Also provides a lua function to retrieve module settings
This commit is contained in:
bsongis
2015-05-05 20:02:02 +02:00
parent f4c3610a8c
commit eb6ba88f5a
18 changed files with 109 additions and 57 deletions
@@ -501,7 +501,7 @@ t_Open9xGruvin9xModelData_v207::operator ModelData ()
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
@@ -587,7 +587,7 @@ t_Open9xGruvin9xModelData_v208::operator ModelData ()
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
@@ -677,7 +677,7 @@ t_Open9xGruvin9xModelData_v209::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
@@ -767,7 +767,7 @@ t_Open9xGruvin9xModelData_v210::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -854,6 +854,6 @@ t_Open9xGruvin9xModelData_v211::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -808,7 +808,7 @@ t_Open9xArmModelData_v208::operator ModelData ()
c9x.frsky.varioCenterMin = varioSpeedDownMin;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
@@ -898,7 +898,7 @@ t_Open9xArmModelData_v209::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
c9x.frsky.screens[1].body.lines[line].source[col] = (col==0 ? (frskyLines[line] & 0x0f) : ((frskyLines[line] & 0xf0) / 16));
@@ -988,7 +988,7 @@ t_Open9xArmModelData_v210::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -1072,7 +1072,7 @@ t_Open9xArmModelData_v211::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.limitData[i].ppmCenter = servoCenter[i];
}
@@ -1159,6 +1159,6 @@ t_Open9xArmModelData_v212::operator ModelData ()
c9x.switchWarningStates = switchWarningStates;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -1060,7 +1060,7 @@ t_Open9xModelData_v202::operator ModelData ()
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId=modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -1134,7 +1134,7 @@ t_Open9xModelData_v203::operator ModelData ()
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -1210,7 +1210,7 @@ t_Open9xModelData_v204::operator ModelData ()
c9x.frsky.rssiAlarms[1] = frskyRssiAlarms[1].get(1);
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -1287,7 +1287,7 @@ t_Open9xModelData_v205::operator ModelData ()
c9x.frsky = frsky;
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0]. modelId = modelId;
c9x.frsky.screens[1].type = 0;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
@@ -1377,7 +1377,7 @@ t_Open9xModelData_v208::operator ModelData ()
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
c9x.frsky.screens[1].type = 0;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
@@ -1471,7 +1471,7 @@ t_Open9xModelData_v209::operator ModelData ()
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
c9x.frsky.screens[1].type = 0;
for (int line=0; line<4; line++) {
for (int col=0; col<2; col++) {
@@ -1565,7 +1565,7 @@ t_Open9xModelData_v210::operator ModelData ()
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
for (int i=0; i<16; i++) {
c9x.limitData[i].ppmCenter=servoCenter[i];
@@ -1653,7 +1653,7 @@ t_Open9xModelData_v211::operator ModelData ()
c9x.moduleData[0].ppmFrameLength = ppmFrameLength;
c9x.thrTraceSrc = thrTraceSrc;
c9x.modelId = modelId;
c9x.moduleData[0].modelId = modelId;
return c9x;
}
@@ -2781,8 +2781,12 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
bool afterrelease21March2013 = IS_AFTER_RELEASE_21_MARCH_2013(board, version);
if (afterrelease21March2013)
internalField.Append(new UnsignedField<8>(modelData.modelId));
if (afterrelease21March2013) {
internalField.Append(new UnsignedField<8>(modelData.moduleData[0].modelId));
}
if (IS_ARM(board) && version >= 217) {
internalField.Append(new UnsignedField<8>(modelData.moduleData[1].modelId));
}
if (IS_TARANIS(board) && version >= 215) {
internalField.Append(new CharField<10>(modelData.bitmap));
@@ -2902,7 +2906,7 @@ OpenTxModelData::OpenTxModelData(ModelData & modelData, BoardEnum board, unsigne
internalField.Append(new ConversionField< UnsignedField<8> >(modelData.thrTraceSrc, &throttleSourceConversionTable, "Throttle Source"));
if (!afterrelease21March2013) {
internalField.Append(new UnsignedField<8>(modelData.modelId));
internalField.Append(new UnsignedField<8>(modelData.moduleData[0].modelId));
}
if (IS_TARANIS_X9E(board) && version >= 217)