From 927886bf8ecc98c8b55b3b024878c34158337282 Mon Sep 17 00:00:00 2001 From: m_thread Date: Wed, 25 Feb 2015 21:58:12 +0100 Subject: [PATCH 1/7] OP-1685 Fixed some issues in the wizard for oneshot --- .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 5 +++-- .../src/plugins/setupwizard/vehicleconfigurationhelper.h | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 7c16e6c3a..727c27b9a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -376,18 +376,19 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() bankMode = ActuatorSettings::BANKMODE_PWM; break; case VehicleConfigurationSource::ESC_RAPID: - escFrequence = RAPID_ESC_FREQUENCY; if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC || m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) && m_configSource->getInputType() == VehicleConfigurationSource::INPUT_PWM) { bankMode = ActuatorSettings::BANKMODE_PWM; + escFrequence = RAPID_ESC_FREQUENCY; } else { bankMode = ActuatorSettings::BANKMODE_PWMSYNC; + escFrequence = PWMSYNC_ESC_FREQUENCY; } break; case VehicleConfigurationSource::ESC_ONESHOT: - escFrequence = RAPID_ESC_FREQUENCY; bankMode = ActuatorSettings::BANKMODE_ONESHOT125; + escFrequence = ONESHOT_ESC_FREQUENCY; break; default: break; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index fd2d83d65..28caca77c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -59,6 +59,8 @@ public: bool setupHardwareSettings(bool save = true); static const qint16 LEGACY_ESC_FREQUENCY = 50; static const qint16 RAPID_ESC_FREQUENCY = 490; + static const qint16 PWMSYNC_ESC_FREQUENCY = 0; + static const qint16 ONESHOT_ESC_FREQUENCY = 0; static const qint16 ANALOG_SERVO_FREQUENCY = 50; static const qint16 DIGITAL_SERVO_FREQUENCY = 333; static const int MIXER_TYPE_NONE = 0; From 3ee481fd2a3e739fcb37421d682a845f321f733f Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 27 Feb 2015 22:55:50 +0100 Subject: [PATCH 2/7] OP-1754 Fixing PWMSunc PPM setting. --- .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 727c27b9a..87c89dad1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -150,7 +150,8 @@ void VehicleConfigurationHelper::applyHardwareConfiguration() data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT; break; case VehicleConfigurationSource::INPUT_PPM: - if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT) { + if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT || + m_configSource->getEscType() == VehicleConfigurationSource::ESC_RAPID) { data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN8ONESHOT; } else { data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPMNOONESHOT; From a8b6e1f959fba61f81d1534071e816ff72568558 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sat, 28 Feb 2015 00:14:51 +0100 Subject: [PATCH 3/7] OP-1755 Added additional location for cloudconfigs. --- .../pages/airframeinitialtuningpage.cpp | 23 ++++++++++++------- .../pages/airframeinitialtuningpage.h | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp index 0d279385a..86a0f553d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp @@ -169,15 +169,10 @@ bool AirframeInitialTuningPage::airframeIsCompatible(int vehicleType, int vehicl } } -void AirframeInitialTuningPage::loadValidFiles() +void AirframeInitialTuningPage::loadFilesInDir(QString templateBasePath) { - ui->templateList->clear(); - foreach(QJsonObject * templ, m_templates.values()) { - delete templ; - } - m_templates.clear(); - - QDir templateDir(QString("%1/%2/").arg(Utils::PathUtils().InsertDataPath("%%DATAPATH%%cloudconfig")).arg(m_dir)); + QDir templateDir(templateBasePath); + qDebug() << "Loading templates from base path:" << templateBasePath; QStringList names; names << "*.optmpl"; templateDir.setNameFilters(names); @@ -207,6 +202,18 @@ void AirframeInitialTuningPage::loadValidFiles() } } +void AirframeInitialTuningPage::loadValidFiles() +{ + ui->templateList->clear(); + foreach(QJsonObject * templ, m_templates.values()) { + delete templ; + } + m_templates.clear(); + + loadFilesInDir(QString("%1/%2/").arg(Utils::PathUtils().InsertDataPath("%%DATAPATH%%cloudconfig")).arg(m_dir)); + loadFilesInDir(QString("%1/%2/").arg(Utils::PathUtils().InsertStoragePath("%%STOREPATH%%cloudconfig")).arg(m_dir)); +} + void AirframeInitialTuningPage::setupTemplateList() { QListWidgetItem *item; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h index 258beb9d1..fecad62bf 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h @@ -44,7 +44,6 @@ public: void initializePage(); bool validatePage(); bool isComplete() const; - public slots: void templateSelectionChanged(); @@ -59,6 +58,7 @@ private: QGraphicsPixmapItem *m_photoItem; void loadValidFiles(); + void loadFilesInDir(QString templateBasePath); void setupTemplateList(); QString getTemplateKey(QJsonObject *templ); void updatePhoto(QJsonObject *templ); From c358f975c4f1c8b6230801a10e368f656fb49f94 Mon Sep 17 00:00:00 2001 From: m_thread Date: Sat, 28 Feb 2015 09:47:23 +0100 Subject: [PATCH 4/7] Uncrustify --- .../plugins/config/cfg_vehicletypes/configccpmwidget.cpp | 6 +++--- .../plugins/setupwizard/pages/airframeinitialtuningpage.cpp | 1 + .../src/plugins/setupwizard/vehicleconfigurationhelper.cpp | 6 +++--- .../src/plugins/setupwizard/vehicleconfigurationhelper.h | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp index 11f2aee00..a770de2dd 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configccpmwidget.cpp @@ -398,7 +398,7 @@ void ConfigCcpmWidget::UpdateType() // Clear advanced settings table if not Custom selected (Keep previous settings) if (TypeText.compare(QString::fromUtf8("Custom - Advanced Settings"), Qt::CaseInsensitive) != 0) { - m_aircraft->ccpmAdvancedSettingsTable->clearFocus(); + m_aircraft->ccpmAdvancedSettingsTable->clearFocus(); } m_aircraft->ccpmAngleW->setEnabled(TypeInt == 1); @@ -695,7 +695,7 @@ void ConfigCcpmWidget::UpdateMixer() ; } } - int TypeInt = m_aircraft->ccpmType->count() - m_aircraft->ccpmType->currentIndex() - 1; + int TypeInt = m_aircraft->ccpmType->count() - m_aircraft->ccpmType->currentIndex() - 1; if (TypeInt != 0) { // not advanced settings // get the channel data from the ui MixerChannelData[0] = m_aircraft->ccpmEngineChannel->currentIndex(); @@ -796,7 +796,7 @@ void ConfigCcpmWidget::UpdateMixer() Channel = QString((int)ConfigCcpmWidget::CHANNEL_NUMELEM + 1); } MixerChannelData[i] = Channel.toInt(); - } + } } } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp index 86a0f553d..428521e3d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp @@ -172,6 +172,7 @@ bool AirframeInitialTuningPage::airframeIsCompatible(int vehicleType, int vehicl void AirframeInitialTuningPage::loadFilesInDir(QString templateBasePath) { QDir templateDir(templateBasePath); + qDebug() << "Loading templates from base path:" << templateBasePath; QStringList names; names << "*.optmpl"; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 87c89dad1..240b520ef 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -151,7 +151,7 @@ void VehicleConfigurationHelper::applyHardwareConfiguration() break; case VehicleConfigurationSource::INPUT_PPM: if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT || - m_configSource->getEscType() == VehicleConfigurationSource::ESC_RAPID) { + m_configSource->getEscType() == VehicleConfigurationSource::ESC_RAPID) { data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN8ONESHOT; } else { data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPMNOONESHOT; @@ -380,10 +380,10 @@ void VehicleConfigurationHelper::applyActuatorConfiguration() if ((m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC || m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_CC3D) && m_configSource->getInputType() == VehicleConfigurationSource::INPUT_PWM) { - bankMode = ActuatorSettings::BANKMODE_PWM; + bankMode = ActuatorSettings::BANKMODE_PWM; escFrequence = RAPID_ESC_FREQUENCY; } else { - bankMode = ActuatorSettings::BANKMODE_PWMSYNC; + bankMode = ActuatorSettings::BANKMODE_PWMSYNC; escFrequence = PWMSYNC_ESC_FREQUENCY; } break; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h index 28caca77c..002518bf0 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.h @@ -59,8 +59,8 @@ public: bool setupHardwareSettings(bool save = true); static const qint16 LEGACY_ESC_FREQUENCY = 50; static const qint16 RAPID_ESC_FREQUENCY = 490; - static const qint16 PWMSYNC_ESC_FREQUENCY = 0; - static const qint16 ONESHOT_ESC_FREQUENCY = 0; + static const qint16 PWMSYNC_ESC_FREQUENCY = 0; + static const qint16 ONESHOT_ESC_FREQUENCY = 0; static const qint16 ANALOG_SERVO_FREQUENCY = 50; static const qint16 DIGITAL_SERVO_FREQUENCY = 333; static const int MIXER_TYPE_NONE = 0; From 1c135310431c4cda01b98ae0abff342378a0b285 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 28 Feb 2015 14:12:46 +0100 Subject: [PATCH 5/7] OP-1754 Connection diagram : Fix regression, rename GPS, airspeed sensors and rcinput objects --- .../resources/connection-diagrams.svg | 159 +++++++++--------- 1 file changed, 79 insertions(+), 80 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg index 236dbe930..eef9bb92b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg +++ b/ground/openpilotgcs/src/plugins/setupwizard/resources/connection-diagrams.svg @@ -30,13 +30,13 @@ inkscape:window-height="928" id="namedview4616" showgrid="false" - inkscape:zoom="1.9844144" - inkscape:cx="236.10597" - inkscape:cy="505.93946" + inkscape:zoom="0.70159644" + inkscape:cx="305.10274" + inkscape:cy="632.28327" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="layer12" + inkscape:current-layer="layer17" fit-margin-top="15" fit-margin-left="15" fit-margin-right="15" @@ -18146,7 +18146,7 @@ sodipodi:insensitive="true">