chore: Companion - add support for GHOST 12bit opt (#1689)

* chore: Companion - add support for 12bit GHOST opt
Resolves #1510

* Ghost protocol reading and writing non-yaml formats

Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
Peter Feerick
2022-03-14 11:10:12 +10:00
committed by GitHub
co-authored by elecpower
parent 9e6ab84599
commit 4571c7b724
7 changed files with 70 additions and 2 deletions
+13 -1
View File
@@ -202,6 +202,7 @@ void TimerPanel::onModeChanged(int index)
#define MASK_RX_FREQ (1<<14)
#define MASK_RF_POWER (1<<15)
#define MASK_RF_RACING_MODE (1<<16)
#define MASK_GHOST (1<<17)
quint8 ModulePanel::failsafesValueDisplayType = ModulePanel::FAILSAFE_DISPLAY_PERCENT;
@@ -445,7 +446,7 @@ void ModulePanel::update()
case PULSES_CROSSFIRE:
mask |= MASK_CHANNELS_RANGE | MASK_RX_NUMBER;
case PULSES_GHOST:
mask |= MASK_CHANNELS_RANGE;
mask |= MASK_CHANNELS_RANGE | MASK_GHOST;
module.channelsCount = 16;
break;
case PULSES_PPM:
@@ -616,6 +617,12 @@ void ModulePanel::update()
ui->label_option->setText(qApp->translate("Multiprotocols", qPrintable(pdef.optionsstr)));
}
// Ghost settings fields
ui->raw12bits->setVisible(mask & MASK_GHOST);
if (mask & MASK_GHOST) {
ui->raw12bits->setChecked(module.ghost.raw12bits);
}
if (mask & MASK_ACCESS) {
ui->rx1->setText(module.access.receiverName[0]);
ui->rx2->setText(module.access.receiverName[1]);
@@ -827,6 +834,11 @@ void ModulePanel::on_disableChMap_stateChanged(int state)
module.multi.disableMapping = (state == Qt::Checked);
}
void ModulePanel::on_raw12bits_stateChanged(int state)
{
module.ghost.raw12bits = (state == Qt::Checked);
}
void ModulePanel::on_racingMode_stateChanged(int state)
{
module.access.racingMode = (state == Qt::Checked);
+1
View File
@@ -99,6 +99,7 @@ class ModulePanel : public ModelPanel
void onSubTypeChanged();
void on_autoBind_stateChanged(int state);
void on_disableChMap_stateChanged(int state);
void on_raw12bits_stateChanged(int state);
void on_racingMode_stateChanged(int state);
void on_disableTelem_stateChanged(int state);
void on_lowPower_stateChanged(int state);
+8 -1
View File
@@ -1051,7 +1051,7 @@
</property>
</widget>
</item>
<item row="12" column="0" colspan="2">
<item row="14" column="0" colspan="2">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
@@ -1071,6 +1071,13 @@
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QCheckBox" name="raw12bits">
<property name="text">
<string>Raw 12 bits</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0" colspan="3">