More internal module receivers menu logic
This commit is contained in:
@@ -291,12 +291,12 @@ void menuModelSetup(event_t event)
|
||||
IF_INTERNAL_MODULE_RECEIVER_1_ON((uint8_t)0), // Receiver Number
|
||||
IF_INTERNAL_MODULE_RECEIVER_1_ON((uint8_t)0), // Receiver Range
|
||||
IF_INTERNAL_MODULE_RECEIVER_1_ON((uint8_t)0), // Receiver Telemetry
|
||||
IF_INTERNAL_MODULE_RECEIVER_1_ON((uint8_t)0), // Receiver Bind/Delete
|
||||
IF_INTERNAL_MODULE_RECEIVER_1_ON((uint8_t)1), // Receiver Bind/Delete
|
||||
IF_INTERNAL_MODULE_RECEIVER_2_ON((uint8_t)0), // Receiver Number
|
||||
IF_INTERNAL_MODULE_RECEIVER_2_ON((uint8_t)0), // Receiver Range
|
||||
IF_INTERNAL_MODULE_RECEIVER_2_ON((uint8_t)0), // Receiver Telemetry
|
||||
IF_INTERNAL_MODULE_RECEIVER_2_ON((uint8_t)0), // Receiver Bind/Delete
|
||||
INTERNAL_MODULE_ADD_RECEIVER_ROW,
|
||||
IF_INTERNAL_MODULE_RECEIVER_2_ON((uint8_t)1), // Receiver Bind/Delete
|
||||
IF_INTERNAL_MODULE_ON(INTERNAL_MODULE_ADD_RECEIVER_ROW),
|
||||
LABEL(ExternalModule),
|
||||
EXTERNAL_MODULE_MODE_ROWS,
|
||||
MULTIMODULE_SUBTYPE_ROWS(EXTERNAL_MODULE)
|
||||
@@ -1064,20 +1064,43 @@ void menuModelSetup(event_t event)
|
||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_2_RANGE:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, TR_CHANNELRANGE);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, "Ch 1 - 8",0);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_1_TELEM:
|
||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_2_TELEM:
|
||||
{
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Telem");
|
||||
uint8_t receiverIdx = CURRENT_RECEIVER_EDITED(k);
|
||||
g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx].telemetry = editCheckBox(g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx].telemetry, MODEL_SETUP_2ND_COLUMN, y, INDENT "Telemetry", attr, event);
|
||||
}
|
||||
break;
|
||||
|
||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_1_BIND:
|
||||
case ITEM_MODEL_INTERNAL_MODULE_RECEIVER_2_BIND:
|
||||
{
|
||||
uint8_t receiverIdx = CURRENT_RECEIVER_EDITED(k);
|
||||
|
||||
lcdDrawTextAlignedLeft(y, INDENT "Receiver");
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, STR_MODULE_BIND, menuHorizontalPosition==0 ? attr : 0);
|
||||
lcdDrawText(MODEL_SETUP_2ND_COLUMN+MODEL_SETUP_RANGE_OFS, y, STR_DEL_BUTTON, menuHorizontalPosition==1 ? attr : 0);
|
||||
if (attr && menuHorizontalPosition == 0) {
|
||||
if (s_editMode > 0)
|
||||
moduleFlag[INTERNAL_MODULE] = MODULE_BIND;
|
||||
else
|
||||
moduleFlag[INTERNAL_MODULE] = MODULE_NORMAL_MODE;
|
||||
}
|
||||
if (attr && menuHorizontalPosition == 1 && s_editMode > 0) {
|
||||
if(receiverIdx == 0) {
|
||||
memcpy(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[0], &g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[1], sizeof(g_model.moduleData[INTERNAL_MODULE].pxx2.receivers));
|
||||
memclear(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[1], sizeof(g_model.moduleData[INTERNAL_MODULE].pxx2.receivers));
|
||||
s_editMode = 0;
|
||||
}
|
||||
else {
|
||||
memclear(&g_model.moduleData[INTERNAL_MODULE].pxx2.receivers[receiverIdx], sizeof(g_model.moduleData[INTERNAL_MODULE].pxx2.receivers));
|
||||
s_editMode = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
@@ -701,6 +701,7 @@ const char STR_BLCOLOR[] = TR_BLCOLOR;
|
||||
|
||||
#if defined(PCBTARANIS) || defined(DSM2)
|
||||
const char STR_MODULE_RANGE[] = TR_MODULE_RANGE;
|
||||
const char STR_DEL_BUTTON[] = TR_DEL_BUTTON;
|
||||
#endif
|
||||
|
||||
#if defined(BLUETOOTH)
|
||||
|
||||
@@ -963,6 +963,7 @@ extern const char STR_BLCOLOR[];
|
||||
|
||||
#if defined(PCBTARANIS) || defined(DSM2)
|
||||
extern const char STR_MODULE_RANGE[];
|
||||
extern const char STR_DEL_BUTTON[];
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -955,6 +955,7 @@
|
||||
#define TR_BYTES "[B]"
|
||||
#define TR_MODULE_BIND BUTTON(TR("Bnd", "Bind"))
|
||||
#define TR_MODULE_RANGE BUTTON(TR("Rng", "Range"))
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN BUTTON("Reset")
|
||||
#define TR_SET BUTTON("Volby")
|
||||
#define TR_TRAINER "Trenér"
|
||||
|
||||
@@ -960,6 +960,7 @@
|
||||
#define TR_BYTES "Bytes"
|
||||
#define TR_MODULE_BIND BUTTON(TR("Bnd","Bind")) //9XR-Pro
|
||||
#define TR_MODULE_RANGE BUTTON(TR("Rng", "Range")) //9XR-Pro
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN BUTTON("Reset")
|
||||
#define TR_SET BUTTON("Set")
|
||||
#define TR_TRAINER "DSC Buchse PPM In/Out"
|
||||
|
||||
@@ -958,6 +958,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND BUTTON(TR("Bnd", "Bind"))
|
||||
#define TR_MODULE_RANGE BUTTON(TR("Rng", "Range"))
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN BUTTON("Reset")
|
||||
#define TR_SET BUTTON("Set")
|
||||
#define TR_TRAINER "Trainer"
|
||||
|
||||
@@ -966,6 +966,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND "[Enlace]"
|
||||
#define TR_MODULE_RANGE "[Limites]"
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Ajuste]"
|
||||
#define TR_TRAINER "Aprendiz"
|
||||
|
||||
@@ -958,6 +958,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND "[Bind]"
|
||||
#define TR_MODULE_RANGE "[Range]"
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Set]"
|
||||
#define TR_TRAINER "Trainer"
|
||||
|
||||
@@ -970,6 +970,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND BUTTON(TR("Bnd", "Bind"))
|
||||
#define TR_MODULE_RANGE BUTTON(TR("Prt", "Port."))
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN BUTTON("RAZ")
|
||||
#define TR_SET BUTTON("Déf")
|
||||
#define TR_TRAINER "Ecolage"
|
||||
|
||||
@@ -960,6 +960,7 @@
|
||||
#define TR_BYTES "Bytes"
|
||||
#define TR_MODULE_BIND "[Bind]"
|
||||
#define TR_MODULE_RANGE "[Range]"
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Set]"
|
||||
#define TR_TRAINER TR("Trainer","Maestro/Allievo")
|
||||
|
||||
@@ -961,6 +961,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND TR("[Bnd]", "[Bind]")
|
||||
#define TR_MODULE_RANGE TR("[Rng]", "[Range]")
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Set]"
|
||||
#define TR_TRAINER "Trainer Poort"
|
||||
|
||||
@@ -961,6 +961,7 @@
|
||||
#define TR_BYTES "bajty"
|
||||
#define TR_MODULE_BIND TR("[BND]","[Bind]")
|
||||
#define TR_MODULE_RANGE TR("[Zas]","Zasięg")
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Set]"
|
||||
#define TR_TRAINER "Port Trenera"
|
||||
|
||||
@@ -965,6 +965,7 @@
|
||||
#define TR_BYTES "bytes"
|
||||
#define TR_MODULE_BIND "[Bind]"
|
||||
#define TR_MODULE_RANGE "[Range]"
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Reset]"
|
||||
#define TR_SET "[Set]"
|
||||
#define TR_TRAINER "Trainer"
|
||||
|
||||
@@ -974,6 +974,7 @@
|
||||
#define TR_BYTES "byte"
|
||||
#define TR_MODULE_BIND TR("[Bnd]", "[Bind]")
|
||||
#define TR_MODULE_RANGE TR("[Tst]", "[Testa]")
|
||||
#define TR_DEL_BUTTON BUTTON(TR("Del", "Delete"))
|
||||
#define TR_RESET_BTN "[Nollställ]"
|
||||
#define TR_SET "[Spara]"
|
||||
#define TR_TRAINER "Trainer"
|
||||
|
||||
Reference in New Issue
Block a user