diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentController.cc b/src/AutoPilotPlugins/PX4/FlightModesComponentController.cc index 32de22c33de24868c14644615692b57af2422997..5fa55e4e44cc28f068b65cf5fdfb02018bb8f929 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentController.cc +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentController.cc @@ -656,6 +656,8 @@ void FlightModesComponentController::setManualModeChannelIndex(int index) _recalcModeSelections(); _recalcModeRows(); + emit channelIndicesChanged(); + } void FlightModesComponentController::setAcroModeChannelIndex(int index) @@ -680,11 +682,12 @@ void FlightModesComponentController::setPosCtlModeChannelIndex(int index) _assistModeVisible = channel != getParameterFact(-1, "RC_MAP_MODE_SW")->value().toInt(); } - emit altCtlModeChannelIndexChanged(index); emit modesVisibleChanged(); _recalcModeSelections(); _recalcModeRows(); + emit channelIndicesChanged(); + } void FlightModesComponentController::setLoiterModeChannelIndex(int index) @@ -701,11 +704,12 @@ void FlightModesComponentController::setLoiterModeChannelIndex(int index) _autoModeVisible = channel != getParameterFact(-1, "RC_MAP_MODE_SW")->value().toInt(); } - emit missionModeChannelIndexChanged(index); emit modesVisibleChanged(); _recalcModeSelections(); _recalcModeRows(); + emit channelIndicesChanged(); + } void FlightModesComponentController::setReturnModeChannelIndex(int index) @@ -713,6 +717,8 @@ void FlightModesComponentController::setReturnModeChannelIndex(int index) getParameterFact(-1, "RC_MAP_RETURN_SW")->setValue(_channelIndexToChannel(index)); _recalcModeSelections(); _recalcModeRows(); + emit channelIndicesChanged(); + } void FlightModesComponentController::setOffboardModeChannelIndex(int index) @@ -720,6 +726,8 @@ void FlightModesComponentController::setOffboardModeChannelIndex(int index) getParameterFact(-1, "RC_MAP_OFFB_SW")->setValue(_channelIndexToChannel(index)); _recalcModeSelections(); _recalcModeRows(); + emit channelIndicesChanged(); + } void FlightModesComponentController::generateThresholds(void) diff --git a/src/AutoPilotPlugins/PX4/FlightModesComponentController.h b/src/AutoPilotPlugins/PX4/FlightModesComponentController.h index 3abf6001e45ca9ce25b2e3ac7fd9a08b0bd87c12..091f0de115dd9d77c3cfaf6e9cb48b97a3d73cfc 100644 --- a/src/AutoPilotPlugins/PX4/FlightModesComponentController.h +++ b/src/AutoPilotPlugins/PX4/FlightModesComponentController.h @@ -63,16 +63,16 @@ public: Q_PROPERTY(int returnModeRow MEMBER _returnModeRow NOTIFY modeRowsChanged) Q_PROPERTY(int offboardModeRow MEMBER _offboardModeRow NOTIFY modeRowsChanged) - Q_PROPERTY(int manualModeChannelIndex READ manualModeChannelIndex WRITE setManualModeChannelIndex NOTIFY manualModeChannelIndexChanged) - Q_PROPERTY(int assistModeChannelIndex READ assistModeChannelIndex NOTIFY assistModeChannelIndexChanged) - Q_PROPERTY(int autoModeChannelIndex READ autoModeChannelIndex NOTIFY autoModeChannelIndexChanged) - Q_PROPERTY(int acroModeChannelIndex READ acroModeChannelIndex WRITE setAcroModeChannelIndex NOTIFY acroModeChannelIndexChanged) - Q_PROPERTY(int altCtlModeChannelIndex READ altCtlModeChannelIndex NOTIFY altCtlModeChannelIndexChanged) - Q_PROPERTY(int posCtlModeChannelIndex READ posCtlModeChannelIndex WRITE setPosCtlModeChannelIndex NOTIFY posCtlModeChannelIndexChanged) - Q_PROPERTY(int loiterModeChannelIndex READ loiterModeChannelIndex WRITE setLoiterModeChannelIndex NOTIFY loiterModeChannelIndexChanged) - Q_PROPERTY(int missionModeChannelIndex READ missionModeChannelIndex NOTIFY missionModeChannelIndexChanged) - Q_PROPERTY(int returnModeChannelIndex READ returnModeChannelIndex WRITE setReturnModeChannelIndex NOTIFY returnModeChannelIndexChanged) - Q_PROPERTY(int offboardModeChannelIndex READ offboardModeChannelIndex WRITE setOffboardModeChannelIndex NOTIFY offboardModeChannelIndexChanged) + Q_PROPERTY(int manualModeChannelIndex READ manualModeChannelIndex WRITE setManualModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int assistModeChannelIndex READ assistModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int autoModeChannelIndex READ autoModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int acroModeChannelIndex READ acroModeChannelIndex WRITE setAcroModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int altCtlModeChannelIndex READ altCtlModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int posCtlModeChannelIndex READ posCtlModeChannelIndex WRITE setPosCtlModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int loiterModeChannelIndex READ loiterModeChannelIndex WRITE setLoiterModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int missionModeChannelIndex READ missionModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int returnModeChannelIndex READ returnModeChannelIndex WRITE setReturnModeChannelIndex NOTIFY channelIndicesChanged) + Q_PROPERTY(int offboardModeChannelIndex READ offboardModeChannelIndex WRITE setOffboardModeChannelIndex NOTIFY channelIndicesChanged) Q_PROPERTY(double manualModeRcValue READ manualModeRcValue NOTIFY switchLiveRangeChanged) Q_PROPERTY(double assistModeRcValue READ assistModeRcValue NOTIFY switchLiveRangeChanged) @@ -179,16 +179,7 @@ signals: void thresholdsChanged(void); void modesSelectedChanged(void); void modesVisibleChanged(void); - void manualModeChannelIndexChanged(int index); - void assistModeChannelIndexChanged(int index); - void autoModeChannelIndexChanged(int index); - void acroModeChannelIndexChanged(int index); - void altCtlModeChannelIndexChanged(int index); - void posCtlModeChannelIndexChanged(int index); - void loiterModeChannelIndexChanged(int index); - void missionModeChannelIndexChanged(int index); - void returnModeChannelIndexChanged(int index); - void offboardModeChannelIndexChanged(int index); + void channelIndicesChanged(void); void modeRowsChanged(void); private slots: