Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1497667
SensorSlotOfAgent.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
998 B
Referenced Files
None
Subscribers
None
SensorSlotOfAgent.cpp
View Options
#include
"SensorSlotOfAgent.h"
#include
<stdio.h>
SensorSlotOfAgent
::
SensorSlotOfAgent
()
{
flagSensorValueIsSet
=
false
;
flagSensorValueHasChanged
=
false
;
}
void
SensorSlotOfAgent
::
set_sensorValue
(
float
sensorValue
)
{
if
(
flagSensorValueIsSet
==
false
)
{
this
->
sensorValue
=
sensorValue
;
flagSensorValueHasChanged
=
true
;
flagSensorValueIsSet
=
true
;
}
else
{
if
(
this
->
sensorValue
!=
sensorValue
)
{
this
->
sensorValue
=
sensorValue
;
flagSensorValueHasChanged
=
true
;
}
else
{
flagSensorValueHasChanged
=
false
;
}
}
printf
(
"sensorSlot updated with: %f
\n
"
,
this
->
sensorValue
);
}
bool
SensorSlotOfAgent
::
get_sensorValue
(
float
*
sensorValue
)
{
if
(
flagSensorValueIsSet
==
true
)
{
*
sensorValue
=
this
->
sensorValue
;
return
true
;
}
return
false
;
}
bool
SensorSlotOfAgent
::
get_flagSensorValueIsSet
()
{
return
flagSensorValueIsSet
;
}
bool
SensorSlotOfAgent
::
get_flagSensorValueHasChanged
()
{
return
flagSensorValueHasChanged
;
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Mar 1, 9:38 PM (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
283153
Default Alt Text
SensorSlotOfAgent.cpp (998 B)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment