org.mbari.siam.core
Class DevicePort

java.lang.Object
  extended by org.mbari.siam.core.DevicePort
Direct Known Subclasses:
AnalogDevicePort, DigitalInputDevicePort, MiscDevicePort, SerialDevicePort

public abstract class DevicePort
extends java.lang.Object

DevicePort specifies deviceID and service associated with a Device port. It is used for communication between PortManager, NodeService, NodeManager, and NodeProperties.


Field Summary
 DeviceService _service
           
 
Constructor Summary
DevicePort(int index, java.lang.String portName, PowerPort powerPort, java.lang.String jar, DeviceService service)
           
 
Method Summary
 void addCommPortListener()
          Perform a CommPortIdentifier.addPortOwnershipListener() if this DevicePort has a SerialPort.
abstract  void closeComms()
          Close the underlying communications port
abstract  void createInstrumentPort()
          Create the appropriate InstrumentPort
 boolean equals(java.lang.Object obj)
          Equals method for finding object in collection
 CommsMode getCommsMode()
          Get commsMode member
 DeviceService getDeviceService()
          Get DeviceService
 int getIndex()
          Get the Port index.
 java.lang.String getPortName()
          Get port name
 PowerPort getPowerPort()
          Get power port member.
 int hashCode()
           
 boolean hasPowerPort()
          Return whether port has a power port
 boolean hasPuck()
          Return whether port has a puck attached
abstract  void openComms()
          Open the underlying communications port
 void powerDownPort()
          Power down a port
 void powerUpPort(int currentLimit)
          Power up the port and enable the comms if a service is not already using it
 void setCommsMode(CommsMode commsMode)
          Set commsMode member and PowerPort HW
 void setPowerPort(PowerPort powerPort)
          Set power port member.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_service

public DeviceService _service
Constructor Detail

DevicePort

public DevicePort(int index,
                  java.lang.String portName,
                  PowerPort powerPort,
                  java.lang.String jar,
                  DeviceService service)
Method Detail

setCommsMode

public void setCommsMode(CommsMode commsMode)
Set commsMode member and PowerPort HW


getCommsMode

public CommsMode getCommsMode()
Get commsMode member


setPowerPort

public void setPowerPort(PowerPort powerPort)
Set power port member.


getDeviceService

public DeviceService getDeviceService()
Get DeviceService


getPowerPort

public PowerPort getPowerPort()
Get power port member.


getPortName

public java.lang.String getPortName()
Get port name


hasPuck

public boolean hasPuck()
Return whether port has a puck attached


hasPowerPort

public boolean hasPowerPort()
Return whether port has a power port


openComms

public abstract void openComms()
                        throws java.lang.Exception
Open the underlying communications port

Throws:
java.lang.Exception

closeComms

public abstract void closeComms()
Close the underlying communications port


createInstrumentPort

public abstract void createInstrumentPort()
                                   throws InitializeException
Create the appropriate InstrumentPort

Throws:
InitializeException

powerUpPort

public void powerUpPort(int currentLimit)
                 throws PortOccupiedException,
                        PortNotFound,
                        RangeException,
                        NotSupportedException
Power up the port and enable the comms if a service is not already using it

Throws:
PortOccupiedException
PortNotFound
RangeException
NotSupportedException

powerDownPort

public void powerDownPort()
                   throws PortOccupiedException,
                          PortNotFound
Power down a port

Throws:
PortOccupiedException
PortNotFound

addCommPortListener

public void addCommPortListener()
Perform a CommPortIdentifier.addPortOwnershipListener() if this DevicePort has a SerialPort. Default implementation is null.


getIndex

public int getIndex()
Get the Port index. This is the number embedded in the property name e.g., serialPort7 has index 7


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Equals method for finding object in collection

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


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.