/** * Constructor */ ConfigTaskWidget::ConfigTaskWidget(QWidget *parent) : QWidget(parent),isConnected(false),smartsave(NULL),dirty(false),outOfLimitsStyle("background-color: rgb(255, 0, 0);") { pm = ExtensionSystem::PluginManager::instance(); objManager = pm->getObject<UAVObjectManager>(); TelemetryManager* telMngr = pm->getObject<TelemetryManager>(); connect(telMngr, SIGNAL(connected()), this, SLOT(onAutopilotConnect())); connect(telMngr, SIGNAL(disconnected()), this, SLOT(onAutopilotDisconnect())); connect(telMngr, SIGNAL(connected()), this, SIGNAL(autoPilotConnected())); connect(telMngr, SIGNAL(disconnected()), this, SIGNAL(autoPilotDisconnected())); UAVSettingsImportExportFactory * importexportplugin = pm->getObject<UAVSettingsImportExportFactory>(); connect(importexportplugin,SIGNAL(importAboutToBegin()),this,SLOT(invalidateObjects())); }
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(); }