QGCCommandButton.cc 17.2 KB
Newer Older
1
#include <QDockWidget>
Don Gagne's avatar
Don Gagne committed
2
#include <QDebug>
3

lm's avatar
lm committed
4 5 6 7 8 9 10
#include "QGCCommandButton.h"
#include "ui_QGCCommandButton.h"

#include "MAVLinkProtocol.h"
#include "UASManager.h"

QGCCommandButton::QGCCommandButton(QWidget *parent) :
11
    QGCToolWidgetItem("Command Button", parent),
lm's avatar
lm committed
12 13 14 15 16
    ui(new Ui::QGCCommandButton),
    uas(NULL)
{
    ui->setupUi(this);

17 18 19
    responsecount = 0;
    responsenum = 0;

lm's avatar
lm committed
20 21 22 23 24 25 26 27 28 29
    connect(ui->commandButton, SIGNAL(clicked()), this, SLOT(sendCommand()));
    connect(ui->editFinishButton, SIGNAL(clicked()), this, SLOT(endEditMode()));
    connect(ui->editButtonName, SIGNAL(textChanged(QString)), this, SLOT(setCommandButtonName(QString)));
    connect(ui->editCommandComboBox, SIGNAL(currentIndexChanged(QString)), ui->nameLabel, SLOT(setText(QString)));

    // Hide all edit items
    ui->editCommandComboBox->hide();
    ui->editFinishButton->hide();
    ui->editNameLabel->hide();
    ui->editButtonName->hide();
30 31 32 33 34 35 36
    ui->editConfirmationCheckBox->hide();
    ui->editComponentSpinBox->hide();
    ui->editParamsVisibleCheckBox->hide();
    ui->editParam1SpinBox->hide();
    ui->editParam2SpinBox->hide();
    ui->editParam3SpinBox->hide();
    ui->editParam4SpinBox->hide();
37 38 39
    ui->editLine1->hide();
    ui->editLine2->hide();

lm's avatar
lm committed
40
    // Add commands to combo box
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    ui->editCommandComboBox->addItem("CUSTOM 0", 0);
    ui->editCommandComboBox->addItem("CUSTOM 1", 1);
    ui->editCommandComboBox->addItem("CUSTOM 2", 2);
    ui->editCommandComboBox->addItem("CUSTOM 3", 3);
    ui->editCommandComboBox->addItem("CUSTOM 4", 4);
    ui->editCommandComboBox->addItem("CUSTOM 5", 5);
    ui->editCommandComboBox->addItem("CUSTOM 6", 6);
    ui->editCommandComboBox->addItem("CUSTOM 7", 7);
    ui->editCommandComboBox->addItem("CUSTOM 8", 8);
    ui->editCommandComboBox->addItem("CUSTOM 9", 9);
    ui->editCommandComboBox->addItem("CUSTOM 10", 10);
    ui->editCommandComboBox->addItem("CUSTOM 11", 11);
    ui->editCommandComboBox->addItem("CUSTOM 12", 12);
    ui->editCommandComboBox->addItem("CUSTOM 13", 13);
    ui->editCommandComboBox->addItem("CUSTOM 14", 14);
    ui->editCommandComboBox->addItem("CUSTOM 15", 15);
57 58 59 60 61 62 63 64 65
    ui->editCommandComboBox->addItem("NAV_WAYPOINT", MAV_CMD_NAV_WAYPOINT);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_UNLIM", MAV_CMD_NAV_LOITER_UNLIM);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TURNS", MAV_CMD_NAV_LOITER_TURNS);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_LOITER_TIME", MAV_CMD_NAV_LOITER_TIME);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_RETURN_TO_LAUNCH", MAV_CMD_NAV_RETURN_TO_LAUNCH);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_LAND", MAV_CMD_NAV_LAND);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_TAKEOFF", MAV_CMD_NAV_TAKEOFF);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_ROI", MAV_CMD_NAV_ROI);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_PATHPLANNING", MAV_CMD_NAV_PATHPLANNING);
66 67 68
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_SPLINE_WAYPOINT", MAV_CMD_NAV_SPLINE_WAYPOINT);
    ui->editCommandComboBox->addItem("MAV_CMD_NAV_GUIDED_ENABLE", MAV_CMD_NAV_GUIDED_ENABLE);
    ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_DELAY", MAV_CMD_CONDITION_DELAY);
69 70 71 72 73 74 75 76 77 78 79 80 81
    ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_CHANGE_ALT", MAV_CMD_CONDITION_CHANGE_ALT);
    ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_DISTANCE", MAV_CMD_CONDITION_DISTANCE);
    ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_YAW", MAV_CMD_CONDITION_YAW);
    ui->editCommandComboBox->addItem("MAV_CMD_CONDITION_LAST", MAV_CMD_CONDITION_LAST);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_MODE", MAV_CMD_DO_SET_MODE);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_JUMP", MAV_CMD_DO_JUMP);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_CHANGE_SPEED", MAV_CMD_DO_CHANGE_SPEED);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_HOME", MAV_CMD_DO_SET_HOME);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_PARAMETER", MAV_CMD_DO_SET_PARAMETER);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_RELAY", MAV_CMD_DO_SET_RELAY);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_REPEAT_RELAY", MAV_CMD_DO_REPEAT_RELAY);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_SERVO", MAV_CMD_DO_SET_SERVO);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_REPEAT_SERVO", MAV_CMD_DO_REPEAT_SERVO);
82
    ui->editCommandComboBox->addItem("MAV_CMD_DO_FLIGHTTERMINATION", MAV_CMD_DO_FLIGHTTERMINATION);
83
    ui->editCommandComboBox->addItem("MAV_CMD_DO_LAND_START", MAV_CMD_DO_LAND_START);
84 85
    ui->editCommandComboBox->addItem("MAV_CMD_DO_RALLY_LAND", MAV_CMD_DO_RALLY_LAND);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_GO_AROUND", MAV_CMD_DO_GO_AROUND);
86
    ui->editCommandComboBox->addItem("MAV_CMD_DO_CONTROL_VIDEO", MAV_CMD_DO_CONTROL_VIDEO);
87 88 89 90 91 92 93 94 95 96 97 98
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_ROI", MAV_CMD_DO_SET_ROI);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_DIGICAM_CONFIGURE", MAV_CMD_DO_DIGICAM_CONFIGURE);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_DIGICAM_CONTROL", MAV_CMD_DO_DIGICAM_CONTROL);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_MOUNT_CONFIGURE", MAV_CMD_DO_MOUNT_CONFIGURE);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_MOUNT_CONTROL", MAV_CMD_DO_MOUNT_CONTROL);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_SET_CAM_TRIGG_DIST", MAV_CMD_DO_SET_CAM_TRIGG_DIST);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_FENCE_ENABLE", MAV_CMD_DO_FENCE_ENABLE);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_PARACHUTE", MAV_CMD_DO_PARACHUTE);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_INVERTED_FLIGHT", MAV_CMD_DO_INVERTED_FLIGHT);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_MOUNT_CONTROL_QUAT", MAV_CMD_DO_MOUNT_CONTROL_QUAT);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_GUIDED_MASTER", MAV_CMD_DO_GUIDED_MASTER);
    ui->editCommandComboBox->addItem("MAV_CMD_DO_GUIDED_LIMITS", MAV_CMD_DO_GUIDED_LIMITS);
99 100 101 102 103 104
    ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_CALIBRATION", MAV_CMD_PREFLIGHT_CALIBRATION);
    ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS", MAV_CMD_PREFLIGHT_SET_SENSOR_OFFSETS);
    ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_STORAGE", MAV_CMD_PREFLIGHT_STORAGE);
    ui->editCommandComboBox->addItem("MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN", MAV_CMD_PREFLIGHT_REBOOT_SHUTDOWN);
    ui->editCommandComboBox->addItem("MAV_CMD_OVERRIDE_GOTO", MAV_CMD_OVERRIDE_GOTO);
    ui->editCommandComboBox->addItem("MAV_CMD_MISSION_START", MAV_CMD_MISSION_START);
105
    ui->editCommandComboBox->addItem("MAV_CMD_COMPONENT_ARM_DISARM", MAV_CMD_COMPONENT_ARM_DISARM);
ndousse's avatar
ndousse committed
106
    ui->editCommandComboBox->addItem("MAV_CMD_START_RX_PAIR", MAV_CMD_START_RX_PAIR);
107 108 109 110 111
    ui->editCommandComboBox->addItem("MAV_CMD_IMAGE_START_CAPTURE", MAV_CMD_IMAGE_START_CAPTURE);
    ui->editCommandComboBox->addItem("MAV_CMD_IMAGE_STOP_CAPTURE", MAV_CMD_IMAGE_STOP_CAPTURE);
    ui->editCommandComboBox->addItem("MAV_CMD_VIDEO_START_CAPTURE", MAV_CMD_VIDEO_START_CAPTURE);
    ui->editCommandComboBox->addItem("MAV_CMD_VIDEO_STOP_CAPTURE", MAV_CMD_VIDEO_STOP_CAPTURE);
    ui->editCommandComboBox->addItem("MAV_CMD_PANORAMA_CREATE", MAV_CMD_PANORAMA_CREATE);
112 113
    ui->editCommandComboBox->addItem("MAV_CMD_PAYLOAD_PREPARE_DEPLOY", MAV_CMD_PAYLOAD_PREPARE_DEPLOY);
    ui->editCommandComboBox->addItem("MAV_CMD_PAYLOAD_CONTROL_DEPLOY", MAV_CMD_PAYLOAD_CONTROL_DEPLOY);
114
    ui->editCommandComboBox->setEditable(true);
115 116

    init();
lm's avatar
lm committed
117 118 119 120 121 122 123 124 125
}

QGCCommandButton::~QGCCommandButton()
{
    delete ui;
}

void QGCCommandButton::sendCommand()
{
126 127
    if (QGCToolWidgetItem::uas)
    {
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150
        if (responsenum != 0)
        {
            if (responsecount == 0)
            {
                //We're finished. Reset.
                qDebug() << "Finished sequence";
                QGCToolWidgetItem::uas->executeCommandAck(responsenum-responsecount,true);
                responsecount = responsenum;
                return;
            }
            if (responsecount < responsenum)
            {
                qDebug() << responsecount << responsenum;
                QGCToolWidgetItem::uas->executeCommandAck(responsenum-responsecount,true);
                responsecount--;
                return;
            }
            else
            {
                qDebug() << "No sequence yet, sending command";
                responsecount--;
            }
        }
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171
        // Check if command text is a number
        bool ok;
        int index = 0;
        index = ui->editCommandComboBox->currentText().toInt(&ok);
        if (!ok)
        {
            // Command was not a number, assume it was one of the text items
            index = ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt(&ok);
            if (ok)
            {
                // Text item found, proceed
                MAV_CMD command = static_cast<MAV_CMD>(index);
                int confirm = (ui->editConfirmationCheckBox->isChecked()) ? 1 : 0;
                float param1 = ui->editParam1SpinBox->value();
                float param2 = ui->editParam2SpinBox->value();
                float param3 = ui->editParam3SpinBox->value();
                float param4 = ui->editParam4SpinBox->value();
                float param5 = ui->editParam5SpinBox->value();
                float param6 = ui->editParam6SpinBox->value();
                float param7 = ui->editParam7SpinBox->value();
                int component = ui->editComponentSpinBox->value();
172 173 174 175
                if (showlabelname != "")
                {
                    emit showLabel(showlabelname,index);
                }
176
                QGCToolWidgetItem::uas->executeCommand(command, confirm, param1, param2, param3, param4, param5, param6, param7, component);
Lorenz Meier's avatar
Lorenz Meier committed
177
                //qDebug() << __FILE__ << __LINE__ << "SENDING COMMAND" << index;
178 179 180 181 182
            }
        }
    }
    else
    {
lm's avatar
lm committed
183 184 185 186 187 188 189 190 191
        qDebug() << __FILE__ << __LINE__ << "NO UAS SET, DOING NOTHING";
    }
}

void QGCCommandButton::setCommandButtonName(QString text)
{
    ui->commandButton->setText(text);
}

192
void QGCCommandButton::setEditMode(bool editMode)
lm's avatar
lm committed
193
{
194
    // Hide elements
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
    ui->commandButton->setVisible(!editMode);
    ui->nameLabel->setVisible(!editMode);

    ui->editCommandComboBox->blockSignals(!editMode);
    ui->editCommandComboBox->setVisible(editMode);
    ui->editFinishButton->setVisible(editMode);
    ui->editNameLabel->setVisible(editMode);
    ui->editButtonName->setVisible(editMode);
    ui->editConfirmationCheckBox->setVisible(editMode);
    ui->editComponentSpinBox->setVisible(editMode);
    ui->editParamsVisibleCheckBox->setVisible(editMode);
    bool showParams = editMode || ui->editParamsVisibleCheckBox->isChecked();
    ui->editParam1SpinBox->setVisible(showParams);
    ui->editParam2SpinBox->setVisible(showParams);
    ui->editParam3SpinBox->setVisible(showParams);
    ui->editParam4SpinBox->setVisible(showParams);
    ui->editParam5SpinBox->setVisible(showParams);
    ui->editParam6SpinBox->setVisible(showParams);
    ui->editParam7SpinBox->setVisible(showParams);

    ui->editLine1->setVisible(editMode);
    ui->editLine2->setVisible(editMode);

    QGCToolWidgetItem::setEditMode(editMode);
lm's avatar
lm committed
219 220 221 222
}

void QGCCommandButton::writeSettings(QSettings& settings)
{
Lorenz Meier's avatar
Lorenz Meier committed
223
    //qDebug() << "COMMAND BUTTON WRITING SETTINGS";
lm's avatar
lm committed
224
    settings.setValue("TYPE", "COMMANDBUTTON");
225 226 227
    settings.setValue("QGC_COMMAND_BUTTON_DESCRIPTION", ui->nameLabel->text());
    settings.setValue("QGC_COMMAND_BUTTON_BUTTONTEXT", ui->commandButton->text());
    settings.setValue("QGC_COMMAND_BUTTON_COMMANDID", ui->editCommandComboBox->itemData(ui->editCommandComboBox->currentIndex()).toInt());
228
    settings.setValue("QGC_COMMAND_BUTTON_PARAMS_VISIBLE", ui->editParamsVisibleCheckBox->isChecked());
229 230 231 232 233 234 235
    settings.setValue("QGC_COMMAND_BUTTON_PARAM1",  ui->editParam1SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM2",  ui->editParam2SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM3",  ui->editParam3SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM4",  ui->editParam4SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM5",  ui->editParam5SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM6",  ui->editParam6SpinBox->value());
    settings.setValue("QGC_COMMAND_BUTTON_PARAM7",  ui->editParam7SpinBox->value());
lm's avatar
lm committed
236 237
    settings.sync();
}
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263
void QGCCommandButton::readSettings(const QString& pre,const QVariantMap& settings)
{
    ui->editButtonName->setText(settings.value(pre + "QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString());
    ui->editCommandComboBox->setCurrentIndex(settings.value(pre + "QGC_COMMAND_BUTTON_COMMANDID", 0).toInt());
    ui->commandButton->setText(settings.value(pre + "QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString());

    int commandId = settings.value(pre + "QGC_COMMAND_BUTTON_COMMANDID", 0).toInt();

    ui->editParam1SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM1", 0.0).toDouble());
    ui->editParam2SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM2", 0.0).toDouble());
    ui->editParam3SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM3", 0.0).toDouble());
    ui->editParam4SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM4", 0.0).toDouble());
    ui->editParam5SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM5", 0.0).toDouble());
    ui->editParam6SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM6", 0.0).toDouble());
    ui->editParam7SpinBox->setValue(settings.value(pre + "QGC_COMMAND_BUTTON_PARAM7", 0.0).toDouble());

    ui->editCommandComboBox->setCurrentIndex(0);

    // Find combobox entry for this data
    for (int i = 0; i < ui->editCommandComboBox->count(); ++i)
    {
        if (commandId == ui->editCommandComboBox->itemData(i).toInt())
        {
            ui->editCommandComboBox->setCurrentIndex(i);
        }
    }
lm's avatar
lm committed
264

265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
    ui->editParamsVisibleCheckBox->setChecked(settings.value(pre + "QGC_COMMAND_BUTTON_PARAMS_VISIBLE").toBool());
    if (ui->editParamsVisibleCheckBox->isChecked())
    {
        ui->editParam1SpinBox->show();
        ui->editParam2SpinBox->show();
        ui->editParam3SpinBox->show();
        ui->editParam4SpinBox->show();
        ui->editParam5SpinBox->show();
        ui->editParam6SpinBox->show();
        ui->editParam7SpinBox->show();
    }
    else
    {
        ui->editParam1SpinBox->hide();
        ui->editParam2SpinBox->hide();
        ui->editParam3SpinBox->hide();
        ui->editParam4SpinBox->hide();
        ui->editParam5SpinBox->hide();
        ui->editParam6SpinBox->hide();
        ui->editParam7SpinBox->hide();
    }

    ui->editNameLabel->setText(settings.value(pre + "QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
    ui->nameLabel->setText(settings.value(pre + "QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
289 290 291

    responsenum = settings.value(pre + "QGC_COMMAND_BUTTON_RESPONSE",0).toInt();
    responsecount = responsenum;
292
}
lm's avatar
lm committed
293 294
void QGCCommandButton::readSettings(const QSettings& settings)
{
295 296 297 298 299
    ui->editButtonName->setText(settings.value("QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString());
    ui->editCommandComboBox->setCurrentIndex(settings.value("QGC_COMMAND_BUTTON_COMMANDID", 0).toInt());
    ui->commandButton->setText(settings.value("QGC_COMMAND_BUTTON_BUTTONTEXT", "UNKNOWN").toString());

    int commandId = settings.value("QGC_COMMAND_BUTTON_COMMANDID", 0).toInt();
lm's avatar
lm committed
300

301 302 303 304 305 306 307
    ui->editParam1SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM1", 0.0).toDouble());
    ui->editParam2SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM2", 0.0).toDouble());
    ui->editParam3SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM3", 0.0).toDouble());
    ui->editParam4SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM4", 0.0).toDouble());
    ui->editParam5SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM5", 0.0).toDouble());
    ui->editParam6SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM6", 0.0).toDouble());
    ui->editParam7SpinBox->setValue(settings.value("QGC_COMMAND_BUTTON_PARAM7", 0.0).toDouble());
308

309 310
    showlabelname = settings.value("QGC_COMMAND_BUTTON_LABEL","").toString();

311 312 313 314 315 316 317 318 319 320 321
    ui->editCommandComboBox->setCurrentIndex(0);

    // Find combobox entry for this data
    for (int i = 0; i < ui->editCommandComboBox->count(); ++i)
    {
        if (commandId == ui->editCommandComboBox->itemData(i).toInt())
        {
            ui->editCommandComboBox->setCurrentIndex(i);
        }
    }

322
    ui->editParamsVisibleCheckBox->setChecked(settings.value("QGC_COMMAND_BUTTON_PARAMS_VISIBLE").toBool());
323 324
    if (ui->editParamsVisibleCheckBox->isChecked())
    {
325 326 327 328
        ui->editParam1SpinBox->show();
        ui->editParam2SpinBox->show();
        ui->editParam3SpinBox->show();
        ui->editParam4SpinBox->show();
329 330 331
        ui->editParam5SpinBox->show();
        ui->editParam6SpinBox->show();
        ui->editParam7SpinBox->show();
332 333 334
    }
    else
    {
335 336 337 338
        ui->editParam1SpinBox->hide();
        ui->editParam2SpinBox->hide();
        ui->editParam3SpinBox->hide();
        ui->editParam4SpinBox->hide();
339 340 341
        ui->editParam5SpinBox->hide();
        ui->editParam6SpinBox->hide();
        ui->editParam7SpinBox->hide();
342
    }
343 344 345

    ui->editNameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
    ui->nameLabel->setText(settings.value("QGC_COMMAND_BUTTON_DESCRIPTION", "ERROR LOADING BUTTON").toString());
346 347
    responsenum = settings.value("QGC_COMMAND_BUTTON_RESPONSE",0).toInt();
    responsecount = responsenum;
lm's avatar
lm committed
348
}