simulationlogic
Class HeartMonitor

java.lang.Object
  extended by simulationlogic.HeartMonitor

public class HeartMonitor
extends java.lang.Object


Constructor Summary
HeartMonitor(java.lang.String patientUsername, java.lang.String heartMonitorURL)
          creates a new heart monitor that monitors a patients heart with the patient id ID.
 
Method Summary
 void setHeartMonitorRate(double rate)
          This sets the heartMonior read rate.
 void startHeartMonitor()
          Starts the heart monitor by starting a timer that reads the heart data at heart rate.
 void stopHeartMonitor()
          Stops the heart monitor by canceling all scheduled tasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HeartMonitor

public HeartMonitor(java.lang.String patientUsername,
                    java.lang.String heartMonitorURL)
creates a new heart monitor that monitors a patients heart with the patient id ID. It opens a file "patient_"patientusername"_heart.txt" and monitors the number of beats or marks in the file.

Parameters:
ID -
Method Detail

setHeartMonitorRate

public void setHeartMonitorRate(double rate)
This sets the heartMonior read rate. The default value is once every 10 seconds if this is never set. It creates a new timerTask readHeart every time a new rate is set

Parameters:
rate -

startHeartMonitor

public void startHeartMonitor()
Starts the heart monitor by starting a timer that reads the heart data at heart rate. setHeartMonitorRate should be set before this is started. The rate is set to 10 seconds by default


stopHeartMonitor

public void stopHeartMonitor()
Stops the heart monitor by canceling all scheduled tasks