Sensor Class Reference

#include <Sensor.h>

Inheritance diagram for Sensor:
GridFriendly2Sensor GridFriendlySensor

List of all members.

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.

Detailed Description

This is the interface used to model a sensor that acts on electrical variables.

Definition at line 9 of file Sensor.h.


Member Enumeration Documentation

The sensor can be a time triggered sensor or a state triggered sensor. Time triggered sensors usually have a fixed sampling period. State triggered sensors can be tripped by conditions on continuous electrical variables.

Definition at line 18 of file Sensor.h.


Constructor & Destructor Documentation

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.

Definition at line 25 of file Sensor.h.


Member Function Documentation

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]

Get the model that this sensor is attached to, or returns NULL if the sensor is not attached to a specific model.

Definition at line 35 of file Sensor.h.

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.


The documentation for this class was generated from the following file:

Generated on 17 Jul 2013 by  doxygen 1.6.1