-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-container.html
75 lines (64 loc) · 4.55 KB
/
test-container.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE HTML>
<html>
<head>
<title>VISIR HTML5 Test</title>
<link rel="stylesheet" href="instrumentframe/instrumentframe.css" />
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="visir.js"></script>
<script>
function init()
{
function MakeMeasurement()
{
reg.MakeRequest(transport);
}
trace("starting up..");
var transport = new visir.JSTransport(visir.SetWorking);
transport.onerror = function(err) { alert("Error: " + err); }
transport.Connect(visir.Config.Get("mesServer"), "fnord");
var extservice = new visir.ExtServices({ MakeMeasurement: MakeMeasurement });
var reg = new visir.InstrumentRegistry(extservice);
var frame = new visir.InstrumentFrame(reg, transport, $("#instrumentframe"));
var savedexperiment_1 = '<save><instruments list="breadboard/breadboard.swf|multimeter/multimeter.swf|functiongenerator/functiongenerator.swf|oscilloscope/oscilloscope.swf|tripledc/tripledc.swf" /><multimeter /><circuit><circuitlist><component>W 0 312 312 235 336 156 364</component><component>W 0 403 325 357.5 309.8 312 325</component><component>W 0 481 312 442 299 403 312</component><component>W 16711680 403 234 442 221 481 234</component><component>W 16711680 312 221 357.5 205.8 403 221</component><component>W 16711680 156 260 229.65 221 312 234</component><component>R 1k 312 273 1</component><component>R 1k 65 52 0</component><component>R 1k 65 39 0</component><component>R 1k 65 78 0</component><component>R 1k 65 65 0</component><component>R 1.6k 481 273 1</component><component>R 10k 260 78 0</component><component>R 10k 403 273 1</component><component>R 10k 260 52 0</component><component>R 10k 260 39 0</component><component>R 10k 260 65 0</component><component>R 2.7k 195 26 0</component><component>R 2.7k 195 52 0</component><component>R 2.7k 195 39 0</component><component>C 56n 312 39 0</component><component>C 56n 312 91 0</component></circuitlist></circuit></save>';
savedexperiment_2 = '<save version="2"><instruments htmlinstruments="Breadboard|FlukeMultimeter|HPFunctionGenerator|AgilentOscilloscope|TripleDC"></instruments><circuit><circuitlist><component>W 0 312 312 235 336 156 364</component><component>W 0 403 325 357 309 312 325</component><component>W 0 481 312 442 299 403 312</component><component>W 16711680 403 234 442 221 481 234</component><component>W 16711680 312 221 357 205 403 221</component><component>W 16711680 156 260 229 221 312 234</component><component>R 1k 312 273 1</component><component>R 1k 65 52 0</component><component>R 1k 65 39 0</component><component>R 1k 65 78 0</component><component>R 1k 65 65 0</component><component>R 1.6k 481 273 1</component><component>R 10k 260 78 0</component><component>R 10k 403 273 1</component><component>R 10k 260 52 0</component><component>R 10k 260 39 0</component><component>R 10k 260 65 0</component><component>R 2.7k 195 26 0</component><component>R 2.7k 195 52 0</component><component>R 2.7k 195 39 0</component><component>C 56n 312 39 0</component><component>C 56n 559 221 0</component></circuitlist></circuit></save>';
emptyexperiment = '<save version="2"><instruments htmlinstruments="Breadboard|FlukeMultimeter|HPFunctionGenerator|AgilentOscilloscope|TripleDC"></instruments><circuit></circuit></save>';
reg.LoadExperiment(emptyexperiment, frame.GetInstrumentContainer());
$(".measure").click( function() {
MakeMeasurement();
});
$("#showlog").click( function() {
$("#logwindow").css("display", "block");
});
$("#hidelog").click( function() {
$("#logwindow").css("display", "none");
});
$("#load_experiment_1").click( function () {
reg.LoadExperiment(savedexperiment_1, frame.GetInstrumentContainer());
});
$("#load_experiment_2").click( function () {
reg.LoadExperiment(savedexperiment_2, frame.GetInstrumentContainer());
});
}
$( function() { visir.Load(init); });
</script>
</head>
<body>
<!--[if lt IE 9]><p style="font-weight: bold; color: #CC2222">This experiment is not supported in your current browser. We strongly recommend you to update it or to get a new browser, such as <a href="http://chrome.google.com/" alt="Download Google Chrome">Google Chrome</a></p><![endif]-->
<div id="instrumentframe"></div>
<br/>
<br/>
<div>
<a href="#" id="load_experiment_1">Test 1</a>
<br/>
<a href="#" id="load_experiment_2">Test 2</a>
</div>
<div>
Log window:
<button id="showlog">Show</button>
<button id="hidelog">Hide</button>
</div>
<div id="logwindow" style="border: 1px solid #000000; padding: 2px; height: 500px; width: 800px; overflow: scroll; display:none"></div>
<br/>
<br/>
</body>
</html>