Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
ed8e6bd4
Commit
ed8e6bd4
authored
Sep 26, 2017
by
Don Gagne
Committed by
GitHub
Sep 26, 2017
Browse files
Merge pull request #5699 from bluerobotics/pr-mobile-default-fact
Add JSON key for mobile-specific default values
parents
de55d6e8
1f220051
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/FactSystem/FactMetaData.cc
View file @
ed8e6bd4
...
...
@@ -68,6 +68,7 @@ const char* FactMetaData::_shortDescriptionJsonKey = "shortDescription";
const
char
*
FactMetaData
::
_longDescriptionJsonKey
=
"longDescription"
;
const
char
*
FactMetaData
::
_unitsJsonKey
=
"units"
;
const
char
*
FactMetaData
::
_defaultValueJsonKey
=
"defaultValue"
;
const
char
*
FactMetaData
::
_mobileDefaultValueJsonKey
=
"mobileDefaultValue"
;
const
char
*
FactMetaData
::
_minJsonKey
=
"min"
;
const
char
*
FactMetaData
::
_maxJsonKey
=
"max"
;
...
...
@@ -861,9 +862,17 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QObjec
if
(
json
.
contains
(
_unitsJsonKey
))
{
metaData
->
setRawUnits
(
json
[
_unitsJsonKey
].
toString
());
}
#ifdef __mobile__
if
(
json
.
contains
(
_mobileDefaultValueJsonKey
))
{
metaData
->
setRawDefaultValue
(
json
[
_mobileDefaultValueJsonKey
].
toVariant
());
}
else
if
(
json
.
contains
(
_defaultValueJsonKey
))
{
metaData
->
setRawDefaultValue
(
json
[
_defaultValueJsonKey
].
toVariant
());
}
#else
if
(
json
.
contains
(
_defaultValueJsonKey
))
{
metaData
->
setRawDefaultValue
(
json
[
_defaultValueJsonKey
].
toVariant
());
}
#endif
if
(
json
.
contains
(
_minJsonKey
))
{
QVariant
typedValue
;
QString
errorString
;
...
...
src/FactSystem/FactMetaData.h
View file @
ed8e6bd4
...
...
@@ -245,6 +245,7 @@ private:
static
const
char
*
_longDescriptionJsonKey
;
static
const
char
*
_unitsJsonKey
;
static
const
char
*
_defaultValueJsonKey
;
static
const
char
*
_mobileDefaultValueJsonKey
;
static
const
char
*
_minJsonKey
;
static
const
char
*
_maxJsonKey
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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