Package org.opentcs.guing.persistence
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 booleanpersist(org.opentcs.guing.model.SystemModel systemModel, org.opentcs.access.KernelServicePortal portal, boolean ignoreValidationErrors)Persists the given model to the given kernel.
-
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.IllegalStateExceptionPersists 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:
trueif, 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.
-