Page MenuHomePhorge

SensorSlotOfAgent.cpp
No OneTemporary

Size
1019 B
Referenced Files
None
Subscribers
None

SensorSlotOfAgent.cpp

#include <stdio.h>
#include "SensorSlotOfAgent.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

Mime Type
text/x-c
Expires
Sun, Mar 1, 10:20 PM (1 d, 1 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
289233
Default Alt Text
SensorSlotOfAgent.cpp (1019 B)

Event Timeline