From 2905d88b5c355ac7f351fc5288378fbeeedcdc7c Mon Sep 17 00:00:00 2001 From: will1742 Date: Tue, 31 Aug 2021 14:44:37 -0400 Subject: [PATCH] File Readability Updates --- Flow_Waterjet_BIDC/Bechtel Waterjet.cps | 42 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/Flow_Waterjet_BIDC/Bechtel Waterjet.cps b/Flow_Waterjet_BIDC/Bechtel Waterjet.cps index 0da96aa..6825626 100644 --- a/Flow_Waterjet_BIDC/Bechtel Waterjet.cps +++ b/Flow_Waterjet_BIDC/Bechtel Waterjet.cps @@ -35,6 +35,8 @@ maximumCircularSweep = toRad(90); allowHelicalMoves = false; allowedCircularPlanes = 1 << PLANE_XY; // allow only XY circular motion +var maximumLineLength = 80; // the maximum number of charaters allowed in a line + // formatVersion: // version 6 should be user selectable, but now use version 5 // version 5 does not have z moves, so it will be safer for inexperienced users @@ -69,6 +71,10 @@ properties = { } }; +staticProperties = { + postVersion: "BIDC-FWJ.G8.A21" +}; + // use fixed width instead var xyzFormat = createFormat({decimals:4, trim:false}); var integerFormat = createFormat({decimals:0}); @@ -95,6 +101,14 @@ function writeBlock() { writeWords(arguments); } +function formatComment(comment) { + return "// " + comment; +} + +function writeComment(text) { + writeln(formatComment(text.substr(0, maximumLineLength - 2))); +} + var FIELD = " "; /** Make sure fields are aligned. */ @@ -361,11 +375,35 @@ function onClose() { if (isRedirecting()) { var mainProgram = getRedirectionBuffer(); // TAG: no need for redirection closeRedirection(); - writeln("// This file was created by FlowMaster(R), which is proprietary to Flow International Corporation. " + lineCounter + " " + arcCounter); + if (programName) { + var programId; + try { + programId = getAsInt(programName); + } catch (e) { + error(localize("Program name must be a number.")); + return; + } + } + writeComment("O" + programId); + writeComment("Career Account Username: " + getGlobalParameter("username")); + writeComment("Filename: " + getGlobalParameter("document-path")); + writeComment("Date: " + getGlobalParameter("generated-at")); + writeComment("Post Version: " + staticProperties.postVersion); + writeln(""); + writeBlock( + "//"," Start X", ",", + f("Start Y"), ",", + fi(" Arc"), ",", // arc cw/ccw + fi(" Feed"), ",", + fi(" Comp"), ",", // left, center, right + f("End X"), ",", + f("End Y") + ); + // writeln("// This file was created by FlowMaster(R), which is proprietary to Flow International Corporation. " + lineCounter + " " + arcCounter); if (useVersion6) { writeln("VER 6.00"); } - writeln("// Created by Autodesk HSM"); + // writeln("// Created by Autodesk HSM"); if (programComment) { writeln("// " + programComment); }