org.mbari.siam.foce.devices.controlLoop
Class BaseResponder

java.lang.Object
  extended by org.mbari.siam.foce.devices.controlLoop.BaseResponder
All Implemented Interfaces:
ControlResponseIF
Direct Known Subclasses:
PH_Responder, VEL_Responder

public abstract class BaseResponder
extends java.lang.Object
implements ControlResponseIF


Field Summary
protected  ControlLoopAttributes _attributes
           
protected  java.lang.StringBuffer _cfgPacketBuffer
           
protected  ControlProcessIF _controlProcess
           
protected  double _correction
           
protected  SensorDataPacket _dataPacket
           
protected  java.lang.String _dataTurbineHost
           
protected  boolean _doTurbinate
           
protected  float _error
           
protected  int _esw_pump_amode
           
protected  int _esw_valve_amode
           
protected  SensorDataPacket _lastDataPacket
           
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  int _maxDataBytes
           
protected  double _offset
           
protected  java.lang.StringBuffer _packetBuffer
           
protected  PacketParser _packetParser
           
protected  int _ph_cmode
           
protected  int _ph_rmode
           
protected  float _previousError
           
protected  float _previousProcessValue
           
protected  float _processValue
           
protected  double _rawCorrection
           
protected  java.lang.String _recordDelimiter
           
protected  java.lang.String _recordType
           
protected  float _setPoint
           
protected  int _thruster_amode
           
protected  Turbinator _turbinator
           
protected  int _velocity_cmode
           
static java.lang.String DELIMITERS
           
 
Constructor Summary
BaseResponder(ControlProcessIF controlProcess, ControlLoopAttributes attributes)
           
 
Method Summary
 java.lang.StringBuffer getConfigBuffer()
          Return a sample buffer with current response configuration.
abstract  float getCorrection()
          Calculate correction value (heart of the PID loop) updateInputs must be called before calling this method
 SensorDataPacket getLastSample()
          Return most recent sample data packet
 java.lang.StringBuffer getSampleBuffer()
          Return a sample buffer with current process data.
abstract  SensorDataPacket getSamplePacket()
          return a sensor data packet sub-classes should override
 void initialize()
          initialize control loop
 void reset()
          reset control loop
 void showParsedData(PacketParser.Field[] fields)
           
abstract  float update()
          update output (new process command)
protected abstract  void updateInputs()
          Update inputs, needed prior to updating output values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j
Log4j logger


DELIMITERS

public static final java.lang.String DELIMITERS
See Also:
Constant Field Values

_velocity_cmode

protected int _velocity_cmode

_ph_cmode

protected int _ph_cmode

_ph_rmode

protected int _ph_rmode

_esw_valve_amode

protected int _esw_valve_amode

_esw_pump_amode

protected int _esw_pump_amode

_thruster_amode

protected int _thruster_amode

_setPoint

protected float _setPoint

_offset

protected double _offset

_processValue

protected float _processValue

_previousProcessValue

protected float _previousProcessValue

_error

protected float _error

_previousError

protected float _previousError

_correction

protected double _correction

_rawCorrection

protected double _rawCorrection

_packetParser

protected PacketParser _packetParser

_turbinator

protected Turbinator _turbinator

_dataTurbineHost

protected java.lang.String _dataTurbineHost

_packetBuffer

protected java.lang.StringBuffer _packetBuffer

_cfgPacketBuffer

protected java.lang.StringBuffer _cfgPacketBuffer

_recordType

protected java.lang.String _recordType

_dataPacket

protected SensorDataPacket _dataPacket

_lastDataPacket

protected SensorDataPacket _lastDataPacket

_maxDataBytes

protected int _maxDataBytes

_doTurbinate

protected boolean _doTurbinate

_recordDelimiter

protected java.lang.String _recordDelimiter

_controlProcess

protected ControlProcessIF _controlProcess

_attributes

protected ControlLoopAttributes _attributes
Constructor Detail

BaseResponder

public BaseResponder(ControlProcessIF controlProcess,
                     ControlLoopAttributes attributes)
              throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

update

public abstract float update()
                      throws java.lang.Exception
update output (new process command)

Specified by:
update in interface ControlResponseIF
Throws:
java.lang.Exception

updateInputs

protected abstract void updateInputs()
                              throws java.lang.Exception
Update inputs, needed prior to updating output values. For example, input signals and tuning parameters that may have changed (picked up from _attributes): _processValue, _setPoint, _error, _offset

Throws:
java.lang.Exception

getCorrection

public abstract float getCorrection()
                             throws java.lang.Exception
Calculate correction value (heart of the PID loop) updateInputs must be called before calling this method

Throws:
java.lang.Exception

getSamplePacket

public abstract SensorDataPacket getSamplePacket()
return a sensor data packet sub-classes should override

Specified by:
getSamplePacket in interface ControlResponseIF

initialize

public void initialize()
initialize control loop

Specified by:
initialize in interface ControlResponseIF

reset

public void reset()
reset control loop

Specified by:
reset in interface ControlResponseIF

getLastSample

public SensorDataPacket getLastSample()
Return most recent sample data packet


getSampleBuffer

public java.lang.StringBuffer getSampleBuffer()
                                       throws java.lang.Exception
Return a sample buffer with current process data. sub-classes should call the base class to get the common data items.

Specified by:
getSampleBuffer in interface ControlResponseIF
Throws:
java.lang.Exception

getConfigBuffer

public java.lang.StringBuffer getConfigBuffer()
                                       throws java.lang.Exception
Return a sample buffer with current response configuration. sub-classes should call the base class to get the common data items.

Throws:
java.lang.Exception

showParsedData

public void showParsedData(PacketParser.Field[] fields)


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.