Global functions (only Firmware) - saves 20bytes flash on 9X stock

This commit is contained in:
bsongis
2014-09-18 11:44:09 +02:00
parent 5173907efd
commit 2f8b9347a4
55 changed files with 1328 additions and 1154 deletions
+18 -18
View File
@@ -1015,8 +1015,8 @@ void CompareDialog::printSwitches()
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
for (int i=0; i<GetCurrentFirmware()->getCapability(LogicalSwitches); i++) {
GeneralSettings settings;
QString sw1 = g_model1->customSw[i].toString(*g_model1, settings);
QString sw2 = g_model2->customSw[i].toString(*g_model2, settings);
QString sw1 = g_model1->logicalSw[i].toString(*g_model1, settings);
QString sw2 = g_model2->logicalSw[i].toString(*g_model2, settings);
if (!(sw1.isEmpty() && sw2.isEmpty())) {
str.append("<tr>");
color=getColor1(sw1,sw2);
@@ -1059,8 +1059,8 @@ void CompareDialog::printFSwitches()
str.append("</tr>");
for(int i=0; i<GetCurrentFirmware()->getCapability(CustomFunctions); i++)
{
if (g_model1->funcSw[i].swtch.type || g_model2->funcSw[i].swtch.type) {
if ((g_model1->funcSw[i].swtch != g_model2->funcSw[i].swtch) || (g_model1->funcSw[i].func!=g_model2->funcSw[i].func) || (g_model1->funcSw[i].adjustMode!=g_model2->funcSw[i].adjustMode) || (g_model1->funcSw[i].param!=g_model2->funcSw[i].param)) {
if (g_model1->customFn[i].swtch.type || g_model2->customFn[i].swtch.type) {
if ((g_model1->customFn[i].swtch != g_model2->customFn[i].swtch) || (g_model1->customFn[i].func!=g_model2->customFn[i].func) || (g_model1->customFn[i].adjustMode!=g_model2->customFn[i].adjustMode) || (g_model1->customFn[i].param!=g_model2->customFn[i].param)) {
color1="green";
color2="red";
} else {
@@ -1068,18 +1068,18 @@ void CompareDialog::printFSwitches()
color2="grey";
}
str.append("<tr>");
if (g_model1->funcSw[i].swtch.type) {
str.append(doTC(g_model1->funcSw[i].swtch.toString(),color1));
str.append(doTC(g_model1->funcSw[i].funcToString(),color1));
str.append(doTC(g_model1->funcSw[i].paramToString(),color1));
int index=g_model1->funcSw[i].func;
if (g_model1->customFn[i].swtch.type) {
str.append(doTC(g_model1->customFn[i].swtch.toString(),color1));
str.append(doTC(g_model1->customFn[i].funcToString(),color1));
str.append(doTC(g_model1->customFn[i].paramToString(),color1));
int index=g_model1->customFn[i].func;
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
str.append(doTC(QString("%1").arg(g_model1->funcSw[i].repeatParam),color1));
str.append(doTC(QString("%1").arg(g_model1->customFn[i].repeatParam),color1));
} else {
str.append(doTC( "---",color1));
}
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
str.append(doTC((g_model1->funcSw[i].enabled ? "ON" : "OFF"),color1));
str.append(doTC((g_model1->customFn[i].enabled ? "ON" : "OFF"),color1));
} else {
str.append(doTC( "---",color1));
}
@@ -1087,18 +1087,18 @@ void CompareDialog::printFSwitches()
str.append("<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>");
}
str.append(doTC(tr("SF")+QString("%1").arg(i+1),"",true));
if (g_model2->funcSw[i].swtch.type) {
str.append(doTC(g_model2->funcSw[i].swtch.toString(),color2));
str.append(doTC(g_model2->funcSw[i].funcToString(),color2));
str.append(doTC(g_model2->funcSw[i].paramToString(),color2));
int index=g_model2->funcSw[i].func;
if (g_model2->customFn[i].swtch.type) {
str.append(doTC(g_model2->customFn[i].swtch.toString(),color2));
str.append(doTC(g_model2->customFn[i].funcToString(),color2));
str.append(doTC(g_model2->customFn[i].paramToString(),color2));
int index=g_model2->customFn[i].func;
if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
str.append(doTC(QString("%1").arg(g_model2->funcSw[i].repeatParam),color2));
str.append(doTC(QString("%1").arg(g_model2->customFn[i].repeatParam),color2));
} else {
str.append(doTC( "---",color2));
}
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
str.append(doTC((g_model2->funcSw[i].enabled ? "ON" : "OFF"),color2));
str.append(doTC((g_model2->customFn[i].enabled ? "ON" : "OFF"),color2));
} else {
str.append(doTC( "---",color2));
}
+7 -7
View File
@@ -713,15 +713,15 @@ QString LogicalSwitchData::toString(const ModelData & model, const GeneralSettin
return result;
}
void FuncSwData::clear()
void CustomFunctionData::clear()
{
memset(this, 0, sizeof(FuncSwData));
memset(this, 0, sizeof(CustomFunctionData));
if (!GetCurrentFirmware()->getCapability(SafetyChannelCustomFunction)) {
func = FuncTrainer;
}
}
QString FuncSwData::funcToString()
QString CustomFunctionData::funcToString()
{
ModelData model;
if (func >= FuncOverrideCH1 && func <= FuncOverrideCH32)
@@ -771,7 +771,7 @@ QString FuncSwData::funcToString()
}
}
QString FuncSwData::paramToString()
QString CustomFunctionData::paramToString()
{
QStringList qs;
if (func <= FuncInstantTrim) {
@@ -842,7 +842,7 @@ QString FuncSwData::paramToString()
return "";
}
QString FuncSwData::repeatToString()
QString CustomFunctionData::repeatToString()
{
if (repeatParam==0) {
return QObject::tr("No repeat");
@@ -1159,9 +1159,9 @@ void ModelData::clear()
for (int i=0; i<NUM_STICKS; i++)
expoData[i].clear();
for (int i=0; i<C9X_NUM_CSW; i++)
customSw[i].clear();
logicalSw[i].clear();
for (int i=0; i<C9X_MAX_CUSTOM_FUNCTIONS; i++)
funcSw[i].clear();
customFn[i].clear();
for (int i=0; i<C9X_MAX_CURVES; i++)
curves[i].clear(5);
for (int i=0; i<C9X_MAX_TIMERS; i++)
+9 -9
View File
@@ -756,9 +756,9 @@ enum AssignFunc {
FuncReserve = -1
};
class FuncSwData { // Function Switches data
class CustomFunctionData { // Function Switches data
public:
FuncSwData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
CustomFunctionData(AssignFunc func=FuncOverrideCH1) { clear(); this->func = func; }
RawSwitch swtch;
AssignFunc func;
int param;
@@ -1019,8 +1019,8 @@ class ModelData {
ExpoData expoData[C9X_MAX_EXPOS];
CurveData curves[C9X_MAX_CURVES];
LogicalSwitchData customSw[C9X_NUM_CSW];
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
LogicalSwitchData logicalSw[C9X_NUM_CSW];
CustomFunctionData customFn[C9X_MAX_CUSTOM_FUNCTIONS];
SwashRingData swashRingData;
unsigned int thrTraceSrc;
unsigned int modelId;
@@ -1289,18 +1289,18 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
// virtual switches
for (int i=0; i<C9X_NUM_CSW; i++) {
RawSource source;
switch (model.customSw[i].getFunctionFamily()) {
switch (model.logicalSw[i].getFunctionFamily()) {
case LS_FAMILY_VCOMP:
source = RawSource(model.customSw[i].val2);
source = RawSource(model.logicalSw[i].val2);
if (source.type == SOURCE_TYPE_STICK)
source.index = applyStickMode(source.index + 1, mode) - 1;
model.customSw[i].val2 = source.toValue();
model.logicalSw[i].val2 = source.toValue();
// no break
case LS_FAMILY_VOFS:
source = RawSource(model.customSw[i].val1);
source = RawSource(model.logicalSw[i].val1);
if (source.type == SOURCE_TYPE_STICK)
source.index = applyStickMode(source.index + 1, mode) - 1;
model.customSw[i].val1 = source.toValue();
model.logicalSw[i].val1 = source.toValue();
break;
default:
break;
+3 -3
View File
@@ -378,9 +378,9 @@ t_Er9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -459,7 +459,7 @@ t_Er9xModelData::operator ModelData ()
}
for (int i=0; i<ER9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ER9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
+1 -1
View File
@@ -241,7 +241,7 @@ PACK(typedef struct t_Er9xModelData {
int8_t trim[4];
int8_t curves5[ER9X_MAX_CURVE5][5];
int8_t curves9[ER9X_MAX_CURVE9][9];
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
Er9xLogicalSwitchData logicalSw[ER9X_NUM_CSW];
uint8_t frSkyVoltThreshold ;
int8_t tmrModeB;
uint8_t numVoice;
@@ -75,12 +75,12 @@ inline void applyStickModeToModel(Er9xModelData & model, unsigned int mode)
for (int i=0; i<ER9X_MAX_MIXERS; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ER9X_NUM_CSW; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -510,9 +510,9 @@ t_Ersky9xModelData_v10::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -587,7 +587,7 @@ t_Ersky9xModelData_v10::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V10; i++)
// c9x.safetySw[i] = safetySw[i];
@@ -626,9 +626,9 @@ t_Ersky9xModelData_v11::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc-2;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncInstantTrim;
c9x.customFn[0].func = FuncInstantTrim;
if (trimSw) {
c9x.funcSw[0].swtch = er9xToSwitch(trimSw);
c9x.customFn[0].swtch = er9xToSwitch(trimSw);
}
c9x.beepANACenter = beepANACenter;
c9x.moduleData[0].ppmPulsePol = pulsePol;
@@ -703,7 +703,7 @@ t_Ersky9xModelData_v11::operator ModelData ()
}
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<ERSKY9X_NUM_CHNOUT_V11; i++)
// c9x.safetySw[i] = safetySw[i];
@@ -246,13 +246,13 @@ PACK(typedef struct t_Ersky9xFlightModeData {
uint16_t spare ; // Future expansion
}) Ersky9xFlightModeData;
PACK(typedef struct t_Ersky9xFuncSwData { // Function Switches data
PACK(typedef struct t_Ersky9xCustomFunctionData { // Function Switches data
int8_t swtch; //input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
}) Ersky9xFuncSwData;
}) Ersky9xCustomFunctionData;
PACK(typedef struct t_Ersky9xFrSkyChannelData_v10 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -360,7 +360,7 @@ PACK(typedef struct t_Ersky9xModelData_v10 {
int8_t trim[4];
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
Ersky9xLogicalSwitchData_v10 customSw[ERSKY9X_NUM_CSW_V10];
Ersky9xLogicalSwitchData_v10 logicalSw[ERSKY9X_NUM_CSW_V10];
uint8_t frSkyVoltThreshold ;
uint8_t res3[2];
Ersky9xSafetySwData_v10 safetySw[ERSKY9X_NUM_CHNOUT_V10];
@@ -409,7 +409,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
int8_t curves5[ERSKY9X_MAX_CURVE5][5];
int8_t curves9[ERSKY9X_MAX_CURVE9][9];
int8_t curvexy[18];
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
Ersky9xLogicalSwitchData_v11 logicalSw[ERSKY9X_NUM_CSW_V11];
uint8_t frSkyVoltThreshold ;
uint8_t bt_telemetry;
uint8_t numVoice; // 0-16, rest are Safety switches
@@ -420,7 +420,7 @@ PACK(typedef struct t_Ersky9xModelData_v11 {
Ersky9xFrSkyAlarmData_v11 frskyAlarms ;
// Add 6 bytes for custom telemetry screen
uint8_t customDisplayIndex[6] ;
Ersky9xFuncSwData funcSw[ERSKY9X_NUM_FSW];
Ersky9xCustomFunctionData customFn[ERSKY9X_NUM_FSW];
Ersky9xFlightModeData flightModeData[6] ;
Ersky9xGvarData gvars[ERSKY9X_MAX_GVARS] ;
@@ -74,12 +74,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v10 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V10; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V10; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -106,12 +106,12 @@ inline void applyStickModeToModel(Ersky9xModelData_v11 & model, unsigned int mod
for (int i=0; i<ERSKY9X_MAX_MIXERS_V11; i++)
model.mixData[i].srcRaw = applyStickMode(model.mixData[i].srcRaw, mode);
for (int i=0; i<ERSKY9X_NUM_CSW_V11; i++) {
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
switch (LogicalSwitchData(model.logicalSw[i].func).getFunctionFamily()) {
case LS_FAMILY_VCOMP:
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
model.logicalSw[i].v2 = applyStickMode(model.logicalSw[i].v2, mode);
// no break
case LS_FAMILY_VOFS:
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
model.logicalSw[i].v1 = applyStickMode(model.logicalSw[i].v1, mode);
break;
default:
break;
@@ -322,9 +322,9 @@ Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
return c9x;
}
Gruvin9xFuncSwData::operator FuncSwData ()
Gruvin9xCustomFunctionData::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = gruvin9xToSwitch(swtch);
c9x.func = (AssignFunc)(func + G9X_NUM_CHNOUT);
return c9x;
@@ -476,7 +476,7 @@ t_Gruvin9xModelData_v102::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -546,7 +546,7 @@ t_Gruvin9xModelData_v103::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -633,9 +633,9 @@ t_Gruvin9xModelData_v105::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -716,9 +716,9 @@ t_Gruvin9xModelData_v106::operator ModelData ()
}
for (int i=0; i<G9X_NUM_CSW; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<G9X_NUM_FSW; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<G9X_NUM_CHNOUT; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -202,13 +202,13 @@ PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
t_Gruvin9xSafetySwData() { memset(this, 0, sizeof(t_Gruvin9xSafetySwData)); }
}) Gruvin9xSafetySwData;
PACK(typedef struct t_Gruvin9xFuncSwData { // Function Switches data
PACK(typedef struct t_Gruvin9xCustomFunctionData { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator FuncSwData();
t_Gruvin9xFuncSwData() { memset(this, 0, sizeof(t_Gruvin9xFuncSwData)); }
}) Gruvin9xFuncSwData;
operator CustomFunctionData();
t_Gruvin9xCustomFunctionData() { memset(this, 0, sizeof(t_Gruvin9xCustomFunctionData)); }
}) Gruvin9xCustomFunctionData;
PACK(typedef struct t_Gruvin9xFrSkyChannelData {
uint16_t ratio:12; // (Maximum resistor divider input volts +/- calibration. 0 means channel not used.
@@ -309,7 +309,7 @@ PACK(typedef struct t_Gruvin9xModelData_v102 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -341,7 +341,7 @@ PACK(typedef struct t_Gruvin9xModelData_v103 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
@@ -373,9 +373,9 @@ PACK(typedef struct t_Gruvin9xModelData_v105 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v102 flightModeData[G9X_MAX_FLIGHT_MODES];
int16_t subtrim[NUM_STICKS];
@@ -405,9 +405,9 @@ PACK(typedef struct t_Gruvin9xModelData_v106 {
Gruvin9xExpoData expoData[G9X_MAX_EXPOS];
int8_t curves5[G9X_MAX_CURVE5][5];
int8_t curves9[G9X_MAX_CURVE9][9];
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
Gruvin9xLogicalSwitchData logicalSw[G9X_NUM_CSW];
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
Gruvin9xCustomFunctionData customFn[G9X_NUM_FSW];
Gruvin9xSwashRingData swashR;
Gruvin9xFlightModeData_v106 flightModeData[G9X_MAX_FLIGHT_MODES];
Gruvin9xFrSkyData frsky;
@@ -339,9 +339,9 @@ Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
return c9x;
}
t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
t_Open9xGruvin9xCustomFunctionData_v203::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.func = (AssignFunc)(func);
@@ -378,9 +378,9 @@ t_Open9xGruvin9xFuncSwData_v203::operator FuncSwData ()
return c9x;
}
t_Open9xGruvin9xFuncSwData_v210::operator FuncSwData ()
t_Open9xGruvin9xCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
@@ -494,9 +494,9 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -577,9 +577,9 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -666,9 +666,9 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -759,9 +759,9 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -846,9 +846,9 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
}
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -132,24 +132,24 @@ PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches
RawSource toSource(int8_t value);
}) Open9xGruvin9xLogicalSwitchData_v209;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v203)); }
}) Open9xGruvin9xFuncSwData_v203;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v203)); }
}) Open9xGruvin9xCustomFunctionData_v203;
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xGruvin9xCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator FuncSwData();
t_Open9xGruvin9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xFuncSwData_v210)); }
}) Open9xGruvin9xFuncSwData_v210;
operator CustomFunctionData();
t_Open9xGruvin9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomFunctionData_v210)); }
}) Open9xGruvin9xCustomFunctionData_v210;
PACK(typedef struct t_Open9xGruvin9xSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -194,8 +194,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v207 flightModeData[5];
Open9xFrSkyData_v205 frsky;
@@ -228,8 +228,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v207 customSw[12];
Open9xGruvin9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v207 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v208 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -267,8 +267,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v203 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v203 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -307,8 +307,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v210 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
@@ -345,8 +345,8 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xGruvin9xLogicalSwitchData_v209 customSw[12];
Open9xGruvin9xFuncSwData_v210 funcSw[16];
Open9xGruvin9xLogicalSwitchData_v209 logicalSw[12];
Open9xGruvin9xCustomFunctionData_v210 customFn[16];
Open9xGruvin9xSwashRingData_v209 swashR;
Open9xGruvin9xFlightModeData_v208 flightModeData[5];
@@ -571,9 +571,9 @@ t_Open9xArmLogicalSwitchData_v210::operator LogicalSwitchData ()
return c9x;
}
t_Open9xArmFuncSwData_v208::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v208::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
if (c9x.func <= FuncOverrideCH32) {
@@ -589,9 +589,9 @@ t_Open9xArmFuncSwData_v208::operator FuncSwData ()
return c9x;
}
t_Open9xArmFuncSwData_v210::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -613,9 +613,9 @@ t_Open9xArmFuncSwData_v210::operator FuncSwData ()
return c9x;
}
t_Open9xArmFuncSwData_v211::operator FuncSwData ()
t_Open9xArmCustomFunctionData_v211::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xArmToSwitch(swtch);
c9x.func = (AssignFunc)(func);
uint32_t value = *((uint32_t *)param);
@@ -798,9 +798,9 @@ t_Open9xArmModelData_v208::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -887,9 +887,9 @@ t_Open9xArmModelData_v209::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -977,9 +977,9 @@ t_Open9xArmModelData_v210::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1064,9 +1064,9 @@ t_Open9xArmModelData_v211::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -1151,9 +1151,9 @@ t_Open9xArmModelData_v212::operator ModelData ()
}
}
for (int i=0; i<32; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<32; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -208,34 +208,34 @@ PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
}) Open9xArmLogicalSwitchData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v208 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xArmFuncSwData_v208() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v208)); }
}) Open9xArmFuncSwData_v208;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v208)); }
}) Open9xArmCustomFunctionData_v208;
PACK(typedef struct t_Open9xArmFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
operator FuncSwData();
t_Open9xArmFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v210)); }
}) Open9xArmFuncSwData_v210;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v210)); }
}) Open9xArmCustomFunctionData_v210;
PACK(typedef struct t_Open9xArmFuncSwData_v211 { // Function Switches data
PACK(typedef struct t_Open9xArmCustomFunctionData_v211 { // Function Switches data
int8_t swtch; // input
uint8_t func;
char param[6];
uint8_t delay;
uint8_t spare;
operator FuncSwData();
t_Open9xArmFuncSwData_v211() { memset(this, 0, sizeof(t_Open9xArmFuncSwData_v211)); }
}) Open9xArmFuncSwData_v211;
operator CustomFunctionData();
t_Open9xArmCustomFunctionData_v211() { memset(this, 0, sizeof(t_Open9xArmCustomFunctionData_v211)); }
}) Open9xArmCustomFunctionData_v211;
PACK(typedef struct t_Open9xArmSwashRingData_v208 { // Swash Ring data
uint8_t invertELE:1;
@@ -332,8 +332,8 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v208 customSw[32];
Open9xArmFuncSwData_v208 funcSw[32];
Open9xArmLogicalSwitchData_v208 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmSwashRingData_v208 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xFrSkyData_v208 frsky;
@@ -371,8 +371,8 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
Open9xArmExpoData_v208 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v209 customSw[32];
Open9xArmFuncSwData_v208 funcSw[32];
Open9xArmLogicalSwitchData_v209 logicalSw[32];
Open9xArmCustomFunctionData_v208 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xFrSkyData_v208 frsky;
@@ -411,8 +411,8 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
Open9xArmExpoData_v210 expoData[32];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v210 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v210 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
Open9xArmFrSkyData_v210 frsky;
@@ -450,8 +450,8 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
Open9xArmExpoData_v210 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v211 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmSwashRingData_v209 swashR;
Open9xArmFlightModeData_v208 flightModeData[9];
@@ -488,8 +488,8 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
Open9xArmExpoData_v212 expoData[32];
int16_t curves[16];
int8_t points[512];
Open9xArmLogicalSwitchData_v210 customSw[32];
Open9xArmFuncSwData_v211 funcSw[32];
Open9xArmLogicalSwitchData_v210 logicalSw[32];
Open9xArmCustomFunctionData_v211 customFn[32];
Open9xArmSwashRingData_v210 swashR;
Open9xArmFlightModeData_v212 flightModeData[9];
@@ -564,9 +564,9 @@ Open9xLogicalSwitchData_v209::operator LogicalSwitchData ()
return c9x;
}
t_Open9xFuncSwData_v201::operator FuncSwData ()
t_Open9xCustomFunctionData_v201::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.func = (AssignFunc)(func+16);
return c9x;
@@ -598,9 +598,9 @@ enum Functions {
FUNC_MAX
};
t_Open9xFuncSwData_v203::operator FuncSwData ()
t_Open9xCustomFunctionData_v203::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
if (func < 16) {
c9x.enabled=param & 0x01;
@@ -628,9 +628,9 @@ t_Open9xFuncSwData_v203::operator FuncSwData ()
return c9x;
}
t_Open9xFuncSwData_v210::operator FuncSwData ()
t_Open9xCustomFunctionData_v210::operator CustomFunctionData ()
{
FuncSwData c9x;
CustomFunctionData c9x;
c9x.swtch = open9xStockToSwitch(swtch);
c9x.param = param;
if (func < 22) {
@@ -977,9 +977,9 @@ t_Open9xModelData_v201::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<12; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<16; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -1051,9 +1051,9 @@ t_Open9xModelData_v202::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<12; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
// for (int i=0; i<16; i++)
// c9x.safetySw[i] = safetySw[i];
c9x.swashRingData = swashR;
@@ -1127,9 +1127,9 @@ t_Open9xModelData_v203::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -1201,9 +1201,9 @@ t_Open9xModelData_v204::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.rssiAlarms[0] = frskyRssiAlarms[0].get(0);
@@ -1280,9 +1280,9 @@ t_Open9xModelData_v205::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
@@ -1366,9 +1366,9 @@ t_Open9xModelData_v208::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1459,9 +1459,9 @@ t_Open9xModelData_v209::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.frsky.varioSource = varioSource;
@@ -1556,9 +1556,9 @@ t_Open9xModelData_v210::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -1644,9 +1644,9 @@ t_Open9xModelData_v211::operator ModelData ()
}
for (int i=0; i<12; i++)
c9x.customSw[i] = customSw[i];
c9x.logicalSw[i] = logicalSw[i];
for (int i=0; i<16; i++)
c9x.funcSw[i] = funcSw[i];
c9x.customFn[i] = customFn[i];
c9x.swashRingData = swashR;
c9x.frsky = frsky;
c9x.switchWarningStates = switchWarningStates;
@@ -247,32 +247,32 @@ PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
t_Open9xSafetySwData() { memset(this, 0, sizeof(t_Open9xSafetySwData)); }
}) Open9xSafetySwData;
PACK(typedef struct t_Open9xFuncSwData_v201 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v201 { // Function Switches data
int8_t swtch; // input
uint8_t func;
operator FuncSwData();
t_Open9xFuncSwData_v201() { memset(this, 0, sizeof(t_Open9xFuncSwData_v201)); }
}) Open9xFuncSwData_v201;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v201() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v201)); }
}) Open9xCustomFunctionData_v201;
PACK(typedef struct t_Open9xFuncSwData_v203 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v203 { // Function Switches data
int8_t swtch; // input
uint8_t func;
uint8_t param;
operator FuncSwData();
t_Open9xFuncSwData_v203() { memset(this, 0, sizeof(t_Open9xFuncSwData_v203)); }
}) Open9xFuncSwData_v203;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v203() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v203)); }
}) Open9xCustomFunctionData_v203;
PACK(typedef struct t_Open9xFuncSwData_v210 { // Function Switches data
PACK(typedef struct t_Open9xCustomFunctionData_v210 { // Function Switches data
int8_t swtch; // input
uint8_t func:5;
uint8_t delay:3;
uint8_t param;
operator FuncSwData();
t_Open9xFuncSwData_v210() { memset(this, 0, sizeof(t_Open9xFuncSwData_v210)); }
}) Open9xFuncSwData_v210;
operator CustomFunctionData();
t_Open9xCustomFunctionData_v210() { memset(this, 0, sizeof(t_Open9xCustomFunctionData_v210)); }
}) Open9xCustomFunctionData_v210;
PACK(typedef struct t_Open9xFrSkyChannelData_v201 {
uint8_t ratio; // 0.0 means not used, 0.1V steps EG. 6.6 Volts = 66. 25.1V = 251, etc.
@@ -502,9 +502,9 @@ PACK(typedef struct t_Open9xModelData_v201 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xFuncSwData_v201 funcSw[12];
Open9xCustomFunctionData_v201 customFn[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v201 frsky;
@@ -533,9 +533,9 @@ PACK(typedef struct t_Open9xModelData_v202 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xSafetySwData safetySw[16];
Open9xFuncSwData_v201 funcSw[12];
Open9xCustomFunctionData_v201 customFn[12];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v202 frsky;
@@ -567,8 +567,8 @@ PACK(typedef struct t_Open9xModelData_v203 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v202 frsky;
@@ -600,8 +600,8 @@ PACK(typedef struct t_Open9xModelData_v204 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v204 frsky;
@@ -633,8 +633,8 @@ PACK(typedef struct t_Open9xModelData_v205 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v205 frsky;
@@ -668,8 +668,8 @@ PACK(typedef struct t_Open9xModelData_v208 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v208 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v208 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v208 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -707,8 +707,8 @@ PACK(typedef struct t_Open9xModelData_v209 {
Open9xExpoData_v201 expoData[14];
int8_t curves5[8][5];
int8_t curves9[8][9];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v203 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v203 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
Open9xFrSkyData_v208 frsky;
@@ -747,8 +747,8 @@ PACK(typedef struct t_Open9xModelData_v210 {
Open9xExpoData_v201 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v210 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
@@ -785,8 +785,8 @@ PACK(typedef struct t_Open9xModelData_v211 {
Open9xExpoData_v211 expoData[14];
int8_t curves[8];
int8_t points[112-8];
Open9xLogicalSwitchData_v209 customSw[12];
Open9xFuncSwData_v210 funcSw[16];
Open9xLogicalSwitchData_v209 logicalSw[12];
Open9xCustomFunctionData_v210 customFn[16];
Open9xSwashRingData_v209 swashR;
Open9xFlightModeData_v201 flightModeData[5];
@@ -65,6 +65,7 @@ namespace Open9xGruvin9x {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -66,6 +66,7 @@ namespace OpenTxM128 {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -71,6 +71,7 @@ namespace OpenTxM64 {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/pulses/pulses_avr.cpp"
@@ -78,6 +78,7 @@ namespace Open9xSky9x {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/targets/sky9x/pulses_driver.cpp"
@@ -81,6 +81,7 @@ inline int geteepromsize() {
#include "radio/src/opentx.cpp"
#include "radio/src/strhelpers.cpp"
#include "radio/src/switches.cpp"
#include "radio/src/functions.cpp"
#include "radio/src/curves.cpp"
#include "radio/src/mixer.cpp"
#include "radio/src/targets/taranis/pulses_driver.cpp"
@@ -1879,7 +1879,7 @@ class SwitchesWarningField: public TransformedField {
class ArmCustomFunctionField: public TransformedField {
public:
ArmCustomFunctionField(FuncSwData & fn, BoardEnum board, unsigned int version, unsigned int variant):
ArmCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
TransformedField(internalField),
internalField("CustomFunction"),
fn(fn),
@@ -2073,7 +2073,7 @@ class ArmCustomFunctionField: public TransformedField {
protected:
StructField internalField;
FuncSwData & fn;
CustomFunctionData & fn;
BoardEnum board;
unsigned int version;
unsigned int variant;
@@ -2086,7 +2086,7 @@ class ArmCustomFunctionField: public TransformedField {
class AvrCustomFunctionField: public TransformedField {
public:
AvrCustomFunctionField(FuncSwData & fn, BoardEnum board, unsigned int version, unsigned int variant):
AvrCustomFunctionField(CustomFunctionData & fn, BoardEnum board, unsigned int version, unsigned int variant):
TransformedField(internalField),
internalField("CustomFunction"),
fn(fn),
@@ -2237,7 +2237,7 @@ class AvrCustomFunctionField: public TransformedField {
protected:
StructField internalField;
FuncSwData & fn;
CustomFunctionData & fn;
BoardEnum board;
unsigned int version;
unsigned int variant;
@@ -2645,12 +2645,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new InputField(modelData.expoData[i], board, version));
internalField.Append(new CurvesField(modelData.curves, board, version));
for (int i=0; i<MAX_CUSTOM_SWITCHES(board, version); i++)
internalField.Append(new LogicalSwitchField(modelData.customSw[i], board, version, variant, &modelData));
internalField.Append(new LogicalSwitchField(modelData.logicalSw[i], board, version, variant, &modelData));
for (int i=0; i<MAX_CUSTOM_FUNCTIONS(board, version); i++) {
if (IS_ARM(board))
internalField.Append(new ArmCustomFunctionField(modelData.funcSw[i], board, version, variant));
internalField.Append(new ArmCustomFunctionField(modelData.customFn[i], board, version, variant));
else
internalField.Append(new AvrCustomFunctionField(modelData.funcSw[i], board, version, variant));
internalField.Append(new AvrCustomFunctionField(modelData.customFn[i], board, version, variant));
}
internalField.Append(new HeliField(modelData.swashRingData, board, version, variant));
for (int i=0; i<MAX_FLIGHT_MODES(board, version); i++)
+2 -2
View File
@@ -274,9 +274,9 @@ t_Th9xModelData::operator ModelData ()
c9x.thrTrim = thrTrim;
c9x.trimInc = trimInc;
c9x.moduleData[0].ppmDelay = 300 + 50 * ppmDelay;
c9x.funcSw[0].func = FuncTrims2Offsets;
c9x.customFn[0].func = FuncTrims2Offsets;
if (trimSw) {
c9x.funcSw[0].swtch = trimSw;
c9x.customFn[0].swtch = trimSw;
}
c9x.beepANACenter = beepANACenter;
c9x.pulsePol = pulsePol;
+64 -62
View File
@@ -70,8 +70,8 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
if (!firmware->getCapability(VoicesAsNumbers)) {
for (int i=0; i<num_fsw; i++) {
if (model.funcSw[i].func==FuncPlayPrompt || model.funcSw[i].func==FuncBackgroundMusic) {
QString temp = model.funcSw[i].paramarm;
if (model.customFn[i].func==FuncPlayPrompt || model.customFn[i].func==FuncBackgroundMusic) {
QString temp = model.customFn[i].paramarm;
if (!temp.isEmpty()) {
if (!paramarmList.contains(temp)) {
paramarmList.append(temp);
@@ -181,7 +181,7 @@ CustomFunctionsPanel::CustomFunctionsPanel(QWidget * parent, ModelData & model,
QHBoxLayout *repeatLayout = new QHBoxLayout();
gridLayout->addLayout(repeatLayout, i+1, 4);
fswtchRepeat[i] = new RepeatComboBox(this, model.funcSw[i].repeatParam);
fswtchRepeat[i] = new RepeatComboBox(this, model.customFn[i].repeatParam);
repeatLayout->addWidget(fswtchRepeat[i], i+1);
connect(fswtchRepeat[i], SIGNAL(modified()), this, SLOT(onChildModified()));
@@ -308,12 +308,14 @@ void CustomFunctionsPanel::onChildModified()
void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
{
CustomFunctionData & cfn = model.customFn[i];
unsigned int widgetsMask = 0;
if (modified) {
model.funcSw[i].swtch = RawSwitch(fswtchSwtch[i]->itemData(fswtchSwtch[i]->currentIndex()).toInt());
model.funcSw[i].func = (AssignFunc)fswtchFunc[i]->currentIndex();
model.funcSw[i].enabled = fswtchEnable[i]->isChecked();
model.funcSw[i].adjustMode = (AssignFunc)fswtchGVmode[i]->currentIndex();
cfn.swtch = RawSwitch(fswtchSwtch[i]->itemData(fswtchSwtch[i]->currentIndex()).toInt());
cfn.func = (AssignFunc)fswtchFunc[i]->currentIndex();
cfn.enabled = fswtchEnable[i]->isChecked();
cfn.adjustMode = (AssignFunc)fswtchGVmode[i]->currentIndex();
}
int index = fswtchFunc[i]->currentIndex();
@@ -325,9 +327,9 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
fswtchParam[i]->setMinimum(-channelsMax);
fswtchParam[i]->setMaximum(channelsMax);
if (modified) {
model.funcSw[i].param = fswtchParam[i]->value();
cfn.param = fswtchParam[i]->value();
}
fswtchParam[i]->setValue(model.funcSw[i].param);
fswtchParam[i]->setValue(cfn.param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (index==FuncLogs) {
@@ -335,15 +337,15 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
fswtchParam[i]->setMinimum(0);
fswtchParam[i]->setMaximum(25.5);
fswtchParam[i]->setSingleStep(0.1);
if (modified) model.funcSw[i].param = fswtchParam[i]->value()*10.0;
fswtchParam[i]->setValue(model.funcSw[i].param/10.0);
if (modified) cfn.param = fswtchParam[i]->value()*10.0;
fswtchParam[i]->setValue(cfn.param/10.0);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
}
else if (index>=FuncAdjustGV1 && index<=FuncAdjustGVLast) {
if (modified) model.funcSw[i].adjustMode = fswtchGVmode[i]->currentIndex();
if (modified) cfn.adjustMode = fswtchGVmode[i]->currentIndex();
widgetsMask |= CUSTOM_FUNCTION_GV_MODE + CUSTOM_FUNCTION_ENABLE;
if (model.funcSw[i].adjustMode==0) {
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
if (cfn.adjustMode==0) {
if (modified) cfn.param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
if (IS_ARM(GetEepromInterface()->getBoard())) {
@@ -354,32 +356,32 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
fswtchParam[i]->setMinimum(-125);
fswtchParam[i]->setMaximum(125);
}
fswtchParam[i]->setValue(model.funcSw[i].param);
fswtchParam[i]->setValue(cfn.param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM;
}
else {
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param, model.funcSw[i].adjustMode);
if (modified) cfn.param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param, cfn.adjustMode);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncReset) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param);
if (modified) cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM | CUSTOM_FUNCTION_ENABLE;
}
else if (index>=FuncSetTimer1 && index<=FuncSetTimer2) {
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
if (modified) cfn.param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setMinimum(0);
fswtchParam[i]->setMaximum(59*60+59);
fswtchParam[i]->setValue(model.funcSw[i].param);
fswtchParam[i]->setValue(cfn.param);
widgetsMask |= CUSTOM_FUNCTION_NUMERIC_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (index==FuncVolume) {
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param);
if (modified) cfn.param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_ENABLE;
}
else if (index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic) {
@@ -388,8 +390,8 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
fswtchRepeat[i]->update();
}
if (index==FuncPlayValue) {
if (modified) model.funcSw[i].param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param);
if (modified) cfn.param = fswtchParamT[i]->itemData(fswtchParamT[i]->currentIndex()).toInt();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM + CUSTOM_FUNCTION_REPEAT;
}
else if (index==FuncPlayPrompt || index==FuncPlayBoth) {
@@ -408,38 +410,38 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
if (modified) {
if (fswtchParamGV[i]->isChecked()) {
fswtchParam[i]->setMinimum(1);
model.funcSw[i].param = std::min(fswtchParam[i]->value(),5.0)+(fswtchParamGV[i]->isChecked() ? 250 : 0);
cfn.param = std::min(fswtchParam[i]->value(),5.0)+(fswtchParamGV[i]->isChecked() ? 250 : 0);
}
else {
model.funcSw[i].param = fswtchParam[i]->value();
cfn.param = fswtchParam[i]->value();
}
}
if (model.funcSw[i].param>250 && (index!=FuncPlayBoth)) {
if (cfn.param>250 && (index!=FuncPlayBoth)) {
fswtchParamGV[i]->setChecked(true);
fswtchParam[i]->setValue(model.funcSw[i].param-250);
fswtchParam[i]->setValue(cfn.param-250);
fswtchParam[i]->setMaximum(5);
}
else {
fswtchParamGV[i]->setChecked(false);
fswtchParam[i]->setValue(model.funcSw[i].param);
fswtchParam[i]->setValue(cfn.param);
}
if (model.funcSw[i].param < 251)
if (cfn.param < 251)
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
else {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
int vml = firmware->getCapability(VoicesMaxLength);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(), vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
else {
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
populateFuncParamArmTCB(fswtchParamArmT[i], cfn.paramarm, paramarmList);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
}
@@ -449,37 +451,37 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
else if (index==FuncBackgroundMusic) {
widgetsMask |= CUSTOM_FUNCTION_FILE_PARAM;
if (modified) {
memset(model.funcSw[i].paramarm, 0, sizeof(model.funcSw[i].paramarm));
memset(cfn.paramarm, 0, sizeof(cfn.paramarm));
int vml=firmware->getCapability(VoicesMaxLength);
if (fswtchParamArmT[i]->currentText() != "----") {
widgetsMask |= CUSTOM_FUNCTION_PLAY;
for (int j=0; j<std::min(fswtchParamArmT[i]->currentText().length(),vml); j++) {
model.funcSw[i].paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
cfn.paramarm[j] = fswtchParamArmT[i]->currentText().toAscii().at(j);
}
}
}
}
else if (index==FuncPlaySound) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param);
if (modified) cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
else if (index==FuncPlayHaptic) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, model.funcSw[i].param);
if (modified) cfn.param = (uint8_t)fswtchParamT[i]->currentIndex();
populateFuncParamCB(fswtchParamT[i], model, index, cfn.param);
widgetsMask |= CUSTOM_FUNCTION_SOURCE_PARAM;
}
}
else if (index==FuncBacklight && IS_TARANIS_PLUS(GetEepromInterface()->getBoard())) {
if (modified) model.funcSw[i].param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(model.funcSw[i].param);
if (modified) cfn.param = (uint8_t)fswtchBLcolor[i]->value();
fswtchBLcolor[i]->setValue(cfn.param);
widgetsMask |= CUSTOM_FUNCTION_BL_COLOR;
}
else {
if (modified) model.funcSw[i].param = fswtchParam[i]->value();
if (modified) cfn.param = fswtchParam[i]->value();
fswtchParam[i]->setDecimals(0);
fswtchParam[i]->setSingleStep(1);
fswtchParam[i]->setValue(model.funcSw[i].param);
fswtchParam[i]->setValue(cfn.param);
if (index <= FuncInstantTrim) {
widgetsMask |= CUSTOM_FUNCTION_ENABLE;
}
@@ -491,7 +493,7 @@ void CustomFunctionsPanel::refreshCustomFunction(int i, bool modified)
fswtchParamArmT[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_FILE_PARAM);
fswtchEnable[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_ENABLE);
if (widgetsMask & CUSTOM_FUNCTION_ENABLE)
fswtchEnable[i]->setChecked(model.funcSw[i].enabled);
fswtchEnable[i]->setChecked(cfn.enabled);
else
fswtchEnable[i]->setChecked(false);
fswtchRepeat[i]->setVisible(widgetsMask & CUSTOM_FUNCTION_REPEAT);
@@ -507,11 +509,11 @@ void CustomFunctionsPanel::update()
lock = true;
for (int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (!initialized) {
populateSwitchCB(fswtchSwtch[i], model.funcSw[i].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[i], model.funcSw[i].func);
populateGVmodeCB(fswtchGVmode[i], model.funcSw[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.funcSw[i].func, model.funcSw[i].param, model.funcSw[i].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[i], model.funcSw[i].paramarm, paramarmList);
populateSwitchCB(fswtchSwtch[i], model.customFn[i].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[i], model.customFn[i].func);
populateGVmodeCB(fswtchGVmode[i], model.customFn[i].adjustMode);
populateFuncParamCB(fswtchParamT[i], model, model.customFn[i].func, model.customFn[i].param, model.customFn[i].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[i], model.customFn[i].paramarm, paramarmList);
}
refreshCustomFunction(i);
}
@@ -525,14 +527,14 @@ void CustomFunctionsPanel::fswPaste()
const QMimeData *mimeData = clipboard->mimeData();
if (mimeData->hasFormat("application/x-companion-fsw")) {
QByteArray fswData = mimeData->data("application/x-companion-fsw");
FuncSwData *fsw = &model.funcSw[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(FuncSwData)).constData(), sizeof(FuncSwData));
CustomFunctionData *fsw = &model.customFn[selectedFunction];
memcpy(fsw, fswData.mid(0, sizeof(CustomFunctionData)).constData(), sizeof(CustomFunctionData));
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.funcSw[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.funcSw[selectedFunction].func, model.funcSw[selectedFunction].param, model.funcSw[selectedFunction].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.funcSw[selectedFunction].paramarm, paramarmList);
populateSwitchCB(fswtchSwtch[selectedFunction], model.customFn[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.customFn[selectedFunction].func);
populateGVmodeCB(fswtchGVmode[selectedFunction], model.customFn[selectedFunction].adjustMode);
populateFuncParamCB(fswtchParamT[selectedFunction], model, model.customFn[selectedFunction].func, model.customFn[selectedFunction].param, model.customFn[selectedFunction].adjustMode);
populateFuncParamArmTCB(fswtchParamArmT[selectedFunction], model.customFn[selectedFunction].paramarm, paramarmList);
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();
@@ -541,11 +543,11 @@ void CustomFunctionsPanel::fswPaste()
void CustomFunctionsPanel::fswDelete()
{
model.funcSw[selectedFunction].clear();
model.customFn[selectedFunction].clear();
// TODO update switch and func
lock = true;
populateSwitchCB(fswtchSwtch[selectedFunction], model.funcSw[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.funcSw[selectedFunction].func);
populateSwitchCB(fswtchSwtch[selectedFunction], model.customFn[selectedFunction].swtch, generalSettings, CustomFunctionsContext);
populateFuncCB(fswtchFunc[selectedFunction], model.customFn[selectedFunction].func);
refreshCustomFunction(selectedFunction);
lock = false;
emit modified();
@@ -554,7 +556,7 @@ void CustomFunctionsPanel::fswDelete()
void CustomFunctionsPanel::fswCopy()
{
QByteArray fswData;
fswData.append((char*)&model.funcSw[selectedFunction], sizeof(FuncSwData));
fswData.append((char*)&model.customFn[selectedFunction], sizeof(CustomFunctionData));
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-companion-fsw", fswData);
QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
@@ -590,7 +592,7 @@ void CustomFunctionsPanel::populateFuncCB(QComboBox *b, unsigned int value)
{
b->clear();
for (unsigned int i=0; i<FuncCount; i++) {
b->addItem(FuncSwData(AssignFunc(i)).funcToString());
b->addItem(CustomFunctionData(AssignFunc(i)).funcToString());
if (((i>=FuncOverrideCH1 && i<=FuncOverrideCH32) && !firmware->getCapability(SafetyChannelCustomFunction)) ||
((i==FuncVolume || i==FuncBackgroundMusic || i==FuncBackgroundMusicPause) && !firmware->getCapability(HasVolume)) ||
((i==FuncPlayHaptic) && !firmware->getCapability(Haptic)) ||
+58 -58
View File
@@ -138,11 +138,11 @@ void LogicalSwitchesPanel::v1Edited(int value)
{
if (!lock) {
int i = sender()->property("index").toInt();
model.customSw[i].val1 = cswitchSource1[i]->itemData(value).toInt();
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_VOFS) {
RawSource source = RawSource(model.customSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
model.customSw[i].val2 = (cswitchOffset[i]->value() - range.offset) / range.step;
model.logicalSw[i].val1 = cswitchSource1[i]->itemData(value).toInt();
if (model.logicalSw[i].getFunctionFamily() == LS_FAMILY_VOFS) {
RawSource source = RawSource(model.logicalSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.logicalSw[i].getRangeFlags());
model.logicalSw[i].val2 = (cswitchOffset[i]->value() - range.offset) / range.step;
setSwitchWidgetVisibility(i);
}
emit modified();
@@ -153,7 +153,7 @@ void LogicalSwitchesPanel::v2Edited(int value)
{
if (!lock) {
int i = sender()->property("index").toInt();
model.customSw[i].val2 = cswitchSource2[i]->itemData(value).toInt();
model.logicalSw[i].val2 = cswitchSource2[i]->itemData(value).toInt();
emit modified();
}
}
@@ -162,7 +162,7 @@ void LogicalSwitchesPanel::andEdited(int value)
{
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].andsw = cswitchAnd[index]->itemData(value).toInt();
model.logicalSw[index].andsw = cswitchAnd[index]->itemData(value).toInt();
emit modified();
}
}
@@ -171,7 +171,7 @@ void LogicalSwitchesPanel::durationEdited(double duration)
{
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].duration = (uint8_t)round(duration*10);
model.logicalSw[index].duration = (uint8_t)round(duration*10);
emit modified();
}
}
@@ -180,7 +180,7 @@ void LogicalSwitchesPanel::delayEdited(double delay)
{
if (!lock) {
int index = sender()->property("index").toInt();
model.customSw[index].delay = (uint8_t)round(delay*10);
model.logicalSw[index].delay = (uint8_t)round(delay*10);
emit modified();
}
}
@@ -190,30 +190,30 @@ void LogicalSwitchesPanel::edited()
if (!lock) {
lock = true;
int i = sender()->property("index").toInt();
CSFunctionFamily oldFuncFamily = model.customSw[i].getFunctionFamily();
model.customSw[i].func = csw[i]->itemData(csw[i]->currentIndex()).toInt();
CSFunctionFamily newFuncFamily = model.customSw[i].getFunctionFamily();
CSFunctionFamily oldFuncFamily = model.logicalSw[i].getFunctionFamily();
model.logicalSw[i].func = csw[i]->itemData(csw[i]->currentIndex()).toInt();
CSFunctionFamily newFuncFamily = model.logicalSw[i].getFunctionFamily();
if (oldFuncFamily != newFuncFamily) {
if (newFuncFamily == LS_FAMILY_TIMER) {
model.customSw[i].val1 = -119;
model.customSw[i].val2 = -119;
model.logicalSw[i].val1 = -119;
model.logicalSw[i].val2 = -119;
}
else if (newFuncFamily == LS_FAMILY_EDGE) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = -129;
model.customSw[i].val3 = 0;
model.logicalSw[i].val1 = 0;
model.logicalSw[i].val2 = -129;
model.logicalSw[i].val3 = 0;
}
else if (newFuncFamily == LS_FAMILY_STICKY) {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
model.customSw[i].delay = 0;
model.logicalSw[i].val1 = 0;
model.logicalSw[i].val2 = 0;
model.logicalSw[i].delay = 0;
}
else {
model.customSw[i].val1 = 0;
model.customSw[i].val2 = 0;
model.logicalSw[i].val1 = 0;
model.logicalSw[i].val2 = 0;
}
model.customSw[i].andsw = 0;
model.logicalSw[i].andsw = 0;
setSwitchWidgetVisibility(i);
}
@@ -223,11 +223,11 @@ void LogicalSwitchesPanel::edited()
{
case LS_FAMILY_VOFS:
{
source = RawSource(model.customSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
source = RawSource(model.logicalSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.logicalSw[i].getRangeFlags());
double value = source.isTimeBased() ? QTimeS(cswitchTOffset[i]->time()).seconds() : cswitchOffset[i]->value();
model.customSw[i].val2 = round((value-range.offset)/range.step);;
value = model.customSw[i].val2*range.step + range.offset;
model.logicalSw[i].val2 = round((value-range.offset)/range.step);;
value = model.logicalSw[i].val2*range.step + range.offset;
if (source.isTimeBased())
cswitchTOffset[i]->setTime(QTimeS(round(value)));
else
@@ -235,22 +235,22 @@ void LogicalSwitchesPanel::edited()
break;
}
case LS_FAMILY_TIMER:
model.customSw[i].val1 = TimToVal(cswitchValue[i]->value());
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchValue[i], model.customSw[i].val1, 0.1);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
model.logicalSw[i].val1 = TimToVal(cswitchValue[i]->value());
model.logicalSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchValue[i], model.logicalSw[i].val1, 0.1);
updateTimerParam(cswitchOffset[i], model.logicalSw[i].val2, 0.1);
break;
case LS_FAMILY_EDGE:
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
if (sender() == cswitchOffset[i]) {
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
model.logicalSw[i].val2 = TimToVal(cswitchOffset[i]->value());
updateTimerParam(cswitchOffset[i], model.logicalSw[i].val2, 0.0);
}
else {
model.customSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.customSw[i].val2;
model.logicalSw[i].val3 = TimToVal(cswitchOffset2[i]->value()) - model.logicalSw[i].val2;
}
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
if (model.customSw[i].val3 == 0) {
updateTimerParam(cswitchOffset2[i], model.logicalSw[i].val2+model.logicalSw[i].val3, cswitchOffset[i]->value()-0.1);
if (model.logicalSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix("(infinite)");
}
else {
@@ -294,10 +294,10 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
lock = true;
unsigned int mask = DELAY_ENABLED;
RawSource source = RawSource(model.customSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.customSw[i].getRangeFlags());
RawSource source = RawSource(model.logicalSw[i].val1);
RawSourceRange range = source.getRange(model, generalSettings, model.logicalSw[i].getRangeFlags());
switch (model.customSw[i].getFunctionFamily())
switch (model.logicalSw[i].getFunctionFamily())
{
case LS_FAMILY_VOFS:
mask |= SOURCE1_VISIBLE;
@@ -307,7 +307,7 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
if (source.isTimeBased()) {
mask |= VALUE_TO_VISIBLE;
int maxTime = round(range.max);
int value = round(range.step*model.customSw[i].val2 + range.offset);
int value = round(range.step*model.logicalSw[i].val2 + range.offset);
cswitchTOffset[i]->setMaximumTime(QTimeS(maxTime));
cswitchTOffset[i]->setDisplayFormat((maxTime>=3600)?"hh:mm:ss":"mm:ss");
cswitchTOffset[i]->setTime(QTimeS(value));
@@ -320,24 +320,24 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchOffset[i]->setSuffix(" " + range.unit);
cswitchOffset[i]->setMinimum(range.min);
cswitchOffset[i]->setMaximum(range.max);
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
cswitchOffset[i]->setValue(range.step*(model.logicalSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
}
break;
case LS_FAMILY_STICKY:
// no break
case LS_FAMILY_VBOOL:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2), generalSettings, LogicalSwitchesContext);
populateSwitchCB(cswitchSource1[i], RawSwitch(model.logicalSw[i].val1), generalSettings, LogicalSwitchesContext);
populateSwitchCB(cswitchSource2[i], RawSwitch(model.logicalSw[i].val2), generalSettings, LogicalSwitchesContext);
break;
case LS_FAMILY_EDGE:
mask |= SOURCE1_VISIBLE | VALUE2_VISIBLE | VALUE3_VISIBLE;
mask &= ~DELAY_ENABLED;
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model.customSw[i].val2+model.customSw[i].val3, cswitchOffset[i]->value()-0.1);
populateSwitchCB(cswitchSource1[i], RawSwitch(model.logicalSw[i].val1), generalSettings, LogicalSwitchesContext);
updateTimerParam(cswitchOffset[i], model.logicalSw[i].val2, 0.0);
updateTimerParam(cswitchOffset2[i], model.logicalSw[i].val2+model.logicalSw[i].val3, cswitchOffset[i]->value()-0.1);
cswitchOffset2[i]->setSpecialValueText(tr("(no release)"));
if (model.customSw[i].val3 == 0) {
if (model.logicalSw[i].val3 == 0) {
cswitchOffset2[i]->setSuffix(tr("(infinite)"));
}
else {
@@ -346,13 +346,13 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
break;
case LS_FAMILY_VCOMP:
mask |= SOURCE1_VISIBLE | SOURCE2_VISIBLE;
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
populateSourceCB(cswitchSource1[i], RawSource(model.logicalSw[i].val1), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
populateSourceCB(cswitchSource2[i], RawSource(model.logicalSw[i].val2), model, POPULATE_SOURCES | POPULATE_SCRIPT_OUTPUTS | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (firmware->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
break;
case LS_FAMILY_TIMER:
mask |= VALUE1_VISIBLE | VALUE2_VISIBLE;
updateTimerParam(cswitchValue[i], model.customSw[i].val1, 0.1);
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, 0.1);
updateTimerParam(cswitchValue[i], model.logicalSw[i].val1, 0.1);
updateTimerParam(cswitchOffset[i], model.logicalSw[i].val2, 0.1);
break;
}
@@ -364,8 +364,8 @@ void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
cswitchTOffset[i]->setVisible(mask & VALUE_TO_VISIBLE);
if (firmware->getCapability(LogicalSwitchesExt)) {
cswitchDelay[i]->setEnabled(mask & DELAY_ENABLED);
cswitchDuration[i]->setValue(model.customSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.customSw[i].delay/10.0);
cswitchDuration[i]->setValue(model.logicalSw[i].duration/10.0);
cswitchDelay[i]->setValue(model.logicalSw[i].delay/10.0);
}
lock = false;
}
@@ -445,11 +445,11 @@ void LogicalSwitchesPanel::populateAndSwitchCB(QComboBox *b, const RawSwitch & v
void LogicalSwitchesPanel::updateLine(int i)
{
lock = true;
populateCSWCB(csw[i], model.customSw[i].func);
populateCSWCB(csw[i], model.logicalSw[i].func);
lock = true;
setSwitchWidgetVisibility(i);
lock = true;
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.logicalSw[i].andsw));
lock = false;
}
@@ -466,7 +466,7 @@ void LogicalSwitchesPanel::cswPaste()
const QMimeData *mimeData = clipboard->mimeData();
if (mimeData->hasFormat("application/x-companion-csw")) {
QByteArray cswData = mimeData->data("application/x-companion-csw");
LogicalSwitchData *csw = &model.customSw[selectedSwitch];
LogicalSwitchData *csw = &model.logicalSw[selectedSwitch];
memcpy(csw, cswData.mid(0, sizeof(LogicalSwitchData)).constData(), sizeof(LogicalSwitchData));
emit modified();
updateLine(selectedSwitch);
@@ -475,7 +475,7 @@ void LogicalSwitchesPanel::cswPaste()
void LogicalSwitchesPanel::cswDelete()
{
model.customSw[selectedSwitch].clear();
model.logicalSw[selectedSwitch].clear();
emit modified();
updateLine(selectedSwitch);
}
@@ -483,7 +483,7 @@ void LogicalSwitchesPanel::cswDelete()
void LogicalSwitchesPanel::cswCopy()
{
QByteArray cswData;
cswData.append((char*)&model.customSw[selectedSwitch],sizeof(LogicalSwitchData));
cswData.append((char*)&model.logicalSw[selectedSwitch],sizeof(LogicalSwitchData));
QMimeData *mimeData = new QMimeData;
mimeData->setData("application/x-companion-csw", cswData);
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
+3 -3
View File
@@ -60,9 +60,9 @@ Templates::~Templates()
void Templates::setSwitch(unsigned int idx, unsigned int func, int v1, int v2)
{
g_model.customSw[idx-1].func = func;
g_model.customSw[idx-1].val1 = v1;
g_model.customSw[idx-1].val2 = v2;
g_model.logicalSw[idx-1].func = func;
g_model.logicalSw[idx-1].val1 = v1;
g_model.logicalSw[idx-1].val2 = v2;
}
void Templates::onDoubleClicked(QModelIndex index)
+10 -10
View File
@@ -577,10 +577,10 @@ void PrintDialog::printSwitches()
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3>");
for (int i=0; i<firmware->getCapability(LogicalSwitches); i++) {
if (g_model->customSw[i].func) {
if (g_model->logicalSw[i].func) {
str.append("<tr>");
str.append("<td width=\"60\"><b>"+tr("L")+QString("%1</b></td>").arg(i+1));
QString tstr = g_model->customSw[i].toString(*g_model, *g_eeGeneral);
QString tstr = g_model->logicalSw[i].toString(*g_model, *g_eeGeneral);
str.append(doTL(tstr,"green"));
str.append("</tr>");
sc++;
@@ -630,21 +630,21 @@ void PrintDialog::printFSwitches()
str.append(doTL(tr("Enabled"), "", true));
str.append("</tr>");
for(int i=0; i<firmware->getCapability(CustomFunctions); i++) {
if (g_model->funcSw[i].swtch.type!=SWITCH_TYPE_NONE) {
if (g_model->customFn[i].swtch.type!=SWITCH_TYPE_NONE) {
str.append("<tr>");
str.append(doTL(tr("SF%1").arg(i+1),"", true));
str.append(doTL(g_model->funcSw[i].swtch.toString(),"green"));
str.append(doTL(g_model->funcSw[i].funcToString(),"green"));
str.append(doTL(g_model->funcSw[i].paramToString(),"green"));
int index=g_model->funcSw[i].func;
if ((g_model->funcSw[i].repeatParam>0) &&
str.append(doTL(g_model->customFn[i].swtch.toString(),"green"));
str.append(doTL(g_model->customFn[i].funcToString(),"green"));
str.append(doTL(g_model->customFn[i].paramToString(),"green"));
int index=g_model->customFn[i].func;
if ((g_model->customFn[i].repeatParam>0) &&
(index==FuncPlaySound || index==FuncPlayHaptic || index==FuncPlayValue || index==FuncPlayPrompt || index==FuncPlayBoth || index==FuncBackgroundMusic)) {
str.append(doTL(QString("%1").arg(g_model->funcSw[i].repeatParam),"green"));
str.append(doTL(QString("%1").arg(g_model->customFn[i].repeatParam),"green"));
} else {
str.append(doTL( "&nbsp;","green"));
}
if ((index<=FuncInstantTrim) || (index>FuncBackgroundMusicPause)) {
str.append(doTL((g_model->funcSw[i].enabled ? "ON" : "OFF"),"green"));
str.append(doTL((g_model->customFn[i].enabled ? "ON" : "OFF"),"green"));
} else {
str.append(doTL( "---","green"));
}
+5 -5
View File
@@ -110,11 +110,11 @@ WizMix::operator ModelData()
// Add the Throttle Cut option
if( options[THROTTLE_CUT_OPTION] && throttleChannel >=0 ){
model.funcSw[switchIndex].swtch.type = SWITCH_TYPE_SWITCH;
model.funcSw[switchIndex].swtch.index = isTaranis ? SWITCH_SF0 : SWITCH_THR;
model.funcSw[switchIndex].enabled = 1;
model.funcSw[switchIndex].func = (AssignFunc)throttleChannel;
model.funcSw[switchIndex].param = -100;
model.customFn[switchIndex].swtch.type = SWITCH_TYPE_SWITCH;
model.customFn[switchIndex].swtch.index = isTaranis ? SWITCH_SF0 : SWITCH_THR;
model.customFn[switchIndex].enabled = 1;
model.customFn[switchIndex].func = (AssignFunc)throttleChannel;
model.customFn[switchIndex].param = -100;
}
// Add the Flight Timer option