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
5cd0593e
Commit
5cd0593e
authored
Dec 24, 2014
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
No inlines for easier debugging
parent
fb0e158e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
10 deletions
+70
-10
Fact.cc
src/FactSystem/Fact.cc
+55
-0
Fact.h
src/FactSystem/Fact.h
+15
-10
No files found.
src/FactSystem/Fact.cc
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
;
}
src/FactSystem/Fact.h
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
);
...
...
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