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

    Fields inherited from class org.opentcs.guing.persistence.OpenTCSModelManager

    DEFAULT_LAYOUT, MODEL_DIRECTORY
  • 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
    boolean exportModel​(org.opentcs.components.plantoverview.PlantModelExporter exporter)
    Exports a model using the given exporter.
    boolean importModel​(org.opentcs.components.plantoverview.PlantModelImporter importer)
    Imports a model using the given importer.
    boolean loadModel​(java.io.File modelFile)
    Shows a dialog to select a model and loads it.
    boolean loadModel​(java.io.File modelFile, org.opentcs.guing.persistence.ModelFileReader reader)
    Shows a dialog to select a model and loads it.
    boolean uploadModel​(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opentcs.guing.persistence.ModelManager

    createEmptyModel, getModel, restoreModel, restoreModel, saveModelToFile
  • 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: ModelManagerModeling
      Shows a dialog to select a model and loads it.
      Specified by:
      loadModel in interface ModelManagerModeling
      Parameters:
      modelFile - The nullable model file to be loaded. If it is not present a dialog to select a file will be shown.
      Returns:
      true if, 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: ModelManagerModeling
      Shows a dialog to select a model and loads it.
      Specified by:
      loadModel in interface ModelManagerModeling
      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:
      true if, and only if, a model was successfully loaded.
    • importModel

      public boolean importModel​(org.opentcs.components.plantoverview.PlantModelImporter importer)
      Description copied from interface: ModelManagerModeling
      Imports a model using the given importer.
      Specified by:
      importModel in interface ModelManagerModeling
      Parameters:
      importer - The importer to be used.
      Returns:
      true if, and only if, a model was successfully imported.
    • uploadModel

      public boolean uploadModel​(org.opentcs.access.KernelServicePortal portal)
      Description copied from interface: ModelManagerModeling
      Uploads the given system model to the kernel.
      Specified by:
      uploadModel in interface ModelManagerModeling
      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: ModelManagerModeling
      Exports a model using the given exporter.
      Specified by:
      exportModel in interface ModelManagerModeling
      Parameters:
      exporter - The exporter to be used.
      Returns:
      true if, and only if, the model was successfully exported.