Klasse BasicPeripheralCommAdapter

java.lang.Object
org.opentcs.drivers.peripherals.BasicPeripheralCommAdapter
Alle implementierten Schnittstellen:
Lifecycle, PeripheralCommAdapter

public abstract class BasicPeripheralCommAdapter extends Object implements PeripheralCommAdapter
A base class for peripheral communication adapters mainly providing command queue processing.
  • Konstruktordetails

    • BasicPeripheralCommAdapter

      public BasicPeripheralCommAdapter(PeripheralProcessModel processModel, EventHandler eventHandler)
      Creates a new instance.
      Parameter:
      processModel - A model of the peripheral device's and its communication adapter's attributes.
      eventHandler - The handler used to send events to.
  • Methodendetails

    • initialize

      public void initialize()
      (Re-)Initializes this component before it is being used.

      Overriding methods are expected to call this implementation, too.

      Angegeben von:
      initialize in Schnittstelle Lifecycle
    • isInitialized

      public boolean isInitialized()
      Beschreibung aus Schnittstelle kopiert: Lifecycle
      Checks whether this component is initialized.
      Angegeben von:
      isInitialized in Schnittstelle Lifecycle
      Gibt zurück:
      true if, and only if, this component is initialized.
    • terminate

      public void terminate()
      Terminates the instance and frees resources.

      Overriding methods are expected to call this implementation, too.

      Angegeben von:
      terminate in Schnittstelle Lifecycle
    • enable

      public void enable()
      Enables this comm adapter, i.e. turns it on.

      Overriding methods are expected to call this implementation, too.

      Angegeben von:
      enable in Schnittstelle PeripheralCommAdapter
    • isEnabled

      public boolean isEnabled()
      Beschreibung aus Schnittstelle kopiert: PeripheralCommAdapter
      Checks whether this communication adapter is enabled.
      Angegeben von:
      isEnabled in Schnittstelle PeripheralCommAdapter
      Gibt zurück:
      true if, and only if, this communication adapter is enabled.
    • disable

      public void disable()
      Disables this comm adapter, i.e. turns it off.

      Overriding methods are expected to call this implementation, too.

      Angegeben von:
      disable in Schnittstelle PeripheralCommAdapter
    • getProcessModel

      public PeripheralProcessModel getProcessModel()
      Beschreibung aus Schnittstelle kopiert: PeripheralCommAdapter
      Returns a model of the peripheral device's and its communication adapter's attributes.
      Angegeben von:
      getProcessModel in Schnittstelle PeripheralCommAdapter
      Gibt zurück:
      A model of the peripheral device's and its communication adapter's attributes.
    • setProcessModel

      protected void setProcessModel(PeripheralProcessModel processModel)
    • getEventHandler

      protected EventHandler getEventHandler()
    • sendProcessModelChangedEvent

      protected void sendProcessModelChangedEvent(PeripheralProcessModel.Attribute attributeChanged)
    • connectPeripheral

      protected abstract void connectPeripheral()
      Initiates a communication channel to the peripheral device. This method should not block, i.e. it should not wait for the actual connection to be established, as the peripheral device could be temporarily absent or not responding at all. If that's the case, the communication adapter should continue trying to establish a connection until successful or until disconnectPeripheral() is called.
    • disconnectPeripheral

      protected abstract void disconnectPeripheral()
      Closes the communication channel to the peripheral device.