chore: Remove legacy UI for telemetry type (#3782)

* CPN and radio: removed legacy UI for telemetry type

* CPN and radio: removed legacy UI for telemetry type
This commit is contained in:
Michael
2023-09-07 21:10:16 +10:00
committed by GitHub
parent e485db93ca
commit 73a4a2387e
24 changed files with 2 additions and 141 deletions
+1 -22
View File
@@ -22,7 +22,6 @@
#include "opentx.h"
enum MenuModelTelemetryFrskyItems {
ITEM_TELEMETRY_PROTOCOL_TYPE,
ITEM_TELEMETRY_SENSORS_LABEL,
ITEM_TELEMETRY_SENSOR_FIRST,
ITEM_TELEMETRY_SENSOR_LAST = ITEM_TELEMETRY_SENSOR_FIRST + MAX_TELEMETRY_SENSORS - 1,
@@ -73,14 +72,6 @@ uint8_t SENSOR_ROW(uint8_t value)
#define VARIO_ROWS
#endif
#if defined(HARDWARE_EXTERNAL_MODULE)
#define TELEMETRY_TYPE_ROW (!IS_INTERNAL_MODULE_ENABLED() && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) ? (uint8_t)0 : HIDDEN_ROW
#else
#define TELEMETRY_TYPE_ROW HIDDEN_ROW
#endif
#define TELEMETRY_TYPE_ROWS TELEMETRY_TYPE_ROW,
void onSensorMenu(const char * result)
{
uint8_t index = menuVerticalPosition - HEADER_LINE - ITEM_TELEMETRY_SENSOR_FIRST;
@@ -126,7 +117,7 @@ void onDeleteAllSensorsConfirm(const char * result)
void menuModelTelemetry(event_t event)
{
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS SENSORS_ROWS RSSI_ROWS VARIO_ROWS });
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS SENSORS_ROWS RSSI_ROWS VARIO_ROWS });
uint8_t sub = menuVerticalPosition - HEADER_LINE;
@@ -184,18 +175,6 @@ void menuModelTelemetry(event_t event)
else
switch (k) {
case ITEM_TELEMETRY_PROTOCOL_TYPE:
lcdDrawTextAlignedLeft(y, STR_TELEMETRY_TYPE);
lcdDrawTextAtIndex(TELEM_COL2, y, STR_TELEMETRY_PROTOCOLS,
g_model.telemetryProtocol, attr);
if (attr) {
g_model.telemetryProtocol = checkIncDec(
event, g_model.telemetryProtocol, PROTOCOL_TELEMETRY_FIRST,
PROTOCOL_TELEMETRY_LAST, EE_MODEL, isTelemetryProtocolAvailable);
}
break;
case ITEM_TELEMETRY_SENSORS_LABEL:
telemExpandState.sensors = expandableSection(y, STR_TELEMETRY_SENSORS, telemExpandState.sensors, attr, event);
break;
+1 -11
View File
@@ -22,7 +22,6 @@
#include "opentx.h"
enum MenuModelTelemetryFrskyItems {
ITEM_TELEMETRY_PROTOCOL_TYPE,
ITEM_TELEMETRY_SENSORS_LABEL,
ITEM_TELEMETRY_SENSOR_FIRST,
ITEM_TELEMETRY_SENSOR_LAST = ITEM_TELEMETRY_SENSOR_FIRST + MAX_TELEMETRY_SENSORS - 1,
@@ -67,7 +66,6 @@ uint8_t SENSOR_ROW(uint8_t value)
#else
#define VARIO_ROWS
#endif
#define TELEMETRY_TYPE_ROWS (!IS_INTERNAL_MODULE_ENABLED() && g_model.moduleData[EXTERNAL_MODULE].type == MODULE_TYPE_PPM) ? (uint8_t)0 : HIDDEN_ROW,
void onSensorMenu(const char * result)
{
@@ -114,7 +112,7 @@ void onDeleteAllSensorsConfirm(const char * result)
void menuModelTelemetry(event_t event)
{
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS TELEMETRY_TYPE_ROWS SENSORS_ROWS RSSI_ROWS VARIO_ROWS });
MENU(STR_MENUTELEMETRY, menuTabModel, MENU_MODEL_TELEMETRY, HEADER_LINE+ITEM_TELEMETRY_MAX, { HEADER_LINE_COLUMNS SENSORS_ROWS RSSI_ROWS VARIO_ROWS });
uint8_t sub = menuVerticalPosition - HEADER_LINE;
@@ -176,14 +174,6 @@ void menuModelTelemetry(event_t event)
else
switch (k) {
case ITEM_TELEMETRY_PROTOCOL_TYPE:
lcdDrawTextAlignedLeft(y, STR_TELEMETRY_TYPE);
lcdDrawTextAtIndex(TELEM_COL2, y, STR_TELEMETRY_PROTOCOLS, g_model.telemetryProtocol, attr);
if (attr) {
g_model.telemetryProtocol = checkIncDec(event, g_model.telemetryProtocol, PROTOCOL_TELEMETRY_FIRST, PROTOCOL_TELEMETRY_LAST, EE_MODEL, isTelemetryProtocolAvailable);
}
break;
case ITEM_TELEMETRY_SENSORS_LABEL:
telemExpandState.sensors = expandableSection(y, STR_TELEMETRY_SENSORS, telemExpandState.sensors, attr, event);
if (telemExpandState.sensors) {
-38
View File
@@ -1024,44 +1024,6 @@ bool isRfProtocolAvailable(int protocol)
return true;
}
bool isTelemetryProtocolAvailable(int protocol)
{
#if defined(PCBTARANIS)
if (protocol == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY &&
hasSerialMode(UART_MODE_TELEMETRY) < 0) {
return false;
}
#endif
if (protocol== PROTOCOL_TELEMETRY_CROSSFIRE) {
return false;
}
if ( protocol== PROTOCOL_TELEMETRY_GHOST) {
return false;
}
#if !defined(MULTIMODULE)
if (protocol == PROTOCOL_TELEMETRY_SPEKTRUM || protocol == PROTOCOL_TELEMETRY_FLYSKY_IBUS || protocol == PROTOCOL_TELEMETRY_MULTIMODULE) {
return false;
}
#endif
#if !defined(AFHDS3)
if (protocol == PROTOCOL_TELEMETRY_AFHDS3) {
return false;
}
#endif
#if defined(PCBHORUS)
if (protocol == PROTOCOL_TELEMETRY_FRSKY_D_SECONDARY) {
return false;
}
#endif
return true;
}
bool isTrainerModeAvailable(int mode)
{
#if defined(PCBX9E)
-1
View File
@@ -97,7 +97,6 @@ bool isExternalModuleAvailable(int moduleType);
bool isInternalModuleAvailable(int moduleType);
bool isInternalModuleSupported(int moduleType);
bool isRfProtocolAvailable(int protocol);
bool isTelemetryProtocolAvailable(int protocol);
bool isTrainerModeAvailable(int mode);
bool isAssignableFunctionAvailable(int function, CustomFunctionData * functions);