forked from JohanZackrisson/visir_html5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-reg.html
202 lines (177 loc) · 6.11 KB
/
test-reg.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!DOCTYPE HTML>
<html>
<head>
<title>VISIR HTML5 Test</title>
<!--meta name="viewport" content="initial-scale=1.0, minimum-scale=1, maximum-scale=2" /-->
<!--meta name="viewport" content="width=1020px, initial-scale=1, maximum-scale=3" /-->
<!--link rel="stylesheet" href="instruments/breadboard/breadboard.css" />
<link rel="stylesheet" href="instruments/flukemultimeter/flukemultimeter.css" />
<link rel="stylesheet" href="instruments/tripledc/tripledc.css" />
<link rel="stylesheet" href="instruments/hp_funcgen/hp_funcgen.css" />
<link rel="stylesheet" href="instruments/ag_oscilloscope/ag_oscilloscope.css" /-->
<style>
#dmm , #dmm2 {
display: inline-block;
}
#turn {
width: 188px; height: 188px;
}
#turn .top
{
transform-origin: 94px 94px;
-moz-transform-origin: 94px 94px;
-webkit-transform-origin: 94px 94px;
width: 188px; height: 188px;
}
#turn2
{
height: 94px;
width: 94px;
}
#turn2 .top
{
height: 94px;
width: 94px;
}
#bottom
{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background: white;
}
#container
{
width: 800px;
/*height: 500px;*/
height: 460px;
border: 1px solid black;
position: relative;
text-align: center;
overflow: hidden;
}
#container > div
{
margin: 0px auto;
position: relative;
display: inline-block;
}
.buttonrow {
padding: 1px;
position: relative;
width: 800px;
text-align: center;
background: #999999;
}
.buttonrow button
{
font-size: 11px;
font-family: sans-serif;
margin: 4px;
height: 40px;
border-radius: 4px;
border-width: 1px;
border-color: rgb(192, 192, 192);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e0e0e0), color-stop(100%,#afafaf));
background: -moz-linear-gradient(top, #e0e0e0 0%, #afafaf 100%);
width: 80px;
vertical-align: top;
-webkit-user-select: none;
}
.instrumentbuttons {
display: inline-block;
position: relative;
left: 40px;
}
#measurebutton {
width: 90px;
float: right;
margin-right: 20px;
}
</style>
<script type="text/javascript" src="jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="visir.js"></script>
<script type="text/javascript" src="instrumentregistry.js"></script>
<script>
function init()
{
function MakeMeasurement()
{
reg.MakeRequest(transport);
}
function ShowInstr(name) {
$("#container > div").hide();
$(name).show();
}
trace("starting up..");
var transport = new visir.JSTransport(visir.SetWorking);
transport.onerror = function(err) { alert("Error: " + err); }
transport.Connect("http://194.47.134.182:8080/measureserver", "fnord");
var reg = new visir.InstrumentRegistry();
reg.CreateInstrument("Breadboard", "#circuit1");
reg.CreateInstrument("FlukeMultimeter", "#multimeter1");
reg.CreateInstrument("FlukeMultimeter", "#multimeter2");
reg.CreateInstrument("AgilentOscilloscope", "#oscilloscope1", { MeasureCalling: MakeMeasurement, CheckToContinueCalling: function() { return true; } });
reg.CreateInstrument("TripleDC", "#dcpower1");
reg.CreateInstrument("HPFunctionGenerator", "#functiongenerator1");
var savedexperiment = '<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>';
//reg.LoadExperiment(savedexperiment, $("#container"));
$(".measure").click( function() {
MakeMeasurement();
});
$("#showlog").click( function() {
$("#logwindow").css("display", "block");
});
$("#hidelog").click( function() {
$("#logwindow").css("display", "none");
});
ShowInstr("#circuit1");
$("#goto_breadboard").click(function() { ShowInstr("#circuit1"); });
$("#goto_dmm").click(function() { ShowInstr("#multimeter1"); });
$("#goto_dmm2").click(function() { ShowInstr("#multimeter2"); });
$("#goto_oscilloscope").click(function() { ShowInstr("#oscilloscope1"); });
$("#goto_fgen").click(function() { ShowInstr("#functiongenerator1"); });
$("#goto_tripledc").click(function() { ShowInstr("#dcpower1"); });
}
$( function() {
//init();
visir.Load(init);
});
function scrollTo(hash) {
location.hash = "#" + hash;
}
</script>
</head>
<body>
<div id="container">
<div id="circuit1"></div>
<div id="multimeter1"></div>
<div id="multimeter2"></div>
<div id="oscilloscope1"></div>
<div id="functiongenerator1"></div>
<div id="dcpower1"></div>
</div>
<div class="buttonrow">
<div class="instrumentbuttons">
<button id="goto_breadboard">Breadboard</button>
<button id="goto_dmm">Multimeter</button>
<button id="goto_dmm2">Multimeter 2</button>
<button id="goto_oscilloscope">Oscilloscope</button>
<button id="goto_fgen">Function Generator</button>
<button id="goto_tripledc">Triple DC</button>
</div>
<button id="measurebutton" class="measure">Perform Measurement</button>
</div>
<br/>
<br/>
<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>