Package org.opentcs.components.kernel.services

# 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.
  `void` | `updateLocationLock​(TCSObjectReference<Location> ref, boolean locked)` | Updates a location's lock state.

  ### Methods inherited from interface org.opentcs.components.kernel.services.TCSObjectService

  `appendObjectHistoryEntry, fetchObject, fetchObject, fetchObjects, fetchObjects, updateObjectProperty`

- ## Method Details

  - ### createPlantModel

    void createPlantModel​(PlantModelCreationTO to) throws ObjectUnknownException, ObjectExistsException, KernelRuntimeException, java.lang.IllegalStateException
    Creates 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

    java.lang.String getModelName() throws KernelRuntimeException
    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 KernelRuntimeException
    Returns 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, KernelRuntimeException
    Updates 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.