diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 44a1974..76595b4 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -74,7 +74,8 @@ FORMS += src/ui/MainWindow.ui \ src/ui/watchdog/WatchdogView.ui \ src/ui/QGCFirmwareUpdate.ui \ src/ui/QGCPxImuFirmwareUpdate.ui \ - src/ui/QGCDataPlot2D.ui + src/ui/QGCDataPlot2D.ui \ + src/ui/QGCRemoteControlView.ui INCLUDEPATH += src \ src/ui \ src/ui/linechart \ @@ -155,7 +156,8 @@ HEADERS += src/MG.h \ src/ui/linechart/IncrementalPlot.h \ src/ui/map/Waypoint2DIcon.h \ src/ui/map/MAV2DIcon.h \ - src/ui/map/QGC2DIcon.h + src/ui/map/QGC2DIcon.h \ + src/ui/QGCRemoteControlView.h SOURCES += src/main.cc \ src/Core.cc \ src/uas/UASManager.cc \ @@ -218,7 +220,8 @@ SOURCES += src/main.cc \ src/ui/linechart/IncrementalPlot.cc \ src/ui/map/Waypoint2DIcon.cc \ src/ui/map/MAV2DIcon.cc \ - src/ui/map/QGC2DIcon.cc + src/ui/map/QGC2DIcon.cc \ + src/ui/QGCRemoteControlView.cc RESOURCES = mavground.qrc # Include RT-LAB Library diff --git a/src/comm/AS4Protocol.cc b/src/comm/AS4Protocol.cc index 8b522bb..47e4ac2 100644 --- a/src/comm/AS4Protocol.cc +++ b/src/comm/AS4Protocol.cc @@ -1,24 +1,24 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009, 2010 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ /** diff --git a/src/comm/LinkManager.cc b/src/comm/LinkManager.cc index 4c1e11d..76c4fde 100644 --- a/src/comm/LinkManager.cc +++ b/src/comm/LinkManager.cc @@ -1,24 +1,24 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ /** diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index 7f253e6..a20877d 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ diff --git a/src/comm/MAVLinkSyntaxHighlighter.cc b/src/comm/MAVLinkSyntaxHighlighter.cc index 170ac2c..ad3cbf3 100644 --- a/src/comm/MAVLinkSyntaxHighlighter.cc +++ b/src/comm/MAVLinkSyntaxHighlighter.cc @@ -1,3 +1,26 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 . + +======================================================================*/ + #include "MAVLinkSyntaxHighlighter.h" MAVLinkSyntaxHighlighter::MAVLinkSyntaxHighlighter(QObject *parent) : diff --git a/src/comm/SerialLink.cc b/src/comm/SerialLink.cc index 5e94921..09d6fa9 100644 --- a/src/comm/SerialLink.cc +++ b/src/comm/SerialLink.cc @@ -1,26 +1,25 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ - /** * @file * @brief Cross-platform support for serial ports diff --git a/src/comm/SerialSimulationLink.cc b/src/comm/SerialSimulationLink.cc index 7a9a929..e2e2e92 100644 --- a/src/comm/SerialSimulationLink.cc +++ b/src/comm/SerialSimulationLink.cc @@ -1,26 +1,25 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ - /** * @file * @brief Brief Description diff --git a/src/comm/UDPLink.cc b/src/comm/UDPLink.cc index 048bacd..ebd768e 100644 --- a/src/comm/UDPLink.cc +++ b/src/comm/UDPLink.cc @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ diff --git a/src/uas/PxQuadMAV.cc b/src/uas/PxQuadMAV.cc index bd83d2a..422244c 100644 --- a/src/uas/PxQuadMAV.cc +++ b/src/uas/PxQuadMAV.cc @@ -1,3 +1,26 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 . + +======================================================================*/ + #include "PxQuadMAV.h" #include "GAudioOutput.h" diff --git a/src/uas/SlugsMAV.cc b/src/uas/SlugsMAV.cc index f053345..9a8c2da 100644 --- a/src/uas/SlugsMAV.cc +++ b/src/uas/SlugsMAV.cc @@ -1,3 +1,26 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 . + +======================================================================*/ + #include "SlugsMAV.h" #include diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index fec0ffb..50db5c4 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ @@ -387,6 +387,42 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) } } break; + case MAVLINK_MSG_ID_RC_CHANNELS: + { + mavlink_rc_channels_t channels; + mavlink_msg_rc_channels_decode(&message, &channels); + for (int i = 0; i < 8; i++) + { + switch (i) + { + case 0: + emit remoteControlChannelChanged(i, channels.chan1_raw, channels.chan1_255/255.0f); + break; + case 1: + emit remoteControlChannelChanged(i, channels.chan2_raw, channels.chan2_255/255.0f); + break; + case 2: + emit remoteControlChannelChanged(i, channels.chan3_raw, channels.chan3_255/255.0f); + break; + case 3: + emit remoteControlChannelChanged(i, channels.chan4_raw, channels.chan4_255/255.0f); + break; + case 4: + emit remoteControlChannelChanged(i, channels.chan5_raw, channels.chan5_255/255.0f); + break; + case 5: + emit remoteControlChannelChanged(i, channels.chan6_raw, channels.chan6_255/255.0f); + break; + case 6: + emit remoteControlChannelChanged(i, channels.chan7_raw, channels.chan7_255/255.0f); + break; + case 7: + emit remoteControlChannelChanged(i, channels.chan8_raw, channels.chan8_255/255.0f); + break; + } + } + } + break; case MAVLINK_MSG_ID_PARAM_VALUE: { mavlink_param_value_t value; @@ -939,6 +975,13 @@ void UAS::enableExtra3Transmission(bool enabled) #endif } +/** + * Set a parameter value onboard + * + * @param component The component to set the parameter + * @param id Name of the parameter + * @param value Parameter value + */ void UAS::setParameter(int component, QString id, float value) { mavlink_message_t msg; @@ -971,7 +1014,7 @@ void UAS::setParameter(int component, QString id, float value) } /** - * @brief Launches the system + * Launches the system * **/ void UAS::launch() diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index a0ad5ad..41931ad 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -329,6 +329,8 @@ signals: void positionZControlEnabled(bool enabled); /** @brief Heading control enabled/disabled */ void positionYawControlEnabled(bool enabled); + /** @brief Value of a remote control channel */ + void remoteControlChannelChanged(int channelId, float raw, float normalized); /** * @brief Localization quality changed diff --git a/src/uas/UASManager.cc b/src/uas/UASManager.cc index c974dc8..bba66dd 100644 --- a/src/uas/UASManager.cc +++ b/src/uas/UASManager.cc @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ diff --git a/src/uas/UASWaypointManager.cc b/src/uas/UASWaypointManager.cc index e7ccdee..02ef012 100644 --- a/src/uas/UASWaypointManager.cc +++ b/src/uas/UASWaypointManager.cc @@ -1,23 +1,23 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ diff --git a/src/ui/AudioOutputWidget.cc b/src/ui/AudioOutputWidget.cc index 392daec..bf157eb 100644 --- a/src/ui/AudioOutputWidget.cc +++ b/src/ui/AudioOutputWidget.cc @@ -23,7 +23,7 @@ This file is part of the QGROUNDCONTROL project /** * @file - * @brief Implementation of class AudioOutputWidget + * @brief Implementation of AudioOutputWidget * @author Lorenz Meier * */ diff --git a/src/ui/CameraView.cc b/src/ui/CameraView.cc index c19f514..ec25ce0 100644 --- a/src/ui/CameraView.cc +++ b/src/ui/CameraView.cc @@ -1,30 +1,29 @@ /*===================================================================== - -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit - -(c) 2009 PIXHAWK PROJECT - -This file is part of the PIXHAWK project - - PIXHAWK is free software: you can redistribute it and/or modify + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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. - - PIXHAWK is distributed in the hope that it will be useful, + + 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 PIXHAWK. If not, see . - + along with QGROUNDCONTROL. If not, see . + ======================================================================*/ - + /** * @file - * @brief Brief Description - * + * @brief Implementation of CameraView * @author Lorenz Meier * */ diff --git a/src/ui/CommConfigurationWindow.cc b/src/ui/CommConfigurationWindow.cc index b48fe72..a51303e 100644 --- a/src/ui/CommConfigurationWindow.cc +++ b/src/ui/CommConfigurationWindow.cc @@ -1,30 +1,29 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit -Please see our website at +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ /** * @file - * @brief Implementation of configuration window for serial links + * @brief Implementation of CommConfigurationWindow * * @author Lorenz Meier * diff --git a/src/ui/DebugConsole.cc b/src/ui/DebugConsole.cc index 4bf1ce9..d91de4a 100644 --- a/src/ui/DebugConsole.cc +++ b/src/ui/DebugConsole.cc @@ -1,29 +1,29 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit +QGroundControl Open Source Ground Control Station -(c) 2009, 2010 PIXHAWK PROJECT +(c) 2009, 2010 QGROUNDCONTROL PROJECT -This file is part of the PIXHAWK project +This file is part of the QGROUNDCONTROL project - PIXHAWK is free software: you can redistribute it and/or modify + 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. - PIXHAWK is distributed in the hope that it will be useful, + 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 PIXHAWK. If not, see . + along with QGROUNDCONTROL. If not, see . ======================================================================*/ /** * @file - * @brief Debug console + * @brief Implementation of DebugConsole * * @author Lorenz Meier * diff --git a/src/ui/MAVLinkSettingsWidget.cc b/src/ui/MAVLinkSettingsWidget.cc index a64fbaa..d419838 100644 --- a/src/ui/MAVLinkSettingsWidget.cc +++ b/src/ui/MAVLinkSettingsWidget.cc @@ -1,3 +1,32 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 Implementation of MAVLinkSettingsWidget + * @author Lorenz Meier + */ + #include "MAVLinkSettingsWidget.h" #include "ui_MAVLinkSettingsWidget.h" diff --git a/src/ui/MainWindow.cc b/src/ui/MainWindow.cc index 781e38f..c7101a5 100644 --- a/src/ui/MainWindow.cc +++ b/src/ui/MainWindow.cc @@ -138,7 +138,8 @@ void MainWindow::buildWidgets() headDown1 = new HDDisplay(acceptList, this); headDown2 = new HDDisplay(acceptList2, this); joystick = new JoystickInput(); - dataplot = new QGCDataPlot2D(); + dataplot = new QGCDataPlot2D(this); + rcView = new QGCRemoteControlView(this); } void MainWindow::connectWidgets() @@ -562,6 +563,11 @@ void MainWindow::loadPixhawkView() container7->setWidget(debugConsole); addDockWidget(Qt::BottomDockWidgetArea, container7); + // DEBUG CONSOLE + QDockWidget* rcContainer = new QDockWidget(tr("Radio Control"), this); + rcContainer->setWidget(rcView); + addDockWidget(Qt::BottomDockWidgetArea, rcContainer); + // ONBOARD PARAMETERS QDockWidget* containerParams = new QDockWidget(tr("Onboard Parameters"), this); containerParams->setWidget(parameters); diff --git a/src/ui/MainWindow.h b/src/ui/MainWindow.h index 1ef6f38..cd1b85f 100644 --- a/src/ui/MainWindow.h +++ b/src/ui/MainWindow.h @@ -62,6 +62,7 @@ This file is part of the QGROUNDCONTROL project #include "WatchdogControl.h" #include "HSIDisplay.h" #include "QGCDataPlot2D.h" +#include "QGCRemoteControlView.h" #include "LogCompressor.h" @@ -170,6 +171,7 @@ protected: WatchdogControl* watchdogControl; HSIDisplay* hsi; QGCDataPlot2D* dataplot; + QGCRemoteControlView* rcView; // Popup widgets JoystickWidget* joystickWidget; diff --git a/src/ui/QGCDataPlot2D.cc b/src/ui/QGCDataPlot2D.cc index a4160ca..afaf40d 100644 --- a/src/ui/QGCDataPlot2D.cc +++ b/src/ui/QGCDataPlot2D.cc @@ -1,3 +1,32 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 Implementation of QGCDataPlot2D + * @author Lorenz Meier + * + */ #include #include diff --git a/src/ui/QGCFirmwareUpdate.cc b/src/ui/QGCFirmwareUpdate.cc index 7e943d7..99c870f 100644 --- a/src/ui/QGCFirmwareUpdate.cc +++ b/src/ui/QGCFirmwareUpdate.cc @@ -1,3 +1,33 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 Implementation of QGCFirmwareUpdate + * @author Lorenz Meier + * + */ + #include "QGCFirmwareUpdate.h" #include "ui_QGCFirmwareUpdate.h" diff --git a/src/ui/QGCPxImuFirmwareUpdate.cc b/src/ui/QGCPxImuFirmwareUpdate.cc index eed713e..330d6b9 100644 --- a/src/ui/QGCPxImuFirmwareUpdate.cc +++ b/src/ui/QGCPxImuFirmwareUpdate.cc @@ -21,6 +21,13 @@ This file is part of the QGROUNDCONTROL project ======================================================================*/ +/** + * @file + * @brief Implementation of QGCPxImuFirmwareUpdate + * @author Lorenz Meier + * + */ + #include "QGCPxImuFirmwareUpdate.h" #include "ui_QGCPxImuFirmwareUpdate.h" diff --git a/src/ui/QGCRemoteControlView.cc b/src/ui/QGCRemoteControlView.cc new file mode 100644 index 0000000..78c5416 --- /dev/null +++ b/src/ui/QGCRemoteControlView.cc @@ -0,0 +1,180 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 Implementation of QGCRemoteControlView + * @author Lorenz Meier + */ + +#include +#include +#include +#include +#include +#include +#include "QGCRemoteControlView.h" +#include "ui_QGCRemoteControlView.h" +#include "UASManager.h" + +QGCRemoteControlView::QGCRemoteControlView(QWidget *parent) : + QWidget(parent), + uasId(-1), + rssi(0.0f), + updated(false), + channelLayout(new QVBoxLayout()), + ui(new Ui::QGCRemoteControlView) +{ + //ui->setupUi(this); + QGridLayout* layout = new QGridLayout(this); + layout->addLayout(channelLayout, 1, 0, 1, 2); + // Name label + nameLabel = new QLabel(this); + nameLabel->setText("No MAV selected yet.."); + layout->addWidget(nameLabel, 0, 0, 1, 2); + // Add spacer left of button + layout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding), 2, 0); + // Set stretch to maximize spacer, not button + layout->setColumnStretch(0, 100); + layout->setColumnStretch(1, 1); + // Calibrate button + QPushButton* calibrateButton = new QPushButton(this); + calibrateButton->setText(tr("Calibrate")); + // Connect to calibration slot + connect(calibrateButton, SIGNAL(clicked()), this, SLOT(calibrate())); + // Add button + layout->addWidget(calibrateButton, 2, 1); + setVisible(false); + + connect(UASManager::instance(), SIGNAL(activeUASSet(int)), this, SLOT(setUASId(int))); +} + +QGCRemoteControlView::~QGCRemoteControlView() +{ + delete ui; + delete channelLayout; +} + +void QGCRemoteControlView::calibrate() +{ + // Run auto-calibration +} + +void QGCRemoteControlView::setUASId(int id) +{ + if (uasId != -1) + { + UASInterface* uas = UASManager::instance()->getUASForId(id); + if (uas) + { + // The UAS exists, disconnect any existing connections + disconnect(uas, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float))); + } + } + + // Connect the new UAS + UASInterface* newUAS = UASManager::instance()->getUASForId(id); + if (newUAS) + { + // New UAS exists, connect + nameLabel->setText(QString("RC Input of %1").arg(newUAS->getUASName())); + connect(newUAS, SIGNAL(remoteControlChannelChanged(int,float,float)), this, SLOT(setChannel(int,float,float))); + } +} + +void QGCRemoteControlView::setChannel(int channelId, float raw, float normalized) +{ + if (this->raw.size() <= channelId) + { + // This is a new channel, append it + this->raw.append(raw); + this->normalized.append(normalized); + appendChannelWidget(channelId); + } + else + { + // This is an existing channel, update it + this->raw[channelId] = raw; + this->normalized[channelId] = normalized; + } + updated = true; + + // FIXME Will be timer based in the future + redraw(); +} + +void QGCRemoteControlView::setRemoteRSSI(float rssiNormalized) +{ + rssi = rssiNormalized; + updated = true; +} + +void QGCRemoteControlView::appendChannelWidget(int channelId) +{ + // Create new layout + QHBoxLayout* layout = new QHBoxLayout(this); + // Add content + layout->addWidget(new QLabel(QString("Channel %1").arg(channelId + 1), this)); + QLabel* raw = new QLabel(this); + // Append raw label + rawLabels.append(raw); + layout->addWidget(raw); + // Append progress bar + QProgressBar* normalized = new QProgressBar(this); + normalized->setMinimum(0); + normalized->setMaximum(100); + progressBars.append(normalized); + layout->addWidget(normalized); + channelLayout->addLayout(layout); +} + +void QGCRemoteControlView::redraw() +{ + if(isVisible() && updated) + { + // Update raw values + for(int i = 0; i < rawLabels.count(); i++) + { + rawLabels.at(i)->setText(QString("%1 us").arg(raw.at(i))); + } + + // Update percent bars + for(int i = 0; i < progressBars.count(); i++) + { + progressBars.at(i)->setValue(normalized.at(i)*100.0f); + } + updated = false; + } +} + +void QGCRemoteControlView::changeEvent(QEvent *e) +{ + QWidget::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} diff --git a/src/ui/QGCRemoteControlView.h b/src/ui/QGCRemoteControlView.h new file mode 100644 index 0000000..a3f82a1 --- /dev/null +++ b/src/ui/QGCRemoteControlView.h @@ -0,0 +1,76 @@ +/*===================================================================== + +QGroundControl Open Source Ground Control Station + +(c) 2009, 2010 QGROUNDCONTROL PROJECT + +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 Declaration of QGCRemoteControlView + * @author Lorenz Meier + */ + +#ifndef QGCREMOTECONTROLVIEW_H +#define QGCREMOTECONTROLVIEW_H + +#include +#include + +namespace Ui { + class QGCRemoteControlView; +} + +class QVBoxLayout; +class QLabel; +class QProgressBar; + +class QGCRemoteControlView : public QWidget { + Q_OBJECT +public: + QGCRemoteControlView(QWidget *parent = 0); + ~QGCRemoteControlView(); + +public slots: + void setUASId(int id); + void setChannel(int channelId, float raw, float normalized); + void setRemoteRSSI(float rssiNormalized); + void calibrate(); + void redraw(); + +protected slots: + void appendChannelWidget(int channelId); + +protected: + void changeEvent(QEvent *e); + int uasId; + float rssi; + bool updated; + QVBoxLayout* channelLayout; + QVector raw; + QVector normalized; + QVector rawLabels; + QVector progressBars; + QLabel* nameLabel; + +private: + Ui::QGCRemoteControlView *ui; +}; + +#endif // QGCREMOTECONTROLVIEW_H diff --git a/src/ui/QGCRemoteControlView.ui b/src/ui/QGCRemoteControlView.ui new file mode 100644 index 0000000..94076eb --- /dev/null +++ b/src/ui/QGCRemoteControlView.ui @@ -0,0 +1,279 @@ + + + QGCRemoteControlView + + + + 0 + 0 + 400 + 300 + + + + Form + + + + + 300 + 260 + 93 + 27 + + + + Calibrate + + + + + + 10 + 270 + 171 + 17 + + + + Remote Control detected + + + + + + 10 + 10 + 71 + 17 + + + + Channel 1 + + + + + + 10 + 30 + 71 + 17 + + + + Channel 2 + + + + + + 10 + 50 + 71 + 17 + + + + Channel 3 + + + + + + 10 + 70 + 71 + 17 + + + + Channel 4 + + + + + + 10 + 90 + 71 + 17 + + + + Channel 5 + + + + + + 10 + 110 + 71 + 17 + + + + Channel 6 + + + + + + 10 + 130 + 71 + 17 + + + + Channel 7 + + + + + + 10 + 150 + 71 + 17 + + + + Channel 8 + + + + + + 10 + 170 + 62 + 17 + + + + RSSI + + + + + + 200 + 10 + 118 + 16 + + + + 24 + + + + + + 200 + 30 + 118 + 16 + + + + 24 + + + + + + 200 + 50 + 118 + 16 + + + + 24 + + + + + + 200 + 70 + 118 + 16 + + + + 24 + + + + + + 200 + 90 + 118 + 16 + + + + 24 + + + + + + 200 + 110 + 118 + 16 + + + + 24 + + + + + + 200 + 130 + 118 + 16 + + + + 24 + + + + + + 200 + 150 + 118 + 16 + + + + 24 + + + + + + 90 + 10 + 41 + 17 + + + + 1120 + + + + + + diff --git a/src/ui/QGCSensorSettingsWidget.cc b/src/ui/QGCSensorSettingsWidget.cc index f00bb98..f91defe 100644 --- a/src/ui/QGCSensorSettingsWidget.cc +++ b/src/ui/QGCSensorSettingsWidget.cc @@ -21,6 +21,13 @@ This file is part of the QGROUNDCONTROL project ======================================================================*/ +/** + * @file + * @brief Implementation of QGCSensorSettingsWidget + * @author Lorenz Meier + * + */ + #include "QGCSensorSettingsWidget.h" #include "ui_QGCSensorSettingsWidget.h" diff --git a/src/ui/SerialConfigurationWindow.cc b/src/ui/SerialConfigurationWindow.cc index d3bd931..5542bc9 100644 --- a/src/ui/SerialConfigurationWindow.cc +++ b/src/ui/SerialConfigurationWindow.cc @@ -23,8 +23,7 @@ This file is part of the QGROUNDCONTROL project /** * @file - * @brief Implementation of configuration window for serial links - * + * @brief Implementation of SerialConfigurationWindow * @author Lorenz Meier * */