From 969475270aae963a00f3ecef02062de90828d130 Mon Sep 17 00:00:00 2001 From: pixhawk Date: Fri, 20 Aug 2010 11:35:55 +0200 Subject: [PATCH] Commented/cleaned up code --- src/Core.cc | 13 +++++---- src/GAudioOutput.cc | 12 ++++----- src/LogCompressor.cc | 30 +++++++++++++++++++++ src/QGC.cc | 23 ++++++++++++++++ src/Waypoint.cc | 12 ++++----- src/comm/MAVLinkProtocol.cc | 19 ++++++------- src/comm/MAVLinkProtocol.h | 24 ++++++++--------- src/comm/MAVLinkXMLParser.cc | 52 ++++++++++++++++++++++-------------- src/comm/MAVLinkXMLParser.h | 36 +++++++++++++++++++++++++ src/comm/OpalLink.cc | 29 ++++++++++++++++++++ src/comm/OpalLink.h | 45 ++++++++++++++++++++++++++----- src/main.cc | 12 ++++----- src/ui/MapWidget.h | 3 ++- 13 files changed, 235 insertions(+), 75 deletions(-) diff --git a/src/Core.cc b/src/Core.cc index 7e04b0f6e..bdd612dcb 100644 --- a/src/Core.cc +++ b/src/Core.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 . ======================================================================*/ @@ -29,7 +29,6 @@ This file is part of the PIXHAWK project * */ - #include #include #include diff --git a/src/GAudioOutput.cc b/src/GAudioOutput.cc index 41d435ee3..6d35f6215 100644 --- a/src/GAudioOutput.cc +++ b/src/GAudioOutput.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/LogCompressor.cc b/src/LogCompressor.cc index b78d1901b..ceed32f62 100644 --- a/src/LogCompressor.cc +++ b/src/LogCompressor.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 class LogCompressor + * @author Lorenz Meier + * + */ + #include #include #include diff --git a/src/QGC.cc b/src/QGC.cc index fe78d323d..14da6ac60 100644 --- a/src/QGC.cc +++ b/src/QGC.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 "QGC.h" namespace QGC { diff --git a/src/Waypoint.cc b/src/Waypoint.cc index c194214a6..7901330b9 100644 --- a/src/Waypoint.cc +++ b/src/Waypoint.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/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index dff77e001..60fdcb85a 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -1,33 +1,30 @@ /*===================================================================== -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 the MAVLink protocol - * - * @author Lorenz Meier - * + * @brief Implementation of class MAVLinkProtocol + * @author Lorenz Meier */ #include diff --git a/src/comm/MAVLinkProtocol.h b/src/comm/MAVLinkProtocol.h index 570efbf05..93aac97e3 100644 --- a/src/comm/MAVLinkProtocol.h +++ b/src/comm/MAVLinkProtocol.h @@ -1,33 +1,30 @@ /*===================================================================== -PIXHAWK Micro Air Vehicle Flying Robotics Toolkit -Please see our website at +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 Definition of the MAVLink protocol - * - * @author Lorenz Meier - * + * @brief Definition of class MAVLinkProtocol + * @author Lorenz Meier */ #ifndef MAVLINKPROTOCOL_H_ @@ -45,8 +42,11 @@ This file is part of the PIXHAWK project #include "protocol.h" /** - * MAVLink micro air vehicle protocol reference implementation. + * @brief MAVLink micro air vehicle protocol reference implementation. * + * MAVLink is a generic communication protocol for micro air vehicles. + * for more information, please see the official website. + * @ref http://pixhawk.ethz.ch/software/mavlink/ **/ class MAVLinkProtocol : public ProtocolInterface { Q_OBJECT diff --git a/src/comm/MAVLinkXMLParser.cc b/src/comm/MAVLinkXMLParser.cc index a49af8042..1a44b405d 100644 --- a/src/comm/MAVLinkXMLParser.cc +++ b/src/comm/MAVLinkXMLParser.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 class MAVLinkXMLParser + * @author Lorenz Meier + */ + #include #include #include @@ -33,6 +62,9 @@ MAVLinkXMLParser::~MAVLinkXMLParser() { } +/** + * Generate C-code (C-89 compliant) out of the XML protocol specs. + */ bool MAVLinkXMLParser::generate() { // Process result @@ -51,26 +83,6 @@ bool MAVLinkXMLParser::generate() QList* usedMessageIDs = new QList(); QMap* usedMessageNames = new QMap(); - - /* - // Seek for element "messages" until end of document - // ignoring all other tags - while(!n.isNull()) - { - if (n.toElement().tagName() == "messages") - { - break; - } - else - { - qDebug() << "IGNORED TAG" << n.toElement().tagName(); - n = n.nextSibling(); - } - } - - qDebug() << "WORKING ON" << n.toElement().tagName(); - */ - QList< QPair > cFiles; QString lcmStructDefs = ""; diff --git a/src/comm/MAVLinkXMLParser.h b/src/comm/MAVLinkXMLParser.h index c8c96c145..c4ede024e 100644 --- a/src/comm/MAVLinkXMLParser.h +++ b/src/comm/MAVLinkXMLParser.h @@ -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 Definition of class MAVLinkXMLParser + * @author Lorenz Meier + */ + #ifndef MAVLINKXMLPARSER_H #define MAVLINKXMLPARSER_H @@ -5,6 +34,13 @@ #include #include +/** + * @brief MAVLink micro air vehicle protocol generator + * + * MAVLink is a generic communication protocol for micro air vehicles. + * for more information, please see the official website. + * @ref http://pixhawk.ethz.ch/software/mavlink/ + **/ class MAVLinkXMLParser : public QObject { Q_OBJECT diff --git a/src/comm/OpalLink.cc b/src/comm/OpalLink.cc index 72bfbe472..90ff9805e 100644 --- a/src/comm/OpalLink.cc +++ b/src/comm/OpalLink.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 class OpalLink + * @author Bryan Godbolt + */ + #include "OpalLink.h" OpalLink::OpalLink() : diff --git a/src/comm/OpalLink.h b/src/comm/OpalLink.h index 3cd033cb7..ad0cbe65b 100644 --- a/src/comm/OpalLink.h +++ b/src/comm/OpalLink.h @@ -1,11 +1,34 @@ -#ifndef OPALLINK_H -#define OPALLINK_H +/*===================================================================== + +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 . + +======================================================================*/ + /** - Connection to OpalRT. This class receives MAVLink packets as if it is a true link, but it - interprets the packets internally, and calls the appropriate api functions. + * @file + * @brief Connection to OpalRT + * @author Bryan Godbolt + */ - \author Bryan Godbolt -*/ +#ifndef OPALLINK_H +#define OPALLINK_H #include #include @@ -42,6 +65,16 @@ #define NUM_OUTPUT_SIGNALS 6 +/** + * @brief Interface to OPAL-RT targets + * + * This is an interface to the Opal-RT hardware-in-the-loop (HIL) simulator. + * This class receives MAVLink packets as if it is a true link, but it + * interprets the packets internally, and calls the appropriate api functions. + * + * @author Bryan Godbolt + * @ref http://www.opal-rt.com/ + */ class OpalLink : public LinkInterface { Q_OBJECT diff --git a/src/main.cc b/src/main.cc index 7db249d83..a27a8d303 100644 --- a/src/main.cc +++ b/src/main.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/MapWidget.h b/src/ui/MapWidget.h index f66fc2dce..21afab5eb 100644 --- a/src/ui/MapWidget.h +++ b/src/ui/MapWidget.h @@ -23,9 +23,10 @@ This file is part of the PIXHAWK project /** * @file - * @brief Definition of map view + * @brief Definition of MapWidget * * @author Lorenz Meier + * @author Mariano Lizzaraga * */ -- 2.22.0