Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qgroundcontrol
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Valentin Platzgummer
qgroundcontrol
Commits
5cd0593e
Commit
5cd0593e
authored
10 years ago
by
Don Gagne
Browse files
Options
Downloads
Patches
Plain Diff
No inlines for easier debugging
parent
fb0e158e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/FactSystem/Fact.cc
+55
-0
55 additions, 0 deletions
src/FactSystem/Fact.cc
src/FactSystem/Fact.h
+15
-10
15 additions, 10 deletions
src/FactSystem/Fact.h
with
70 additions
and
10 deletions
src/FactSystem/Fact.cc
+
55
−
0
View file @
5cd0593e
...
...
@@ -48,3 +48,58 @@ void Fact::_containerSetValue(const QVariant& value)
_value
=
value
;
emit
valueChanged
(
_value
);
}
QString
Fact
::
name
(
void
)
const
{
return
_name
;
}
QVariant
Fact
::
value
(
void
)
const
{
return
_value
;
}
QString
Fact
::
valueString
(
void
)
const
{
return
_value
.
toString
();
}
QVariant
Fact
::
defaultValue
(
void
)
{
return
_metaData
->
defaultValue
;
}
FactMetaData
::
ValueType_t
Fact
::
type
(
void
)
{
return
_metaData
->
type
;
}
QString
Fact
::
shortDescription
(
void
)
{
return
_metaData
->
shortDescription
;
}
QString
Fact
::
longDescription
(
void
)
{
return
_metaData
->
longDescription
;
}
QString
Fact
::
units
(
void
)
{
return
_metaData
->
units
;
}
QVariant
Fact
::
min
(
void
)
{
return
_metaData
->
min
;
}
QVariant
Fact
::
max
(
void
)
{
return
_metaData
->
max
;
}
void
Fact
::
setMetaData
(
FactMetaData
*
metaData
)
{
_metaData
=
metaData
;
}
This diff is collapsed.
Click to expand it.
src/FactSystem/Fact.h
+
15
−
10
View file @
5cd0593e
...
...
@@ -32,6 +32,7 @@
#include
<QObject>
#include
<QString>
#include
<QVariant>
#include
<QDebug>
/// @brief A Fact is used to hold a single value within the system.
///
...
...
@@ -44,6 +45,7 @@ class Fact : public QObject
Q_PROPERTY
(
QString
name
READ
name
CONSTANT
)
Q_PROPERTY
(
QVariant
value
READ
value
WRITE
setValue
NOTIFY
valueChanged
USER
true
)
Q_PROPERTY
(
QVariant
valueString
READ
valueString
NOTIFY
valueChanged
)
Q_PROPERTY
(
QVariant
defaultValue
READ
defaultValue
CONSTANT
)
Q_PROPERTY
(
FactMetaData
::
ValueType_t
type
READ
type
CONSTANT
)
Q_PROPERTY
(
QString
shortDescription
READ
shortDescription
CONSTANT
)
...
...
@@ -60,37 +62,40 @@ public:
// Property system methods
/// Read accessor or name property
QString
name
(
void
)
const
{
return
_name
;
}
QString
name
(
void
)
const
;
/// Read accessor for value property
QVariant
value
(
void
)
const
{
return
_value
;
}
QVariant
value
(
void
)
const
;
/// Read accessor for valueString property
QString
valueString
(
void
)
const
;
/// Write accessor for value property
void
setValue
(
const
QVariant
&
value
);
/// Read accesor for defaultValue property
QVariant
defaultValue
(
void
)
{
return
_metaData
->
defaultValue
;
}
QVariant
defaultValue
(
void
)
;
/// Read accesor for type property
FactMetaData
::
ValueType_t
type
(
void
)
{
return
_metaData
->
type
;
}
FactMetaData
::
ValueType_t
type
(
void
)
;
/// Read accesor for shortDescription property
QString
shortDescription
(
void
)
{
return
_metaData
->
shortDescription
;
}
QString
shortDescription
(
void
)
;
/// Read accesor for longDescription property
QString
longDescription
(
void
)
{
return
_metaData
->
longDescription
;
}
QString
longDescription
(
void
)
;
/// Read accesor for units property
QString
units
(
void
)
{
return
_metaData
->
units
;
}
QString
units
(
void
)
;
/// Read accesor for min property
QVariant
min
(
void
)
{
return
_metaData
->
min
;
}
QVariant
min
(
void
)
;
/// Read accesor for max property
QVariant
max
(
void
)
{
return
_metaData
->
max
;
}
QVariant
max
(
void
)
;
/// Sets the meta data associated with the Fact.
void
setMetaData
(
FactMetaData
*
metaData
)
{
_metaData
=
metaData
;
}
void
setMetaData
(
FactMetaData
*
metaData
)
;
void
_containerSetValue
(
const
QVariant
&
value
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment