SlugsPIDControl.h 5.26 KB
Newer Older
1 2 3 4 5
#ifndef SLUGSPIDCONTROL_H
#define SLUGSPIDCONTROL_H

#include <QWidget>
#include<QGroupBox>
6 7 8
#include "UASInterface.h"
#include "QGCMAVLink.h"
#include "SlugsMAV.h"
9
#include "mavlink.h"
10 11 12 13 14 15 16 17 18 19 20 21 22

namespace Ui {
    class SlugsPIDControl;
}

class SlugsPIDControl : public QWidget
{
    Q_OBJECT

public:
    explicit SlugsPIDControl(QWidget *parent = 0);
    ~SlugsPIDControl();

23
public slots:
24

25 26 27 28 29 30 31 32 33 34 35
    /**
     * @brief Called when the a new UAS is set to active.
     *
     * Called when the a new UAS is set to active.
     *
     * @param uas The new active UAS
     */
    void activeUasSet(UASInterface* uas);

    /**
     */
36
    void setRedColorStyle();
37 38 39 40 41
    /**
     * @brief Set color StyleSheet GREEN
     *
     * @param
     */
42 43
    void setGreenColorStyle();

44 45 46 47 48 49 50 51 52 53 54 55 56
    /**
     * @brief Connect Set pushButtons to change the color GroupBox
     *
     * @param
     */
    void connect_set_pushButtons();

    /**
     * @brief Connect Edition Lines for PID Values
     *
     * @param
     */
    void connect_editLinesPDIvalues();
57

58 59 60 61 62 63 64
// Fuctions for Air Speed GroupBox
    /**
     * @brief Change color style to red when PID values of Air Speed are edited
     *
     *
     * @param
     */
65
    void changeColor_RED_AirSpeed_groupBox(QString text);
66 67 68 69 70
    /**
     * @brief Change color style to green when PID values of Air Speed are send to UAS
     *
     * @param
     */
71 72 73 74 75 76
    void changeColor_GREEN_AirSpeed_groupBox();
    /**
     * @brief Connects the SIGNALS from the editline to SLOT changeColor_RED_AirSpeed_groupBox()
     *
     * @param
     */
77
    void connect_AirSpeed_LineEdit();
78

79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
// Functions for Pitch Followei GroupBox
    /**
     * @brief Change color style to red when PID values of Pitch Followei are edited
     *
     *
     * @param
     */
     void changeColor_RED_PitchFollowei_groupBox(QString text);
     /**
         * @brief Change color style to green when PID values of Pitch Followei are send to UAS
         *
         * @param
         */
     void changeColor_GREEN_PitchFollowei_groupBox();
     /**
         * @brief Connects the SIGNALS from the editline to SLOT PitchFlowei_groupBox
         *
         * @param
         */
     void connect_PitchFollowei_LineEdit();

     // Functions for Roll Control GroupBox
     /**
          * @brief Change color style to red when PID values of Roll Control are edited
          *
          *
          * @param
          */
     void changeColor_RED_RollControl_groupBox(QString text);
     /**
              * @brief Change color style to green when PID values of Roll Control are send to UAS
              *
              * @param
              */
     void changeColor_GREEN_RollControl_groupBox();
     /**
              * @brief Connects the SIGNALS from the editline to SLOT RollControl_groupBox
              *
              * @param
              */
     void connect_RollControl_LineEdit();

     // Functions for Heigth Error GroupBox
     /**
          * @brief Change color style to red when PID values of Heigth Error are edited
          *
          *
          * @param
          */
     void changeColor_RED_HeigthError_groupBox(QString text);
     /**
              * @brief Change color style to green when PID values of Heigth Error are send to UAS
              *
              * @param
              */
     void changeColor_GREEN_HeigthError_groupBox();
     /**
              * @brief Connects the SIGNALS from the editline to SLOT HeigthError_groupBox
              *
              * @param
              */
     void connect_HeigthError_LineEdit();

     // Functions for Yaw Damper GroupBox
     /**
          * @brief Change color style to red when PID values of Yaw Damper are edited
          *
          *
          * @param
          */
     void changeColor_RED_YawDamper_groupBox(QString text);
     /**
              * @brief Change color style to green when PID values of Yaw Damper are send to UAS
              *
              * @param
              */
     void changeColor_GREEN_YawDamper_groupBox();
     /**
              * @brief Connects the SIGNALS from the editline to SLOT YawDamper_groupBox
              *
              * @param
              */
     void connect_YawDamper_LineEdit();

     // Functions for Pitch to dT GroupBox
     /**
          * @brief Change color style to red when PID values of Pitch to dT are edited
          *
          *
          * @param
          */
     void changeColor_RED_Pitch2dT_groupBox(QString text);
     /**
              * @brief Change color style to green when PID values of Pitch to dT are send to UAS
              *
              * @param
              */
     void changeColor_GREEN_Pitch2dT_groupBox();
     /**
              * @brief Connects the SIGNALS from the editline to SLOT Pitch2dT_groupBox
              *
              * @param
              */
     void connect_Pitch2dT_LineEdit();


     //Create, send and get Messages PID
    // void createMessagePID();
187
#ifdef MAVLINK_ENABLED_SLUGS
188

189
     void recibeMensaje(int systemId, const mavlink_action_ack_t& action);
190

191
#endif // MAVLINK_ENABLED_SLUG
192

193 194
private:
    Ui::SlugsPIDControl *ui;
195 196 197 198

     UASInterface* activeUAS;
     int systemId;

199 200
    bool change_dT;

201

202 203 204 205
    //Color Styles
    QString REDcolorStyle;
    QString GREENcolorStyle;
    QString ORIGINcolorStyle;
206 207 208

    //SlugsMav Message
    mavlink_pid_t pidMessage;
209 210 211
};

#endif // SLUGSPIDCONTROL_H