Esempio n. 1
0
TauLinkGadgetWidget::TauLinkGadgetWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    ui = new Ui_TauLink();
    ui->setupUi(this);

    // Connect to the LinkStatus object updates
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
    rfm22bStatusObj = dynamic_cast<UAVDataObject*>(objManager->getObject("RFM22BStatus"));

    if (rfm22bStatusObj != NULL ) {
        connect(rfm22bStatusObj, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateStatus(UAVObject*)));
        rfm22bStatusObj->requestUpdate();

        autoLoadWidgets();

        addUAVObjectToWidgetRelation("RFM22BStatus", "RxGood", ui->Good);
        addUAVObjectToWidgetRelation("RFM22BStatus", "RxCorrected", ui->Corrected);
        addUAVObjectToWidgetRelation("RFM22BStatus", "RxErrors", ui->Errors);
        addUAVObjectToWidgetRelation("RFM22BStatus", "RxFailure", ui->RxFailure);
        addUAVObjectToWidgetRelation("RFM22BStatus", "Resets", ui->Resets);
        addUAVObjectToWidgetRelation("RFM22BStatus", "Timeouts", ui->Timeouts);
        addUAVObjectToWidgetRelation("RFM22BStatus", "RSSI", ui->RSSI);
        addUAVObjectToWidgetRelation("RFM22BStatus", "LinkQuality", ui->LinkQuality);
        addUAVObjectToWidgetRelation("RFM22BStatus", "RXRate", ui->RXRate);
        addUAVObjectToWidgetRelation("RFM22BStatus", "TXRate", ui->TXRate);
    }
ConfigCCHWWidget::ConfigCCHWWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    m_telemetry = new Ui_CC_HW_Widget();
    m_telemetry->setupUi(this);

    ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>();
    if(!settings->useExpertMode())
        m_telemetry->saveTelemetryToRAM->setVisible(false);


    UAVObjectUtilManager* utilMngr = pm->getObject<UAVObjectUtilManager>();
    int id = utilMngr->getBoardModel();

    switch (id) {
    case 0x0101:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0101.svg"));
        break;
    case 0x0301:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0301.svg"));
        break;
    case 0x0401:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    case 0x0402:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    case 0x0201:
        m_telemetry->label_2->setPixmap(QPixmap(":/uploader/images/deviceID-0201.svg"));
        break;
    default:
        m_telemetry->label_2->setPixmap(QPixmap(":/configgadget/images/coptercontrol.svg"));
        break;
    }
    addApplySaveButtons(m_telemetry->saveTelemetryToRAM,m_telemetry->saveTelemetryToSD);
    addUAVObjectToWidgetRelation("HwCopterControl","FlexiPort",m_telemetry->cbFlexi);
    addUAVObjectToWidgetRelation("HwCopterControl","MainPort",m_telemetry->cbTele);
    addUAVObjectToWidgetRelation("HwCopterControl","RcvrPort",m_telemetry->cbRcvr);
    addUAVObjectToWidgetRelation("HwCopterControl","USB_HIDPort",m_telemetry->cbUsbHid);
    addUAVObjectToWidgetRelation("HwCopterControl","USB_VCPPort",m_telemetry->cbUsbVcp);
    addUAVObjectToWidgetRelation("ModuleSettings","TelemetrySpeed",m_telemetry->telemetrySpeed);
    addUAVObjectToWidgetRelation("ModuleSettings","GPSSpeed",m_telemetry->gpsSpeed);
    addUAVObjectToWidgetRelation("ModuleSettings","ComUsbBridgeSpeed",m_telemetry->comUsbBridgeSpeed);

    // Load UAVObjects to widget relations from UI file
    // using objrelation dynamic property
    autoLoadWidgets();

    connect(m_telemetry->cchwHelp,SIGNAL(clicked()),this,SLOT(openHelp()));
    enableControls(false);
    populateWidgets();
    refreshWidgetsValues();
    forceConnectedState();
}
Esempio n. 3
0
ConfigCCAttitudeWidget::ConfigCCAttitudeWidget(QWidget *parent) :
        ConfigTaskWidget(parent),
        ui(new Ui_ccattitude)
{
    ui->setupUi(this);

    // Initialization of the Paper plane widget
    ui->sixPointHelp->setScene(new QGraphicsScene(this));

    paperplane = new QGraphicsSvgItem();
    paperplane->setSharedRenderer(new QSvgRenderer());
    paperplane->renderer()->load(QString(":/configgadget/images/paper-plane.svg"));
    paperplane->setElementId("plane-horizontal");
    ui->sixPointHelp->scene()->addItem(paperplane);
    ui->sixPointHelp->setSceneRect(paperplane->boundingRect());

    //dynamic widgets don't recieve the connected signal
    forceConnectedState();

    ExtensionSystem::PluginManager *pm=ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings * settings=pm->getObject<Core::Internal::GeneralSettings>();
    if(!settings->useExpertMode())
        ui->applyButton->setVisible(false);
    
    addApplySaveButtons(ui->applyButton,ui->saveButton);
    addUAVObject("AttitudeSettings");
    addUAVObject("InertialSensorSettings");
    addUAVObject("HwCopterControl");

    // Load UAVObjects to widget relations from UI file
    // using objrelation dynamic property
    autoLoadWidgets();
    addUAVObjectToWidgetRelation("AttitudeSettings","ZeroDuringArming",ui->zeroGyroBiasOnArming);

    // Connect signals
    connect(ui->ccAttitudeHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
    connect(ui->sixPointStart, SIGNAL(clicked()), &calibration, SLOT(doStartSixPoint()));
    connect(ui->sixPointSave, SIGNAL(clicked()),  &calibration, SLOT(doSaveSixPointPosition()));
    connect(ui->levelButton ,SIGNAL(clicked()), &calibration, SLOT(doStartLeveling()));
    connect(ui->sixPointCancel, SIGNAL(clicked()), &calibration ,SLOT(doCancelSixPoint()));

    // Let calibration update the UI
    connect(&calibration, SIGNAL(levelingProgressChanged(int)), ui->levelProgress, SLOT(setValue(int)));
    connect(&calibration, SIGNAL(sixPointProgressChanged(int)), ui->sixPointProgress, SLOT(setValue(int)));
    connect(&calibration, SIGNAL(showSixPointMessage(QString)), ui->sixPointCalibInstructions, SLOT(setText(QString)));
    connect(&calibration, SIGNAL(updatePlane(int)), this, SLOT(displayPlane(int)));

    // Let the calibration gadget control some control enables
    connect(&calibration, SIGNAL(toggleSavePosition(bool)), ui->sixPointSave, SLOT(setEnabled(bool)));
    connect(&calibration, SIGNAL(toggleControls(bool)), ui->sixPointCancel, SLOT(setDisabled(bool)));
    connect(&calibration, SIGNAL(toggleControls(bool)), ui->sixPointStart, SLOT(setEnabled(bool)));
    connect(&calibration, SIGNAL(toggleControls(bool)), ui->levelButton, SLOT(setEnabled(bool)));

    addWidget(ui->levelButton);
    refreshWidgetsValues();
}
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject *obj, UAVObjectField * field, QWidget *widget, QString index)
{
    QString objstr;
    QString fieldstr;
    if(obj)
        objstr=obj->getName();
    if(field)
        fieldstr=field->getName();
    addUAVObjectToWidgetRelation(objstr, fieldstr, widget, index);
}
/**
 * Add an UAVObject field to widget relation to the management system
 * @param object name of the object to add
 * @param field name of the field to add
 * @param widget pointer to the widget whitch will display/define the field value
 * @param index index of the field element to add to this relation
 */
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget * widget, QString index)
{
    UAVObject *obj=NULL;
    UAVObjectField *_field=NULL;
    obj = objManager->getObject(QString(object));
    Q_ASSERT(obj);
    _field = obj->getField(QString(field));
    Q_ASSERT(_field);
    addUAVObjectToWidgetRelation(object,field,widget,_field->getElementNames().indexOf(index));
}
void ConfigTaskWidget::addUAVObjectToWidgetRelation(UAVObject * obj,UAVObjectField * field, QWidget * widget, int index,double scale,bool isLimited,QList<int>* defaultReloadGroups, quint32 instID)
{
    QString objstr;
    QString fieldstr;
    if(obj)
        objstr=obj->getName();
    if(field)
        fieldstr=field->getName();
    addUAVObjectToWidgetRelation(objstr,fieldstr,widget,index,scale,isLimited,defaultReloadGroups,instID);
}
/**
 * Add a UAVObject field to widget relation to the management system
 * @param object name of the object to add
 * @param field name of the field to add
 * @param widget pointer to the widget whitch will display/define the field value
 * @param element name of the element of the field element to add to this relation
 * @param scale scale value of this relation
 * @param isLimited bool to signal if this widget contents is limited in value
 * @param defaultReloadGroups default and reload groups this relation belongs to
 * @param instID instance ID of the object used on this relation
 */
void ConfigTaskWidget::addUAVObjectToWidgetRelation(QString object, QString field, QWidget *widget, QString element, double scale, bool isLimited, QList<int> *defaultReloadGroups, quint32 instID)
{
    UAVObject *obj=objManager->getObject(QString(object),instID);
    Q_ASSERT(obj);
    UAVObjectField *_field;
    int index=0;
    if(!field.isEmpty() && obj)
    {
        _field = obj->getField(QString(field));
        if(!element.isEmpty())
            index=_field->getElementNames().indexOf(QString(element));
    }
    addUAVObjectToWidgetRelation(object, field, widget,index,scale,isLimited,defaultReloadGroups,instID);
}
void ConfigTaskWidget::addUAVObject(QString objectName)
{
    addUAVObjectToWidgetRelation(objectName,"",NULL);
}
void ConfigTaskWidget::addWidget(QWidget * widget)
{
    addUAVObjectToWidgetRelation("","",widget);
}
/**
 * Add an object to the management system
 * @param objectName name of the object to add to the management system
 */
void ConfigTaskWidget::addUAVObject(QString objectName,QList<int> * reloadGroups)
{
    addUAVObjectToWidgetRelation(objectName,"",NULL,0,1,false,reloadGroups);
}
Esempio n. 11
0
ConfigModuleWidget::ConfigModuleWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    ui = new Ui::Modules();
    ui->setupUi(this);

    connect(this, SIGNAL(autoPilotConnected()), this, SLOT(recheckTabs()));

    // Populate UAVO strings
    AirspeedSettings *airspeedSettings;
    airspeedSettings = AirspeedSettings::GetInstance(getObjectManager());
    QString airspeedSettingsName = airspeedSettings->getName();

    FlightBatterySettings batterySettings;
    QString batterySettingsName = batterySettings.getName();

    FlightBatteryState batteryState;
    QString batteryStateName = batteryState.getName();

    ModuleSettings moduleSettings;
    QString moduleSettingsName = moduleSettings.getName();

    VibrationAnalysisSettings vibrationAnalysisSettings;
    QString vibrationAnalysisSettingsName = vibrationAnalysisSettings.getName();

    HoTTSettings hoTTSettings;
    QString hoTTSettingsName = hoTTSettings.getName();

    PicoCSettings picoCSettings;
    QString picoCSettingsName = picoCSettings.getName();

    // Link the checkboxes
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbAirspeed, ModuleSettings::ADMINSTATE_AIRSPEED);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbAltitudeHold, ModuleSettings::ADMINSTATE_ALTITUDEHOLD);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbBattery, ModuleSettings::ADMINSTATE_BATTERY);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbComBridge, ModuleSettings::ADMINSTATE_COMUSBBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbGPS, ModuleSettings::ADMINSTATE_GPS);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbUavoMavlink, ModuleSettings::ADMINSTATE_UAVOMAVLINKBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbOveroSync, ModuleSettings::ADMINSTATE_OVEROSYNC);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbVibrationAnalysis, ModuleSettings::ADMINSTATE_VIBRATIONANALYSIS);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbVtolFollower, ModuleSettings::ADMINSTATE_VTOLPATHFOLLOWER);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbPathPlanner, ModuleSettings::ADMINSTATE_PATHPLANNER);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbPicoC, ModuleSettings::ADMINSTATE_PICOC);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbUAVOHottBridge, ModuleSettings::ADMINSTATE_UAVOHOTTBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbUAVOLighttelemetryBridge, ModuleSettings::ADMINSTATE_UAVOLIGHTTELEMETRYBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbUAVOFrskyBridge, ModuleSettings::ADMINSTATE_UAVOFRSKYSENSORHUBBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbUAVOFrSkySPortBridge, ModuleSettings::ADMINSTATE_UAVOFRSKYSPORTBRIDGE);
    addUAVObjectToWidgetRelation(moduleSettingsName, "AdminState", ui->cbGeofence, ModuleSettings::ADMINSTATE_GEOFENCE);

    addUAVObjectToWidgetRelation(batterySettingsName, "SensorType", ui->gb_measureVoltage, FlightBatterySettings::SENSORTYPE_BATTERYVOLTAGE);
    addUAVObjectToWidgetRelation(batterySettingsName, "SensorType", ui->gb_measureCurrent, FlightBatterySettings::SENSORTYPE_BATTERYCURRENT);

    // Link the fields
    addUAVObjectToWidgetRelation(airspeedSettingsName, "GPSSamplePeriod_ms", ui->sb_gpsUpdateRate);
    addUAVObjectToWidgetRelation(airspeedSettingsName, "Scale", ui->sb_pitotScale);
    addUAVObjectToWidgetRelation(airspeedSettingsName, "ZeroPoint", ui->sb_pitotZeroPoint);
    addUAVObjectToWidgetRelation(airspeedSettingsName, "AnalogPin", ui->cbAirspeedAnalog);

    addUAVObjectToWidgetRelation(batterySettingsName, "Type", ui->cb_batteryType);
    addUAVObjectToWidgetRelation(batterySettingsName, "NbCells", ui->sb_numBatteryCells);
    addUAVObjectToWidgetRelation(batterySettingsName, "Capacity", ui->sb_batteryCapacity);
    addUAVObjectToWidgetRelation(batterySettingsName, "VoltagePin", ui->cbVoltagePin);
    addUAVObjectToWidgetRelation(batterySettingsName, "CurrentPin", ui->cbCurrentPin);
    addUAVObjectToWidgetRelation(batterySettingsName, "VoltageThresholds", ui->sb_lowVoltageAlarm, FlightBatterySettings::VOLTAGETHRESHOLDS_ALARM);
    addUAVObjectToWidgetRelation(batterySettingsName, "VoltageThresholds", ui->sb_lowVoltageWarning, FlightBatterySettings::VOLTAGETHRESHOLDS_WARNING);
    addUAVObjectToWidgetRelation(batterySettingsName, "SensorCalibrationFactor", ui->sb_voltageFactor, FlightBatterySettings::SENSORCALIBRATIONFACTOR_VOLTAGE);
    addUAVObjectToWidgetRelation(batterySettingsName, "SensorCalibrationFactor", ui->sb_currentFactor, FlightBatterySettings::SENSORCALIBRATIONFACTOR_CURRENT);
    addUAVObjectToWidgetRelation(batterySettingsName, "SensorCalibrationOffset", ui->sb_voltageOffSet, FlightBatterySettings::SENSORCALIBRATIONOFFSET_VOLTAGE);
    addUAVObjectToWidgetRelation(batterySettingsName, "SensorCalibrationOffset", ui->sb_currentOffSet, FlightBatterySettings::SENSORCALIBRATIONOFFSET_CURRENT);

    addUAVObjectToWidgetRelation(batteryStateName, "Voltage", ui->le_liveVoltageReading);
    addUAVObjectToWidgetRelation(batteryStateName, "Current", ui->le_liveCurrentReading);

    addUAVObjectToWidgetRelation(vibrationAnalysisSettingsName, "SampleRate", ui->sb_sampleRate);
    addUAVObjectToWidgetRelation(vibrationAnalysisSettingsName, "FFTWindowSize", ui->cb_windowSize);

    //HoTT Sensor
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Sensor", ui->cb_GAM, HoTTSettings::SENSOR_GAM);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Sensor", ui->cb_EAM, HoTTSettings::SENSOR_EAM);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Sensor", ui->cb_Vario, HoTTSettings::SENSOR_VARIO);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Sensor", ui->cb_GPS, HoTTSettings::SENSOR_GPS);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Sensor", ui->cb_ESC, HoTTSettings::SENSOR_ESC);

    ui->cb_GAM->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_GAM->setProperty(falseString.toLatin1(), "Disabled");

    ui->cb_EAM->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_EAM->setProperty(falseString.toLatin1(), "Disabled");

    ui->cb_Vario->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_Vario->setProperty(falseString.toLatin1(), "Disabled");

    ui->cb_GPS->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_GPS->setProperty(falseString.toLatin1(), "Disabled");

    ui->cb_ESC->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_ESC->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings POWERVOLTAGE
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINPOWERVOLTAGE, HoTTSettings::LIMIT_MINPOWERVOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXPOWERVOLTAGE, HoTTSettings::LIMIT_MAXPOWERVOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINPOWERVOLTAGE, HoTTSettings::WARNING_MINPOWERVOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXPOWERVOLTAGE, HoTTSettings::WARNING_MAXPOWERVOLTAGE);
    ui->cb_MINPOWERVOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINPOWERVOLTAGE->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXPOWERVOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXPOWERVOLTAGE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings CURRENT
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXCURRENT, HoTTSettings::LIMIT_MAXCURRENT);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXCURRENT, HoTTSettings::WARNING_MAXCURRENT);
    ui->cb_MAXCURRENT->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXCURRENT->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings USEDCAPACITY
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXUSEDCAPACITY, HoTTSettings::LIMIT_MAXUSEDCAPACITY);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXUSEDCAPACITY, HoTTSettings::WARNING_MAXUSEDCAPACITY);
    ui->cb_MAXUSEDCAPACITY->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXUSEDCAPACITY->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings CELLVOLTAGE
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINCELLVOLTAGE, HoTTSettings::LIMIT_MINCELLVOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINCELLVOLTAGE, HoTTSettings::WARNING_MINCELLVOLTAGE);
    ui->cb_MINCELLVOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINCELLVOLTAGE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SENSOR1VOLTAGE
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINSENSOR1VOLTAGE, HoTTSettings::LIMIT_MINSENSOR1VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSENSOR1VOLTAGE, HoTTSettings::LIMIT_MAXSENSOR1VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINSENSOR1VOLTAGE, HoTTSettings::WARNING_MINSENSOR1VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSENSOR1VOLTAGE, HoTTSettings::WARNING_MAXSENSOR1VOLTAGE);
    ui->cb_MINSENSOR1VOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINSENSOR1VOLTAGE->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXSENSOR1VOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSENSOR1VOLTAGE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SENSOR2VOLTAGE
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINSENSOR2VOLTAGE, HoTTSettings::LIMIT_MINSENSOR2VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSENSOR2VOLTAGE, HoTTSettings::LIMIT_MAXSENSOR2VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINSENSOR2VOLTAGE, HoTTSettings::WARNING_MINSENSOR2VOLTAGE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSENSOR2VOLTAGE, HoTTSettings::WARNING_MAXSENSOR2VOLTAGE);
    ui->cb_MINSENSOR2VOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINSENSOR2VOLTAGE->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXSENSOR2VOLTAGE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSENSOR2VOLTAGE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SENSOR1TEMP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINSENSOR1TEMP, HoTTSettings::LIMIT_MINSENSOR1TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSENSOR1TEMP, HoTTSettings::LIMIT_MAXSENSOR1TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINSENSOR1TEMP, HoTTSettings::WARNING_MINSENSOR1TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSENSOR1TEMP, HoTTSettings::WARNING_MAXSENSOR1TEMP);
    ui->cb_MINSENSOR1TEMP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINSENSOR1TEMP->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXSENSOR1TEMP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSENSOR1TEMP->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SENSOR2TEMP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINSENSOR2TEMP, HoTTSettings::LIMIT_MINSENSOR2TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSENSOR2TEMP, HoTTSettings::LIMIT_MAXSENSOR2TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINSENSOR2TEMP, HoTTSettings::WARNING_MINSENSOR2TEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSENSOR2TEMP, HoTTSettings::WARNING_MAXSENSOR2TEMP);
    ui->cb_MINSENSOR2TEMP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINSENSOR2TEMP->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXSENSOR2TEMP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSENSOR2TEMP->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings FUEL
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINFUEL, HoTTSettings::LIMIT_MINFUEL);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINFUEL, HoTTSettings::WARNING_MINFUEL);
    ui->cb_MINFUEL->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINFUEL->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SENSOR1TEMP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINRPM, HoTTSettings::LIMIT_MINRPM);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXRPM, HoTTSettings::LIMIT_MAXRPM);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINRPM, HoTTSettings::WARNING_MINRPM);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXRPM, HoTTSettings::WARNING_MAXRPM);
    ui->cb_MINRPM->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINRPM->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXRPM->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXRPM->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SERVOTEMP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSERVOTEMP, HoTTSettings::LIMIT_MAXSERVOTEMP);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSERVOTEMP, HoTTSettings::WARNING_MAXSERVOTEMP);
    ui->cb_MAXSERVOTEMP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSERVOTEMP->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SERVODIFFERENCE
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSERVODIFFERENCE, HoTTSettings::LIMIT_MAXSERVODIFFERENCE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSERVODIFFERENCE, HoTTSettings::WARNING_MAXSERVODIFFERENCE);
    ui->cb_MAXSERVODIFFERENCE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSERVODIFFERENCE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SPEED
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINSPEED, HoTTSettings::LIMIT_MINSPEED);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXSPEED, HoTTSettings::LIMIT_MAXSPEED);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINSPEED, HoTTSettings::WARNING_MINSPEED);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXSPEED, HoTTSettings::WARNING_MAXSPEED);
    ui->cb_MINSPEED->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINSPEED->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXSPEED->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXSPEED->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SPEED
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MINHEIGHT, HoTTSettings::LIMIT_MINHEIGHT);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXHEIGHT, HoTTSettings::LIMIT_MAXHEIGHT);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MINHEIGHT, HoTTSettings::WARNING_MINHEIGHT);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXHEIGHT, HoTTSettings::WARNING_MAXHEIGHT);
    ui->cb_MINHEIGHT->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MINHEIGHT->setProperty(falseString.toLatin1(), "Disabled");
    ui->cb_MAXHEIGHT->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXHEIGHT->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings SERVOTEMP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_MAXDISTANCE, HoTTSettings::LIMIT_MAXDISTANCE);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_MAXDISTANCE, HoTTSettings::WARNING_MAXDISTANCE);
    ui->cb_MAXDISTANCE->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_MAXDISTANCE->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings NEGDIFFERENCE1
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_NEGDIFFERENCE1, HoTTSettings::LIMIT_NEGDIFFERENCE1);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_NEGDIFFERENCE1, HoTTSettings::WARNING_NEGDIFFERENCE1);
    ui->cb_NEGDIFFERENCE1->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_NEGDIFFERENCE1->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings NEGDIFFERENCE2
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_NEGDIFFERENCE2, HoTTSettings::LIMIT_NEGDIFFERENCE2);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_NEGDIFFERENCE2, HoTTSettings::WARNING_NEGDIFFERENCE2);
    ui->cb_NEGDIFFERENCE2->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_NEGDIFFERENCE2->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings POSDIFFERENCE1
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_POSDIFFERENCE1, HoTTSettings::LIMIT_POSDIFFERENCE1);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_POSDIFFERENCE1, HoTTSettings::WARNING_POSDIFFERENCE1);
    ui->cb_POSDIFFERENCE1->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_POSDIFFERENCE1->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings POSDIFFERENCE2
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Limit", ui->sb_POSDIFFERENCE2, HoTTSettings::LIMIT_POSDIFFERENCE2);
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_POSDIFFERENCE2, HoTTSettings::WARNING_POSDIFFERENCE2);
    ui->cb_POSDIFFERENCE2->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_POSDIFFERENCE2->setProperty(falseString.toLatin1(), "Disabled");

    //HoTT Settings ALTITUDEBEEP
    addUAVObjectToWidgetRelation(hoTTSettingsName, "Warning", ui->cb_ALTITUDEBEEP, HoTTSettings::WARNING_ALTITUDEBEEP);
    ui->cb_ALTITUDEBEEP->setProperty(trueString.toLatin1(), "Enabled");
    ui->cb_ALTITUDEBEEP->setProperty(falseString.toLatin1(), "Disabled");

    // Connect PicoC settings
    addUAVObjectToWidgetRelation(picoCSettingsName, "MaxFileSize", ui->sb_picocMaxFileSize);
    addUAVObjectToWidgetRelation(picoCSettingsName, "TaskStackSize", ui->sb_picocTaskStackSize);
    addUAVObjectToWidgetRelation(picoCSettingsName, "PicoCStackSize", ui->sb_picocPicoCStackSize);
    addUAVObjectToWidgetRelation(picoCSettingsName, "BootFileID", ui->sb_picocBootFileID);
    addUAVObjectToWidgetRelation(picoCSettingsName, "Startup", ui->cb_picocStartup);
    addUAVObjectToWidgetRelation(picoCSettingsName, "Source", ui->cb_picocSource);
    addUAVObjectToWidgetRelation(picoCSettingsName, "ComSpeed", ui->cb_picocComSpeed);

    //Help button
    addHelpButton(ui->inputHelp,"https://github.com/TauLabs/TauLabs/wiki/OnlineHelp:-Modules");

    // Connect any remaining widgets
    connect(airspeedSettings, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(updateAirspeedUAVO(UAVObject *)));
    connect(ui->pb_startVibrationTest, SIGNAL(clicked()), this, SLOT(toggleVibrationTest()));

    // Set text properties for checkboxes. The second argument is the UAVO field that corresponds
    // to the checkbox's true (respectively, false) state.
    ui->cbAirspeed->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbAirspeed->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbAltitudeHold->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbAltitudeHold->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbBattery->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbBattery->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbComBridge->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbComBridge->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbGPS->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbGPS->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbUavoMavlink->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbUavoMavlink->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbOveroSync->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbOveroSync->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbVibrationAnalysis->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbVibrationAnalysis->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbVtolFollower->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbVtolFollower->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbPathPlanner->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbPathPlanner->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbPicoC->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbPicoC->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbUAVOHottBridge->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbUAVOHottBridge->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbUAVOFrskyBridge->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbUAVOFrskyBridge->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbUAVOFrSkySPortBridge->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbUAVOFrSkySPortBridge->setProperty(falseString.toLatin1(), "Disabled");

    ui->cbUAVOLighttelemetryBridge->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbUAVOLighttelemetryBridge->setProperty(falseString.toLatin1(), "Disabled");	

    ui->cbGeofence->setProperty(trueString.toLatin1(), "Enabled");
    ui->cbGeofence->setProperty(falseString.toLatin1(), "Disabled");

    ui->gb_measureVoltage->setProperty(trueString.toLatin1(), "Enabled");
    ui->gb_measureVoltage->setProperty(falseString.toLatin1(), "Disabled");

    ui->gb_measureCurrent->setProperty(trueString.toLatin1(), "Enabled");
    ui->gb_measureCurrent->setProperty(falseString.toLatin1(), "Disabled");

    enableBatteryTab(false);
    enableAirspeedTab(false);
    enableVibrationTab(false);
    enableHoTTTelemetryTab(false);
    enableGeofenceTab(false);
    enablePicoCTab(false);

    // Load UAVObjects to widget relations from UI file
    // using objrelation dynamic property
    autoLoadWidgets();

    // Refresh widget contents
    refreshWidgetsValues();

    // Prevent mouse wheel from changing values
    disableMouseWheelEvents();

    setNotMandatory(batterySettingsName);
    setNotMandatory(airspeedSettingsName);
    setNotMandatory(vibrationAnalysisSettingsName);
    setNotMandatory(hoTTSettingsName);
    setNotMandatory(picoCSettingsName);
    setNotMandatory(GeoFenceSettings::NAME);
}