mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-31 16:52:10 +01:00
LP-446 - Fixes from review
This commit is contained in:
parent
44365cf3e9
commit
866280084f
@ -1792,7 +1792,7 @@ void ConfigInputWidget::updatePositionSlider()
|
|||||||
{
|
{
|
||||||
ManualControlSettings::DataFields manualSettingsDataPriv = manualSettingsObj->getData();
|
ManualControlSettings::DataFields manualSettingsDataPriv = manualSettingsObj->getData();
|
||||||
|
|
||||||
QWidget *fmodes[] = {
|
QWidget *fmsModes[] = {
|
||||||
ui->fmsModePos1,
|
ui->fmsModePos1,
|
||||||
ui->fmsModePos2,
|
ui->fmsModePos2,
|
||||||
ui->fmsModePos3,
|
ui->fmsModePos3,
|
||||||
@ -1800,7 +1800,7 @@ void ConfigInputWidget::updatePositionSlider()
|
|||||||
ui->fmsModePos5,
|
ui->fmsModePos5,
|
||||||
ui->fmsModePos6
|
ui->fmsModePos6
|
||||||
};
|
};
|
||||||
QWidget *pidbanks[] = {
|
QWidget *pidBanks[] = {
|
||||||
ui->pidBankSs1_0,
|
ui->pidBankSs1_0,
|
||||||
ui->pidBankSs1_1,
|
ui->pidBankSs1_1,
|
||||||
ui->pidBankSs1_2,
|
ui->pidBankSs1_2,
|
||||||
@ -1808,7 +1808,7 @@ void ConfigInputWidget::updatePositionSlider()
|
|||||||
ui->pidBankSs1_4,
|
ui->pidBankSs1_4,
|
||||||
ui->pidBankSs1_5
|
ui->pidBankSs1_5
|
||||||
};
|
};
|
||||||
QWidget *assisstecontrols[] = {
|
QWidget *assistControls[] = {
|
||||||
ui->assistControlPos1,
|
ui->assistControlPos1,
|
||||||
ui->assistControlPos2,
|
ui->assistControlPos2,
|
||||||
ui->assistControlPos3,
|
ui->assistControlPos3,
|
||||||
@ -1820,9 +1820,9 @@ void ConfigInputWidget::updatePositionSlider()
|
|||||||
for (quint32 i = 0; i < FlightModeSettings::FLIGHTMODEPOSITION_NUMELEM; i++) {
|
for (quint32 i = 0; i < FlightModeSettings::FLIGHTMODEPOSITION_NUMELEM; i++) {
|
||||||
bool enabled = i < manualSettingsDataPriv.FlightModeNumber;
|
bool enabled = i < manualSettingsDataPriv.FlightModeNumber;
|
||||||
|
|
||||||
fmodes[i]->setEnabled(enabled);
|
fmsModes[i]->setEnabled(enabled);
|
||||||
pidbanks[i]->setEnabled(enabled);
|
pidBanks[i]->setEnabled(enabled);
|
||||||
assisstecontrols[i]->setEnabled(enabled);
|
assistControls[i]->setEnabled(enabled);
|
||||||
setComboBoxItemEnabled(ui->failsafeFlightMode, i, enabled);
|
setComboBoxItemEnabled(ui->failsafeFlightMode, i, enabled);
|
||||||
setComboBoxItemEnabled(ui->failsafeBatteryCriticalFlightMode, i, enabled);
|
setComboBoxItemEnabled(ui->failsafeBatteryCriticalFlightMode, i, enabled);
|
||||||
setComboBoxItemEnabled(ui->failsafeBatteryWarningFlightMode, i, enabled);
|
setComboBoxItemEnabled(ui->failsafeBatteryWarningFlightMode, i, enabled);
|
||||||
@ -2135,7 +2135,7 @@ void ConfigInputWidget::updateReceiverActivityStatus()
|
|||||||
|
|
||||||
void ConfigInputWidget::failsafeBatteryWarningFlightModeChanged(int index)
|
void ConfigInputWidget::failsafeBatteryWarningFlightModeChanged(int index)
|
||||||
{
|
{
|
||||||
hwSettingsData = hwSettingsObj->getData();
|
HwSettings::DataFields hwSettingsData = hwSettingsObj->getData();
|
||||||
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
||||||
|
|
||||||
ui->failsafeBatteryWarningFlightMode->setEnabled(batteryModuleEnabled && index != -1);
|
ui->failsafeBatteryWarningFlightMode->setEnabled(batteryModuleEnabled && index != -1);
|
||||||
@ -2144,7 +2144,7 @@ void ConfigInputWidget::failsafeBatteryWarningFlightModeChanged(int index)
|
|||||||
|
|
||||||
void ConfigInputWidget::failsafeBatteryCriticalFlightModeChanged(int index)
|
void ConfigInputWidget::failsafeBatteryCriticalFlightModeChanged(int index)
|
||||||
{
|
{
|
||||||
hwSettingsData = hwSettingsObj->getData();
|
HwSettings::DataFields hwSettingsData = hwSettingsObj->getData();
|
||||||
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
||||||
|
|
||||||
ui->failsafeBatteryCriticalFlightMode->setEnabled(batteryModuleEnabled && index != -1);
|
ui->failsafeBatteryCriticalFlightMode->setEnabled(batteryModuleEnabled && index != -1);
|
||||||
@ -2176,7 +2176,7 @@ void ConfigInputWidget::enableControlsChanged(bool enabled)
|
|||||||
{
|
{
|
||||||
ui->failsafeFlightMode->setEnabled(enabled && ui->failsafeFlightMode->currentIndex() != -1);
|
ui->failsafeFlightMode->setEnabled(enabled && ui->failsafeFlightMode->currentIndex() != -1);
|
||||||
|
|
||||||
hwSettingsData = hwSettingsObj->getData();
|
HwSettings::DataFields hwSettingsData = hwSettingsObj->getData();
|
||||||
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
bool batteryModuleEnabled = (hwSettingsData.OptionalModules[HwSettings::OPTIONALMODULES_BATTERY] == HwSettings::OPTIONALMODULES_ENABLED);
|
||||||
ui->failsafeBatteryWarningFlightMode->setEnabled(batteryModuleEnabled && enabled && ui->failsafeBatteryWarningFlightMode->currentIndex() != -1);
|
ui->failsafeBatteryWarningFlightMode->setEnabled(batteryModuleEnabled && enabled && ui->failsafeBatteryWarningFlightMode->currentIndex() != -1);
|
||||||
ui->failsafeBatteryCriticalFlightMode->setEnabled(batteryModuleEnabled && enabled && ui->failsafeBatteryCriticalFlightMode->currentIndex() != -1);
|
ui->failsafeBatteryCriticalFlightMode->setEnabled(batteryModuleEnabled && enabled && ui->failsafeBatteryCriticalFlightMode->currentIndex() != -1);
|
||||||
|
@ -146,7 +146,6 @@ private:
|
|||||||
SystemSettings::DataFields systemSettingsData;
|
SystemSettings::DataFields systemSettingsData;
|
||||||
|
|
||||||
HwSettings *hwSettingsObj;
|
HwSettings *hwSettingsObj;
|
||||||
HwSettings::DataFields hwSettingsData;
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ManualControlSettings::DataFields manualSettingsData;
|
ManualControlSettings::DataFields manualSettingsData;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user