org.mbari.siam.core
Class MiscInstrumentPort

java.lang.Object
  extended by org.mbari.siam.core.MiscInstrumentPort
All Implemented Interfaces:
InstrumentPort

public class MiscInstrumentPort
extends java.lang.Object
implements InstrumentPort

Implements InstrumentPort interface for a miscellaneous port. May have a power port.

Author:
Bob Herlien

Field Summary
protected  boolean _instrumentPortSuspended
           
protected static org.apache.log4j.Logger _log4j
          Log4j logger
protected  java.lang.String _nullString
           
protected  java.lang.String _params
           
protected  java.lang.String _portName
           
protected  PowerPort _powerPort
           
 
Fields inherited from interface org.mbari.siam.core.InstrumentPort
RTS_SENSE
 
Constructor Summary
MiscInstrumentPort(java.lang.String portName, PowerPort power, java.lang.String params)
          Create a MiscInstrumentPort.
 
Method Summary
 void connectPower()
          Connect instrument to power.
 void disableCommunications()
          Disable communications
 void disconnectPower()
          Disconnect instrument from power.
 void enableCommunications()
          Enable communications
 java.lang.String getCommPortName()
          get the commport name
 float getCurrentLevel()
          Get the current level of the PowerPort.
 int getCurrentLimit()
          Get current limit of port.
 java.io.InputStream getInputStream()
          get an InputStream to the instrument
 InstrumentConsole getInstrumentConsole()
          get a console to an Instrument
 InstrumentPortOutputStream getOutputStream()
          get an OutputStream to the instrument
 java.lang.String getParams()
          Get the parameters
 java.lang.String getStatusMessage()
          Sample health/status sensors.
 java.lang.String getStatusSummaryMessage()
          Get health/status summary string, including extreme values.
 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 resume()
          resume instrument comms from suspended state
 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.
 void suspend()
          suspends comms so another application can communicate with the instrument
 
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


_portName

protected java.lang.String _portName

_powerPort

protected PowerPort _powerPort

_instrumentPortSuspended

protected boolean _instrumentPortSuspended

_nullString

protected java.lang.String _nullString

_params

protected java.lang.String _params
Constructor Detail

MiscInstrumentPort

public MiscInstrumentPort(java.lang.String portName,
                          PowerPort power,
                          java.lang.String params)
Create a MiscInstrumentPort.

Method Detail

initialize

public void initialize()
                throws InitializeException
initialize the InstrumentPort

Specified by:
initialize in interface InstrumentPort
Throws:
InitializeException

getParams

public java.lang.String getParams()
Get the parameters


resume

public void resume()
resume instrument comms from suspended state

Specified by:
resume in interface InstrumentPort

suspend

public void suspend()
suspends comms so another application can communicate with the instrument

Specified by:
suspend in interface InstrumentPort

shutDown

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

Specified by:
shutDown in interface InstrumentPort

isSuspended

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

Specified by:
isSuspended in interface InstrumentPort

getCommPortName

public java.lang.String getCommPortName()
get the commport name

Specified by:
getCommPortName in interface InstrumentPort

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
get an InputStream to the instrument

Specified by:
getInputStream in interface InstrumentPort
Throws:
java.io.IOException

getOutputStream

public InstrumentPortOutputStream getOutputStream()
                                           throws java.io.IOException
get an OutputStream to the instrument

Specified by:
getOutputStream in interface InstrumentPort
Throws:
java.io.IOException

getInstrumentConsole

public InstrumentConsole getInstrumentConsole()
                                       throws java.io.IOException
get a console to an Instrument

Specified by:
getInstrumentConsole in interface InstrumentPort
Throws:
java.io.IOException

enableCommunications

public void enableCommunications()
Enable communications

Specified by:
enableCommunications in interface InstrumentPort

disableCommunications

public void disableCommunications()
Disable communications

Specified by:
disableCommunications in interface InstrumentPort

connectPower

public void connectPower()
Connect instrument to power.

Specified by:
connectPower in interface InstrumentPort

disconnectPower

public void disconnectPower()
Disconnect instrument from power.

Specified by:
disconnectPower in interface InstrumentPort

setCurrentLimit

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

Specified by:
setCurrentLimit in interface InstrumentPort
Throws:
RangeException
NotSupportedException

getCurrentLimit

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

Specified by:
getCurrentLimit in interface InstrumentPort
Throws:
NoDataException
NotSupportedException

getVoltageLevel

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

Specified by:
getVoltageLevel in interface InstrumentPort
Throws:
NoDataException
NotSupportedException

getCurrentLevel

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

Specified by:
getCurrentLevel in interface InstrumentPort
Throws:
NoDataException
NotSupportedException

isolatePort

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

Specified by:
isolatePort in interface InstrumentPort

getStatusMessage

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

Specified by:
getStatusMessage in interface InstrumentPort

getStatusSummaryMessage

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

Specified by:
getStatusSummaryMessage in interface InstrumentPort

resetStatus

public void resetStatus()
Reset status.

Specified by:
resetStatus in interface InstrumentPort

getTerseStatus

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

Specified by:
getTerseStatus in interface InstrumentPort

setCommsMode

public void setCommsMode(CommsMode commsMode)
Set communications mode (RS422,RS485,RS232) satisfies InstrumentPort interface

Specified by:
setCommsMode in interface InstrumentPort


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.