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
6256bc21
Commit
6256bc21
authored
Aug 04, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
9f396d68
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
FactMetaData.cc
src/FactSystem/FactMetaData.cc
+23
-18
No files found.
src/FactSystem/FactMetaData.cc
View file @
6256bc21
...
...
@@ -321,9 +321,9 @@ bool FactMetaData::isInRawMinLimit(const QVariant& variantValue) const
case
valueTypeInt64
:
return
_rawMin
.
value
<
int64_t
>
()
<=
variantValue
.
value
<
int64_t
>
();
case
valueTypeFloat
:
return
_rawMin
.
value
<
float
>
()
<=
variantValue
.
value
<
float
>
();
return
qIsNaN
(
variantValue
.
toFloat
())
||
_rawMin
.
value
<
float
>
()
<=
variantValue
.
value
<
float
>
();
case
valueTypeDouble
:
return
_rawMin
.
value
<
double
>
()
<=
variantValue
.
value
<
double
>
();
return
qIsNaN
(
variantValue
.
toDouble
())
||
_rawMin
.
value
<
double
>
()
<=
variantValue
.
value
<
double
>
();
default:
return
true
;
}
...
...
@@ -351,9 +351,9 @@ bool FactMetaData::isInRawMaxLimit(const QVariant& variantValue) const
case
valueTypeInt64
:
return
_rawMax
.
value
<
int64_t
>
()
>=
variantValue
.
value
<
int64_t
>
();
case
valueTypeFloat
:
return
_rawMax
.
value
<
float
>
()
>=
variantValue
.
value
<
float
>
();
return
qIsNaN
(
variantValue
.
toFloat
())
||
_rawMax
.
value
<
float
>
()
>=
variantValue
.
value
<
float
>
();
case
valueTypeDouble
:
return
_rawMax
.
value
<
double
>
()
>=
variantValue
.
value
<
double
>
();
return
qIsNaN
(
variantValue
.
toDouble
())
||
_rawMax
.
value
<
double
>
()
>=
variantValue
.
value
<
double
>
();
default:
return
true
;
}
...
...
@@ -1294,19 +1294,23 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q
metaData
->
setRawUnits
(
json
[
_unitsJsonKey
].
toString
());
}
QString
defaultValueJsonKey
;
QString
defaultValueJsonKey
=
_defaultValueJsonKey
;
#ifdef __mobile__
if
(
json
.
contains
(
_mobileDefaultValueJsonKey
))
{
defaultValueJsonKey
=
_mobileDefaultValueJsonKey
;
}
#endif
if
(
defaultValueJsonKey
.
isEmpty
()
&&
json
.
contains
(
_defaultValueJsonKey
))
{
defaultValueJsonKey
=
_defaultValueJsonKey
;
}
if
(
!
defaultValueJsonKey
.
isEmpty
())
{
if
(
json
.
contains
(
defaultValueJsonKey
))
{
const
QJsonValue
jsonValue
=
json
[
defaultValueJsonKey
];
if
(
jsonValue
.
type
()
==
QJsonValue
::
Null
&&
(
type
==
valueTypeFloat
||
type
==
valueTypeDouble
))
{
metaData
->
setRawDefaultValue
(
type
==
valueTypeFloat
?
std
::
numeric_limits
<
float
>::
quiet_NaN
()
:
std
::
numeric_limits
<
double
>::
quiet_NaN
());
}
else
{
QVariant
typedValue
;
QString
errorString
;
QVariant
initialValue
=
json
[
defaultValueJsonKey
].
toVariant
();
QVariant
initialValue
=
jsonValue
.
toVariant
();
if
(
metaData
->
convertAndValidateRaw
(
initialValue
,
true
/* convertOnly */
,
typedValue
,
errorString
))
{
metaData
->
setRawDefaultValue
(
typedValue
);
}
else
{
...
...
@@ -1316,6 +1320,7 @@ FactMetaData* FactMetaData::createFromJsonObject(const QJsonObject& json, QMap<Q
<<
" error:"
<<
errorString
;
}
}
}
if
(
json
.
contains
(
_incrementJsonKey
))
{
QVariant
typedValue
;
...
...
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