Interface PlantModelService
- All Superinterfaces:
TCSObjectService
- All Known Subinterfaces:
InternalPlantModelService
public interface PlantModelService extends TCSObjectService
Provides methods concerning the plant model.
-
Method Summary
Modifier and Type Method Description void
createPlantModel(PlantModelCreationTO to)
Creates a new plant model with the objects described in the given transfer object.java.lang.String
getModelName()
Returns the name of the model that is currently loaded in the kernel.java.util.Map<java.lang.String,java.lang.String>
getModelProperties()
Returns the model's properties.PlantModel
getPlantModel()
Returns a representation of the plant model's current state.void
updateLocationLock(TCSObjectReference<Location> ref, boolean locked)
Updates a location's lock state.default void
updatePathLock(TCSObjectReference<Path> ref, boolean locked)
Updates a path's lock state.Methods inherited from interface org.opentcs.components.kernel.services.TCSObjectService
appendObjectHistoryEntry, fetchObject, fetchObject, fetchObjects, fetchObjects, updateObjectProperty
-
Method Details
-
getPlantModel
Returns a representation of the plant model's current state.- Returns:
- The complete plant model.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
createPlantModel
void createPlantModel(PlantModelCreationTO to) throws ObjectUnknownException, ObjectExistsException, KernelRuntimeException, java.lang.IllegalStateExceptionCreates a new plant model with the objects described in the given transfer object. Implicitly saves/persists the new plant model.- Parameters:
to
- The transfer object describing the plant model objects to be created.- Throws:
ObjectUnknownException
- If any referenced object does not exist.ObjectExistsException
- If an object with the same name already exists in the model.KernelRuntimeException
- In case there is an exception executing this method.java.lang.IllegalStateException
- If there was a problem persisting the model.
-
getModelName
Returns the name of the model that is currently loaded in the kernel.- Returns:
- The name of the currently loaded model.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
getModelProperties
java.util.Map<java.lang.String,java.lang.String> getModelProperties() throws KernelRuntimeExceptionReturns the model's properties.- Returns:
- The model's properties.
- Throws:
KernelRuntimeException
- In case there is an exception executing this method.
-
updateLocationLock
void updateLocationLock(TCSObjectReference<Location> ref, boolean locked) throws ObjectUnknownException, KernelRuntimeExceptionUpdates a location's lock state.- Parameters:
ref
- A reference to the location to be updated.locked
- Indicates whether the location is to be locked (true
) or unlocked (false
).- Throws:
ObjectUnknownException
- If the referenced location does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-
updatePathLock
@ScheduledApiChange(when="6.0", details="Default implementation will be removed.") default void updatePathLock(TCSObjectReference<Path> ref, boolean locked) throws ObjectUnknownException, KernelRuntimeExceptionUpdates a path's lock state.- Parameters:
ref
- A reference to the path to be updated.locked
- Indicates whether the path is to be locked (true
) or unlocked (false
).- Throws:
ObjectUnknownException
- If the referenced path does not exist.KernelRuntimeException
- In case there is an exception executing this method.
-