Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 379fe6b
Author: Williams, Gavin J <will1742@purdue.edu>
Date:   Thu Sep 16 14:35:30 2021 -0400

    Removed User Selected Axis

commit eaa3131
Author: will1742 <will1742@purdue.edu>
Date:   Thu Sep 16 14:17:57 2021 -0400

    Removed Manual A,B,C Selection

commit a6a840a
Author: will1742 <will1742@purdue.edu>
Date:   Thu Sep 16 14:12:04 2021 -0400

    Added Debug Mode and Feed Cancel

commit d584dba
Author: Williams, Gavin J <will1742@purdue.edu>
Date:   Thu Sep 16 11:54:12 2021 -0400

    Added Dwell for coolant

commit 72bcd93
Author: pan261 <pan261@purdue.edu>
Date:   Tue Sep 14 13:54:42 2021 -0400

    FIxed tool validation checking in Mills

commit 3ce1950
Author: Williams, Gavin J <will1742@purdue.edu>
Date:   Tue Sep 14 13:42:18 2021 -0400

    Added Tool Selection

commit ca32b19
Author: pan261 <pan261@purdue.edu>
Date:   Tue Sep 14 12:44:01 2021 -0400

    Changed H19 -> H1 for Verify WCS
  • Loading branch information
pan261 committed Sep 16, 2021
1 parent 218a399 commit 6fb2f7e
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 76 deletions.
81 changes: 49 additions & 32 deletions Flow_Waterjet_BIDC/Bechtel Waterjet.cps
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ longDescription = "Post for Flow Waterjets using software Version 5 or 6. V5=2-a
"V5: Manually set nozzle height. V6: Nozzle height in NC program set by Top Height attribute. " + EOL +
"Feed percentage set by Cutting Mode quality in tool dialog (auto=60, high=20, medium=40, low=100)";

extension = "ORD";
extension = "ord";
setCodePage("ascii");

capabilities = CAPABILITY_JET;
Expand Down Expand Up @@ -68,6 +68,13 @@ properties = {
],
value: "6",
scope: "post"
},
debugMode: {
title: "Debug Mode",
description: "Display Comments in ORD. Not compatible with machine",
type: "boolean",
value: false,
scope: "post"
}
};

Expand All @@ -87,6 +94,8 @@ var lineCounter = -1;
// collected state
var useVersion6 = false;
var arcFinish = undefined;
var feedActive = false;
var prevCoords = undefined;

// override radius compensation
var compensationOffset = 0; // center compensation
Expand All @@ -106,6 +115,7 @@ function formatComment(comment) {
}

function writeComment(text) {
if (!getProperty("debugMode")) return;
writeln(formatComment(text.substr(0, maximumLineLength - 2)));
}

Expand Down Expand Up @@ -218,13 +228,6 @@ function onSection() {
return;
}

if (hasParameter("operation-comment")) {
var comment = getParameter("operation-comment");
writeln("");
writeComment(comment);
} else {
writeln("");
}
var initialPosition = getFramePosition(currentSection.getInitialPosition());
onExpandedRapid(initialPosition.x, initialPosition.y, initialPosition.z);
}
Expand Down Expand Up @@ -256,14 +259,16 @@ function writeLinear(x, y, z, feed, column7) {
writeComment("Arc Completion");
break;
}
writeBlock(
commentf("X"), ",",
f("Y"), ",",
f("Z"), ",",
fi("L", 2), ",",
fi("Feed", 5), ",",
fi("C", 2), ",",
fi("?", 2));
if (getProperty("debugMode")){
writeBlock(
commentf("X"), ",",
f("Y"), ",",
f("Z"), ",",
fi("L", 2), ",",
fi("Feed", 5), ",",
fi("C", 2), ",",
fi("?", 2));
}
writeBlock(
f(xyzFormat.format(x)), ",",
f(xyzFormat.format(y)), ",",
Expand All @@ -285,7 +290,6 @@ function writeLinear(x, y, z, feed, column7) {
writeComment("Arc Completion");
break;
}
writeBlock(commentf("X"), ",", f("Y"), ",", fi("L", 2), ",", fi("Feed", 5), ",", fi("C", 2))
writeBlock(
f(xyzFormat.format(x)), ",",
f(xyzFormat.format(y)), ",",
Expand All @@ -297,7 +301,10 @@ function writeLinear(x, y, z, feed, column7) {
++lineCounter;
forceOutput = false;
}

if (feed > 0) {
feedActive = true;
}
prevCoords = {x:x, y:y, z:z};
}

function finishArcs() {
Expand All @@ -311,7 +318,12 @@ function finishArcs() {

function onRapid(x, y, z) {
finishArcs();
if (feedActive) {
forceOutput = true;
writeLinear(prevCoords.x, prevCoords.y, prevCoords.z, 0, 0);
}
writeLinear(x, y, z, 0, 0); // non-cutting
feedActive = false;
}

function onLinear(x, y, z, feed) {
Expand Down Expand Up @@ -342,17 +354,19 @@ function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {
var p = getCurrentPosition();
if (useVersion6) {
writeComment("Circular");
writeBlock(
commentf("X"), ",",
f("Y"), ",",
f("Z"), ",",
fi("CW", 2), ",",
fi("Feed", 5), ",",
fi("C", 2), ",",
fi("?", 2), ",",
f("CX"), ",",
f("CY"), ",",
f("CZ"));
if (getProperty("debugMode")){
writeBlock(
commentf("X"), ",",
f("Y"), ",",
f("Z"), ",",
fi("CW", 2), ",",
fi("Feed", 5), ",",
fi("C", 2), ",",
fi("?", 2), ",",
f("CX"), ",",
f("CY"), ",",
f("CZ"));
}
writeBlock(
f(xyzFormat.format(p.x)), ",",
f(xyzFormat.format(p.y)), ",",
Expand Down Expand Up @@ -381,7 +395,10 @@ function onCircular(clockwise, cx, cy, cz, x, y, z, feed) {

// save destination values to complete arc move
arcFinish = {x:x, y:y, z:z, feed:(power ? getFeedInPercent(feed) : 0)};

if (feed > 0) {
feedActive = true;
}
prevCoords = {x:x, y:y, z:z};
}

function getFeedInPercent(feed) {
Expand Down Expand Up @@ -451,11 +468,11 @@ function onClose() {
writeComment("Filename: " + getGlobalParameter("document-path"));
writeComment("Date: " + getGlobalParameter("generated-at"));
writeComment("Post Version: " + staticProperties.postVersion);
// writeln("// This file was created by FlowMaster(R), which is proprietary to Flow International Corporation. " + lineCounter + " " + arcCounter);
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
29 changes: 15 additions & 14 deletions Haas_Mills_BIDC/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ properties = {/*
],
value: "none",
scope: "post"
},*/
},
hasAAxis: {
title: "Has A-axis rotary",
description: "Enable if the machine has an A-axis table/trunnion. Check the table direction on the machine and use the (Reversed) selection if the table is moving in the opposite direction.",
Expand Down Expand Up @@ -110,7 +110,7 @@ properties = {/*
],
value: "false",
scope: "post"
},/*
},
throughSpindle: {
title: "Allow Through Spindle Coolant",
description: "Enables through spindle coolant, if off uses flood",
Expand Down Expand Up @@ -417,31 +417,31 @@ properties = {/*
},
toolLengthValidation: {
title: "Tool Length Validation",
description: "Length validation. By turning this off, you accept responsibility for any resulting crashes.",
description: "Length validation. By setting this to optional, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
scope: "post"
},
pencilWCSValidation: {
title: "WCS Validation",
description: "WCS validation. By turning this off, you accept responsibility for any resulting crashes.",
description: "WCS validation. By setting this to optional, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
scope: "post"
},
measureToolsAtStart: {
title: "Tool Probing",
description: "Tool Probing. By turning this off, you accept responsibility for any resulting crashes.",
description: "Tool Probing. By setting this to optional, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
scope: "post"
},
loadToolsAtStart: {
title: "Tool Loading",
description: "Tool Loading. By turning this off, you accept responsibility for any resulting crashes.",
description: "Tool Loading. By setting this to optional, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
Expand Down Expand Up @@ -486,6 +486,9 @@ staticProperties = {
coolantPressure: "",
singleResultsFile: true,
useP9995: true,
hasAAxis: "false",
hasBAxis: "false",
hasCAxis: "false",
postVersion: "DT1G8A21"
};

Expand Down Expand Up @@ -897,7 +900,6 @@ function prepareForToolCheck() {

function writeToolMeasureBlock(tool, preMeasure) {
var writeFunction = getProperty("measureToolsAtStart") ? writeBlock : writeOptionalBlock;
// var writeFunction = writeBlock;
var comment = measureTool ? formatComment("MEASURE TOOL") : "";
if (!preMeasure) {
prepareForToolCheck();
Expand Down Expand Up @@ -1098,9 +1100,9 @@ function setFeedrateMode(reset) {
}

function defineMachine() {
hasA = getProperty("hasAAxis") != "false";
hasB = getProperty("hasBAxis") != "false";
hasC = getProperty("hasCAxis") != "false";
hasA = staticProperties.hasAAxis != "false";
hasB = staticProperties.hasBAxis != "false";
hasC = staticProperties.hasCAxis != "false";
if (hasA && hasB && hasC) {
error(localize("Only two rotary axes can be active at the same time."));
Expand All @@ -1119,7 +1121,7 @@ function defineMachine() {
var cAxis;
var useTCPC = getProperty("useTCPC");
if (hasA) { // A Axis - For horizontal machines and trunnions
var dir = getProperty("hasAAxis") == "reversed" ? -1 : 1;
var dir = staticProperties.hasAAxis == "reversed" ? -1 : 1;
if (hasC || hasB) {
var aMin = (dir == 1) ? -120 - 0.0001 : -30 - 0.0001;
var aMax = (dir == 1) ? 30 + 0.0001 : 120 + 0.0001;
Expand All @@ -1130,7 +1132,7 @@ function defineMachine() {
}

if (hasB) { // B Axis - For horizontal machines and trunnions
var dir = getProperty("hasBAxis") == "reversed" ? -1 : 1;
var dir = staticProperties.hasBAxis == "reversed" ? -1 : 1;
if (hasC) {
var bMin = (dir == 1) ? -120 - 0.0001 : -30 - 0.0001;
var bMax = (dir == 1) ? 30 + 0.0001 : 120 + 0.0001;
Expand All @@ -1143,7 +1145,7 @@ function defineMachine() {
}

if (hasC) { // C Axis - For trunnions only
var dir = getProperty("hasCAxis") == "reversed" ? -1 : 1;
var dir = staticProperties.hasCAxis == "reversed" ? -1 : 1;
cAxis = createAxis({coordinate:2, table:true, axis:[0, 0, dir], cyclic:true, reset:1, tcp:useTCPC});
}

Expand Down Expand Up @@ -1441,7 +1443,6 @@ function onOpen() {
comment += " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg");
}
comment += " - " + getToolTypeName(tool.type);

writeComment(tool.description);
writeFunction("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg", !getProperty("loadToolsAtStart"));
Expand Down
Loading

0 comments on commit 6fb2f7e

Please sign in to comment.