Package org.opentcs.drivers.peripherals
Schnittstelle PeripheralController
- Alle Superschnittstellen:
Lifecycle
Provides high-level methods for the system to control a peripheral device.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
abortJob()
Aborts the current job, if any.canProcess
(PeripheralJob job) Checks if the peripheral device would be able to process the given job, taking into account its current state.void
process
(PeripheralJob job, PeripheralJobCallback callback) Lets the peripheral device associated with this controller process the given job.void
Sends aPeripheralAdapterCommand
to the communication adapter.Von Schnittstelle geerbte Methoden org.opentcs.components.Lifecycle
initialize, isInitialized, terminate
-
Methodendetails
-
process
void process(@Nonnull PeripheralJob job, @Nonnull PeripheralJobCallback callback) throws IllegalStateException Lets the peripheral device associated with this controller process the given job. The callback is used to inform about the successful or failed completion of the job.- Parameter:
job
- The job to process.callback
- The callback to use.- Löst aus:
IllegalStateException
- If this peripheral device associated with this controller cannot process the job.
-
abortJob
void abortJob()Aborts the current job, if any.Whether a job can actually be aborted depends on the actual peripheral/job semantics. The callback for the current job may still be called to indicate the job has failed, but it is not strictly expected to. The kernel will ignore calls to the callback after calling this method.
-
canProcess
Checks if the peripheral device would be able to process the given job, taking into account its current state.- Parameter:
job
- A job that might have to be processed.- Gibt zurück:
- An
ExplainedBoolean
telling if the peripheral device would be able to process the job.
-
sendCommAdapterCommand
Sends aPeripheralAdapterCommand
to the communication adapter.- Parameter:
command
- The adapter command to be sent.
-