-
Notifications
You must be signed in to change notification settings - Fork 5
/
test-dmm.html
executable file
·127 lines (108 loc) · 3.97 KB
/
test-dmm.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
<!DOCTYPE HTML>
<html>
<head>
<title>Multimeter test</title>
<meta name="viewport" content="initial-scale=1.0" />
<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="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>
function init()
{
//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.134.182:8080/measureserver", "fnord");
var flukedmm = new visir.FlukeMultimeter(1, $("#dmm"));
var flukedmm2 = new visir.FlukeMultimeter(2, $("#dmm2"));
/*var dcpower = new visir.DCPower(1);
dcpower.GetChannel("6V+").voltage = 5;
dcpower.WriteRequest();
*/
var tripledc = new visir.TripleDC(1, $("#tripledc"));
var hp_func = new visir.HPFunctionGenerator(1, $("#hp_funcgen"));
$(".measure").click( function() {
transport.Request(circuit
+ flukedmm.WriteRequest()
+ flukedmm2.WriteRequest()
+ tripledc.WriteRequest(),
function(res) {
flukedmm.ReadResponse(res);
flukedmm2.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="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>