-
Notifications
You must be signed in to change notification settings - Fork 3
/
appPMem.h
80 lines (76 loc) · 2.72 KB
/
appPMem.h
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
const char* VARIABLES_DEF_YAML PROGMEM = R"~(
Wifi settings:
- st_ssid:
label: Name for WLAN
- st_pass:
label: Password for WLAN
- host_name:
label: >-
Host name to use for MDNS and AP<br>{mac} will be replaced with device's mac id
default: ConfigAssist_{mac}
Application settings:
- app_name:
label: Name your application
default: VarAttribues
- led_buildin:
label: Pin that the build in led is connected. Leave blank for auto.
Usually pin 4 on esp32, 2 on esp8266
attribs: "min='2' max='23' step='1'"
- display_style:
label: Choose how the config sections are displayed.
Must reboot to apply
options: AllOpen: 0
- AllClosed: 1
- Accordion : 2
- AccordionToggleClosed : 3
default: AccordionToggleClosed
Batch upload settings:
- batch_upload:
label: >-
Enable batch upload measurements
<b>Upload interval ⁚</b> <span id='uploadInterval'> 1.0 mins</span>
checked: True
attribs: onClick="enableDisableBatchUpload()"
- batch_size:
label: "Measurements size. Change to calculate <b>Upload interval</b>"
default: 5
attribs: >-
min='1' max='35535' step='1'
onChange="
const ctrl = document.getElementById('update_interval');
const batch = document.getElementById('batch_upload');
var ui = 0;
if(batch.checked)
ui = ( (ctrl.value/1000) * this.value ) / 60;
else
ui = ( (ctrl.value/1000) * 1 ) / 60;
document.getElementById('uploadInterval').innerHTML = ui.toFixed(2) + ' mins';
"
- update_interval:
label: "Delay between measurements (ms).Change to calculate <b>Upload interval</b>"
default: 30000
attribs: >-
onChange="
const ctrl = document.getElementById('batch_size');
const batch = document.getElementById('batch_upload');
var ui = 0;
if(batch.checked)
ui = (ctrl.value * (this.value / 1000) ) / 60;
else
ui = (1 * (this.value / 1000) ) / 60;
document.getElementById('uploadInterval').innerHTML = ui.toFixed(2) + ' mins';"
"
)~";
PROGMEM const char INIT_SCRIPT[] = R"=====(
function enableDisableBatchUpload(){
if( document.getElementById('batch_upload').checked ){
document.getElementById('batch_size').disabled = false;
}else{
document.getElementById('batch_size').disabled = true;
}
document.getElementById('batch_size').dispatchEvent(new Event('change'))
}
document.addEventListener('DOMContentLoaded', function (event) {
enableDisableBatchUpload();
});
)=====";