simulationlogic
Class BloodSugarMonitor

java.lang.Object
  extended by simulationlogic.BloodSugarMonitor

public class BloodSugarMonitor
extends java.lang.Object


Constructor Summary
BloodSugarMonitor(java.lang.String patientUsername, java.lang.String heartMonitorURL)
          creates a new blood sugar monitor that monitors a patients blood sugar level with the patient username.
 
Method Summary
 void setBloodSugarMonitorRate(double rate)
          This sets the bloodsugar Monitor read rate.
 void startBloodSugarMonitor()
          Starts the blood sugar monitor by starting a timer that reads the blood sugar data setBloodSugarMonitorRate should be set before this is started.
 void stopBloodSugarMonitor()
          Stops the blood sugar monitor by canceling all scheduled tasks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BloodSugarMonitor

public BloodSugarMonitor(java.lang.String patientUsername,
                         java.lang.String heartMonitorURL)
creates a new blood sugar monitor that monitors a patients blood sugar level with the patient username. It opens a file "patient_"patientusername"_heart.txt" and monitors the current blood sugar level in the file

Parameters:
ID -
Method Detail

setBloodSugarMonitorRate

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

Parameters:
rate -

startBloodSugarMonitor

public void startBloodSugarMonitor()
Starts the blood sugar monitor by starting a timer that reads the blood sugar data setBloodSugarMonitorRate should be set before this is started. The rate is set to 10 seconds by default


stopBloodSugarMonitor

public void stopBloodSugarMonitor()
Stops the blood sugar monitor by canceling all scheduled tasks