Skip to content

Commit

Permalink
File Readability Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Sep 7, 2021
1 parent dffdcf0 commit 2905d88
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions Flow_Waterjet_BIDC/Bechtel Waterjet.cps
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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});
Expand All @@ -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. */
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 2905d88

Please sign in to comment.