Show RX time moved to www config

pull/22/head
Rysiek Labus 2 years ago
parent 794045998c
commit 67857940c1
  1. 18
      data_embed/index.html
  2. 2
      include/taskWebServer.h
  3. 9
      src/TTGO_T-Beam_LoRa_APRS.ino
  4. 6
      src/taskWebServer.cpp

@ -59,7 +59,7 @@
</div>
<div>
<label for="aprs_symbol">Symbol</label>
<input class="u-full-width" type="text" minlength="1" maxlength="1" name="aprs_symbol" id="aprs_symbol" title="[ - jogger, Y - jacht, > - car, b - bike ">
<input class="u-full-width" type="text" minlength="1" maxlength="1" name="aprs_symbol" id="aprs_symbol" title="select an icon, for example: [ - jogger, Y - jacht, > - car, b - bike ">
</div>
<div>
<label for="aprs_alt">Show Altitude</label>
@ -117,19 +117,25 @@
<h2 class="u-full-width">Device Settings</h2>
</div>
<div class="grid-container quarters">
<div>
<label for="oled_enabled">Display dimmer enabled</label>
<input name="oled_enabled" id="oled_enabled" type="checkbox" value="1" title="enable or disable oled dimmer">
</div>
<div>
<label for="bt_enabled">Bluetooth enabled</label>
<input name="bt_enabled" id="bt_enabled" type="checkbox" value="1" title="enable or disable bluetooth">
</div>
<div>
<label for="oled_enabled">Display dimmer enabled</label>
<input name="oled_enabled" id="oled_enabled" type="checkbox" value="1" title="enable or disable oled dimmer">
</div>
<div>
<label for="led_enable">LED signaling</label>
<input name="led_enable" id="led_enable" type="checkbox" value="1" title="enable or disable LED" DISABLED>
</div>
</div>
</div>
<div class="grid-container quarters">
<div>
<label for="sh_rxtime">Display show RX time (s)</label>
<input name="sh_rxtime" id="sh_rxtime" type="number" min="1" max="45" title="show RX packet for seconds">
</div>
</div>
<div class="grid-container full">
<div>
<input class="button-primary u-full-width" type="submit" value="Save" title="save settings, remember reboot tracker after save">

@ -43,6 +43,8 @@ static const char *const PREF_DEV_BT_EN = "bt_enabled";
static const char *const PREF_DEV_BT_EN_INIT = "bt_enabled_init";
static const char *const PREF_DEV_OL_EN = "oled_enabled";
static const char *const PREF_DEV_OL_EN_INIT = "ol_enabled_init";
static const char *const PREF_DEV_SHOW_RX_TIME = "sh_rxtime";
static const char *const PREF_DEV_SHOW_RX_TIME_INIT = "sh_rxtime_init";
typedef struct {
String callsign;

@ -478,11 +478,20 @@ void setup(){
}
fixed_beacon_enabled = preferences.getBool(PREF_APRS_FIXED_BEACON_PRESET);
if (!preferences.getBool(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET_INIT)){
preferences.putBool(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET_INIT, true);
preferences.putInt(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET, fix_beacon_interval/1000);
}
fix_beacon_interval = preferences.getInt(PREF_APRS_FIXED_BEACON_INTERVAL_PRESET) * 1000;
if (!preferences.getBool(PREF_DEV_SHOW_RX_TIME_INIT)){
preferences.putBool(PREF_DEV_SHOW_RX_TIME_INIT, true);
preferences.putInt(PREF_DEV_SHOW_RX_TIME, showRXTime/1000);
}
showRXTime = preferences.getInt(PREF_DEV_SHOW_RX_TIME) * 1000;
if (clear_preferences){
delay(1000);
if(digitalRead(BUTTON)==LOW){

@ -122,6 +122,7 @@ void handle_Cfg() {
jsonData += jsonLineFromPreferenceBool(PREF_DEV_OL_EN);
jsonData += jsonLineFromPreferenceBool(PREF_APRS_SHOW_CMT);
jsonData += jsonLineFromPreferenceBool(PREF_DEV_BT_EN);
jsonData += jsonLineFromPreferenceInt(PREF_DEV_SHOW_RX_TIME);
jsonData += jsonLineFromString("FreeHeap", String(ESP.getFreeHeap()).c_str());
jsonData += jsonLineFromString("HeapSize", String(ESP.getHeapSize()).c_str());
jsonData += jsonLineFromString("FreeSketchSpace", String(ESP.getFreeSketchSpace()).c_str(), true);
@ -155,6 +156,7 @@ void handle_SaveAPRSCfg() {
if (server.hasArg(PREF_APRS_LONGITUDE_PRESET)){
preferences.putString(PREF_APRS_LONGITUDE_PRESET, server.arg(PREF_APRS_LONGITUDE_PRESET));
}
preferences.putBool(PREF_APRS_SHOW_BATTERY, server.hasArg(PREF_APRS_SHOW_BATTERY));
preferences.putBool(PREF_APRS_SHOW_ALTITUDE, server.hasArg(PREF_APRS_SHOW_ALTITUDE));
preferences.putBool(PREF_APRS_FIXED_BEACON_PRESET, server.hasArg(PREF_APRS_FIXED_BEACON_PRESET));
@ -168,7 +170,9 @@ void handle_SaveAPRSCfg() {
void handle_saveDeviceCfg(){
preferences.putBool(PREF_DEV_BT_EN, server.hasArg(PREF_DEV_BT_EN));
preferences.putBool(PREF_DEV_OL_EN, server.hasArg(PREF_DEV_OL_EN));
if (server.hasArg(PREF_DEV_SHOW_RX_TIME)){
preferences.putInt(PREF_DEV_SHOW_RX_TIME, server.arg(PREF_DEV_SHOW_RX_TIME).toInt());
}
server.sendHeader("Location", "/");
server.send(302,"text/html", "");
}

Loading…
Cancel
Save