forked from OpenEarable/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
748 lines (667 loc) · 37.4 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
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>OpenEarable - Dashboard</title>
<!-- CSS -->
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.1/font/bootstrap-icons.min.css"
integrity="sha512-oAvZuuYVzkcTc2dH5z1ZJup5OmSQ000qlfRvuoTTiyTBjwX1faoyearj8KdMq0LgsBTHMrRuMek7s+CxF8yE+w=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
<style>
/* General Styles */
body {
background: #161618;
color: white !important;
transition: background-color 0.5s;
}
.bg-green {
background-color: #3f3f44;
}
.bg-red {
background-color: #161618;
}
.card {
border-color: transparent;
border-width: 0px;
overflow: hidden;
background: #36353b;
color: b0b0b0;
}
.card-title {
color: white;
}
.btn {
border-width: 0px;
}
.btn:hover {
border-width: 0px;
opacity: 0.9;
}
.btn:disabled {
opacity: 0.5;
}
a {
color: white !important;
}
a:hover {
color: white;
opacity: 0.8;
}
/* Tooltip */
.tooltip-indicator {
background: white;
min-width: 17px;
min-height: 17px;
max-width: 17px;
max-height: 17px;
border-radius: 50%;
font-size: 0.8em;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
color: black;
}
.tooltip-inner {
background-color: white !important;
color: black;
}
.tooltip .tooltip-arrow::before {
--bs-tooltip-bg: white;
}
/* Connection Card */
.btn-connect {
background-color: #77F2A1 !important;
color: black !important;
}
.btn-disconnect {
background-color: #f27777 !important;
color: black !important;
display: none;
/* default is hidden */
}
/* Audio Player Card */
.btn-audio-controls {
font-size: 1.3em;
}
.btn-play {
background-color: #77F2A1 !important;
color: black !important;
font-size: 1.2em;
}
.btn-pause {
background-color: #e0f277 !important;
color: black !important;
font-size: 1.2em;
}
.btn-stop {
background-color: #f27777 !important;
color: black !important;
}
/* Sensor Control Card */
.btn-control {
background-color: #53515b !important;
color: white !important;
}
/* Log card */
.btn-clear {
background-color: white !important;
padding: 2px 4px;
font-size: 0.8em;
color: black !important;
}
/* Sensor Chart Cards */
.chartWrapper {
max-height: 180px;
width: 100%;
height: 100%;
}
.btn-confirm {
background: #77F2A1 !important;
color: black !important;
border-radius: 0px 5px 5px 0px;
border: 0px solid transparent;
margin: 1px;
font-size: 1.4em;
line-height: 1em;
}
.btn-edit-input {
max-width: 120px;
}
.sampling-rate-input {
min-width: 100px;
}
.form-select,
.form-control {
padding: 0px 5px;
}
input[disabled],
select[disabled] {
opacity: 0.5 !important;
}
</style>
</head>
<body class="pt-1 pb-1">
<div class="container-fluid d-flex flex-column" style="min-height: 100%;">
<div class="row gx-2">
<div class="col-12 col-md-6 col-xl-2 d-flex align-items-stretch flex-column mt-2">
<div class="card" style="background: transparent;;">
<div class="card-body d-flex justify-content-center align-items-center">
<div>
<h5 class="m-0 text-white" style=" color: white !important"><img style="height: 30px"
src="./assets/images/logo.png"><span class="ms-2">OpenEarable</span></h5>
</div>
</div>
</div>
<div class="card mt-2 flex-fill">
<div class="card-body d-flex flex-column justify-content-between">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Device</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="OpenEarable connects via WebBLE. Make sure your browser supports WebBLE (e.g., Chrome version ≥ 56).">
<div>?</div>
</div>
</div>
<div class="d-flex flex-column">
<div class="card-text"><b></b><span id="connectedDevice" class=""
style="font-family: monospace;">OpenEarable-XXXX </span> (<span id="batteryLevel"
style="font-family: monospace;">XX</span><span style="font-size: 0.8em;">%<i
id="batteryChargingIndicator" class="bi bi-lightning-charge"></i><i
style="color: #77F2A1" id="batteryChargedIndicator"
class="bi bi-lightning-charge-fill"></i></span>)
</div>
<div class="mt-1"><b>Firmware</b> <span style="font-family: monospace"
id="fwVersion">X.X.X</span> <b class="ms-2">Device</b> <span
style="font-family: monospace" id="deviceVersion">X.X.X</span></div>
</div>
<div>
<button id="connectDeviceButton" class="btn btn-connect w-100">Connect</button>
<button id="disconnectDeviceButton" class="btn btn-disconnect w-100">Disconnect</button>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2">
<div class="card h-100">
<div class="card-body h-100 flex-column d-flex">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Sensor Control</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="Enable and disable the sensors of OpenEarable. Note that sampling all sensors at the maximum sampling rate can lead to lag and/or audio play issues. Inner / outer microphone and gain control (g-dB) only available with hardware and firmware verison >= 1.4.">
<div>?</div>
</div>
</div>
<div class="d-flex flex-column flex-fill justify-content-between">
<p class="card-text">Select sensors and sampling rate to capture.</p>
<!-- Grid Layout Starts Here -->
<div
style="display: grid; grid-template-columns: auto 1fr auto auto; gap: 16px; align-items: center;">
<!-- First Row -->
<div>
<input type="checkbox" disabled class="is-connect-enabled" id="areSensorsEnabled">
</div>
<div class="ms-2"
style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
Accelerometer, Gyroscope, Magnetometer (via BLE)
</div>
<div>
<select disabled
class="w-100 is-connect-enabled ms-1 sampling-rate-input form-select"
name="sensorSamplingRate" id="sensorSamplingRate">
<option value="0">0</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
</select>
</div>
<div class="ms-1">Hz</div>
<!-- Second Row -->
<div>
<input type="checkbox" disabled class="is-connect-enabled"
id="isPressureSensorEnabled">
</div>
<div class="ms-2"
style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
Pressure Sensor, Temperature Sensor (via BLE)
</div>
<div>
<select disabled
class="w-100 is-connect-enabled ms-1 sampling-rate-input form-select"
name="pressureSensorSamplingRate" id="pressureSensorSamplingRate">
<option value="0">0</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
</select>
</div>
<div class="ms-1">Hz</div>
<!-- Third Row -->
<div>
<input disabled type="checkbox" class="is-connect-enabled" id="isMicEnabled">
</div>
<div class="ms-2"
style="overflow: hidden; white-space: nowrap; text-overflow: ellipsis;">
Microphone (recorded to microSD card)
</div>
<div class="d-flex flex-row">
<div>
<select disabled
class="w-100 is-connect-enabled ms-1 sampling-rate-input form-select"
name="microphoneSamplingRate" id="microphoneSamplingRate">
<option value="0">0</option>
<option value="16000">16,000</option>
<option value="41667">41,667</option>
<option value="62500">62,500</option>
</select>
</div>
</div>
<div class="ms-1">Hz</div>
<!-- Fourth Row -->
<div class="d-flex flex-row 1-4-0-controls justify-content-between w-100 align-items-center"
style="grid-column: 1 / 5;">
<div class="1-4-0-controls">⌞</div>
<!-- inner mic -->
<input id="innerMicrophoneEnabled" type="checkbox" disabled
class="is-connect-enabled 1-4-0-controls ms-3"></input>
<div class="ms-2 1-4-0-controls">Inner </div>
<div class="ms-1 1-4-0-controls">Gain</div>
<select disabled
class="is-connect-enabled ms-2 sampling-rate-input form-select 1-4-0-controls "
name="microphoneGainInner" id="microphoneGainInner">
</select>
<div class="ms-3 1-4-0-controls">dB</div>
</div>
<div class="d-flex flex-row 1-4-0-controls justify-content-between w-100 align-items-center"
style="grid-column: 1 / 5;">
<div class="1-4-0-controls">⌞</div>
<!-- outer mic -->
<input id="outerMicrophoneEnabled" type="checkbox" disabled
class="is-connect-enabled 1-4-0-controls ms-3"></input>
<div class="ms-2 1-4-0-controls">Outer </div>
<div class="ms-1 1-4-0-controls">Gain</div>
<select disabled
class="is-connect-enabled ms-2 sampling-rate-input form-select 1-4-0-controls "
name="microphoneGainOuter" id="microphoneGainOuter">
</select>
<div class="ms-3 1-4-0-controls">dB</div>
</div>
</div>
<!-- Grid Layout Ends Here -->
<div class="d-flex flex-row mt-3 w-100 justify-content-between">
<button disabled id="setSensorConfigurationButton"
class="btn btn-control is-connect-enabled flex-fill">Set Configuration</button>
<button disabled id="preloadWalkParams"
class="btn btn-control is-connect-enabled ms-3">Preload Walk</button>
<button disabled id="preloadRunParams"
class="btn btn-control is-connect-enabled ms-3">Preload Run</button>
<button disabled id="testOcclusionButton"
class="btn btn-control is-connect-enabled ms-3 1-4-0-controls" style="min-width: 120px;">Test Occl.</button>
<button disabled id="turnOffSensors"
class="btn btn-disable-sensors btn-stop is-connect-enabled ms-3">Off</button>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2">
<div class="card h-100">
<div class="card-body d-flex flex-column justify-content-between">
<div>
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Audio Control </h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="Audio files are played locally from the microSD card inside OpenEarable. The supported file formats are single channel, 16-bit, 44.1 kHz *.wav files.">
<div>?</div>
</div>
</div>
<p class="card-text">Play audio from microSD or a constant tone or a built-in jingle.
</p>
</div>
<div class="d-flex flex-row w-100 justify-content-between mt-2">
<input type="radio" disabled checked id="file" name="audio_source" value="file"
class="me-2 is-connect-enabled">
<input disabled id="fileNameInput" class="is-connect-enabled ms-1 w-100 form-control"
placeholder="filename.wav">
</div>
<div class="d-flex flex-row align-items-center justify-content-between mt-2">
<div class="d-flex flex-row w-100">
<input type="radio" disabled id="jingle" name="audio_source" value="jingle"
class="me-2 is-connect-enabled">
<select disabled class="ms-1 w-100 is-connect-enabled form-select" name="jingleSelect"
id="jingleSelect">
<option value="1">NOTIFICATION (1)</option>
<option value="2">SUCCESS (2)</option>
<option value="3">ERROR (3)</option>
<option value="4">ALARM (4)</option>
<option value="5">PING (5)</option>
<option value="6">OPEN (6)</option>
<option value="7">CLOSE (7)</option>
<option value="8">CLICK (8)</option>
</select>
</div>
</div>
<div class="d-flex flex-row align-items-center justify-content-between mt-2">
<div class="d-flex flex-row w-100 justify-content-center align-items-stretch">
<input type="radio" disabled id="frequency" name="audio_source" value="frequency"
class="me-2 is-connect-enabled">
<input id="frequencyNumberSelector" disabled min="300" max="22000" value="440"
type="number" class="ms-1 is-connect-enabled flex-fill form-control" value="0">
<div
class="ms-1 is-connect-enabled me-2 d-flex justify-content-center align-items-center">
<div>Hz</div>
</div>
<input id="loudnessInput" class="ms-1 is-connect-enabled form-control" type="number"
step="1" min="0" max="100" value="50" disabled>
<div class="ms-1 is-connect-enabled d-flex justify-content-center align-items-center">
<div>%</div>
</div>
<select disabled class="ms-3 flex-fill is-connect-enabled form-select"
name="waveTypeSelect" id="waveTypeSelect">
<option value="1">sine (1)</option>
<option value="2">square (2)</option>
<option value="3">triangle (3)</option>
<option value="4">saw (4)</option>
</select>
</div>
</div>
<div class="d-flex w-100 justify-content-between align-items-center mt-2">
<div>
<button id="button-set-source" class="btn btn-control is-connect-enabled">Set
Source</button>
<button id="button-play-audio" class="btn btn-play btn-block ms-2 is-connect-enabled"
disabled><i class="bi bi-play"></i></button>
<button id="button-pause-audio" class="btn btn-pause btn-block ms-2 is-connect-enabled"
disabled><i class="bi bi-pause"></i></button>
<button id="button-stop-audio" class="btn btn-stop btn-block ms-2 is-connect-enabled"
disabled><i class="bi bi-stop"></i></button>
</div>
<div>
<i style="color: #f27777">⚠️ Audio can be very loud! ⚠️</i>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-2 d-flex flex-column mt-2">
<div class="card h-100">
<div class="card-body d-flex flex-column h-100">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">RGB LED Control</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="You can set the RGB color LED. The rainbow mode shifts through the RGB colors.">
<div>?</div>
</div>
</div>
<p class="card-text">Control the RGB LED.
</p>
<div class="d-flex flex-column justify-content-between align-items-stretch flex-fill">
<div class="d-flex flex-row justify-content-between">
<div style="flex: 0 0 40px;">
<input disabled class="is-connect-enabled w-100 h-100" type="color" id="colorpicker"
value="#ffffff">
</div>
<input disabled class="ms-2 form-control" style="width: calc(100% - 40px)"
id="colorInput">
</div>
<button disabled class="btn btn-control is-connect-enabled mt-2" onclick="onSetColor()">Set
</button>
<hr />
<div class="d-flex flex-row">
<button disabled class="btn btn-control flex-fill is-connect-enabled"
onclick="startRainbowMode()">🦄</button>
<button disabled onclick="onTurnOffLed()"
class="btn btn-stop is-connect-enabled flex-fill ms-2">Off</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row gx-2 mb-2">
<div class="col-12 col-xl-8 mt-2 ">
<div class="card h-100 flex-fill">
<div class="card-body d-flex flex-column h-100">
<div class="d-flex flex-row w-100 justify-content-between">
<div class="d-flex flex-row justify-content-center align-items-center">
<div>
<h5 class="card-title">Log </h5>
</div>
<button class="btn btn-clear ms-3" onclick="onClearLog()">Clear Log</button>
<button class="btn btn-clear ms-2" onclick="onClearGraphs()">Clear Graphs</button>
</div>
<div class="tooltip-indicator" data-toggle="tooltip"
title="Prints relevant events and shows debug information.">
<div>?</div>
</div>
</div>
<div id="log" class="w-100 p-2 mt-3 flex-fill"
style="color: white; min-height: 100px; max-height: 320px; font-family: 'Courier New', Courier, monospace; border: 1px solid rgb(94, 94, 94); border-radius: 0.375rem; overflow-y: scroll; overflow-x: hidden;">
</div>
</div>
</div>
</div>
<div class="col-12 col-xl-4 d-flex mt-2 ">
<div class="card flex-fill">
<div class="card-body d-flex flex-column h-100">
<div class="d-flex flex-row w-100 justify-content-between">
<div class="d-flex flex-row justify-content-center align-items-center">
<div>
<h5 class="card-title">Recorder</h5>
</div>
</div>
<div class="tooltip-indicator" data-toggle="tooltip"
title="You can record data directly in your browser. The format is compataible with edge-ml.org, a tool for embedded machine learning.">
<div>?</div>
</div>
</div>
<div class="d-flex flex-column w-100 flex-fill" style="font-family: monospace;">
<div class="d-flex w-100 flex-row justify-content-between flex-grow-1">
<button id="btn1" style="border: 3px solid transparent;"
class="btn flex-fill btn-control">Label 1</button>
<button id="btn2" style="border: 3px solid transparent;"
class="btn flex-fill ms-2 btn-control">Label 2</button>
<button id="btn3" style="border: 3px solid transparent;"
class="btn flex-fill ms-2 btn-control">Label 3</button>
<button id="btn4" style="border: 3px solid transparent;"
class="btn flex-fill ms-2 btn-control">Label 4</button>
</div>
<div class="d-flex w-100 flex-row justify-content-between mt-2 flex-grow-1">
<button id="btn5" style="border: 3px solid transparent;"
class="btn btn-control flex-fill">Label 5</button>
<button id="btn6" style="border: 3px solid transparent;"
class="btn btn-control flex-fill flex-fill ms-2">Label 6</button>
<button id="btn7" style="border: 3px solid transparent;"
class="btn btn-control flex-fill flex-fill ms-2">Label 7</button>
<button id="btn8" style="border: 3px solid transparent;"
class="btn btn-control flex-fill flex-fill ms-2">Label 8</button>
</div>
<div class="d-flex flex-row mt-2">
<div class="d-flex flex-row justify-content-between align-items-center flex-fill">
<button id="startRecordingButton" class="btn btn-play is-connect-enabled w-100"
disabled>Start
Recording</button>
<button id="stopRecordingButton"
class="btn btn-stop is-connect-enabled w-100 d-none">Stop
Recording</button>
</div>
<button id="btn9" style="border: 3px solid #77F2A1;"
class="btn btn-primary btn-control ms-2">
No Label</button>
<button id="lockButton" class="btn btn-stop ms-2 is-record-enabled"><i
class="bi bi-lock"></i></button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row gx-2 flex-grow-1">
<div class="col-12 col-md-6 col-xl-4 mt-2 ">
<div class="card h-100">
<div class="card-body d-flex flex-column">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Accelerometer</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows live data once the accelerometer is activated.">
<div>?</div>
</div>
</div>
<div class="chartWrapper"><canvas class="w-100" id="accelerometerChart"></canvas></div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2 ">
<div class="card h-100">
<div class="card-body">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Gyroscope</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows live data once the gyroscope is activated.">
<div>?</div>
</div>
</div>
<div class="chartWrapper"><canvas class="w-100" id="gyroscopeChart"></canvas></div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2 ">
<div class="card h-100">
<div class="card-body">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Magnetometer</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows live data once the magnetometer is activated.">
<div>?</div>
</div>
</div>
<div class="chartWrapper"><canvas class="w-100" id="magnetometerChart"></canvas></div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2 d-flex">
<div class="card d-flex flex-fill">
<div class="card-body h-100 d-flex flex-column">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">3D Model</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows the orientation of the earable in realtime if the IMU is activated.">
<div>?</div>
</div>
</div>
<div class="d-flex flex-row h-100 align-items-center-center">
<model-viewer class="w-100 flex-fill h-100" disable-tap disable-zoom
src="./assets/models/OpenEarable.glb" camera-orbit="0 0 0"></model-viewer>
<div class="ms-2">
<div>
<div><b>Roll Angle</b></div>
<div style="font-family: monospace;" id="rollAngleValue">0.0</div>
</div>
<div>
<div><b>Pitch Angle</b></div>
<div style="font-family: monospace;" id="pitchAngleValue">0.0</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2 ">
<div class="card h-100">
<div class="card-body">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Pressure Sensor</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows live data once the pressure sensor is activated.">
<div>?</div>
</div>
</div>
<div class="chartWrapper"><canvas class="w-100" id="pressureSensorChart"></canvas></div>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-xl-4 mt-2 ">
<div class="card h-100">
<div class="card-body h-100">
<div class="d-flex flex-row w-100 justify-content-between">
<h5 class="card-title">Temperature Sensor</h5>
<div class="tooltip-indicator" data-toggle="tooltip"
title="This panel shows live data once the temperature sensor is activated.">
<div>?</div>
</div>
</div>
<div class="chartWrapper"><canvas class="w-100" id="temperatureSensorChart"></canvas></div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"
integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.1.1/model-viewer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Note: keep import order -->
<script src="./assets/js/LogManager.js"></script>
<script src="./assets/js/OpenEarable.js"></script>
<script src="./assets/js/LEDManager.js"></script>
<script src="./assets/js/ConnectionManager.js"></script>
<script src="./assets/js/ChartManager.js"></script>
<script src="./assets/js/RecordingManager.js"></script>
<script src="./assets/js/AudioManager.js"></script>
<script src="./assets/js/SensorManager.js"></script>
<script>
/* initialization tasks */
// Function to map dB values to linear values
function mapLinear(db, minDb, maxDb, minLinear, maxLinear) {
return (db - minDb) * (maxLinear - minLinear) / (maxDb - minDb) + minLinear;
}
$(document).ready(function () {
$('#batteryChargingIndicator').hide();
$('#batteryChargedIndicator').hide();
// enable tooltips
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
// disable all buttons on initial load
$(".is-connect-enabled").prop('disabled', true);
// check if bluetooth is supported
if ('bluetooth' in navigator) {
log('Your browser supports WebBLE. You are ready to connect to OpenEarable!');
} else {
log('Your browser does not support WebBLE. Enable it or download a browser that supports WebBLE (e.g., Chrome version ≥ 56)!', "ERROR");
}
const selectInner = document.getElementById('microphoneGainInner');
const selectOuter = document.getElementById('microphoneGainOuter');
const minDb = -20;
const maxDb = 20;
const step = 2;
const minLinear = 0;
const maxLinear = 80;
for (let db = minDb; db <= maxDb; db += step) {
const linearValue = mapLinear(db, minDb, maxDb, minLinear, maxLinear);
const option = document.createElement('option');
option.value = linearValue.toFixed(0);
option.textContent = `${db.toFixed(1)}`;
const option1 = document.createElement('option');
option1.value = linearValue.toFixed(0);
option1.textContent = `${db.toFixed(1)}`;
selectInner.appendChild(option);
selectOuter.appendChild(option1);
}
selectInner.selectedIndex = 10;
selectOuter.selectedIndex = 10;
});
</script>
</body>
</html>