public SimulationExport CreateExportFor(IModel model, SimModelExportMode exportMode) { try { _modelExport = new SimulationExport(); _idMap = new Cache <string, int> { { Constants.TIME, 0 } }; _exportMode = exportMode; _allProcesses = model.Root.GetAllChildren <IProcess>(); _modelExport.ObjectPathDelimiter = ObjectPath.PATH_DELIMITER; model.Root.AcceptVisitor(this); return(_modelExport); } finally { _allProcesses = null; _modelExport = null; } }
private SimulationExport createSimulationExport(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode) { var simulationExportCreator = _simulationExportCreatorFactory.Create(); var simulationExport = simulationExportCreator.CreateExportFor(simulation.Model, simModelExportMode); simulationExport.AddSimulationConfiguration(simulation.SimulationSettings); return(simulationExport); }
public string ExportSimModelXml(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode) { return(_exportSerializer.Serialize(createSimulationExport(simulation, simModelExportMode))); }
/// <summary> /// Create the xml for simmodel based on the <paramref name="simulation" /> /// </summary> protected Task <string> CreateSimulationExportAsync(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode) { return(Task.Run(() => _simModelExporter.ExportSimModelXml(simulation, simModelExportMode))); }
/// <summary> /// Create the xml for simmodel based on the <paramref name="simulation" /> /// </summary> protected string CreateSimulationExport(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode) { return(_simModelExporter.ExportSimModelXml(simulation, simModelExportMode)); }
private SimulationExport createSimulationExport(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode) { var simulationExport = _createExportModelVisitor.CreateExportFor(simulation.Model, simModelExportMode); simulationExport.AddSimulationConfiguration(simulation.BuildConfiguration.SimulationSettings); return(simulationExport); }