Package org.opentcs.drivers.peripherals
Klasse BasicPeripheralCommAdapter
java.lang.Object
org.opentcs.drivers.peripherals.BasicPeripheralCommAdapter
- Alle implementierten Schnittstellen:
Lifecycle
,PeripheralCommAdapter
A base class for peripheral communication adapters mainly providing command queue processing.
-
Konstruktorübersicht
KonstruktorBeschreibungBasicPeripheralCommAdapter
(PeripheralProcessModel processModel, EventHandler eventHandler) Creates a new instance. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungprotected abstract void
Initiates a communication channel to the peripheral device.void
disable()
Disables this comm adapter, i.e. turns it off.protected abstract void
Closes the communication channel to the peripheral device.void
enable()
Enables this comm adapter, i.e. turns it on.protected EventHandler
Returns a model of the peripheral device's and its communication adapter's attributes.void
(Re-)Initializes this component before it is being used.boolean
Checks whether this communication adapter is enabled.boolean
Checks whether this component is initialized.protected void
sendProcessModelChangedEvent
(PeripheralProcessModel.Attribute attributeChanged) protected void
setProcessModel
(PeripheralProcessModel processModel) void
Terminates the instance and frees resources.Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.opentcs.drivers.peripherals.PeripheralCommAdapter
abortJob, canProcess, execute, process
-
Konstruktordetails
-
BasicPeripheralCommAdapter
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 SchnittstelleLifecycle
-
isInitialized
public boolean isInitialized()Beschreibung aus Schnittstelle kopiert:Lifecycle
Checks whether this component is initialized.- Angegeben von:
isInitialized
in SchnittstelleLifecycle
- 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.
-
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 SchnittstellePeripheralCommAdapter
-
isEnabled
public boolean isEnabled()Beschreibung aus Schnittstelle kopiert:PeripheralCommAdapter
Checks whether this communication adapter is enabled.- Angegeben von:
isEnabled
in SchnittstellePeripheralCommAdapter
- 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 SchnittstellePeripheralCommAdapter
-
getProcessModel
Beschreibung aus Schnittstelle kopiert:PeripheralCommAdapter
Returns a model of the peripheral device's and its communication adapter's attributes.- Angegeben von:
getProcessModel
in SchnittstellePeripheralCommAdapter
- Gibt zurück:
- A model of the peripheral device's and its communication adapter's attributes.
-
setProcessModel
-
getEventHandler
-
sendProcessModelChangedEvent
-
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 untildisconnectPeripheral()
is called. -
disconnectPeripheral
protected abstract void disconnectPeripheral()Closes the communication channel to the peripheral device.
-