Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
5cd0593e
Commit
5cd0593e
authored
Dec 24, 2014
by
Don Gagne
Browse files
No inlines for easier debugging
parent
fb0e158e
Changes
2
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment