org.mbari.siam.core
Class BaseInstrumentPort

java.lang.Object
  extended by org.mbari.siam.core.BaseInstrumentPort
Direct Known Subclasses:
HttpInstrumentPort, SerialInstrumentPort

public class BaseInstrumentPort
extends java.lang.Object

Implements power control and communications to an instrument via serial port. May have a power port.

Author:
Mike Risi

Field Summary
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  PowerPort _powerPort
           
 
Constructor Summary
BaseInstrumentPort(PowerPort power)
           
 
Method Summary
 void connectPower()
          Connect instrument to power.
 void disableCommunications()
          Disable communications
 void disconnectPower()
          Disconnect instrument from power.
 void enableCommunications()
          Enable communications
 float getCurrentLevel()
          Get the current level of the PowerPort.
 int getCurrentLimit()
          Get current limit of port.
 java.lang.String getStatusMessage()
          Sample health/status sensors.
 java.lang.String getStatusSummaryMessage()
          Get health/status summary string, including extreme values.
 float getTemperature()
          Get the temperature of the PowerPort.
 java.lang.String getTerseStatus()
          Get health/status summary string.
 float getVoltageLevel()
          Get the voltage level of the PowerPort.
 void initialize()
          initialize the InstrumentPort
 void isolatePort()
          Isolate comms and power from port.
 boolean isSuspended()
          get the suspend state of the instrument port
 void resetStatus()
          Reset status.
 void setCommsMode(CommsMode commsMode)
          Set communications mode (RS422,RS485,RS232) satisfies InstrumentPort interface.
 void setCurrentLimit(int currentLimit)
          Set current limit on port.
 void shutDown()
          shutdown the intrument port.
 
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


_powerPort

protected PowerPort _powerPort
Constructor Detail

BaseInstrumentPort

public BaseInstrumentPort(PowerPort power)
Method Detail

initialize

public void initialize()
                throws InitializeException
initialize the InstrumentPort

Throws:
InitializeException

shutDown

public void shutDown()
shutdown the intrument port. This port must not be used again until the initialize() method is called again.


isSuspended

public boolean isSuspended()
get the suspend state of the instrument port


enableCommunications

public void enableCommunications()
Enable communications


disableCommunications

public void disableCommunications()
Disable communications


connectPower

public void connectPower()
Connect instrument to power.


disconnectPower

public void disconnectPower()
Disconnect instrument from power.


setCurrentLimit

public void setCurrentLimit(int currentLimit)
                     throws RangeException,
                            NotSupportedException
Set current limit on port.

Throws:
RangeException
NotSupportedException

getCurrentLimit

public int getCurrentLimit()
                    throws NoDataException,
                           NotSupportedException
Get current limit of port.

Throws:
NoDataException
NotSupportedException

getVoltageLevel

public float getVoltageLevel()
                      throws NoDataException,
                             NotSupportedException
Get the voltage level of the PowerPort.

Throws:
NoDataException
NotSupportedException

getCurrentLevel

public float getCurrentLevel()
                      throws NoDataException,
                             NotSupportedException
Get the current level of the PowerPort.

Throws:
NoDataException
NotSupportedException

getTemperature

public float getTemperature()
                     throws NoDataException,
                            NotSupportedException
Get the temperature of the PowerPort.

Throws:
NoDataException
NotSupportedException

isolatePort

public void isolatePort()
Isolate comms and power from port.


getStatusMessage

public java.lang.String getStatusMessage()
Sample health/status sensors.


getStatusSummaryMessage

public java.lang.String getStatusSummaryMessage()
Get health/status summary string, including extreme values.


resetStatus

public void resetStatus()
Reset status.


getTerseStatus

public java.lang.String getTerseStatus()
Get health/status summary string.


setCommsMode

public void setCommsMode(CommsMode commsMode)
Set communications mode (RS422,RS485,RS232) satisfies InstrumentPort interface. NOTE: this method really does not belong in the InstrumentPort interface, since CommsMode is quite specific to serial instruments.



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.