#include <Sensor.h>
Public Types | |
enum | SensorType { TIME_TR, STATE_TR } |
Public Member Functions | |
Sensor (SensorType type, adevs::Devs< adevs::PortValue< BasicEvent * > > *device_model=NULL) | |
adevs::Devs< adevs::PortValue < BasicEvent * > > * | getDeviceModel () |
virtual double | distFromTrip (ElectricalSensorInterface *evars)=0 |
virtual void | trip (ElectricalSensorInterface *evars)=0 |
SensorType | getType () const |
Get the sensor's type. | |
virtual | ~Sensor () |
Destructor. |
This is the interface used to model a sensor that acts on electrical variables.
Definition at line 9 of file Sensor.h.
enum Sensor::SensorType |
Sensor::Sensor | ( | SensorType | type, | |
adevs::Devs< adevs::PortValue< BasicEvent * > > * | device_model = NULL | |||
) | [inline] |
Create a sensor of a particular type that is attached to a specific device model. If the model is NULL, the sensor is not attached to any specific device. The device is useful primarily for routing output events from the ElectricalModel to their proper destinations.
virtual double Sensor::distFromTrip | ( | ElectricalSensorInterface * | evars | ) | [pure virtual] |
When this function returns zero the sensor is triggered. If this is a TIME triggered sensor, then the return value is interpreted as the time remaining until the sensor trips.
Implemented in GridFriendlySensor, and GridFriendly2Sensor.
adevs::Devs<adevs::PortValue<BasicEvent*> >* Sensor::getDeviceModel | ( | ) | [inline] |
virtual void Sensor::trip | ( | ElectricalSensorInterface * | evars | ) | [pure virtual] |
This function is called when the sensor is tripped. At this time, the sensor should record its sensor measurements for later use by the device model or any other model that receives this sensor object as input. If the sensor itself has any discrete dynamics, its state can also be switched by this function.
Implemented in GridFriendlySensor, and GridFriendly2Sensor.