mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
LP-505 Use clear() for OpenLRS settings reset
This commit is contained in:
parent
ba5e5695db
commit
289285cadb
@ -608,13 +608,13 @@ void ConfigOPLinkWidget::unbind()
|
||||
|
||||
// Clear the OpenLRS settings when needed
|
||||
if (isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPENLRS)) {
|
||||
oplinkSettingsObj->setVersion((quint16)0);
|
||||
oplinkSettingsObj->setSerialBaudrate(0);
|
||||
oplinkSettingsObj->setRFFrequency(0);
|
||||
oplinkSettingsObj->setRFPower((quint16)0);
|
||||
oplinkSettingsObj->setRFChannelSpacing((quint16)0);
|
||||
oplinkSettingsObj->setModemParams((quint16)0);
|
||||
oplinkSettingsObj->setFlags((quint16)0);
|
||||
QStringList openLRS_settings;
|
||||
openLRS_settings << "Version" << "SerialBaudrate" << "ModemParams" << "Flags" \
|
||||
<< "RFFrequency" << "RFPower" << "RFChannelSpacing" << "HopChannel";
|
||||
|
||||
for (int i = 0; i < openLRS_settings.size(); ++i) {
|
||||
oplinkSettingsObj->getField(openLRS_settings[i])->clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,6 +80,8 @@ public:
|
||||
bool isText();
|
||||
QString toString();
|
||||
|
||||
void clear();
|
||||
|
||||
void toXML(QXmlStreamWriter *xmlWriter);
|
||||
void fromXML(QXmlStreamReader *xmlReader);
|
||||
|
||||
@ -106,7 +108,6 @@ protected:
|
||||
quint8 *data;
|
||||
UAVObject *obj;
|
||||
QMap<quint32, QList<LimitStruct> > elementLimits;
|
||||
void clear();
|
||||
void constructorInitialize(const QString & name, const QString & description, const QString & units, FieldType type, const QStringList & elementNames, const QStringList & options, const QString &limits);
|
||||
void limitsInitialize(const QString &limits);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user