Exemplo n.º 1
0
        private void exportToDirectory(ISimulation simulation, string exportDirectory)
        {
            var fileName            = createFilePathFor(simulation, exportDirectory, Constants.Filter.XML_EXTENSION);
            var modelCoreSimulation = _simulationToModelCoreSimulationMapper.MapFrom(simulation, shouldCloneModel: false);

            _simModelExporter.ExportSimModelXml(modelCoreSimulation, fileName);
        }
        public void ExportSimModelXml(IMoBiSimulation simulation)
        {
            var fileName = _dialogCreator.AskForFileToSave(AppConstants.Captions.Save, AppConstants.Filter.SIM_MODEL_FILE_FILTER, Constants.DirectoryKey.SIM_MODEL_XML, simulation.Name);

            if (fileName.IsNullOrEmpty())
            {
                return;
            }
            _simModelExporter.ExportSimModelXml(simulation, fileName);
        }
Exemplo n.º 3
0
        public void SaveToSimModelXmlFile(string pkmlFileFullPath, string simModelXmlFileFullPath)
        {
            var simulationTransfer = _simulationTransferLoader.Load(pkmlFileFullPath);

            _simModelExporter.ExportSimModelXml(simulationTransfer.Simulation, simModelXmlFileFullPath);
        }
Exemplo n.º 4
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));
 }
Exemplo n.º 5
0
 public Task ExportSimulationToSimModelXmlAsync(Simulation simulation, string fileName)
 {
     return(Task.Run(() => _simModelExporter.ExportSimModelXml(_coreSimulationMapper.MapFrom(simulation, shouldCloneModel: false), fileName)));
 }