コード例 #1
0
        public async Task Verify(FileInfo kplModelFile, FileInfo outputFile, SimulatorSettings settings, ISimulatorProgressMonitor monitor)
        {
            this.settings = settings;
            this.monitor  = monitor;
            await Task.Run(() =>
            {
                try
                {
                    monitor.Start(5, string.Format("Simulates the {0} model using the FLAME simulator...", kplModelFile.Name));

                    monitor.LogProgress(0, "Translate in the correspoding FLAME model...");
                    FileInfo tempFolder;
                    TranslateModel(kplModelFile, outputFile, out tempFolder);

                    monitor.LogProgress(2, "Generating the FLAME model...");
                    GenerateModel(new FileInfo(tempFolder + modelGeneratedFile));

                    monitor.LogProgress(3, "Compiling the FLAME model...");
                    CompileModel(tempFolder);

                    Clean(tempFolder);

                    monitor.LogProgress(4, "Simulate the FLAME model...");
                    Simulate(outputFile);


                    monitor.Done("Finished the simulation process");
                }
                catch (Exception e)
                {
                    monitor.Terminate("Simulation failed: " + e.Message);
                }
            });
        }
コード例 #2
0
 public async Task Verify(FileInfo kplModelFile, FileInfo outputFile, SimulatorSettings settings, SimulatorTarget target, ISimulatorProgressMonitor monitor)
 {
     var executor = GetExecutor(target);
     await executor.Verify(kplModelFile, outputFile, settings, monitor);
 }
コード例 #3
0
        public async Task Verify(FileInfo kplModelFile, FileInfo outputFile, SimulatorSettings settings, ISimulatorProgressMonitor monitor)
        {
            this.settings = settings;
            await Task.Run(() =>
            {
                try
                {
                    monitor.Start(1, string.Format("Simulating the {0} model using the kPWorkbench simulator...", kplModelFile.Name));

                    monitor.LogProgress(0, "Performing simulation...");
                    Execute(kplModelFile, outputFile);

                    monitor.Done("Finished the simulation process");
                }
                catch (Exception e)
                {
                    monitor.Terminate("Simulation failed: " + e.Message);
                }
            });
        }