1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1604 Initialize accessoryDesiredObjects the the plugin constructor

This commit is contained in:
Stefan Karlsson 2014-11-09 22:54:13 +01:00
parent 90e0459522
commit fd801e3637

View File

@ -68,6 +68,14 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) :
flightModeSettingsObj = FlightModeSettings::GetInstance(getObjectManager());
flightStatusObj = FlightStatus::GetInstance(getObjectManager());
receiverActivityObj = ReceiverActivity::GetInstance(getObjectManager());
accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0);
accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1);
accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2);
// Only instance 0 is present if the board is not connected.
// The other instances are populated lazily.
Q_ASSERT(accessoryDesiredObj0);
ui = new Ui_InputWidget();
ui->setupUi(this);
@ -401,14 +409,6 @@ void ConfigInputWidget::goToWizard()
flightModeSettingsData.Arming = FlightModeSettings::ARMING_ALWAYSDISARMED;
flightModeSettingsObj->setData(flightModeSettingsData);
accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0);
accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1);
accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2);
// Only instance 0 is present if the board is not connected.
// The other instances are populated lazily.
Q_ASSERT(accessoryDesiredObj0);
// Use faster input update rate.
fastMdata();