-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-all.html
157 lines (134 loc) · 5.16 KB
/
test-all.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
<!DOCTYPE HTML>
<html>
<head>
<title>VISIR HTML5 Test</title>
<meta name="viewport" content="initial-scale=1.0" />
<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" />
<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;
height: 30px;
bottom: 0;
right: 0;
}
</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="utils.js"></script>
<script type="text/javascript" src="jquery-turnable.js"></script>
<script type="text/javascript" src="jquery-draggable.js"></script>
<script type="text/javascript" src="jquery-updownbutton.js"></script>
<script type="text/javascript" src="instruments/transport.js"></script>
<script type="text/javascript" src="instruments/breadboard/breadboard.js"></script>
<script type="text/javascript" src="instruments/multimeter.js"></script>
<script type="text/javascript" src="instruments/flukemultimeter/flukemultimeter.js"></script>
<script type="text/javascript" src="instruments/dcpower.js"></script>
<script type="text/javascript" src="instruments/tripledc/tripledc.js"></script>
<script type="text/javascript" src="instruments/functiongenerator.js"></script>
<script type="text/javascript" src="instruments/hp_funcgen/hp_funcgen.js"></script>
<script type="text/javascript" src="instruments/oscilloscope.js"></script>
<script type="text/javascript" src="instruments/ag_oscilloscope/ag_oscilloscope.js"></script>
<script>
// var useLabsLandUI = true;
var useLabsLandUI = false;
function init()
{
visir.Config.Set("llUi", useLabsLandUI);
function MakeMeasurement()
{
transport.Request(breadboard.WriteRequest()
+ flukedmm.WriteRequest()
+ flukedmm2.WriteRequest()
+ tripledc.WriteRequest()
+ osc.WriteRequest()
+ hp_func.WriteRequest()
,
function(res) {
flukedmm.ReadResponse(res);
flukedmm2.ReadResponse(res);
osc.ReadResponse(res);
});
}
//var circuit = '<circuit><circuitlist>W_X A23 DMM_VHI\nW_X F23 DMM_VLO\nR_X A23 F23 10k\nDMM_2 AA BB\nR_X AA BB 1k\n</circuitlist></circuit>';
var circuit = '<circuit><circuitlist>W_X A23 DMM_VHI\nW_X F23 DMM_VLO\nR_X A23 F23 10k\nVDC+6V AA\nDMM_2 AA 0\n</circuitlist></circuit>';
var instrxml = '<multimeter id="1"><dmm_function value="ac current"/><dmm_resolution value="3.5"/><dmm_range value="10"/></multimeter><multimeter id="2"><dmm_function value="dc volts"/><dmm_resolution value="3.5"/><dmm_range value="10"/></multimeter>';
var dcpower = '<dcpower><dc_outputs><dc_output channel="6V+"><dc_voltage value="5"/><dc_current value="0.5"/></dc_output><dc_output channel="25V+"><dc_voltage value="0"/><dc_current value="0.5"/></dc_output><dc_output channel="25V-"><dc_voltage value="0"/><dc_current value="0.5"/></dc_output></dc_outputs></dcpower>';
trace("starting up..");
var transport = new visir.JSTransport(visir.SetWorking);
transport.onerror = function(err) { alert("Error: " + err); }
transport.Connect("http://194.47.149.107:8080/measureserver", "fnord");
var breadboard = new visir.Breadboard(1, $("#breadboard"));
var flukedmm = new visir.FlukeMultimeter(1, $("#dmm"));
var flukedmm2 = new visir.FlukeMultimeter(2, $("#dmm2"));
var osc = new visir.AgilentOscilloscope(1, $("#oscilloscope"), { MeasureCalling: MakeMeasurement, CheckToContinueCalling: function() { return true; } });
var tripledc = new visir.TripleDC(1, $("#tripledc"));
var hp_func = new visir.HPFunctionGenerator(1, $("#hp_funcgen"));
$(".measure").click( function() {
/*transport.Request(breadboard.WriteRequest()
+ flukedmm.WriteRequest()
+ flukedmm2.WriteRequest()
+ tripledc.WriteRequest(),
function(res) {
flukedmm.ReadResponse(res);
flukedmm2.ReadResponse(res);
});*/
MakeMeasurement();
});
$("#showlog").click( function() {
$("#logwindow").css("display", "block");
});
$("#hidelog").click( function() {
$("#logwindow").css("display", "none");
});
}
$( function() { visir.Load(init, undefined, undefined, undefined, useLabsLandUI); });
</script>
</head>
<body>
<button class="measure">Measure</button>
<br/>
<div id="breadboard"></div>
<div id="dmm"></div>
<div id="dmm2"></div>
<div id="oscilloscope"></div>
<div id="hp_funcgen"></div>
<div id="tripledc"></div>
<div id="hp_funcgen"></div>
<div id="bottom">
<button class="measure">Measure</button>
</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>
</body>
</html>