Class Sinus

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--Sinus
All Implemented Interfaces:
java.lang.Runnable

public class Sinus
extends java.lang.Thread

Sinus thread. Generates a sinewave and sends data points to Opcom


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Sinus()
           
 
Method Summary
 double getAmplitude()
          Method called by the run method to get the current amplitude. Calls a synchronized method in an internal monitor.
 double getFrequency()
          Method called by the run method to get the current frequency. Calls a synchronized method in an internal monitor.
 void run()
          Run method
 void setAmplitude(double amp)
          Method called by Opcom to set the current amplitude. Calls a synchronized method in an internal monitor.
 void setFrequency(double freq)
          Method called by Opcom to set the current frequency. Calls a synchronized method in an internal monitor.
 void setOpcom(Opcom opc)
          Sets up a reference to Opcom.
 void stopThread()
          Stop the thread
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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

Sinus

public Sinus()
Method Detail

setOpcom

public void setOpcom(Opcom opc)
Sets up a reference to Opcom. Called from Main.


getAmplitude

public double getAmplitude()
Method called by the run method to get the current amplitude. Calls a synchronized method in an internal monitor.


setAmplitude

public void setAmplitude(double amp)
Method called by Opcom to set the current amplitude. Calls a synchronized method in an internal monitor.


getFrequency

public double getFrequency()
Method called by the run method to get the current frequency. Calls a synchronized method in an internal monitor.


setFrequency

public void setFrequency(double freq)
Method called by Opcom to set the current frequency. Calls a synchronized method in an internal monitor.


run

public void run()
Run method

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

stopThread

public void stopThread()
Stop the thread