ist.palcom.services.alarmhrhr
Class AlarmHRHRDevice

java.lang.Object
  extended by ist.palcom.device.AbstractDevice
      extended by ist.palcom.device.AbstractUDPDevice
          extended by ist.palcom.services.alarmhrhr.AlarmHRHRDevice
All Implemented Interfaces:
OutEventListener, java.lang.Runnable

public class AlarmHRHRDevice
extends AbstractUDPDevice
implements OutEventListener

Device that take two input values (Heartrate) and provide two different alarmstates depending on the relation between the two values. Threashold values (Min and Max) can be set.


Field Summary
 
Fields inherited from class ist.palcom.device.AbstractDevice
context, scheduler
 
Constructor Summary
AlarmHRHRDevice(java.lang.String name, DeviceID deviceID)
           
 
Method Summary
protected  DeviceContext createDeviceContext(DeviceID deviceID, PalcomScheduler scheduler)
          Creates the DeviceContext of the device.
protected  void initDevice()
          Initialize the device.
static void main(java.lang.String[] args)
          A main method that runs an AlarmHRHRDevice.
 void outEventReceived(Event event)
           
protected  void stopDevice()
          stopDevice is overridden for stopping the service.
 
Methods inherited from class ist.palcom.device.AbstractDevice
getDeviceContext, getDeviceInfo, getName, getRootPath, run, safePutEvent, setHeartBeatPeriod, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlarmHRHRDevice

public AlarmHRHRDevice(java.lang.String name,
                       DeviceID deviceID)
Method Detail

initDevice

protected void initDevice()
                   throws java.io.IOException
Description copied from class: AbstractDevice
Initialize the device. Called from a PalcomThread. Here the actual setup is done. Subclasses override this method, and call super.initDevice from there.

Overrides:
initDevice in class AbstractDevice
Throws:
java.io.IOException

stopDevice

protected void stopDevice()
                   throws java.io.IOException
stopDevice is overridden for stopping the service.

Overrides:
stopDevice in class AbstractDevice
Throws:
java.io.IOException

createDeviceContext

protected DeviceContext createDeviceContext(DeviceID deviceID,
                                            PalcomScheduler scheduler)
Description copied from class: AbstractDevice
Creates the DeviceContext of the device. This method has to be implemented in a concrete subclass.

Overrides:
createDeviceContext in class AbstractUDPDevice
Parameters:
deviceID - The device ID.
scheduler - The scheduler.
Returns:
The DeviceContext

outEventReceived

public void outEventReceived(Event event)
Specified by:
outEventReceived in interface OutEventListener

main

public static void main(java.lang.String[] args)
A main method that runs an AlarmHRHRDevice.