diff --git a/files/images/devices/BR-HMC5883-01-2.jpg b/files/images/devices/BR-HMC5883-01-2.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f695795f6f93082d0e4a9b588aef3e9f515ff133 Binary files /dev/null and b/files/images/devices/BR-HMC5883-01-2.jpg differ diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 0b614ff6728ae877cf12dcb852b2eea6e5af02d1..fab4b89ebfa6d8691b53fa939efd343fddbcd35d 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -106,6 +106,10 @@ files/images/apm_planner_logo_splash.png files/images/apm_planner_2_0-07.png files/images/apm_planner_2_0-08.png + files/images/mavs/frames_plus.png + files/images/mavs/frames_x.png + files/images/mavs/frames-05.png + files/images/devices/BR-HMC5883-01-2.jpg files/styles/Vera.ttf diff --git a/src/ui/configuration/AccelCalibrationConfig.ui b/src/ui/configuration/AccelCalibrationConfig.ui index 75fdd0c65954a05efdc14c98f354de5d6ef4beac..43ca6a1536ad76dfecd97ddcd0ea7f1a60547c9b 100644 --- a/src/ui/configuration/AccelCalibrationConfig.ui +++ b/src/ui/configuration/AccelCalibrationConfig.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 576 + 354 @@ -16,8 +16,8 @@ - 20 - 20 + 10 + 0 231 31 @@ -29,6 +29,33 @@ false + + + + 60 + 60 + 81 + 31 + + + + Calibrate +Accelerometer + + + + + + 40 + 120 + 161 + 51 + + + + + + diff --git a/src/ui/configuration/ApmHardwareConfig.cc b/src/ui/configuration/ApmHardwareConfig.cc index 829b43292aa20d05c49fa18670ddf9426ebc7377..909db3ad5b1d40220e54ad2c951b93a36b316b9f 100644 --- a/src/ui/configuration/ApmHardwareConfig.cc +++ b/src/ui/configuration/ApmHardwareConfig.cc @@ -1,3 +1,33 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief APM Hardware Configuration widget source. + * + * @author Michael Carpenter + * + */ #include "ApmHardwareConfig.h" diff --git a/src/ui/configuration/ApmHardwareConfig.h b/src/ui/configuration/ApmHardwareConfig.h index d021d267209dd517d7c117498cd9928373a576f2..8a2beacff3abeb17a0cd761e445516473612afb2 100644 --- a/src/ui/configuration/ApmHardwareConfig.h +++ b/src/ui/configuration/ApmHardwareConfig.h @@ -1,3 +1,34 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief APM Hardware Configuration widget header. + * + * @author Michael Carpenter + * + */ + #ifndef APMHARDWARECONFIG_H #define APMHARDWARECONFIG_H diff --git a/src/ui/configuration/CompassConfig.ui b/src/ui/configuration/CompassConfig.ui index b97069d7ce8c222a62a91b4c5747d09d89bacafd..8f7edd5945deea9957faaddbe2f5d094ac2be25d 100644 --- a/src/ui/configuration/CompassConfig.ui +++ b/src/ui/configuration/CompassConfig.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 565 + 241 @@ -16,9 +16,9 @@ - 30 - 20 - 131 + 10 + 0 + 521 31 @@ -29,7 +29,168 @@ false + + + + 230 + 100 + 101 + 16 + + + + <a href="http://magnetic-declination.com/">Declination Website</a> + + + + + + 280 + 120 + 201 + 22 + + + + + + + 300 + 180 + 91 + 23 + + + + Live Calibration + + + + + + 390 + 180 + 91 + 23 + + + + Log Calibration + + + + + + 340 + 160 + 91 + 16 + + + + Advanced Config + + + + + + 220 + 70 + 321 + 31 + + + + + + + + + + in Degrees eg 2* 3' W is -2.3 + + + + + + + + + 10 + 70 + 201 + 111 + + + + + + + + 100 + 100 + + + + + + + :/files/images/devices/BR-HMC5883-01-2.jpg + + + true + + + + + + + + + Enable + + + + + + + Auto Declination + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 220 + 120 + 54 + 20 + + + + Orientation + + - + + + diff --git a/src/ui/configuration/FrameTypeConfig.cc b/src/ui/configuration/FrameTypeConfig.cc index ac514cae3e93cf2d96023ae558b4a777c497414f..abb894245be1635667ac859de9995d15edcc5792 100644 --- a/src/ui/configuration/FrameTypeConfig.cc +++ b/src/ui/configuration/FrameTypeConfig.cc @@ -1,11 +1,60 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief Airframe type configuration widget source. + * + * @author Michael Carpenter + * + */ + #include "FrameTypeConfig.h" FrameTypeConfig::FrameTypeConfig(QWidget *parent) : QWidget(parent) { ui.setupUi(this); + connect(ui.plusRadioButton,SIGNAL(clicked()),this,SLOT(plusFrameSelected())); + connect(ui.xRadioButton,SIGNAL(clicked()),this,SLOT(xFrameSelected())); + connect(ui.vRadioButton,SIGNAL(clicked()),this,SLOT(vFrameSelected())); + //connect(UASManager::instance()->getActiveUAS()->getParamManager(),SIGNAL(parameterListUpToDate(int)) } FrameTypeConfig::~FrameTypeConfig() { } +void FrameTypeConfig::xFrameSelected() +{ + +} + +void FrameTypeConfig::plusFrameSelected() +{ + +} + +void FrameTypeConfig::vFrameSelected() +{ + +} diff --git a/src/ui/configuration/FrameTypeConfig.h b/src/ui/configuration/FrameTypeConfig.h index 592bf564d9b097fe0028f04a9ff366d4b63f9d07..f24e00f9fd301e81fac034fcf1058aff88e8ff69 100644 --- a/src/ui/configuration/FrameTypeConfig.h +++ b/src/ui/configuration/FrameTypeConfig.h @@ -1,9 +1,42 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief Airframe type configuration widget header. + * + * @author Michael Carpenter + * + */ + #ifndef FRAMETYPECONFIG_H #define FRAMETYPECONFIG_H #include #include "ui_FrameTypeConfig.h" - +#include "UASInterface.h" +#include "UASManager.h" +#include "QGCUASParamManager.h" class FrameTypeConfig : public QWidget { Q_OBJECT @@ -11,7 +44,10 @@ class FrameTypeConfig : public QWidget public: explicit FrameTypeConfig(QWidget *parent = 0); ~FrameTypeConfig(); - +private slots: + void xFrameSelected(); + void plusFrameSelected(); + void vFrameSelected(); private: Ui::FrameTypeConfig ui; }; diff --git a/src/ui/configuration/FrameTypeConfig.ui b/src/ui/configuration/FrameTypeConfig.ui index 4359e41a0f4a5c93f38657c3e7e45fb0b962d75d..6787fa5dbc17d6f27fdfeeb689e766c4dc49b44d 100644 --- a/src/ui/configuration/FrameTypeConfig.ui +++ b/src/ui/configuration/FrameTypeConfig.ui @@ -6,30 +6,102 @@ 0 0 - 400 - 300 + 553 + 497 Form - - - - 20 - 20 - 131 - 31 - - - - <h2>Frame Setup</h2> - - - false - - + + + + + <h2>Frame Setup</h2> + + + false + + + + + + + + + 'Plus' Style + + + + :/files/images/mavs/frames_plus.png:/files/images/mavs/frames_plus.png + + + + 300 + 150 + + + + + + + + 'X' Style + + + + :/files/images/mavs/frames_x.png:/files/images/mavs/frames_x.png + + + + 300 + 150 + + + + + + + + Qt::LeftToRight + + + false + + + 'V' Style + + + + :/files/images/mavs/frames-05.png:/files/images/mavs/frames-05.png + + + + 300 + 120 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + - + + + diff --git a/src/ui/configuration/RadioCalibrationConfig.cc b/src/ui/configuration/RadioCalibrationConfig.cc index 81b898eda635b841e4bdd9f1cbf40f93769bfeaf..37aaac08868bfca76e6e6c539f4a64b240f3b508 100644 --- a/src/ui/configuration/RadioCalibrationConfig.cc +++ b/src/ui/configuration/RadioCalibrationConfig.cc @@ -1,11 +1,111 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief Radio Calibration Configuration source. + * + * @author Michael Carpenter + * + */ + #include "RadioCalibrationConfig.h" RadioCalibrationConfig::RadioCalibrationConfig(QWidget *parent) : QWidget(parent) { ui.setupUi(this); + m_uas = 0; + m_calibrationEnabled = false; + connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); + setActiveUAS(UASManager::instance()->getActiveUAS()); + ui.rollWidget->setMin(800); + ui.rollWidget->setMax(2200); + ui.pitchWidget->setMin(800); + ui.pitchWidget->setMax(2200); + ui.throttleWidget->setMin(800); + ui.throttleWidget->setMax(2200); + ui.yawWidget->setMin(800); + ui.yawWidget->setMax(2200); + guiUpdateTimer = new QTimer(this); + connect(guiUpdateTimer,SIGNAL(timeout()),this,SLOT(guiUpdateTimerTick())); } RadioCalibrationConfig::~RadioCalibrationConfig() { } +void RadioCalibrationConfig::setActiveUAS(UASInterface *uas) +{ + if (uas==NULL) return; + if (m_uas) + { + // Disconnect old system + disconnect(m_uas, SIGNAL(remoteControlChannelRawChanged(int,float)), this,SLOT(remoteControlChannelRawChanged(int,float))); + disconnect(m_uas, SIGNAL(parameterChanged(int,int,QString,QVariant)), this,SLOT(parameterChanged(int,int,QString,QVariant))); + } + +} +void RadioCalibrationConfig::remoteControlChannelRawChanged(int chan,float val) +{ + + //Channel is 0-7 typically? + //Val will be 0-3000, PWM value. + if (m_calibrationEnabled) { + if (val < rcMin[chan]) + { + rcMin[chan] = val; + } + + if (val > rcMax[chan]) + { + rcMax[chan] = val; + } + } + + // Raw value + rcValue[chan] = val; +} + +void RadioCalibrationConfig::parameterChanged(int uas, int component, QString parameterName, QVariant value) +{ + +} +void RadioCalibrationConfig::guiUpdateTimerTick() +{ + ui.rollWidget->setValue(rcValue[0]); + ui.pitchWidget->setValue(rcValue[1]); + ui.throttleWidget->setValue(rcValue[2]); + ui.yawWidget->setValue(rcValue[3]); + ui.radio5Widget->setValue(rcValue[4]); + ui.radio6Widget->setValue(rcValue[5]); + ui.radio7Widget->setValue(rcValue[6]); + ui.radio8Widget->setValue(rcValue[7]); +} +void RadioCalibrationConfig::showEvent(QShowEvent *event) +{ + guiUpdateTimer->stop(); +} +void RadioCalibrationConfig::hideEvent(QHideEvent *event) +{ + guiUpdateTimer->start(100); +} diff --git a/src/ui/configuration/RadioCalibrationConfig.h b/src/ui/configuration/RadioCalibrationConfig.h index df0cb44d6de3a2a694400094a90a83b93b153a94..a873483191679ad5d1d105103a4d6210793bec68 100644 --- a/src/ui/configuration/RadioCalibrationConfig.h +++ b/src/ui/configuration/RadioCalibrationConfig.h @@ -1,9 +1,44 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2013 Michael Carpenter (malcom2073@gmail.com) + +This file is part of the QGROUNDCONTROL project + + QGROUNDCONTROL 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. + + QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see . + +======================================================================*/ + +/** + * @file + * @brief Radio Calibration Configuration widget header. + * + * @author Michael Carpenter + * + */ + #ifndef RADIOCALIBRATIONCONFIG_H #define RADIOCALIBRATIONCONFIG_H #include +#include +#include +#include #include "ui_RadioCalibrationConfig.h" - +#include "UASManager.h" +#include "UASInterface.h" class RadioCalibrationConfig : public QWidget { Q_OBJECT @@ -11,8 +46,21 @@ class RadioCalibrationConfig : public QWidget public: explicit RadioCalibrationConfig(QWidget *parent = 0); ~RadioCalibrationConfig(); - +protected: + void showEvent(QShowEvent *event); + void hideEvent(QHideEvent *event); +private slots: + void setActiveUAS(UASInterface *uas); + void remoteControlChannelRawChanged(int chan,float val); + void parameterChanged(int uas, int component, QString parameterName, QVariant value); + void guiUpdateTimerTick(); private: + double rcMin[8]; + double rcMax[8]; + double rcValue[8]; + QTimer *guiUpdateTimer; + bool m_calibrationEnabled; + UASInterface *m_uas; Ui::RadioCalibrationConfig ui; }; diff --git a/src/ui/configuration/RadioCalibrationConfig.ui b/src/ui/configuration/RadioCalibrationConfig.ui index 3fdd683782b0126290dd4195e45caa764c2055ae..321d20087dddf08468491ccc68f9e47373fdfc1c 100644 --- a/src/ui/configuration/RadioCalibrationConfig.ui +++ b/src/ui/configuration/RadioCalibrationConfig.ui @@ -6,8 +6,8 @@ 0 0 - 400 - 300 + 771 + 389 @@ -16,8 +16,8 @@ - 20 - 20 + 10 + 10 171 31 @@ -29,7 +29,252 @@ false + + + + 10 + 50 + 716 + 300 + + + + + QLayout::SetMinAndMaxSize + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 50 + 200 + + + + + 50 + 200 + + + + + + + + Qt::Horizontal + + + + 250 + 20 + + + + + + + + + 50 + 200 + + + + + 50 + 200 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + + + + + + + + 250 + 40 + + + + + 250 + 40 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + 20 + 360 + 75 + 23 + + + + Calibrate + + + + + QGCRadioChannelDisplay + QWidget +
ui/designer/QGCRadioChannelDisplay.h
+ 1 +
+