my.ABB_UI
Class wisaBSwriter

java.lang.Object
  extended by java.lang.Thread
      extended by my.ABB_UI.wisaBSwriter
All Implemented Interfaces:
java.lang.Runnable

public class wisaBSwriter
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
wisaBSwriter(java.lang.String port)
           
wisaBSwriter(wisaBS bs, java.lang.String port)
          Creates a new instance of wisaBSwriter
 
Method Summary
 void close()
           
 void connect(java.lang.String portName)
          Establish a connection to a given portname (eg.
 void disablePeephole()
          Closes the peephole.
 void enablePeephole()
          Opens the Peephole.
 void run()
           
 void write2Bytes(char byte1, char byte2)
          Write 2 bytes to the serial port.
 void write3Bytes(char byte1, char byte2, char byte3)
          Write 3 bytes to the serial port.
 void writeTo(char addr_hi_temp, char addr_lo_temp, char data)
          Write to the address field given by the two first inputs.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

wisaBSwriter

public wisaBSwriter(wisaBS bs,
                    java.lang.String port)
Creates a new instance of wisaBSwriter


wisaBSwriter

public wisaBSwriter(java.lang.String port)
Method Detail

connect

public void connect(java.lang.String portName)
             throws gnu.io.NoSuchPortException
Establish a connection to a given portname (eg. "COM5")

Throws:
gnu.io.NoSuchPortException

close

public void close()

write3Bytes

public void write3Bytes(char byte1,
                        char byte2,
                        char byte3)
Write 3 bytes to the serial port.


write2Bytes

public void write2Bytes(char byte1,
                        char byte2)
Write 2 bytes to the serial port.


writeTo

public void writeTo(char addr_hi_temp,
                    char addr_lo_temp,
                    char data)
Write to the address field given by the two first inputs. This method is used only after a peephole is established.


enablePeephole

public void enablePeephole()
Opens the Peephole. This is necessary to reach the actual adress fields of the WISA BS.


disablePeephole

public void disablePeephole()
Closes the peephole. Should be done when fisished accessing the WISA BS registers.


run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread