Renaming started ... who wants to continue?
This commit is contained in:
@@ -1039,7 +1039,7 @@ void compareDialog::printSwitches()
|
||||
QString str = "<table border=1 cellspacing=0 cellpadding=3 width=\"100%\">";
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=1 cellspacing=0 cellpadding=1 width=\"100%\">");
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
QString sw1 = g_model1->customSw[i].toString(*g_model1);
|
||||
QString sw2 = g_model2->customSw[i].toString(*g_model2);
|
||||
if (!(sw1.isEmpty() && sw2.isEmpty())) {
|
||||
|
||||
@@ -335,71 +335,71 @@ QString CurveReference::toString()
|
||||
}
|
||||
}
|
||||
|
||||
CSFunctionFamily CustomSwData::getFunctionFamily()
|
||||
CSFunctionFamily LogicalSwitchData::getFunctionFamily()
|
||||
{
|
||||
if (func == CS_FN_STAY)
|
||||
return CS_FAMILY_STAY;
|
||||
else if (func == CS_FN_TIMER)
|
||||
return CS_FAMILY_TIMER;
|
||||
else if (func == CS_FN_STICKY)
|
||||
return CS_FAMILY_STICKY;
|
||||
else if (func < CS_FN_AND || func > CS_FN_ELESS)
|
||||
return CS_FAMILY_VOFS;
|
||||
else if (func < CS_FN_EQUAL)
|
||||
return CS_FAMILY_VBOOL;
|
||||
if (func == LS_FN_STAY)
|
||||
return LS_FAMILY_STAY;
|
||||
else if (func == LS_FN_TIMER)
|
||||
return LS_FAMILY_TIMER;
|
||||
else if (func == LS_FN_STICKY)
|
||||
return LS_FAMILY_STICKY;
|
||||
else if (func < LS_FN_AND || func > LS_FN_ELESS)
|
||||
return LS_FAMILY_VOFS;
|
||||
else if (func < LS_FN_EQUAL)
|
||||
return LS_FAMILY_VBOOL;
|
||||
else
|
||||
return CS_FAMILY_VCOMP;
|
||||
return LS_FAMILY_VCOMP;
|
||||
}
|
||||
|
||||
QString CustomSwData::funcToString()
|
||||
QString LogicalSwitchData::funcToString()
|
||||
{
|
||||
switch (func) {
|
||||
case CS_FN_OFF:
|
||||
case LS_FN_OFF:
|
||||
return QObject::tr("---");
|
||||
case CS_FN_VPOS:
|
||||
case LS_FN_VPOS:
|
||||
return QObject::tr("a>x");
|
||||
case CS_FN_VNEG:
|
||||
case LS_FN_VNEG:
|
||||
return QObject::tr("a<x");
|
||||
case CS_FN_APOS:
|
||||
case LS_FN_APOS:
|
||||
return QObject::tr("|a|>x");
|
||||
case CS_FN_ANEG:
|
||||
case LS_FN_ANEG:
|
||||
return QObject::tr("|a|<x");
|
||||
case CS_FN_AND:
|
||||
case LS_FN_AND:
|
||||
return QObject::tr("AND");
|
||||
case CS_FN_OR:
|
||||
case LS_FN_OR:
|
||||
return QObject::tr("OR");
|
||||
case CS_FN_XOR:
|
||||
case LS_FN_XOR:
|
||||
return QObject::tr("XOR");
|
||||
case CS_FN_EQUAL:
|
||||
case LS_FN_EQUAL:
|
||||
return QObject::tr("a=b");
|
||||
case CS_FN_NEQUAL:
|
||||
case LS_FN_NEQUAL:
|
||||
return QObject::tr("a!=b");
|
||||
case CS_FN_GREATER:
|
||||
case LS_FN_GREATER:
|
||||
return QObject::tr("a>b");
|
||||
case CS_FN_LESS:
|
||||
case LS_FN_LESS:
|
||||
return QObject::tr("a<b");
|
||||
case CS_FN_EGREATER:
|
||||
case LS_FN_EGREATER:
|
||||
return QObject::tr("a>=b");
|
||||
case CS_FN_ELESS:
|
||||
case LS_FN_ELESS:
|
||||
return QObject::tr("a<=b");
|
||||
case CS_FN_DPOS:
|
||||
case LS_FN_DPOS:
|
||||
return QObject::tr("d>=x");
|
||||
case CS_FN_DAPOS:
|
||||
case LS_FN_DAPOS:
|
||||
return QObject::tr("|d|>=x");
|
||||
case CS_FN_VEQUAL:
|
||||
case LS_FN_VEQUAL:
|
||||
return QObject::tr("a~x");
|
||||
case CS_FN_TIMER:
|
||||
case LS_FN_TIMER:
|
||||
return QObject::tr("Timer");
|
||||
case CS_FN_STICKY:
|
||||
case LS_FN_STICKY:
|
||||
return QObject::tr("Sticky");
|
||||
case CS_FN_STAY:
|
||||
case LS_FN_STAY:
|
||||
return QObject::tr("Stay");
|
||||
default:
|
||||
return QObject::tr("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
QString CustomSwData::toString(const ModelData & model)
|
||||
QString LogicalSwitchData::toString(const ModelData & model)
|
||||
{
|
||||
QString result = "";
|
||||
|
||||
@@ -410,16 +410,16 @@ QString CustomSwData::toString(const ModelData & model)
|
||||
result +="( ";
|
||||
}
|
||||
switch (getFunctionFamily()) {
|
||||
case CS_FAMILY_STAY:
|
||||
case LS_FAMILY_STAY:
|
||||
result = QObject::tr("STAY(%1, [%2:%3])").arg(RawSwitch(val1).toString()).arg(ValToTim(val2)).arg(ValToTim(val2+val3));
|
||||
break;
|
||||
case CS_FAMILY_STICKY:
|
||||
case LS_FAMILY_STICKY:
|
||||
result = QObject::tr("STICKY(%1, %2)").arg(RawSwitch(val1).toString()).arg(RawSwitch(val2).toString());
|
||||
break;
|
||||
case CS_FAMILY_TIMER:
|
||||
case LS_FAMILY_TIMER:
|
||||
result = QObject::tr("TIMER(%1, %2)").arg(ValToTim(val1)).arg(ValToTim(val2));
|
||||
break;
|
||||
case CS_FAMILY_VOFS: {
|
||||
case LS_FAMILY_VOFS: {
|
||||
RawSource source = RawSource(val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (val1)
|
||||
@@ -427,28 +427,28 @@ QString CustomSwData::toString(const ModelData & model)
|
||||
else
|
||||
result += "0";
|
||||
result.remove(" ");
|
||||
if (func == CS_FN_APOS || func == CS_FN_ANEG)
|
||||
if (func == LS_FN_APOS || func == LS_FN_ANEG)
|
||||
result = "|" + result + "|";
|
||||
else if (func == CS_FN_DAPOS)
|
||||
else if (func == LS_FN_DAPOS)
|
||||
result = "|d(" + result + ")|";
|
||||
else if (func == CS_FN_DPOS) result = "d(" + result + ")";
|
||||
if (func == CS_FN_APOS || func == CS_FN_VPOS || func == CS_FN_DAPOS || func == CS_FN_DPOS)
|
||||
else if (func == LS_FN_DPOS) result = "d(" + result + ")";
|
||||
if (func == LS_FN_APOS || func == LS_FN_VPOS || func == LS_FN_DAPOS || func == LS_FN_DPOS)
|
||||
result += " > ";
|
||||
else if (func == CS_FN_ANEG || func == CS_FN_VNEG)
|
||||
else if (func == LS_FN_ANEG || func == LS_FN_VNEG)
|
||||
result += " < ";
|
||||
result += QString::number(range.step * (val2 /*TODO+ source.getRawOffset(model)*/) + range.offset);
|
||||
break;
|
||||
}
|
||||
case CS_FAMILY_VBOOL:
|
||||
case LS_FAMILY_VBOOL:
|
||||
result = RawSwitch(val1).toString();
|
||||
switch (func) {
|
||||
case CS_FN_AND:
|
||||
case LS_FN_AND:
|
||||
result += " AND ";
|
||||
break;
|
||||
case CS_FN_OR:
|
||||
case LS_FN_OR:
|
||||
result += " OR ";
|
||||
break;
|
||||
case CS_FN_XOR:
|
||||
case LS_FN_XOR:
|
||||
result += " XOR ";
|
||||
break;
|
||||
default:
|
||||
@@ -457,28 +457,28 @@ QString CustomSwData::toString(const ModelData & model)
|
||||
result += RawSwitch(val2).toString();
|
||||
break;
|
||||
|
||||
case CS_FAMILY_VCOMP:
|
||||
case LS_FAMILY_VCOMP:
|
||||
if (val1)
|
||||
result += RawSource(val1).toString();
|
||||
else
|
||||
result += "0";
|
||||
switch (func) {
|
||||
case CS_FN_EQUAL:
|
||||
case LS_FN_EQUAL:
|
||||
result += " = ";
|
||||
break;
|
||||
case CS_FN_NEQUAL:
|
||||
case LS_FN_NEQUAL:
|
||||
result += " != ";
|
||||
break;
|
||||
case CS_FN_GREATER:
|
||||
case LS_FN_GREATER:
|
||||
result += " > ";
|
||||
break;
|
||||
case CS_FN_LESS:
|
||||
case LS_FN_LESS:
|
||||
result += " < ";
|
||||
break;
|
||||
case CS_FN_EGREATER:
|
||||
case LS_FN_EGREATER:
|
||||
result += " >= ";
|
||||
break;
|
||||
case CS_FN_ELESS:
|
||||
case LS_FN_ELESS:
|
||||
result += " <= ";
|
||||
break;
|
||||
default:
|
||||
@@ -496,7 +496,7 @@ QString CustomSwData::toString(const ModelData & model)
|
||||
result += RawSwitch(andsw).toString();
|
||||
}
|
||||
|
||||
if (GetEepromInterface()->getCapability(CustomSwitchesExt)) {
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
if (delay)
|
||||
result += QObject::tr(" Delay %1 sec").arg(delay/2.0);
|
||||
if (duration)
|
||||
|
||||
@@ -577,42 +577,42 @@ class MixData {
|
||||
};
|
||||
|
||||
enum CSFunction {
|
||||
CS_FN_OFF,
|
||||
CS_FN_VPOS,
|
||||
CS_FN_VNEG,
|
||||
CS_FN_APOS,
|
||||
CS_FN_ANEG,
|
||||
CS_FN_AND,
|
||||
CS_FN_OR,
|
||||
CS_FN_XOR,
|
||||
CS_FN_EQUAL,
|
||||
CS_FN_NEQUAL,
|
||||
CS_FN_GREATER,
|
||||
CS_FN_LESS,
|
||||
CS_FN_EGREATER,
|
||||
CS_FN_ELESS,
|
||||
CS_FN_DPOS,
|
||||
CS_FN_DAPOS,
|
||||
CS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
CS_FN_TIMER,
|
||||
CS_FN_STICKY,
|
||||
CS_FN_STAY,
|
||||
// later ... CS_FN_RANGE,
|
||||
CS_FN_MAX
|
||||
LS_FN_OFF,
|
||||
LS_FN_VPOS,
|
||||
LS_FN_VNEG,
|
||||
LS_FN_APOS,
|
||||
LS_FN_ANEG,
|
||||
LS_FN_AND,
|
||||
LS_FN_OR,
|
||||
LS_FN_XOR,
|
||||
LS_FN_EQUAL,
|
||||
LS_FN_NEQUAL,
|
||||
LS_FN_GREATER,
|
||||
LS_FN_LESS,
|
||||
LS_FN_EGREATER,
|
||||
LS_FN_ELESS,
|
||||
LS_FN_DPOS,
|
||||
LS_FN_DAPOS,
|
||||
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_TIMER,
|
||||
LS_FN_STICKY,
|
||||
LS_FN_STAY,
|
||||
// later ... LS_FN_RANGE,
|
||||
LS_FN_MAX
|
||||
};
|
||||
|
||||
enum CSFunctionFamily {
|
||||
CS_FAMILY_VOFS,
|
||||
CS_FAMILY_VBOOL,
|
||||
CS_FAMILY_VCOMP,
|
||||
CS_FAMILY_TIMER,
|
||||
CS_FAMILY_STICKY,
|
||||
CS_FAMILY_STAY,
|
||||
LS_FAMILY_VOFS,
|
||||
LS_FAMILY_VBOOL,
|
||||
LS_FAMILY_VCOMP,
|
||||
LS_FAMILY_TIMER,
|
||||
LS_FAMILY_STICKY,
|
||||
LS_FAMILY_STAY,
|
||||
};
|
||||
|
||||
class CustomSwData { // Custom Switches data
|
||||
class LogicalSwitchData { // Custom Switches data
|
||||
public:
|
||||
CustomSwData(unsigned int func=0)
|
||||
LogicalSwitchData(unsigned int func=0)
|
||||
{
|
||||
clear();
|
||||
this->func = func;
|
||||
@@ -624,7 +624,7 @@ class CustomSwData { // Custom Switches data
|
||||
unsigned int delay;
|
||||
unsigned int duration;
|
||||
int andsw;
|
||||
void clear() { memset(this, 0, sizeof(CustomSwData)); }
|
||||
void clear() { memset(this, 0, sizeof(LogicalSwitchData)); }
|
||||
CSFunctionFamily getFunctionFamily();
|
||||
QString funcToString();
|
||||
QString toString(const ModelData & model);
|
||||
@@ -876,7 +876,7 @@ class ModelData {
|
||||
ExpoData expoData[C9X_MAX_EXPOS];
|
||||
|
||||
CurveData curves[C9X_MAX_CURVES];
|
||||
CustomSwData customSw[C9X_NUM_CSW];
|
||||
LogicalSwitchData customSw[C9X_NUM_CSW];
|
||||
FuncSwData funcSw[C9X_MAX_CUSTOM_FUNCTIONS];
|
||||
SwashRingData swashRingData;
|
||||
unsigned int thrTraceSrc;
|
||||
@@ -942,10 +942,10 @@ enum Capability {
|
||||
Pots,
|
||||
Switches,
|
||||
SwitchesPositions,
|
||||
CustomSwitches,
|
||||
LogicalSwitches,
|
||||
CustomAndSwitches,
|
||||
HasNegAndSwitches,
|
||||
CustomSwitchesExt,
|
||||
LogicalSwitchesExt,
|
||||
RotaryEncoders,
|
||||
Outputs,
|
||||
ChannelsName,
|
||||
@@ -1161,13 +1161,13 @@ inline void applyStickModeToModel(ModelData &model, unsigned int mode)
|
||||
for (int i=0; i<C9X_NUM_CSW; i++) {
|
||||
RawSource source;
|
||||
switch (model.customSw[i].getFunctionFamily()) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
case LS_FAMILY_VCOMP:
|
||||
source = RawSource(model.customSw[i].val2);
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
source.index = applyStickMode(source.index + 1, mode) - 1;
|
||||
model.customSw[i].val2 = source.toValue();
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
source = RawSource(model.customSw[i].val1);
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
source.index = applyStickMode(source.index + 1, mode) - 1;
|
||||
|
||||
@@ -269,22 +269,22 @@ RawSource er9xToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
Er9xCustomSwData::operator CustomSwData ()
|
||||
Er9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = er9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = er9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -154,15 +154,15 @@ PACK(typedef struct t_Er9xMixData {
|
||||
}) Er9xMixData;
|
||||
|
||||
|
||||
PACK(typedef struct t_Er9xCustomSwData { // Custom Switches data
|
||||
PACK(typedef struct t_Er9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func:4;
|
||||
uint8_t andsw:4;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Er9xCustomSwData() { memset(this, 0, sizeof(t_Er9xCustomSwData)); }
|
||||
}) Er9xCustomSwData;
|
||||
operator LogicalSwitchData();
|
||||
t_Er9xLogicalSwitchData() { memset(this, 0, sizeof(t_Er9xLogicalSwitchData)); }
|
||||
}) Er9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Er9xSafetySwData { // Custom Switches data
|
||||
int8_t swtch;
|
||||
@@ -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];
|
||||
Er9xCustomSwData customSw[ER9X_NUM_CSW];
|
||||
Er9xLogicalSwitchData customSw[ER9X_NUM_CSW];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
int8_t tmrModeB;
|
||||
uint8_t numVoice;
|
||||
|
||||
@@ -75,11 +75,11 @@ 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 (CustomSwData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -239,7 +239,7 @@ int Er9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
return 5;
|
||||
|
||||
@@ -353,22 +353,22 @@ RawSource ersky9xToSource_v11(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
Ersky9xCustomSwData_v10::operator CustomSwData ()
|
||||
Ersky9xLogicalSwitchData_v10::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = ersky9xToSource_v10(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = ersky9xToSource_v10(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -376,22 +376,22 @@ Ersky9xCustomSwData_v10::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Ersky9xCustomSwData_v11::operator CustomSwData ()
|
||||
Ersky9xLogicalSwitchData_v11::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = ersky9xToSource_v11(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = ersky9xToSource_v11(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = er9xToSwitch(v1).toValue();
|
||||
c9x.val2 = er9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -185,25 +185,25 @@ PACK(typedef struct t_Ersky9xMixData_v11 {
|
||||
t_Ersky9xMixData_v11();
|
||||
}) Ersky9xMixData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xCustomSwData_v10 { // Custom Switches data
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v10 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Ersky9xCustomSwData_v10() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v10)); }
|
||||
}) Ersky9xCustomSwData_v10;
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v10() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v10)); }
|
||||
}) Ersky9xLogicalSwitchData_v10;
|
||||
|
||||
PACK(typedef struct t_Ersky9xCustomSwData_v11 { // Custom Switches data
|
||||
PACK(typedef struct t_Ersky9xLogicalSwitchData_v11 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t andsw;
|
||||
uint8_t res ;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Ersky9xCustomSwData_v11() { memset(this, 0, sizeof(t_Ersky9xCustomSwData_v11)); }
|
||||
}) Ersky9xCustomSwData_v11;
|
||||
operator LogicalSwitchData();
|
||||
t_Ersky9xLogicalSwitchData_v11() { memset(this, 0, sizeof(t_Ersky9xLogicalSwitchData_v11)); }
|
||||
}) Ersky9xLogicalSwitchData_v11;
|
||||
|
||||
PACK(typedef struct t_Ersky9xSafetySwData_v10 { // Custom Switches data
|
||||
int8_t swtch;
|
||||
@@ -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];
|
||||
Ersky9xCustomSwData_v10 customSw[ERSKY9X_NUM_CSW_V10];
|
||||
Ersky9xLogicalSwitchData_v10 customSw[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];
|
||||
Ersky9xCustomSwData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
Ersky9xLogicalSwitchData_v11 customSw[ERSKY9X_NUM_CSW_V11];
|
||||
uint8_t frSkyVoltThreshold ;
|
||||
uint8_t bt_telemetry;
|
||||
uint8_t numVoice; // 0-16, rest are Safety switches
|
||||
|
||||
@@ -74,11 +74,11 @@ 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 (CustomSwData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -106,11 +106,11 @@ 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 (CustomSwData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case CS_FAMILY_VCOMP:
|
||||
switch (LogicalSwitchData(model.customSw[i].func).getFunctionFamily()) {
|
||||
case LS_FAMILY_VCOMP:
|
||||
model.customSw[i].v2 = applyStickMode(model.customSw[i].v2, mode);
|
||||
// no break
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
model.customSw[i].v1 = applyStickMode(model.customSw[i].v1, mode);
|
||||
break;
|
||||
default:
|
||||
@@ -285,7 +285,7 @@ int Ersky9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return ERSKY9X_NUM_CSW_V11;
|
||||
case CustomAndSwitches:
|
||||
return 1;
|
||||
|
||||
@@ -301,22 +301,22 @@ RawSource gruvin9xToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
Gruvin9xCustomSwData::operator CustomSwData ()
|
||||
Gruvin9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = gruvin9xToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = gruvin9xToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = gruvin9xToSwitch(v1).toValue();
|
||||
c9x.val2 = gruvin9xToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -186,14 +186,14 @@ PACK(typedef struct t_Gruvin9xMixData {
|
||||
t_Gruvin9xMixData();
|
||||
}) Gruvin9xMixData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xCustomSwData { // Custom Switches data
|
||||
PACK(typedef struct t_Gruvin9xLogicalSwitchData { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Gruvin9xCustomSwData() { memset(this, 0, sizeof(t_Gruvin9xCustomSwData)); }
|
||||
}) Gruvin9xCustomSwData;
|
||||
operator LogicalSwitchData();
|
||||
t_Gruvin9xLogicalSwitchData() { memset(this, 0, sizeof(t_Gruvin9xLogicalSwitchData)); }
|
||||
}) Gruvin9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Gruvin9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
@@ -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];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES];
|
||||
@@ -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];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
Gruvin9xPhaseData_v102 phaseData[G9X_MAX_PHASES];
|
||||
@@ -373,7 +373,7 @@ 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];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
@@ -405,7 +405,7 @@ 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];
|
||||
Gruvin9xCustomSwData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xLogicalSwitchData customSw[G9X_NUM_CSW];
|
||||
Gruvin9xSafetySwData safetySw[G9X_NUM_CHNOUT];
|
||||
Gruvin9xFuncSwData funcSw[G9X_NUM_FSW];
|
||||
Gruvin9xSwashRingData swashR;
|
||||
|
||||
@@ -237,7 +237,7 @@ int Gruvin9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 12;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return 12;
|
||||
case CSFunc:
|
||||
return 13;
|
||||
|
||||
@@ -293,22 +293,22 @@ RawSource open9xV4209ToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
Open9xGruvin9xCustomSwData_v207::operator CustomSwData ()
|
||||
Open9xGruvin9xLogicalSwitchData_v207::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xV4207ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = open9xV4207ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -316,22 +316,22 @@ Open9xGruvin9xCustomSwData_v207::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Open9xGruvin9xCustomSwData_v209::operator CustomSwData ()
|
||||
Open9xGruvin9xLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xV4209ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL && c9x.func <= CS_FN_ELESS) {
|
||||
if (c9x.func >= LS_FN_EQUAL && c9x.func <= LS_FN_ELESS) {
|
||||
c9x.val2 = open9xV4209ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -110,27 +110,27 @@ PACK(typedef struct t_Open9xGruvin9xMixData_v211 {
|
||||
t_Open9xGruvin9xMixData_v211() { memset(this, 0, sizeof(t_Open9xGruvin9xMixData_v211)); }
|
||||
}) Open9xGruvin9xMixData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xCustomSwData_v207 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v207 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xGruvin9xCustomSwData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v207)); }
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v207() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v207)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xCustomSwData_v207;
|
||||
}) Open9xGruvin9xLogicalSwitchData_v207;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xGruvin9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xGruvin9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xCustomSwData_v209)); }
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xGruvin9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xGruvin9xLogicalSwitchData_v209)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Open9xGruvin9xCustomSwData_v209;
|
||||
}) Open9xGruvin9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xGruvin9xFuncSwData_v203 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
@@ -194,7 +194,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v207 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v207 phaseData[O9X_MAX_PHASES];
|
||||
@@ -228,7 +228,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v208 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v207 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v208 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -267,7 +267,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v209 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -307,7 +307,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v210 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
@@ -345,7 +345,7 @@ PACK(typedef struct t_Open9xGruvin9xModelData_v211 {
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xGruvin9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xGruvin9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xGruvin9xSwashRingData_v209 swashR;
|
||||
Open9xGruvin9xPhaseData_v208 phaseData[O9X_MAX_PHASES];
|
||||
|
||||
@@ -501,22 +501,22 @@ t_Open9xArmMixData_v212::operator MixData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmCustomSwData_v208::operator CustomSwData ()
|
||||
t_Open9xArmLogicalSwitchData_v208::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xArm208ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = open9xArm208ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xArmToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xArmToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -524,22 +524,22 @@ t_Open9xArmCustomSwData_v208::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmCustomSwData_v209::operator CustomSwData ()
|
||||
t_Open9xArmLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xArm209ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = open9xArm209ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xArmToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xArmToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -547,24 +547,24 @@ t_Open9xArmCustomSwData_v209::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Open9xArmCustomSwData_v210::operator CustomSwData ()
|
||||
t_Open9xArmLogicalSwitchData_v210::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
c9x.delay = delay;
|
||||
c9x.duration = duration;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xArm210ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL && c9x.func <= CS_FN_ELESS) {
|
||||
if (c9x.func >= LS_FN_EQUAL && c9x.func <= LS_FN_ELESS) {
|
||||
c9x.val2 = open9xArm210ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xArmToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xArmToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -190,34 +190,34 @@ PACK(typedef struct t_Open9xArmPhaseData_v212 {
|
||||
t_Open9xArmPhaseData_v212() { memset(this, 0, sizeof(t_Open9xArmPhaseData_v212)); }
|
||||
}) Open9xArmPhaseData_v212;
|
||||
|
||||
PACK(typedef struct t_Open9xArmCustomSwData_v208 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v208() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v208)); }
|
||||
}) Open9xArmCustomSwData_v208;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v208)); }
|
||||
}) Open9xArmLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xArmCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v209)); }
|
||||
}) Open9xArmCustomSwData_v209;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v209)); }
|
||||
}) Open9xArmLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xArmCustomSwData_v210 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xArmLogicalSwitchData_v210 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
uint8_t delay;
|
||||
uint8_t duration;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xArmCustomSwData_v210() { memset(this, 0, sizeof(t_Open9xArmCustomSwData_v210)); }
|
||||
}) Open9xArmCustomSwData_v210;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xArmLogicalSwitchData_v210() { memset(this, 0, sizeof(t_Open9xArmLogicalSwitchData_v210)); }
|
||||
}) Open9xArmLogicalSwitchData_v210;
|
||||
|
||||
PACK(typedef struct t_Open9xArmFuncSwData_v208 { // Function Switches data
|
||||
int8_t swtch; // input
|
||||
@@ -343,7 +343,7 @@ PACK(typedef struct t_Open9xArmModelData_v208 {
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v208 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v208 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -382,7 +382,7 @@ PACK(typedef struct t_Open9xArmModelData_v209 {
|
||||
Open9xArmExpoData_v208 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v209 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v208 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -422,7 +422,7 @@ PACK(typedef struct t_Open9xArmModelData_v210 {
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v210 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -461,7 +461,7 @@ PACK(typedef struct t_Open9xArmModelData_v211 {
|
||||
Open9xArmExpoData_v210 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v209 swashR;
|
||||
Open9xArmPhaseData_v208 phaseData[O9X_ARM_MAX_PHASES];
|
||||
@@ -499,7 +499,7 @@ PACK(typedef struct t_Open9xArmModelData_v212 {
|
||||
Open9xArmExpoData_v212 expoData[O9X_ARM_MAX_EXPOS];
|
||||
int16_t curves[O9X_ARM_MAX_CURVES];
|
||||
int8_t points[O9X_ARM_NUM_POINTS];
|
||||
Open9xArmCustomSwData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmLogicalSwitchData_v210 customSw[O9X_ARM_NUM_CSW];
|
||||
Open9xArmFuncSwData_v211 funcSw[O9X_ARM_NUM_FSW];
|
||||
Open9xArmSwashRingData_v210 swashR;
|
||||
Open9xArmPhaseData_v212 phaseData[O9X_ARM_MAX_PHASES];
|
||||
|
||||
@@ -518,22 +518,22 @@ RawSource open9xStock209ToSource(int8_t value)
|
||||
}
|
||||
}
|
||||
|
||||
Open9xCustomSwData_v208::operator CustomSwData ()
|
||||
Open9xLogicalSwitchData_v208::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9x208ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = open9x208ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
@@ -541,22 +541,22 @@ Open9xCustomSwData_v208::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
Open9xCustomSwData_v209::operator CustomSwData ()
|
||||
Open9xLogicalSwitchData_v209::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = func;
|
||||
c9x.val1 = v1;
|
||||
c9x.val2 = v2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = open9xStock209ToSource(v1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL && c9x.func <= CS_FN_ELESS) {
|
||||
if (c9x.func >= LS_FN_EQUAL && c9x.func <= LS_FN_ELESS) {
|
||||
c9x.val2 = open9xStock209ToSource(v2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = open9xStockToSwitch(v1).toValue();
|
||||
c9x.val2 = open9xStockToSwitch(v2).toValue();
|
||||
}
|
||||
|
||||
@@ -221,24 +221,24 @@ PACK(typedef struct t_Open9xMixData_v211 {
|
||||
t_Open9xMixData_v211() { memset(this, 0, sizeof(t_Open9xMixData_v211)); }
|
||||
}) Open9xMixData_v211;
|
||||
|
||||
PACK(typedef struct t_Open9xCustomSwData_v208 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v208 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xCustomSwData_v208() { memset(this, 0, sizeof(t_Open9xCustomSwData_v208)); }
|
||||
t_Open9xCustomSwData_v208(CustomSwData&);
|
||||
}) Open9xCustomSwData_v208;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v208() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v208)); }
|
||||
t_Open9xLogicalSwitchData_v208(LogicalSwitchData&);
|
||||
}) Open9xLogicalSwitchData_v208;
|
||||
|
||||
PACK(typedef struct t_Open9xCustomSwData_v209 { // Custom Switches data
|
||||
PACK(typedef struct t_Open9xLogicalSwitchData_v209 { // Custom Switches data
|
||||
int8_t v1; //input
|
||||
int8_t v2; //offset
|
||||
uint8_t func;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Open9xCustomSwData_v209() { memset(this, 0, sizeof(t_Open9xCustomSwData_v209)); }
|
||||
}) Open9xCustomSwData_v209;
|
||||
operator LogicalSwitchData();
|
||||
t_Open9xLogicalSwitchData_v209() { memset(this, 0, sizeof(t_Open9xLogicalSwitchData_v209)); }
|
||||
}) Open9xLogicalSwitchData_v209;
|
||||
|
||||
PACK(typedef struct t_Open9xSafetySwData { // Safety Switches data
|
||||
int8_t swtch;
|
||||
@@ -516,7 +516,7 @@ PACK(typedef struct t_Open9xModelData_v201 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
@@ -547,7 +547,7 @@ PACK(typedef struct t_Open9xModelData_v202 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xSafetySwData safetySw[O9X_NUM_CHNOUT];
|
||||
Open9xFuncSwData_v201 funcSw[12];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
@@ -581,7 +581,7 @@ PACK(typedef struct t_Open9xModelData_v203 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -614,7 +614,7 @@ PACK(typedef struct t_Open9xModelData_v204 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -647,7 +647,7 @@ PACK(typedef struct t_Open9xModelData_v205 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -682,7 +682,7 @@ PACK(typedef struct t_Open9xModelData_v208 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v208 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v208 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -721,7 +721,7 @@ PACK(typedef struct t_Open9xModelData_v209 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves5[O9X_209_MAX_CURVE5][5];
|
||||
int8_t curves9[O9X_209_MAX_CURVE9][9];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v203 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -761,7 +761,7 @@ PACK(typedef struct t_Open9xModelData_v210 {
|
||||
Open9xExpoData_v201 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
@@ -799,7 +799,7 @@ PACK(typedef struct t_Open9xModelData_v211 {
|
||||
Open9xExpoData_v211 expoData[O9X_MAX_EXPOS];
|
||||
int8_t curves[O9X_MAX_CURVES];
|
||||
int8_t points[O9X_NUM_POINTS];
|
||||
Open9xCustomSwData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xLogicalSwitchData_v209 customSw[O9X_NUM_CSW];
|
||||
Open9xFuncSwData_v210 funcSw[O9X_NUM_FSW];
|
||||
Open9xSwashRingData_v209 swashR;
|
||||
Open9xPhaseData_v201 phaseData[O9X_MAX_PHASES];
|
||||
|
||||
@@ -1045,39 +1045,39 @@ class CurvesField: public TransformedField {
|
||||
int _points[C9X_MAX_CURVES*C9X_MAX_POINTS*2];
|
||||
};
|
||||
|
||||
class CustomSwitchesFunctionsTable: public ConversionTable {
|
||||
class LogicalSwitchesFunctionsTable: public ConversionTable {
|
||||
|
||||
public:
|
||||
CustomSwitchesFunctionsTable(BoardEnum board, unsigned int version)
|
||||
LogicalSwitchesFunctionsTable(BoardEnum board, unsigned int version)
|
||||
{
|
||||
int val=0;
|
||||
bool release21March2013 = IS_RELEASE_21_MARCH_2013(board, version);
|
||||
addConversion(CS_FN_OFF, val++);
|
||||
addConversion(LS_FN_OFF, val++);
|
||||
if (release21March2013)
|
||||
addConversion(CS_FN_VEQUAL, val++);
|
||||
addConversion(CS_FN_VPOS, val++);
|
||||
addConversion(CS_FN_VNEG, val++);
|
||||
addConversion(LS_FN_VEQUAL, val++);
|
||||
addConversion(LS_FN_VPOS, val++);
|
||||
addConversion(LS_FN_VNEG, val++);
|
||||
if (IS_ARM(board) && version >= 216) val++; // later RANGE
|
||||
addConversion(CS_FN_APOS, val++);
|
||||
addConversion(CS_FN_ANEG, val++);
|
||||
addConversion(CS_FN_AND, val++);
|
||||
addConversion(CS_FN_OR, val++);
|
||||
addConversion(CS_FN_XOR, val++);
|
||||
if (IS_ARM(board) && version >= 216) addConversion(CS_FN_STAY, val++);
|
||||
addConversion(CS_FN_EQUAL, val++);
|
||||
addConversion(LS_FN_APOS, val++);
|
||||
addConversion(LS_FN_ANEG, val++);
|
||||
addConversion(LS_FN_AND, val++);
|
||||
addConversion(LS_FN_OR, val++);
|
||||
addConversion(LS_FN_XOR, val++);
|
||||
if (IS_ARM(board) && version >= 216) addConversion(LS_FN_STAY, val++);
|
||||
addConversion(LS_FN_EQUAL, val++);
|
||||
if (!release21March2013)
|
||||
addConversion(CS_FN_NEQUAL, val++);
|
||||
addConversion(CS_FN_GREATER, val++);
|
||||
addConversion(CS_FN_LESS, val++);
|
||||
addConversion(LS_FN_NEQUAL, val++);
|
||||
addConversion(LS_FN_GREATER, val++);
|
||||
addConversion(LS_FN_LESS, val++);
|
||||
if (!release21March2013) {
|
||||
addConversion(CS_FN_EGREATER, val++);
|
||||
addConversion(CS_FN_ELESS, val++);
|
||||
addConversion(LS_FN_EGREATER, val++);
|
||||
addConversion(LS_FN_ELESS, val++);
|
||||
}
|
||||
addConversion(CS_FN_DPOS, val++);
|
||||
addConversion(CS_FN_DAPOS, val++);
|
||||
addConversion(CS_FN_TIMER, val++);
|
||||
addConversion(LS_FN_DPOS, val++);
|
||||
addConversion(LS_FN_DAPOS, val++);
|
||||
addConversion(LS_FN_TIMER, val++);
|
||||
if (version >= 216)
|
||||
addConversion(CS_FN_STICKY, val++);
|
||||
addConversion(LS_FN_STICKY, val++);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1153,11 +1153,11 @@ class AndSwitchesConversionTable: public ConversionTable {
|
||||
}
|
||||
};
|
||||
|
||||
class CustomSwitchField: public TransformedField {
|
||||
class LogicalSwitchField: public TransformedField {
|
||||
public:
|
||||
CustomSwitchField(CustomSwData & csw, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
LogicalSwitchField(LogicalSwitchData & csw, BoardEnum board, unsigned int version, unsigned int variant):
|
||||
TransformedField(internalField),
|
||||
internalField("CustomSwitch"),
|
||||
internalField("LogicalSwitch"),
|
||||
csw(csw),
|
||||
board(board),
|
||||
version(version),
|
||||
@@ -1202,21 +1202,21 @@ class CustomSwitchField: public TransformedField {
|
||||
|
||||
virtual void beforeExport()
|
||||
{
|
||||
if (csw.func == CS_FN_STAY) {
|
||||
if (csw.func == LS_FN_STAY) {
|
||||
switchesConversionTable->exportValue(csw.val1, v1);
|
||||
v2 = csw.val2;
|
||||
v3 = csw.val3;
|
||||
}
|
||||
else if ((csw.func >= CS_FN_AND && csw.func <= CS_FN_XOR) || csw.func == CS_FN_STICKY) {
|
||||
else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY) {
|
||||
switchesConversionTable->exportValue(csw.val1, v1);
|
||||
switchesConversionTable->exportValue(csw.val2, v2);
|
||||
}
|
||||
else if (csw.func >= CS_FN_EQUAL && csw.func <= CS_FN_ELESS) {
|
||||
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
|
||||
sourcesConversionTable->exportValue(csw.val1, v1);
|
||||
sourcesConversionTable->exportValue(csw.val2, v2);
|
||||
}
|
||||
else {
|
||||
if ((csw.func >= CS_FN_VPOS && csw.func <= CS_FN_ANEG) || (csw.func >= CS_FN_EQUAL && csw.func!=CS_FN_TIMER))
|
||||
if ((csw.func >= LS_FN_VPOS && csw.func <= LS_FN_ANEG) || (csw.func >= LS_FN_EQUAL && csw.func!=LS_FN_TIMER))
|
||||
sourcesConversionTable->exportValue(csw.val1, v1);
|
||||
else
|
||||
v1 = csw.val1;
|
||||
@@ -1226,21 +1226,21 @@ class CustomSwitchField: public TransformedField {
|
||||
|
||||
virtual void afterImport()
|
||||
{
|
||||
if (csw.func == CS_FN_STAY) {
|
||||
if (csw.func == LS_FN_STAY) {
|
||||
switchesConversionTable->importValue(v1, csw.val1);
|
||||
csw.val2 = v2;
|
||||
csw.val3 = v3;
|
||||
}
|
||||
else if ((csw.func >= CS_FN_AND && csw.func <= CS_FN_XOR) || csw.func == CS_FN_STICKY) {
|
||||
else if ((csw.func >= LS_FN_AND && csw.func <= LS_FN_XOR) || csw.func == LS_FN_STICKY) {
|
||||
switchesConversionTable->importValue(v1, csw.val1);
|
||||
switchesConversionTable->importValue(v2, csw.val2);
|
||||
}
|
||||
else if (csw.func >= CS_FN_EQUAL && csw.func <= CS_FN_ELESS) {
|
||||
else if (csw.func >= LS_FN_EQUAL && csw.func <= LS_FN_ELESS) {
|
||||
sourcesConversionTable->importValue(v1, csw.val1);
|
||||
sourcesConversionTable->importValue(v2, csw.val2);
|
||||
}
|
||||
else {
|
||||
if ((csw.func >= CS_FN_VPOS && csw.func <= CS_FN_ANEG) || (csw.func >= CS_FN_EQUAL && csw.func!=CS_FN_TIMER))
|
||||
if ((csw.func >= LS_FN_VPOS && csw.func <= LS_FN_ANEG) || (csw.func >= LS_FN_EQUAL && csw.func!=LS_FN_TIMER))
|
||||
sourcesConversionTable->importValue(v1, csw.val1);
|
||||
else
|
||||
csw.val1 = v1;
|
||||
@@ -1250,11 +1250,11 @@ class CustomSwitchField: public TransformedField {
|
||||
|
||||
protected:
|
||||
StructField internalField;
|
||||
CustomSwData & csw;
|
||||
LogicalSwitchData & csw;
|
||||
BoardEnum board;
|
||||
unsigned int version;
|
||||
unsigned int variant;
|
||||
CustomSwitchesFunctionsTable functionsConversionTable;
|
||||
LogicalSwitchesFunctionsTable functionsConversionTable;
|
||||
SourcesConversionTable * sourcesConversionTable;
|
||||
SwitchesConversionTable * switchesConversionTable;
|
||||
ConversionTable * andswitchesConversionTable;
|
||||
@@ -2087,7 +2087,7 @@ Open9xModelDataNew::Open9xModelDataNew(ModelData & modelData, BoardEnum board, u
|
||||
internalField.Append(new ExpoField(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 CustomSwitchField(modelData.customSw[i], board, version, variant));
|
||||
internalField.Append(new LogicalSwitchField(modelData.customSw[i], board, version, variant));
|
||||
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));
|
||||
|
||||
@@ -526,7 +526,7 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||
return 24;
|
||||
else
|
||||
return 16;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
if (IS_ARM(board))
|
||||
return 32;
|
||||
else if (board==BOARD_GRUVIN9X||board==BOARD_M128)
|
||||
@@ -535,10 +535,10 @@ int Open9xInterface::getCapability(const Capability capability)
|
||||
return 12;
|
||||
case CustomAndSwitches:
|
||||
if (IS_ARM(board))
|
||||
return getCapability(CustomSwitches);
|
||||
return getCapability(LogicalSwitches);
|
||||
else
|
||||
return 15/*4bits*/-9/*sw positions*/;
|
||||
case CustomSwitchesExt:
|
||||
case LogicalSwitchesExt:
|
||||
return (IS_ARM(board) ? true : false);
|
||||
case RotaryEncoders:
|
||||
if (board == BOARD_GRUVIN9X)
|
||||
|
||||
@@ -169,22 +169,22 @@ t_Th9xMixData::operator MixData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
t_Th9xCustomSwData::operator CustomSwData ()
|
||||
t_Th9xLogicalSwitchData::operator LogicalSwitchData ()
|
||||
{
|
||||
CustomSwData c9x;
|
||||
LogicalSwitchData c9x;
|
||||
c9x.func = opCmp;
|
||||
c9x.val1 = val1;
|
||||
c9x.val2 = val2;
|
||||
|
||||
if ((c9x.func >= CS_FN_VPOS && c9x.func <= CS_FN_ANEG) || c9x.func >= CS_FN_EQUAL) {
|
||||
if ((c9x.func >= LS_FN_VPOS && c9x.func <= LS_FN_ANEG) || c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val1 = toSource(val1).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_EQUAL) {
|
||||
if (c9x.func >= LS_FN_EQUAL) {
|
||||
c9x.val2 = toSource(val2).toValue();
|
||||
}
|
||||
|
||||
if (c9x.func >= CS_FN_AND && c9x.func <= CS_FN_XOR) {
|
||||
if (c9x.func >= LS_FN_AND && c9x.func <= LS_FN_XOR) {
|
||||
c9x.val1 = th9xToSwitch(val1).toValue();
|
||||
c9x.val2 = th9xToSwitch(val2).toValue();
|
||||
}
|
||||
@@ -192,7 +192,7 @@ t_Th9xCustomSwData::operator CustomSwData ()
|
||||
return c9x;
|
||||
}
|
||||
|
||||
int8_t t_Th9xCustomSwData::fromSource(RawSource source)
|
||||
int8_t t_Th9xLogicalSwitchData::fromSource(RawSource source)
|
||||
{
|
||||
int v1 = 0;
|
||||
if (source.type == SOURCE_TYPE_STICK)
|
||||
@@ -216,7 +216,7 @@ int8_t t_Th9xCustomSwData::fromSource(RawSource source)
|
||||
return v1;
|
||||
}
|
||||
|
||||
RawSource t_Th9xCustomSwData::toSource(int8_t value)
|
||||
RawSource t_Th9xLogicalSwitchData::toSource(int8_t value)
|
||||
{
|
||||
if (value == 0) {
|
||||
return RawSource(SOURCE_TYPE_NONE);
|
||||
|
||||
@@ -138,18 +138,18 @@ PACK(typedef struct t_Th9xMixData {
|
||||
t_Th9xMixData();
|
||||
}) Th9xMixData;
|
||||
|
||||
PACK(typedef struct t_Th9xCustomSwData {
|
||||
PACK(typedef struct t_Th9xLogicalSwitchData {
|
||||
uint8_t sw:3; // 0..7
|
||||
uint8_t opCmp:2; // < & | ^
|
||||
uint8_t opRes:3; // 0 => 1=> 0=> !=> & | ^
|
||||
int8_t val1;
|
||||
int8_t val2;
|
||||
|
||||
operator CustomSwData();
|
||||
t_Th9xCustomSwData() { memset(this, 0, sizeof(t_Th9xCustomSwData)); }
|
||||
operator LogicalSwitchData();
|
||||
t_Th9xLogicalSwitchData() { memset(this, 0, sizeof(t_Th9xLogicalSwitchData)); }
|
||||
int8_t fromSource(RawSource source);
|
||||
RawSource toSource(int8_t value);
|
||||
}) Th9xCustomSwData;
|
||||
}) Th9xLogicalSwitchData;
|
||||
|
||||
PACK(typedef struct t_Th9xTrimData {
|
||||
int8_t itrim:6; //trim index
|
||||
@@ -173,7 +173,7 @@ PACK(typedef struct t_Th9xModelData {
|
||||
int8_t curves3[TH9X_MAX_CURVES3][3]; // 9 new143
|
||||
int8_t curves5[TH9X_MAX_CURVES5][5]; // 10
|
||||
int8_t curves9[TH9X_MAX_CURVES9][9]; // 18
|
||||
Th9xCustomSwData switchTab[TH9X_MAX_SWITCHES];//
|
||||
Th9xLogicalSwitchData switchTab[TH9X_MAX_SWITCHES];//
|
||||
Th9xTrimData trimData[NUM_STICKS]; // 3*4 -> 1*4
|
||||
operator ModelData();
|
||||
t_Th9xModelData();
|
||||
|
||||
@@ -157,7 +157,7 @@ int Th9xInterface::getCapability(const Capability capability)
|
||||
return 9;
|
||||
case CustomFunctions:
|
||||
return 0;
|
||||
case CustomSwitches:
|
||||
case LogicalSwitches:
|
||||
return TH9X_MAX_SWITCHES;
|
||||
case Outputs:
|
||||
return 8;
|
||||
|
||||
+26
-26
@@ -407,7 +407,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr)
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=-GetEepromInterface()->getCapability(CustomSwitches); i<0; i++) {
|
||||
for (int i=-GetEepromInterface()->getCapability(LogicalSwitches); i<0; i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
@@ -474,7 +474,7 @@ void populateSwitchCB(QComboBox *b, const RawSwitch & value, unsigned long attr)
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=1; i<=GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=1; i<=GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
item = RawSwitch(SWITCH_TYPE_VIRTUAL, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == value) b->setCurrentIndex(b->count()-1);
|
||||
@@ -582,7 +582,7 @@ void populateSourceCB(QComboBox *b, const RawSource & source, const ModelData &
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
}
|
||||
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
item = RawSource(SOURCE_TYPE_CUSTOM_SWITCH, i);
|
||||
b->addItem(item.toString(), item.toValue());
|
||||
if (item == source) b->setCurrentIndex(b->count()-1);
|
||||
@@ -656,33 +656,33 @@ int TimToVal(float value)
|
||||
void populateCSWCB(QComboBox *b, int value)
|
||||
{
|
||||
int order[] = {
|
||||
CS_FN_OFF,
|
||||
CS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
CS_FN_VPOS,
|
||||
CS_FN_VNEG,
|
||||
// CS_FN_RANGE,
|
||||
CS_FN_APOS,
|
||||
CS_FN_ANEG,
|
||||
CS_FN_AND,
|
||||
CS_FN_OR,
|
||||
CS_FN_XOR,
|
||||
CS_FN_STAY,
|
||||
CS_FN_EQUAL,
|
||||
CS_FN_NEQUAL,
|
||||
CS_FN_GREATER,
|
||||
CS_FN_LESS,
|
||||
CS_FN_EGREATER,
|
||||
CS_FN_ELESS,
|
||||
CS_FN_DPOS,
|
||||
CS_FN_DAPOS,
|
||||
CS_FN_TIMER,
|
||||
CS_FN_STICKY
|
||||
LS_FN_OFF,
|
||||
LS_FN_VEQUAL, // added at the end to avoid everything renumbered
|
||||
LS_FN_VPOS,
|
||||
LS_FN_VNEG,
|
||||
// LS_FN_RANGE,
|
||||
LS_FN_APOS,
|
||||
LS_FN_ANEG,
|
||||
LS_FN_AND,
|
||||
LS_FN_OR,
|
||||
LS_FN_XOR,
|
||||
LS_FN_STAY,
|
||||
LS_FN_EQUAL,
|
||||
LS_FN_NEQUAL,
|
||||
LS_FN_GREATER,
|
||||
LS_FN_LESS,
|
||||
LS_FN_EGREATER,
|
||||
LS_FN_ELESS,
|
||||
LS_FN_DPOS,
|
||||
LS_FN_DAPOS,
|
||||
LS_FN_TIMER,
|
||||
LS_FN_STICKY
|
||||
};
|
||||
|
||||
b->clear();
|
||||
for (int i=0; i<CS_FN_MAX; i++) {
|
||||
for (int i=0; i<LS_FN_MAX; i++) {
|
||||
int func = order[i];
|
||||
b->addItem(CustomSwData(func).funcToString(), func);
|
||||
b->addItem(LogicalSwitchData(func).funcToString(), func);
|
||||
// if (i>GetEepromInterface()->getCapability(CSFunc)) {
|
||||
// QModelIndex index = b->model()->index(i, 0);
|
||||
// QVariant v(0);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <QtGui>
|
||||
#include "eeprominterface.h"
|
||||
|
||||
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(CustomSwitches)-1)
|
||||
#define TMR_NUM_OPTION (TMR_VAROFS+2*9+2*GetEepromInterface()->getCapability(LogicalSwitches)-1)
|
||||
|
||||
//convert from mode 1 to mode generalSettings.stickMode
|
||||
//NOTICE! => 1..4 -> 1..4
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <QDoubleSpinBox>
|
||||
#include "helpers.h"
|
||||
|
||||
CustomSwitchesPanel::CustomSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
LogicalSwitchesPanel::LogicalSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
ModelPanel(parent, model),
|
||||
selectedSwitch(0)
|
||||
{
|
||||
@@ -18,13 +18,13 @@ CustomSwitchesPanel::CustomSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
addLabel(gridLayout, tr("V1"), col++);
|
||||
addLabel(gridLayout, tr("V2"), col++);
|
||||
addLabel(gridLayout, tr("AND"), col++);
|
||||
if (GetEepromInterface()->getCapability(CustomSwitchesExt)) {
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
addLabel(gridLayout, tr("Duration"), col++);
|
||||
addLabel(gridLayout, tr("Delay"), col++);
|
||||
}
|
||||
|
||||
lock = true;
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
// The label
|
||||
QLabel * label = new QLabel(this);
|
||||
label->setProperty("index", i);
|
||||
@@ -81,7 +81,7 @@ CustomSwitchesPanel::CustomSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
connect(cswitchAnd[i], SIGNAL(currentIndexChanged(int)), this, SLOT(andEdited(int)));
|
||||
gridLayout->addWidget(cswitchAnd[i], i+1, 4);
|
||||
|
||||
if (GetEepromInterface()->getCapability(CustomSwitchesExt)) {
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
// Duration
|
||||
cswitchDuration[i] = new QDoubleSpinBox(this);
|
||||
cswitchDuration[i]->setProperty("index", i);
|
||||
@@ -109,19 +109,19 @@ CustomSwitchesPanel::CustomSwitchesPanel(QWidget * parent, ModelData & model):
|
||||
lock = false;
|
||||
}
|
||||
|
||||
CustomSwitchesPanel::~CustomSwitchesPanel()
|
||||
LogicalSwitchesPanel::~LogicalSwitchesPanel()
|
||||
{
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::v1Edited(int value)
|
||||
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() == CS_FAMILY_VOFS) {
|
||||
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_VOFS) {
|
||||
RawSource source = RawSource(model.customSw[i].val1, &model);
|
||||
if (source.type == SOURCE_TYPE_TELEMETRY) {
|
||||
if (model.customSw[i].func > CS_FN_ELESS && model.customSw[i].func < CS_FN_VEQUAL) {
|
||||
if (model.customSw[i].func > LS_FN_ELESS && model.customSw[i].func < LS_FN_VEQUAL) {
|
||||
model.customSw[i].val2 = 0;
|
||||
}
|
||||
else {
|
||||
@@ -130,7 +130,7 @@ void CustomSwitchesPanel::v1Edited(int value)
|
||||
}
|
||||
else {
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func > CS_FN_ELESS && model.customSw[i].func < CS_FN_VEQUAL) {
|
||||
if (model.customSw[i].func > LS_FN_ELESS && model.customSw[i].func < LS_FN_VEQUAL) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
}
|
||||
else {
|
||||
@@ -143,7 +143,7 @@ void CustomSwitchesPanel::v1Edited(int value)
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::v2Edited(int value)
|
||||
void LogicalSwitchesPanel::v2Edited(int value)
|
||||
{
|
||||
if (!lock) {
|
||||
int i = sender()->property("index").toInt();
|
||||
@@ -152,7 +152,7 @@ void CustomSwitchesPanel::v2Edited(int value)
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::andEdited(int value)
|
||||
void LogicalSwitchesPanel::andEdited(int value)
|
||||
{
|
||||
if (!lock) {
|
||||
int index = sender()->property("index").toInt();
|
||||
@@ -161,34 +161,34 @@ void CustomSwitchesPanel::andEdited(int value)
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::durationEdited(double duration)
|
||||
void LogicalSwitchesPanel::durationEdited(double duration)
|
||||
{
|
||||
int index = sender()->property("index").toInt();
|
||||
model.customSw[index].duration = (uint8_t)round(duration*2);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::delayEdited(double delay)
|
||||
void LogicalSwitchesPanel::delayEdited(double delay)
|
||||
{
|
||||
int index = sender()->property("index").toInt();
|
||||
model.customSw[index].delay = (uint8_t)round(delay*2);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::edited()
|
||||
void LogicalSwitchesPanel::edited()
|
||||
{
|
||||
if (!lock) {
|
||||
lock = true;
|
||||
int i = sender()->property("index").toInt();
|
||||
int newFunc = csw[i]->itemData(csw[i]->currentIndex()).toInt();
|
||||
bool chAr = (model.customSw[i].getFunctionFamily() != CustomSwData(newFunc).getFunctionFamily());
|
||||
bool chAr = (model.customSw[i].getFunctionFamily() != LogicalSwitchData(newFunc).getFunctionFamily());
|
||||
model.customSw[i].func = newFunc;
|
||||
if (chAr) {
|
||||
if (model.customSw[i].getFunctionFamily() == CS_FAMILY_TIMER) {
|
||||
if (model.customSw[i].getFunctionFamily() == LS_FAMILY_TIMER) {
|
||||
model.customSw[i].val1 = -119;
|
||||
model.customSw[i].val2 = -119;
|
||||
}
|
||||
else if (model.customSw[i].getFunctionFamily() == CS_FAMILY_STAY) {
|
||||
else if (model.customSw[i].getFunctionFamily() == LS_FAMILY_STAY) {
|
||||
model.customSw[i].val1 = 0;
|
||||
model.customSw[i].val2 = -129;
|
||||
model.customSw[i].val3 = 0;
|
||||
@@ -204,11 +204,11 @@ void CustomSwitchesPanel::edited()
|
||||
RawSource source;
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
{
|
||||
source = RawSource(model.customSw[i].val1, &model);
|
||||
RawSourceRange range = source.getRange();
|
||||
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].func<CS_FN_VEQUAL) {
|
||||
if (model.customSw[i].func>LS_FN_ELESS && model.customSw[i].func<LS_FN_VEQUAL) {
|
||||
model.customSw[i].val2 = (cswitchOffset[i]->value() / range.step);
|
||||
cswitchOffset[i]->setValue(model.customSw[i].val2*range.step);
|
||||
}
|
||||
@@ -218,13 +218,13 @@ void CustomSwitchesPanel::edited()
|
||||
}
|
||||
}
|
||||
break;
|
||||
case CS_FAMILY_TIMER:
|
||||
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);
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2);
|
||||
break;
|
||||
case CS_FAMILY_STAY:
|
||||
case LS_FAMILY_STAY:
|
||||
model.customSw[i].val2 = TimToVal(cswitchOffset[i]->value());
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
break;
|
||||
@@ -236,7 +236,7 @@ void CustomSwitchesPanel::edited()
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero)
|
||||
void LogicalSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool allowZero)
|
||||
{
|
||||
sb->setVisible(true);
|
||||
sb->setDecimals(1);
|
||||
@@ -252,7 +252,7 @@ void CustomSwitchesPanel::updateTimerParam(QDoubleSpinBox *sb, int timer, bool a
|
||||
sb->setValue(value);
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
void LogicalSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
{
|
||||
lock = true;
|
||||
|
||||
@@ -261,7 +261,7 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
|
||||
switch (model.customSw[i].getFunctionFamily())
|
||||
{
|
||||
case CS_FAMILY_VOFS:
|
||||
case LS_FAMILY_VOFS:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
@@ -269,7 +269,7 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
populateSourceCB(cswitchSource1[i], source, model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
cswitchOffset[i]->setDecimals(range.decimals);
|
||||
cswitchOffset[i]->setSingleStep(range.step);
|
||||
if (model.customSw[i].func>CS_FN_ELESS && model.customSw[i].func<CS_FN_VEQUAL) {
|
||||
if (model.customSw[i].func>LS_FN_ELESS && model.customSw[i].func<LS_FN_VEQUAL) {
|
||||
cswitchOffset[i]->setMinimum(range.step*-127);
|
||||
cswitchOffset[i]->setMaximum(range.step*127);
|
||||
cswitchOffset[i]->setValue(range.step*model.customSw[i].val2);
|
||||
@@ -280,8 +280,8 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
cswitchOffset[i]->setValue(range.step*(model.customSw[i].val2/* TODO+source.getRawOffset(model)*/)+range.offset);
|
||||
}
|
||||
break;
|
||||
case CS_FAMILY_VBOOL:
|
||||
case CS_FAMILY_STICKY:
|
||||
case LS_FAMILY_VBOOL:
|
||||
case LS_FAMILY_STICKY:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(true);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
@@ -289,14 +289,14 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
populateSwitchCB(cswitchSource2[i], RawSwitch(model.customSw[i].val2));
|
||||
break;
|
||||
case CS_FAMILY_STAY:
|
||||
case LS_FAMILY_STAY:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
populateSwitchCB(cswitchSource1[i], RawSwitch(model.customSw[i].val1));
|
||||
updateTimerParam(cswitchOffset[i], model.customSw[i].val2, true);
|
||||
break;
|
||||
case CS_FAMILY_VCOMP:
|
||||
case LS_FAMILY_VCOMP:
|
||||
cswitchSource1[i]->setVisible(true);
|
||||
cswitchSource2[i]->setVisible(true);
|
||||
cswitchValue[i]->setVisible(false);
|
||||
@@ -304,7 +304,7 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
populateSourceCB(cswitchSource1[i], RawSource(model.customSw[i].val1), model, POPULATE_SOURCES | POPULATE_VIRTUAL_INPUTS | POPULATE_TRIMS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
populateSourceCB(cswitchSource2[i], RawSource(model.customSw[i].val2), model, POPULATE_SOURCES | POPULATE_TRIMS | POPULATE_VIRTUAL_INPUTS | POPULATE_SWITCHES | POPULATE_TELEMETRY | (GetEepromInterface()->getCapability(GvarsInCS) ? POPULATE_GVARS : 0));
|
||||
break;
|
||||
case CS_FAMILY_TIMER:
|
||||
case LS_FAMILY_TIMER:
|
||||
cswitchSource1[i]->setVisible(false);
|
||||
cswitchSource2[i]->setVisible(false);
|
||||
updateTimerParam(cswitchValue[i], model.customSw[i].val1);
|
||||
@@ -315,16 +315,16 @@ void CustomSwitchesPanel::setSwitchWidgetVisibility(int i)
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::update()
|
||||
void LogicalSwitchesPanel::update()
|
||||
{
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
lock = true;
|
||||
populateCSWCB(csw[i], model.customSw[i].func);
|
||||
lock = false;
|
||||
setSwitchWidgetVisibility(i);
|
||||
lock = true;
|
||||
populateAndSwitchCB(cswitchAnd[i], RawSwitch(model.customSw[i].andsw));
|
||||
if (GetEepromInterface()->getCapability(CustomSwitchesExt)) {
|
||||
if (GetEepromInterface()->getCapability(LogicalSwitchesExt)) {
|
||||
cswitchDuration[i]->setValue(model.customSw[i].duration/2.0);
|
||||
cswitchDelay[i]->setValue(model.customSw[i].delay/2.0);
|
||||
}
|
||||
@@ -332,37 +332,37 @@ void CustomSwitchesPanel::update()
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::cswPaste()
|
||||
void LogicalSwitchesPanel::cswPaste()
|
||||
{
|
||||
const QClipboard *clipboard = QApplication::clipboard();
|
||||
const QMimeData *mimeData = clipboard->mimeData();
|
||||
if (mimeData->hasFormat("application/x-companion-csw")) {
|
||||
QByteArray cswData = mimeData->data("application/x-companion-csw");
|
||||
|
||||
CustomSwData *csw = &model.customSw[selectedSwitch];
|
||||
memcpy(csw, cswData.mid(0, sizeof(CustomSwData)).constData(), sizeof(CustomSwData));
|
||||
LogicalSwitchData *csw = &model.customSw[selectedSwitch];
|
||||
memcpy(csw, cswData.mid(0, sizeof(LogicalSwitchData)).constData(), sizeof(LogicalSwitchData));
|
||||
emit modified();
|
||||
updateSelectedSwitch();
|
||||
}
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::cswDelete()
|
||||
void LogicalSwitchesPanel::cswDelete()
|
||||
{
|
||||
model.customSw[selectedSwitch].clear();
|
||||
emit modified();
|
||||
updateSelectedSwitch();
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::cswCopy()
|
||||
void LogicalSwitchesPanel::cswCopy()
|
||||
{
|
||||
QByteArray cswData;
|
||||
cswData.append((char*)&model.customSw[selectedSwitch],sizeof(CustomSwData));
|
||||
cswData.append((char*)&model.customSw[selectedSwitch],sizeof(LogicalSwitchData));
|
||||
QMimeData *mimeData = new QMimeData;
|
||||
mimeData->setData("application/x-companion-csw", cswData);
|
||||
QApplication::clipboard()->setMimeData(mimeData,QClipboard::Clipboard);
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::updateSelectedSwitch()
|
||||
void LogicalSwitchesPanel::updateSelectedSwitch()
|
||||
{
|
||||
lock = true;
|
||||
populateCSWCB(csw[selectedSwitch], model.customSw[selectedSwitch].func);
|
||||
@@ -370,14 +370,14 @@ void CustomSwitchesPanel::updateSelectedSwitch()
|
||||
lock = false;
|
||||
}
|
||||
|
||||
void CustomSwitchesPanel::cswCut()
|
||||
void LogicalSwitchesPanel::cswCut()
|
||||
{
|
||||
cswCopy();
|
||||
cswDelete();
|
||||
}
|
||||
|
||||
// TODO make something generic here!
|
||||
void CustomSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
||||
void LogicalSwitchesPanel::csw_customContextMenuRequested(QPoint pos)
|
||||
{
|
||||
QLabel *label = (QLabel *)sender();
|
||||
selectedSwitch = label->property("index").toInt();
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
#include <QComboBox>
|
||||
#include <QDoubleSpinBox>
|
||||
|
||||
class CustomSwitchesPanel : public ModelPanel
|
||||
class LogicalSwitchesPanel : public ModelPanel
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CustomSwitchesPanel(QWidget *parent, ModelData & model);
|
||||
virtual ~CustomSwitchesPanel();
|
||||
LogicalSwitchesPanel(QWidget *parent, ModelData & model);
|
||||
virtual ~LogicalSwitchesPanel();
|
||||
|
||||
virtual void update();
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ ModelEdit::ModelEdit(RadioData & radioData, int modelId, bool openWizard, bool i
|
||||
addTab(new InputsPanel(this, model, radioData.generalSettings), tr("Inputs"));
|
||||
addTab(new MixesPanel(this, model, radioData.generalSettings), tr("Mixes"));
|
||||
addTab(new Channels(this, model), tr("Channels"));
|
||||
addTab(new CustomSwitchesPanel(this, model), tr("Logical Switches"));
|
||||
addTab(new LogicalSwitchesPanel(this, model), tr("Logical Switches"));
|
||||
if (GetEepromInterface()->getCapability(CustomFunctions))
|
||||
addTab(new CustomFunctionsPanel(this, model, radioData.generalSettings), tr("Switch Assignment"));
|
||||
addTab(new Curves(this, model), tr("Curves"));
|
||||
|
||||
@@ -584,8 +584,8 @@ void Templates::applyTemplate(uint8_t idx)
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_CH, 13); md->weight= 100; md->swtch=RawSwitch();
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-100; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 11); md->mltpx=MLTPX_REP;
|
||||
md=setDest(14); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 100; md->swtch=RawSwitch(SWITCH_TYPE_SWITCH,thrsw); md->mltpx=MLTPX_REP;
|
||||
setSwitch(0xB, CS_FN_VNEG, RawSource(SOURCE_TYPE_STICK, 2).toValue(), -99);
|
||||
setSwitch(0xC, CS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 13).toValue(), 0);
|
||||
setSwitch(0xB, LS_FN_VNEG, RawSource(SOURCE_TYPE_STICK, 2).toValue(), -99);
|
||||
setSwitch(0xC, LS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 13).toValue(), 0);
|
||||
updateSwitchesTab();
|
||||
}
|
||||
|
||||
@@ -841,9 +841,9 @@ void Templates::applyTemplate(uint8_t idx)
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_CUSTOM_SWITCH, 0); md->weight= 110; md->swtch=RawSwitch();
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight=-110; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 2); md->mltpx=MLTPX_REP;
|
||||
md=setDest(16); md->srcRaw=RawSource(SOURCE_TYPE_MAX); md->weight= 110; md->swtch=RawSwitch(SWITCH_TYPE_VIRTUAL, 3); md->mltpx=MLTPX_REP;
|
||||
setSwitch(1, CS_FN_LESS, RawSource(SOURCE_TYPE_CH, 14).toValue(), RawSource(SOURCE_TYPE_CH, 15).toValue());
|
||||
setSwitch(2, CS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 14).toValue(), 105);
|
||||
setSwitch(3, CS_FN_VNEG, RawSource(SOURCE_TYPE_CH, 14).toValue(), -105);
|
||||
setSwitch(1, LS_FN_LESS, RawSource(SOURCE_TYPE_CH, 14).toValue(), RawSource(SOURCE_TYPE_CH, 15).toValue());
|
||||
setSwitch(2, LS_FN_VPOS, RawSource(SOURCE_TYPE_CH, 14).toValue(), 105);
|
||||
setSwitch(3, LS_FN_VNEG, RawSource(SOURCE_TYPE_CH, 14).toValue(), -105);
|
||||
|
||||
// redraw switches tab
|
||||
updateSwitchesTab();
|
||||
|
||||
@@ -642,7 +642,7 @@ void printDialog::printSwitches()
|
||||
str.append("<tr><td><h2>"+tr("Logical Switches")+"</h2></td></tr>");
|
||||
str.append("<tr><td><table border=0 cellspacing=0 cellpadding=3>");
|
||||
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(CustomSwitches); i++) {
|
||||
for (int i=0; i<GetEepromInterface()->getCapability(LogicalSwitches); i++) {
|
||||
if (g_model->customSw[i].func) {
|
||||
str.append("<tr>");
|
||||
if (i<9) {
|
||||
|
||||
@@ -356,7 +356,7 @@ void simulatorDialog::loadParams(RadioData &radioData, const int model_idx)
|
||||
|
||||
beepVal = 0;
|
||||
beepShow = 0;
|
||||
switches=txInterface->getCapability(CustomSwitches);
|
||||
switches=txInterface->getCapability(LogicalSwitches);
|
||||
if ( switches < 13) {
|
||||
ui->cswitch_13->hide();
|
||||
ui->labelCSW_13->hide();
|
||||
|
||||
Reference in New Issue
Block a user