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
c4052eac
Commit
c4052eac
authored
Jul 01, 2020
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to ignore camel case in FactGroup.
parent
ef99212f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
7 deletions
+10
-7
QGCCameraControl.cc
src/Camera/QGCCameraControl.cc
+1
-1
FactGroup.cc
src/FactSystem/FactGroup.cc
+6
-4
FactGroup.h
src/FactSystem/FactGroup.h
+3
-2
No files found.
src/Camera/QGCCameraControl.cc
View file @
c4052eac
...
...
@@ -154,7 +154,7 @@ read_value(QDomNode& element, const char* tagName, QString& target)
//-----------------------------------------------------------------------------
QGCCameraControl
::
QGCCameraControl
(
const
mavlink_camera_information_t
*
info
,
Vehicle
*
vehicle
,
int
compID
,
QObject
*
parent
)
:
FactGroup
(
0
,
parent
)
:
FactGroup
(
0
,
parent
,
true
/* ignore camel case */
)
,
_vehicle
(
vehicle
)
,
_compID
(
compID
)
{
...
...
src/FactSystem/FactGroup.cc
View file @
c4052eac
...
...
@@ -20,17 +20,19 @@
QGC_LOGGING_CATEGORY
(
FactGroupLog
,
"FactGroupLog"
)
FactGroup
::
FactGroup
(
int
updateRateMsecs
,
const
QString
&
metaDataFile
,
QObject
*
parent
)
FactGroup
::
FactGroup
(
int
updateRateMsecs
,
const
QString
&
metaDataFile
,
QObject
*
parent
,
bool
ignoreCamelCase
)
:
QObject
(
parent
)
,
_updateRateMSecs
(
updateRateMsecs
)
,
_ignoreCamelCase
(
ignoreCamelCase
)
{
_setupTimer
();
_nameToFactMetaDataMap
=
FactMetaData
::
createMapFromJsonFile
(
metaDataFile
,
this
);
}
FactGroup
::
FactGroup
(
int
updateRateMsecs
,
QObject
*
parent
)
FactGroup
::
FactGroup
(
int
updateRateMsecs
,
QObject
*
parent
,
bool
ignoreCamelCase
)
:
QObject
(
parent
)
,
_updateRateMSecs
(
updateRateMsecs
)
,
_ignoreCamelCase
(
ignoreCamelCase
)
{
_setupTimer
();
}
...
...
@@ -70,7 +72,7 @@ Fact* FactGroup::getFact(const QString& name)
}
Fact
*
fact
=
nullptr
;
QString
camelCaseName
=
_camelCase
(
name
);
QString
camelCaseName
=
_
ignoreCamelCase
?
name
:
_
camelCase
(
name
);
if
(
_nameToFactMap
.
contains
(
camelCaseName
))
{
fact
=
_nameToFactMap
[
camelCaseName
];
...
...
@@ -85,7 +87,7 @@ Fact* FactGroup::getFact(const QString& name)
FactGroup
*
FactGroup
::
getFactGroup
(
const
QString
&
name
)
{
FactGroup
*
factGroup
=
nullptr
;
QString
camelCaseName
=
_camelCase
(
name
);
QString
camelCaseName
=
_
ignoreCamelCase
?
name
:
_
camelCase
(
name
);
if
(
_nameToFactGroupMap
.
contains
(
camelCaseName
))
{
factGroup
=
_nameToFactGroupMap
[
camelCaseName
];
...
...
src/FactSystem/FactGroup.h
View file @
c4052eac
...
...
@@ -26,8 +26,8 @@ class FactGroup : public QObject
Q_OBJECT
public:
FactGroup
(
int
updateRateMsecs
,
const
QString
&
metaDataFile
,
QObject
*
parent
=
nullptr
);
FactGroup
(
int
updateRateMsecs
,
QObject
*
parent
=
nullptr
);
FactGroup
(
int
updateRateMsecs
,
const
QString
&
metaDataFile
,
QObject
*
parent
=
nullptr
,
bool
ignoreCamelCase
=
false
);
FactGroup
(
int
updateRateMsecs
,
QObject
*
parent
=
nullptr
,
bool
ignoreCamelCase
=
false
);
Q_PROPERTY
(
QStringList
factNames
READ
factNames
CONSTANT
)
Q_PROPERTY
(
QStringList
factGroupNames
READ
factGroupNames
CONSTANT
)
...
...
@@ -63,6 +63,7 @@ private:
void
_setupTimer
(
void
);
QString
_camelCase
(
const
QString
&
text
);
bool
_ignoreCamelCase
=
false
;
QTimer
_updateTimer
;
};
...
...
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