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);
    }
ConfigAutotuneWidget::ConfigAutotuneWidget(QWidget *parent) :
    ConfigTaskWidget(parent)
{
    m_autotune = new Ui_AutotuneWidget();
    m_autotune->setupUi(this);

    // Connect automatic signals
    autoLoadWidgets();
    disableMouseWheelEvents();

    // Whenever any value changes compute new potential stabilization settings
    connect(m_autotune->rateDamp, SIGNAL(valueChanged(int)), this, SLOT(recomputeStabilization()));
    connect(m_autotune->rateNoise, SIGNAL(valueChanged(int)), this, SLOT(recomputeStabilization()));

    addUAVObject("ModuleSettings");
    addWidget(m_autotune->enableAutoTune);

    SystemIdent *systemIdent = SystemIdent::GetInstance(getObjectManager());
    Q_ASSERT(systemIdent);
    if(systemIdent)
        connect(systemIdent, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(recomputeStabilization()));

    // Connect the apply button for the stabilization settings
    connect(m_autotune->useComputedValues, SIGNAL(pressed()), this, SLOT(saveStabilization()));

    connect(m_autotune->shareDataPB, SIGNAL(pressed()),this, SLOT(onShareData()));
}
ConfigCameraStabilizationWidget::ConfigCameraStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    ui = new Ui_CameraStabilizationWidget();
    ui->setupUi(this);

    addApplySaveButtons(ui->camerastabilizationSaveRAM, ui->camerastabilizationSaveSD);

    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
    if (!settings->useExpertMode()) {
        ui->camerastabilizationSaveRAM->setVisible(false);
    }


    // These widgets don't have direct relation to UAVObjects
    // and need special processing
    QComboBox *outputs[] = {
        ui->rollChannel,
        ui->pitchChannel,
        ui->yawChannel,
    };
    const int NUM_OUTPUTS = sizeof(outputs) / sizeof(outputs[0]);

    // Populate widgets with channel numbers
    for (int i = 0; i < NUM_OUTPUTS; i++) {
        outputs[i]->clear();
        outputs[i]->addItem("None");
        for (quint32 j = 0; j < ActuatorCommand::CHANNEL_NUMELEM; j++) {
            outputs[i]->addItem(QString("Channel %1").arg(j + 1));
        }
    }

    setWikiURL("Camera+Stabilisation+Configuration");
    // Load UAVObjects to widget relations from UI file
    // using objrelation dynamic property
    autoLoadWidgets();

    // Add some widgets to track their UI dirty state and handle smartsave
    addWidget(ui->enableCameraStabilization);
    addWidget(ui->rollChannel);
    addWidget(ui->pitchChannel);
    addWidget(ui->yawChannel);

    // Add some UAVObjects to monitor their changes in addition to autoloaded ones.
    // Note also that we want to reload some UAVObjects by "Reload" button and have
    // to pass corresponding reload group numbers (defined also in objrelation property)
    // to the montitor. We don't reload HwSettings (module enable state) but reload
    // output channels.
    QList<int> reloadGroups;
    reloadGroups << 1;
    addUAVObject("HwSettings");
    addUAVObject("MixerSettings", &reloadGroups);

    // To set special widgets to defaults when requested
    connect(this, SIGNAL(defaultRequested(int)), this, SLOT(defaultRequestedSlot(int)));

    disableMouseWheelEvents();
    updateEnableControls();
}
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();
}
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();
}
Beispiel #6
0
ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    m_stabilization = new Ui_StabilizationWidget();
    m_stabilization->setupUi(this);
    autoLoadWidgets();
    realtimeUpdates=new QTimer(this);
    connect(m_stabilization->realTimeUpdates_6,SIGNAL(stateChanged(int)),this,SLOT(realtimeUpdatesSlot(int)));
    connect(m_stabilization->realTimeUpdates_7,SIGNAL(stateChanged(int)),this,SLOT(realtimeUpdatesSlot(int)));
    connect(realtimeUpdates,SIGNAL(timeout()),this,SLOT(apply()));

    connect(m_stabilization->checkBox_7,SIGNAL(stateChanged(int)),this,SLOT(linkCheckBoxes(int)));
    connect(m_stabilization->checkBox_2,SIGNAL(stateChanged(int)),this,SLOT(linkCheckBoxes(int)));
    connect(m_stabilization->checkBox_8,SIGNAL(stateChanged(int)),this,SLOT(linkCheckBoxes(int)));
    connect(m_stabilization->checkBox_3,SIGNAL(stateChanged(int)),this,SLOT(linkCheckBoxes(int)));

    connect(this,SIGNAL(widgetContentsChanged(QWidget*)),this,SLOT(processLinkedWidgets(QWidget*)));
}
Beispiel #7
0
bool BrokerArchive::open( const char * archiveFile, bool write /*= true*/, bool autoLoad /*= true*/ )
{
	if (! m_Archive.open( archiveFile, write ? Archive::READ_WRITE : Archive::READ ) )
		return false;

	// register all the widgets contained in the archive
	for(int i=0;i<m_Archive.fileCount();i++)
	{
		registerWidget( this, m_Archive.fileKey( i ), m_Archive.fileVersion( i ),
			(m_Archive.fileFlags( i ) & FLAG_AUTOLOAD) && autoLoad, true );
	}

	// load all autoload widgets
	autoLoadWidgets();

	return true;
}
ConfigPipXtremeWidget::ConfigPipXtremeWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
    m_oplink = new Ui_OPLinkWidget();
    m_oplink->setupUi(this);

    // Connect to the OPLinkStatus object updates
    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    UAVObjectManager *objManager = pm->getObject<UAVObjectManager>();
    oplinkStatusObj = dynamic_cast<UAVDataObject *>(objManager->getObject("OPLinkStatus"));
    Q_ASSERT(oplinkStatusObj);
    connect(oplinkStatusObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateStatus(UAVObject *)));

    // Connect to the OPLinkSettings object updates
    oplinkSettingsObj = dynamic_cast<OPLinkSettings *>(objManager->getObject("OPLinkSettings"));
    Q_ASSERT(oplinkSettingsObj);
    connect(oplinkSettingsObj, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(updateSettings(UAVObject *)));

    Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();
    if (!settings->useExpertMode()) {
        m_oplink->Apply->setVisible(false);
    }
    addApplySaveButtons(m_oplink->Apply, m_oplink->Save);

    addWidgetBinding("OPLinkSettings", "MainPort", m_oplink->MainPort);
    addWidgetBinding("OPLinkSettings", "FlexiPort", m_oplink->FlexiPort);
    addWidgetBinding("OPLinkSettings", "VCPPort", m_oplink->VCPPort);
    addWidgetBinding("OPLinkSettings", "MaxRFPower", m_oplink->MaxRFTxPower);
    addWidgetBinding("OPLinkSettings", "MinChannel", m_oplink->MinimumChannel);
    addWidgetBinding("OPLinkSettings", "MaxChannel", m_oplink->MaximumChannel);
    addWidgetBinding("OPLinkSettings", "ChannelSet", m_oplink->ChannelSet);
    addWidgetBinding("OPLinkSettings", "CoordID", m_oplink->CoordID);
    addWidgetBinding("OPLinkSettings", "Coordinator", m_oplink->Coordinator);
    addWidgetBinding("OPLinkSettings", "OneWay", m_oplink->OneWayLink);
    addWidgetBinding("OPLinkSettings", "PPMOnly", m_oplink->PPMOnly);
    addWidgetBinding("OPLinkSettings", "PPM", m_oplink->PPM);
    addWidgetBinding("OPLinkSettings", "ComSpeed", m_oplink->ComSpeed);

    addWidgetBinding("OPLinkStatus", "DeviceID", m_oplink->DeviceID);
    addWidgetBinding("OPLinkStatus", "RxGood", m_oplink->Good);
    addWidgetBinding("OPLinkStatus", "RxCorrected", m_oplink->Corrected);
    addWidgetBinding("OPLinkStatus", "RxErrors", m_oplink->Errors);
    addWidgetBinding("OPLinkStatus", "RxMissed", m_oplink->Missed);
    addWidgetBinding("OPLinkStatus", "RxFailure", m_oplink->RxFailure);
    addWidgetBinding("OPLinkStatus", "UAVTalkErrors", m_oplink->UAVTalkErrors);
    addWidgetBinding("OPLinkStatus", "TxDropped", m_oplink->Dropped);
    addWidgetBinding("OPLinkStatus", "TxResent", m_oplink->Resent);
    addWidgetBinding("OPLinkStatus", "TxFailure", m_oplink->TxFailure);
    addWidgetBinding("OPLinkStatus", "Resets", m_oplink->Resets);
    addWidgetBinding("OPLinkStatus", "Timeouts", m_oplink->Timeouts);
    addWidgetBinding("OPLinkStatus", "RSSI", m_oplink->RSSI);
    addWidgetBinding("OPLinkStatus", "HeapRemaining", m_oplink->FreeHeap);
    addWidgetBinding("OPLinkStatus", "LinkQuality", m_oplink->LinkQuality);
    addWidgetBinding("OPLinkStatus", "RXSeq", m_oplink->RXSeq);
    addWidgetBinding("OPLinkStatus", "TXSeq", m_oplink->TXSeq);
    addWidgetBinding("OPLinkStatus", "RXRate", m_oplink->RXRate);
    addWidgetBinding("OPLinkStatus", "TXRate", m_oplink->TXRate);

    // Connect the bind buttons
    connect(m_oplink->Bind1, SIGNAL(clicked()), this, SLOT(bind()));
    connect(m_oplink->Bind2, SIGNAL(clicked()), this, SLOT(bind()));
    connect(m_oplink->Bind3, SIGNAL(clicked()), this, SLOT(bind()));
    connect(m_oplink->Bind4, SIGNAL(clicked()), this, SLOT(bind()));

    // Connect the selection changed signals.
    connect(m_oplink->PPMOnly, SIGNAL(toggled(bool)), this, SLOT(ppmOnlyChanged()));

    // Request and update of the setting object.
    settingsUpdated = false;
    autoLoadWidgets();
    disableMouseWheelEvents();
    updateEnableControls();
}
Beispiel #9
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);
}
ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTaskWidget(parent),
    boardModel(0), m_stabSettingsBankCount(0), m_currentStabSettingsBank(0)
{
    ui = new Ui_StabilizationWidget();
    ui->setupUi(this);

    setupExpoPlot();

    setupStabBanksGUI();

    ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
    Core::Internal::GeneralSettings *settings = pm->getObject<Core::Internal::GeneralSettings>();

    if (!settings->useExpertMode()) {
        ui->saveStabilizationToRAM_6->setVisible(false);
    }

    autoLoadWidgets();

    realtimeUpdates = new QTimer(this);
    connect(realtimeUpdates, SIGNAL(timeout()), this, SLOT(apply()));

    connect(ui->realTimeUpdates_6, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
    addWidget(ui->realTimeUpdates_6);
    connect(ui->realTimeUpdates_8, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
    addWidget(ui->realTimeUpdates_8);
    connect(ui->realTimeUpdates_12, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
    addWidget(ui->realTimeUpdates_12);
    connect(ui->realTimeUpdates_7, SIGNAL(toggled(bool)), this, SLOT(realtimeUpdatesSlot(bool)));
    addWidget(ui->realTimeUpdates_7);

    connect(ui->checkBox_7, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
    addWidget(ui->checkBox_7);
    connect(ui->checkBox_2, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
    addWidget(ui->checkBox_2);
    connect(ui->checkBox_8, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
    addWidget(ui->checkBox_8);
    connect(ui->checkBox_3, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
    addWidget(ui->checkBox_3);

    addWidget(ui->pushButton_2);
    addWidget(ui->pushButton_3);
    addWidget(ui->pushButton_4);
    addWidget(ui->pushButton_5);
    addWidget(ui->pushButton_6);
    addWidget(ui->pushButton_7);
    addWidget(ui->pushButton_8);
    addWidget(ui->pushButton_9);
    addWidget(ui->pushButton_10);
    addWidget(ui->pushButton_11);
    addWidget(ui->pushButton_20);
    addWidget(ui->pushButton_22);
    addWidget(ui->pushButton_23);

    addWidget(ui->basicResponsivenessGroupBox);
    addWidget(ui->basicResponsivenessCheckBox);
    connect(ui->basicResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
    addWidget(ui->advancedResponsivenessGroupBox);
    addWidget(ui->advancedResponsivenessCheckBox);
    connect(ui->advancedResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));

    connect(ui->defaultThrottleCurveButton, SIGNAL(clicked()), this, SLOT(resetThrottleCurveToDefault()));
    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDSource, SLOT(setEnabled(bool)));
    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDTarget, SLOT(setEnabled(bool)));
    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->ThrustPIDAxis, SLOT(setEnabled(bool)));
    connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->thrustPIDScalingCurve, SLOT(setEnabled(bool)));
    ui->thrustPIDScalingCurve->setXAxisLabel(tr("Thrust"));
    ui->thrustPIDScalingCurve->setYAxisLabel(tr("Scaling factor"));
    ui->thrustPIDScalingCurve->setMin(-0.5);
    ui->thrustPIDScalingCurve->setMax(0.5);
    ui->thrustPIDScalingCurve->initLinearCurve(5, -0.25, 0.25);
    connect(ui->thrustPIDScalingCurve, SIGNAL(curveUpdated()), this, SLOT(throttleCurveUpdated()));

    addWidget(ui->defaultThrottleCurveButton);
    addWidget(ui->enableThrustPIDScalingCheckBox);
    addWidget(ui->thrustPIDScalingCurve);
    addWidget(ui->thrustPIDScalingCurve);
    connect(this, SIGNAL(widgetContentsChanged(QWidget *)), this, SLOT(processLinkedWidgets(QWidget *)));

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

    addWidget(ui->expoPlot);
    connect(ui->expoSpinnerRoll, SIGNAL(valueChanged(int)), this, SLOT(replotExpoRoll(int)));
    connect(ui->expoSpinnerPitch, SIGNAL(valueChanged(int)), this, SLOT(replotExpoPitch(int)));
    connect(ui->expoSpinnerYaw, SIGNAL(valueChanged(int)), this, SLOT(replotExpoYaw(int)));

    disableMouseWheelEvents();
    updateEnableControls();
}