Ejemplo n.º 1
0
        public override void GenerateRunBat()
        {
            StringBuilder sbuilder = new StringBuilder();

            sbuilder.AppendLine("REM ****************************");
            sbuilder.AppendLine("REM Ballistic Tool");
            sbuilder.AppendLine("REM ****************************");

            sbuilder.AppendLine("set BALLISTIC_CONFIG_FILE=\"BallisticConfig.json\"");
            sbuilder.AppendLine("set BALLISTIC_EXE_FILE_NAME=ballistics.exe");
            sbuilder.AppendLine("set BALLISTIC_EXE=\"%SWRI_BALLISTIC_EXTENSIONS%\\%BALLISTIC_EXE_FILE_NAME%\"\n");

            sbuilder.AppendLine("if exist %BALLISTIC_EXE% goto  :BALLISTIC_EXE_FOUND");
            sbuilder.AppendLine("@echo off");
            sbuilder.AppendLine("echo		Error: Could not find %BALLISTIC_EXE_FILE_NAME%.");
            sbuilder.AppendLine("echo		Your system is not properly configured to run %BALLISTIC_EXE_FILE_NAME%.");
            sbuilder.AppendLine("set ERROR_CODE=2");
            sbuilder.AppendLine("set ERROR_MSG=\"Error: Could not find ballistics.exe.\"\n");
            sbuilder.AppendLine("goto :ERROR_SECTION");

            sbuilder.AppendLine(":BALLISTIC_EXE_FOUND");
            sbuilder.AppendLine("%BALLISTIC_EXE% %BALLISTIC_CONFIG_FILE% --no-display\n");

            sbuilder.AppendLine("set ERROR_CODE=%ERRORLEVEL%");
            sbuilder.AppendLine("if %ERRORLEVEL% NEQ 0 (");
            sbuilder.AppendLine("set ERROR_MSG=\"ballistics.exe exited with error, exit code %ERROR_CODE%\"");
            sbuilder.AppendLine("goto :ERROR_SECTION");
            sbuilder.AppendLine(")");

            if (this.ballisticConfig.analysis.tier >= 3)
            {
                sbuilder.AppendLine("rd /s/q AP203_E2_SINGLE_FILE");
                sbuilder.AppendLine("del /f/q *.prt.* *.asm.*");
                sbuilder.AppendLine("rem ignore delete failures");
                sbuilder.AppendLine("cmd /c \"exit /b 0\"");
            }


            Template.run_bat searchmeta = new Template.run_bat()
            {
                Automation     = IsAutomated,
                XMLFileName    = "CADAssembly",
                Assembler      = "CREO",
                Mesher         = "NONE",
                Analyzer       = "NONE",
                CallDomainTool = sbuilder.ToString()
            };
            using (StreamWriter writer = new StreamWriter(Path.Combine(OutputDirectory, "runCADJob.bat")))
            {
                writer.WriteLine(searchmeta.TransformText());
            }


            // shotline viewer cmd file
            Template.run_shotlineviewer viewer = new Template.run_shotlineviewer();
            using (StreamWriter writer = new StreamWriter(Path.Combine(OutputDirectory, "runShotlineViewer.bat")))
            {
                writer.WriteLine(viewer.TransformText());
            }
        }
Ejemplo n.º 2
0
        public override void GenerateRunBat()
        {
            StringBuilder sbuilder = new StringBuilder();
            sbuilder.AppendLine("REM ****************************");
            sbuilder.AppendLine("REM Ballistic Tool");
            sbuilder.AppendLine("REM ****************************");

            sbuilder.AppendLine("set BALLISTIC_CONFIG_FILE=\"BallisticConfig.json\"");
            sbuilder.AppendLine("set BALLISTIC_EXE_FILE_NAME=ballistics.exe");
            sbuilder.AppendLine("set BALLISTIC_EXE=\"%SWRI_BALLISTIC_EXTENSIONS%\\%BALLISTIC_EXE_FILE_NAME%\"\n");

            sbuilder.AppendLine("if exist %BALLISTIC_EXE% goto  :BALLISTIC_EXE_FOUND");
            sbuilder.AppendLine("@echo off");
            sbuilder.AppendLine("echo		Error: Could not find %BALLISTIC_EXE_FILE_NAME%.");
            sbuilder.AppendLine("echo		Your system is not properly configured to run %BALLISTIC_EXE_FILE_NAME%.");
            sbuilder.AppendLine("set ERROR_CODE=2");
            sbuilder.AppendLine("set ERROR_MSG=\"Error: Could not find ballistics.exe.\"\n");
            sbuilder.AppendLine("goto :ERROR_SECTION");

            sbuilder.AppendLine(":BALLISTIC_EXE_FOUND");
            sbuilder.AppendLine("%BALLISTIC_EXE% %BALLISTIC_CONFIG_FILE% --no-display\n");

            sbuilder.AppendLine("set ERROR_CODE=%ERRORLEVEL%");
            sbuilder.AppendLine("if %ERRORLEVEL% NEQ 0 (");
            sbuilder.AppendLine("set ERROR_MSG=\"ballistics.exe exited with error, exit code %ERROR_CODE%\"");
            sbuilder.AppendLine("goto :ERROR_SECTION");
            sbuilder.AppendLine(")");

            if (this.ballisticConfig.analysis.tier >= 3)
            {
                sbuilder.AppendLine("rd /s/q AP203_E2_SINGLE_FILE");
                sbuilder.AppendLine("del /f/q *.prt.* *.asm.*");
                sbuilder.AppendLine("rem ignore delete failures");
                sbuilder.AppendLine("cmd /c \"exit /b 0\"");
            }


            Template.run_bat searchmeta = new Template.run_bat()
            {
                Automation = IsAutomated,
                XMLFileName = "CADAssembly",
                Assembler = "CREO",
                Mesher = "NONE",
                Analyzer = "NONE",
                CallDomainTool = sbuilder.ToString()
            };
            using (StreamWriter writer = new StreamWriter(Path.Combine(OutputDirectory, "runCADJob.bat")))
            {
                writer.WriteLine(searchmeta.TransformText());
            }


            // shotline viewer cmd file
            Template.run_shotlineviewer viewer = new Template.run_shotlineviewer();
            using (StreamWriter writer = new StreamWriter(Path.Combine(OutputDirectory, "runShotlineViewer.bat")))
            {
                writer.WriteLine(viewer.TransformText());
            }

        }