@@ -146,6 +146,9 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
146146 SystemAlarms *systemAlarmsObj = SystemAlarms::GetInstance (getObjectManager ());
147147 connect (systemAlarmsObj, SIGNAL (objectUpdated (UAVObject *)), this , SLOT (updateBoardWarnings (UAVObject *)));
148148
149+ inputCalibrationStarted = false ;
150+ channelTestsStarted = false ;
151+
149152 // TODO why do we do that ?
150153 disconnect (this , SLOT (refreshWidgetsValues (UAVObject *)));
151154}
@@ -219,6 +222,17 @@ void ConfigOutputWidget::runChannelTests(bool state)
219222 }
220223 }
221224
225+ channelTestsStarted = state;
226+
227+ // Disable/Enable banks
228+ for (int i = 0 ; i < m_banks.count (); i++) {
229+ OutputBankControls controls = m_banks.at (i);
230+ bool isUsed = !(controls.rateCombo ()->currentText () == " -" && controls.modeCombo ()->currentText () == " PWM" );
231+ if (isUsed) {
232+ controls.modeCombo ()->setEnabled (!state);
233+ }
234+ }
235+
222236 ActuatorCommand *obj = ActuatorCommand::GetInstance (getObjectManager ());
223237 UAVObject::Metadata mdata = obj->getMetadata ();
224238 if (state) {
@@ -418,8 +432,8 @@ void ConfigOutputWidget::refreshWidgetsValuesImpl(UAVObject *obj)
418432 controls.rateCombo ()->setCurrentIndex (index);
419433 controls.rateCombo ()->setEnabled (controls.modeCombo ()->currentIndex () == ActuatorSettings::BANKMODE_PWM);
420434 setColor (controls.rateCombo (), controls.color ());
421- controls.modeCombo ()->setEnabled (true );
422435 setColor (controls.modeCombo (), controls.color ());
436+ controls.modeCombo ()->setEnabled ((inputCalibrationStarted || channelTestsStarted) ? false : true );
423437 i++;
424438 }
425439
@@ -698,6 +712,7 @@ void ConfigOutputWidget::checkOutputConfig()
698712void ConfigOutputWidget::stopTests ()
699713{
700714 m_ui->channelOutTest ->setChecked (false );
715+ channelTestsStarted = false ;
701716}
702717
703718void ConfigOutputWidget::updateBoardWarnings (UAVObject *)
@@ -778,11 +793,13 @@ QString ConfigOutputWidget::bankModeName(int index)
778793
779794void ConfigOutputWidget::inputCalibrationStatus (bool started)
780795{
796+ inputCalibrationStarted = started;
797+
781798 // Disable UI when a input calibration is started
782799 // so user cannot manipulate settings.
783800 enableControls (!started);
784801
785- // Disable every channel form
802+ // Disable every channel form when needed
786803 for (unsigned int i = 0 ; i < ActuatorCommand::CHANNEL_NUMELEM; i++) {
787804 OutputChannelForm *form = getOutputChannelForm (i);
788805 form->ui ->actuatorRev ->setChecked (false );
0 commit comments