Skip to content

Commit c53edaa

Browse files
Merge pull request #7 from virtual-labs/testing
Testing merge to main
2 parents b6bf2b6 + e319ebd commit c53edaa

File tree

11 files changed

+8673
-122
lines changed

11 files changed

+8673
-122
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

experiment-descriptor.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"unit-type": "lu",
33
"label": "",
44
"basedir": ".",
5+
"services": ["VLAB_SVC_OCTAVE_ANN"],
56
"units": [
67
{
78
"unit-type": "aim"
@@ -13,7 +14,7 @@
1314
"unit-type": "task",
1415
"content-type": "text"
1516
},
16-
17+
1718
{
1819
"target": "procedure.html",
1920
"source": "procedure.md",
@@ -28,7 +29,7 @@
2829
"unit-type": "task",
2930
"content-type": "simulation"
3031
},
31-
{
32+
{
3233
"target": "observations.html",
3334
"source": "observations.md",
3435
"label": "Observations",
@@ -42,7 +43,7 @@
4243
"unit-type": "task",
4344
"content-type": "text"
4445
},
45-
46+
4647
{
4748
"target": "references.html",
4849
"source": "references.md",

experiment/simulation/css/main.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
/* You CSS goes in here */
1+
#heading {
2+
text-align: center;
3+
font-family: 'Roboto Slab', serif;
4+
}

experiment/simulation/exp.css

Lines changed: 0 additions & 4 deletions
This file was deleted.

experiment/simulation/exp.html

Lines changed: 0 additions & 68 deletions
This file was deleted.

experiment/simulation/exp.js

Lines changed: 0 additions & 34 deletions
This file was deleted.

experiment/simulation/index.html

100644100755
Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,79 @@
11
<!DOCTYPE html>
2-
<html>
2+
<html lang="en">
3+
34
<head>
4-
<!-- Add CSS at the head of HTML file -->
5+
<meta charset="UTF-8">
6+
<title>CLNN</title>
57
<link rel="stylesheet" href="./css/main.css">
68
</head>
9+
710
<body>
8-
<!-- Your code goes here-->
11+
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
12+
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous" />
13+
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
14+
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
15+
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
16+
crossorigin="anonymous"></script>
17+
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
18+
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
19+
crossorigin="anonymous"></script>
20+
<div class="container-fluid p-4">
21+
<div class="row no-gutters">
22+
<div class="col">
23+
24+
<form name="myform" method="post">
25+
<div class="form-group">
26+
27+
<label>
28+
Type of mapping
29+
<select name="mapping" class="custom-select">
30+
</select>
31+
</label>
32+
33+
<label>
34+
Region
35+
<select name="region" class="custom-select">
36+
</select>
37+
</label>
38+
</div>
39+
40+
<div class="form-group">
941

10-
<!-- Add JS at the bottom of HTML file -->
11-
<iframe src="exp.html" width="1200" height="1000"></iframe>
12-
<script src="./js/main.js"></script>
42+
<label>
43+
Number of data points
44+
<select name="numDataPoints" class="custom-select">
45+
</select>
46+
</label>
47+
48+
<label>
49+
Number of iterations
50+
<select name="numIterations" class="custom-select">
51+
</select>
52+
</label>
53+
54+
<label>Iteration step size: <input class="form-control" type="text" name=NIstep></label>
55+
</div>
56+
57+
<div class="form-group">
58+
<button class="btn btn-primary" type="submit" name="generateData" value="Generate data"
59+
onclick="jssetgenflag();">Generate data
60+
</button>
61+
<button class="btn btn-primary" type="submit" name="nextIteration" value="Next iteration"
62+
onclick="jssetiternflag();">Next
63+
iteration
64+
</button>
65+
</div>
66+
67+
<input type=hidden name=genflag value=0>
68+
<input type=hidden name=iternflag value=0>
69+
</form>
70+
</div>
71+
<div class="col image-container">
72+
</div>
73+
</div>
74+
</div>
75+
<script src="./js/utils.js"></script>
76+
<script src="./js/main.js"></script>
1377
</body>
14-
</html>
78+
79+
</html>

experiment/simulation/js/main.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,34 @@
1-
//Your JavaScript goes in here
1+
window.EXP_NAME = "clnn";
2+
const map_arr = {1: "2D-2D"};
3+
const region_arr = {1: "Square", 2: "Circle", 3: "Triangle"};
4+
const numDataPoints_arr = {100: "100", 300: "300", 1000: "1000"};
5+
const numIterations_arr = {20: "20", 50: "50", 100: "100"};
6+
7+
const typeOfMapping = 1;
8+
const regionType = 1;
9+
const numIterations = 20;
10+
const numDataPoints = 100;
11+
const NIstep = 1;
12+
13+
let isSetGen = true;
14+
15+
function jssetgenflag() {
16+
isSetGen = true;
17+
}
18+
19+
function jssetiternflag() {
20+
isSetGen = false;
21+
}
22+
23+
window.extraArgs = function () {
24+
return {type: isSetGen ? "1" : "0", inputDim: "2"};
25+
};
26+
window.appenditure = {
27+
"mapping": map_arr,
28+
"region": region_arr,
29+
"numDataPoints": numDataPoints_arr,
30+
"numIterations": numIterations_arr
31+
};
32+
33+
34+
window.otherSetters = {NIstep};

experiment/simulation/js/utils.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
window.SERVER =
2-
"svc-test.vlabs.ac.in/octave-ann";
1+
// window.SERVER =
2+
// "svc-test.vlabs.ac.in/octave-ann";
33

44
function submitForm() {
5+
const SERVER = window.vlabsConfig.service["VLAB_SVC_OCTAVE_ANN"];
56
const $form = $('form[name="myform"]');
67

78
let args = $form.serializeArray().reduce((prev, cur) => {
@@ -11,7 +12,7 @@ function submitForm() {
1112
if (window.extraArgs) args = { ...args, ...window.extraArgs() };
1213

1314
$.ajax({
14-
url: SERVER + "/exp-" + window.EXP_NAME,
15+
url: SERVER.url + "/exp-" + window.EXP_NAME,
1516
type: "POST",
1617
headers: {
1718
token: localStorage.getItem("token"),
@@ -71,10 +72,11 @@ function appendOptions(elm, list) {
7172
}
7273

7374
function onload() {
75+
const SERVER = window.vlabsConfig.service["VLAB_SVC_OCTAVE_ANN"];
7476
if (document.readyState === "complete") {
7577
if (!localStorage.getItem("token")) {
7678
$.get(
77-
`${SERVER}/get_token`,
79+
`${SERVER.url}/get_token`,
7880
(success = function (data) {
7981
localStorage.setItem("token", data);
8082
})

0 commit comments

Comments
 (0)