Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
b8e9fe47
Commit
b8e9fe47
authored
Jan 13, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Reboot Required fact meta data
parent
621e754b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
8 deletions
+50
-8
Fact.cc
src/FactSystem/Fact.cc
+10
-0
Fact.h
src/FactSystem/Fact.h
+2
-0
FactMetaData.cc
src/FactSystem/FactMetaData.cc
+3
-0
FactMetaData.h
src/FactSystem/FactMetaData.h
+3
-0
ParameterLoader.cc
src/FactSystem/ParameterLoader.cc
+4
-0
APMParameterMetaData.cc
src/FirmwarePlugin/APM/APMParameterMetaData.cc
+7
-0
APMParameterMetaData.h
src/FirmwarePlugin/APM/APMParameterMetaData.h
+13
-8
PX4ParameterMetaData.cc
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
+8
-0
No files found.
src/FactSystem/Fact.cc
View file @
b8e9fe47
...
...
@@ -482,3 +482,13 @@ QString Fact::validate(const QString& cookedValue, bool convertOnly)
return
QString
(
"Internal error: Meta data pointer missing"
);
}
}
bool
Fact
::
rebootRequired
(
void
)
const
{
if
(
_metaData
)
{
return
_metaData
->
rebootRequired
();
}
else
{
qWarning
()
<<
"Meta data pointer missing"
;
return
false
;
}
}
src/FactSystem/Fact.h
View file @
b8e9fe47
...
...
@@ -66,6 +66,7 @@ public:
Q_PROPERTY
(
QString
minString
READ
cookedMinString
CONSTANT
)
Q_PROPERTY
(
bool
minIsDefaultForType
READ
minIsDefaultForType
CONSTANT
)
Q_PROPERTY
(
QString
name
READ
name
CONSTANT
)
Q_PROPERTY
(
bool
rebootRequired
READ
rebootRequired
CONSTANT
)
Q_PROPERTY
(
QString
shortDescription
READ
shortDescription
CONSTANT
)
Q_PROPERTY
(
FactMetaData
::
ValueType_t
type
READ
type
CONSTANT
)
Q_PROPERTY
(
QString
units
READ
cookedUnits
CONSTANT
)
...
...
@@ -109,6 +110,7 @@ public:
QString
rawValueString
(
void
)
const
;
QString
cookedValueString
(
void
)
const
;
bool
valueEqualsDefault
(
void
)
const
;
bool
rebootRequired
(
void
)
const
;
void
setRawValue
(
const
QVariant
&
value
);
void
setCookedValue
(
const
QVariant
&
value
);
...
...
src/FactSystem/FactMetaData.cc
View file @
b8e9fe47
...
...
@@ -51,6 +51,7 @@ FactMetaData::FactMetaData(QObject* parent)
,
_minIsDefaultForType
(
true
)
,
_rawTranslator
(
_defaultTranslator
)
,
_cookedTranslator
(
_defaultTranslator
)
,
_rebootRequired
(
false
)
{
}
...
...
@@ -68,6 +69,7 @@ FactMetaData::FactMetaData(ValueType_t type, QObject* parent)
,
_minIsDefaultForType
(
true
)
,
_rawTranslator
(
_defaultTranslator
)
,
_cookedTranslator
(
_defaultTranslator
)
,
_rebootRequired
(
false
)
{
}
...
...
@@ -100,6 +102,7 @@ const FactMetaData& FactMetaData::operator=(const FactMetaData& other)
_cookedUnits
=
other
.
_cookedUnits
;
_rawTranslator
=
other
.
_rawTranslator
;
_cookedTranslator
=
other
.
_cookedTranslator
;
_rebootRequired
=
other
.
_rebootRequired
;
return
*
this
;
}
...
...
src/FactSystem/FactMetaData.h
View file @
b8e9fe47
...
...
@@ -81,6 +81,7 @@ public:
ValueType_t
type
(
void
)
const
{
return
_type
;
}
QString
rawUnits
(
void
)
const
{
return
_rawUnits
;
}
QString
cookedUnits
(
void
)
const
{
return
_cookedUnits
;
}
bool
rebootRequired
(
void
)
const
{
return
_rebootRequired
;
}
Translator
rawTranslator
(
void
)
const
{
return
_rawTranslator
;
}
Translator
cookedTranslator
(
void
)
const
{
return
_cookedTranslator
;
}
...
...
@@ -102,6 +103,7 @@ public:
void
setName
(
const
QString
&
name
)
{
_name
=
name
;
}
void
setShortDescription
(
const
QString
&
shortDescription
)
{
_shortDescription
=
shortDescription
;
}
void
setRawUnits
(
const
QString
&
rawUnits
);
void
setRebootRequired
(
bool
rebootRequired
)
{
_rebootRequired
=
rebootRequired
;
}
void
setTranslators
(
Translator
rawTranslator
,
Translator
cookedTranslator
);
...
...
@@ -150,6 +152,7 @@ private:
QString
_cookedUnits
;
Translator
_rawTranslator
;
Translator
_cookedTranslator
;
bool
_rebootRequired
;
struct
BuiltInTranslation_s
{
const
char
*
rawUnits
;
...
...
src/FactSystem/ParameterLoader.cc
View file @
b8e9fe47
...
...
@@ -295,6 +295,10 @@ void ParameterLoader::_valueUpdated(const QVariant& value)
_writeParameterRaw
(
componentId
,
fact
->
name
(),
value
);
qCDebug
(
ParameterLoaderLog
)
<<
"Set parameter (componentId:"
<<
componentId
<<
"name:"
<<
name
<<
value
<<
")"
;
if
(
fact
->
rebootRequired
())
{
qgcApp
()
->
showMessage
(
QStringLiteral
(
"Change of parameter %1 requires a Vehicle reboot to take affect"
).
arg
(
name
));
}
}
void
ParameterLoader
::
refreshAllParameters
(
void
)
...
...
src/FirmwarePlugin/APM/APMParameterMetaData.cc
View file @
b8e9fe47
...
...
@@ -342,6 +342,7 @@ bool APMParameterMetaData::parseParameterAttributes(QXmlStreamReader& xml, APMFa
// skip empty elements. Somehow I am getting lot of these. Dont know what to do with them.
}
else
if
(
elementName
==
"field"
)
{
QString
attributeName
=
xml
.
attributes
().
value
(
"name"
).
toString
();
if
(
attributeName
==
"Range"
)
{
QString
range
=
xml
.
readElementText
().
trimmed
();
QStringList
rangeList
=
range
.
split
(
' '
);
...
...
@@ -402,6 +403,11 @@ bool APMParameterMetaData::parseParameterAttributes(QXmlStreamReader& xml, APMFa
if
(
parseError
)
{
rawMetaData
->
bitmask
.
clear
();
}
}
else
if
(
attributeName
==
"RebootRequired"
)
{
QString
strValue
=
xml
.
readElementText
().
trimmed
();
if
(
strValue
.
compare
(
"true"
,
Qt
::
CaseInsensitive
)
==
0
)
{
rawMetaData
->
rebootRequired
=
true
;
}
}
}
else
if
(
elementName
==
"values"
)
{
// doing nothing individual value will follow anyway. May be used for sanity checking.
...
...
@@ -447,6 +453,7 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType)
metaData
->
setName
(
rawMetaData
->
name
);
metaData
->
setGroup
(
rawMetaData
->
group
);
metaData
->
setRebootRequired
(
rawMetaData
->
rebootRequired
);
if
(
!
rawMetaData
->
shortDescription
.
isEmpty
())
{
metaData
->
setShortDescription
(
rawMetaData
->
shortDescription
);
...
...
src/FirmwarePlugin/APM/APMParameterMetaData.h
View file @
b8e9fe47
...
...
@@ -37,14 +37,19 @@
class
APMFactMetaDataRaw
{
public:
QString
name
;
QString
group
;
QString
shortDescription
;
QString
longDescription
;
QString
min
;
QString
max
;
QString
incrementSize
;
QString
units
;
APMFactMetaDataRaw
(
void
)
:
rebootRequired
(
false
)
{
}
QString
name
;
QString
group
;
QString
shortDescription
;
QString
longDescription
;
QString
min
;
QString
max
;
QString
incrementSize
;
QString
units
;
bool
rebootRequired
;
QList
<
QPair
<
QString
,
QString
>
>
values
;
QList
<
QPair
<
QString
,
QString
>
>
bitmask
;
};
...
...
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
View file @
b8e9fe47
...
...
@@ -312,6 +312,14 @@ void PX4ParameterMetaData::_loadParameterFactMetaData(void)
qCWarning
(
PX4ParameterMetaDataLog
)
<<
"Invalid decimals value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" decimals:"
<<
text
<<
" error: invalid number"
;
}
}
else
if
(
elementName
==
"reboot_required"
)
{
Q_ASSERT
(
metaData
);
QString
text
=
xml
.
readElementText
();
qCDebug
(
PX4ParameterMetaDataLog
)
<<
"RebootRequired:"
<<
text
;
if
(
text
.
compare
(
"true"
,
Qt
::
CaseInsensitive
)
==
0
)
{
metaData
->
setRebootRequired
(
true
);
}
}
else
{
qDebug
()
<<
"Unknown element in XML: "
<<
elementName
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment