org.mbari.siam.tests.utils.osdt
Class Model

java.lang.Object
  extended by java.lang.Thread
      extended by org.mbari.siam.foce.devices.controlLoop.WorkerThread
          extended by org.mbari.siam.tests.utils.osdt.Model
All Implemented Interfaces:
java.lang.Runnable

public class Model
extends WorkerThread


Nested Class Summary
 class Model.ChannelDefinition
           
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected static org.apache.log4j.Logger _log4j
           
static int ID_ISCALE
           
static int ID_PH1
           
static int ID_PH2
           
static int ID_PH3
           
static int ID_PH4
           
static int ID_PH5
           
static int ID_PH6
           
static int ID_PHBOXCARDEPTH
           
static int ID_PHCORR
           
static int ID_PHPUMPCMD
           
static int ID_PSCALE
           
static int ID_TAFTCMD
           
static int ID_TFWDCMD
           
static int ID_TSHIFT
           
static int ID_USEVCONST
           
static int ID_VELA
           
static int ID_VELB
           
static int ID_VELC
           
static int ID_VELCORR
           
static int ID_VELXINT
           
static int ID_VXCONST
           
static int ID_VYCONST
           
 
Fields inherited from class org.mbari.siam.foce.devices.controlLoop.WorkerThread
_initialized, _name, _pause, _running, _terminate, _updatePeriodMillisec
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Model()
           
Model(long delayMillis)
           
Model(java.lang.String osdtHost, int osdtPort, java.lang.String testHost, int testPort, long delayMillis)
           
 
Method Summary
 void configure(java.lang.String[] args)
           
 void connect(java.lang.String testHost, int testPort, java.lang.String osdtHost, int osdtPort)
           
 void doWorkerAction()
           
 Model.ChannelDefinition getChannel(int channelID)
           
 java.lang.Number getChannelValue(int channelID)
           
 java.lang.String getChannelValue(java.lang.String channelName)
           
 java.util.Vector getParameterNames()
           
 void initialize()
           
static void main(java.lang.String[] args)
           
 void printHelp()
           
protected  double pumpCmd2PH(double backgroundPH, double pumpSpeedRPM)
          compute new pH from pump command
 void readConnectors()
           
protected  double rpm2VEL(double thrusterRPM)
          compute new water velocity (vx) from thruster command
 void setOSDTHost(java.lang.String host)
           
 void setOSDTPort(int port)
           
 void setTestHost(java.lang.String host)
           
 void setTestPort(int port)
           
 void shutdown()
           
 void updateConfig()
           
protected  void updateCurrent()
          Update model water velocity (current) inputs and outputs
protected  void updatePH()
          Update model pH inputs and outputs
 
Methods inherited from class org.mbari.siam.foce.devices.controlLoop.WorkerThread
delay, isInitialized, isRunning, name, pause, run, setUpdatePeriod, setWorkerName, terminate
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_PHCORR

public static final int ID_PHCORR
See Also:
Constant Field Values

ID_PHPUMPCMD

public static final int ID_PHPUMPCMD
See Also:
Constant Field Values

ID_VELCORR

public static final int ID_VELCORR
See Also:
Constant Field Values

ID_VELXINT

public static final int ID_VELXINT
See Also:
Constant Field Values

ID_TFWDCMD

public static final int ID_TFWDCMD
See Also:
Constant Field Values

ID_TAFTCMD

public static final int ID_TAFTCMD
See Also:
Constant Field Values

ID_PSCALE

public static final int ID_PSCALE
See Also:
Constant Field Values

ID_ISCALE

public static final int ID_ISCALE
See Also:
Constant Field Values

ID_TSHIFT

public static final int ID_TSHIFT
See Also:
Constant Field Values

ID_USEVCONST

public static final int ID_USEVCONST
See Also:
Constant Field Values

ID_VXCONST

public static final int ID_VXCONST
See Also:
Constant Field Values

ID_VYCONST

public static final int ID_VYCONST
See Also:
Constant Field Values

ID_VELA

public static final int ID_VELA
See Also:
Constant Field Values

ID_VELB

public static final int ID_VELB
See Also:
Constant Field Values

ID_VELC

public static final int ID_VELC
See Also:
Constant Field Values

ID_PHBOXCARDEPTH

public static final int ID_PHBOXCARDEPTH
See Also:
Constant Field Values

ID_PH1

public static final int ID_PH1
See Also:
Constant Field Values

ID_PH2

public static final int ID_PH2
See Also:
Constant Field Values

ID_PH3

public static final int ID_PH3
See Also:
Constant Field Values

ID_PH4

public static final int ID_PH4
See Also:
Constant Field Values

ID_PH5

public static final int ID_PH5
See Also:
Constant Field Values

ID_PH6

public static final int ID_PH6
See Also:
Constant Field Values

_log4j

protected static org.apache.log4j.Logger _log4j
Constructor Detail

Model

public Model()

Model

public Model(long delayMillis)

Model

public Model(java.lang.String osdtHost,
             int osdtPort,
             java.lang.String testHost,
             int testPort,
             long delayMillis)
Method Detail

setOSDTHost

public void setOSDTHost(java.lang.String host)

setOSDTPort

public void setOSDTPort(int port)

setTestHost

public void setTestHost(java.lang.String host)

setTestPort

public void setTestPort(int port)

initialize

public void initialize()
                throws java.lang.Exception
Overrides:
initialize in class WorkerThread
Throws:
java.lang.Exception

connect

public void connect(java.lang.String testHost,
                    int testPort,
                    java.lang.String osdtHost,
                    int osdtPort)
             throws java.lang.Exception
Throws:
java.lang.Exception

pumpCmd2PH

protected double pumpCmd2PH(double backgroundPH,
                            double pumpSpeedRPM)
compute new pH from pump command


updatePH

protected void updatePH()
Update model pH inputs and outputs


rpm2VEL

protected double rpm2VEL(double thrusterRPM)
compute new water velocity (vx) from thruster command


updateCurrent

protected void updateCurrent()
Update model water velocity (current) inputs and outputs


updateConfig

public void updateConfig()

readConnectors

public void readConnectors()

doWorkerAction

public void doWorkerAction()
Specified by:
doWorkerAction in class WorkerThread

shutdown

public void shutdown()
Overrides:
shutdown in class WorkerThread

printHelp

public void printHelp()

getChannel

public Model.ChannelDefinition getChannel(int channelID)

getParameterNames

public java.util.Vector getParameterNames()

getChannelValue

public java.lang.Number getChannelValue(int channelID)

getChannelValue

public java.lang.String getChannelValue(java.lang.String channelName)

configure

public void configure(java.lang.String[] args)
               throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.