From 683113a0f68303c1a22ba77fe42c3690f1f32ab2 Mon Sep 17 00:00:00 2001
From: DonLakeFlyer <dongagne@outlook.com>
Date: Wed, 13 Nov 2019 10:19:49 -0800
Subject: [PATCH] Remove unused code

---
 src/uas/UAS.cc         | 41 -----------------------------------------
 src/uas/UAS.h          |  5 +----
 src/uas/UASInterface.h | 17 -----------------
 3 files changed, 1 insertion(+), 62 deletions(-)

diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc
index 19f31d7..2509502 100644
--- a/src/uas/UAS.cc
+++ b/src/uas/UAS.cc
@@ -142,39 +142,6 @@ int UAS::getUASID() const
 
 void UAS::receiveMessage(mavlink_message_t message)
 {
-    if (!components.contains(message.compid))
-    {
-        QString componentName;
-
-        switch (message.compid)
-        {
-        case MAV_COMP_ID_ALL:
-        {
-            componentName = "ANONYMOUS";
-            break;
-        }
-        case MAV_COMP_ID_IMU:
-        {
-            componentName = "IMU #1";
-            break;
-        }
-        case MAV_COMP_ID_CAMERA:
-        {
-            componentName = "CAMERA";
-            break;
-        }
-        case MAV_COMP_ID_MISSIONPLANNER:
-        {
-            componentName = "MISSIONPLANNER";
-            break;
-        }
-        }
-
-        components.insert(message.compid, componentName);
-    }
-
-    //    qDebug() << "UAS RECEIVED from" << message.sysid << "component" << message.compid << "msg id" << message.msgid << "seq no" << message.seq;
-
     // Only accept messages from this system (condition 1)
     // and only then if a) attitudeStamped is disabled OR b) attitudeStamped is enabled
     // and we already got one attitude packet
@@ -1466,14 +1433,6 @@ void UAS::stopHil()
 }
 #endif
 
-/**
-* @rerturn the map of the components
-*/
-QMap<int, QString> UAS::getComponents()
-{
-    return components;
-}
-
 void UAS::sendMapRCToParam(QString param_id, float scale, float value0, quint8 param_rc_channel_index, float valueMin, float valueMax)
 {
     if (!_vehicle) {
diff --git a/src/uas/UAS.h b/src/uas/UAS.h
index 39d842e..159fb1c 100644
--- a/src/uas/UAS.h
+++ b/src/uas/UAS.h
@@ -52,8 +52,6 @@ public:
 
     /** @brief Get the unique system id */
     int getUASID() const;
-    /** @brief Get the components */
-    QMap<int, QString> getComponents();
 
     /** @brief The time interval the robot is switched on */
     quint64 getUptime() const;
@@ -118,10 +116,9 @@ public:
     friend class FileManager;
 #endif
 
-protected: //COMMENTS FOR TEST UNIT
+protected:
     /// LINK ID AND STATUS
     int uasId;                    ///< Unique system ID
-    QMap<int, QString> components;///< IDs and names of all detected onboard components
 
     QList<int> unknownPackets;    ///< Packet IDs which are unknown and have been received
     MAVLinkProtocol* mavlink;     ///< Reference to the MAVLink instance
diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h
index f47b335..c18b148 100644
--- a/src/uas/UASInterface.h
+++ b/src/uas/UASInterface.h
@@ -48,8 +48,6 @@ public:
     virtual FileManager* getFileManager() = 0;
 #endif
 
-    virtual QMap<int, QString> getComponents() = 0;
-
     enum StartCalibrationType {
         StartCalibrationRadio,
         StartCalibrationGyro,
@@ -110,21 +108,6 @@ public slots:
     virtual void unsetRCToParameterMap() = 0;
 
 signals:
-    /**
-     * @brief Update the error count of a device
-     *
-     * The error count indicates how many errors occurred during the use of a device.
-     * Usually a random error from time to time is acceptable, e.g. through electromagnetic
-     * interferences on device lines like I2C and SPI. A constantly and rapidly increasing
-     * error count however can help to identify broken cables or misbehaving drivers.
-     *
-     * @param uasid System ID
-     * @param component Name of the component, e.g. "IMU"
-     * @param device Name of the device, e.g. "SPI0" or "I2C1"
-     * @param count Errors occurred since system startup
-     */
-    void errCountChanged(int uasid, QString component, QString device, int count);
-
     /** @brief The robot is connected **/
     void connected();
     /** @brief The robot is disconnected **/