Class ModelKernelPersistor

java.lang.Object
org.opentcs.guing.persistence.ModelKernelPersistor

public class ModelKernelPersistor
extends java.lang.Object
Persists data kept in SystemModels to the kernel.
  • Constructor Summary

    Constructors 
    Constructor Description
    ModelKernelPersistor​(org.opentcs.guing.application.StatusPanel statusPanel, javax.inject.Provider<ModelValidator> validatorProvider, org.opentcs.guing.persistence.ModelExportAdapter modelExportAdapter)
    Creates a new instance.
  • Method Summary

    Modifier and Type Method Description
    boolean persist​(org.opentcs.guing.model.SystemModel systemModel, org.opentcs.access.KernelServicePortal portal, boolean ignoreValidationErrors)
    Persists the given model to the given kernel.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ModelKernelPersistor

      @Inject public ModelKernelPersistor​(@Nonnull org.opentcs.guing.application.StatusPanel statusPanel, @Nonnull javax.inject.Provider<ModelValidator> validatorProvider, org.opentcs.guing.persistence.ModelExportAdapter modelExportAdapter)
      Creates a new instance.
      Parameters:
      statusPanel - A status panel for logging error messages.
      validatorProvider - Provides validators for system models.
      modelExportAdapter - Converts model data on export.
  • Method Details

    • persist

      public boolean persist​(org.opentcs.guing.model.SystemModel systemModel, org.opentcs.access.KernelServicePortal portal, boolean ignoreValidationErrors) throws java.lang.IllegalStateException
      Persists the given model to the given kernel.
      Parameters:
      systemModel - The model to be persisted.
      portal - The plant model service used to persist to the kernel.
      ignoreValidationErrors - Whether to ignore any validation errors.
      Returns:
      true if, and only if, the model was valid or validation errors were to be ignored.
      Throws:
      java.lang.IllegalStateException - If there was a problem persisting the model on the kernel side.