1
0
Fork 0
mirror of https://github.com/EdgeTX/edgetx.git synced 2025-07-25 01:05:08 +03:00

Telemetry sources removed from the Reset Global Function

This commit is contained in:
bsongis 2015-07-21 19:14:02 +02:00
parent 370728433a
commit 29e9039176
4 changed files with 13 additions and 4 deletions

View file

@ -663,7 +663,7 @@ void CustomFunctionsPanel::populateFuncParamCB(QComboBox *b, uint function, unsi
} }
if (IS_ARM(firmware->getBoard())) { if (IS_ARM(firmware->getBoard())) {
for (int i=0; i<C9X_MAX_SENSORS; ++i) { for (int i=0; i<C9X_MAX_SENSORS; ++i) {
if (model->sensorData[i].isAvailable()) { if (model && model->sensorData[i].isAvailable()) {
RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i); RawSource item = RawSource(SOURCE_TYPE_TELEMETRY, 3*i);
qs.append(item.toString(model)); qs.append(item.toString(model));
} }

View file

@ -353,7 +353,15 @@ bool isAssignableFunctionAvailable(int function)
} }
} }
bool isAvailableInResetSpecialFunction(int index) bool isSourceAvailableInGlobalResetSpecialFunction(int index)
{
if (index >= FUNC_RESET_PARAM_FIRST_TELEM)
return false;
else
return isSourceAvailableInResetSpecialFunction(index);
}
bool isSourceAvailableInResetSpecialFunction(int index)
{ {
if (index >= FUNC_RESET_PARAM_FIRST_TELEM) { if (index >= FUNC_RESET_PARAM_FIRST_TELEM) {
TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index-FUNC_RESET_PARAM_FIRST_TELEM]; TelemetrySensor & telemetrySensor = g_model.telemetrySensors[index-FUNC_RESET_PARAM_FIRST_TELEM];

View file

@ -231,7 +231,7 @@ void menuCustomFunctions(uint8_t event, CustomFunctionData * functions, CustomFu
TelemetrySensor * sensor = & g_model.telemetrySensors[param-FUNC_RESET_PARAM_FIRST_TELEM]; TelemetrySensor * sensor = & g_model.telemetrySensors[param-FUNC_RESET_PARAM_FIRST_TELEM];
lcd_putsnAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, sensor->label, TELEM_LABEL_LEN, attr|ZCHAR); lcd_putsnAtt(MODEL_CUSTOM_FUNC_3RD_COLUMN, y, sensor->label, TELEM_LABEL_LEN, attr|ZCHAR);
} }
INCDEC_ENABLE_CHECK(isAvailableInResetSpecialFunction); INCDEC_ENABLE_CHECK(functionsContext == &globalFunctionsContext ? isSourceAvailableInGlobalResetSpecialFunction : isSourceAvailableInResetSpecialFunction);
} }
#if defined(OVERRIDE_CHANNEL_FUNCTION) #if defined(OVERRIDE_CHANNEL_FUNCTION)
else if (func == FUNC_OVERRIDE_CHANNEL) { else if (func == FUNC_OVERRIDE_CHANNEL) {

View file

@ -196,7 +196,8 @@ int8_t checkIncDecMovedSwitch(int8_t val);
bool isThrottleSourceAvailable(int source); bool isThrottleSourceAvailable(int source);
bool isLogicalSwitchFunctionAvailable(int function); bool isLogicalSwitchFunctionAvailable(int function);
bool isAssignableFunctionAvailable(int function); bool isAssignableFunctionAvailable(int function);
bool isAvailableInResetSpecialFunction(int index); bool isSourceAvailableInResetSpecialFunction(int index);
bool isSourceAvailableInGlobalResetSpecialFunction(int index);
bool isLogicalSwitchAvailable(int index); bool isLogicalSwitchAvailable(int index);
bool isSwitchAvailableInLogicalSwitches(int swtch); bool isSwitchAvailableInLogicalSwitches(int swtch);
bool isSwitchAvailableInCustomFunctions(int swtch); bool isSwitchAvailableInCustomFunctions(int swtch);