Page MenuHomePhorge

SensorSlotOfAgent.cpp
No OneTemporary

Size
998 B
Referenced Files
None
Subscribers
None

SensorSlotOfAgent.cpp

#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

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

Event Timeline