stella.roof
Class Blinker.SwitchTask

java.lang.Object
  extended by java.util.TimerTask
      extended by stella.roof.Blinker.SwitchTask
All Implemented Interfaces:
Runnable
Enclosing class:
Blinker

private class Blinker.SwitchTask
extends TimerTask

A timer task class that writes a string to the serial line. If the command strings for switching on and off a light are alternated a flashing light signal results. Note that this class assumes the RS485 server to be up and working.


Field Summary
private  boolean action
          The string to write to the serial port.
 
Constructor Summary
protected Blinker.SwitchTask(boolean cmd)
          Constructs a new switch task.
 
Method Summary
 void run()
          Writes the switch command to the serial port.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

action

private boolean action
The string to write to the serial port.

Constructor Detail

Blinker.SwitchTask

protected Blinker.SwitchTask(boolean cmd)
Constructs a new switch task. The appropriate switch command is handed over as the argument.

Method Detail

run

public void run()
Writes the switch command to the serial port. If this write fails, no action is undertaken. This is to avoid message-log overflooding.

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask