airboardUI
Class Rules

java.lang.Object
  extended byairboardUI.Rules

public class Rules
extends java.lang.Object

Author:
Bruschieri Stefano

Constructor Summary
Rules(AirboardFrame parent)
          Creates a new vector containing commands.
 
Method Summary
 void transmitRules()
          Sends one rule each time through serial port.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Rules

public Rules(AirboardFrame parent)
      throws java.io.IOException
Creates a new vector containing commands. It loads the list of rules from a file (AirboardFrame.RULES_FILE) and it creates the vector putting the values of rules into the string representing commands.

Parameters:
parent - The main frame
Method Detail

transmitRules

public void transmitRules()
Sends one rule each time through serial port. The Rules constructor generates a Vector containing the sequence of commands, but it doesn't send rules. In order to execute commands we have to call explicity this method.
Before sending each command, waits a period DELAY_TIME to ensure a little probability of errors.
In order to show what it is doing, it opens a progress bar. If any errors occurs the bar becomes red and some diagnostic information is written under the bar.