Пример #1
0
        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;
            }
        }
Пример #2
0
        private SimulationExport createSimulationExport(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode)
        {
            var simulationExportCreator = _simulationExportCreatorFactory.Create();
            var simulationExport        = simulationExportCreator.CreateExportFor(simulation.Model, simModelExportMode);

            simulationExport.AddSimulationConfiguration(simulation.SimulationSettings);
            return(simulationExport);
        }
Пример #3
0
 public string ExportSimModelXml(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode)
 {
     return(_exportSerializer.Serialize(createSimulationExport(simulation, simModelExportMode)));
 }
Пример #4
0
 /// <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)));
 }
Пример #5
0
 /// <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));
 }
Пример #6
0
        private SimulationExport createSimulationExport(IModelCoreSimulation simulation, SimModelExportMode simModelExportMode)
        {
            var simulationExport = _createExportModelVisitor.CreateExportFor(simulation.Model, simModelExportMode);

            simulationExport.AddSimulationConfiguration(simulation.BuildConfiguration.SimulationSettings);
            return(simulationExport);
        }