Multichannel config

Multichannel selection in web config
This commit is contained in:
oh3bsg 2023-10-22 17:28:39 +03:00
parent 60051d087f
commit a0c5205240
5 changed files with 21 additions and 3 deletions

View File

@ -704,6 +704,12 @@ struct st_configitems config_list[] = {
{"sondehub.fimaxdist", 0, &sonde.config.sondehub.fimaxdist},
{"sondehub.fimaxage", -7, &sonde.config.sondehub.fimaxage},
#endif
#if FEATURE_MULTICH
/* Multi channel settings*/
{"multich.active", 0, &sonde.config.multich.active},
{"multich.alt_limit", 0, &sonde.config.multich.alt_limit},
#endif // FEATURE_MULTICH
};
const int N_CONFIG = (sizeof(config_list) / sizeof(struct st_configitems));

View File

@ -74,6 +74,9 @@ var cfgs = [
[ "sondehub.fiinterval", "Import frequency (minutes, ≥ 5)" ],
[ "sondehub.fimaxdist", "Import maximum distance (km, ≤ 700)" ],
[ "sondehub.fimaxage", "Import maximum age (hours, ≤ 48)" ],
["", "Multi channel configuration", ""],
["multich.active", "0=disabled, 1=active"],
["multich.alt_limit", "Altitude after continue scanning (in meters)"],
[ "", "Hardware configuration (requires reboot)", "https://github.com/dl9rdz/rdz_ttgo_sonde/wiki/Hardware-configuration"],
[ "disptype", "Display type (0=OLED/SSD1306, 1=ILI9225, 2=OLED/SH1106, 3=ILI9341, 4=ILI9342, 5=ST7789)"],
[ "oled_sda", "OLED SDA/TFT SDA"],

View File

@ -10,6 +10,7 @@
#define FEATURE_MQTT 1
#define FEATURE_SDCARD 0
#define FEATURE_APRS 1
#define FEATURE_MULTICH 1
// Additional optional components

View File

@ -514,9 +514,11 @@ void Sonde::receive() {
else sonde.dispsavectlON();
int action = (event==EVT_NONE) ? ACT_NONE : disp.layout->actions[event];
#if 1
if ((res==RX_OK || res==RX_ERROR) && (si->d.alt > 2000.0f)) {
action = ACT_NEXTSONDE;
#if FEATURE_MULTICH
if (sonde.config.multich.active == 1) {
if ((res==RX_OK || res==RX_ERROR) && (si->d.alt > (float)(sonde.config.multich.alt_limit))) {
action = ACT_NEXTSONDE;
}
}
#endif // 0

View File

@ -229,6 +229,11 @@ struct st_sondehub {
double fimaxage;
};
struct st_multich {
int active;
uint32_t alt_limit;
};
// to be extended
enum { TYPE_TTGO, TYPE_M5_CORE2 };
@ -296,6 +301,7 @@ typedef struct st_rdzconfig {
struct st_kisstnc kisstnc; // target for KISS TNC (via TCP, mainly for APRSdroid)
struct st_mqtt mqtt;
struct st_sondehub sondehub;
struct st_multich multich;
struct st_cm cm;
} RDZConfig;