Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F27036672
SensorSlotOfAgent.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
Unknown
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
Tue, Oct 27, 8:07 PM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
407313
Default Alt Text
SensorSlotOfAgent.cpp (998 B)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline