-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
388 lines (352 loc) · 18.2 KB
/
index.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
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link href="css/fontawesome/css/all.css" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/main.css">
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/simple-serial.min.js"></script>
<script src="js/chart.min.js"></script>
<script src="js/luxon.min.js"></script>
<script src="js/chartjs-adapter-luxon.js"></script>
<script src="js/chartjs-plugin-streaming.js"></script>
<script src="js/idb-keyval.min.js"></script>
<script src="js/exprEval.bundle.min.js"></script>
<script src="js/jquery-ui.min.js"></script>
<script src="js/cbuffer.js"></script>
<script src="js/main.js"></script>
<title>DAQari - Browser-based Serial-DAQ Solution</title>
<script>
function dontLeave() {
return "Please, don't leave!";
}
</script>
<script id="worker-code" type="dont/run">
setInterval(function() { postMessage(''); }, 1000 / 50);
</script>
</head>
<body onbeforeunload="return dontLeave()">
<div class="w-100 p-2">
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-2">
<h3 class="card-title"><img src="images/logo.svg" style="height: 1.75rem;"></img> DAQari</h3>
<h6 class="card-subtitle mb-2 text-muted">Browser-based data acquisition</h6>
<h6 class="card-subtitle mb-2 text-muted"><i class="far fa-copyright"></i> Nicholas Ravanelli, PhD</h6>
<hr>
<div class="row text-center">
<div class="row mx-auto">
<label for="BaudrateSelect" class="form-label fw-bold">Baud rate:</label>
<input class="form-control" list="BaudrateOptions" id="BaudrateSelect" name="BaudrateSelect">
<datalist id="BaudrateOptions">
<option value="9600">
<option value="14400">
<option value="19200">
<option value="57600">
<option value="115200">
<option value="256000">
</datalist>
</div>
<div class="row mx-auto"><button class="btn btn-success mt-1" id="serialConnect-btn" disabled><i class="fas fa-plug"></i> Connect</button></div>
</div>
</div>
<div class="col-md-6">
<div class="row text-center border rounded">
<div class="w-100 input-group mt-2 mb-2">
<span class="input-group-text" id="configSelect-inputLabel">Select Config</span>
<select class="form-select" id="configSelect">
<option disabled>Create a configuration</option>
</select>
<button class="btn btn-outline-dark" type="button" id="loadConfig-btn">Load Configuration</button>
</div>
<div class="col-md-3 p-0"><button class="btn btn-success m-2" id="SaveConfig-btn" onclick="saveConfigModalshow();"><i class="fas fa-save"></i> Save</button></div>
<div class="col-md-3 p-0"><button class="btn btn-primary m-2" id="DownloadConfig-btn" onclick="downloadConfigModalshow();"><i class="fas fa-download"></i> Download</button></div>
<div class="col-md-3 p-0"><button class="btn btn-secondary m-2" id="uploadConfig-btn" onclick="uploadConfigModalshow();" ><i class="fas fa-upload"></i> Upload</button></div>
<div class="col-md-3 p-0"><button class="btn btn-danger m-2" id="DeleteConfig-btn" onclick="deleteConfigModalshow();" disabled><i class="far fa-trash-alt"></i> Delete</button></div>
</div>
<div id="DAQ-Large" class="row text-center border rounded mt-2">
<div class="col-md-3">
<div class="card w-100 m-2">
<div class="card-body DAQ-large-card connectedSortable" id="LargeDataCard_1">
<div class="card-title text-muted"><i class="far fa-hand-point-up"></i> <br> Drag Channel</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card w-100 m-2">
<div class="card-body DAQ-large-card connectedSortable" id="LargeDataCard_2">
<div class="card-title text-muted"><i class="far fa-hand-point-up"></i> <br> Drag Channel</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card w-100 m-2">
<div class="card-body DAQ-large-card connectedSortable" id="LargeDataCard_3">
<div class="card-title text-muted"><i class="far fa-hand-point-up"></i> <br> Drag Channel</div>
</div>
</div>
</div>
<div class="col-md-3">
<div class="card w-100 m-2">
<div class="card-body DAQ-large-card connectedSortable" id="LargeDataCard_4">
<div class="card-title text-muted"><i class="far fa-hand-point-up"></i> <br> Drag Channel</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-4 ">
<div class="input-group mb-3 mt-2" id="filename-input">
<input type="text" class="form-control form-control-sm" id="file-name-text" placeholder="Create file...">
<span class="input-group-text" id="file-url-icon"><i class="fas fa-file-medical-alt"></i></span>
</div>
<div class="input-group mb-3">
<span class="input-group-text" id="basic-addon1">File Comment:</span>
<input type="text" class="form-control form-control-sm logdata-settings" placeholder="..." id="fileComment-input" data-comment=""></input>
<button class="btn btn-outline-secondary" type="button" id="submitComment-btn">Submit</button>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-check form-switch w-100">
<input class="form-check-input logdata-settings" type="checkbox" id="LogdataSwitch" disabled>
<label class="form-check-label" for="Logdata">Save data</label>
</div>
</div>
<div class="col-md-8">
<div class="input-group mb-3">
<span class="input-group-text">Log every</span>
<input type="number" step="1" class="form-control form-control-sm logdata-settings" style="text-align: right;" value="5000" id="datalogInterval">
<span class="input-group-text" id="msinput-unit">ms</span>
</div>
</div>
</div>
<div class="row p-2">
<div class="col-md-4">
<div><i id="recordCircleIcon" class="fa fa-circle text-muted"></i> <span id="statusText"> Not recording</span></div>
</div>
<div class="col-md-8 text-center h2">
<label id="recordHours">00</label>:<label id="recordMinutes">00</label>:<label id="recordSeconds">00</label>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="DAQ-window-settings" class="mt-2 border rounded">
<button class="btn btn-danger btn-sm m-2" id="addUserChannel-btn" onclick="userChannel_SettingsModal();"><i class="fas fa-plus"></i> Custom Channel</button>
</div>
<div id="DAQ-charts" class="mt-2 connectedSortable border rounded" style="min-height: 10px;">
</div>
</div>
<!-- Modals -->
<div class="modal fade" id="serialChannel_Settings" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="serialChannel-SettingsLabel"></span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form id="serialChannel-Settings-form">
<input type="hidden" id="serialChannel-id" name="serialChannel-id" value="">
<div class="mb-3">
<label for="channelName" class="form-label">Channel Name:</label>
<input type="text" class="form-control" id="serialChannel-Name" placeholder="Humidity" name="serialChannel-Name">
</div>
<label for="low-pc-input" class="form-label">Point Calibration (Low):</label>
<div id="lowpointCalibrateHelp" class="form-text m-0">e.g. 0 V = 0 C</div>
<div class="input-group mb-3">
<input type="number" class="form-control" id="low-pc-input" name="low-pc-input">
<span class="input-group-text"> = </span>
<input type="number" class="form-control" id="low-pc-input-equivalent" name="low-pc-input-equivalent">
</div>
<label for="high-pc-input" class="form-label">Point Calibration (High):</label>
<div id="highpointCalibrateHelp" class="form-text m-0">e.g. 5 V = 5 C</div>
<div class="input-group mb-3">
<input type="number" class="form-control" id="high-pc-input" name="high-pc-input">
<span class="input-group-text"> = </span>
<input type="number" class="form-control" id="high-pc-input-equivalent" name="high-pc-input-equivalent">
</div>
<div class="mb-3">
<label for="channelUnit" class="form-label">Channel Units:</label>
<input type="text" class="form-control" id="channelUnit" placeholder="%RH" name="serialChannel-Unit">
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="transformswitch" name="transform">
<label class="form-check-label" for="transformswitch">Transform & Data Log</label>
</div>
<div class="mb-3">
<label class="form-check-label" for="transformtype">Transformation Type:</label>
<select class="form-select form-select-sm" id="transformtype" name="transformtype">
<option selected value="linear">Linear</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<span class="text-danger" id="serialChannelsetting-submit-error"></span>
<button type="button" class="btn btn-primary" id="serialChannelSettings-submit-btn">Save changes</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="userChannel_Settings" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="userChannel-SettingsLabel"></span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<p><i>Advanced Users Only!</i></p>
<form id="userChannel-Settings-form">
<input type="hidden" id="userChannel-id" name="userChannel-id" value="">
<div class="mb-3">
<label for="userChannel-Name" class="form-label">Channel Name:</label>
<input type="text" class="form-control" id="userChannel-Name" placeholder="Humidity" name="userChannel-Name">
</div>
<div class="mb-3">
<label for="userChannel-Unit" class="form-label">Units:</label>
<input type="text" class="form-control" id="userChannel-Name" placeholder="%" name="userChannel-Unit">
</div>
<div class="mb-3">
<label for="userChannel-equation" class="form-label">Equation:</label>
<div id="EquationHelp" class="form-text m-1"><i class="fas fa-info-circle"></i> Refer to channels in the equation with their primary names, e.g. serialChannel_3, userChannel_2 </div>
<input type="text" class="form-control" id="userChannel-equation-input" placeholder="Humidity" name="userChannel-equation">
<span id="equationError"></span>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="userChannel-LogData" name="userChannel-LogData">
<label class="form-check-label" for="userChannel-LogData">Log Data</label>
</div>
</form>
</div>
<div class="modal-footer">
<span class="text-danger" id="userChannelsetting-submit-error"></span>
<button type="button" class="btn btn-primary" id="userChannelSettings-submit-btn">Save changes</button>
</div>
</div>
</div>
</div>
<!-- SAVE CONFIG MODAL-->
<div class="modal fade" id="saveConfigModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="saveConfigModal_Label">Config Details:</span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<label for="saveConfig-Name-input" class="form-label">Name:</label>
<input type="text" class="form-control" id="saveConfig-Name-input" placeholder="Give me a name (no spaces)" name="saveConfig-Name-input">
</div>
<div class="mb-3">
<label for="saveConfig-CreatedBy-input" class="form-label">Author:</label>
<input type="text" class="form-control" id="saveConfig-CreatedBy-input" placeholder="(optional)" name="author">
</div>
<div class="mb-3">
<label for="saveConfig-Desc-input" class="form-label">Description:</label>
<input type="textarea" class="form-control" id="saveConfig-Desc-input" placeholder="(optional)" name="description">
</div>
</div>
<div class="modal-footer">
<span class="text-danger" id="saveConfigModal-submit-error"></span>
<button type="button" class="btn btn-primary" id="saveConfigModal-submit-btn">Save config</button>
</div>
</div>
</div>
</div>
<!-- Download CONFIG MODAL-->
<div class="modal fade" id="downloadConfigModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="downloadConfigModal_Label">Filename:</span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<input type="text" class="form-control" id="downloadConfig-Name-input" placeholder="Give me a name (no spaces)" name="downloadConfig-Name-input">
<div id="DownloadHelp" class="form-text"></div>
</div>
</div>
<div class="modal-footer">
<span class="text-danger" id="downloadConfigModal-submit-error"></span>
<button type="button" class="btn btn-primary" id="downloadConfigModal-submit-btn">Download</button>
</div>
</div>
</div>
</div>
<!-- Upload CONFIG MODAL-->
<div class="modal fade" id="uploadConfigModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="uploadConfigModal_Label">Upload Configuration:</span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div class="mb-3">
<input type="file" id="uploadConfig-file">
</div>
<div class="mb-3">
<input type="text" class="form-control" id="uploadConfig-Name-input" placeholder="Name (no spaces or underscore)" name="uploadConfig-Name-input">
<div id="uploadHelp" class="form-text"></div>
</div>
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="uploadConfig-set">
<label class="form-check-label" for="uploadConfig-set">Set configuration on upload</label>
</div>
</div>
<div class="modal-footer">
<span class="text-danger" id="uploadConfigModal-submit-error"></span>
<button type="button" class="btn btn-primary" id="uploadConfigModal-submit-btn">Upload</button>
</div>
</div>
</div>
</div>
<!-- Delete CONFIG MODAL-->
<div class="modal fade" id="deleteConfigModal" tabindex="-1">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="deleteConfigModal_Label">Delete configurations:</span></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Select all configurations you would like to delete (this cannot be undone).
<div id="deleteConfiglist"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger" id="deleteConfigModal-submit-btn">Delete</button>
</div>
</div>
</div>
</div>
<!-- Initial CONFIG MODAL-->
<div class="modal fade" id="initConfigModal" tabindex="-1">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="initConfigModal_Label"> <i class="fas fa-spinner fa-pulse"></i> Detecting serial input configuration...</span></h5>
</div>
<div class="modal-body">
<div id="initConfigModal-arrayError">
</div>
<ul id="initConfigModal-body" class="list-group m-2">
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" id="initConfigModal-submit-btn" disabled>Start DAQari</button>
</div>
</div>
</div>
</div>
</body>
</html>