Companion support for FAS offset, Persistent mAh and Altitude in top bar
This commit is contained in:
@@ -375,8 +375,7 @@ void TelemetryPanel::setup()
|
||||
ui->AltitudeGPS_ChkB->setChecked(model.frsky.FrSkyGpsAlt);
|
||||
}
|
||||
int varioCap=GetEepromInterface()->getCapability(HasVario);
|
||||
// if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
if (false) {
|
||||
if (IS_TARANIS(GetEepromInterface()->getBoard())) {
|
||||
ui->AltitudeToolbar_ChkB->setChecked(model.frsky.altitudeDisplayed);
|
||||
} else {
|
||||
ui->AltitudeToolbar_ChkB->hide();
|
||||
@@ -481,6 +480,29 @@ void TelemetryPanel::setup()
|
||||
} else {
|
||||
ui->frskyProtoCB->addItem(tr("Winged Shadow How High (not supported)"));
|
||||
}
|
||||
|
||||
ui->variousGB->hide();
|
||||
if (!(GetEepromInterface()->getCapability(HasFasOffset)) && !(firmware_id.contains("fasoffset"))) {
|
||||
ui->fasOffset_label->hide();
|
||||
ui->fasOffset_DSB->hide();
|
||||
} else {
|
||||
ui->fasOffset_DSB->setValue(model.frsky.fasOffset/10.0);
|
||||
ui->variousGB->show();
|
||||
}
|
||||
|
||||
if (!(GetEepromInterface()->getCapability(HasMahPersistent))) {
|
||||
ui->mahCount_label->hide();
|
||||
ui->mahCount_SB->hide();
|
||||
ui->mahCount_ChkB->hide();
|
||||
} else {
|
||||
if (model.frsky.mAhPersistent) {
|
||||
ui->mahCount_ChkB->setChecked(true);
|
||||
ui->mahCount_SB->setValue(model.frsky.storedMah);
|
||||
} else {
|
||||
ui->mahCount_SB->setDisabled(true);
|
||||
}
|
||||
ui->variousGB->show();
|
||||
}
|
||||
|
||||
ui->frskyProtoCB->setCurrentIndex(model.frsky.usrProto);
|
||||
ui->frskyUnitsCB->setCurrentIndex(model.frsky.imperial);
|
||||
@@ -715,6 +737,25 @@ void TelemetryPanel::on_varioLimitCenterMax_DSB_editingFinished()
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_fasOffset_DSB_editingFinished()
|
||||
{
|
||||
model.frsky.fasOffset = ui->fasOffset_DSB->value()*10;
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_mahCount_SB_editingFinished()
|
||||
{
|
||||
model.frsky.storedMah = ui->mahCount_SB->value();
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::on_mahCount_ChkB_toggled(bool checked)
|
||||
{
|
||||
model.frsky.mAhPersistent = checked;
|
||||
ui->mahCount_SB->setDisabled(!checked);
|
||||
emit modified();
|
||||
}
|
||||
|
||||
void TelemetryPanel::telBarUpdate()
|
||||
{
|
||||
int index;
|
||||
|
||||
@@ -74,6 +74,9 @@ class TelemetryPanel : public ModelPanel
|
||||
void on_varioLimitCenterMin_DSB_editingFinished();
|
||||
void on_varioLimitMinOff_ChkB_toggled(bool checked);
|
||||
void on_varioLimitCenterMax_DSB_editingFinished();
|
||||
void on_fasOffset_DSB_editingFinished();
|
||||
void on_mahCount_SB_editingFinished();
|
||||
void on_mahCount_ChkB_toggled(bool checked);
|
||||
void telBarCBcurrentIndexChanged(int index);
|
||||
void ScreenTypeCBcurrentIndexChanged(int index);
|
||||
void telMaxSBeditingFinished();
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>692</width>
|
||||
<height>540</height>
|
||||
<height>568</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,1">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0,0,1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_14" stretch="0,0,0">
|
||||
<property name="sizeConstraint">
|
||||
@@ -770,6 +770,106 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="variousGB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Various</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<property name="topMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QSpinBox" name="mahCount_SB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>32767</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" alignment="Qt::AlignHCenter">
|
||||
<widget class="QLabel" name="mahCount_label">
|
||||
<property name="text">
|
||||
<string>mAh count</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0" alignment="Qt::AlignHCenter">
|
||||
<widget class="QLabel" name="fasOffset_label">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>FAS Offset</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QCheckBox" name="mahCount_ChkB">
|
||||
<property name="text">
|
||||
<string>Persistent mAh</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDoubleSpinBox" name="fasOffset_DSB">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="decimals">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<double>-1.500000000000000</double>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<double>1.500000000000000</double>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<double>0.100000000000000</double>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
|
||||
Reference in New Issue
Block a user