Interface VehicleService
- All Superinterfaces:
TCSObjectService
- All Known Subinterfaces:
InternalVehicleService
public interface VehicleService extends TCSObjectService
Provides methods concerning
Vehicles.-
Method Summary
Modifier and Type Method Description voidattachCommAdapter(TCSObjectReference<Vehicle> ref, VehicleCommAdapterDescription description)Attaches the described comm adapter to the referenced vehicle.voiddisableCommAdapter(TCSObjectReference<Vehicle> ref)Disables the comm adapter attached to the referenced vehicle.voidenableCommAdapter(TCSObjectReference<Vehicle> ref)Enables the comm adapter attached to the referenced vehicle.VehicleAttachmentInformationfetchAttachmentInformation(TCSObjectReference<Vehicle> ref)Returns attachment information for the referenced vehicle.VehicleProcessModelTOfetchProcessModel(TCSObjectReference<Vehicle> ref)Returns the process model for the referenced vehicle.voidsendCommAdapterCommand(TCSObjectReference<Vehicle> ref, AdapterCommand command)Sends anAdapterCommandto the comm adapter attached to the referenced vehicle.voidsendCommAdapterMessage(TCSObjectReference<Vehicle> ref, java.lang.Object message)Sends a message to the communication adapter associated with the referenced vehicle.voidupdateVehicleAllowedOrderTypes(TCSObjectReference<Vehicle> ref, java.util.Set<java.lang.String> allowedOrderTypes)Updates the types of transport orders a vehicle is allowed to process.default voidupdateVehicleEnvelopeKey(TCSObjectReference<Vehicle> ref, java.lang.String envelopeKey)Updates the vehicle's envelope key.voidupdateVehicleIntegrationLevel(TCSObjectReference<Vehicle> ref, Vehicle.IntegrationLevel integrationLevel)Updates the vehicle's integration level.voidupdateVehiclePaused(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, KernelRuntimeExceptionAttaches 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, KernelRuntimeExceptionDisables 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, KernelRuntimeExceptionEnables 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, KernelRuntimeExceptionReturns 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, KernelRuntimeExceptionReturns 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, KernelRuntimeExceptionSends anAdapterCommandto 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:
VehicleCommAdapter.execute(AdapterCommand)
-
sendCommAdapterMessage
void sendCommAdapterMessage(TCSObjectReference<Vehicle> ref, java.lang.Object message) throws ObjectUnknownException, KernelRuntimeExceptionSends 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:
VehicleCommAdapter.processMessage(java.lang.Object)
-
updateVehicleIntegrationLevel
void updateVehicleIntegrationLevel(TCSObjectReference<Vehicle> ref, Vehicle.IntegrationLevel integrationLevel) throws ObjectUnknownException, KernelRuntimeException, java.lang.IllegalArgumentExceptionUpdates 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.java.lang.IllegalArgumentException- If changing the vehicle's integration level tointegrationLevelis not allowed from its current integration level.
-
updateVehiclePaused
void updateVehiclePaused(TCSObjectReference<Vehicle> ref, boolean paused) throws ObjectUnknownException, KernelRuntimeExceptionUpdates 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, java.util.Set<java.lang.String> allowedOrderTypes) throws ObjectUnknownException, KernelRuntimeExceptionUpdates 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
@ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default void updateVehicleEnvelopeKey(TCSObjectReference<Vehicle> ref, java.lang.String envelopeKey) throws ObjectUnknownException, java.lang.IllegalArgumentException, KernelRuntimeExceptionUpdates 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.java.lang.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.
-