From f4b19fe65aeac71aff0592064a3f5eaed565acc0 Mon Sep 17 00:00:00 2001 From: elafargue Date: Thu, 2 Jun 2011 16:08:19 +0200 Subject: [PATCH 01/33] OP-369 Settings Import/Export for the Airframe. Also sanitized UAV Object saving in flash in one central location in the uavobjectutils library. --- .../src/plugins/config/configahrswidget.cpp | 3 +- .../plugins/config/configairframewidget.cpp | 17 +- .../src/plugins/config/configccpmwidget.cpp | 9 +- .../src/plugins/config/configinputwidget.cpp | 6 +- .../src/plugins/config/configoutputwidget.cpp | 6 +- .../config/configstabilizationwidget.cpp | 6 +- .../src/plugins/config/configtaskwidget.cpp | 99 +------- .../src/plugins/config/configtaskwidget.h | 10 +- .../plugins/config/configtelemetrywidget.cpp | 10 +- .../src/plugins/importexport/importexport.pro | 11 +- .../importexport/importexportdialog.cpp | 3 +- .../plugins/importexport/importexportdialog.h | 3 +- .../importexport/importexportdialog.ui | 2 +- .../importexportgadgetconfiguration.cpp | 76 ------ .../importexportgadgetconfiguration.h | 65 ------ .../importexportgadgetfactory.cpp | 67 ------ .../importexport/importexportgadgetfactory.h | 61 ----- .../importexportgadgetoptionspage.cpp | 81 ------- .../importexportgadgetoptionspage.h | 74 ------ .../importexportgadgetoptionspage.ui | 103 --------- .../importexport/importexportgadgetwidget.cpp | 49 ++-- .../importexport/importexportgadgetwidget.h | 4 +- .../importexport/importexportgadgetwidget.ui | 85 ++++--- .../importexport/importexportplugin.cpp | 7 +- .../plugins/importexport/importexportplugin.h | 3 - .../uavobjectutil/uavobjectutilmanager.cpp | 121 ++++++---- .../uavobjectutil/uavobjectutilmanager.h | 12 +- .../uavsettingsimportexport.cpp | 218 +++++++++++------- .../uavsettingsimportexport.h | 4 +- .../uavsettingsimportexport.pluginspec | 1 + .../uavsettingsimportexport_dependencies.pri | 1 + 31 files changed, 322 insertions(+), 895 deletions(-) delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.cpp delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.h delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.cpp delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.h delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.cpp delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.h delete mode 100644 ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.ui diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp index 9d81392e4..228e7157e 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp @@ -568,8 +568,7 @@ void ConfigAHRSWidget::saveAHRSCalibration() UAVObjectField *field = obj->getField(QString("measure_var")); field->setValue("SET"); obj->updated(); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); - + saveObjectToSD(obj); } FORCE_ALIGN_FUNC diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index da6dc6afb..4e23de86e 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -1524,7 +1524,7 @@ bool ConfigAirframeWidget::setupMixer(double mixerFactors[8][3]) setupQuadMotor(channel, mixerFactors[i][0]*pFactor, rFactor*mixerFactors[i][1], yFactor*mixerFactors[i][2]); } - obj->updated(); +// obj->updated(); return true; } @@ -1568,7 +1568,7 @@ void ConfigAirframeWidget::setupMotors(QList motorList) field = obj->getField(motor); field->setValue(mmList.takeFirst()->currentText()); } - obj->updated(); // Save... + //obj->updated(); // Save... } @@ -2026,14 +2026,12 @@ void ConfigAirframeWidget::sendAircraftUpdate() m_aircraft->mrStatusLabel->setText("Error: Assign a Yaw channel"); return; } + motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorS"; + setupMotors(motorList); obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); Q_ASSERT(obj); field = obj->getField("FixedWingYaw1"); field->setValue(m_aircraft->triYawChannel->currentText()); - // No need to send a obj->updated() here because setupMotors - // will do it. - motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorS"; - setupMotors(motorList); // Motor 1 to 6, Y6 Layout: // pitch roll yaw @@ -2112,10 +2110,13 @@ void ConfigAirframeWidget::sendAircraftUpdate() field->setValue(m_aircraft->customMixerTable->item(5,i)->text(),ti); } - obj->updated(); } - UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); + obj->updated(); + obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); + obj->updated(); + obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); UAVObjectField* field = obj->getField(QString("AirframeType")); field->setValue(airframeType); obj->updated(); diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp index ea4078b52..74e38b803 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp @@ -1195,11 +1195,9 @@ void ConfigccpmWidget::saveccpmUpdate() ShowDisclaimer(0); // Send update so that the latest value is saved sendccpmUpdate(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("MixerSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(obj); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); } void ConfigccpmWidget::resizeEvent(QResizeEvent* event) @@ -1506,8 +1504,7 @@ void ConfigccpmWidget::SwashLvlFinishButtonPressed() } obj->updated(); - - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); //restore Flight control of ActuatorCommand enableSwashplateLevellingControl(false); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 9ee8f6bb7..84f29705b 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -508,11 +508,9 @@ void ConfigInputWidget::saveRCInputObject() { // Send update so that the latest value is saved sendRCInputUpdate(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("ManualControlSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ManualControlSettings"))); Q_ASSERT(obj); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); } diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 27858e111..8a38ce80f 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -534,11 +534,9 @@ void ConfigOutputWidget::saveRCOutputObject() { // Send update so that the latest value is saved sendRCOutputUpdate(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); Q_ASSERT(obj); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); } diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index dd172a599..c78db94bd 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -262,11 +262,9 @@ void ConfigStabilizationWidget::saveStabilizationUpdate() { // Send update so that the latest value is saved sendStabilizationUpdate(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("StabilizationSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("StabilizationSettings"))); Q_ASSERT(obj); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); } diff --git a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp index 8fb743ef0..9ddf04aa6 100644 --- a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp @@ -30,8 +30,6 @@ ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent) { - saveState = IDLE; - queue.clear(); } ConfigTaskWidget::~ConfigTaskWidget() @@ -41,100 +39,13 @@ ConfigTaskWidget::~ConfigTaskWidget() void ConfigTaskWidget::saveObjectToSD(UAVObject *obj) { - // Add to queue - queue.enqueue(obj); - // If queue length is one, then start sending (call sendNextObject) - // Otherwise, do nothing, it's sending anyway - if (queue.length()==1) - saveNextObject(); - + // saveObjectToSD is now handled by the UAVUtils plugin in one + // central place (and one central queue) + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectUtilManager* utilMngr = pm->getObject(); + utilMngr->saveObjectToSD(obj); } -void ConfigTaskWidget::saveNextObject() -{ - if ( queue.isEmpty() ) - { - return; - } - - Q_ASSERT(saveState == IDLE); - - // Get next object from the queue - UAVObject* obj = queue.head(); - ObjectPersistence* objper = dynamic_cast( getObjectManager()->getObject(ObjectPersistence::NAME) ); - connect(objper, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); - connect(objper, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(objectPersistenceUpdated(UAVObject *))); - saveState = AWAITING_ACK; - if (obj != NULL) - { - ObjectPersistence::DataFields data; - data.Operation = ObjectPersistence::OPERATION_SAVE; - data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; - data.ObjectID = obj->getObjID(); - data.InstanceID = obj->getInstID(); - objper->setData(data); - objper->updated(); - } -} - -/** - * @brief Process the transactionCompleted message from Telemetry indicating request sent successfully - * @param[in] The object just transsacted. Must be ObjectPersistance - * @param[in] success Indicates that the transaction did not time out - * - * After a failed transaction (usually timeout) resends the save request. After a succesful - * transaction will then wait for a save completed update from the autopilot. - */ -void ConfigTaskWidget::objectPersistenceTransactionCompleted(UAVObject* obj, bool success) -{ - if(success) { - Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); - Q_ASSERT(saveState == AWAITING_ACK); - saveState = AWAITING_COMPLETED; - disconnect(obj, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); - } else if (!success) { - // Can be caused by timeout errors on sending. Send again. - saveNextObject(); - } -} - -/** - * @brief Process the ObjectPersistence updated message to confirm the right object saved - * then requests next object be saved. - * @param[in] The object just received. Must be ObjectPersistance - */ -void ConfigTaskWidget::objectPersistenceUpdated(UAVObject * obj) -{ - Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); - if(saveState == AWAITING_COMPLETED) { - // Check flight is saying it completed. This is the only thing flight should do to trigger an update. - Q_ASSERT( obj->getField("Operation")->getValue().toString().compare(QString("Completed")) == 0 ); - - // Check right object saved - UAVObject* savingObj = queue.head(); - Q_ASSERT( obj->getField("ObjectID")->getValue() == savingObj->getObjID() ); - - obj->disconnect(this); - queue.dequeue(); // We can now remove the object, it's done. - saveState = IDLE; - saveNextObject(); - } -} - -void ConfigTaskWidget::updateObjectPersistance(ObjectPersistence::OperationOptions op, UAVObject *obj) -{ - ObjectPersistence* objper = dynamic_cast( getObjectManager()->getObject(ObjectPersistence::NAME) ); - if (obj != NULL) - { - ObjectPersistence::DataFields data; - data.Operation = op; - data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; - data.ObjectID = obj->getObjID(); - data.InstanceID = obj->getInstID(); - objper->setData(data); - objper->updated(); - } -} UAVObjectManager* ConfigTaskWidget::getObjectManager() { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); diff --git a/ground/openpilotgcs/src/plugins/config/configtaskwidget.h b/ground/openpilotgcs/src/plugins/config/configtaskwidget.h index 0650ddb25..5c467b918 100644 --- a/ground/openpilotgcs/src/plugins/config/configtaskwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configtaskwidget.h @@ -31,7 +31,7 @@ #include "extensionsystem/pluginmanager.h" #include "uavobjectmanager.h" #include "uavobject.h" -#include "objectpersistence.h" +#include "uavobjectutilmanager.h" #include #include #include @@ -45,20 +45,12 @@ public: ConfigTaskWidget(QWidget *parent = 0); ~ConfigTaskWidget(); void saveObjectToSD(UAVObject *obj); - void updateObjectPersistance(ObjectPersistence::OperationOptions op, UAVObject *obj); UAVObjectManager* getObjectManager(); - static double listMean(QList list); private slots: - void objectPersistenceTransactionCompleted(UAVObject* obj, bool success); - void objectPersistenceUpdated(UAVObject * obj); private: - QQueue queue; - void saveNextObject(); - enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState; - }; diff --git a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp index 843f94ffb..8e8ce5fbc 100644 --- a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp @@ -84,9 +84,7 @@ void ConfigTelemetryWidget::requestTelemetryUpdate() */ void ConfigTelemetryWidget::sendTelemetryUpdate() { - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("TelemetrySettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("TelemetrySettings"))); Q_ASSERT(obj); UAVObjectField* field = obj->getField(QString("Speed")); field->setValue(m_telemetry->telemetrySpeed->currentText()); @@ -100,11 +98,9 @@ void ConfigTelemetryWidget::saveTelemetryUpdate() { // Send update so that the latest value is saved sendTelemetryUpdate(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); - UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("TelemetrySettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("TelemetrySettings"))); Q_ASSERT(obj); - updateObjectPersistance(ObjectPersistence::OPERATION_SAVE, obj); + saveObjectToSD(obj); } diff --git a/ground/openpilotgcs/src/plugins/importexport/importexport.pro b/ground/openpilotgcs/src/plugins/importexport/importexport.pro index 0d5d2778d..3c9b6ba13 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexport.pro +++ b/ground/openpilotgcs/src/plugins/importexport/importexport.pro @@ -7,18 +7,9 @@ include(importexport_dependencies.pri) HEADERS += importexportplugin.h \ importexportgadgetwidget.h \ importexportdialog.h -HEADERS += importexportgadget.h -HEADERS += importexportgadgetfactory.h -HEADERS += importexportgadgetconfiguration.h -HEADERS += importexportgadgetoptionspage.h SOURCES += importexportplugin.cpp \ importexportgadgetwidget.cpp \ importexportdialog.cpp -SOURCES += importexportgadget.cpp -SOURCES += importexportgadgetfactory.cpp -SOURCES += importexportgadgetconfiguration.cpp -SOURCES += importexportgadgetoptionspage.cpp OTHER_FILES += ImportExportGadget.pluginspec -FORMS += importexportgadgetoptionspage.ui \ - importexportgadgetwidget.ui \ +FORMS += importexportgadgetwidget.ui \ importexportdialog.ui diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.cpp index 74efb81e1..df38653f8 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.cpp @@ -1,12 +1,11 @@ #include "importexportdialog.h" #include "ui_importexportdialog.h" -ImportExportDialog::ImportExportDialog( ImportExportGadgetConfiguration *config, QWidget *parent) : +ImportExportDialog::ImportExportDialog(QWidget *parent) : QDialog(parent), ui(new Ui::ImportExportDialog) { ui->setupUi(this); - ui->widget->loadConfiguration(config); setWindowTitle(tr("Import Export Settings")); connect( ui->widget, SIGNAL(done()), this, SLOT(close())); diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.h b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.h index e93addd77..008d588d1 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.h +++ b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.h @@ -27,7 +27,6 @@ #define IMPORTEXPORTDIALOG_H #include -#include "importexportgadgetconfiguration.h" namespace Ui { class ImportExportDialog; @@ -38,7 +37,7 @@ class ImportExportDialog : public QDialog Q_OBJECT public: - explicit ImportExportDialog( ImportExportGadgetConfiguration *config, QWidget *parent = 0); + explicit ImportExportDialog(QWidget *parent = 0); ~ImportExportDialog(); protected: diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.ui b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.ui index eca016fc4..3c0fca682 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportdialog.ui +++ b/ground/openpilotgcs/src/plugins/importexport/importexportdialog.ui @@ -23,7 +23,7 @@ Qt::Horizontal - QDialogButtonBox::Cancel + QDialogButtonBox::Close diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.cpp deleted file mode 100644 index 8e97c9bec..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/** - ****************************************************************************** - * - * @file importexportgadgetconfiguration.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @brief Configuration for Import/Export Plugin - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "importexportgadgetconfiguration.h" - -static const QString VERSION = "1.0.1"; - -/** - * Loads a saved configuration or defaults if non exist. - * - */ -ImportExportGadgetConfiguration::ImportExportGadgetConfiguration(QString classId, QSettings* qSettings, UAVConfigInfo *configInfo, QObject *parent) : - IUAVGadgetConfiguration(classId, parent) -{ - if ( ! qSettings ) - return; - - if ( configInfo->version() == UAVConfigVersion() ) - configInfo->setVersion("1.0.0"); - - if ( !configInfo->standardVersionHandlingOK(VERSION)) - return; - - iniFile = qSettings->value("iniFile", "gcs.xml").toString(); -} - -/** - * Clones a configuration. - * - */ -IUAVGadgetConfiguration *ImportExportGadgetConfiguration::clone() -{ - ImportExportGadgetConfiguration *m = new ImportExportGadgetConfiguration(this->classId()); - m->iniFile = iniFile; - return m; -} - -/** - * Saves a configuration. - * - */ -void ImportExportGadgetConfiguration::saveConfig(QSettings* qSettings, Core::UAVConfigInfo *configInfo) const { - configInfo->setVersion(VERSION); - qSettings->setValue("iniFile", iniFile); -} - -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.h b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.h deleted file mode 100644 index 21a87ff27..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetconfiguration.h +++ /dev/null @@ -1,65 +0,0 @@ -/** - ****************************************************************************** - * @file - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef IMPORTEXPORTGADGETCONFIGURATION_H -#define IMPORTEXPORTGADGETCONFIGURATION_H - -#include -#include "importexport_global.h" - -using namespace Core; - -/* This is a generic bargraph dial - supporting one indicator. - */ -class IMPORTEXPORT_EXPORT ImportExportGadgetConfiguration : public IUAVGadgetConfiguration -{ - Q_OBJECT -public: - ImportExportGadgetConfiguration(QString classId, QSettings* qSettings = 0, UAVConfigInfo *configInfo = 0, QObject *parent = 0); - - //set dial configuration functions - void setIniFile(QString filename) { - iniFile = filename; - } - - //get dial configuration functions - QString getIniFile() const{ - return iniFile; - } - - void saveConfig(QSettings* settings, Core::UAVConfigInfo *configInfo) const; - IUAVGadgetConfiguration *clone(); - -private: - QString iniFile; -}; - -#endif // IMPORTEXPORTGADGETCONFIGURATION_H -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.cpp deleted file mode 100644 index b9d93fde3..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/** - ****************************************************************************** - * - * @file importexportgadgetfactory.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @brief Factory for Import/Export Plugin - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "importexportgadgetfactory.h" -#include "importexportgadgetwidget.h" -#include "importexportgadget.h" -#include "importexportgadgetconfiguration.h" -#include "importexportgadgetoptionspage.h" -#include - -ImportExportGadgetFactory::ImportExportGadgetFactory(QObject *parent) : - IUAVGadgetFactory(QString("ImportExportGadget"), - tr("Import/Export GCS Config"), - parent) -{ -} - -ImportExportGadgetFactory::~ImportExportGadgetFactory() -{ -} - -Core::IUAVGadget* ImportExportGadgetFactory::createGadget(QWidget *parent) -{ - ImportExportGadgetWidget* gadgetWidget = new ImportExportGadgetWidget(parent); - return new ImportExportGadget(QString("ImportExportGadget"), gadgetWidget, parent); -} - -IUAVGadgetConfiguration *ImportExportGadgetFactory::createConfiguration(QSettings* qSettings, UAVConfigInfo *configInfo) -{ - lastConfig = new ImportExportGadgetConfiguration(QString("ImportExportGadget"), qSettings, configInfo); - return lastConfig; -} - -IOptionsPage *ImportExportGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *config) -{ - return new ImportExportGadgetOptionsPage(qobject_cast(config)); -} - -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.h b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.h deleted file mode 100644 index ac1b56494..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetfactory.h +++ /dev/null @@ -1,61 +0,0 @@ -/** - ****************************************************************************** - * @file - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef IMPORTEXPORTGADGETFACTORY_H_ -#define IMPORTEXPORTGADGETFACTORY_H_ - -#include -#include "importexportgadgetconfiguration.h" - -namespace Core -{ -class IUAVGadget; -class IUAVGadgetFactory; -} - -using namespace Core; - -class IMPORTEXPORT_EXPORT ImportExportGadgetFactory : public IUAVGadgetFactory -{ - Q_OBJECT -public: - ImportExportGadgetFactory(QObject *parent = 0); - ~ImportExportGadgetFactory(); - ImportExportGadgetConfiguration *getLastConfig(){ return lastConfig;} - - Core::IUAVGadget *createGadget(QWidget *parent); - IUAVGadgetConfiguration *createConfiguration(QSettings *qSettings, UAVConfigInfo *configInfo); - IOptionsPage *createOptionsPage(IUAVGadgetConfiguration *config); - -private: - ImportExportGadgetConfiguration *lastConfig; -}; - -#endif // IMPORTEXPORTGADGETFACTORY_H_ -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.cpp deleted file mode 100644 index ade45bb5f..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/** - ****************************************************************************** - * - * @file importexportgadgetoptionspage.cpp - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @brief Option page for Import/Export Plugin - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - * - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "importexportgadgetoptionspage.h" -#include "importexportgadgetconfiguration.h" -#include "ui_importexportgadgetoptionspage.h" - -#include -#include - -ImportExportGadgetOptionsPage::ImportExportGadgetOptionsPage(ImportExportGadgetConfiguration *config, QObject *parent) : - IOptionsPage(parent), - m_config(config) -{ -} - -//creates options page widget (uses the UI file) -QWidget *ImportExportGadgetOptionsPage::createPage(QWidget *parent) -{ - - options_page = new Ui::ImportExportGadgetOptionsPage(); - //main widget - QWidget *optionsPageWidget = new QWidget; - //main layout - options_page->setupUi(optionsPageWidget); - - // Restore the contents from the settings: - options_page->iniFile->setExpectedKind(Utils::PathChooser::File); - options_page->iniFile->setPromptDialogFilter(tr("INI file (*.ini);; XML file (*.xml)")); - options_page->iniFile->setPromptDialogTitle(tr("Choose configuration file")); - options_page->iniFile->setPath(m_config->getIniFile()); - - return optionsPageWidget; -} - -/** - * Called when the user presses apply or OK. - * - * Saves the current values - * - */ -void ImportExportGadgetOptionsPage::apply() -{ - m_config->setIniFile(options_page->iniFile->path()); -} - - -void ImportExportGadgetOptionsPage::finish() -{ - -} -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.h b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.h deleted file mode 100644 index 41415dde4..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.h +++ /dev/null @@ -1,74 +0,0 @@ -/** - ****************************************************************************** - * @file - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. - * @see The GNU Public License (GPL) Version 3 - * @addtogroup GCSPlugins GCS Plugins - * @{ - * @addtogroup importexportplugin - * @{ - *****************************************************************************/ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef IMPORTEXPORTGADGETOPTIONSPAGE_H -#define IMPORTEXPORTGADGETOPTIONSPAGE_H - -#include "importexport_global.h" -#include "coreplugin/dialogs/ioptionspage.h" -#include -#include -#include -#include - -namespace Core -{ -class IUAVGadgetConfiguration; -} - -class ImportExportGadgetConfiguration; - -namespace Ui -{ -class ImportExportGadgetOptionsPage; -} - -using namespace Core; - -class IMPORTEXPORT_EXPORT ImportExportGadgetOptionsPage : public IOptionsPage -{ - Q_OBJECT -public: - explicit ImportExportGadgetOptionsPage(ImportExportGadgetConfiguration *config, QObject *parent = 0); - - QWidget *createPage(QWidget *parent); - void apply(); - void finish(); - -private: - Ui::ImportExportGadgetOptionsPage *options_page; - ImportExportGadgetConfiguration *m_config; - QFont font; - -private slots: - -}; - -#endif // IMPORTEXPORTGADGETOPTIONSPAGE_H -/** - * @} - * @} - */ diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.ui deleted file mode 100644 index 176d5dd6c..000000000 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetoptionspage.ui +++ /dev/null @@ -1,103 +0,0 @@ - - - ImportExportGadgetOptionsPage - - - - 0 - 0 - 486 - 300 - - - - - 0 - 0 - - - - Form - - - - - -1 - -1 - 485 - 339 - - - - - QLayout::SetMinimumSize - - - 10 - - - 5 - - - 10 - - - 10 - - - - - 10 - - - QLayout::SetMaximumSize - - - 10 - - - - - Default Config File - - - - - - - - 0 - 0 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 -
-
- - -
diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp index eda567bde..350e1a3ff 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.cpp @@ -48,10 +48,9 @@ ImportExportGadgetWidget::ImportExportGadgetWidget(QWidget *parent) : setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); ui->setupUi(this); ui->configFile->setExpectedKind(Utils::PathChooser::File); - ui->configFile->setPromptDialogFilter(tr("INI file (*.ini);; XML file (*.xml)")); + ui->configFile->setPromptDialogFilter(tr("XML file (*.xml)")); ui->configFile->setPromptDialogTitle(tr("Choose configuration file")); - } ImportExportGadgetWidget::~ImportExportGadgetWidget() @@ -70,17 +69,22 @@ void ImportExportGadgetWidget::changeEvent(QEvent *e) break; } } -void ImportExportGadgetWidget::loadConfiguration(const ImportExportGadgetConfiguration* config) -{ - if ( !config ) - return; - - ui->configFile->setPath(config->getIniFile()); -} void ImportExportGadgetWidget::on_exportButton_clicked() { QString file = ui->configFile->path(); + if (file.isEmpty()) { + QMessageBox msgBox; + msgBox.setText(tr("Empty File name.")); + msgBox.setInformativeText(tr("Please choose an export file name.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + return; + } + // Add a "XML" extension to the file in case it does not exist: + if (!file.endsWith(".xml")) + file.append(".xml"); + qDebug() << "Export pressed! Write to file " << QFileInfo(file).absoluteFilePath(); if ( QFileInfo(file).exists() ){ @@ -133,18 +137,7 @@ void ImportExportGadgetWidget::exportConfiguration(const QString& fileName) bool doAllGadgets = ui->checkBoxAllGadgets->isChecked(); bool doPlugins = ui->checkBoxPlugins->isChecked(); - QSettings::Format format; - if ( ui->radioButtonIniFormat->isChecked() ){ - format = QSettings::IniFormat; - } - else if ( ui->radioButtonXmlFormat->isChecked() ){ - format = XmlConfig::XmlSettingsFormat; - } - else { - qWarning() << "Program Error in ImportExportGadgetWidget::exportConfiguration: unknown format. Assume XML!"; - format = XmlConfig::XmlSettingsFormat; - } - + QSettings::Format format = XmlConfig::XmlSettingsFormat; QSettings qs(fileName, format); if (doGeneral) { @@ -193,19 +186,7 @@ void ImportExportGadgetWidget::importConfiguration(const QString& fileName) bool doAllGadgets = ui->checkBoxAllGadgets->isChecked(); bool doPlugins = ui->checkBoxPlugins->isChecked(); - QSettings::Format format; - if ( ui->radioButtonIniFormat->isChecked() ){ - format = QSettings::IniFormat; - } - else if ( ui->radioButtonXmlFormat->isChecked() ){ - format = XmlConfig::XmlSettingsFormat; - } - else { - qWarning() << "Program Error in ImportExportGadgetWidget::exportConfiguration: unknown format. Assume XML!"; - format = XmlConfig::XmlSettingsFormat; - } - - QSettings qs(fileName, format); + QSettings qs(fileName, XmlConfig::XmlSettingsFormat); if ( doAllGadgets ) { Core::ICore::instance()->uavGadgetInstanceManager()->readSettings(&qs); diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h index 37393678c..ced46a059 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.h @@ -13,8 +13,8 @@ #include #include +#include "importexport_global.h" #include -#include "importexportgadgetconfiguration.h" namespace Ui { @@ -28,8 +28,6 @@ public: ImportExportGadgetWidget(QWidget *parent = 0); ~ImportExportGadgetWidget(); - void loadConfiguration(const ImportExportGadgetConfiguration* config); - signals: void done(); diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui index 2aba80711..c29461d5c 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui +++ b/ground/openpilotgcs/src/plugins/importexport/importexportgadgetwidget.ui @@ -82,8 +82,50 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + Export the GCS settings selected in the checkboxes above. + Export @@ -91,6 +133,9 @@ + + Import settings from the config file, only for the items checked above. + Import @@ -98,46 +143,16 @@ + + Resets your GCS configuration to its default configuration. + Reset Config - - - - Help - - - - - - - Format - - - - - - XML Format - - - true - - - - - - - INI Format - - - - - - @@ -148,6 +163,8 @@ 1 - + + + diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp index 44d2b82a1..32f783593 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp @@ -4,7 +4,7 @@ * @file importexportplugin.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. * @see The GNU Public License (GPL) Version 3 - * @brief Import/Export Plugin + * @brief Import/Export Plugin for GCS Settings * @addtogroup GCSPlugins GCS Plugins * @{ * @defgroup importexportplugin @@ -28,7 +28,6 @@ */ #include "importexportplugin.h" -#include "importexportgadgetfactory.h" #include "importexportdialog.h" #include #include @@ -55,8 +54,6 @@ bool ImportExportPlugin::initialize(const QStringList& args, QString *errMsg) { Q_UNUSED(args); Q_UNUSED(errMsg); - mf = new ImportExportGadgetFactory(this); - addAutoReleasedObject(mf); // Add Menu entry Core::ActionManager* am = Core::ICore::instance()->actionManager(); @@ -82,7 +79,7 @@ bool ImportExportPlugin::initialize(const QStringList& args, QString *errMsg) void ImportExportPlugin::importExport() { - ImportExportDialog(mf->getLastConfig()).exec(); + ImportExportDialog().exec(); } void ImportExportPlugin::extensionsInitialized() diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.h b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.h index 91b3ed901..7070ce56c 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.h +++ b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.h @@ -30,8 +30,6 @@ #include #include "importexport_global.h" -class ImportExportGadgetFactory; - class IMPORTEXPORT_EXPORT ImportExportPlugin : public ExtensionSystem::IPlugin { Q_OBJECT @@ -44,7 +42,6 @@ public: bool initialize(const QStringList & arguments, QString * errorString); void shutdown(); private: - ImportExportGadgetFactory *mf; private slots: void importExport(); diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index 9bfa9f24e..a4cde6428 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -58,64 +58,101 @@ UAVObjectUtilManager::~UAVObjectUtilManager() } } + +UAVObjectManager* UAVObjectUtilManager::getObjectManager() { + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager * objMngr = pm->getObject(); + Q_ASSERT(objMngr); + return objMngr; +} + + // ****************************** // SD card saving - +// void UAVObjectUtilManager::saveObjectToSD(UAVObject *obj) { - QMutexLocker locker(mutex); + // Add to queue + queue.enqueue(obj); + // If queue length is one, then start sending (call sendNextObject) + // Otherwise, do nothing, it's sending anyway + if (queue.length()==1) + saveNextObject(); - if (!obj) return; - - // Add to queue - queue.enqueue(obj); - - // If queue length is one, then start sending (call sendNextObject) - // Otherwise, do nothing, it's sending anyway - if (queue.length() <= 1) - saveNextObject(); } void UAVObjectUtilManager::saveNextObject() { - if (queue.isEmpty()) return; + if ( queue.isEmpty() ) + { + return; + } - // Get next object from the queue - UAVObject *obj = queue.head(); - if (!obj) return; + Q_ASSERT(saveState == IDLE); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - if (!pm) return; - - UAVObjectManager *om = pm->getObject(); - if (!om) return; - - ObjectPersistence *objper = dynamic_cast(om->getObject(ObjectPersistence::NAME)); - connect(objper, SIGNAL(transactionCompleted(UAVObject *, bool)), this, SLOT(transactionCompleted(UAVObject *, bool))); - - ObjectPersistence::DataFields data; - data.Operation = ObjectPersistence::OPERATION_SAVE; - data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; - data.ObjectID = obj->getObjID(); - data.InstanceID = obj->getInstID(); - objper->setData(data); - objper->updated(); + // Get next object from the queue + UAVObject* obj = queue.head(); + ObjectPersistence* objper = dynamic_cast( getObjectManager()->getObject(ObjectPersistence::NAME) ); + connect(objper, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); + connect(objper, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(objectPersistenceUpdated(UAVObject *))); + saveState = AWAITING_ACK; + if (obj != NULL) + { + ObjectPersistence::DataFields data; + data.Operation = ObjectPersistence::OPERATION_SAVE; + data.Selection = ObjectPersistence::SELECTION_SINGLEOBJECT; + data.ObjectID = obj->getObjID(); + data.InstanceID = obj->getInstID(); + objper->setData(data); + objper->updated(); + } } -void UAVObjectUtilManager::transactionCompleted(UAVObject *obj, bool success) +/** + * @brief Process the transactionCompleted message from Telemetry indicating request sent successfully + * @param[in] The object just transsacted. Must be ObjectPersistance + * @param[in] success Indicates that the transaction did not time out + * + * After a failed transaction (usually timeout) resends the save request. After a succesful + * transaction will then wait for a save completed update from the autopilot. + */ +void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject* obj, bool success) { - Q_UNUSED(success); - - QMutexLocker locker(mutex); - - if (!obj) return; - - // Disconnect from sending object - obj->disconnect(this); - queue.dequeue(); // We can now remove the object, it's done. - saveNextObject(); + if(success) { + Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); + Q_ASSERT(saveState == AWAITING_ACK); + saveState = AWAITING_COMPLETED; + disconnect(obj, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); + } else if (!success) { + // Can be caused by timeout errors on sending. Send again. + saveNextObject(); + } } +/** + * @brief Process the ObjectPersistence updated message to confirm the right object saved + * then requests next object be saved. + * @param[in] The object just received. Must be ObjectPersistance + */ +void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj) +{ + Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); + if(saveState == AWAITING_COMPLETED) { + // Check flight is saying it completed. This is the only thing flight should do to trigger an update. + Q_ASSERT( obj->getField("Operation")->getValue().toString().compare(QString("Completed")) == 0 ); + + // Check right object saved + UAVObject* savingObj = queue.head(); + Q_ASSERT( obj->getField("ObjectID")->getValue() == savingObj->getObjID() ); + + obj->disconnect(this); + queue.dequeue(); // We can now remove the object, it's done. + saveState = IDLE; + saveNextObject(); + } +} + + /** * Get the UAV Board model, for anyone interested. Return format is: * (Board Type << 8) + BoardRevision. diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h index 5d6afbfa2..80ca9e900 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h @@ -63,17 +63,21 @@ public: int getBoardModel(); QByteArray getBoardCPUSerial(); QString getBoardDescription(); + UAVObjectManager* getObjectManager(); + void saveObjectToSD(UAVObject *obj); + private: QMutex *mutex; - QQueue queue; - + enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState; void saveNextObject(); - void saveObjectToSD(UAVObject *obj); private slots: - void transactionCompleted(UAVObject *obj, bool success); + //void transactionCompleted(UAVObject *obj, bool success); + void objectPersistenceTransactionCompleted(UAVObject* obj, bool success); + void objectPersistenceUpdated(UAVObject * obj); + }; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 7bd6b3e5b..e1b9ea1d1 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -36,6 +36,7 @@ #include #include +#include // for menu item #include @@ -74,20 +75,21 @@ bool UAVSettingsImportExportPlugin::initialize(const QStringList& args, QString Core::ActionManager* am = Core::ICore::instance()->actionManager(); Core::ActionContainer* ac = am->actionContainer(Core::Constants::M_FILE); Core::Command* cmd = am->registerAction(new QAction(this), - "UAVSettingsImportExportPlugin.UAVSettingsImportExport", + "UAVSettingsImportExportPlugin.UAVSettingsExport", QList() << Core::Constants::C_GLOBAL_ID); - cmd->setDefaultKeySequence(QKeySequence("Ctrl+E")); + cmd->setDefaultKeySequence(QKeySequence("Ctrl+E")); + cmd->action()->setText(tr("Export UAV Settings...")); + ac->addAction(cmd, Core::Constants::G_FILE_SAVE); + connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(exportUAVSettings())); -// cmd->action()->setText(tr("UAV Settings Import/Export...")); - cmd->action()->setText(tr("UAV Settings Export...")); - -// ac->menu()->addSeparator(); -// ac->appendGroup("ImportExport"); -// ac->addAction(cmd, "ImportExport"); - ac->addAction(cmd, Core::Constants::G_FILE_SAVE); - - connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(importExport())); + cmd = am->registerAction(new QAction(this), + "UAVSettingsImportExportPlugin.UAVSettingsImport", + QList() << + Core::Constants::C_GLOBAL_ID); + cmd->action()->setText(tr("Import UAV Settings...")); + ac->addAction(cmd, Core::Constants::G_FILE_SAVE); + connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(importUAVSettings())); return true; } @@ -97,39 +99,106 @@ void UAVSettingsImportExportPlugin::extensionsInitialized() // Do nothing } + // Slot called by the menu manager on user action -// TODO: import function is not implemented yet -void UAVSettingsImportExportPlugin::importExport() +void UAVSettingsImportExportPlugin::importUAVSettings() { - // available formats - enum { UNDEF, UAV, XML, INI } fileFormat = UNDEF; - - // ask for file name and export format + // ask for file name QString fileName; - QString filters = tr("UAV Settings files (*.uav)") - + ";;" + tr("Simple XML files (*.xml)") - + ";;" + tr("INI files (*.ini)"); - - fileName = QFileDialog::getSaveFileName(0, tr("Save UAV Settings File As"), "", filters); + QString filters = tr("UAVSettings XML files (*.xml)"); + fileName = QFileDialog::getOpenFileName(0, tr("Import UAV Settings"), "", filters); if (fileName.isEmpty()) { return; } - // check export file format - QFileInfo fileInfo(fileName); - QString fileType = fileInfo.suffix().toLower(); + // Now open the file + QFile file(fileName); + QDomDocument doc("UAVSettings"); + file.open(QFile::ReadOnly|QFile::Text); + if (!doc.setContent(file.readAll())) { + QMessageBox msgBox; + msgBox.setText(tr("File Parsing Failed.")); + msgBox.setInformativeText(tr("This file is not a correct XML file")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + return; + } + file.close(); - if (fileType == "uav") { - fileFormat = UAV; - } else if (fileType == "xml") { - fileFormat = XML; - } else if (fileType == "ini") { - fileFormat = INI; - } else { - QMessageBox::critical(0, - tr("UAV Settings Export"), - tr("Unsupported export file format: ") + fileType, - QMessageBox::Ok); + QDomElement root = doc.documentElement(); + if (root.tagName() != "settings") { + QMessageBox msgBox; + msgBox.setText(tr("Wrong file contents.")); + msgBox.setInformativeText(tr("This file is not a correct UAVSettings file")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + return; + } + + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); + UAVObjectUtilManager *utilManager = pm->getObject(); + QDomNode node = root.firstChild(); + while (!node.isNull()) { + QDomElement e = node.toElement(); + if (e.tagName() == "object") { + // - Read each object + QString uavObjectName = e.attribute("name"); + uint uavObjectID = e.attribute("id").toUInt(NULL,16); + // Sanity Check: + UAVObject* obj = objManager->getObject(uavObjectName); + if (uavObjectID != obj->getObjID()) { + qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); + QMessageBox msgBox; + msgBox.setText(tr("File Object Mismatch: aborting.")); + msgBox.setInformativeText(tr("Found a mismatch between file object definition and current object definition.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + return; + + } else { + // - Update each field + // - Issue and "updated" command + QDomNode field = node.firstChild(); + while(!field.isNull()) { + QDomElement f = field.toElement(); + if (f.tagName() == "field") { + UAVObjectField *uavfield = obj->getField(f.attribute("name")); + if (f.attribute("elements").toInt() == 1) { + uavfield->setValue(f.attribute("values")); + } else { + // This is an enum: + int i=0; + QStringList list = f.attribute("values").split(","); + foreach (QString element, list) { + uavfield->setValue(element,i++); + } + } + } + field = field.nextSibling(); + } + obj->updated(); + utilManager->saveObjectToSD(obj); + } + } + node = node.nextSibling(); + } + QMessageBox msgBox; + msgBox.setText(tr("Settings restored.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + +} + +// Slot called by the menu manager on user action +void UAVSettingsImportExportPlugin::exportUAVSettings() +{ + // ask for file name + QString fileName; + QString filters = tr("UAVSettings XML files (*.xml)"); + + fileName = QFileDialog::getSaveFileName(0, tr("Save UAV Settings File As"), "", filters); + if (fileName.isEmpty()) { return; } @@ -152,12 +221,10 @@ void UAVSettingsImportExportPlugin::importExport() QDomElement o = doc.createElement("object"); o.setAttribute("name", obj->getName()); o.setAttribute("id", QString("0x")+ QString().setNum(obj->getObjID(),16).toUpper()); - if (fileFormat == UAV) { - QDomElement d = doc.createElement("description"); - QDomText t = doc.createTextNode(obj->getDescription().remove("@Ref ", Qt::CaseInsensitive)); - d.appendChild(t); - o.appendChild(d); - } + QDomElement d = doc.createElement("description"); + QDomText t = doc.createTextNode(obj->getDescription().remove("@Ref ", Qt::CaseInsensitive)); + d.appendChild(t); + o.appendChild(d); // iterate over fields QList fieldList = obj->getFields(); @@ -175,13 +242,11 @@ void UAVSettingsImportExportPlugin::importExport() f.setAttribute("name", field->getName()); f.setAttribute("values", vals); - if (fileFormat == UAV) { - f.setAttribute("type", field->getTypeAsString()); - f.setAttribute("units", field->getUnits()); - f.setAttribute("elements", nelem); - if (field->getType() == UAVObjectField::ENUM) { - f.setAttribute("options", field->getOptions().join(",")); - } + f.setAttribute("type", field->getTypeAsString()); + f.setAttribute("units", field->getUnits()); + f.setAttribute("elements", nelem); + if (field->getType() == UAVObjectField::ENUM) { + f.setAttribute("options", field->getOptions().join(",")); } o.appendChild(f); } @@ -189,48 +254,23 @@ void UAVSettingsImportExportPlugin::importExport() } } } - // save file - if ((fileFormat == UAV) || (fileFormat == XML)) { - QFile file(fileName); - if (file.open(QIODevice::WriteOnly) && - (file.write(doc.toString(4).toAscii()) != -1)) { - file.close(); - } else { - QMessageBox::critical(0, - tr("UAV Settings Export"), - tr("Unable to save settings: ") + fileName, - QMessageBox::Ok); - return; - } - } else if (fileFormat == INI) { - if (QFile::exists(fileName) && !QFile::remove(fileName)) { - QMessageBox::critical(0, - tr("UAV Settings Export"), - tr("Unable to remove existing file: ") + fileName, - QMessageBox::Ok); - return; - } - - QSettings ini(fileName, QSettings::IniFormat); - QDomElement docElem = doc.documentElement(); - QDomNodeList nodeList = docElem.elementsByTagName("object"); - for (int i = 0; i < nodeList.count(); i++) { - QDomElement e = nodeList.at(i).toElement(); - if (!e.isNull()) { - ini.beginGroup(e.attribute("name", "undefined")); - ini.setValue("id", e.attribute("id")); - QDomNodeList n = e.elementsByTagName("field"); - for (int j = 0; j < n.count(); j++) { - QDomElement f = n.at(j).toElement(); - if (!f.isNull()) { - ini.setValue(f.attribute("name", "unknown"), f.attribute("values")); - } - } - ini.endGroup(); - } - } + QFile file(fileName); + if (file.open(QIODevice::WriteOnly) && + (file.write(doc.toString(4).toAscii()) != -1)) { + file.close(); + } else { + QMessageBox::critical(0, + tr("UAV Settings Export"), + tr("Unable to save settings: ") + fileName, + QMessageBox::Ok); + return; } + + QMessageBox msgBox; + msgBox.setText(tr("Settings saved.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); } void UAVSettingsImportExportPlugin::shutdown() diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h index 60b0efd6a..696103ba4 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h @@ -28,6 +28,7 @@ #define UAVSETTINGSIMPORTEXPORT_H #include +#include "uavobjectutil/uavobjectutilmanager.h" class UAVSettingsImportExportPlugin : public ExtensionSystem::IPlugin { @@ -42,7 +43,8 @@ public: void shutdown(); private slots: - void importExport(); + void importUAVSettings(); + void exportUAVSettings(); }; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pluginspec b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pluginspec index 7b64a8e60..b40dc5b60 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pluginspec +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pluginspec @@ -7,5 +7,6 @@ + diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport_dependencies.pri b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport_dependencies.pri index 4bb362f98..2bf87c3be 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport_dependencies.pri +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport_dependencies.pri @@ -1,2 +1,3 @@ include(../../plugins/coreplugin/coreplugin.pri) include(../../plugins/uavobjects/uavobjects.pri) +include(../../plugins/uavobjectutil/uavobjectutil.pri) From 23879584228c6555781b9e36e3fea0ff9971ddc4 Mon Sep 17 00:00:00 2001 From: elafargue Date: Sat, 4 Jun 2011 13:06:12 +0200 Subject: [PATCH 02/33] OP-369 Now the import operation provides a summary and lets the user selectively save the right objects. Also improved the saveToSD queue a great deal so that it can deal with failed save operations (on non-existent objects). --- .../uavobjectutil/uavobjectutilmanager.cpp | 51 ++++++++ .../uavobjectutil/uavobjectutilmanager.h | 3 + .../uavsettingsimportexport/importsummary.cpp | 120 +++++++++++++++++ .../uavsettingsimportexport/importsummary.h | 66 ++++++++++ .../importsummarydialog.ui | 123 ++++++++++++++++++ .../uavsettingsimportexport.cpp | 33 +++-- .../uavsettingsimportexport.h | 1 + .../uavsettingsimportexport.pro | 31 +++-- 8 files changed, 401 insertions(+), 27 deletions(-) create mode 100644 ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp create mode 100644 ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h create mode 100644 ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index a4cde6428..cad88b25c 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -41,6 +41,11 @@ UAVObjectUtilManager::UAVObjectUtilManager() { mutex = new QMutex(QMutex::Recursive); + saveState = IDLE; + failureTimer.stop(); + failureTimer.setSingleShot(true); + failureTimer.setInterval(1000); + connect(&failureTimer, SIGNAL(timeout()),this,SLOT(objectPersistenceOperationFailed())); } UAVObjectUtilManager::~UAVObjectUtilManager() @@ -70,15 +75,23 @@ UAVObjectManager* UAVObjectUtilManager::getObjectManager() { // ****************************** // SD card saving // + +/* + Add a new object to save in the queue + */ void UAVObjectUtilManager::saveObjectToSD(UAVObject *obj) { // Add to queue queue.enqueue(obj); + qDebug() << "Enqueue object: " << obj->getName(); + + // If queue length is one, then start sending (call sendNextObject) // Otherwise, do nothing, it's sending anyway if (queue.length()==1) saveNextObject(); + } void UAVObjectUtilManager::saveNextObject() @@ -92,6 +105,8 @@ void UAVObjectUtilManager::saveNextObject() // Get next object from the queue UAVObject* obj = queue.head(); + qDebug() << "Request board to save object " << obj->getName(); + ObjectPersistence* objper = dynamic_cast( getObjectManager()->getObject(ObjectPersistence::NAME) ); connect(objper, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); connect(objper, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(objectPersistenceUpdated(UAVObject *))); @@ -106,6 +121,11 @@ void UAVObjectUtilManager::saveNextObject() objper->setData(data); objper->updated(); } + // Now: we are going to get two "objectUpdated" messages (one coming from GCS, one coming from Flight, which + // will confirm the object was properly received by both sides) and then one "transactionCompleted" indicating + // that the Flight side did not only receive the object but it did receive it without error. Last we will get + // a last "objectUpdated" message coming from flight side, where we'll get the results of the objectPersistence + // operation we asked for (saved, other). } /** @@ -121,14 +141,43 @@ void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject* obj, if(success) { Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); Q_ASSERT(saveState == AWAITING_ACK); + // Two things can happen: + // Either the Object Save Request did actually go through, and then we should get in + // "AWAITING_COMPLETED" mode, or the Object Save Request did _not_ go through, for example + // because the object does not exist and then we will never get a subsequent update. + // For this reason, we will arm a 1 second timer to make provision for this and not block + // the queue: saveState = AWAITING_COMPLETED; disconnect(obj, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); + failureTimer.start(1000); // Create a timeout } else if (!success) { // Can be caused by timeout errors on sending. Send again. + qDebug() << "objectPersistenceTranscationCompleted (error)"; saveNextObject(); } } +/** + * @brief Object persistence operation failed, i.e. we never got an update + * from the board saying "completed". + */ +void UAVObjectUtilManager::objectPersistenceOperationFailed() +{ + qDebug() << "objectPersistenceOperationFailed"; + if(saveState == AWAITING_COMPLETED) { + //TODO: some warning that this operation failed somehow + // We have to disconnect the object persistence 'updated' signal + // and ask to save the next object: + UAVObject *obj = getObjectManager()->getObject(ObjectPersistence::NAME); + obj->disconnect(this); + queue.dequeue(); // We can now remove the object, it failed anyway. + saveState = IDLE; + saveNextObject(); + } +} + + + /** * @brief Process the ObjectPersistence updated message to confirm the right object saved * then requests next object be saved. @@ -136,8 +185,10 @@ void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject* obj, */ void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj) { + qDebug() << "objectPersistenceUpdated: " << obj->getField("Operation")->getValue().toString(); Q_ASSERT(obj->getName().compare("ObjectPersistence") == 0); if(saveState == AWAITING_COMPLETED) { + failureTimer.stop(); // Check flight is saying it completed. This is the only thing flight should do to trigger an update. Q_ASSERT( obj->getField("Operation")->getValue().toString().compare(QString("Completed")) == 0 ); diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h index 80ca9e900..a9cf6d5fb 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -72,11 +73,13 @@ private: QQueue queue; enum {IDLE, AWAITING_ACK, AWAITING_COMPLETED} saveState; void saveNextObject(); + QTimer failureTimer; private slots: //void transactionCompleted(UAVObject *obj, bool success); void objectPersistenceTransactionCompleted(UAVObject* obj, bool success); void objectPersistenceUpdated(UAVObject * obj); + void objectPersistenceOperationFailed(); }; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp new file mode 100644 index 000000000..0d007bd17 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp @@ -0,0 +1,120 @@ +/** + ****************************************************************************** + * + * @file importsummary.cpp + * @author (C) 2011 The OpenPilot Team, http://www.openpilot.org + * @addtogroup GCSPlugins GCS Plugins + * @{ + * @addtogroup UAVSettingsImportExport UAVSettings Import/Export Plugin + * @{ + * @brief UAVSettings Import/Export Plugin + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#include "importsummary.h" + +ImportSummaryDialog::ImportSummaryDialog( QWidget *parent) : + QDialog(parent), + ui(new Ui::ImportSummaryDialog) +{ + ui->setupUi(this); + setWindowTitle(tr("Import Summary")); + + ui->importSummaryList->setColumnCount(3); + ui->importSummaryList->setRowCount(0); + QStringList header; + header.append("Save"); + header.append("Name"); + header.append("Status"); + ui->importSummaryList->setHorizontalHeaderLabels(header); + ui->progressBar->setValue(0); + + connect( ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); + connect(ui->saveToFlash, SIGNAL(clicked()), this, SLOT(doTheSaving())); +} + +ImportSummaryDialog::~ImportSummaryDialog() +{ + delete ui; +} + +/* + Adds a new line about a UAVObject along with its status + (whether it got saved OK or not) + */ +void ImportSummaryDialog::addLine(QString uavObjectName, bool status) +{ + ui->importSummaryList->setRowCount(ui->importSummaryList->rowCount()+1); + int row = ui->importSummaryList->rowCount()-1; + ui->progressBar->setMaximum(row); + ui->importSummaryList->setCellWidget(row,0,new QCheckBox(ui->importSummaryList)); + QTableWidgetItem *objName = new QTableWidgetItem(uavObjectName); + ui->importSummaryList->setItem(row, 1, objName); + QCheckBox *box = dynamic_cast(ui->importSummaryList->cellWidget(row,0)); + if (status) { + ui->importSummaryList->setItem(row,2,new QTableWidgetItem("OK")); + box->setChecked(true); + } else { + ui->importSummaryList->setItem(row,2,new QTableWidgetItem("Mismatch")); + box->setChecked(false); + box->setEnabled(false); + } + this->repaint(); + this->showEvent(NULL); +} + +/* + Saves every checked UAVObjet in the list to Flash + */ +void ImportSummaryDialog::doTheSaving() +{ + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); + UAVObjectUtilManager *utilManager = pm->getObject(); + + for(int i=0; i < ui->importSummaryList->rowCount(); i++) { + QString uavObjectName = ui->importSummaryList->item(i,1)->text(); + QCheckBox *box = dynamic_cast(ui->importSummaryList->cellWidget(i,0)); + if (box->isChecked()) { + UAVObject* obj = objManager->getObject(uavObjectName); + utilManager->saveObjectToSD(obj); + ui->progressBar->setValue(i); + this->repaint(); + } + } +} + +void ImportSummaryDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void ImportSummaryDialog::showEvent(QShowEvent *event) +{ + Q_UNUSED(event) + ui->importSummaryList->resizeColumnsToContents(); + int width = ui->importSummaryList->width()-(ui->importSummaryList->columnWidth(0)+ + ui->importSummaryList->columnWidth(2)); + ui->importSummaryList->setColumnWidth(1,width-15); +} + diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h new file mode 100644 index 000000000..391ff0ff6 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h @@ -0,0 +1,66 @@ +/** + ****************************************************************************** + * + * @file importsummary.h + * @author (C) 2011 The OpenPilot Team, http://www.openpilot.org + * @addtogroup GCSPlugins GCS Plugins + * @{ + * @addtogroup UAVSettingsImportExport UAVSettings Import/Export Plugin + * @{ + * @brief UAVSettings Import/Export Plugin + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef IMPORTSUMMARY_H +#define IMPORTSUMMARY_H + +#include +#include +#include "ui_importsummarydialog.h" +#include "uavdataobject.h" +#include "uavobjectmanager.h" +#include "extensionsystem/pluginmanager.h" +#include "uavobjectutil/uavobjectutilmanager.h" + + + +namespace Ui { + class ImportSummaryDialog; +} + +class ImportSummaryDialog : public QDialog +{ + Q_OBJECT + +public: + ImportSummaryDialog(QWidget *parent=0); + ~ImportSummaryDialog(); + void addLine(QString objectName, bool status); + +protected: + void showEvent(QShowEvent *event); + void changeEvent(QEvent *e); + +private: + Ui::ImportSummaryDialog *ui; + +private slots: + + void doTheSaving(); + +}; + +#endif // IMPORTSUMMARY_H diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui new file mode 100644 index 000000000..41d963034 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui @@ -0,0 +1,123 @@ + + + ImportSummaryDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + UAV Settings import summary + + + + + + + Qt::ScrollBarAlwaysOff + + + true + + + 10 + + + true + + + false + + + false + + + + + + + 24 + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 32 + 32 + + + + + + + + :/core/images/helpicon.svg:/core/images/helpicon.svg + + + + 32 + 32 + + + + true + + + + + + + Save all settings checked above to persistent board storage, +then close the dialog. + + + Save to Board Flash/SD + + + + + + + Close this dialog without saving to persistent storage + + + Close + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index e1b9ea1d1..29bc553a7 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -37,6 +37,7 @@ #include #include #include +#include // for menu item #include @@ -135,9 +136,14 @@ void UAVSettingsImportExportPlugin::importUAVSettings() return; } + // We are now ok: setup the import summary dialog & update it as we + // go along. + ImportSummaryDialog swui; + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); - UAVObjectUtilManager *utilManager = pm->getObject(); + swui.show(); + QDomNode node = root.firstChild(); while (!node.isNull()) { QDomElement e = node.toElement(); @@ -145,17 +151,17 @@ void UAVSettingsImportExportPlugin::importUAVSettings() // - Read each object QString uavObjectName = e.attribute("name"); uint uavObjectID = e.attribute("id").toUInt(NULL,16); + // Sanity Check: UAVObject* obj = objManager->getObject(uavObjectName); - if (uavObjectID != obj->getObjID()) { - qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); - QMessageBox msgBox; - msgBox.setText(tr("File Object Mismatch: aborting.")); - msgBox.setInformativeText(tr("Found a mismatch between file object definition and current object definition.")); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.exec(); - return; + if (obj == NULL) { + // This object is unknown! + qDebug() << "Object Unknown:" << uavObjectName << uavObjectID; + swui.addLine(uavObjectName, false); + } else if(uavObjectID != obj->getObjID()) { + qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); + swui.addLine(uavObjectName, false); } else { // - Update each field // - Issue and "updated" command @@ -178,15 +184,14 @@ void UAVSettingsImportExportPlugin::importUAVSettings() field = field.nextSibling(); } obj->updated(); - utilManager->saveObjectToSD(obj); + swui.addLine(uavObjectName, true); } } node = node.nextSibling(); } - QMessageBox msgBox; - msgBox.setText(tr("Settings restored.")); - msgBox.setStandardButtons(QMessageBox::Ok); - msgBox.exec(); + swui.exec(); + + } diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h index 696103ba4..17804326a 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.h @@ -29,6 +29,7 @@ #include #include "uavobjectutil/uavobjectutilmanager.h" +#include "importsummary.h" class UAVSettingsImportExportPlugin : public ExtensionSystem::IPlugin { diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pro b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pro index 5f2b18103..b653864ed 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pro +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.pro @@ -1,13 +1,18 @@ - -TEMPLATE = lib -QT += xml - -TARGET = UAVSettingsImportExport - -include(../../openpilotgcsplugin.pri) -include(uavsettingsimportexport_dependencies.pri) - -HEADERS += uavsettingsimportexport.h -SOURCES += uavsettingsimportexport.cpp - -OTHER_FILES += uavsettingsimportexport.pluginspec + +TEMPLATE = lib +QT += xml + +TARGET = UAVSettingsImportExport + +include(../../openpilotgcsplugin.pri) +include(uavsettingsimportexport_dependencies.pri) + +HEADERS += uavsettingsimportexport.h \ + importsummary.h +SOURCES += uavsettingsimportexport.cpp \ + importsummary.cpp + +OTHER_FILES += uavsettingsimportexport.pluginspec + +FORMS += \ + importsummarydialog.ui From 864dbb0ab50f8e0f02aa896adbb2bd775eb14f96 Mon Sep 17 00:00:00 2001 From: elafargue Date: Sat, 4 Jun 2011 14:32:15 +0200 Subject: [PATCH 03/33] Add an object saving completion message, so that the user knows when saving is finished. --- .../src/plugins/uavobjectutil/uavobjectutilmanager.cpp | 2 ++ .../src/plugins/uavobjectutil/uavobjectutilmanager.h | 2 ++ .../src/plugins/uavsettingsimportexport/importsummary.cpp | 8 +++++++- .../src/plugins/uavsettingsimportexport/importsummary.h | 4 +++- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index cad88b25c..029f9f77f 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -172,6 +172,7 @@ void UAVObjectUtilManager::objectPersistenceOperationFailed() obj->disconnect(this); queue.dequeue(); // We can now remove the object, it failed anyway. saveState = IDLE; + emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), false); saveNextObject(); } } @@ -199,6 +200,7 @@ void UAVObjectUtilManager::objectPersistenceUpdated(UAVObject * obj) obj->disconnect(this); queue.dequeue(); // We can now remove the object, it's done. saveState = IDLE; + emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), true); saveNextObject(); } } diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h index a9cf6d5fb..de61068ca 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.h @@ -67,6 +67,8 @@ public: UAVObjectManager* getObjectManager(); void saveObjectToSD(UAVObject *obj); +signals: + void saveCompleted(int objectID, bool status); private: QMutex *mutex; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp index 0d007bd17..f9d96bf09 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp @@ -84,6 +84,7 @@ void ImportSummaryDialog::doTheSaving() ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); UAVObjectUtilManager *utilManager = pm->getObject(); + connect(utilManager, SIGNAL(saveCompleted(int,bool)), this, SLOT(updateSaveCompletion())); for(int i=0; i < ui->importSummaryList->rowCount(); i++) { QString uavObjectName = ui->importSummaryList->item(i,1)->text(); @@ -91,12 +92,17 @@ void ImportSummaryDialog::doTheSaving() if (box->isChecked()) { UAVObject* obj = objManager->getObject(uavObjectName); utilManager->saveObjectToSD(obj); - ui->progressBar->setValue(i); this->repaint(); } } } + +void ImportSummaryDialog::updateSaveCompletion() +{ + ui->progressBar->setValue(ui->progressBar->value()+1); +} + void ImportSummaryDialog::changeEvent(QEvent *e) { QDialog::changeEvent(e); diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h index 391ff0ff6..defc824b1 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h @@ -57,8 +57,10 @@ protected: private: Ui::ImportSummaryDialog *ui; -private slots: +public slots: + void updateSaveCompletion(); +private slots: void doTheSaving(); }; From 2e089e2816036a36463a5533b148b5fc1c11c2c6 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sun, 5 Jun 2011 10:58:08 -0500 Subject: [PATCH 04/33] 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 05/33] 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 06/33] 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 + + + + + + From ac7216946ad3e4419dc779647b27b1ff856f2286 Mon Sep 17 00:00:00 2001 From: elafargue Date: Sun, 5 Jun 2011 19:02:43 +0200 Subject: [PATCH 07/33] Now use the ".uav" extension for exporting settings in XML format. Dormant feature: if you use a .xml extension manually, will export in full format. --- .../importsummarydialog.ui | 5 ++- .../uavsettingsimportexport.cpp | 37 +++++++++++++------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui index 41d963034..19f8c27c9 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui @@ -7,12 +7,15 @@ 0 0 400 - 300 + 377 Dialog + + true + diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 29bc553a7..781c28ea8 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -106,7 +106,7 @@ void UAVSettingsImportExportPlugin::importUAVSettings() { // ask for file name QString fileName; - QString filters = tr("UAVSettings XML files (*.xml)"); + QString filters = tr("UAVSettings XML files (*.uav);; XML files (*.xml)"); fileName = QFileDialog::getOpenFileName(0, tr("Import UAV Settings"), "", filters); if (fileName.isEmpty()) { return; @@ -170,7 +170,8 @@ void UAVSettingsImportExportPlugin::importUAVSettings() QDomElement f = field.toElement(); if (f.tagName() == "field") { UAVObjectField *uavfield = obj->getField(f.attribute("name")); - if (f.attribute("elements").toInt() == 1) { + QStringList list = f.attribute("values").split(","); + if (list.length() == 1) { uavfield->setValue(f.attribute("values")); } else { // This is an enum: @@ -200,13 +201,21 @@ void UAVSettingsImportExportPlugin::exportUAVSettings() { // ask for file name QString fileName; - QString filters = tr("UAVSettings XML files (*.xml)"); + QString filters = tr("UAVSettings XML files (*.uav)"); fileName = QFileDialog::getSaveFileName(0, tr("Save UAV Settings File As"), "", filters); if (fileName.isEmpty()) { return; } + bool fullExport = false; + // If the filename ends with .xml, we will do a full export, otherwise, a simple export + if (fileName.endsWith(".xml")) { + fullExport = true; + } else if (!fileName.endsWith(".uav")) { + fileName.append(".uav"); + } + // generate an XML first (used for all export formats as a formatted data source) ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); @@ -226,10 +235,12 @@ void UAVSettingsImportExportPlugin::exportUAVSettings() QDomElement o = doc.createElement("object"); o.setAttribute("name", obj->getName()); o.setAttribute("id", QString("0x")+ QString().setNum(obj->getObjID(),16).toUpper()); - QDomElement d = doc.createElement("description"); - QDomText t = doc.createTextNode(obj->getDescription().remove("@Ref ", Qt::CaseInsensitive)); - d.appendChild(t); - o.appendChild(d); + if (fullExport) { + QDomElement d = doc.createElement("description"); + QDomText t = doc.createTextNode(obj->getDescription().remove("@Ref ", Qt::CaseInsensitive)); + d.appendChild(t); + o.appendChild(d); + } // iterate over fields QList fieldList = obj->getFields(); @@ -247,11 +258,13 @@ void UAVSettingsImportExportPlugin::exportUAVSettings() f.setAttribute("name", field->getName()); f.setAttribute("values", vals); - f.setAttribute("type", field->getTypeAsString()); - f.setAttribute("units", field->getUnits()); - f.setAttribute("elements", nelem); - if (field->getType() == UAVObjectField::ENUM) { - f.setAttribute("options", field->getOptions().join(",")); + if (fullExport) { + f.setAttribute("type", field->getTypeAsString()); + f.setAttribute("units", field->getUnits()); + f.setAttribute("elements", nelem); + if (field->getType() == UAVObjectField::ENUM) { + f.setAttribute("options", field->getOptions().join(",")); + } } o.appendChild(f); } From 2a5ff0b36a7011d0f1d57d4a40ae67d83cd3f29c Mon Sep 17 00:00:00 2001 From: elafargue Date: Mon, 6 Jun 2011 10:44:21 +0200 Subject: [PATCH 09/33] OP-369 : in case there is an objectID mismatch, still try to update the object if we found the name, but place it in "warning" mode. If during update some fields do not exist, then place in "Error" mode and prevent automated saving (will still try to update as many fields as possible) --- .../uavobjectutil/uavobjectutilmanager.cpp | 9 +++-- .../uavsettingsimportexport/importsummary.cpp | 5 ++- .../uavsettingsimportexport/importsummary.h | 2 +- .../uavsettingsimportexport.cpp | 35 ++++++++++++------- 4 files changed, 32 insertions(+), 19 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp index 029f9f77f..e86d4794b 100644 --- a/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp +++ b/ground/openpilotgcs/src/plugins/uavobjectutil/uavobjectutilmanager.cpp @@ -150,9 +150,14 @@ void UAVObjectUtilManager::objectPersistenceTransactionCompleted(UAVObject* obj, saveState = AWAITING_COMPLETED; disconnect(obj, SIGNAL(transactionCompleted(UAVObject*,bool)), this, SLOT(objectPersistenceTransactionCompleted(UAVObject*,bool))); failureTimer.start(1000); // Create a timeout - } else if (!success) { - // Can be caused by timeout errors on sending. Send again. + } else { + // Can be caused by timeout errors on sending. Forget it and send next. qDebug() << "objectPersistenceTranscationCompleted (error)"; + UAVObject *obj = getObjectManager()->getObject(ObjectPersistence::NAME); + obj->disconnect(this); + queue.dequeue(); // We can now remove the object, it failed anyway. + saveState = IDLE; + emit saveCompleted(obj->getField("ObjectID")->getValue().toInt(), false); saveNextObject(); } } diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp index f9d96bf09..bc80afcf3 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp @@ -55,7 +55,7 @@ ImportSummaryDialog::~ImportSummaryDialog() Adds a new line about a UAVObject along with its status (whether it got saved OK or not) */ -void ImportSummaryDialog::addLine(QString uavObjectName, bool status) +void ImportSummaryDialog::addLine(QString uavObjectName, QString text, bool status) { ui->importSummaryList->setRowCount(ui->importSummaryList->rowCount()+1); int row = ui->importSummaryList->rowCount()-1; @@ -64,11 +64,10 @@ void ImportSummaryDialog::addLine(QString uavObjectName, bool status) QTableWidgetItem *objName = new QTableWidgetItem(uavObjectName); ui->importSummaryList->setItem(row, 1, objName); QCheckBox *box = dynamic_cast(ui->importSummaryList->cellWidget(row,0)); + ui->importSummaryList->setItem(row,2,new QTableWidgetItem(text)); if (status) { - ui->importSummaryList->setItem(row,2,new QTableWidgetItem("OK")); box->setChecked(true); } else { - ui->importSummaryList->setItem(row,2,new QTableWidgetItem("Mismatch")); box->setChecked(false); box->setEnabled(false); } diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h index defc824b1..11a9de00c 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h @@ -48,7 +48,7 @@ class ImportSummaryDialog : public QDialog public: ImportSummaryDialog(QWidget *parent=0); ~ImportSummaryDialog(); - void addLine(QString objectName, bool status); + void addLine(QString objectName, QString text, bool status); protected: void showEvent(QShowEvent *event); diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 781c28ea8..2f172e521 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -157,35 +157,44 @@ void UAVSettingsImportExportPlugin::importUAVSettings() if (obj == NULL) { // This object is unknown! qDebug() << "Object Unknown:" << uavObjectName << uavObjectID; - swui.addLine(uavObjectName, false); + swui.addLine(uavObjectName, "Error", false); - } else if(uavObjectID != obj->getObjID()) { - qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); - swui.addLine(uavObjectName, false); } else { // - Update each field // - Issue and "updated" command + bool error=false; QDomNode field = node.firstChild(); while(!field.isNull()) { QDomElement f = field.toElement(); if (f.tagName() == "field") { UAVObjectField *uavfield = obj->getField(f.attribute("name")); - QStringList list = f.attribute("values").split(","); - if (list.length() == 1) { - uavfield->setValue(f.attribute("values")); - } else { - // This is an enum: - int i=0; + if (uavfield) { QStringList list = f.attribute("values").split(","); - foreach (QString element, list) { - uavfield->setValue(element,i++); + if (list.length() == 1) { + uavfield->setValue(f.attribute("values")); + } else { + // This is an enum: + int i=0; + QStringList list = f.attribute("values").split(","); + foreach (QString element, list) { + uavfield->setValue(element,i++); + } } + error = false; + } else { + error = true; } } field = field.nextSibling(); } obj->updated(); - swui.addLine(uavObjectName, true); + if (error) { + swui.addLine(uavObjectName, "Error", false); + } else if (uavObjectID != obj->getObjID()) { + qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); + swui.addLine(uavObjectName, "Warning", true); + } else + swui.addLine(uavObjectName, "OK", true); } } node = node.nextSibling(); From 83916f3a4e863053ae767dca2b1c3010e74942eb Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 6 Jun 2011 10:37:57 -0500 Subject: [PATCH 10/33] Fix bug in UAVTalk where the expected packet length check was incorrect for instances of objects --- .../openpilotgcs/src/plugins/uavtalk/uavtalk.cpp | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp index 3cfe6dfe7..6a9d22d5f 100644 --- a/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp +++ b/ground/openpilotgcs/src/plugins/uavtalk/uavtalk.cpp @@ -295,7 +295,7 @@ bool UAVTalk::processInputByte(quint8 rxbyte) } // Check the lengths match - if ((rxPacketLength + rxLength) != packetSize) + if ((rxPacketLength + rxLength + (rxObj->isSingleInstance() ? 0 : 2)) != packetSize) { // packet error - mismatched packet size stats.rxErrors++; rxState = STATE_SYNC; @@ -805,17 +805,3 @@ quint8 UAVTalk::updateCRC(quint8 crc, const quint8* data, qint32 length) crc = crc_table[crc ^ *data++]; return crc; } - - - - - - - - - - - - - - From 1ecd244affb82068cad6b3901e58776ceb996167 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 6 Jun 2011 10:46:07 -0500 Subject: [PATCH 11/33] OP-493 OP-505 OP-511: Fixed bug with the direct mapping where it looked at throttle curve source instead of directly bypassing --- flight/Modules/Actuator/actuator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/flight/Modules/Actuator/actuator.c b/flight/Modules/Actuator/actuator.c index 9d21dba5a..1deceab0e 100644 --- a/flight/Modules/Actuator/actuator.c +++ b/flight/Modules/Actuator/actuator.c @@ -254,11 +254,16 @@ static void actuatorTask(void* parameters) status[ct] = 0; } - // If an accessory channel is selected + // If an accessory channel is selected for direct bypass mode + // In this configuration the accessory channel is scaled and mapped + // directly to output. Note: THERE IS NO SAFETY CHECK HERE FOR ARMING + // these also will not be updated in failsafe mode. I'm not sure what + // the correct behavior is since it seems domain specific. I don't love + // this code if( (mixers[ct].type >= MIXERSETTINGS_MIXER1TYPE_ACCESSORY0) && (mixers[ct].type <= MIXERSETTINGS_MIXER1TYPE_ACCESSORY2)) { - if(AccessoryDesiredInstGet(mixerSettings.Curve2Source - MIXERSETTINGS_CURVE2SOURCE_ACCESSORY0,&accessory) == 0) + if(AccessoryDesiredInstGet(mixers[ct].type - MIXERSETTINGS_MIXER1TYPE_ACCESSORY0,&accessory) == 0) status[ct] = accessory.AccessoryVal; else status[ct] = -1; From bdc909497554d83c87fb5677c9725c6b2803d63d Mon Sep 17 00:00:00 2001 From: James Cotton Date: Mon, 6 Jun 2011 10:52:02 -0500 Subject: [PATCH 12/33] OP-493 OP-505 OP-511: Make up to 6 accessory channels so some can go from ManualCommand to a camera module and some could go from that camera module to output (i.e. mixing of inputs to pan tilt with stabilization) --- flight/Modules/Actuator/actuator.c | 3 +++ shared/uavobjectdefinition/mixersettings.xml | 18 +++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/flight/Modules/Actuator/actuator.c b/flight/Modules/Actuator/actuator.c index 1deceab0e..af8ee06ea 100644 --- a/flight/Modules/Actuator/actuator.c +++ b/flight/Modules/Actuator/actuator.c @@ -219,6 +219,9 @@ static void actuatorTask(void* parameters) case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY0: case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY1: case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY2: + case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY3: + case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY4: + case MIXERSETTINGS_CURVE2SOURCE_ACCESSORY5: if(AccessoryDesiredInstGet(mixerSettings.Curve2Source - MIXERSETTINGS_CURVE2SOURCE_ACCESSORY0,&accessory) == 0) curve2 = MixerCurve(accessory.AccessoryVal,mixerSettings.ThrottleCurve2); else diff --git a/shared/uavobjectdefinition/mixersettings.xml b/shared/uavobjectdefinition/mixersettings.xml index e1a1a6c5a..a93b8c2ff 100644 --- a/shared/uavobjectdefinition/mixersettings.xml +++ b/shared/uavobjectdefinition/mixersettings.xml @@ -6,23 +6,23 @@ - + - + - + - + - + - + - + - + - + From b6326b855d4245e28db80d36add103bb3153bf0f Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 07:01:58 +0200 Subject: [PATCH 13/33] OP-369 Implement help button and keyboard shortcuts as requested. --- .../src/plugins/importexport/importexportplugin.cpp | 2 +- .../uavsettingsimportexport/importsummary.cpp | 12 ++++++++++++ .../plugins/uavsettingsimportexport/importsummary.h | 3 +++ .../uavsettingsimportexport/importsummarydialog.ui | 2 +- .../uavsettingsimportexport.cpp | 1 + 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp index 32f783593..d7fa31a54 100644 --- a/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp +++ b/ground/openpilotgcs/src/plugins/importexport/importexportplugin.cpp @@ -63,7 +63,7 @@ bool ImportExportPlugin::initialize(const QStringList& args, QString *errMsg) "ImportExportPlugin.ImportExport", QList() << Core::Constants::C_GLOBAL_ID); - cmd->setDefaultKeySequence(QKeySequence("Ctrl+I")); + cmd->setDefaultKeySequence(QKeySequence("Ctrl+S")); cmd->action()->setText(tr("GCS Settings Import/Export...")); // ac->menu()->addSeparator(); diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp index bc80afcf3..a7bf6f367 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.cpp @@ -44,6 +44,10 @@ ImportSummaryDialog::ImportSummaryDialog( QWidget *parent) : connect( ui->closeButton, SIGNAL(clicked()), this, SLOT(close())); connect(ui->saveToFlash, SIGNAL(clicked()), this, SLOT(doTheSaving())); + + // Connect the help button + connect(ui->helpButton, SIGNAL(clicked()), this, SLOT(openHelp())); + } ImportSummaryDialog::~ImportSummaryDialog() @@ -51,6 +55,14 @@ ImportSummaryDialog::~ImportSummaryDialog() delete ui; } +/* + Open the right page on the wiki + */ +void ImportSummaryDialog::openHelp() +{ + QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/UAV+Settings+import-export", QUrl::StrictMode) ); +} + /* Adds a new line about a UAVObject along with its status (whether it got saved OK or not) diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h index 11a9de00c..ab88eb835 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummary.h @@ -29,6 +29,8 @@ #include #include +#include +#include #include "ui_importsummarydialog.h" #include "uavdataobject.h" #include "uavobjectmanager.h" @@ -62,6 +64,7 @@ public slots: private slots: void doTheSaving(); + void openHelp(); }; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui index 19f8c27c9..7c7212eb0 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/importsummarydialog.ui @@ -69,7 +69,7 @@ - + 32 diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 2f172e521..a53291d2c 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -88,6 +88,7 @@ bool UAVSettingsImportExportPlugin::initialize(const QStringList& args, QString "UAVSettingsImportExportPlugin.UAVSettingsImport", QList() << Core::Constants::C_GLOBAL_ID); + cmd->setDefaultKeySequence(QKeySequence("Ctrl+I")); cmd->action()->setText(tr("Import UAV Settings...")); ac->addAction(cmd, Core::Constants::G_FILE_SAVE); connect(cmd->action(), SIGNAL(triggered(bool)), this, SLOT(importUAVSettings())); From 4f248172a3eb659684beb101239ff1643ac8710d Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 13:50:24 +0200 Subject: [PATCH 14/33] Fix flight mode dial SVG to show the complete status. --- artwork/Dials/default/flightmode-status.svg | 346 +++++++++++++++++- .../dials/default/flightmode-status.svg | 346 +++++++++++++++++- 2 files changed, 674 insertions(+), 18 deletions(-) diff --git a/artwork/Dials/default/flightmode-status.svg b/artwork/Dials/default/flightmode-status.svg index dca4d213a..80935d0c3 100644 --- a/artwork/Dials/default/flightmode-status.svg +++ b/artwork/Dials/default/flightmode-status.svg @@ -14,7 +14,7 @@ height="80.827866" id="svg10068" version="1.1" - inkscape:version="0.47 r22583" + inkscape:version="0.48.1 r9760" sodipodi:docname="flightmode-status.svg" inkscape:export-filename="H:\Documents\Hobbies\W433\My Gauges\vbat-001.png" inkscape:export-xdpi="103.61" @@ -949,6 +949,94 @@ fx="29.77438" fy="7.0922189" r="25.380436" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ground/openpilotgcs/share/openpilotgcs/dials/default/flightmode-status.svg b/ground/openpilotgcs/share/openpilotgcs/dials/default/flightmode-status.svg index dca4d213a..80935d0c3 100644 --- a/ground/openpilotgcs/share/openpilotgcs/dials/default/flightmode-status.svg +++ b/ground/openpilotgcs/share/openpilotgcs/dials/default/flightmode-status.svg @@ -14,7 +14,7 @@ height="80.827866" id="svg10068" version="1.1" - inkscape:version="0.47 r22583" + inkscape:version="0.48.1 r9760" sodipodi:docname="flightmode-status.svg" inkscape:export-filename="H:\Documents\Hobbies\W433\My Gauges\vbat-001.png" inkscape:export-xdpi="103.61" @@ -949,6 +949,94 @@ fx="29.77438" fy="7.0922189" r="25.380436" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 8ac5399c1dab53666928d536f4f2d2220e1c3075 Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 13:54:38 +0200 Subject: [PATCH 15/33] OP-527 Implemented as requested: will load the default settings if no settings found, without asking. --- .../src/plugins/coreplugin/mainwindow.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp index 5926e6c98..25170092e 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.cpp @@ -290,13 +290,11 @@ void MainWindow::extensionsInitialized() if ( ! qs->allKeys().count() ){ QMessageBox msgBox; msgBox.setText(tr("No configuration file could be found.")); - msgBox.setInformativeText(tr("Do you want to load the default configuration?")); - msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); - msgBox.setDefaultButton(QMessageBox::Yes); - if ( msgBox.exec() == QMessageBox::Yes ){ - qDebug() << "Load default config from resource /core/OpenPilotGCS.xml"; - qs = &defaultSettings; - } + msgBox.setInformativeText(tr("The default configuration will be loaded.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.exec(); + qDebug() << "Load default config from resource /core/OpenPilotGCS.xml"; + qs = &defaultSettings; } m_uavGadgetInstanceManager = new UAVGadgetInstanceManager(this); From a7dccb6648764fc435fa1ce05727fe381a46a523 Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 16:56:16 +0200 Subject: [PATCH 16/33] OP-502 If a board is not connected, the "Save" button is grayed out. The "Apply" button is still enable, which enables creating configurations purely offline. --- .../src/plugins/config/configahrswidget.cpp | 30 +++++---- .../src/plugins/config/configahrswidget.h | 5 +- .../plugins/config/configairframewidget.cpp | 32 +++++++--- .../src/plugins/config/configairframewidget.h | 4 +- .../plugins/config/configccattitudewidget.cpp | 19 ++++-- .../plugins/config/configccattitudewidget.h | 4 +- .../src/plugins/config/configccpmwidget.h | 5 ++ .../src/plugins/config/configgadgetwidget.cpp | 9 ++- .../src/plugins/config/configgadgetwidget.h | 2 + .../src/plugins/config/configinputwidget.cpp | 63 +++--------------- .../src/plugins/config/configinputwidget.h | 8 +-- .../src/plugins/config/configoutputwidget.cpp | 64 ++++--------------- .../src/plugins/config/configoutputwidget.h | 10 +-- .../config/configstabilizationwidget.cpp | 19 ++++-- .../config/configstabilizationwidget.h | 3 +- .../src/plugins/config/configtaskwidget.cpp | 15 +++++ .../src/plugins/config/configtaskwidget.h | 6 ++ .../plugins/config/configtelemetrywidget.cpp | 19 ++++-- .../plugins/config/configtelemetrywidget.h | 3 +- .../plugins/config/defaultattitudewidget.cpp | 2 +- .../plugins/config/defaultattitudewidget.h | 2 +- 21 files changed, 161 insertions(+), 163 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp index 8862e40ad..75cb57f78 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.cpp @@ -218,23 +218,23 @@ ConfigAHRSWidget::ConfigAHRSWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_ahrs->accelBiasStart, SIGNAL(clicked()), this, SLOT(launchAccelBiasCalibration())); obj = dynamic_cast(getObjectManager()->getObject(QString("AHRSSettings"))); - connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(ahrsSettingsRequest())); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshValues())); obj = getObjectManager()->getObject(QString("HomeLocation")); - connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(ahrsSettingsRequest())); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshValues())); - /* - connect(m_ahrs->algorithm, SIGNAL(currentIndexChanged(int)), this, SLOT(ahrsSettingsSave())); - connect(m_ahrs->indoorFlight, SIGNAL(stateChanged(int)), this, SLOT(homeLocationSave())); - connect(m_ahrs->homeLocation, SIGNAL(clicked()), this, SLOT(homeLocationSaveSD())); - */ connect(m_ahrs->ahrsSettingsSaveRAM, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveRAM())); connect(m_ahrs->ahrsSettingsSaveSD, SIGNAL(clicked()), this, SLOT(ahrsSettingsSaveSD())); 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(); + // Order is important: 1st request the settings (it will also enable the controls) + // then explicitely disable them. They will be re-enabled right afterwards by the + // configgadgetwidget if the autopilot is actually connected. + refreshValues(); + // when the AHRS Widget is instanciated, the autopilot is always connected // enableControls(false); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); // Connect the help button connect(m_ahrs->ahrsHelp, SIGNAL(clicked()), this, SLOT(openHelp())); @@ -263,6 +263,13 @@ void ConfigAHRSWidget::resizeEvent(QResizeEvent *event) m_ahrs->sixPointsHelp->fitInView(paperplane,Qt::KeepAspectRatio); } + +void ConfigAHRSWidget::enableControls(bool enable) +{ + //m_ahrs->ahrsSettingsSaveRAM->setEnabled(enable); + m_ahrs->ahrsSettingsSaveSD->setEnabled(enable); +} + /** Starts an accelerometer bias calibration. */ @@ -281,7 +288,7 @@ void ConfigAHRSWidget::launchAccelBiasCalibration() accel_accum_y.clear(); accel_accum_z.clear(); - UAVDataObject* ahrsCalib = dynamic_cast(getObjectManager()->getObject(QString("AHRSCalibration"))); +// UAVDataObject* ahrsCalib = dynamic_cast(getObjectManager()->getObject(QString("AHRSCalibration"))); // ahrsCalib->getField("accel_bias")->setDouble(0,0); // ahrsCalib->getField("accel_bias")->setDouble(0,1); // ahrsCalib->getField("accel_bias")->setDouble(0,2); @@ -416,6 +423,7 @@ void ConfigAHRSWidget::launchGyroDriftCalibration() */ void ConfigAHRSWidget::driftCalibrationAttitudeRawUpdated(UAVObject* obj) { + Q_UNUSED(obj) // This is necessary to prevent a race condition on disconnect signal and another update if (collectingData == true) { /** @@ -1142,7 +1150,7 @@ void ConfigAHRSWidget::drawVariancesGraph() /** Request current settings from the AHRS */ -void ConfigAHRSWidget::ahrsSettingsRequest() +void ConfigAHRSWidget::refreshValues() { UAVObject *obj = getObjectManager()->getObject(QString("AHRSSettings")); diff --git a/ground/openpilotgcs/src/plugins/config/configahrswidget.h b/ground/openpilotgcs/src/plugins/config/configahrswidget.h index 81344226e..23da6f242 100644 --- a/ground/openpilotgcs/src/plugins/config/configahrswidget.h +++ b/ground/openpilotgcs/src/plugins/config/configahrswidget.h @@ -55,6 +55,7 @@ public: private: void drawVariancesGraph(); void displayPlane(QString elementID); + virtual void enableControls(bool enable); Ui_AHRSWidget *m_ahrs; QGraphicsSvgItem *paperplane; @@ -130,7 +131,9 @@ private slots: void launchAccelBiasCalibration(); void calibPhase2(); void incrementProgress(); - void ahrsSettingsRequest(); + + virtual void refreshValues(); + //void ahrsSettingsRequest(); void ahrsSettingsSaveRAM(); void ahrsSettingsSaveSD(); void savePositionData(); diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index f7b40e72f..bf3a1cfe9 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -172,7 +172,6 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p 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))); - requestAircraftUpdate(); connect(m_aircraft->fwThrottleReset, SIGNAL(clicked()), this, SLOT(resetFwMixer())); connect(m_aircraft->mrThrottleCurveReset, SIGNAL(clicked()), this, SLOT(resetMrMixer())); @@ -191,17 +190,22 @@ ConfigAirframeWidget::ConfigAirframeWidget(QWidget *parent) : ConfigTaskWidget(p connect(m_aircraft->ffTestBox2, SIGNAL(clicked(bool)), this, SLOT(enableFFTest())); connect(m_aircraft->ffTestBox3, SIGNAL(clicked(bool)), this, SLOT(enableFFTest())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestAircraftUpdate())); + enableControls(false); + refreshValues(); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); + // Register for ManualControlSettings changes: obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestAircraftUpdate())); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); // Connect the help button connect(m_aircraft->airframeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); + } ConfigAirframeWidget::~ConfigAirframeWidget() @@ -209,6 +213,18 @@ ConfigAirframeWidget::~ConfigAirframeWidget() // Do nothing } +/** + Enable or disable controls depending on whether we're ronnected or not + */ +void ConfigAirframeWidget::enableControls(bool enable) +{ + //m_aircraft->saveAircraftToRAM->setEnabled(enable); + m_aircraft->saveAircraftToSD->setEnabled(enable); + //m_aircraft->ffApply->setEnabled(enable); + m_aircraft->ffSave->setEnabled(enable); +} + + /** Slot for switching the airframe type. We do it explicitely rather than a signal in the UI, because we want to force a fitInView of the quad shapes. @@ -446,14 +462,13 @@ void ConfigAirframeWidget::updateCustomThrottle2CurveValue(QList list, d * Aircraft settings **************************/ /** - Request the current value of the SystemSettings which holds the aircraft type + Refreshes the current value of the SystemSettings which holds the aircraft type */ -void ConfigAirframeWidget::requestAircraftUpdate() +void ConfigAirframeWidget::refreshValues() { // Get the Airframe type from the system settings: UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); Q_ASSERT(obj); - // 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 @@ -463,7 +478,6 @@ void ConfigAirframeWidget::requestAircraftUpdate() obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); Q_ASSERT(obj); - //obj->requestUpdate(); field = obj->getField(QString("ThrottleCurve1")); Q_ASSERT(field); QList curveValues; diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.h b/ground/openpilotgcs/src/plugins/config/configairframewidget.h index 37f6ef877..19b5c35e8 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.h @@ -32,6 +32,7 @@ #include "extensionsystem/pluginmanager.h" #include "uavobjectmanager.h" #include "uavobject.h" +#include "uavtalk/telemetrymanager.h" #include #include #include @@ -57,6 +58,7 @@ private: void updateCustomAirframeUI(); bool setupMixer(double mixerFactors[8][3]); void setupMotors(QList motorList); + virtual void enableControls(bool enable); void resetField(UAVObjectField * field); void resetMixer (MixerCurveWidget *mixer, int numElements); @@ -72,7 +74,7 @@ private: UAVObject::Metadata accInitialData; private slots: - void requestAircraftUpdate(); + virtual void refreshValues(); void sendAircraftUpdate(); void saveAircraftUpdate(); void setupAirframeUI(QString type); diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp index 14c408521..52488da19 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.cpp @@ -43,13 +43,18 @@ ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) : connect(ui->applyButton,SIGNAL(clicked()),this,SLOT(applyAttitudeSettings())); // Make it smart: - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(getCurrentAttitudeSettings())); - getCurrentAttitudeSettings(); // The 1st time this panel is instanciated, the autopilot is already connected. + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); + + enableControls(true); + refreshValues(); // 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(settings,SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshValues())); // Connect the help button connect(ui->ccAttitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp())); + + } ConfigCCAttitudeWidget::~ConfigCCAttitudeWidget() @@ -57,6 +62,12 @@ ConfigCCAttitudeWidget::~ConfigCCAttitudeWidget() delete ui; } +void ConfigCCAttitudeWidget::enableControls(bool enable) +{ + //ui->applyButton->setEnabled(enable); + ui->saveButton->setEnabled(enable); +} + void ConfigCCAttitudeWidget::attitudeRawUpdated(UAVObject * obj) { QMutexLocker locker(&startStop); @@ -127,7 +138,7 @@ void ConfigCCAttitudeWidget::applyAttitudeSettings() { settings->updated(); } -void ConfigCCAttitudeWidget::getCurrentAttitudeSettings() { +void ConfigCCAttitudeWidget::refreshValues() { UAVDataObject * settings = dynamic_cast(getObjectManager()->getObject(QString("AttitudeSettings"))); UAVObjectField * field = settings->getField("BoardRotation"); ui->rollBias->setValue(field->getDouble(0)); diff --git a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h index 1a2627c84..1dee369f7 100644 --- a/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h +++ b/ground/openpilotgcs/src/plugins/config/configccattitudewidget.h @@ -52,7 +52,7 @@ private slots: void startAccelCalibration(); void saveAttitudeSettings(); void applyAttitudeSettings(); - void getCurrentAttitudeSettings(); + virtual void refreshValues(); void openHelp(); private: @@ -67,6 +67,8 @@ private: static const int NUM_ACCEL_UPDATES = 60; static const float ACCEL_SCALE = 0.004f * 9.81f; + virtual void enableControls(bool enable); + }; #endif // CCATTITUDEWIDGET_H diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.h b/ground/openpilotgcs/src/plugins/config/configccpmwidget.h index 21b4e1b38..c55a5b521 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.h @@ -85,6 +85,7 @@ private: int MixerChannelData[6]; int ShowDisclaimer(int messageID); + virtual void enableControls(bool enable) { Q_UNUSED(enable)}; // Not used by this widget private slots: void ccpmSwashplateUpdate(); @@ -107,10 +108,14 @@ private: void setSwashplateLevel(int percent); void SwashLvlSpinBoxChanged(int value); void FocusChanged(QWidget *oldFocus, QWidget *newFocus); + + virtual void refreshValues() {}; // Not used + public slots: void requestccpmUpdate(); void sendccpmUpdate(); void saveccpmUpdate(); + protected: void showEvent(QShowEvent *event); void resizeEvent(QResizeEvent *event); diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp index b49ccf1df..f19b414c4 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.cpp @@ -90,10 +90,11 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent) ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); TelemetryManager* telMngr = pm->getObject(); connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect())); + connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect())); // And check whether by any chance we are not already connected if (telMngr->isConnected()) - onAutopilotConnect(); + onAutopilotConnect(); help = 0; } @@ -111,6 +112,10 @@ void ConfigGadgetWidget::resizeEvent(QResizeEvent *event) QWidget::resizeEvent(event); } +void ConfigGadgetWidget::onAutopilotDisconnect() { + emit autopilotDisconnected(); +} + void ConfigGadgetWidget::onAutopilotConnect() { // First of all, check what Board type we are talking to, and @@ -135,8 +140,6 @@ void ConfigGadgetWidget::onAutopilotConnect() { ftw->insertTab(3, qwd, QIcon(":/configgadget/images/AHRS-v1.3.png"), QString("INS")); } } - - emit autopilotConnected(); } diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h index 2520458eb..43db58429 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configgadgetwidget.h @@ -52,9 +52,11 @@ public: public slots: void onAutopilotConnect(); + void onAutopilotDisconnect(); signals: void autopilotConnected(); + void autopilotDisconnected(); protected: void resizeEvent(QResizeEvent * event); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index eb0b50c8c..e1da9887d 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -43,8 +43,8 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) m_config = new Ui_InputWidget(); m_config->setupUi(this); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); - UAVObjectManager *objManager = pm->getObject(); + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); // First of all, put all the channel widgets into lists, so that we can // manipulate those: @@ -102,7 +102,7 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) // Register for ManualControlSettings changes: obj = dynamic_cast(objManager->getObject(QString("ManualControlSettings"))); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestRCInputUpdate())); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); // Get the receiver types supported by OpenPilot and fill the corresponding @@ -155,12 +155,14 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) m_config->armControl->clear(); m_config->armControl->addItems(field->getOptions()); - requestRCInputUpdate(); connect(m_config->saveRCInputToSD, SIGNAL(clicked()), this, SLOT(saveRCInputObject())); connect(m_config->saveRCInputToRAM, SIGNAL(clicked()), this, SLOT(sendRCInputUpdate())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestRCInputUpdate())); + enableControls(false); + refreshValues(); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); connect(m_config->inSlider0, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged0(int))); connect(m_config->inSlider1, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged1(int))); @@ -182,20 +184,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) firstUpdate = true; - 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(connected()), this, SLOT(onTelemetryConnect())); - connect(tm, SIGNAL(disconnected()), this, SLOT(onTelemetryDisconnect())); - } - } - // Connect the help button connect(m_config->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } @@ -266,27 +254,6 @@ void ConfigInputWidget::onInSliderValueChanged7(int value) inNeuLabels[7]->setText(QString::number(value)); } -// ************************************ -// telemetry start/stop connect/disconnect signals - -void ConfigInputWidget::onTelemetryStart() -{ -} - -void ConfigInputWidget::onTelemetryStop() -{ -} - -void ConfigInputWidget::onTelemetryConnect() -{ - enableControls(true); -} - -void ConfigInputWidget::onTelemetryDisconnect() -{ - enableControls(false); - m_config->doRCInputCalibration->setChecked(false); -} // ************************************ @@ -297,21 +264,11 @@ void ConfigInputWidget::onTelemetryDisconnect() */ void ConfigInputWidget::enableControls(bool 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); - m_config->ch3Assign->setEnabled(enable); - m_config->ch4Assign->setEnabled(enable); - m_config->ch5Assign->setEnabled(enable); - m_config->ch6Assign->setEnabled(enable); - m_config->ch7Assign->setEnabled(enable); - */ + m_config->doRCInputCalibration->setChecked(false); } @@ -322,7 +279,7 @@ void ConfigInputWidget::enableControls(bool enable) /** Request the current config from the board */ -void ConfigInputWidget::requestRCInputUpdate() +void ConfigInputWidget::refreshValues() { UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ManualControlSettings"))); Q_ASSERT(obj); diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 5747ee35d..1c7839a6f 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -46,10 +46,6 @@ public: ~ConfigInputWidget(); public slots: - void onTelemetryStart(); - void onTelemetryStop(); - void onTelemetryConnect(); - void onTelemetryDisconnect(); void onInSliderValueChanged0(int value); void onInSliderValueChanged1(int value); @@ -82,11 +78,11 @@ private: bool firstUpdate; - void enableControls(bool enable); + virtual void enableControls(bool enable); private slots: void updateChannels(UAVObject* obj); - void requestRCInputUpdate(); + virtual void refreshValues(); void sendRCInputUpdate(); void saveRCInputObject(); void reverseCheckboxClicked(bool state); diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 8699ff6d7..1a961805b 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -97,18 +97,17 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren << m_config->ch7Rev; links << m_config->ch0Link - << m_config->ch1Link - << m_config->ch2Link - << m_config->ch3Link - << m_config->ch4Link - << m_config->ch5Link - << m_config->ch6Link - << m_config->ch7Link; + << m_config->ch1Link + << m_config->ch2Link + << m_config->ch3Link + << m_config->ch4Link + << m_config->ch5Link + << m_config->ch6Link + << m_config->ch7Link; // Register for ActuatorSettings changes: UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestRCOutputUpdate())); - + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); for (int i = 0; i < 8; i++) { connect(outMin[i], SIGNAL(editingFinished()), this, SLOT(setChOutRange())); @@ -128,28 +127,15 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren connect(m_config->saveRCOutputToSD, SIGNAL(clicked()), this, SLOT(saveRCOutputObject())); connect(m_config->saveRCOutputToRAM, SIGNAL(clicked()), this, SLOT(sendRCOutputUpdate())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestRCOutputUpdate())); - requestRCOutputUpdate(); + enableControls(false); + refreshValues(); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); firstUpdate = true; connect(m_config->spinningArmed, SIGNAL(toggled(bool)), this, SLOT(setSpinningArmed(bool))); - enableControls(false); - - // 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())); - } - } - // Connect the help button connect(m_config->outputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); } @@ -160,34 +146,12 @@ ConfigOutputWidget::~ConfigOutputWidget() } - -// ************************************ -// telemetry start/stop connect/disconnect signals - -void ConfigOutputWidget::onTelemetryStart() -{ -} - -void ConfigOutputWidget::onTelemetryStop() -{ -} - -void ConfigOutputWidget::onTelemetryConnect() -{ - enableControls(true); -} - -void ConfigOutputWidget::onTelemetryDisconnect() -{ - enableControls(false); -} - // ************************************ void ConfigOutputWidget::enableControls(bool enable) { m_config->saveRCOutputToSD->setEnabled(enable); - m_config->saveRCOutputToRAM->setEnabled(enable); + //m_config->saveRCOutputToRAM->setEnabled(enable); } // ************************************ @@ -391,7 +355,7 @@ void ConfigOutputWidget::sendChannelTest(int value) /** Request the current config from the board (RC Output) */ -void ConfigOutputWidget::requestRCOutputUpdate() +void ConfigOutputWidget::refreshValues() { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h index bb18312f7..2a197e3ac 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.h @@ -46,12 +46,6 @@ public: ConfigOutputWidget(QWidget *parent = 0); ~ConfigOutputWidget(); -public slots: - void onTelemetryStart(); - void onTelemetryStop(); - void onTelemetryConnect(); - void onTelemetryDisconnect(); - private: Ui_OutputWidget *m_config; @@ -75,10 +69,10 @@ private: bool firstUpdate; - void enableControls(bool enable); + virtual void enableControls(bool enable); private slots: - void requestRCOutputUpdate(); + virtual void refreshValues(); void sendRCOutputUpdate(); void saveRCOutputObject(); void runChannelTests(bool state); diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index d588d2c1d..277c21648 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -43,14 +43,17 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa m_stabilization->setupUi(this); - requestStabilizationUpdate(); connect(m_stabilization->saveStabilizationToSD, SIGNAL(clicked()), this, SLOT(saveStabilizationUpdate())); connect(m_stabilization->saveStabilizationToRAM, SIGNAL(clicked()), this, SLOT(sendStabilizationUpdate())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestStabilizationUpdate())); + enableControls(false); + refreshValues(); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()),this, SLOT(onAutopilotDisconnect())); + // Now connect the widget to the StabilizationSettings object UAVObject *obj = getObjectManager()->getObject(QString("StabilizationSettings")); - connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(requestStabilizationUpdate())); + connect(obj,SIGNAL(objectUpdated(UAVObject*)),this,SLOT(refreshValues())); // Create a timer to regularly send the object update in case // we want realtime updates. @@ -84,6 +87,12 @@ ConfigStabilizationWidget::~ConfigStabilizationWidget() } +void ConfigStabilizationWidget::enableControls(bool enable) +{ + //m_stabilization->saveStabilizationToRAM->setEnabled(enable); + m_stabilization->saveStabilizationToSD->setEnabled(enable); +} + void ConfigStabilizationWidget::updateRateRollKP(double val) { if (m_stabilization->linkRateRP->isChecked()) { @@ -178,9 +187,9 @@ void ConfigStabilizationWidget::updatePitchILimit(double val) /** Request stabilization settings from the board */ -void ConfigStabilizationWidget::requestStabilizationUpdate() +void ConfigStabilizationWidget::refreshValues() { - // Not needed anymore as this slot is called whenever we get + // Not needed anymore as this slot is only called whenever we get // a signal that the object was just updated // stabSettings->requestUpdate(); StabilizationSettings::DataFields stabData = stabSettings->getData(); diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h index 5af92ae65..98db5530f 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.h @@ -49,9 +49,10 @@ private: Ui_StabilizationWidget *m_stabilization; StabilizationSettings* stabSettings; QTimer updateTimer; + virtual void enableControls(bool enable); private slots: - void requestStabilizationUpdate(); + virtual void refreshValues(); void sendStabilizationUpdate(); void saveStabilizationUpdate(); void realtimeUpdateToggle(bool); diff --git a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp index 9ddf04aa6..bb598cba0 100644 --- a/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtaskwidget.cpp @@ -62,6 +62,21 @@ double ConfigTaskWidget::listMean(QList list) return accum / list.size(); } +// ************************************ +// telemetry start/stop connect/disconnect signals + +void ConfigTaskWidget::onAutopilotDisconnect() +{ + enableControls(false); +} + +void ConfigTaskWidget::onAutopilotConnect() +{ + enableControls(true); + refreshValues(); +} + + /** @} diff --git a/ground/openpilotgcs/src/plugins/config/configtaskwidget.h b/ground/openpilotgcs/src/plugins/config/configtaskwidget.h index 5c467b918..6ffe15b70 100644 --- a/ground/openpilotgcs/src/plugins/config/configtaskwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configtaskwidget.h @@ -48,9 +48,15 @@ public: UAVObjectManager* getObjectManager(); static double listMean(QList list); +public slots: + void onAutopilotDisconnect(); + void onAutopilotConnect(); + private slots: + virtual void refreshValues() = 0; private: + virtual void enableControls(bool enable) = 0; }; diff --git a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp index 6532b625e..2b1a8e873 100644 --- a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.cpp @@ -47,13 +47,14 @@ ConfigTelemetryWidget::ConfigTelemetryWidget(QWidget *parent) : ConfigTaskWidget 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(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(requestTelemetryUpdate())); + connect(obj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(refreshValues())); - connect(parent, SIGNAL(autopilotConnected()),this, SLOT(requestTelemetryUpdate())); - requestTelemetryUpdate(); + enableControls(false); + refreshValues(); + connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); + connect(parent, SIGNAL(autopilotDisconnected()),this, SLOT(onAutopilotDisconnect())); } ConfigTelemetryWidget::~ConfigTelemetryWidget() @@ -66,10 +67,16 @@ ConfigTelemetryWidget::~ConfigTelemetryWidget() * Telemetry Settings *****************************/ +void ConfigTelemetryWidget::enableControls(bool enable) +{ + m_telemetry->saveTelemetryToSD->setEnabled(enable); + //m_telemetry->saveTelemetryToRAM->setEnabled(enable); +} + /** Request telemetry settings from the board */ -void ConfigTelemetryWidget::requestTelemetryUpdate() +void ConfigTelemetryWidget::refreshValues() { ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); @@ -102,5 +109,3 @@ void ConfigTelemetryWidget::saveTelemetryUpdate() Q_ASSERT(obj); saveObjectToSD(obj); } - - diff --git a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.h b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.h index 3f38eef3b..f36ba1a4e 100644 --- a/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.h +++ b/ground/openpilotgcs/src/plugins/config/configtelemetrywidget.h @@ -46,9 +46,10 @@ public: private: Ui_TelemetryWidget *m_telemetry; + void enableControls(bool enable); private slots: - void requestTelemetryUpdate(); + virtual void refreshValues(); void sendTelemetryUpdate(); void saveTelemetryUpdate(); diff --git a/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.cpp b/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.cpp index 8fb68d910..4705bb02e 100644 --- a/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.cpp @@ -31,7 +31,7 @@ #include DefaultAttitudeWidget::DefaultAttitudeWidget(QWidget *parent) : - ConfigTaskWidget(parent), + QWidget(parent), ui(new Ui_defaultattitude) { ui->setupUi(this); diff --git a/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.h b/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.h index 25b8809d4..5541eee37 100644 --- a/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.h +++ b/ground/openpilotgcs/src/plugins/config/defaultattitudewidget.h @@ -38,7 +38,7 @@ class Ui_Widget; -class DefaultAttitudeWidget : public ConfigTaskWidget +class DefaultAttitudeWidget : public QWidget { Q_OBJECT From dbba0afe0dede7b1172bdc913cf2f0edd5084e0e Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 17:06:50 +0200 Subject: [PATCH 17/33] OP-369 Last improvements to import option. --- .../uavsettingsimportexport/uavsettingsimportexport.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index a53291d2c..932af48fc 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -158,7 +158,7 @@ void UAVSettingsImportExportPlugin::importUAVSettings() if (obj == NULL) { // This object is unknown! qDebug() << "Object Unknown:" << uavObjectName << uavObjectID; - swui.addLine(uavObjectName, "Error", false); + swui.addLine(uavObjectName, "Error (object Unknown)", false); } else { // - Update each field @@ -190,10 +190,10 @@ void UAVSettingsImportExportPlugin::importUAVSettings() } obj->updated(); if (error) { - swui.addLine(uavObjectName, "Error", false); + swui.addLine(uavObjectName, "Warning (Object field unknown)", true); } else if (uavObjectID != obj->getObjID()) { qDebug() << "Mismatch for Object " << uavObjectName << uavObjectID << " - " << obj->getObjID(); - swui.addLine(uavObjectName, "Warning", true); + swui.addLine(uavObjectName, "Warning (ObjectID mismatch)", true); } else swui.addLine(uavObjectName, "OK", true); } From 9b572407a793ea7642563ccb81f150fc4b7f3cd2 Mon Sep 17 00:00:00 2001 From: elafargue Date: Tue, 7 Jun 2011 17:15:16 +0200 Subject: [PATCH 18/33] Small compilation warning fixed and small typos --- .../src/plugins/coreplugin/connectionmanager.cpp | 5 +++-- ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp | 1 + ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h | 2 +- .../uavsettingsimportexport/uavsettingsimportexport.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp index 07f0ef0c9..176263d04 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/connectionmanager.cpp @@ -219,8 +219,9 @@ void ConnectionManager::aboutToRemoveObject(QObject *obj) void ConnectionManager::onConnectionDestroyed(QObject *obj) // Pip { - //onConnectionClosed(obj); - disconnectDevice(); + Q_UNUSED(obj) + //onConnectionClosed(obj); + disconnectDevice(); } /** diff --git a/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp b/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp index f3e95a8cb..dd6c3d0bc 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp +++ b/ground/openpilotgcs/src/plugins/coreplugin/coreimpl.cpp @@ -183,6 +183,7 @@ void CoreImpl::updateContext() void CoreImpl::openFiles(const QStringList &arguments) { + Q_UNUSED(arguments) //m_mainwindow->openFiles(arguments); } diff --git a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h index 585d4604a..d2f7b1977 100644 --- a/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h +++ b/ground/openpilotgcs/src/plugins/coreplugin/mainwindow.h @@ -177,8 +177,8 @@ private: QList m_additionalContexts; QSettings *m_settings; QSettings *m_globalSettings; - bool m_dontSaveSettings; // In case of an Error or if we reset the settings, never save them. SettingsDatabase *m_settingsDatabase; + bool m_dontSaveSettings; // In case of an Error or if we reset the settings, never save them. ActionManagerPrivate *m_actionManager; MessageManager *m_messageManager; VariableManager *m_variableManager; diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 932af48fc..0b52a699a 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -158,7 +158,7 @@ void UAVSettingsImportExportPlugin::importUAVSettings() if (obj == NULL) { // This object is unknown! qDebug() << "Object Unknown:" << uavObjectName << uavObjectID; - swui.addLine(uavObjectName, "Error (object Unknown)", false); + swui.addLine(uavObjectName, "Error (object unknown)", false); } else { // - Update each field From 4a59c03b0e62f3dde9be5abb7ddb3d2db0801cc1 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 7 Jun 2011 10:31:40 -0500 Subject: [PATCH 19/33] OP-493: Unfortuantely have to change stack alarms for this to work :( --- flight/CopterControl/System/inc/pios_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index 98c900387..392771a26 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -85,8 +85,8 @@ #define AUXUART_BAUDRATE 19200 /* Alarm Thresholds */ -#define HEAP_LIMIT_WARNING 350 -#define HEAP_LIMIT_CRITICAL 250 +#define HEAP_LIMIT_WARNING 220 +#define HEAP_LIMIT_CRITICAL 150 #define CPULOAD_LIMIT_WARNING 80 #define CPULOAD_LIMIT_CRITICAL 95 From b1d945c6f20c41ace284c50f90aa5a9af97d18a2 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 7 Jun 2011 19:41:52 +0300 Subject: [PATCH 20/33] OP-369: remove completed TODO list, unify capitalization --- .../uavsettingsimportexport.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp index 0b52a699a..f3c48c969 100644 --- a/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp +++ b/ground/openpilotgcs/src/plugins/uavsettingsimportexport/uavsettingsimportexport.cpp @@ -25,13 +25,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - * TODO: - * - write import functions - * - split formats into different files/classes - * - better error handling (not a lot of QMessageBoxes) - */ - #include "uavsettingsimportexport.h" #include @@ -157,8 +150,8 @@ void UAVSettingsImportExportPlugin::importUAVSettings() UAVObject* obj = objManager->getObject(uavObjectName); if (obj == NULL) { // This object is unknown! - qDebug() << "Object Unknown:" << uavObjectName << uavObjectID; - swui.addLine(uavObjectName, "Error (object unknown)", false); + qDebug() << "Object unknown:" << uavObjectName << uavObjectID; + swui.addLine(uavObjectName, "Error (Object unknown)", false); } else { // - Update each field From 268488a5b8cce87f9de77d6ec2a0812ff0333a7c Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Tue, 7 Jun 2011 19:46:46 +0300 Subject: [PATCH 21/33] config: relax the CCPM mixer disclaimer (it has been used already) --- ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp index bd4239159..5d942bf1a 100644 --- a/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configccpmwidget.cpp @@ -1533,7 +1533,7 @@ int ConfigccpmWidget::ShowDisclaimer(int messageID) break; case 1: // Not Tested disclaimer - msgBox.setInformativeText("

The CCPM mixer code has not been used to fly a helicopter!

Use it at your own risk!

Do you wish to continue?"); + msgBox.setInformativeText("

The CCPM mixer code needs more testing!

Use it at your own risk!

Do you wish to continue?"); msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Cancel); msgBox.setIcon(QMessageBox::Warning); From 0b78ae07bbd97a79b569fb9c552741a85cf25ba9 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 7 Jun 2011 17:04:36 -0500 Subject: [PATCH 22/33] OP-521: Match the flight logic for processing flight mode switch position on GCS so the slider should always match what hte internal logic says. --- .../src/plugins/config/configinputwidget.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index e1da9887d..5821adfbc 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -602,12 +602,13 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) valueScaled = 0; } - // Bound - if (valueScaled > 1.0) valueScaled = 1.0; - else - if (valueScaled < -1.0) valueScaled = -1.0; + if(valueScaled < -(1.0 / 3.0)) + m_config->fmsSlider->setValue(-100); + else if (valueScaled > (1.0/3.0)) + m_config->fmsSlider->setValue(100); + else + m_config->fmsSlider->setValue(0); - m_config->fmsSlider->setValue(valueScaled * 100); } } From 68d6e7debab8270892cac5b6961a0da66021bce0 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Tue, 7 Jun 2011 17:35:21 -0500 Subject: [PATCH 23/33] OP-521: Fixed dangerous UI bug that reversed flight mode switch on GCS relative to flight when flight mode switch input range was reversed. Also switche to using static field method technique for compiler error checking (preferrable when possible) --- .../src/plugins/config/configinputwidget.cpp | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 5821adfbc..e644307a1 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -38,6 +38,8 @@ #include #include +#include "manualcontrolsettings.h" + ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) { m_config = new Ui_InputWidget(); @@ -547,7 +549,7 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) mdata.flightAccess = UAVObject::ACCESS_READONLY; obj->setMetadata(mdata); UAVObjectField *field = obj->getField("Channel"); - for (int i=0; i< field->getNumElements(); i++) { + for (uint i=0; i< field->getNumElements(); i++) { field->setValue(0,i); } obj->updated(); @@ -574,17 +576,17 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) } firstUpdate = true; } + //Update the Flight mode channel slider - UAVObject* obj = getObjectManager()->getObject("ManualControlSettings"); - // Find the channel currently assigned to flightmode - field = obj->getField("FlightMode"); - int chIndex = field->getOptions().indexOf(field->getValue().toString()); - if (chIndex < field->getOptions().length() - 1) { + ManualControlSettings * manualSettings = ManualControlSettings::GetInstance(getObjectManager()); + ManualControlSettings::DataFields manualSettingsData = manualSettings->getData(); + uint chIndex = manualSettingsData.FlightMode; + if (chIndex < manualSettings->FLIGHTMODEPOSITION_NUMELEM - 1) { float valueScaled; - int chMin = inSliders[chIndex]->minimum(); - int chMax = inSliders[chIndex]->maximum(); - int chNeutral = inSliders[chIndex]->value(); + int chMin = manualSettingsData.ChannelMin[chIndex]; + int chMax = manualSettingsData.ChannelMax[chIndex]; + int chNeutral = manualSettingsData.ChannelNeutral[chIndex]; int value = controlCommand->getField("Channel")->getValue(chIndex).toInt(); if ((chMax > chMin && value >= chNeutral) || (chMin > chMax && value <= chNeutral)) From 0b59c34afb1c9ba76636e998484711a83e8d809b Mon Sep 17 00:00:00 2001 From: dankers Date: Thu, 9 Jun 2011 00:47:09 +1000 Subject: [PATCH 24/33] Change Accel kP default to 0.03 Lots of testing with this but would like more thoughts as well. --- shared/uavobjectdefinition/attitudesettings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/uavobjectdefinition/attitudesettings.xml b/shared/uavobjectdefinition/attitudesettings.xml index af89cc0d6..e0007bbeb 100644 --- a/shared/uavobjectdefinition/attitudesettings.xml +++ b/shared/uavobjectdefinition/attitudesettings.xml @@ -4,7 +4,7 @@ - + From f361603a10a3861f8cb117d237f8abc8c32f8a71 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 8 Jun 2011 12:01:47 -0500 Subject: [PATCH 25/33] OP-521: Fixed reversal of flight mode in GCS properly now I have hardware to test it :) --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index e644307a1..7cecdcc24 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -581,7 +581,7 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) ManualControlSettings * manualSettings = ManualControlSettings::GetInstance(getObjectManager()); ManualControlSettings::DataFields manualSettingsData = manualSettings->getData(); uint chIndex = manualSettingsData.FlightMode; - if (chIndex < manualSettings->FLIGHTMODEPOSITION_NUMELEM - 1) { + if (chIndex < manualSettings->FLIGHTMODE_NONE) { float valueScaled; int chMin = manualSettingsData.ChannelMin[chIndex]; From 3a3c88cefa172669fabac0837ebb054ad2145eff Mon Sep 17 00:00:00 2001 From: James Cotton Date: Wed, 8 Jun 2011 12:21:43 -0500 Subject: [PATCH 26/33] OP-522: When you unchecked Run Calibration it forces the Throttle neutral to 5% of the range and the FlightMode to 50%. Sorry there's also some indentation changes mixed into this patch. --- .../src/plugins/config/configinputwidget.cpp | 77 +++++++++++-------- 1 file changed, 46 insertions(+), 31 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 7cecdcc24..81618b3c8 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -534,35 +534,34 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) if (m_config->doRCInputCalibration->isChecked()) { if (firstUpdate) { - // Increase the data rate from the board so that the sliders - // move faster - UAVObject::Metadata mdata = controlCommand->getMetadata(); - mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC; - mccDataRate = mdata.flightTelemetryUpdatePeriod; - mdata.flightTelemetryUpdatePeriod = 150; - controlCommand->setMetadata(mdata); - - // Also protect the user by setting all values to zero - // and making the ActuatorCommand object readonly - UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorCommand"))); - mdata = obj->getMetadata(); - mdata.flightAccess = UAVObject::ACCESS_READONLY; - obj->setMetadata(mdata); - UAVObjectField *field = obj->getField("Channel"); - for (uint i=0; i< field->getNumElements(); i++) { - field->setValue(0,i); - } - obj->updated(); + // Increase the data rate from the board so that the sliders + // move faster + UAVObject::Metadata mdata = controlCommand->getMetadata(); + mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC; + mccDataRate = mdata.flightTelemetryUpdatePeriod; + mdata.flightTelemetryUpdatePeriod = 150; + controlCommand->setMetadata(mdata); + // Also protect the user by setting all values to zero + // and making the ActuatorCommand object readonly + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorCommand"))); + mdata = obj->getMetadata(); + mdata.flightAccess = UAVObject::ACCESS_READONLY; + obj->setMetadata(mdata); + UAVObjectField *field = obj->getField("Channel"); + for (uint i=0; i< field->getNumElements(); i++) { + field->setValue(0,i); } + obj->updated(); + } field = controlCommand->getField(QString("Channel")); for (int i = 0; i < 8; i++) updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked()); firstUpdate = false; - } - else { - if (!firstUpdate) { + } + else { + if (!firstUpdate) { // Restore original data rate from the board: UAVObject::Metadata mdata = controlCommand->getMetadata(); mdata.flightTelemetryUpdateMode = UAVObject::UPDATEMODE_PERIODIC; @@ -573,6 +572,22 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) mdata = obj->getMetadata(); mdata.flightAccess = UAVObject::ACCESS_READWRITE; obj->setMetadata(mdata); + + // Set some slider values to better defaults + ManualControlSettings * manualSettings = ManualControlSettings::GetInstance(getObjectManager()); + ManualControlSettings::DataFields manualSettingsData = manualSettings->getData(); + uint throttleIndex = manualSettingsData.Throttle; + uint flightModeIndex = manualSettingsData.FlightMode; + if(throttleIndex < manualSettings->THROTTLE_NONE) { + // Throttle neutral defaults to 5% of range + manualSettingsData.ChannelNeutral[throttleIndex] = 0.05 * (manualSettingsData.ChannelMax[throttleIndex] - manualSettingsData.ChannelMin[throttleIndex]) + manualSettingsData.ChannelMin[throttleIndex]; + qDebug() << manualSettingsData.ChannelNeutral[throttleIndex]; + } + if(flightModeIndex < manualSettings->FLIGHTMODE_NONE) { + // Flight mode neutral defaults to 50% of range + manualSettingsData.ChannelNeutral[flightModeIndex] = 0.5 * (manualSettingsData.ChannelMax[flightModeIndex] - manualSettingsData.ChannelMin[flightModeIndex]) + manualSettingsData.ChannelMin[flightModeIndex]; + } + manualSettings->setData(manualSettingsData); } firstUpdate = true; } @@ -591,17 +606,17 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) int value = controlCommand->getField("Channel")->getValue(chIndex).toInt(); if ((chMax > chMin && value >= chNeutral) || (chMin > chMax && value <= chNeutral)) { - if (chMax != chNeutral) - valueScaled = (float)(value - chNeutral) / (float)(chMax - chNeutral); - else - valueScaled = 0; + if (chMax != chNeutral) + valueScaled = (float)(value - chNeutral) / (float)(chMax - chNeutral); + else + valueScaled = 0; } else { - if (chMin != chNeutral) - valueScaled = (float)(value - chNeutral) / (float)(chNeutral - chMin); - else - valueScaled = 0; + if (chMin != chNeutral) + valueScaled = (float)(value - chNeutral) / (float)(chNeutral - chMin); + else + valueScaled = 0; } if(valueScaled < -(1.0 / 3.0)) @@ -611,7 +626,7 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) else m_config->fmsSlider->setValue(0); - } + } } void ConfigInputWidget::updateChannelInSlider(QSlider *slider, QLabel *min, QLabel *max, int value, bool reversed) From 1ac92643b7ffd58d61692180626c5d5cfb17c03f Mon Sep 17 00:00:00 2001 From: elafargue Date: Wed, 8 Jun 2011 22:15:10 +0200 Subject: [PATCH 27/33] Fix 'smart' throttle/flight mode channel assignment, it works now. Someone please test & report. OP-522 --- .../src/plugins/config/configinputwidget.cpp | 132 ++++++---------- .../src/plugins/config/configinputwidget.h | 10 +- .../openpilotgcs/src/plugins/config/input.ui | 147 ++++++++++++++++-- 3 files changed, 188 insertions(+), 101 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 81618b3c8..da1038c03 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -70,15 +70,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) << m_config->ch6Min << m_config->ch7Min; - inNeuLabels << m_config->ch0Cur - << m_config->ch1Cur - << m_config->ch2Cur - << m_config->ch3Cur - << m_config->ch4Cur - << m_config->ch5Cur - << m_config->ch6Cur - << m_config->ch7Cur; - inSliders << m_config->inSlider0 << m_config->inSlider1 << m_config->inSlider2 @@ -97,6 +88,14 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) << m_config->ch6Rev << m_config->ch7Rev; + inChannelAssign << m_config->ch0Assign + << m_config->ch1Assign + << m_config->ch2Assign + << m_config->ch3Assign + << m_config->ch4Assign + << m_config->ch5Assign + << m_config->ch6Assign + << m_config->ch7Assign; // Now connect the widget to the ManualControlCommand / Channel UAVObject UAVDataObject* obj = dynamic_cast(objManager->getObject(QString("ManualControlCommand"))); @@ -166,15 +165,6 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(parent, SIGNAL(autopilotConnected()),this, SLOT(onAutopilotConnect())); connect(parent, SIGNAL(autopilotDisconnected()), this, SLOT(onAutopilotDisconnect())); - connect(m_config->inSlider0, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged0(int))); - connect(m_config->inSlider1, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged1(int))); - connect(m_config->inSlider2, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged2(int))); - connect(m_config->inSlider3, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged3(int))); - connect(m_config->inSlider4, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged4(int))); - connect(m_config->inSlider5, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged5(int))); - connect(m_config->inSlider6, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged6(int))); - connect(m_config->inSlider7, SIGNAL(valueChanged(int)),this, SLOT(onInSliderValueChanged7(int))); - connect(m_config->ch0Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); connect(m_config->ch1Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); connect(m_config->ch2Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); @@ -213,49 +203,6 @@ void ConfigInputWidget::reverseCheckboxClicked(bool state) } } -// ************************************ -// slider value changed signals - -void ConfigInputWidget::onInSliderValueChanged0(int value) -{ - inNeuLabels[0]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged1(int value) -{ - inNeuLabels[1]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged2(int value) -{ - inNeuLabels[2]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged3(int value) -{ - inNeuLabels[3]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged4(int value) -{ - inNeuLabels[4]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged5(int value) -{ - inNeuLabels[5]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged6(int value) -{ - inNeuLabels[6]->setText(QString::number(value)); -} - -void ConfigInputWidget::onInSliderValueChanged7(int value) -{ - inNeuLabels[7]->setText(QString::number(value)); -} - // ************************************ @@ -269,8 +216,6 @@ void ConfigInputWidget::enableControls(bool enable) //m_config->saveRCInputToRAM->setEnabled(enable); m_config->saveRCInputToSD->setEnabled(enable); m_config->doRCInputCalibration->setEnabled(enable); - - m_config->doRCInputCalibration->setChecked(false); } @@ -319,14 +264,9 @@ void ConfigInputWidget::refreshValues() m_config->receiverType->setCurrentIndex(m_config->receiverType->findText(field->getValue().toString())); // Reset all channel assignement dropdowns: - m_config->ch0Assign->setCurrentIndex(0); - m_config->ch1Assign->setCurrentIndex(0); - m_config->ch2Assign->setCurrentIndex(0); - m_config->ch3Assign->setCurrentIndex(0); - m_config->ch4Assign->setCurrentIndex(0); - m_config->ch5Assign->setCurrentIndex(0); - m_config->ch6Assign->setCurrentIndex(0); - m_config->ch7Assign->setCurrentIndex(0); + foreach (QComboBox *combo, inChannelAssign) { + combo->setCurrentIndex(0); + } // Update all channels assignements QList fieldList = obj->getFields(); @@ -553,6 +493,10 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) field->setValue(0,i); } obj->updated(); + + // Last, make sure the user won't apply/save during calibration + m_config->saveRCInputToRAM->setEnabled(false); + m_config->saveRCInputToSD->setEnabled(false); } field = controlCommand->getField(QString("Channel")); @@ -574,20 +518,42 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) obj->setMetadata(mdata); // Set some slider values to better defaults - ManualControlSettings * manualSettings = ManualControlSettings::GetInstance(getObjectManager()); - ManualControlSettings::DataFields manualSettingsData = manualSettings->getData(); - uint throttleIndex = manualSettingsData.Throttle; - uint flightModeIndex = manualSettingsData.FlightMode; - if(throttleIndex < manualSettings->THROTTLE_NONE) { - // Throttle neutral defaults to 5% of range - manualSettingsData.ChannelNeutral[throttleIndex] = 0.05 * (manualSettingsData.ChannelMax[throttleIndex] - manualSettingsData.ChannelMin[throttleIndex]) + manualSettingsData.ChannelMin[throttleIndex]; - qDebug() << manualSettingsData.ChannelNeutral[throttleIndex]; + // Find what channel we used for throttle, set it 5% about min: + int throttleChannel = -1; + int fmChannel = -1; + for (int i=0; i < inChannelAssign.length(); i++) { + if (inChannelAssign.at(i)->currentText() == "Throttle") { + // TODO: this is very ugly, because this relies on the name of the + // channel input, everywhere else in the gadget we don't rely on the + // naming... + throttleChannel = i; + } + if (inChannelAssign.at(i)->currentText() == "FlightMode") { + // TODO: this is very ugly, because this relies on the name of the + // channel input, everywhere else in the gadget we don't rely on the + // naming... + fmChannel = i; + } } - if(flightModeIndex < manualSettings->FLIGHTMODE_NONE) { - // Flight mode neutral defaults to 50% of range - manualSettingsData.ChannelNeutral[flightModeIndex] = 0.5 * (manualSettingsData.ChannelMax[flightModeIndex] - manualSettingsData.ChannelMin[flightModeIndex]) + manualSettingsData.ChannelMin[flightModeIndex]; + + // Throttle neutral defaults to 2% of range + if (throttleChannel > -1) { + inSliders.at(throttleChannel)->setValue( + inSliders.at(throttleChannel)->minimum() + + (inSliders.at(throttleChannel)->maximum()- + inSliders.at(throttleChannel)->minimum())*0.02); } - manualSettings->setData(manualSettingsData); + + // Flight mode at 50% of range: + if (fmChannel > -1) { + inSliders.at(fmChannel)->setValue( + inSliders.at(fmChannel)->minimum()+ + (inSliders.at(fmChannel)->maximum()- + inSliders.at(fmChannel)->minimum())*0.5); + } + + m_config->saveRCInputToRAM->setEnabled(true); + m_config->saveRCInputToSD->setEnabled(true); } firstUpdate = true; } diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 1c7839a6f..3017c5677 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -47,15 +47,6 @@ public: public slots: - void onInSliderValueChanged0(int value); - void onInSliderValueChanged1(int value); - void onInSliderValueChanged2(int value); - void onInSliderValueChanged3(int value); - void onInSliderValueChanged4(int value); - void onInSliderValueChanged5(int value); - void onInSliderValueChanged6(int value); - void onInSliderValueChanged7(int value); - private: Ui_InputWidget *m_config; @@ -75,6 +66,7 @@ private: QList inMinLabels; QList inNeuLabels; QList inRevCheckboxes; + QList inChannelAssign; bool firstUpdate; diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 2bfd7b03d..224424c4e 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -52,7 +52,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -160,7 +160,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -268,7 +268,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -376,7 +376,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -484,7 +484,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -592,7 +592,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -700,7 +700,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -912,7 +912,7 @@ p, li { white-space: pre-wrap; } <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:9pt;">Current channel value.</span></p></body></html> - 1000 + 1500 @@ -1460,5 +1460,134 @@ Applies and Saves all settings to SD - + + + inSlider0 + valueChanged(int) + ch0Cur + setNum(int) + + + 291 + 93 + + + 150 + 104 + + + + + inSlider1 + valueChanged(int) + ch1Cur + setNum(int) + + + 283 + 137 + + + 160 + 138 + + + + + inSlider2 + valueChanged(int) + ch2Cur + setNum(int) + + + 341 + 163 + + + 156 + 167 + + + + + inSlider3 + valueChanged(int) + ch3Cur + setNum(int) + + + 283 + 211 + + + 159 + 210 + + + + + inSlider4 + valueChanged(int) + ch4Cur + setNum(int) + + + 287 + 239 + + + 156 + 242 + + + + + inSlider5 + valueChanged(int) + ch5Cur + setNum(int) + + + 309 + 272 + + + 164 + 276 + + + + + inSlider6 + valueChanged(int) + ch6Cur + setNum(int) + + + 282 + 300 + + + 144 + 311 + + + + + inSlider7 + valueChanged(int) + ch7Cur + setNum(int) + + + 278 + 339 + + + 168 + 340 + + + + From 9d89f1e1802e39b776bed184db18b56db4e164ba Mon Sep 17 00:00:00 2001 From: elafargue Date: Thu, 9 Jun 2011 13:12:03 +0200 Subject: [PATCH 28/33] OP-528 Make the manual and maximum RPY rates available in the config gadget --- .../config/configstabilizationwidget.cpp | 16 ++ .../src/plugins/config/stabilization.ui | 188 ++++++++++++++++++ 2 files changed, 204 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp index 277c21648..f691cc22f 100644 --- a/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configstabilizationwidget.cpp @@ -222,6 +222,14 @@ void ConfigStabilizationWidget::refreshValues() m_stabilization->pitchMax->setValue(stabData.PitchMax); m_stabilization->yawMax->setValue(stabData.YawMax); + m_stabilization->manualRoll->setValue(stabData.ManualRate[StabilizationSettings::MANUALRATE_ROLL]); + m_stabilization->manualPitch->setValue(stabData.ManualRate[StabilizationSettings::MANUALRATE_PITCH]); + m_stabilization->manualYaw->setValue(stabData.ManualRate[StabilizationSettings::MANUALRATE_YAW]); + + m_stabilization->maximumRoll->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_ROLL]); + m_stabilization->maximumPitch->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_PITCH]); + m_stabilization->maximumYaw->setValue(stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_YAW]); + } @@ -261,6 +269,14 @@ void ConfigStabilizationWidget::sendStabilizationUpdate() stabData.PitchMax = m_stabilization->pitchMax->value(); stabData.YawMax = m_stabilization->yawMax->value(); + stabData.ManualRate[StabilizationSettings::MANUALRATE_ROLL] = m_stabilization->manualRoll->value(); + stabData.ManualRate[StabilizationSettings::MANUALRATE_PITCH] = m_stabilization->manualPitch->value(); + stabData.ManualRate[StabilizationSettings::MANUALRATE_YAW] = m_stabilization->manualYaw->value(); + + stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_ROLL] = m_stabilization->maximumRoll->value(); + stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_PITCH] = m_stabilization->maximumPitch->value(); + stabData.MaximumRate[StabilizationSettings::MAXIMUMRATE_YAW] = m_stabilization->maximumYaw->value(); + stabSettings->setData(stabData); // this is atomic } diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 55a563a49..120695b96 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -483,6 +483,12 @@ flying style. + + + 150 + 0 + + 75 @@ -564,6 +570,188 @@ flying style. + + + + + + + 150 + 0 + + + + + 75 + true + + + + Manual rate: + + + + + + + Roll + + + + + + + 300 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Pitch + + + + + + + 300 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Yaw + + + + + + + 300 + + + + + + + + + + + + 150 + 0 + + + + + 75 + true + + + + Maximum rate: + + + + + + + Roll + + + + + + + 300 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Pitch + + + + + + + 300 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Yaw + + + + + + + 300 + + + + + From c79cc1eb1a6bf4afd3dba65c0b010c2119875e08 Mon Sep 17 00:00:00 2001 From: elafargue Date: Thu, 9 Jun 2011 18:03:19 +0200 Subject: [PATCH 29/33] OP-376 Make all dialogs more dynamic to cope with smaller screens & resizes. --- .../lineardial/lineardialgadgetoptionspage.ui | 1053 ++++++++--------- .../src/plugins/pfd/pfdgadgetoptionspage.ui | 220 ++-- .../plugins/scope/scopegadgetoptionspage.cpp | 2 +- .../plugins/scope/scopegadgetoptionspage.ui | 644 +++++----- 4 files changed, 917 insertions(+), 1002 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui index 1d94b3cf4..9bf5c93e0 100644 --- a/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui +++ b/ground/openpilotgcs/src/plugins/lineardial/lineardialgadgetoptionspage.ui @@ -1,546 +1,507 @@ - - - LineardialGadgetOptionsPage - - - - 0 - 0 - 540 - 347 - - - - - 0 - 0 - - - - Form - - - - - -1 - -1 - 533 - 321 - - - - - QLayout::SetMinimumSize - - - 10 - - - 5 - - - 10 - - - 10 - - - - - - - Use OpenGL - - - true - - - - - - - - - Qt::Horizontal - - - - - - - 10 - - - QLayout::SetMaximumSize - - - 10 - - - - - Dial SVG: - - - - - - - - 0 - 0 - - - - - - - - - - - - - 0 - 0 - - - - Whole range: - - - - - - - Min: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - Max: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - Green: - - - - - - - Min: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - Max: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - Yellow: - - - - - - - Min: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - Max: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - - - Qt::Horizontal - - - - - - - - - - 0 - 0 - - - - Red: - - - - - - - Min: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - Max: - - - - - - - - 0 - 0 - - - - 3 - - - -99999.000000000000000 - - - 99999.990000000005239 - - - - - - - - - - - - 0 - 0 - - - - Input: - - - - - - - ObjectName - - - - - - - - 0 - 0 - - - - - - - - ObjectField - - - - - - - - 0 - 0 - - - - - - - - - - 0 - - - - - - 0 - 0 - - - - Dial font: - - - - - - - Select... - - - - - - - Decimal places: - - - - - - - 99 - - - - - - - Factor: - - - - - - - 6 - - - -10000.000000000000000 - - - 100000.000000000000000 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Utils::PathChooser - QWidget -

utils/pathchooser.h
- 1 - - - - - + + + LineardialGadgetOptionsPage + + + + 0 + 0 + 540 + 347 + + + + + 0 + 0 + + + + Form + + + + + + + + Use OpenGL + + + true + + + + + + + + + Qt::Horizontal + + + + + + + 10 + + + QLayout::SetMaximumSize + + + 10 + + + + + Dial SVG: + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + Whole range: + + + + + + + Min: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + Max: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + + + Qt::Horizontal + + + + + + + + + + 0 + 0 + + + + Green: + + + + + + + Min: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + Max: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + + + + + + 0 + 0 + + + + Yellow: + + + + + + + Min: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + Max: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + + + + + + 0 + 0 + + + + Red: + + + + + + + Min: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + Max: + + + + + + + + 0 + 0 + + + + 3 + + + -99999.000000000000000 + + + 99999.990000000005239 + + + + + + + + + + + + 0 + 0 + + + + Input: + + + + + + + ObjectName + + + + + + + + 0 + 0 + + + + + + + + ObjectField + + + + + + + + 0 + 0 + + + + + + + + + + 0 + + + + + + 0 + 0 + + + + Dial font: + + + + + + + Select... + + + + + + + Decimal places: + + + + + + + 99 + + + + + + + Factor: + + + + + + + 6 + + + -10000.000000000000000 + + + 100000.000000000000000 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Utils::PathChooser + QWidget +
utils/pathchooser.h
+ 1 +
+
+ + +
diff --git a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.ui index 4086d1a5a..f9a2808b3 100644 --- a/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.ui +++ b/ground/openpilotgcs/src/plugins/pfd/pfdgadgetoptionspage.ui @@ -7,7 +7,7 @@ 0 0 529 - 346 + 271
@@ -19,131 +19,99 @@ Form - - - - -1 - -1 - 504 - 331 - - - - - QLayout::SetMinimumSize - - - 10 - - - 5 - - - 10 - - - 10 - - - - - 10 - - - QLayout::SetMaximumSize - - - 10 - - - - - PFD SVG: - - - - - - - - 0 - 0 - - - - - - - - - - Qt::Horizontal - - - - - - - - - true - - - Use OpenGL for rendering - - - true - - - - - - - High Quality text (OpenGL) - - - - - - - - - - - Smooth updates - - - true - - - - - - - - - Qt::Vertical - - - QSizePolicy::Minimum - - - - 20 - 40 - - - - - - - - Qt::Horizontal - - - - - + + + + + 10 + + + QLayout::SetMaximumSize + + + 10 + + + + + PFD SVG: + + + + + + + + 0 + 0 + + + + + + + + + + Qt::Horizontal + + + + + + + + + true + + + Use OpenGL for rendering + + + true + + + + + + + High Quality text (OpenGL) + + + + + + + + + + + Smooth updates + + + true + + + + + + + + + Qt::Vertical + + + QSizePolicy::MinimumExpanding + + + + 20 + 40 + + + + +
diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.cpp b/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.cpp index 6dc549ba1..e44ccb08f 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.cpp +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.cpp @@ -132,7 +132,7 @@ QWidget* ScopeGadgetOptionsPage::createPage(QWidget *parent) void ScopeGadgetOptionsPage::on_btnColor_clicked() { - QColor color = QColorDialog::getColor( QColor(options_page->btnColor->text()), options_page->widget); + QColor color = QColorDialog::getColor( QColor(options_page->btnColor->text())); if (color.isValid()) { setButtonColor(color); } diff --git a/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.ui b/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.ui index 4ba44b242..2aaee1942 100644 --- a/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.ui +++ b/ground/openpilotgcs/src/plugins/scope/scopegadgetoptionspage.ui @@ -1,329 +1,315 @@ - - - ScopeGadgetOptionsPage - - - - 0 - 0 - 550 - 290 - - - - Form - - - - - 10 - 10 - 541 - 271 - - - - - - 0 - 0 - 531 - 272 - - - - - 3 - - - - - QLayout::SetDefaultConstraint - - - - - QFormLayout::AllNonFixedFieldsGrow - - - - - - Bitstream Charter - 75 - true - - - - X-Axis - - - - - - - Plot Type: - - - - - - - - - - Data Size: - - - - - - - seconds - - - 5000 - - - 30 - - - 300 - - - - - - - Update Interval: - - - - - - - ms - - - 10 - - - 30000 - - - 500 - - - 1000 - - - - - - - - Bitstream Charter - 75 - true - - - - Plot curves - - - - - - - UAVObject: - - - - - - - - - - UAVField: - - - - - - - - - - Color: - - - - - - - Choose - - - - - - - Scale: - - - - - - - false - - - - - - - - - QLayout::SetFixedSize - - - - - Qt::Vertical - - - - 20 - 100 - - - - - - - - Add a new curve to the scope, or update it if the UAVObject and UAVField is the same. - - - Add -Update - - - - - - - Remove the curve from the scope. - - - Remove - - - - - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 15 - - - - - - - - - - - - Qt::Vertical - - - - 0 - 200 - - - - - - - - QAbstractItemView::SelectItems - - - 100 - - - - - - - - - - - - - - - - - Log data to csv file - - - - - - - New file on connect - - - - - - - - - Logging path - - - - - - - - 0 - 0 - - - - - - - - - - - - - - - Utils::PathChooser - QWidget -
utils/pathchooser.h
- 1 -
-
- - -
+ + + ScopeGadgetOptionsPage + + + + 0 + 0 + 550 + 405 + + + + Form + + + + + + QLayout::SetDefaultConstraint + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + + Bitstream Charter + 75 + true + + + + X-Axis + + + + + + + Plot Type: + + + + + + + + + + Data Size: + + + + + + + seconds + + + 5000 + + + 30 + + + 300 + + + + + + + Update Interval: + + + + + + + ms + + + 10 + + + 30000 + + + 500 + + + 1000 + + + + + + + + Bitstream Charter + 75 + true + + + + Plot curves + + + + + + + UAVObject: + + + + + + + + + + UAVField: + + + + + + + + + + Color: + + + + + + + Choose + + + + + + + Scale: + + + + + + + false + + + + + + + + + QLayout::SetFixedSize + + + + + Qt::Vertical + + + + 20 + 100 + + + + + + + + Add a new curve to the scope, or update it if the UAVObject and UAVField is the same. + + + Add +Update + + + + + + + Remove the curve from the scope. + + + Remove + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 15 + + + + + + + + + + + + Qt::Vertical + + + + 0 + 200 + + + + + + + + QAbstractItemView::SelectItems + + + 100 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Log data to csv file + + + + + + + New file on connect + + + + + + + + + Logging path + + + + + + + + 0 + 0 + + + + + + + + + + + Utils::PathChooser + QWidget +
utils/pathchooser.h
+ 1 +
+
+ + +
From 314f59694025f0e0ca8534757e4ddeb21f588263 Mon Sep 17 00:00:00 2001 From: dankers Date: Fri, 10 Jun 2011 21:40:30 +1000 Subject: [PATCH 30/33] Update to Ed's PFD from London Flyer, adds slight look and feel improvments and removes the orange look. Uses some look and feel from Guy's work also. --- artwork/PFD/pfd.svg | 2199 +++++++++++------ .../share/openpilotgcs/pfd/default/pfd.svg | 2199 +++++++++++------ 2 files changed, 2910 insertions(+), 1488 deletions(-) diff --git a/artwork/PFD/pfd.svg b/artwork/PFD/pfd.svg index a5daa9575..9a732388f 100755 --- a/artwork/PFD/pfd.svg +++ b/artwork/PFD/pfd.svg @@ -14,7 +14,7 @@ height="707.56323" id="svg2" version="1.1" - inkscape:version="0.47 r22583" + inkscape:version="0.48.1 " sodipodi:docname="pfd.svg" style="display:inline" inkscape:export-filename="H:\Documents\Hobbies\OpenPilot\SVN\artwork\PFD-2.png" @@ -1561,6 +1561,52 @@ inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> + + + + + + + - - - - - - - - - - - - - - 20 - 20 - - - - 10 - 10 - - - - 10 - 10 - - - - 20 - 20 - + transform="matrix(4.6362185,0,0,1.5267412,-1475.4746,-169.05952)" + id="g4280"> + + + + 10 + 10 + + + + + 20 + 20 + + + + + -10 + -10 + + + + + + + + + + + + + + + + + + + -20 + -20 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2094,141 +2075,598 @@ id="tspan4328" sodipodi:role="line">GPS - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + inkscape:label="#g5089"> + id="angle-3"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + id="g7953"> + + + + + + + + + + + + + + + + + + + + inkscape:label="#path3779-1" + inkscape:connector-curvature="0" /> + inkscape:label="#path3779-7" + inkscape:connector-curvature="0" /> + id="path4216" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3.06858087;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + d="m 280.28409,30.123177 5.7832,0 7.54688,11.08789 0,-11.08789 5.83789,0 0,20.042968 -5.83789,0 -7.50586,-11.005859 0,11.005859 -5.82422,0 z" + inkscape:connector-curvature="0" /> + id="path6986" + inkscape:connector-curvature="0" /> + d="m -217.0715,43.535286 5.89258,-0.369141 c 0.12759,0.957038 0.38736,1.686204 0.77929,2.1875 0.63801,0.811202 1.54947,1.216801 2.73438,1.216797 0.8841,4e-6 1.56542,-0.207353 2.04394,-0.62207 0.47851,-0.414709 0.71776,-0.895503 0.71778,-1.442383 -2e-5,-0.519525 -0.22788,-0.984368 -0.6836,-1.394531 -0.45574,-0.410149 -1.51303,-0.797518 -3.17187,-1.16211 -2.71616,-0.610668 -4.653,-1.421865 -5.81055,-2.433593 -1.16667,-1.011707 -1.75,-2.30142 -1.75,-3.869141 0,-1.029932 0.2985,-2.002913 0.89551,-2.918945 0.597,-0.915998 1.49479,-1.636049 2.69336,-2.160156 1.19856,-0.524069 2.84146,-0.786113 4.92871,-0.786133 2.56118,2e-5 4.51398,0.476257 5.8584,1.428711 1.34438,0.952492 2.14418,2.46779 2.39941,4.545898 l -5.83789,0.341797 c -0.15496,-0.902329 -0.48081,-1.558578 -0.97754,-1.96875 -0.49675,-0.41014 -1.18263,-0.615218 -2.05762,-0.615234 -0.72006,1.6e-5 -1.26237,0.152685 -1.62695,0.458007 -0.36459,0.305355 -0.54688,0.676774 -0.54687,1.114258 -1e-5,0.319025 0.15038,0.606134 0.45117,0.861328 0.29166,0.264337 0.98436,0.510431 2.07812,0.738282 2.70702,0.583346 4.64615,1.173514 5.81739,1.770507 1.1712,0.597017 2.02342,1.337576 2.55664,2.22168 0.53318,0.884123 0.79978,1.873055 0.7998,2.966797 -2e-5,1.285161 -0.35549,2.470056 -1.06641,3.554687 -0.71095,1.084638 -1.70444,1.907228 -2.98046,2.467774 -1.27606,0.560547 -2.88478,0.84082 -4.82618,0.84082 -3.40886,0 -5.76953,-0.656249 -7.08203,-1.96875 -1.3125,-1.312497 -2.05534,-2.980464 -2.22851,-5.003906 z" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" /> + d="m 778.62402,43.535286 5.89258,-0.369141 c 0.1276,0.957038 0.38736,1.686204 0.7793,2.1875 0.63801,0.811202 1.54947,1.216801 2.73437,1.216797 0.88411,4e-6 1.56542,-0.207353 2.04395,-0.62207 0.4785,-0.414709 0.71776,-0.895503 0.71777,-1.442383 -1e-5,-0.519525 -0.22788,-0.984368 -0.68359,-1.394531 -0.45574,-0.410149 -1.51303,-0.797518 -3.17188,-1.16211 -2.71615,-0.610668 -4.653,-1.421865 -5.81054,-2.433593 -1.16667,-1.011707 -1.75001,-2.30142 -1.75,-3.869141 -10e-6,-1.029932 0.2985,-2.002913 0.8955,-2.918945 0.59701,-0.915998 1.49479,-1.636049 2.69336,-2.160156 1.19856,-0.524069 2.84147,-0.786113 4.92871,-0.786133 2.56119,2e-5 4.51399,0.476257 5.8584,1.428711 1.34439,0.952492 2.14419,2.46779 2.39942,4.545898 l -5.83789,0.341797 c -0.15496,-0.902329 -0.48081,-1.558578 -0.97754,-1.96875 -0.49676,-0.41014 -1.18263,-0.615218 -2.05762,-0.615234 -0.72006,1.6e-5 -1.26238,0.152685 -1.62695,0.458007 -0.36459,0.305355 -0.54689,0.676774 -0.54688,1.114258 -1e-5,0.319025 0.15039,0.606134 0.45117,0.861328 0.29166,0.264337 0.98437,0.510431 2.07813,0.738282 2.70702,0.583346 4.64614,1.173514 5.81738,1.770507 1.17121,0.597017 2.02342,1.337576 2.55664,2.22168 0.53319,0.884123 0.79979,1.873055 0.79981,2.966797 -2e-5,1.285161 -0.35549,2.470056 -1.06641,3.554687 -0.71095,1.084638 -1.70444,1.907228 -2.98047,2.467774 -1.27605,0.560547 -2.88478,0.84082 -4.82617,0.84082 -3.40886,0 -5.76954,-0.656249 -7.08203,-1.96875 -1.3125,-1.312497 -2.05534,-2.980464 -2.22852,-5.003906 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + d="m 26.930511,30.123177 5.878907,0 2.11914,11.197265 3.089844,-11.197265 5.865234,0 3.103516,11.197265 2.119141,-11.197265 5.851562,0 -4.416015,20.042968 -6.070313,0 -3.513672,-12.61914 -3.5,12.61914 -6.070312,0 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + d="m 530.34277,30.123177 16.59766,0 0,4.279296 -10.39063,0 0,3.185547 9.63868,0 0,4.087891 -9.63868,0 0,3.951172 10.69141,0 0,4.539062 -16.89844,0 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3048" + inkscape:connector-curvature="0" /> + id="path3651" + inkscape:connector-curvature="0" /> + id="path3653" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3656" + inkscape:connector-curvature="0" /> + id="path3658" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3661" + inkscape:connector-curvature="0" /> + id="path3663" + inkscape:connector-curvature="0" /> + id="path3056" + inkscape:connector-curvature="0" /> + id="path3666" + inkscape:connector-curvature="0" /> + id="path3668" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3671" + inkscape:connector-curvature="0" /> + id="path3673" + inkscape:connector-curvature="0" /> + id="path3060" + inkscape:connector-curvature="0" /> + id="path3676" + inkscape:connector-curvature="0" /> + id="path3678" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3681" + inkscape:connector-curvature="0" /> + id="path3683" + inkscape:connector-curvature="0" /> + id="path3685" + inkscape:connector-curvature="0" /> + id="path3924" + inkscape:connector-curvature="0" /> + id="path3688" + inkscape:connector-curvature="0" /> + id="path3690" + inkscape:connector-curvature="0" /> + id="path3692" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3695" + inkscape:connector-curvature="0" /> + id="path3697" + inkscape:connector-curvature="0" /> + id="path3699" + inkscape:connector-curvature="0" /> + id="path3940" + inkscape:connector-curvature="0" /> + id="path3702" + inkscape:connector-curvature="0" /> + id="path3704" + inkscape:connector-curvature="0" /> + id="path3706" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3709" + inkscape:connector-curvature="0" /> + id="path3711" + inkscape:connector-curvature="0" /> + id="path3713" + inkscape:connector-curvature="0" /> + id="path3956" + inkscape:connector-curvature="0" /> + id="path3716" + inkscape:connector-curvature="0" /> + id="path3718" + inkscape:connector-curvature="0" /> + id="path3720" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3723" + inkscape:connector-curvature="0" /> + id="path3725" + inkscape:connector-curvature="0" /> + id="path3727" + inkscape:connector-curvature="0" /> + id="path3972" + inkscape:connector-curvature="0" /> + id="path3730" + inkscape:connector-curvature="0" /> + id="path3732" + inkscape:connector-curvature="0" /> + id="path3734" + inkscape:connector-curvature="0" /> + id="path4052" + inkscape:connector-curvature="0" /> + id="path3737" + inkscape:connector-curvature="0" /> + id="path3739" + inkscape:connector-curvature="0" /> + id="path3741" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3744" + inkscape:connector-curvature="0" /> + id="path3746" + inkscape:connector-curvature="0" /> + id="path3748" + inkscape:connector-curvature="0" /> + id="path4068" + inkscape:connector-curvature="0" /> + id="path3751" + inkscape:connector-curvature="0" /> + id="path3753" + inkscape:connector-curvature="0" /> + id="path3755" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3758" + inkscape:connector-curvature="0" /> + id="path3760" + inkscape:connector-curvature="0" /> + id="path3762" + inkscape:connector-curvature="0" /> + id="path4084" + inkscape:connector-curvature="0" /> + id="path3765" + inkscape:connector-curvature="0" /> + id="path3767" + inkscape:connector-curvature="0" /> + id="path3769" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3772" + inkscape:connector-curvature="0" /> + id="path3774" + inkscape:connector-curvature="0" /> + id="path3776" + inkscape:connector-curvature="0" /> + id="path4100" + inkscape:connector-curvature="0" /> + id="path3780" + inkscape:connector-curvature="0" /> + id="path3782" + inkscape:connector-curvature="0" /> + id="path3784" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3787" + inkscape:connector-curvature="0" /> + id="path3789" + inkscape:connector-curvature="0" /> + id="path3791" + inkscape:connector-curvature="0" /> + id="path4116" + inkscape:connector-curvature="0" /> + id="path3794" + inkscape:connector-curvature="0" /> + id="path3796" + inkscape:connector-curvature="0" /> + id="path3798" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3801" + inkscape:connector-curvature="0" /> + id="path3803" + inkscape:connector-curvature="0" /> + id="path3805" + inkscape:connector-curvature="0" /> + id="path4228" + inkscape:connector-curvature="0" /> + id="path3809" + inkscape:connector-curvature="0" /> + id="path3811" + inkscape:connector-curvature="0" /> + id="path3813" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3816" + inkscape:connector-curvature="0" /> + id="path3818" + inkscape:connector-curvature="0" /> + id="path3820" + inkscape:connector-curvature="0" /> + id="path4244" + inkscape:connector-curvature="0" /> + id="path3823" + inkscape:connector-curvature="0" /> + id="path3825" + inkscape:connector-curvature="0" /> + id="path3827" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3830" + inkscape:connector-curvature="0" /> + id="path3832" + inkscape:connector-curvature="0" /> + id="path3834" + inkscape:connector-curvature="0" /> + id="path4260" + inkscape:connector-curvature="0" /> + id="path3837" + inkscape:connector-curvature="0" /> + id="path3839" + inkscape:connector-curvature="0" /> + id="path3841" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3844" + inkscape:connector-curvature="0" /> + id="path3846" + inkscape:connector-curvature="0" /> + id="path3848" + inkscape:connector-curvature="0" /> + id="path3306" + inkscape:connector-curvature="0" /> + id="path3851" + inkscape:connector-curvature="0" /> + id="path3853" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3856" + inkscape:connector-curvature="0" /> + id="path3858" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + id="path4116-9" + inkscape:connector-curvature="0" /> + id="path3794-8" + inkscape:connector-curvature="0" /> + id="path3796-8" + inkscape:connector-curvature="0" /> + id="path3798-2" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3801-1" + inkscape:connector-curvature="0" /> + id="path3803-7" + inkscape:connector-curvature="0" /> + id="path3805-1" + inkscape:connector-curvature="0" /> + id="path4228-5" + inkscape:connector-curvature="0" /> + id="path3809-7" + inkscape:connector-curvature="0" /> + id="path3811-6" + inkscape:connector-curvature="0" /> + id="path3813-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3816-2" + inkscape:connector-curvature="0" /> + id="path3818-2" + inkscape:connector-curvature="0" /> + id="path3820-1" + inkscape:connector-curvature="0" /> + id="path4244-8" + inkscape:connector-curvature="0" /> + id="path3823-7" + inkscape:connector-curvature="0" /> + id="path3825-6" + inkscape:connector-curvature="0" /> + id="path3827-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3830-7" + inkscape:connector-curvature="0" /> + id="path3832-9" + inkscape:connector-curvature="0" /> + id="path3834-5" + inkscape:connector-curvature="0" /> + id="path4260-3" + inkscape:connector-curvature="0" /> + id="path3837-2" + inkscape:connector-curvature="0" /> + id="path3839-3" + inkscape:connector-curvature="0" /> + id="path3841-3" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3844-3" + inkscape:connector-curvature="0" /> + id="path3846-8" + inkscape:connector-curvature="0" /> + id="path3848-7" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3681-1" + inkscape:connector-curvature="0" /> + id="path3683-9" + inkscape:connector-curvature="0" /> + id="path3685-8" + inkscape:connector-curvature="0" /> + id="path3924-5" + inkscape:connector-curvature="0" /> + id="path3688-2" + inkscape:connector-curvature="0" /> + id="path3690-8" + inkscape:connector-curvature="0" /> + id="path3692-6" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3695-8" + inkscape:connector-curvature="0" /> + id="path3697-6" + inkscape:connector-curvature="0" /> + id="path3699-5" + inkscape:connector-curvature="0" /> + id="path3940-9" + inkscape:connector-curvature="0" /> + id="path3702-0" + inkscape:connector-curvature="0" /> + id="path3704-6" + inkscape:connector-curvature="0" /> + id="path3706-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3709-3" + inkscape:connector-curvature="0" /> + id="path3711-4" + inkscape:connector-curvature="0" /> + id="path3713-4" + inkscape:connector-curvature="0" /> + id="path3956-0" + inkscape:connector-curvature="0" /> + id="path3716-6" + inkscape:connector-curvature="0" /> + id="path3718-1" + inkscape:connector-curvature="0" /> + id="path3720-8" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3723-3" + inkscape:connector-curvature="0" /> + id="path3725-7" + inkscape:connector-curvature="0" /> + id="path3727-8" + inkscape:connector-curvature="0" /> + id="path3972-2" + inkscape:connector-curvature="0" /> + id="path3730-1" + inkscape:connector-curvature="0" /> + id="path3732-3" + inkscape:connector-curvature="0" /> + id="path3734-5" + inkscape:connector-curvature="0" /> @@ -3570,7 +4208,8 @@ inkscape:groupmode="layer" id="layer6" inkscape:label="Bottom area" - style="display:inline"> + style="display:none" + sodipodi:insensitive="true"> + id="path10183" + inkscape:connector-curvature="0" /> + id="path10185" + inkscape:connector-curvature="0" /> @@ -3630,19 +4271,22 @@ id="gcstelemetry-Connected" d="m -109.55949,412.40842 0,9.28125 -31.40625,0 0,4.90625 0,0.0937 0,4.90625 31.40625,0 0,9.28125 14.250003,-14.25 -14.250003,-14.21875 z" style="fill:#1c870b;fill-opacity:1;stroke:#113b05;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - inkscape:label="#path7548" /> + inkscape:label="#path7548" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="ccccccccccccccccc" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cccccccccc" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#1c5313;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#1c5313;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:connector-curvature="0" /> + id="path5044" + inkscape:connector-curvature="0" /> + id="path5046" + inkscape:connector-curvature="0" /> + id="path4035" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4039" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4043" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4061" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4065" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4071" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4075" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4079" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4085" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4089" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4095" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4099" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4103" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4109" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4113" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4119" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5650" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5654" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5658" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5662" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5666" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5670" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5674" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5678" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5682" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5686" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5690" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5694" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5698" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5702" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5706" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> @@ -4020,6 +4730,7 @@ style="fill:#453e3e;fill-opacity:1;stroke:#000000;stroke-width:4.08031273;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m -115.54603,-47.690059 c -2.50791,0 -4.54785,1.99743 -4.54785,4.50534 l 0,807.009359 c 0,2.5079 2.03994,4.54785 4.54785,4.54785 l 807.00936,0 c 2.5079,0 4.50534,-2.03995 4.50534,-4.54785 l 0,-807.009359 c 0,-2.50791 -1.99744,-4.50534 -4.50534,-4.50534 l -807.00936,0 z M 289.34,11.395534 c 150.15374,0 271.88009,59.618647 272.02085,133.162706 l 0.21252,48.57516 -0.38253,374.99409 C 556.30557,639.62843 436.47945,673.69951 289.34,673.69951 c -147.13944,0 -266.965544,-34.07108 -271.850832,-105.57202 l -0.212516,0 0,-374.99409 0.0425,-48.58122 C 17.459912,71.008115 139.18627,11.395534 289.34,11.395534 z" id="rect2816" - sodipodi:nodetypes="cccccccccccccsccccc" /> + sodipodi:nodetypes="cccccccccccccsccccc" + inkscape:connector-curvature="0" /> diff --git a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg index a5daa9575..9a732388f 100755 --- a/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg +++ b/ground/openpilotgcs/share/openpilotgcs/pfd/default/pfd.svg @@ -14,7 +14,7 @@ height="707.56323" id="svg2" version="1.1" - inkscape:version="0.47 r22583" + inkscape:version="0.48.1 " sodipodi:docname="pfd.svg" style="display:inline" inkscape:export-filename="H:\Documents\Hobbies\OpenPilot\SVN\artwork\PFD-2.png" @@ -1561,6 +1561,52 @@ inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> + + + + + + + - - - - - - - - - - - - - - 20 - 20 - - - - 10 - 10 - - - - 10 - 10 - - - - 20 - 20 - + transform="matrix(4.6362185,0,0,1.5267412,-1475.4746,-169.05952)" + id="g4280"> + + + + 10 + 10 + + + + + 20 + 20 + + + + + -10 + -10 + + + + + + + + + + + + + + + + + + + -20 + -20 + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2094,141 +2075,598 @@ id="tspan4328" sodipodi:role="line">GPS - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + inkscape:label="#g5089"> + id="angle-3"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + id="g7953"> + + + + + + + + + + + + + + + + + + + + inkscape:label="#path3779-1" + inkscape:connector-curvature="0" /> + inkscape:label="#path3779-7" + inkscape:connector-curvature="0" /> + id="path4216" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3.06858087;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + d="m 280.28409,30.123177 5.7832,0 7.54688,11.08789 0,-11.08789 5.83789,0 0,20.042968 -5.83789,0 -7.50586,-11.005859 0,11.005859 -5.82422,0 z" + inkscape:connector-curvature="0" /> + id="path6986" + inkscape:connector-curvature="0" /> + d="m -217.0715,43.535286 5.89258,-0.369141 c 0.12759,0.957038 0.38736,1.686204 0.77929,2.1875 0.63801,0.811202 1.54947,1.216801 2.73438,1.216797 0.8841,4e-6 1.56542,-0.207353 2.04394,-0.62207 0.47851,-0.414709 0.71776,-0.895503 0.71778,-1.442383 -2e-5,-0.519525 -0.22788,-0.984368 -0.6836,-1.394531 -0.45574,-0.410149 -1.51303,-0.797518 -3.17187,-1.16211 -2.71616,-0.610668 -4.653,-1.421865 -5.81055,-2.433593 -1.16667,-1.011707 -1.75,-2.30142 -1.75,-3.869141 0,-1.029932 0.2985,-2.002913 0.89551,-2.918945 0.597,-0.915998 1.49479,-1.636049 2.69336,-2.160156 1.19856,-0.524069 2.84146,-0.786113 4.92871,-0.786133 2.56118,2e-5 4.51398,0.476257 5.8584,1.428711 1.34438,0.952492 2.14418,2.46779 2.39941,4.545898 l -5.83789,0.341797 c -0.15496,-0.902329 -0.48081,-1.558578 -0.97754,-1.96875 -0.49675,-0.41014 -1.18263,-0.615218 -2.05762,-0.615234 -0.72006,1.6e-5 -1.26237,0.152685 -1.62695,0.458007 -0.36459,0.305355 -0.54688,0.676774 -0.54687,1.114258 -1e-5,0.319025 0.15038,0.606134 0.45117,0.861328 0.29166,0.264337 0.98436,0.510431 2.07812,0.738282 2.70702,0.583346 4.64615,1.173514 5.81739,1.770507 1.1712,0.597017 2.02342,1.337576 2.55664,2.22168 0.53318,0.884123 0.79978,1.873055 0.7998,2.966797 -2e-5,1.285161 -0.35549,2.470056 -1.06641,3.554687 -0.71095,1.084638 -1.70444,1.907228 -2.98046,2.467774 -1.27606,0.560547 -2.88478,0.84082 -4.82618,0.84082 -3.40886,0 -5.76953,-0.656249 -7.08203,-1.96875 -1.3125,-1.312497 -2.05534,-2.980464 -2.22851,-5.003906 z" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cc" + inkscape:connector-curvature="0" /> + d="m 778.62402,43.535286 5.89258,-0.369141 c 0.1276,0.957038 0.38736,1.686204 0.7793,2.1875 0.63801,0.811202 1.54947,1.216801 2.73437,1.216797 0.88411,4e-6 1.56542,-0.207353 2.04395,-0.62207 0.4785,-0.414709 0.71776,-0.895503 0.71777,-1.442383 -1e-5,-0.519525 -0.22788,-0.984368 -0.68359,-1.394531 -0.45574,-0.410149 -1.51303,-0.797518 -3.17188,-1.16211 -2.71615,-0.610668 -4.653,-1.421865 -5.81054,-2.433593 -1.16667,-1.011707 -1.75001,-2.30142 -1.75,-3.869141 -10e-6,-1.029932 0.2985,-2.002913 0.8955,-2.918945 0.59701,-0.915998 1.49479,-1.636049 2.69336,-2.160156 1.19856,-0.524069 2.84147,-0.786113 4.92871,-0.786133 2.56119,2e-5 4.51399,0.476257 5.8584,1.428711 1.34439,0.952492 2.14419,2.46779 2.39942,4.545898 l -5.83789,0.341797 c -0.15496,-0.902329 -0.48081,-1.558578 -0.97754,-1.96875 -0.49676,-0.41014 -1.18263,-0.615218 -2.05762,-0.615234 -0.72006,1.6e-5 -1.26238,0.152685 -1.62695,0.458007 -0.36459,0.305355 -0.54689,0.676774 -0.54688,1.114258 -1e-5,0.319025 0.15039,0.606134 0.45117,0.861328 0.29166,0.264337 0.98437,0.510431 2.07813,0.738282 2.70702,0.583346 4.64614,1.173514 5.81738,1.770507 1.17121,0.597017 2.02342,1.337576 2.55664,2.22168 0.53319,0.884123 0.79979,1.873055 0.79981,2.966797 -2e-5,1.285161 -0.35549,2.470056 -1.06641,3.554687 -0.71095,1.084638 -1.70444,1.907228 -2.98047,2.467774 -1.27605,0.560547 -2.88478,0.84082 -4.82617,0.84082 -3.40886,0 -5.76954,-0.656249 -7.08203,-1.96875 -1.3125,-1.312497 -2.05534,-2.980464 -2.22852,-5.003906 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + d="m 26.930511,30.123177 5.878907,0 2.11914,11.197265 3.089844,-11.197265 5.865234,0 3.103516,11.197265 2.119141,-11.197265 5.851562,0 -4.416015,20.042968 -6.070313,0 -3.513672,-12.61914 -3.5,12.61914 -6.070312,0 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + d="m 530.34277,30.123177 16.59766,0 0,4.279296 -10.39063,0 0,3.185547 9.63868,0 0,4.087891 -9.63868,0 0,3.951172 10.69141,0 0,4.539062 -16.89844,0 z" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3048" + inkscape:connector-curvature="0" /> + id="path3651" + inkscape:connector-curvature="0" /> + id="path3653" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3656" + inkscape:connector-curvature="0" /> + id="path3658" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3661" + inkscape:connector-curvature="0" /> + id="path3663" + inkscape:connector-curvature="0" /> + id="path3056" + inkscape:connector-curvature="0" /> + id="path3666" + inkscape:connector-curvature="0" /> + id="path3668" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3671" + inkscape:connector-curvature="0" /> + id="path3673" + inkscape:connector-curvature="0" /> + id="path3060" + inkscape:connector-curvature="0" /> + id="path3676" + inkscape:connector-curvature="0" /> + id="path3678" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3681" + inkscape:connector-curvature="0" /> + id="path3683" + inkscape:connector-curvature="0" /> + id="path3685" + inkscape:connector-curvature="0" /> + id="path3924" + inkscape:connector-curvature="0" /> + id="path3688" + inkscape:connector-curvature="0" /> + id="path3690" + inkscape:connector-curvature="0" /> + id="path3692" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3695" + inkscape:connector-curvature="0" /> + id="path3697" + inkscape:connector-curvature="0" /> + id="path3699" + inkscape:connector-curvature="0" /> + id="path3940" + inkscape:connector-curvature="0" /> + id="path3702" + inkscape:connector-curvature="0" /> + id="path3704" + inkscape:connector-curvature="0" /> + id="path3706" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3709" + inkscape:connector-curvature="0" /> + id="path3711" + inkscape:connector-curvature="0" /> + id="path3713" + inkscape:connector-curvature="0" /> + id="path3956" + inkscape:connector-curvature="0" /> + id="path3716" + inkscape:connector-curvature="0" /> + id="path3718" + inkscape:connector-curvature="0" /> + id="path3720" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3723" + inkscape:connector-curvature="0" /> + id="path3725" + inkscape:connector-curvature="0" /> + id="path3727" + inkscape:connector-curvature="0" /> + id="path3972" + inkscape:connector-curvature="0" /> + id="path3730" + inkscape:connector-curvature="0" /> + id="path3732" + inkscape:connector-curvature="0" /> + id="path3734" + inkscape:connector-curvature="0" /> + id="path4052" + inkscape:connector-curvature="0" /> + id="path3737" + inkscape:connector-curvature="0" /> + id="path3739" + inkscape:connector-curvature="0" /> + id="path3741" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3744" + inkscape:connector-curvature="0" /> + id="path3746" + inkscape:connector-curvature="0" /> + id="path3748" + inkscape:connector-curvature="0" /> + id="path4068" + inkscape:connector-curvature="0" /> + id="path3751" + inkscape:connector-curvature="0" /> + id="path3753" + inkscape:connector-curvature="0" /> + id="path3755" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3758" + inkscape:connector-curvature="0" /> + id="path3760" + inkscape:connector-curvature="0" /> + id="path3762" + inkscape:connector-curvature="0" /> + id="path4084" + inkscape:connector-curvature="0" /> + id="path3765" + inkscape:connector-curvature="0" /> + id="path3767" + inkscape:connector-curvature="0" /> + id="path3769" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3772" + inkscape:connector-curvature="0" /> + id="path3774" + inkscape:connector-curvature="0" /> + id="path3776" + inkscape:connector-curvature="0" /> + id="path4100" + inkscape:connector-curvature="0" /> + id="path3780" + inkscape:connector-curvature="0" /> + id="path3782" + inkscape:connector-curvature="0" /> + id="path3784" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3787" + inkscape:connector-curvature="0" /> + id="path3789" + inkscape:connector-curvature="0" /> + id="path3791" + inkscape:connector-curvature="0" /> + id="path4116" + inkscape:connector-curvature="0" /> + id="path3794" + inkscape:connector-curvature="0" /> + id="path3796" + inkscape:connector-curvature="0" /> + id="path3798" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3801" + inkscape:connector-curvature="0" /> + id="path3803" + inkscape:connector-curvature="0" /> + id="path3805" + inkscape:connector-curvature="0" /> + id="path4228" + inkscape:connector-curvature="0" /> + id="path3809" + inkscape:connector-curvature="0" /> + id="path3811" + inkscape:connector-curvature="0" /> + id="path3813" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3816" + inkscape:connector-curvature="0" /> + id="path3818" + inkscape:connector-curvature="0" /> + id="path3820" + inkscape:connector-curvature="0" /> + id="path4244" + inkscape:connector-curvature="0" /> + id="path3823" + inkscape:connector-curvature="0" /> + id="path3825" + inkscape:connector-curvature="0" /> + id="path3827" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3830" + inkscape:connector-curvature="0" /> + id="path3832" + inkscape:connector-curvature="0" /> + id="path3834" + inkscape:connector-curvature="0" /> + id="path4260" + inkscape:connector-curvature="0" /> + id="path3837" + inkscape:connector-curvature="0" /> + id="path3839" + inkscape:connector-curvature="0" /> + id="path3841" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3844" + inkscape:connector-curvature="0" /> + id="path3846" + inkscape:connector-curvature="0" /> + id="path3848" + inkscape:connector-curvature="0" /> + id="path3306" + inkscape:connector-curvature="0" /> + id="path3851" + inkscape:connector-curvature="0" /> + id="path3853" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3856" + inkscape:connector-curvature="0" /> + id="path3858" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + id="path4116-9" + inkscape:connector-curvature="0" /> + id="path3794-8" + inkscape:connector-curvature="0" /> + id="path3796-8" + inkscape:connector-curvature="0" /> + id="path3798-2" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3801-1" + inkscape:connector-curvature="0" /> + id="path3803-7" + inkscape:connector-curvature="0" /> + id="path3805-1" + inkscape:connector-curvature="0" /> + id="path4228-5" + inkscape:connector-curvature="0" /> + id="path3809-7" + inkscape:connector-curvature="0" /> + id="path3811-6" + inkscape:connector-curvature="0" /> + id="path3813-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3816-2" + inkscape:connector-curvature="0" /> + id="path3818-2" + inkscape:connector-curvature="0" /> + id="path3820-1" + inkscape:connector-curvature="0" /> + id="path4244-8" + inkscape:connector-curvature="0" /> + id="path3823-7" + inkscape:connector-curvature="0" /> + id="path3825-6" + inkscape:connector-curvature="0" /> + id="path3827-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3830-7" + inkscape:connector-curvature="0" /> + id="path3832-9" + inkscape:connector-curvature="0" /> + id="path3834-5" + inkscape:connector-curvature="0" /> + id="path4260-3" + inkscape:connector-curvature="0" /> + id="path3837-2" + inkscape:connector-curvature="0" /> + id="path3839-3" + inkscape:connector-curvature="0" /> + id="path3841-3" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3844-3" + inkscape:connector-curvature="0" /> + id="path3846-8" + inkscape:connector-curvature="0" /> + id="path3848-7" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3681-1" + inkscape:connector-curvature="0" /> + id="path3683-9" + inkscape:connector-curvature="0" /> + id="path3685-8" + inkscape:connector-curvature="0" /> + id="path3924-5" + inkscape:connector-curvature="0" /> + id="path3688-2" + inkscape:connector-curvature="0" /> + id="path3690-8" + inkscape:connector-curvature="0" /> + id="path3692-6" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3695-8" + inkscape:connector-curvature="0" /> + id="path3697-6" + inkscape:connector-curvature="0" /> + id="path3699-5" + inkscape:connector-curvature="0" /> + id="path3940-9" + inkscape:connector-curvature="0" /> + id="path3702-0" + inkscape:connector-curvature="0" /> + id="path3704-6" + inkscape:connector-curvature="0" /> + id="path3706-1" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3709-3" + inkscape:connector-curvature="0" /> + id="path3711-4" + inkscape:connector-curvature="0" /> + id="path3713-4" + inkscape:connector-curvature="0" /> + id="path3956-0" + inkscape:connector-curvature="0" /> + id="path3716-6" + inkscape:connector-curvature="0" /> + id="path3718-1" + inkscape:connector-curvature="0" /> + id="path3720-8" + inkscape:connector-curvature="0" /> + style="fill:#ffffff;fill-opacity:1;stroke:#fff8f8;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path3723-3" + inkscape:connector-curvature="0" /> + id="path3725-7" + inkscape:connector-curvature="0" /> + id="path3727-8" + inkscape:connector-curvature="0" /> + id="path3972-2" + inkscape:connector-curvature="0" /> + id="path3730-1" + inkscape:connector-curvature="0" /> + id="path3732-3" + inkscape:connector-curvature="0" /> + id="path3734-5" + inkscape:connector-curvature="0" /> @@ -3570,7 +4208,8 @@ inkscape:groupmode="layer" id="layer6" inkscape:label="Bottom area" - style="display:inline"> + style="display:none" + sodipodi:insensitive="true"> + id="path10183" + inkscape:connector-curvature="0" /> + id="path10185" + inkscape:connector-curvature="0" /> @@ -3630,19 +4271,22 @@ id="gcstelemetry-Connected" d="m -109.55949,412.40842 0,9.28125 -31.40625,0 0,4.90625 0,0.0937 0,4.90625 31.40625,0 0,9.28125 14.250003,-14.25 -14.250003,-14.21875 z" style="fill:#1c870b;fill-opacity:1;stroke:#113b05;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" - inkscape:label="#path7548" /> + inkscape:label="#path7548" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="ccccccccccccccccc" + inkscape:connector-curvature="0" /> + sodipodi:nodetypes="cccccccccc" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#1c5313;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#1c5313;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + inkscape:connector-curvature="0" /> + id="path5044" + inkscape:connector-curvature="0" /> + id="path5046" + inkscape:connector-curvature="0" /> + id="path4035" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4039" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4043" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4061" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4065" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4071" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4075" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4079" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4085" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4089" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4095" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4099" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4103" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4109" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4113" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path4119" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5650" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5654" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5658" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5662" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5666" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5670" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5674" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5678" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5682" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5686" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5690" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5694" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5698" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5702" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:2.10024118;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> + id="path5706" + inkscape:connector-curvature="0" /> + style="fill:none;stroke:#ffffff;stroke-width:3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" + inkscape:connector-curvature="0" /> @@ -4020,6 +4730,7 @@ style="fill:#453e3e;fill-opacity:1;stroke:#000000;stroke-width:4.08031273;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m -115.54603,-47.690059 c -2.50791,0 -4.54785,1.99743 -4.54785,4.50534 l 0,807.009359 c 0,2.5079 2.03994,4.54785 4.54785,4.54785 l 807.00936,0 c 2.5079,0 4.50534,-2.03995 4.50534,-4.54785 l 0,-807.009359 c 0,-2.50791 -1.99744,-4.50534 -4.50534,-4.50534 l -807.00936,0 z M 289.34,11.395534 c 150.15374,0 271.88009,59.618647 272.02085,133.162706 l 0.21252,48.57516 -0.38253,374.99409 C 556.30557,639.62843 436.47945,673.69951 289.34,673.69951 c -147.13944,0 -266.965544,-34.07108 -271.850832,-105.57202 l -0.212516,0 0,-374.99409 0.0425,-48.58122 C 17.459912,71.008115 139.18627,11.395534 289.34,11.395534 z" id="rect2816" - sodipodi:nodetypes="cccccccccccccsccccc" /> + sodipodi:nodetypes="cccccccccccccsccccc" + inkscape:connector-curvature="0" /> From d9607c44d8ad0508e40737fd3c3461197b783c14 Mon Sep 17 00:00:00 2001 From: dankers Date: Fri, 10 Jun 2011 23:51:01 +1000 Subject: [PATCH 31/33] Minor update from London flyer, readability on smaller screens improvement --- artwork/PFD/pfd.svg | 95 ++++++++----------- .../share/openpilotgcs/pfd/default/pfd.svg | 95 ++++++++----------- 2 files changed, 78 insertions(+), 112 deletions(-) diff --git a/artwork/PFD/pfd.svg b/artwork/PFD/pfd.svg index 9a732388f..6313bf1df 100755 --- a/artwork/PFD/pfd.svg +++ b/artwork/PFD/pfd.svg @@ -1616,8 +1616,8 @@ inkscape:pageopacity="0.0" inkscape:pageshadow="2" inkscape:zoom="0.73067675" - inkscape:cx="362.05822" - inkscape:cy="335.39415" + inkscape:cx="305.98471" + inkscape:cy="372.16908" inkscape:document-units="px" inkscape:current-layer="layer3" showgrid="false" @@ -2077,7 +2077,7 @@ + inkscape:label="#g4670"> - - - - + width="110.05586" + height="450" + x="-147.23766" + y="131.33096" /> + - @@ -2693,24 +2680,20 @@ inkscape:connector-curvature="0" /> - - - - + inkscape:label="#g4577"> + + + inkscape:label="#g4670"> - - - - + width="110.05586" + height="450" + x="-147.23766" + y="131.33096" /> + - @@ -2693,24 +2680,20 @@ inkscape:connector-curvature="0" /> - - - - + inkscape:label="#g4577"> + + Date: Fri, 10 Jun 2011 17:16:15 +0200 Subject: [PATCH 32/33] PiOS.posix: ported PiOS_CRC to PiOS.posix to fix compilation error on OpenPilot introduced by new dependency --- flight/OpenPilot/Makefile.posix | 1 + flight/PiOS.posix/pios.h | 1 + flight/PiOS.posix/posix/pios_crc.c | 74 ++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 flight/PiOS.posix/posix/pios_crc.c diff --git a/flight/OpenPilot/Makefile.posix b/flight/OpenPilot/Makefile.posix index 2eff6f933..050323721 100644 --- a/flight/OpenPilot/Makefile.posix +++ b/flight/OpenPilot/Makefile.posix @@ -162,6 +162,7 @@ CFLAGS_UAVOBJECTS = $(UAVOBJDEFINE) endif ## PIOS Hardware (posix) +SRC += $(PIOSPOSIX)/pios_crc.c SRC += $(PIOSPOSIX)/pios_sys.c SRC += $(PIOSPOSIX)/pios_led.c SRC += $(PIOSPOSIX)/pios_delay.c diff --git a/flight/PiOS.posix/pios.h b/flight/PiOS.posix/pios.h index 4f6266aca..a82d13b81 100644 --- a/flight/PiOS.posix/pios.h +++ b/flight/PiOS.posix/pios.h @@ -64,6 +64,7 @@ #include #include #include +#include #define NELEMENTS(x) (sizeof(x) / sizeof(*(x))) diff --git a/flight/PiOS.posix/posix/pios_crc.c b/flight/PiOS.posix/posix/pios_crc.c new file mode 100644 index 000000000..548ba2648 --- /dev/null +++ b/flight/PiOS.posix/posix/pios_crc.c @@ -0,0 +1,74 @@ +/* + * pios_crc.c + * OpenPilotOSX + * + * Created by James Cotton on 6/4/11. + * Copyright 2011 OpenPilot. All rights reserved. + * + */ + +#include "pios.h" + +// CRC lookup table +static const uint8_t crc_table[256] = { + 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, + 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, + 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, + 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, + 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, + 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, + 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, + 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, + 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, + 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, + 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, + 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, + 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, + 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, + 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, + 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3 +}; + +/** + * Update the crc value with new data. + * + * Generated by pycrc v0.7.5, http://www.tty1.net/pycrc/ + * using the configuration: + * Width = 8 + * Poly = 0x07 + * XorIn = 0x00 + * ReflectIn = False + * XorOut = 0x00 + * ReflectOut = False + * Algorithm = table-driven + * + * \param crc The current crc value. + * \param data Pointer to a buffer of \a data_len bytes. + * \param length Number of bytes in the \a data buffer. + * \return The updated crc value. + */ +uint8_t PIOS_CRC_updateByte(uint8_t crc, const uint8_t data) +{ + return crc_table[crc ^ data]; +} + +/* + * @brief Update a CRC with a data buffer + * @param[in] crc Starting CRC value + * @param[in] data Data buffer + * @param[in] length Number of bytes to process + * @returns Updated CRC + */ +uint8_t PIOS_CRC_updateCRC(uint8_t crc, const uint8_t* data, int32_t length) +{ + // use registers for speed + register int32_t len = length; + register uint8_t crc8 = crc; + register const uint8_t *p = data; + + while (len--) + crc8 = crc_table[crc8 ^ *p++]; + + return crc8; +} + From a7841a523ae338a9243de81e25c129a5a0e5d03d Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Fri, 10 Jun 2011 22:04:54 +0200 Subject: [PATCH 33/33] bugfix: forgot to add header file (pios.posix) --- flight/PiOS.posix/inc/pios_crc.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 flight/PiOS.posix/inc/pios_crc.h diff --git a/flight/PiOS.posix/inc/pios_crc.h b/flight/PiOS.posix/inc/pios_crc.h new file mode 100644 index 000000000..3a64f8bab --- /dev/null +++ b/flight/PiOS.posix/inc/pios_crc.h @@ -0,0 +1,31 @@ +/** + ****************************************************************************** + * @addtogroup PIOS PIOS Core hardware abstraction layer + * @{ + * @addtogroup PIOS_CRC CRC Functions + * @{ + * + * @file pios_crc.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010. + * @brief CRC functions header. + * @see The GNU Public License (GPL) Version 3 + * + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +uint8_t PIOS_CRC_updateByte(uint8_t crc, const uint8_t data); +uint8_t PIOS_CRC_updateCRC(uint8_t crc, const uint8_t* data, int32_t length);