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);