-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-osc.html
146 lines (126 loc) · 4.56 KB
/
test-osc.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
<!DOCTYPE HTML>
<html>
<head>
<title>Oscilloscope + functiongenerator test</title>
<meta name="viewport" content="initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<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;
height: 30px;
bottom: 0;
right: 0;
}
</style>
<script type="text/javascript" src="jquery-2.1.3.min.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-updownbutton.js"></script>
<script type="text/javascript" src="instruments/transport.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>
function ExtServices()
{
return {
MakeRequest: function() {}
, NotifyMe: function() {}
}
}
function init()
{
function MakeMeasurement()
{
transport.Request(circuit
+ osc.WriteRequest()
+ hp_func.WriteRequest()
,
function(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 circuit = '<circuit><circuitlist>VFGENA_X A 0\nR_X A B 10k\nPROBE1_1 A\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.134.182:8080/measureserver", "fnord");
var hp_func = new visir.HPFunctionGenerator(1, $("#hp_funcgen"));
var osc = new visir.AgilentOscilloscope(1, $("#oscilloscope"), { MeasureCalling: MakeMeasurement, CheckToContinueCalling: function() { return true; } });
$(".measure").click( function() {
MakeMeasurement();
/*transport.Request(circuit
+ osc.WriteRequest()
+ hp_func.WriteRequest()
,
function(res) {
osc.ReadResponse(res);
});
*/
});
$("#showlog").click( function() {
$("#logwindow").css("display", "block");
});
$("#hidelog").click( function() {
$("#logwindow").css("display", "none");
});
}
$( function() { init(); });
</script>
</head>
<body>
<button class="measure">Measure</button>
<br/>
<div id="oscilloscope"></div>
<div id="dmm"></div>
<div id="dmm2"></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>