Commit 067cca9b authored by Eric Duminil's avatar Eric Duminil
Browse files

Timestep for measurement, interval for loggers

parent abe61df3
Pipeline #5819 passed with stage
in 2 minutes and 29 seconds
...@@ -96,8 +96,8 @@ namespace web_config { ...@@ -96,8 +96,8 @@ namespace web_config {
*/ */
OptionalParameterGroup csvParams = OptionalParameterGroup("CSV", "CSV", AMPEL_CSV); OptionalParameterGroup csvParams = OptionalParameterGroup("CSV", "CSV", AMPEL_CSV);
IntTParameter<uint16_t> csvTimestepParam = IntTParameter<uint16_t> csvIntervalParam =
Builder<IntTParameter<uint16_t>>("csv_timestep").label("CSV timestep").defaultValue(CSV_INTERVAL).min(0).step(1).placeholder( Builder<IntTParameter<uint16_t>>("csv_interval").label("CSV interval").defaultValue(CSV_INTERVAL).min(0).step(1).placeholder(
"[s]").build(); "[s]").build();
/** /**
...@@ -105,8 +105,8 @@ namespace web_config { ...@@ -105,8 +105,8 @@ namespace web_config {
*/ */
OptionalParameterGroup mqttParams = OptionalParameterGroup("MQTT", "MQTT", AMPEL_MQTT); OptionalParameterGroup mqttParams = OptionalParameterGroup("MQTT", "MQTT", AMPEL_MQTT);
IntTParameter<uint16_t> mqttTimestepParam = IntTParameter<uint16_t> mqttIntervalParam =
Builder<IntTParameter<uint16_t>>("mqtt_timestep").label("MQTT timestep").defaultValue( Builder<IntTParameter<uint16_t>>("mqtt_interval").label("MQTT interval").defaultValue(
MQTT_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build(); MQTT_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build();
CheckboxTParameter mqttEncryptionParam = CheckboxTParameter mqttEncryptionParam =
...@@ -145,8 +145,8 @@ namespace web_config { ...@@ -145,8 +145,8 @@ namespace web_config {
*/ */
#if defined(ESP32) #if defined(ESP32)
OptionalParameterGroup loraParams = OptionalParameterGroup("LoRaWan", "LoRaWan", AMPEL_LORAWAN); OptionalParameterGroup loraParams = OptionalParameterGroup("LoRaWan", "LoRaWan", AMPEL_LORAWAN);
IntTParameter<uint16_t> loraTimestepParam = IntTParameter<uint16_t> loraIntervalParam =
Builder<IntTParameter<uint16_t>>("lora_timestep").label("LoRa timestep").defaultValue( Builder<IntTParameter<uint16_t>>("lora_interval").label("LoRa interval").defaultValue(
LORAWAN_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build(); LORAWAN_SENDING_INTERVAL).min(0).step(1).defaultValue(300).placeholder("[s]").build();
//TODO: Use those parameters //TODO: Use those parameters
...@@ -200,9 +200,9 @@ namespace web_config { ...@@ -200,9 +200,9 @@ namespace web_config {
timeParams.addItem(&timeOffsetParam); timeParams.addItem(&timeOffsetParam);
timeParams.addItem(&dstParam); timeParams.addItem(&dstParam);
csvParams.addItem(&csvTimestepParam); csvParams.addItem(&csvIntervalParam);
mqttParams.addItem(&mqttTimestepParam); mqttParams.addItem(&mqttIntervalParam);
mqttParams.addItem(&mqttServerParam); mqttParams.addItem(&mqttServerParam);
mqttParams.addItem(&mqttPortParam); mqttParams.addItem(&mqttPortParam);
mqttParams.addItem(&mqttUserParam); mqttParams.addItem(&mqttUserParam);
...@@ -211,7 +211,7 @@ namespace web_config { ...@@ -211,7 +211,7 @@ namespace web_config {
mqttParams.addItem(&mqttCommandsParam); mqttParams.addItem(&mqttCommandsParam);
#if defined(ESP32) #if defined(ESP32)
loraParams.addItem(&loraTimestepParam); loraParams.addItem(&loraIntervalParam);
loraParams.addItem(&deviceEUIParam); loraParams.addItem(&deviceEUIParam);
loraParams.addItem(&appEUIParam); loraParams.addItem(&appEUIParam);
loraParams.addItem(&appKeyParam); loraParams.addItem(&appKeyParam);
...@@ -328,7 +328,7 @@ namespace config { ...@@ -328,7 +328,7 @@ namespace config {
bool is_csv_active() { bool is_csv_active() {
return web_config::csvParams.isActive(); return web_config::csvParams.isActive();
} }
uint16_t &csv_interval = web_config::csvTimestepParam.value(); uint16_t &csv_interval = web_config::csvIntervalParam.value();
// MQTT // MQTT
bool is_mqtt_active() { bool is_mqtt_active() {
...@@ -338,15 +338,15 @@ namespace config { ...@@ -338,15 +338,15 @@ namespace config {
char *mqtt_user = web_config::mqttUserParam.value(); char *mqtt_user = web_config::mqttUserParam.value();
char *mqtt_password = web_config::mqttPasswordParam.value(); char *mqtt_password = web_config::mqttPasswordParam.value();
uint16_t &mqtt_port = web_config::mqttPortParam.value(); uint16_t &mqtt_port = web_config::mqttPortParam.value();
uint16_t &mqtt_sending_interval = web_config::mqttTimestepParam.value(); uint16_t &mqtt_sending_interval = web_config::mqttIntervalParam.value();
bool &mqtt_encryption = web_config::mqttEncryptionParam.value(); bool &mqtt_encryption = web_config::mqttEncryptionParam.value();
bool &allow_mqtt_commands = web_config::mqttCommandsParam.value(); bool &allow_mqtt_commands = web_config::mqttCommandsParam.value();
// HTTP // HTTP
// const char *http_user = IOTWEBCONF_ADMIN_USER_NAME; // "admin" by default // const char *http_user = IOTWEBCONF_ADMIN_USER_NAME; // "admin" by default
// char *http_password = web_config::iotWebConf->getApPasswordParameter()->valueBuffer; // char *http_password = web_config::iotWebConf->getApPasswordParameter()->valueBuffer;
// LORAWAN // LORAWAN
#if defined(ESP32) #if defined(ESP32)
bool lorawan_active() { bool lorawan_active() {
return web_config::loraParams.isActive(); return web_config::loraParams.isActive();
......
...@@ -78,18 +78,18 @@ namespace web_server { ...@@ -78,18 +78,18 @@ namespace web_server {
"<tr><td>Timestep</td><td>%5d s</td></tr>" "<tr><td>Timestep</td><td>%5d s</td></tr>"
"<tr><th colspan='2'>CSV</th></tr>" //TODO: Gray out if !config::csv_active "<tr><th colspan='2'>CSV</th></tr>" //TODO: Gray out if !config::csv_active
"<tr><td>Last write</td><td>%s</td></tr>" "<tr><td>Last write</td><td>%s</td></tr>"
"<tr><td>Timestep</td><td>%5d s</td></tr>" "<tr><td>Interval</td><td>%5d s</td></tr>"
"<tr><td>Available space</td><td>%d kB</td></tr>" "<tr><td>Available space</td><td>%d kB</td></tr>"
"<tr><th colspan='2'>MQTT</th></tr>"//TODO: Gray out if !config::mqtt_active "<tr><th colspan='2'>MQTT</th></tr>"//TODO: Gray out if !config::mqtt_active
"<tr><td>Connected?</td><td>%s</td></tr>" "<tr><td>Connected?</td><td>%s</td></tr>"
"<tr><td>Last publish</td><td>%s</td></tr>" "<tr><td>Last publish</td><td>%s</td></tr>"
"<tr><td>Timestep</td><td>%5d s</td></tr>" "<tr><td>Interval</td><td>%5d s</td></tr>"
#if defined(ESP32) #if defined(ESP32)
"<tr><th colspan='2'>LoRaWAN</th></tr>" //TODO: Gray out if !config::lora_active "<tr><th colspan='2'>LoRaWAN</th></tr>" //TODO: Gray out if !config::lora_active
"<tr><td>Connected?</td><td>%s</td></tr>" "<tr><td>Connected?</td><td>%s</td></tr>"
"<tr><td>Frequency</td><td>%s MHz</td></tr>" "<tr><td>Frequency</td><td>%s MHz</td></tr>"
"<tr><td>Last transmission</td><td>%s</td></tr>" "<tr><td>Last transmission</td><td>%s</td></tr>"
"<tr><td>Timestep</td><td>%5d s</td></tr>" "<tr><td>Interval</td><td>%5d s</td></tr>"
#endif #endif
"<tr><th colspan='2'>Sensor</th></tr>" "<tr><th colspan='2'>Sensor</th></tr>"
"<tr><td>Temperature offset</td><td>%.1fK</td></tr>" //TODO: Read it from sensor? "<tr><td>Temperature offset</td><td>%.1fK</td></tr>" //TODO: Read it from sensor?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment