mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-474: Config gadget option for the "spinning while armed" check box
This commit is contained in:
parent
401a989c63
commit
bd06f156da
@ -144,6 +144,8 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren
|
|||||||
|
|
||||||
firstUpdate = true;
|
firstUpdate = true;
|
||||||
|
|
||||||
|
connect(m_config->spinningArmed, SIGNAL(toggled(bool)), this, SLOT(setSpinningArmed(bool)));
|
||||||
|
|
||||||
enableControls(false);
|
enableControls(false);
|
||||||
|
|
||||||
// Listen to telemetry connection events
|
// Listen to telemetry connection events
|
||||||
@ -307,7 +309,17 @@ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the "Spin motors at neutral when armed" flag in ActuatorSettings
|
||||||
|
*/
|
||||||
|
void ConfigOutputWidget::setSpinningArmed(bool val)
|
||||||
|
{
|
||||||
|
UAVDataObject *obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ActuatorSettings")));
|
||||||
|
if (!obj) return;
|
||||||
|
UAVObjectField *field = obj->getField("MotorsSpinWhileArmed");
|
||||||
|
if (!field) return;
|
||||||
|
field->setValue(val);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sends the channel value to the UAV to move the servo.
|
Sends the channel value to the UAV to move the servo.
|
||||||
@ -400,6 +412,10 @@ void ConfigOutputWidget::requestRCOutputUpdate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the SpinWhileArmed setting
|
||||||
|
field = obj->getField(QString("MotorsSpinWhileArmed"));
|
||||||
|
m_config->spinningArmed->setChecked(field->getValue().toBool());
|
||||||
|
|
||||||
// Get Output rates for both banks
|
// Get Output rates for both banks
|
||||||
field = obj->getField(QString("ChannelUpdateFreq"));
|
field = obj->getField(QString("ChannelUpdateFreq"));
|
||||||
m_config->outputRate1->setValue(field->getValue(0).toInt());
|
m_config->outputRate1->setValue(field->getValue(0).toInt());
|
||||||
|
@ -85,6 +85,7 @@ private slots:
|
|||||||
void setChOutRange();
|
void setChOutRange();
|
||||||
void reverseChannel(bool state);
|
void reverseChannel(bool state);
|
||||||
void linkToggled(bool state);
|
void linkToggled(bool state);
|
||||||
|
void setSpinningArmed(bool val);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -838,7 +838,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<widget class="QPushButton" name="saveRCOutputToSD">
|
<widget class="QPushButton" name="saveRCOutputToSD">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>490</x>
|
<x>530</x>
|
||||||
<y>310</y>
|
<y>310</y>
|
||||||
<width>93</width>
|
<width>93</width>
|
||||||
<height>27</height>
|
<height>27</height>
|
||||||
@ -855,7 +855,7 @@ Applies and Saves all settings to SD</string>
|
|||||||
<widget class="QPushButton" name="getRCOutputCurrent">
|
<widget class="QPushButton" name="getRCOutputCurrent">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>270</x>
|
<x>330</x>
|
||||||
<y>310</y>
|
<y>310</y>
|
||||||
<width>93</width>
|
<width>93</width>
|
||||||
<height>27</height>
|
<height>27</height>
|
||||||
@ -871,7 +871,7 @@ Applies and Saves all settings to SD</string>
|
|||||||
<widget class="QPushButton" name="saveRCOutputToRAM">
|
<widget class="QPushButton" name="saveRCOutputToRAM">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>380</x>
|
<x>430</x>
|
||||||
<y>310</y>
|
<y>310</y>
|
||||||
<width>93</width>
|
<width>93</width>
|
||||||
<height>27</height>
|
<height>27</height>
|
||||||
@ -1443,6 +1443,19 @@ p, li { white-space: pre-wrap; }
|
|||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QCheckBox" name="spinningArmed">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>310</y>
|
||||||
|
<width>301</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Motors at neutral (spinning) when armed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user