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
ca4da5bc
Commit
ca4da5bc
authored
Oct 12, 2015
by
Nate Weibley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Proper const correctness for Fact system read methods
parent
a6da2b7d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
52 deletions
+52
-52
Fact.cc
src/FactSystem/Fact.cc
+12
-12
Fact.h
src/FactSystem/Fact.h
+13
-13
FactMetaData.cc
src/FactSystem/FactMetaData.cc
+3
-3
FactMetaData.h
src/FactSystem/FactMetaData.h
+24
-24
No files found.
src/FactSystem/Fact.cc
View file @
ca4da5bc
...
@@ -134,7 +134,7 @@ QString Fact::valueString(void) const
...
@@ -134,7 +134,7 @@ QString Fact::valueString(void) const
return
_value
.
toString
();
return
_value
.
toString
();
}
}
QVariant
Fact
::
defaultValue
(
void
)
QVariant
Fact
::
defaultValue
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
if
(
!
_metaData
->
defaultValueAvailable
())
{
if
(
!
_metaData
->
defaultValueAvailable
())
{
...
@@ -147,12 +147,12 @@ QVariant Fact::defaultValue(void)
...
@@ -147,12 +147,12 @@ QVariant Fact::defaultValue(void)
}
}
}
}
FactMetaData
::
ValueType_t
Fact
::
type
(
void
)
FactMetaData
::
ValueType_t
Fact
::
type
(
void
)
const
{
{
return
_type
;
return
_type
;
}
}
QString
Fact
::
shortDescription
(
void
)
QString
Fact
::
shortDescription
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
shortDescription
();
return
_metaData
->
shortDescription
();
...
@@ -162,7 +162,7 @@ QString Fact::shortDescription(void)
...
@@ -162,7 +162,7 @@ QString Fact::shortDescription(void)
}
}
}
}
QString
Fact
::
longDescription
(
void
)
QString
Fact
::
longDescription
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
longDescription
();
return
_metaData
->
longDescription
();
...
@@ -172,7 +172,7 @@ QString Fact::longDescription(void)
...
@@ -172,7 +172,7 @@ QString Fact::longDescription(void)
}
}
}
}
QString
Fact
::
units
(
void
)
QString
Fact
::
units
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
units
();
return
_metaData
->
units
();
...
@@ -182,7 +182,7 @@ QString Fact::units(void)
...
@@ -182,7 +182,7 @@ QString Fact::units(void)
}
}
}
}
QVariant
Fact
::
min
(
void
)
QVariant
Fact
::
min
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
min
();
return
_metaData
->
min
();
...
@@ -192,7 +192,7 @@ QVariant Fact::min(void)
...
@@ -192,7 +192,7 @@ QVariant Fact::min(void)
}
}
}
}
QVariant
Fact
::
max
(
void
)
QVariant
Fact
::
max
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
max
();
return
_metaData
->
max
();
...
@@ -202,7 +202,7 @@ QVariant Fact::max(void)
...
@@ -202,7 +202,7 @@ QVariant Fact::max(void)
}
}
}
}
bool
Fact
::
minIsDefaultForType
(
void
)
bool
Fact
::
minIsDefaultForType
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
minIsDefaultForType
();
return
_metaData
->
minIsDefaultForType
();
...
@@ -212,7 +212,7 @@ bool Fact::minIsDefaultForType(void)
...
@@ -212,7 +212,7 @@ bool Fact::minIsDefaultForType(void)
}
}
}
}
bool
Fact
::
maxIsDefaultForType
(
void
)
bool
Fact
::
maxIsDefaultForType
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
maxIsDefaultForType
();
return
_metaData
->
maxIsDefaultForType
();
...
@@ -222,7 +222,7 @@ bool Fact::maxIsDefaultForType(void)
...
@@ -222,7 +222,7 @@ bool Fact::maxIsDefaultForType(void)
}
}
}
}
QString
Fact
::
group
(
void
)
QString
Fact
::
group
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
group
();
return
_metaData
->
group
();
...
@@ -237,7 +237,7 @@ void Fact::setMetaData(FactMetaData* metaData)
...
@@ -237,7 +237,7 @@ void Fact::setMetaData(FactMetaData* metaData)
_metaData
=
metaData
;
_metaData
=
metaData
;
}
}
bool
Fact
::
valueEqualsDefault
(
void
)
bool
Fact
::
valueEqualsDefault
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
if
(
_metaData
->
defaultValueAvailable
())
{
if
(
_metaData
->
defaultValueAvailable
())
{
...
@@ -251,7 +251,7 @@ bool Fact::valueEqualsDefault(void)
...
@@ -251,7 +251,7 @@ bool Fact::valueEqualsDefault(void)
}
}
}
}
bool
Fact
::
defaultValueAvailable
(
void
)
bool
Fact
::
defaultValueAvailable
(
void
)
const
{
{
if
(
_metaData
)
{
if
(
_metaData
)
{
return
_metaData
->
defaultValueAvailable
();
return
_metaData
->
defaultValueAvailable
();
...
...
src/FactSystem/Fact.h
View file @
ca4da5bc
...
@@ -74,18 +74,18 @@ public:
...
@@ -74,18 +74,18 @@ public:
QVariant
value
(
void
)
const
;
QVariant
value
(
void
)
const
;
QString
valueString
(
void
)
const
;
QString
valueString
(
void
)
const
;
void
setValue
(
const
QVariant
&
value
);
void
setValue
(
const
QVariant
&
value
);
QVariant
defaultValue
(
void
);
QVariant
defaultValue
(
void
)
const
;
bool
defaultValueAvailable
(
void
);
bool
defaultValueAvailable
(
void
)
const
;
bool
valueEqualsDefault
(
void
);
bool
valueEqualsDefault
(
void
)
const
;
FactMetaData
::
ValueType_t
type
(
void
);
FactMetaData
::
ValueType_t
type
(
void
)
const
;
QString
shortDescription
(
void
);
QString
shortDescription
(
void
)
const
;
QString
longDescription
(
void
);
QString
longDescription
(
void
)
const
;
QString
units
(
void
);
QString
units
(
void
)
const
;
QVariant
min
(
void
);
QVariant
min
(
void
)
const
;
bool
minIsDefaultForType
(
void
);
bool
minIsDefaultForType
(
void
)
const
;
QVariant
max
(
void
)
;
QVariant
max
(
void
)
const
;
bool
maxIsDefaultForType
(
void
);
bool
maxIsDefaultForType
(
void
)
const
;
QString
group
(
void
);
QString
group
(
void
)
const
;
/// Sets and sends new value to vehicle even if value is the same
/// Sets and sends new value to vehicle even if value is the same
void
forceSetValue
(
const
QVariant
&
value
);
void
forceSetValue
(
const
QVariant
&
value
);
...
@@ -120,4 +120,4 @@ private:
...
@@ -120,4 +120,4 @@ private:
FactMetaData
*
_metaData
;
FactMetaData
*
_metaData
;
};
};
#endif
#endif
\ No newline at end of file
src/FactSystem/FactMetaData.cc
View file @
ca4da5bc
...
@@ -80,7 +80,7 @@ const FactMetaData& FactMetaData::operator=(const FactMetaData& other)
...
@@ -80,7 +80,7 @@ const FactMetaData& FactMetaData::operator=(const FactMetaData& other)
return
*
this
;
return
*
this
;
}
}
QVariant
FactMetaData
::
defaultValue
(
void
)
QVariant
FactMetaData
::
defaultValue
(
void
)
const
{
{
if
(
_defaultValueAvailable
)
{
if
(
_defaultValueAvailable
)
{
return
_defaultValue
;
return
_defaultValue
;
...
@@ -122,7 +122,7 @@ void FactMetaData::setMax(const QVariant& max)
...
@@ -122,7 +122,7 @@ void FactMetaData::setMax(const QVariant& max)
}
}
}
}
QVariant
FactMetaData
::
_minForType
(
void
)
QVariant
FactMetaData
::
_minForType
(
void
)
const
{
{
switch
(
_type
)
{
switch
(
_type
)
{
case
valueTypeUint8
:
case
valueTypeUint8
:
...
@@ -147,7 +147,7 @@ QVariant FactMetaData::_minForType(void)
...
@@ -147,7 +147,7 @@ QVariant FactMetaData::_minForType(void)
return
QVariant
();
return
QVariant
();
}
}
QVariant
FactMetaData
::
_maxForType
(
void
)
QVariant
FactMetaData
::
_maxForType
(
void
)
const
{
{
switch
(
_type
)
{
switch
(
_type
)
{
case
valueTypeUint8
:
case
valueTypeUint8
:
...
...
src/FactSystem/FactMetaData.h
View file @
ca4da5bc
...
@@ -57,28 +57,28 @@ public:
...
@@ -57,28 +57,28 @@ public:
FactMetaData
(
const
FactMetaData
&
other
,
QObject
*
parent
=
NULL
);
FactMetaData
(
const
FactMetaData
&
other
,
QObject
*
parent
=
NULL
);
const
FactMetaData
&
operator
=
(
const
FactMetaData
&
other
);
const
FactMetaData
&
operator
=
(
const
FactMetaData
&
other
);
// Property accessors
// Property accessors
QString
name
(
void
)
{
return
_name
;
}
QString
name
(
void
)
const
{
return
_name
;
}
QString
group
(
void
)
{
return
_group
;
}
QString
group
(
void
)
const
{
return
_group
;
}
ValueType_t
type
(
void
)
{
return
_type
;
}
ValueType_t
type
(
void
)
const
{
return
_type
;
}
QVariant
defaultValue
(
void
)
;
QVariant
defaultValue
(
void
)
const
;
bool
defaultValueAvailable
(
void
)
{
return
_defaultValueAvailable
;
}
bool
defaultValueAvailable
(
void
)
const
{
return
_defaultValueAvailable
;
}
QString
shortDescription
(
void
)
{
return
_shortDescription
;
}
QString
shortDescription
(
void
)
const
{
return
_shortDescription
;
}
QString
longDescription
(
void
)
{
return
_longDescription
;}
QString
longDescription
(
void
)
const
{
return
_longDescription
;}
QString
units
(
void
)
{
return
_units
;
}
QString
units
(
void
)
const
{
return
_units
;
}
QVariant
min
(
void
)
{
return
_min
;
}
QVariant
min
(
void
)
const
{
return
_min
;
}
QVariant
max
(
void
)
{
return
_max
;
}
QVariant
max
(
void
)
const
{
return
_max
;
}
bool
minIsDefaultForType
(
void
)
{
return
_minIsDefaultForType
;
}
bool
minIsDefaultForType
(
void
)
const
{
return
_minIsDefaultForType
;
}
bool
maxIsDefaultForType
(
void
)
{
return
_maxIsDefaultForType
;
}
bool
maxIsDefaultForType
(
void
)
const
{
return
_maxIsDefaultForType
;
}
// Property setters
// Property setters
void
setName
(
const
QString
&
name
)
{
_name
=
name
;
}
void
setName
(
const
QString
&
name
)
{
_name
=
name
;
}
void
setGroup
(
const
QString
&
group
)
{
_group
=
group
;
}
void
setGroup
(
const
QString
&
group
)
{
_group
=
group
;
}
void
setDefaultValue
(
const
QVariant
&
defaultValue
);
void
setDefaultValue
(
const
QVariant
&
defaultValue
);
void
setShortDescription
(
const
QString
&
shortDescription
)
{
_shortDescription
=
shortDescription
;
}
void
setShortDescription
(
const
QString
&
shortDescription
)
{
_shortDescription
=
shortDescription
;
}
void
setLongDescription
(
const
QString
&
longDescription
)
{
_longDescription
=
longDescription
;}
void
setLongDescription
(
const
QString
&
longDescription
)
{
_longDescription
=
longDescription
;}
void
setUnits
(
const
QString
&
units
)
{
_units
=
units
;
}
void
setUnits
(
const
QString
&
units
)
{
_units
=
units
;
}
void
setMin
(
const
QVariant
&
max
);
void
setMin
(
const
QVariant
&
max
);
void
setMax
(
const
QVariant
&
max
);
void
setMax
(
const
QVariant
&
max
);
...
@@ -91,8 +91,8 @@ public:
...
@@ -91,8 +91,8 @@ public:
bool
convertAndValidate
(
const
QVariant
&
value
,
bool
convertOnly
,
QVariant
&
typedValue
,
QString
&
errorString
);
bool
convertAndValidate
(
const
QVariant
&
value
,
bool
convertOnly
,
QVariant
&
typedValue
,
QString
&
errorString
);
private:
private:
QVariant
_minForType
(
void
);
QVariant
_minForType
(
void
)
const
;
QVariant
_maxForType
(
void
);
QVariant
_maxForType
(
void
)
const
;
QString
_name
;
QString
_name
;
QString
_group
;
QString
_group
;
...
@@ -108,4 +108,4 @@ private:
...
@@ -108,4 +108,4 @@ private:
bool
_maxIsDefaultForType
;
bool
_maxIsDefaultForType
;
};
};
#endif
#endif
\ No newline at end of file
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