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
|
// Clear the OpenLRS settings when needed
|
||||||
if (isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPENLRS)) {
|
if (isComboboxOptionSelected(m_oplink->Protocol, OPLinkSettings::PROTOCOL_OPENLRS)) {
|
||||||
oplinkSettingsObj->setVersion((quint16)0);
|
QStringList openLRS_settings;
|
||||||
oplinkSettingsObj->setSerialBaudrate(0);
|
openLRS_settings << "Version" << "SerialBaudrate" << "ModemParams" << "Flags" \
|
||||||
oplinkSettingsObj->setRFFrequency(0);
|
<< "RFFrequency" << "RFPower" << "RFChannelSpacing" << "HopChannel";
|
||||||
oplinkSettingsObj->setRFPower((quint16)0);
|
|
||||||
oplinkSettingsObj->setRFChannelSpacing((quint16)0);
|
for (int i = 0; i < openLRS_settings.size(); ++i) {
|
||||||
oplinkSettingsObj->setModemParams((quint16)0);
|
oplinkSettingsObj->getField(openLRS_settings[i])->clear();
|
||||||
oplinkSettingsObj->setFlags((quint16)0);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -80,6 +80,8 @@ public:
|
|||||||
bool isText();
|
bool isText();
|
||||||
QString toString();
|
QString toString();
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
void toXML(QXmlStreamWriter *xmlWriter);
|
void toXML(QXmlStreamWriter *xmlWriter);
|
||||||
void fromXML(QXmlStreamReader *xmlReader);
|
void fromXML(QXmlStreamReader *xmlReader);
|
||||||
|
|
||||||
@ -106,7 +108,6 @@ protected:
|
|||||||
quint8 *data;
|
quint8 *data;
|
||||||
UAVObject *obj;
|
UAVObject *obj;
|
||||||
QMap<quint32, QList<LimitStruct> > elementLimits;
|
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 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);
|
void limitsInitialize(const QString &limits);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user