-
Notifications
You must be signed in to change notification settings - Fork 4
/
OpenSignals.html
329 lines (313 loc) · 17 KB
/
OpenSignals.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>OpenSignals</title>
<script language="javascript" type="text/javascript" src="flot/jquery.js"></script>
<script language="javascript" type="text/javascript" src="flot/jquery.flot.js"></script>
<script language="javascript" type="text/javascript" src="flot/jquery.flot.selection.js"></script>
<script language="javascript" type="text/javascript" src="flot/jquery.flot.navigate.js"></script>
<script language="javascript" type="text/javascript" src="flot/jquery.flot.crosshair.js"></script>
<link href="OpenSignals.css" rel="stylesheet" type="text/css">
<link href="animate.css" rel="stylesheet" type="text/css">
<script language="javascript" type="text/javascript" src="OpenSignals.js"></script>
<script type="text/javascript">
var ws = new WebSocket("ws://localhost:9001 ");
var options = {
xaxis: { show:false,color: 'grey',tickColor:"#C2C2C2",tickSize:50},
yaxis: {show:true,color: 'grey',tickColor:"#C2C2C2",min:0,max:1024},
series: {
lines: { show: true, lineWidth: 1.2 },
points: { show: false,fill:false,radius:0.5 },
shadowSize: 0
},
grid: {backgroundColor: "transparent",borderColor:"#C2C2C2",borderWidth:1 }
};
var optOverview = {
series: {
lines: { show: true, lineWidth: 1.2 ,tickColor:"#571F8B"},
points: { show: false },
shadowSize: 0,
},
selection: { mode: "x"},
legend:false,
xaxis: {show:false,color:"grey",tickColor:"#C2C2C2"},
yaxis: {show:false,min:0,max:1026},
grid: {backgroundColor: "transparent" ,borderColor:"#C2C2C2",borderWidth:0.5}
};
var dataGeral;
var Samples
Samples = 0
var AxisShow = false
var AcqShoworHide = true;
ws.onopen = function() {
};
ws.onmessage = function (e) {
eval(e.data);
};
var TimeProfile = new Array()
tIndex = 0
ws.data = function (msg) {
if (AcqShoworHide){
play = false;
ws.send("digitalOutputs("+JSON.stringify(digitalOut)+")")
BeginApp = false
$("#stopArrow").show();
AcqShoworHide = false;
//startTimer()
$("#load").fadeOut(100)
tIndex = 0
Samples = 0
}
Samples += nSamples
tick(Samples/samplingRate)
dataGeral = msg;
dataOverview =[]
for (var i in dataGeral) {
if (i.indexOf('Analog') != -1) {
$.plot($("#placeholder"+i),[{data:msg[i],color:ListColors[i.slice(-1)]}],$.extend(true, {}, options, {yaxis:{min:MinOffset[i.slice(-1)],max:MaxOffset[i.slice(-1)]}}));
dataOverview.push({data:msg['overview'][i],color:ListColors[i.slice(-1)]});
} else if(i.indexOf('Digital') != -1) {
if (msg[i] == 1) {
$("#DI"+i.slice(-1)).attr('src','Img/new/botao_azul.png')
} else {
$("#DI"+i.slice(-1)).attr('src','Img/new/botao.png')
}
}
}
overviewPlot = $.plot($("#overview"), dataOverview, $.extend(true, {},optOverview,{grid:{markings:[{lineWidth: 1,color:'lightGrey',xaxis:{from:xmin,to:xmax}}]}}))
};
window.onbeforeunload = function() {
ws.onclose = function () {}; // disable onclose handler first
ws.close()
};
</script>
</head>
<body>
<div class="overlay" style="display:none"></div>
<div id="page" >
<div id="PageTitle" style="position:relative;text-align:center;z-index:50;margin:0 auto;width:33%;">
<img id="MenuLogo" src="Img/logo.png" height="9%" style="margin-top:27px;display:none"/>
</div>
<div id="load" style="display:none;position: absolute;margin: 0 auto;width: 20px;height:20px;background-image:url(Img/new/load.gif);background-size: 15px 15px;background-repeat: no-repeat;background-position: center;top: 6.5%;left: 60.5%;">
</div>
<div id="Loading"></div>
<div id="stopArrow" style="position:fixed;width:100%;height:30px;top:8.5%;display:none">
<div id="stopArrow" style="position: fixed; width: 20%; height: 30px; top: 5.5%;left: 54%;">
<div style="position:relative;margin:0 auto;width:200px;height:100%">
<table align="center"><tbody><tr>
<td><img src="Img/new/arrowCurve1.png" height="25px" style=""></td>
<td><p style="margin:0;width:62px;text-align:center"> Stop here </p></td>
</tr></tbody></table>
</div>
</div>
</div>
<div id="WelcomePage"></div>
<div id="MainWelcome">
<div id="boxToFlip" class="boxFlip" style="display:none" >
<div id="exit" style="position:absolute;top:163px;left:52px;z-index:9999;" onClick="exit()">
<img id="exitImage" title="Exit" src="Img/new/on.png" height="70px"/>
</div>
<div style="position:absolute;width:100%;height:100%;text-align:center">
<div style="height:16%"></div>
<div id = "playImageSmall" >
<img id="record" src="Img/new/record_azul.png" title="Record" style="height: 151px;position:absolute;bottom: 174px;right: 164px;z-index:61"/>
<img id="save" src="Img/new/save_1.png" title="Save record" style="height: 77px;position:absolute;bottom: 134px;right: 79px;z-index:61"/>
<img id="config" src="Img/new/settings_1.png" title="Configurations" onClick="configurations()" style="height: 65px;position:absolute;bottom: 83px;right: 163px;z-index:61"/>
<div id="colorCircle" style="display:none;"></div>
<div id="colorCircleSmall" ></div>
</div>
<div style="background-image:url(Img/logosJuntos.png);height: 60px;background-repeat:no-repeat;background-position:center;background-size: 210px 51px;position:relative;top:30px;opacity:0.7;"></div>
</div>
</div>
</div>
<div id="containOverview" style="z-index:0;position:absolute;bottom:0px;right:0%;width:100%;height:17%;padding-top:3px;border-top:0px solid rgb(83, 83, 83);background:transparent;padding-top">
<div style="position:absolute;right:1%;top:6px">
<table><tr>
<td><p style="margin:0">Time scale: </p></td>
<td><p style="margin:0" id="timeScale">10s</p></td>
</tr></table>
</div>
<div style="position:absolute;left:1.5%;top:6px">
<p id="ELAPSED" style="margin:0;text-align:left;"></p>
</div>
<table id="containTO" width="100%" height="100%" cellspacing="0" cellpadding="0" align="center">
<tr>
<td id="boxOContent" align="center" style="vertical-align:middle;height:28px">
</td>
</tr>
<tr>
<td id="overviewColumn" align="center" valign="middle" width="100%">
<div id="overview" style="height:90%;width:98%;"></div>
</td>
</tr>
</table>
</div>
<div id="containGraphics">
<table id="containTable" align="center" width="100%" height="100%" cellspacing="0" cellpadding="0" style="margin:0;border-collapse:collapse;"></table>
</div>
<div id="digital" style="z-index:9">
<table align="center" height="100%" width="40%">
<tr>
<td align="center">
<img id="DI0" src="Img/new/botao.png" height="15%"/>
</td>
<td align="center">
<img id="DI1" src="Img/new/botao.png" height="15%"/>
</td>
<td align="center">
<img id="DI2" src="Img/new/botao.png" height="15%"/>
</td>
<td align="center">
<img id="DI3" src="Img/new/botao.png" height="15%"/>
</td>
<td align="center" style="width:30%">
<p style="margin:0;color:white;font-size:80%;text-align:center;font-family:arial">Digital Input</p>
</td>
<td align="center" style="border-left:1px solid white;width:30%">
<p style="margin:0;color:white;font-size:80%;text-align:center;font-family:arial">Digital Output</p>
</td>
<td align="center">
<img id="DO0" src="Img/new/botao.png" style="cursor:pointer" onClick="digitalOutputs(0)" height="15%"/>
</td>
<td align="center">
<img id="DO1" src="Img/new/botao.png" style="cursor:pointer" onClick="digitalOutputs(1)" height="15%"/>
</td>
<td align="center">
<img id="DO2" src="Img/new/botao.png" style="cursor:pointer" onClick="digitalOutputs(2)" height="15%"/>
</td>
<td align="center">
<img id="DO3" src="Img/new/botao.png" style="cursor:pointer" onClick="digitalOutputs(3)" height="15%"/>
</td>
</tr>
</table>
</div>
<div style="position:absolute;width:100%;height:100%;top:0px;left:0px;">
<div id="FileExplorer" style="display:none" >
<div style="width:305px;margin:0 auto;height:92px;background-image:url(Img/new/file_explorer.png);background-repeat:no-repeat;background-size:100% 100%;position:relative;top:8%"></div>
<div style="width:80%;margin:0 auto;height:4%;position:relative;top:9%">
<p style="margin:0 0 5px 0px;text-align:center">SAVE AS</p>
<input id="fileName" type="text" name="fileName" class="gradient"/>
<select id="fileFormat" style="border:1px solid lightgrey;height:100%;width:19%">
<option id="txt">txt</option>
<option id="hdf5">hdf5</option>
</select>
<hr style="height: 12px;background: transparent;border: transparent;margin: 0;"/>
<input id="pathName" onkeypress="checkKey()" type="text" class="gradient" />
</div>
<div id="FilesandFolders" class="gradient"></div>
<div id="symbols" style="width: 50%;margin: 0 auto;margin-top: 2%;text-align: center;z-index: 5;position: relative;top: 25%;">
<img id="ConfirmCheck" src="Img/new/certo_cinza.png" width="50px" height="50px" style="margin-right:5%" />
<img id="cancel" src="Img/new/errado_cinza.png" width="50px" height="50px" style="margin-right:5%"/>
<img id="goBack" src="Img/backF.png" width="50px" height="50px" style="display:none"/>
</div>
</div>
<div id="popMessage" style="display:none;position:relative;top:-27px;width: 460px;text-align: center;margin: 0 auto;color: red;font-weight: bold;z-index:51"><p style="margin-top:2px">PLEASE INSERT FILE NAME</p></div>
<div id="popMessageSaving" style="display:none;position:absolute;top:670px;width: 100%;text-align: center;margin: 0 auto;color: red;font-weight: bold;z-index:51"><p style="margin-top:2px">SAVING...</p></div>
</div>
<div style="position:absolute;width:100%;height:100%;top:0px;left:0px;">
<div id="configurations" style="display:none">
<div style="width:305px;margin:0 auto;height:92px;background-image:url(Img/new/configurations.png);background-repeat:no-repeat;background-size:100% 100%;position:relative;top:12%"></div>
<div id="contentConfig" style="overflow-y: auto;position: relative;top:14%;width: 60%;height: 55%;margin:0 auto;text-align:center">
<table align="center" width="75%">
<tr>
<td style="text-align:right">
<label for="Device" style="margin-right: 5px;font-family:arial;font-weight:bold">Device:</label>
</td>
<td>
<input id="Device" onchange="" style="border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:4px;height:22px;" name="Device" type="text" value=""/>
</td>
<td id="searchConfig" onclick="DevicesPage()" class="buttonGradient" style="border:1px solid lightGrey;border-radius:5px">
<img src="Img/new/searchConfig.png" height="20px" width="18px" style="margin:2px"/>
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="MacAdd" style="margin-right: 5px;font-family:arial;font-weight:bold;">MAC:</label>
</td>
<td>
<input id="MacAdd" style="border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:4px;height:22px;" name="MacAdd" type="text" value=""/>
</td>
</tr>
</table>
<hr style="margin-bottom:25px;margin-top:20px">
<h3 style="margin-top:0;margin-bottom:18px;font-family:arial;font-size:15px">Analog Channels:</h3>
<input type="checkbox" id="A0" class="mycheckbox" onclick="changeCheckboxStyle('A0')"/><label for="A0" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A0t" type="text" value="" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px" />
<select id="unit0">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<input type="checkbox" id="A1" class="mycheckbox" onclick="changeCheckboxStyle('A1')"/><label for="A1" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A1t" type="text" value="" for="A1" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px"/>
<select id="unit1">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<input type="checkbox" id="A2" class="mycheckbox" onclick="changeCheckboxStyle('A2')"/><label for="A2" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A2t" type="text" value="" for="A2" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px"/>
<select id="unit2">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<input type="checkbox" id="A3" class="mycheckbox" onclick="changeCheckboxStyle('A3')"/><label for="A3" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A3t" type="text" value="" for="A3" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px"/>
<select id="unit3">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<input type="checkbox" id="A4" class="mycheckbox" onclick="changeCheckboxStyle('A4')"/><label for="A4" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A4t" type="text" value="" for="A4" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px"/>
<select id="unit4">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<input type="checkbox" id="A5" class="mycheckbox" onclick="changeCheckboxStyle('A5')"/><label for="A5" class="mycheckbox-label" style="display:inline-block;margin-bottom:0px; margin-right:3px;background:transparent no-repeat left bottom;border:1px solid grey;"></label><input id="A5t" type="text" value="" for="A5" style="width:25%;border-radius:3px;border:1px solid lightGrey;box-shadow:0px 3px 8px #E9E9E9;text-indent:2px"/>
<select id="unit5">
<option value="None">None</option>
<option value="V">V</option>
<option value="mV">mV</option>
<option value="uS">uS</option>
<option value="G">G</option>
<option value="lx">lx</option>
</select></br>
<h3 style="font-family:arial;font-size:15px">Sampling Rate:</h3>
<select id="samplingRate">
<option value="1000">1000</option>
<option value="100">100</option>
<option value="10">10</option>
<option value="1">1</option>
</select>
</div>
<img id="saveConfig" src="Img/new/certo_cinza.png" width="50px" height="50px" style="position:absolute;bottom:7%;left:37%;"/>
<img id="cancelConfig" src="Img/new/errado_cinza.png" width="50px" height="50px" style="position:absolute;bottom:7%;right:37%"/>
</div>
<div id="configurationsDevices" style="display:none">
<div style="width:305px;margin:0 auto;height:92px;background-image:url(Img/new/configurations.png);background-repeat:no-repeat;background-size:100% 100%;position:relative;top:12%"></div>
<div id="contentConfig" style="overflow-y: auto;overflow-x:hidden;position: relative;top:16%;width: 60%;height: 51%;margin:0 auto;text-align:center">
<h4 id="SearchNewDevices" style="text-align:left;font-family:arial;" onclick="ws.send('search()');$('#loadDevices').show();$('#SearchNewDevices').text('Searching...')"></h4>
<div id="loadDevices" style="display:none;width: 20px;height:20px;background-image:url(Img/new/load.gif);background-size: 15px 15px;background-repeat: no-repeat;background-position: center;position:absolute;top:21px;right:75px;"></div>
<table id="newDevices" align="center" width="100%" >
</table>
<table id="oldDevices" align="center" width="100%" style="border-top:5px solid #71a9ab">
</table>
</div>
<img id="BackDevices" src="Img/backF.png" onclick="$('#configurationsDevices').hide();$('#configurations').show();$('#newDevices').empty()" width="50px" height="50px" style="display:none;position:absolute;bottom:9%;left:45%;" />
</div>
</body>
</html>