Interface VehicleService
- All Superinterfaces:
TCSObjectService
- All Known Subinterfaces:
InternalVehicleService
Provides methods concerning
Vehicle
s.-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachCommAdapter
(TCSObjectReference<Vehicle> ref, VehicleCommAdapterDescription description) Attaches the described comm adapter to the referenced vehicle.void
Disables the comm adapter attached to the referenced vehicle.void
Enables the comm adapter attached to the referenced vehicle.Returns attachment information for the referenced vehicle.Returns the process model for the referenced vehicle.void
sendCommAdapterCommand
(TCSObjectReference<Vehicle> ref, AdapterCommand command) Sends anAdapterCommand
to the comm adapter attached to the referenced vehicle.void
sendCommAdapterMessage
(TCSObjectReference<Vehicle> ref, Object message) Sends a message to the communication adapter associated with the referenced vehicle.void
updateVehicleAllowedOrderTypes
(TCSObjectReference<Vehicle> ref, Set<String> allowedOrderTypes) Updates the types of transport orders a vehicle is allowed to process.void
updateVehicleEnvelopeKey
(TCSObjectReference<Vehicle> ref, String envelopeKey) Updates the vehicle's envelope key.void
updateVehicleIntegrationLevel
(TCSObjectReference<Vehicle> ref, Vehicle.IntegrationLevel integrationLevel) Updates the vehicle's integration level.void
updateVehiclePaused
(TCSObjectReference<Vehicle> ref, boolean paused) Updates the vehicle's paused state.Methods inherited from interface org.opentcs.components.kernel.services.TCSObjectService
appendObjectHistoryEntry, fetchObject, fetchObject, fetchObjects, fetchObjects, updateObjectProperty
-
Method Details
-
attachCommAdapter
void attachCommAdapter(TCSObjectReference<Vehicle> ref, VehicleCommAdapterDescription description) throws ObjectUnknownException, KernelRuntimeException Attaches the described comm adapter to the referenced vehicle.- Parameters:
ref
- A reference to the vehicle.description
- The description for the comm adapter to be attached.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
disableCommAdapter
void disableCommAdapter(TCSObjectReference<Vehicle> ref) throws ObjectUnknownException, KernelRuntimeException Disables the comm adapter attached to the referenced vehicle.- Parameters:
ref
- A reference to the vehicle the comm adapter is attached to.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
enableCommAdapter
void enableCommAdapter(TCSObjectReference<Vehicle> ref) throws ObjectUnknownException, KernelRuntimeException Enables the comm adapter attached to the referenced vehicle.- Parameters:
ref
- A reference to the vehicle the comm adapter is attached to.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
fetchAttachmentInformation
VehicleAttachmentInformation fetchAttachmentInformation(TCSObjectReference<Vehicle> ref) throws ObjectUnknownException, KernelRuntimeException Returns attachment information for the referenced vehicle.- Parameters:
ref
- A reference to the vehicle.- Returns:
- The attachment information.
- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
fetchProcessModel
VehicleProcessModelTO fetchProcessModel(TCSObjectReference<Vehicle> ref) throws ObjectUnknownException, KernelRuntimeException Returns the process model for the referenced vehicle.- Parameters:
ref
- A reference to the vehicle.- Returns:
- The process model.
- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
sendCommAdapterCommand
void sendCommAdapterCommand(TCSObjectReference<Vehicle> ref, AdapterCommand command) throws ObjectUnknownException, KernelRuntimeException Sends anAdapterCommand
to the comm adapter attached to the referenced vehicle.If called within the kernel application, this method is supposed to be called only on the kernel executor thread.
- Parameters:
ref
- A reference to the vehicle.command
- The adapter command to send.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.- See Also:
-
sendCommAdapterMessage
void sendCommAdapterMessage(TCSObjectReference<Vehicle> ref, Object message) throws ObjectUnknownException, KernelRuntimeException Sends a message to the communication adapter associated with the referenced vehicle. This method provides a generic one-way communication channel to the communication adapter of a vehicle. Note that there is no return value and no guarantee that the communication adapter will understand the message; clients cannot even know which communication adapter is attached to a vehicle, so it's entirely possible that the communication adapter receiving the message does not understand it.- Parameters:
ref
- The vehicle whose communication adapter shall receive the message.message
- The message to be delivered.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- If the calling client is not allowed to execute this method.- See Also:
-
updateVehicleIntegrationLevel
void updateVehicleIntegrationLevel(TCSObjectReference<Vehicle> ref, Vehicle.IntegrationLevel integrationLevel) throws ObjectUnknownException, KernelRuntimeException, IllegalArgumentException Updates the vehicle's integration level.- Parameters:
ref
- A reference to the vehicle.integrationLevel
- The vehicle's new integration level.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.IllegalArgumentException
- If changing the vehicle's integration level tointegrationLevel
is not allowed from its current integration level.
-
updateVehiclePaused
void updateVehiclePaused(TCSObjectReference<Vehicle> ref, boolean paused) throws ObjectUnknownException, KernelRuntimeException Updates the vehicle's paused state.- Parameters:
ref
- A refrence to the vehicle.paused
- The vehicle's new paused state.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
updateVehicleAllowedOrderTypes
void updateVehicleAllowedOrderTypes(TCSObjectReference<Vehicle> ref, Set<String> allowedOrderTypes) throws ObjectUnknownException, KernelRuntimeException Updates the types of transport orders a vehicle is allowed to process.- Parameters:
ref
- A reference to the vehicle to be modified.allowedOrderTypes
- A set of transport order types.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
updateVehicleEnvelopeKey
void updateVehicleEnvelopeKey(TCSObjectReference<Vehicle> ref, String envelopeKey) throws ObjectUnknownException, IllegalArgumentException, KernelRuntimeException Updates the vehicle's envelope key.- Parameters:
ref
- A reference to the vehicle.envelopeKey
- The vehicle's new envelope key.- Throws:
ObjectUnknownException
- If the referenced vehicle does not exist.IllegalArgumentException
- If the referenced vehicle is processing a transport order or is currently claiming/allocating resources.KernelRuntimeException
- In case there is an exception executing this method.
-