SlugsPIDControl.h 6.46 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
    /**
     * @brief Connect Set pushButtons to change the color GroupBox
     *
     * @param
     */
    void connect_set_pushButtons();

51 52 53 54 55 56 57
    /**
     * @brief Connect Set pushButtons to change the color GroupBox
     *
     * @param
     */
    void connect_get_pushButtons();

58 59 60 61 62 63
    /**
     * @brief Connect Edition Lines for PID Values
     *
     * @param
     */
    void connect_editLinesPDIvalues();
64

65 66 67 68 69 70 71
    /**
     * @brief send a PDI request message to UAS
     *
     * @param
     */
    void sendMessagePIDStatus(int PIDtype);

72 73 74 75 76 77 78
// Fuctions for Air Speed GroupBox
    /**
     * @brief Change color style to red when PID values of Air Speed are edited
     *
     *
     * @param
     */
79
    void changeColor_RED_AirSpeed_groupBox(QString text);
80 81 82 83 84
    /**
     * @brief Change color style to green when PID values of Air Speed are send to UAS
     *
     * @param
     */
85 86 87 88 89 90
    void changeColor_GREEN_AirSpeed_groupBox();
    /**
     * @brief Connects the SIGNALS from the editline to SLOT changeColor_RED_AirSpeed_groupBox()
     *
     * @param
     */
91
    void connect_AirSpeed_LineEdit();
92 93 94 95 96 97 98
    /**
     * @brief get message PID Air Speed(loop index = 0) from UAS
     *
     * @param
     */
    void get_AirSpeed_PID();

99

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
// 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();
120 121 122 123 124 125 126
     /**
      * @brief get message PID Pitch Followei(loop index = 2) from UAS
      *
      * @param
      */
     void get_PitchFollowei_PID();

127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147

     // 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();
148 149 150 151 152 153 154
     /**
      * @brief get message PID Roll Control(loop index = 4) from UAS
      *
      * @param
      */
     void get_RollControl_PID();

155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175

     // 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();
176 177 178 179 180 181
     /**
      * @brief get message PID Heigth Error(loop index = 1) from UAS
      *
      * @param
      */
     void get_HeigthError_PID();
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202

     // 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();
203 204 205 206 207 208 209 210
     /**
      * @brief get message PID Yaw Damper(loop index = 3) from UAS
      *
      * @param
      */
     void get_YawDamper_PID();


211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231

     // 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();
232 233 234 235 236 237
     /**
      * @brief get message PID Pitch2dT(loop index = 8) from UAS
      *
      * @param
      */
     void get_Pitch2dT_PID();
238 239 240 241


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

244
     void recibeMensaje(int systemId, const mavlink_action_ack_t& action);
245
     void receivePidValues(int systemId, const mavlink_pid_t& pidValues);
246

247
#endif // MAVLINK_ENABLED_SLUG
248

249 250
private:
    Ui::SlugsPIDControl *ui;
251 252 253 254

     UASInterface* activeUAS;
     int systemId;

255 256
    bool change_dT;

257

258 259 260 261
    //Color Styles
    QString REDcolorStyle;
    QString GREENcolorStyle;
    QString ORIGINcolorStyle;
262 263 264

    //SlugsMav Message
    mavlink_pid_t pidMessage;
265
    mavlink_slugs_action_t actionSlugs;
266 267 268
};

#endif // SLUGSPIDCONTROL_H