Package org.opentcs.guing.persistence
Class OpenTCSModelManagerModeling
java.lang.Object
org.opentcs.guing.persistence.OpenTCSModelManager
org.opentcs.guing.persistence.OpenTCSModelManagerModeling
- All Implemented Interfaces:
org.opentcs.guing.persistence.ModelManager,ModelManagerModeling
public class OpenTCSModelManagerModeling extends org.opentcs.guing.persistence.OpenTCSModelManager implements ModelManagerModeling
Manages (loads, persists and keeps) the driving course model.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description OpenTCSModelManagerModeling(org.opentcs.guing.util.CourseObjectFactory crsObjFactory, org.opentcs.guing.util.ModelComponentFactory modelComponentFactory, org.opentcs.guing.exchange.adapter.ProcessAdapterUtil procAdapterUtil, javax.inject.Provider<org.opentcs.guing.model.SystemModel> systemModelProvider, org.opentcs.guing.application.StatusPanel statusPanel, java.io.File homeDir, ModelKernelPersistor kernelPersistor, org.opentcs.guing.persistence.ModelFileReader modelReader, org.opentcs.guing.persistence.ModelFilePersistor modelPersistor, ModelImportAdapter modelImportAdapter, org.opentcs.guing.persistence.ModelExportAdapter modelExportAdapter, org.opentcs.guing.application.ProgressIndicator progressIndicator)Creates a new instance. -
Method Summary
Modifier and Type Method Description booleanexportModel(org.opentcs.components.plantoverview.PlantModelExporter exporter)Exports a model using the given exporter.booleanimportModel(org.opentcs.components.plantoverview.PlantModelImporter importer)Imports a model using the given importer.booleanloadModel(java.io.File modelFile)Shows a dialog to select a model and loads it.booleanloadModel(java.io.File modelFile, org.opentcs.guing.persistence.ModelFileReader reader)Shows a dialog to select a model and loads it.booleanuploadModel(org.opentcs.access.KernelServicePortal portal)Uploads the given system model to the kernel.Methods inherited from class org.opentcs.guing.persistence.OpenTCSModelManager
createEmptyModel, getModel, getModelExportAdapter, getModelName, getStatusPanel, initializeSystemModel, restoreModel, restoreModel, saveModelToFile, setCurrentModelFile, setModel, setModelName
-
Constructor Details
-
OpenTCSModelManagerModeling
@Inject public OpenTCSModelManagerModeling(org.opentcs.guing.util.CourseObjectFactory crsObjFactory, org.opentcs.guing.util.ModelComponentFactory modelComponentFactory, org.opentcs.guing.exchange.adapter.ProcessAdapterUtil procAdapterUtil, javax.inject.Provider<org.opentcs.guing.model.SystemModel> systemModelProvider, org.opentcs.guing.application.StatusPanel statusPanel, java.io.File homeDir, ModelKernelPersistor kernelPersistor, org.opentcs.guing.persistence.ModelFileReader modelReader, org.opentcs.guing.persistence.ModelFilePersistor modelPersistor, ModelImportAdapter modelImportAdapter, org.opentcs.guing.persistence.ModelExportAdapter modelExportAdapter, org.opentcs.guing.application.ProgressIndicator progressIndicator)Creates a new instance.- Parameters:
crsObjFactory- A course object factory to be used.modelComponentFactory- The model component factory to be used.procAdapterUtil- A utility class for process adapters.systemModelProvider- Provides instances of SystemModel.statusPanel- StatusPanel to log messages.homeDir- The application's home directory.kernelPersistor- Persists a model to a kernel.modelReader- The model reader.modelPersistor- The model persistor.modelImportAdapter- Converts model data on import.modelExportAdapter- Converts model data on export.progressIndicator- The progress indicator to be used.
-
-
Method Details
-
loadModel
public boolean loadModel(@Nullable java.io.File modelFile)Description copied from interface:ModelManagerModelingShows a dialog to select a model and loads it.- Specified by:
loadModelin interfaceModelManagerModeling- Parameters:
modelFile- The nullable model file to be loaded. If it is not present a dialog to select a file will be shown.- Returns:
trueif, and only if, a model was successfully loaded.
-
loadModel
public boolean loadModel(@Nullable java.io.File modelFile, org.opentcs.guing.persistence.ModelFileReader reader)Description copied from interface:ModelManagerModelingShows a dialog to select a model and loads it.- Specified by:
loadModelin interfaceModelManagerModeling- Parameters:
modelFile- The nullable model file to be loaded. If it is not present a dialog to select a file will be shown.reader- The reader which reads and parses the file.- Returns:
trueif, and only if, a model was successfully loaded.
-
importModel
public boolean importModel(org.opentcs.components.plantoverview.PlantModelImporter importer)Description copied from interface:ModelManagerModelingImports a model using the given importer.- Specified by:
importModelin interfaceModelManagerModeling- Parameters:
importer- The importer to be used.- Returns:
trueif, and only if, a model was successfully imported.
-
uploadModel
public boolean uploadModel(org.opentcs.access.KernelServicePortal portal)Description copied from interface:ModelManagerModelingUploads the given system model to the kernel.- Specified by:
uploadModelin interfaceModelManagerModeling- Parameters:
portal- The kernel client portal to upload the model to.- Returns:
- Whether the model was actually uploaded.
-
exportModel
public boolean exportModel(org.opentcs.components.plantoverview.PlantModelExporter exporter)Description copied from interface:ModelManagerModelingExports a model using the given exporter.- Specified by:
exportModelin interfaceModelManagerModeling- Parameters:
exporter- The exporter to be used.- Returns:
trueif, and only if, the model was successfully exported.
-