Exemple #1
0
        private void CopyCFDPreprocessing()
        {
            META.AnalysisTool tool = META.AnalysisTool.GetByName("cfd_preprocessing");
            if (tool != null)
            {
                string cfdPreprocessDir = Path.Combine(tool.InstallLocation, tool.OutputDirectory);
                if (Directory.Exists(cfdPreprocessDir))
                {
                    UtilityHelpers.CopyFiles(cfdPreprocessDir,
                                             Path.Combine(OutputDirectory, "PreProcessing"));
                }
                else
                {
                    Logger.Instance.AddLogMessage(cfdPreprocessDir + " does not exist. META analysis tool did not install correctly.", Severity.Warning);
                }
            }
            else
            {
                Logger.Instance.AddLogMessage("Could not retrieve information about CFD Preprocessing tool from registry!", Severity.Warning);
            }

            using (StreamWriter writer = new StreamWriter(Path.Combine(this.OutputDirectory, "TestBench_PreProcess.cmd")))
            {
                Template.postprocess_cmd appendscript = new Template.postprocess_cmd()
                {
                    ScriptName = "main_pre_process.py"
                };

                writer.WriteLine(appendscript.TransformText());
            }

            List <string> ScriptPaths = new List <string>();

            ScriptPaths.Add("PreProcessing\\CFDPreprocess.py");
            using (StreamWriter writer = new StreamWriter(Path.Combine(this.OutputDirectory, "main_pre_process.py")))
            {
                Template.postprocess_py postpy = new Template.postprocess_py()
                {
                    ScriptNames = ScriptPaths,      //ScriptNames = scripts,
                    LogName     = "pre_process.log"
                };
                writer.WriteLine(postpy.TransformText());
            }
        }
Exemple #2
0
        public override void GenerateRunBat()
        {
            Template.run_bat_cfd searchmeta = new Template.run_bat_cfd()
            {
                Automation = IsAutomated,
            };
            using (StreamWriter writer = new StreamWriter(Path.Combine(OutputDirectory, "runCADJob.bat")))
            {
                writer.WriteLine(searchmeta.TransformText());
            }

            string metaPath = META.VersionInfo.MetaPath;

            if (!Directory.Exists(metaPath))
            {
                Logger.Instance.AddLogMessage("META_PATH is not found in registry!", Severity.Error);
            }

            string ergonomicsPath = Path.Combine(metaPath, @"analysis_tools\PYTHON_RICARDO\output_ergonomics\scripts");

            UtilityHelpers.CopyFiles(ergonomicsPath, Path.Combine(OutputDirectory, "scripts"));
        }