From 42b9929521a669ff065e9c6e286df2c39a0b8b4d Mon Sep 17 00:00:00 2001 From: dankers Date: Sat, 4 Jun 2011 09:35:55 +1000 Subject: [PATCH 1/4] Update milestones with the next heli challenge --- MILESTONES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MILESTONES.txt b/MILESTONES.txt index f0dd1962d..8f3e4a133 100644 --- a/MILESTONES.txt +++ b/MILESTONES.txt @@ -117,6 +117,10 @@ C: Sami Korhonen (Sambas) D: May 2011 V: http://vimeo.com/24258192 +M: First CopterControl flip on a Flybarless Heli +C: +D: +V: From 2e089e2816036a36463a5533b148b5fc1c11c2c6 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 5 Jun 2011 10:58:08 -0500 Subject: [PATCH 2/4] Changed text when using test output mode to remove deprecated comment about arming. --- ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 27858e111..d5cd0b855 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -237,7 +237,7 @@ void ConfigOutputWidget::runChannelTests(bool state) // Confirm this is definitely what they want if(state) { QMessageBox mbox; - mbox.setText(QString(tr("This option will requires you to be in the armed state and will start your motors by the amount selected on the sliders. It is recommended to remove any blades from motors. Are you sure you want to do this?"))); + mbox.setText(QString(tr("This option will start your motors by the amount selected on the sliders regardless of transmitter. It is recommended to remove any blades from motors. Are you sure you want to do this?"))); mbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); int retval = mbox.exec(); if(retval != QMessageBox::Yes) { From 483deb2bfcb294643cf0206d26dfbc59ef7f37e9 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 5 Jun 2011 11:01:00 -0500 Subject: [PATCH 3/4] Changed the default values for manual control settings to none to avoid problems with channel mappings being different by brand. You will need to recalibrate your transmitter. --- shared/uavobjectdefinition/manualcontrolsettings.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/shared/uavobjectdefinition/manualcontrolsettings.xml b/shared/uavobjectdefinition/manualcontrolsettings.xml index 63488deee..5060c12db 100644 --- a/shared/uavobjectdefinition/manualcontrolsettings.xml +++ b/shared/uavobjectdefinition/manualcontrolsettings.xml @@ -2,11 +2,11 @@ Settings to indicate how to decode receiver input by @ref ManualControlModule. - - - - - + + + + + From e5e85fa47a21d57a749f22c8ed4fa702fbb734c2 Mon Sep 17 00:00:00 2001 From: elafargue Date: Sun, 5 Jun 2011 18:40:52 +0200 Subject: [PATCH 4/4] Get rid of the "Request" button on the config gadget: it now tracks object updates and automatically keeps its state synchronized with UAVOBject changes. --- .../openpilotgcs/src/plugins/config/ahrs.ui | 10 - .../src/plugins/config/airframe.ui | 20 -- .../src/plugins/config/ccattitude.ui | 7 - .../src/plugins/config/configahrswidget.cpp | 14 +- .../plugins/config/configairframewidget.cpp | 14 +- .../plugins/config/configccattitudewidget.cpp | 4 +- .../src/plugins/config/configccpmwidget.cpp | 2 +- .../src/plugins/config/configinputwidget.cpp | 24 ++- .../src/plugins/config/configoutputwidget.cpp | 63 +++---- .../config/configstabilizationwidget.cpp | 15 +- .../plugins/config/configtelemetrywidget.cpp | 6 +- .../openpilotgcs/src/plugins/config/input.ui | 12 +- .../openpilotgcs/src/plugins/config/output.ui | 11 -- .../src/plugins/config/stabilization.ui | 7 - .../src/plugins/config/telemetry.ui | 178 +++++++++--------- 15 files changed, 166 insertions(+), 221 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/ahrs.ui b/ground/openpilotgcs/src/plugins/config/ahrs.ui index de39ad079..e41c73afd 100644 --- a/ground/openpilotgcs/src/plugins/config/ahrs.ui +++ b/ground/openpilotgcs/src/plugins/config/ahrs.ui @@ -673,16 +673,6 @@ new home location unless it is in indoor mode. - - - - Refresh this screen with current values from the board. - - - Request - - - diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index 50403ab93..66a99e902 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -1962,16 +1962,6 @@ p, li { white-space: pre-wrap; } - - - - Retrieve settings from OpenPilot - - - Get Current - - - @@ -2316,16 +2306,6 @@ p, li { white-space: pre-wrap; } - - - - Request current settings from the board. - - - Get Current - - - diff --git a/ground/openpilotgcs/src/plugins/config/ccattitude.ui b/ground/openpilotgcs/src/plugins/config/ccattitude.ui index 2497983f5..f4ee69629 100644 --- a/ground/openpilotgcs/src/plugins/config/ccattitude.ui +++ b/ground/openpilotgcs/src/plugins/config/ccattitude.ui @@ -325,13 +325,6 @@ arming it in that case! - - - - Get Current - - - diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp index 9d81392e4..8a6e1397b 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp @@ -216,7 +216,12 @@ ConfigAHRSWidget::ConfigAHRSWidget(QWidget *parent) : ConfigTaskWidget(parent) // Connect the signals connect(m_ahrs->ahrsCalibStart, SIGNAL(clicked()), this, SLOT(launchAHRSCalibration())); connect(m_ahrs->accelBiasStart, SIGNAL(clicked()), this, SLOT(launchAccelBiasCalibration())); - connect(m_ahrs->ahrsSettingsRequest, SIGNAL(clicked()), this, SLOT(ahrsSettingsRequest())); + + obj = dynamic_cast(getObjectManager()->getObject(QString("AHRSSettings"))); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(ahrsSettingsRequest())); + obj = getObjectManager()->getObject(QString("HomeLocation")); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(ahrsSettingsRequest())); + /* connect(m_ahrs->algorithm, SIGNAL(currentIndexChanged(int)), this, SLOT(ahrsSettingsSave())); connect(m_ahrs->indoorFlight, SIGNAL(stateChanged(int)), this, SLOT(homeLocationSave())); @@ -227,7 +232,9 @@ ConfigAHRSWidget::ConfigAHRSWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_ahrs->sixPointsStart, SIGNAL(clicked()), this, SLOT(multiPointCalibrationMode())); connect(m_ahrs->sixPointsSave, SIGNAL(clicked()), this, SLOT(savePositionData())); connect(m_ahrs->startDriftCalib, SIGNAL(clicked()),this, SLOT(launchGyroDriftCalibration())); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(ahrsSettingsRequest())); + ahrsSettingsRequest(); // Connect the help button connect(m_ahrs->ahrsHelp, SIGNAL(clicked()), this, SLOT(openHelp())); @@ -1139,14 +1146,13 @@ void ConfigAHRSWidget::drawVariancesGraph() void ConfigAHRSWidget::ahrsSettingsRequest() { - UAVObject *obj = dynamic_cast(getObjectManager()->getObject(QString("AHRSSettings"))); - obj->requestUpdate(); + UAVObject *obj = getObjectManager()->getObject(QString("AHRSSettings")); UAVObjectField *field = obj->getField(QString("Algorithm")); if (field) m_ahrs->algorithm->setCurrentIndex(m_ahrs->algorithm->findText(field->getValue().toString())); drawVariancesGraph(); - obj = dynamic_cast(getObjectManager()->getObject(QString("HomeLocation"))); + obj = getObjectManager()->getObject(QString("HomeLocation")); field = obj->getField(QString("Set")); if (field) m_ahrs->homeLocationSet->setEnabled(field->getValue().toBool()); diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index da6dc6afb..37ce3eb1a 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -166,10 +166,9 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p connect(m_aircraft->saveAircraftToSD, SIGNAL(clicked()), this, SLOT(saveAircraftUpdate())); connect(m_aircraft->saveAircraftToRAM, SIGNAL(clicked()), this, SLOT(sendAircraftUpdate())); - connect(m_aircraft->getAircraftCurrent, SIGNAL(clicked()), this, SLOT(requestAircraftUpdate())); + connect(m_aircraft->ffSave, SIGNAL(clicked()), this, SLOT(saveAircraftUpdate())); connect(m_aircraft->ffApply, SIGNAL(clicked()), this, SLOT(sendAircraftUpdate())); - connect(m_aircraft->ffGetCurrent, SIGNAL(clicked()), this, SLOT(requestAircraftUpdate())); connect(m_aircraft->fixedWingType, SIGNAL(currentIndexChanged(QString)), this, SLOT(setupAirframeUI(QString))); connect(m_aircraft->multirotorFrameType, SIGNAL(currentIndexChanged(QString)), this, SLOT(setupAirframeUI(QString))); connect(m_aircraft->aircraftType, SIGNAL(currentIndexChanged(int)), this, SLOT(switchAirframeType(int))); @@ -193,6 +192,13 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p connect(m_aircraft->ffTestBox3, SIGNAL(clicked(bool)), this, SLOT(enableFFTest())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestAircraftUpdate())); + // Register for ManualControlSettings changes: + obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); + obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); + obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); // Connect the help button connect(m_aircraft->airframeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); @@ -447,7 +453,7 @@ void ConfigAirframeWidget::requestAircraftUpdate() // Get the Airframe type from the system settings: UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); Q_ASSERT(obj); - obj->requestUpdate(); + // obj->requestUpdate(); UAVObjectField *field = obj->getField(QString("AirframeType")); Q_ASSERT(field); // At this stage, we will need to have some hardcoded settings in this code, this @@ -457,7 +463,7 @@ void ConfigAirframeWidget::requestAircraftUpdate() obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(obj); - obj->requestUpdate(); + //obj->requestUpdate(); field = obj->getField(QString("ThrottleCurve1")); Q_ASSERT(field); QList curveValues; diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp index 2a15bf0cf..14c408521 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp @@ -41,11 +41,12 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : connect(ui->zeroBias,SIGNAL(clicked()),this,SLOT(startAccelCalibration())); connect(ui->saveButton,SIGNAL(clicked()),this,SLOT(saveAttitudeSettings())); connect(ui->applyButton,SIGNAL(clicked()),this,SLOT(applyAttitudeSettings())); - connect(ui->getCurrentButton,SIGNAL(clicked()),this,SLOT(getCurrentAttitudeSettings())); // Make it smart: connect(parent, SIGNAL(autopilotConnected()),this, SLOT(getCurrentAttitudeSettings())); getCurrentAttitudeSettings(); // The 1st time this panel is instanciated, the autopilot is already connected. + UAVObject * settings = getObjectManager()->getObject(QString("AttitudeSettings")); + connect(settings,SIGNAL(objectUpdated(UAVObject*)), this, SLOT(getCurrentAttitudeSettings())); // Connect the help button connect(ui->ccAttitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); @@ -128,7 +129,6 @@ void ConfigCCAttitudeWidget::applyAttitudeSettings() { void ConfigCCAttitudeWidget::getCurrentAttitudeSettings() { UAVDataObject * settings = dynamic_cast(getObjectManager()->getObject(QString("AttitudeSettings"))); - settings->requestUpdate(); UAVObjectField * field = settings->getField("BoardRotation"); ui->rollBias->setValue(field->getDouble(0)); ui->pitchBias->setValue(field->getDouble(1)); diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp index ea4078b52..7a8518f80 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp @@ -1276,7 +1276,7 @@ void ConfigccpmWidget::SwashLvlStartButtonPressed() // Get the channel assignements: obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); Q_ASSERT(obj); - obj->requestUpdate(); + // obj->requestUpdate(); MinField = obj->getField(QString("ChannelMin")); NeutralField = obj->getField(QString("ChannelNeutral")); MaxField = obj->getField(QString("ChannelMax")); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 9ee8f6bb7..b773ab787 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -97,10 +97,14 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) // Now connect the widget to the ManualControlCommand / Channel UAVObject - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("ManualControlCommand"))); connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateChannels(UAVObject*))); + // Register for ManualControlSettings changes: + obj = dynamic_cast(objManager->getObject(QString("ManualControlSettings"))); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestRCInputUpdate())); + + // Get the receiver types supported by OpenPilot and fill the corresponding // dropdown menu: obj = dynamic_cast(objManager->getObject(QString("ManualControlSettings"))); @@ -155,7 +159,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_config->saveRCInputToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject())); connect(m_config->saveRCInputToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate())); - connect(m_config->getRCInputCurrent, SIGNAL(clicked()), this, SLOT(requestRCInputUpdate())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestRCInputUpdate())); @@ -181,12 +184,13 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) enableControls(false); + // Ed's note: don't know who added this, this goes against the design + // of this plugin (there is a autopilotconnected event managed by the + // parent. // Listen to telemetry connection events if (pm) { TelemetryManager *tm = pm->getObject(); if (tm) { - connect(tm, SIGNAL(myStart()), this, SLOT(onTelemetryStart())); - connect(tm, SIGNAL(myStop()), this, SLOT(onTelemetryStop())); connect(tm, SIGNAL(connected()), this, SLOT(onTelemetryConnect())); connect(tm, SIGNAL(disconnected()), this, SLOT(onTelemetryDisconnect())); } @@ -286,14 +290,19 @@ void ConfigInputWidget::onTelemetryDisconnect() // ************************************ +/* + Enable or disable some controls depending on whether we are connected + or not to the board. Actually, this i mostly useless IMHO, I don't + know who added this into the code (Ed's note) + */ void ConfigInputWidget::enableControls(bool enable) { - m_config->getRCInputCurrent->setEnabled(enable); - m_config->saveRCInputToRAM->setEnabled(enable); + // m_config->saveRCInputToRAM->setEnabled(enable); m_config->saveRCInputToSD->setEnabled(enable); m_config->doRCInputCalibration->setEnabled(enable); + /* m_config->ch0Assign->setEnabled(enable); m_config->ch1Assign->setEnabled(enable); m_config->ch2Assign->setEnabled(enable); @@ -302,6 +311,7 @@ void ConfigInputWidget::enableControls(bool enable) m_config->ch5Assign->setEnabled(enable); m_config->ch6Assign->setEnabled(enable); m_config->ch7Assign->setEnabled(enable); + */ } @@ -316,7 +326,7 @@ void ConfigInputWidget::requestRCInputUpdate() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ManualControlSettings"))); Q_ASSERT(obj); - obj->requestUpdate(); + //obj->requestUpdate(); UAVObjectField *field; // Now update all the slider values: diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 27858e111..ddc0aeef8 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -120,21 +120,16 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren connect(m_config->channelOutTest, SIGNAL(toggled(bool)), this, SLOT(runChannelTests(bool))); - for (int i = 0; i < links.count(); i++) - links[i]->setChecked(false); - for (int i = 0; i < links.count(); i++) - connect(links[i], SIGNAL(toggled(bool)), this, SLOT(linkToggled(bool))); - - requestRCOutputUpdate(); + for (int i = 0; i < links.count(); i++) + links[i]->setChecked(false); + for (int i = 0; i < links.count(); i++) + connect(links[i], SIGNAL(toggled(bool)), this, SLOT(linkToggled(bool))); connect(m_config->saveRCOutputToSD, SIGNAL(clicked()), this, SLOT(saveRCOutputObject())); connect(m_config->saveRCOutputToRAM, SIGNAL(clicked()), this, SLOT(sendRCOutputUpdate())); - // Actually, this is not really needed since we are subscribing to the object updates already - // TODO: remove those buttons on all config gadget panels. - connect(m_config->getRCOutputCurrent, SIGNAL(clicked()), this, SLOT(requestRCOutputUpdate())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestRCOutputUpdate())); + requestRCOutputUpdate(); firstUpdate = true; @@ -193,7 +188,6 @@ void ConfigOutputWidget::enableControls(bool enable) { m_config->saveRCOutputToSD->setEnabled(enable); m_config->saveRCOutputToRAM->setEnabled(enable); - m_config->getRCOutputCurrent->setEnabled(enable); } // ************************************ @@ -203,29 +197,30 @@ void ConfigOutputWidget::enableControls(bool enable) */ void ConfigOutputWidget::linkToggled(bool state) { - // find the minimum slider value for the linked ones - int min = 10000; - int linked_count = 0; - for (int i = 0; i < outSliders.count(); i++) - { - if (!links[i]->checkState()) continue; - int value = outSliders[i]->value(); - if (min > value) min = value; - linked_count++; - } + Q_UNUSED(state) + // find the minimum slider value for the linked ones + int min = 10000; + int linked_count = 0; + for (int i = 0; i < outSliders.count(); i++) + { + if (!links[i]->checkState()) continue; + int value = outSliders[i]->value(); + if (min > value) min = value; + linked_count++; + } - if (linked_count <= 0) - return; // no linked channels + if (linked_count <= 0) + return; // no linked channels - if (!m_config->channelOutTest->checkState()) - return; // we are not in Test Output mode + if (!m_config->channelOutTest->checkState()) + return; // we are not in Test Output mode - // set the linked channels to the same value - for (int i = 0; i < outSliders.count(); i++) - { - if (!links[i]->checkState()) continue; - outSliders[i]->setValue(min); - } + // set the linked channels to the same value + for (int i = 0; i < outSliders.count(); i++) + { + if (!links[i]->checkState()) continue; + outSliders[i]->setValue(min); + } } /** @@ -547,8 +542,8 @@ void ConfigOutputWidget::saveRCOutputObject() Sets the minimum/maximum value of the channel 0 to seven output sliders. Have to do it here because setMinimum is not a slot. - One added trick: if the slider is at either its max or its min when the value - is changed, then keep it on the max/min. + One added trick: if the slider is at its min when the value + is changed, then keep it on the min. */ void ConfigOutputWidget::setChOutRange() { @@ -561,7 +556,7 @@ void ConfigOutputWidget::setChOutRange() QSlider *slider = outSliders[index]; int oldMini = slider->minimum(); - int oldMaxi = slider->maximum(); +// int oldMaxi = slider->maximum(); if (outMin[index]->value()value()) { diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index dd172a599..7010613aa 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -42,15 +42,15 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa m_stabilization = new Ui_StabilizationWidget(); m_stabilization->setupUi(this); - // Now connect the widget to the ManualControlCommand / Channel UAVObject - //UAVObject *obj = dynamic_cast(getObjectManager()->getObject(QString("StabilizationSettings"))); requestStabilizationUpdate(); connect(m_stabilization->saveStabilizationToSD, SIGNAL(clicked()), this, SLOT(saveStabilizationUpdate())); connect(m_stabilization->saveStabilizationToRAM, SIGNAL(clicked()), this, SLOT(sendStabilizationUpdate())); - connect(m_stabilization->getStabilizationCurrent, SIGNAL(clicked()), this, SLOT(requestStabilizationUpdate())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestStabilizationUpdate())); + // Now connect the widget to the StabilizationSettings object + UAVObject *obj = getObjectManager()->getObject(QString("StabilizationSettings")); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestStabilizationUpdate())); // Create a timer to regularly send the object update in case // we want realtime updates. @@ -180,7 +180,9 @@ void ConfigStabilizationWidget::updatePitchILimit(double val) */ void ConfigStabilizationWidget::requestStabilizationUpdate() { - stabSettings->requestUpdate(); + // Not needed anymore as this slot is called whenever we get + // a signal that the object was just updated + // stabSettings->requestUpdate(); StabilizationSettings::DataFields stabData = stabSettings->getData(); // Now fill in all the fields, this is fairly tedious: m_stabilization->rateRollKp->setValue(stabData.RollRatePI[StabilizationSettings::ROLLRATEPI_KP]); @@ -272,10 +274,11 @@ void ConfigStabilizationWidget::saveStabilizationUpdate() void ConfigStabilizationWidget::realtimeUpdateToggle(bool state) { - if (state) + if (state) { updateTimer.start(300); - else + } else { updateTimer.stop(); + } } void ConfigStabilizationWidget::openHelp() diff --git a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp index 843f94ffb..c155d5f40 100644 --- a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp @@ -43,16 +43,17 @@ ConfigTelemetryWidget::ConfigTelemetryWidget(QWidget *parent) : ConfigTaskWidget ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); - UAVObject *obj = dynamic_cast(objManager->getObject(QString("TelemetrySettings"))); + UAVObject *obj = objManager->getObject(QString("TelemetrySettings")); UAVObjectField *field = obj->getField(QString("Speed")); m_telemetry->telemetrySpeed->addItems(field->getOptions()); requestTelemetryUpdate(); connect(m_telemetry->saveTelemetryToSD, SIGNAL(clicked()), this, SLOT(saveTelemetryUpdate())); connect(m_telemetry->saveTelemetryToRAM, SIGNAL(clicked()), this, SLOT(sendTelemetryUpdate())); - connect(m_telemetry->getTelemetryCurrent, SIGNAL(clicked()), this, SLOT(requestTelemetryUpdate())); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(requestTelemetryUpdate())); connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestTelemetryUpdate())); + requestTelemetryUpdate(); } ConfigTelemetryWidget::~ConfigTelemetryWidget() @@ -74,7 +75,6 @@ void ConfigTelemetryWidget::requestTelemetryUpdate() UAVObjectManager *objManager = pm->getObject(); UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("TelemetrySettings"))); Q_ASSERT(obj); - obj->requestUpdate(); UAVObjectField *field = obj->getField(QString("Speed")); m_telemetry->telemetrySpeed->setCurrentIndex(m_telemetry->telemetrySpeed->findText(field->getValue().toString())); } diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index d3260e150..2bfd7b03d 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -7,7 +7,7 @@ 0 0 557 - 462 + 467 @@ -1406,16 +1406,6 @@ if you have not done so already. - - - - Retrieve settings from OpenPilot - - - Get Current - - - diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index 4d292204b..0084d11ed 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -1143,16 +1143,6 @@ p, li { white-space: pre-wrap; } - - - - Retrieve settings from OpenPilot - - - Get Current - - - @@ -1225,7 +1215,6 @@ Applies and Saves all settings to SD ch7Rev ch7Link channelOutTest - getRCOutputCurrent saveRCOutputToRAM saveRCOutputToSD diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index e4ccf1b89..55a563a49 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -638,13 +638,6 @@ automatically every 300ms, which will help for fast tuning. - - - - Get Current - - - diff --git a/ground/openpilotgcs/src/plugins/config/telemetry.ui b/ground/openpilotgcs/src/plugins/config/telemetry.ui index 905e2fdb2..0db9c9299 100644 --- a/ground/openpilotgcs/src/plugins/config/telemetry.ui +++ b/ground/openpilotgcs/src/plugins/config/telemetry.ui @@ -22,108 +22,98 @@ QFrame::Raised - - - - 10 - 10 - 361 - 151 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } </style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Set the serial speed of your onboard telemetry modem here. It is the speed between the OpenPilot board and the onboard modem, and could be different from the radio link speed.</span></p> <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;"></p> <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans'; font-size:10pt;">Beware of not locking yourself out! You should only modify this setting when the OpenPilot board is connected through the USB port.</span></p></body></html> - - - - - - 70 - 200 - 131 - 17 - - - - - 11 - 75 - true - - - - Telemetry speed: - - - - - - 200 - 190 - 141 - 31 - - - - Select the speed here. - - - - - - 190 - 280 - 93 - 27 - - - - Send to OpenPilot but don't write in SD. + + + + + + + + + + 11 + 75 + true + + + + Telemetry speed: + + + + + + + Select the speed here. + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Send to OpenPilot but don't write in SD. Beware of not locking yourself out! - - - Apply - - - - - - 80 - 280 - 93 - 27 - - - - Retrieve settings from OpenPilot - - - Get Current - - - - - - 300 - 280 - 93 - 27 - - - - Applies and Saves all settings to SD. + + + Apply + + + + + + + Applies and Saves all settings to SD. Beware of not locking yourself out! - - - Save - - + + + Save + + + + + +