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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
113 additions
and
108 deletions
+113
-108
FactMetaData.cc
src/FactSystem/FactMetaData.cc
+23
-18
EstimatorStatusFactGroup.json
src/Vehicle/EstimatorStatusFactGroup.json
+90
-90
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,26 +1294,31 @@ 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
())
{
QVariant
typedValue
;
QString
errorString
;
QVariant
initialValue
=
json
[
defaultValueJsonKey
].
toVariant
();
if
(
metaData
->
convertAndValidateRaw
(
initialValue
,
true
/* convertOnly */
,
typedValue
,
errorString
))
{
metaData
->
setRawDefaultValue
(
typedValue
);
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
{
qWarning
()
<<
"Invalid default value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
initialValue
<<
" error:"
<<
errorString
;
QVariant
typedValue
;
QString
errorString
;
QVariant
initialValue
=
jsonValue
.
toVariant
();
if
(
metaData
->
convertAndValidateRaw
(
initialValue
,
true
/* convertOnly */
,
typedValue
,
errorString
))
{
metaData
->
setRawDefaultValue
(
typedValue
);
}
else
{
qWarning
()
<<
"Invalid default value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
initialValue
<<
" error:"
<<
errorString
;
}
}
}
...
...
src/Vehicle/EstimatorStatusFactGroup.json
View file @
6256bc21
{
"version"
:
1
,
"fileType"
:
"FactMetaData"
,
"version"
:
1
,
"fileType"
:
"FactMetaData"
,
"QGC.MetaData.Facts"
:
[
{
"name"
:
"goodAttitudeEsimate"
,
"shortDesc"
:
"Good Attitude Esimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodAttitudeEsimate"
,
"shortDesc"
:
"Good Attitude Esimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodHorizVelEstimate"
,
"shortDesc"
:
"Good Horiz Vel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodHorizVelEstimate"
,
"shortDesc"
:
"Good Horiz Vel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodVertVelEstimate"
,
"shortDesc"
:
"Good Vert Vel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodVertVelEstimate"
,
"shortDesc"
:
"Good Vert Vel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodHorizPosRelEstimate"
,
"shortDesc"
:
"Good Horiz Pos Rel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodHorizPosRelEstimate"
,
"shortDesc"
:
"Good Horiz Pos Rel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodHorizPosAbsEstimate"
,
"shortDesc"
:
"Good Horiz Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodHorizPosAbsEstimate"
,
"shortDesc"
:
"Good Horiz Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodVertPosAbsEstimate"
,
"shortDesc"
:
"Good Vert Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodVertPosAbsEstimate"
,
"shortDesc"
:
"Good Vert Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodVertPosAGLEstimate"
,
"shortDesc"
:
"Good Vert Pos AGL Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodVertPosAGLEstimate"
,
"shortDesc"
:
"Good Vert Pos AGL Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodConstPosModeEstimate"
,
"shortDesc"
:
"Good Const Pos Mode Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodConstPosModeEstimate"
,
"shortDesc"
:
"Good Const Pos Mode Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodPredHorizPosRelEstimate"
,
"shortDesc"
:
"Good Pred Horiz Pos Rel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodPredHorizPosRelEstimate"
,
"shortDesc"
:
"Good Pred Horiz Pos Rel Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"goodPredHorizPosAbsEstimate"
,
"shortDesc"
:
"Good Pred Horiz Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"goodPredHorizPosAbsEstimate"
,
"shortDesc"
:
"Good Pred Horiz Pos Abs Estimate"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"gpsGlitch"
,
"shortDesc"
:
"Gps Glitch"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"gpsGlitch"
,
"shortDesc"
:
"Gps Glitch"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"accelError"
,
"shortDesc"
:
"Accel Error"
,
"type"
:
"bool"
,
"default"
:
false
"name"
:
"accelError"
,
"shortDesc"
:
"Accel Error"
,
"type"
:
"bool"
,
"default"
:
false
},
{
"name"
:
"velRatio"
,
"shortDesc"
:
"Vel Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"velRatio"
,
"shortDesc"
:
"Vel Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"horizPosRatio"
,
"shortDesc"
:
"Horiz Pos Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"horizPosRatio"
,
"shortDesc"
:
"Horiz Pos Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"vertPosRatio"
,
"shortDesc"
:
"Vert Pos Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"vertPosRatio"
,
"shortDesc"
:
"Vert Pos Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"magRatio"
,
"shortDesc"
:
"Mag Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"magRatio"
,
"shortDesc"
:
"Mag Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"haglRatio"
,
"shortDesc"
:
"HAGL Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"haglRatio"
,
"shortDesc"
:
"HAGL Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"tasRatio"
,
"shortDesc"
:
"TAS Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"tasRatio"
,
"shortDesc"
:
"TAS Ratio"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"horizPosAccuracy"
,
"shortDesc"
:
"Horiz Pos Accuracy"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"horizPosAccuracy"
,
"shortDesc"
:
"Horiz Pos Accuracy"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
},
{
"name"
:
"vertPosAccuracy"
,
"shortDesc"
:
"Vert Pos Accuracy"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
"name"
:
"vertPosAccuracy"
,
"shortDesc"
:
"Vert Pos Accuracy"
,
"type"
:
"float"
,
"decimalPlaces"
:
2
,
"default"
:
null
}
]
}
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