コード例 #1
0
        private static void GenerateDefaultInputFiles()
        {
            var inputFiles = SimulationInputProvider.GenerateAllSimulationInputs();

            foreach (var input in inputFiles)
            {
                input.ToFile("infile_" + input.OutputName + ".txt"); // write json to .txt files
            }
        }
コード例 #2
0
        private static void GenerateDefaultInputFiles()
        {
            var infiles = SimulationInputProvider.GenerateAllSimulationInputs();

            for (int i = 0; i < infiles.Count; i++)
            {
                infiles[i].ToFile("infile_" + infiles[i].OutputName + ".txt"); // write json to .txt files
            }
            //var sources = SourceInputProvider.GenerateAllSourceInputs();
            //sources.WriteToJson("infile_source_options_test.txt");
        }
コード例 #3
0
        private void MC_DownloadDefaultSimulationInput_Executed(object sender, ExecutedEventArgs e)
        {
            using (var stream = StreamFinder.GetLocalFilestreamFromSaveFileDialog("zip"))
            {
                if (stream != null)
                {
                    var files = SimulationInputProvider.GenerateAllSimulationInputs().Select(input =>
                                                                                             new
                    {
                        Name  = "infile_" + input.OutputName + ".txt",
                        Input = input
                    });

                    foreach (var file in files)
                    {
                        file.Input.ToFile(file.Name);
                    }
                    var allFiles = files.Concat(files);
                    FileIO.ZipFiles(files.Select(file => file.Name), "", stream);
                    logger.Info(() => "Template simulation input files exported to a zip file.\r");
                }
            }
        }