From 6fb2f7e715f36fcd302223b3062c208e8c0e2351 Mon Sep 17 00:00:00 2001 From: pan261 Date: Thu, 16 Sep 2021 16:56:38 -0400 Subject: [PATCH] Squashed commit of the following: commit 379fe6b23050dbf928fb16d6c4c2a8140a219e66 Author: Williams, Gavin J Date: Thu Sep 16 14:35:30 2021 -0400 Removed User Selected Axis commit eaa3131b240038233f38c12c5cfb7af2cd57d564 Author: will1742 Date: Thu Sep 16 14:17:57 2021 -0400 Removed Manual A,B,C Selection commit a6a840a000e7df5116616cadd3afa16bcb645b79 Author: will1742 Date: Thu Sep 16 14:12:04 2021 -0400 Added Debug Mode and Feed Cancel commit d584dba8256dc9d22dc0681bf7908cb4767d884e Author: Williams, Gavin J Date: Thu Sep 16 11:54:12 2021 -0400 Added Dwell for coolant commit 72bcd9306acd06cf33c1ff0b5ff5a628fa2cbfbd Author: pan261 Date: Tue Sep 14 13:54:42 2021 -0400 FIxed tool validation checking in Mills commit 3ce1950882af0bf108c01f3b78bccd3ea14cd121 Author: Williams, Gavin J Date: Tue Sep 14 13:42:18 2021 -0400 Added Tool Selection commit ca32b19316c66d5d1acce74ec65a4336c1e6be76 Author: pan261 Date: Tue Sep 14 12:44:01 2021 -0400 Changed H19 -> H1 for Verify WCS --- Flow_Waterjet_BIDC/Bechtel Waterjet.cps | 81 +++++++++++++++---------- Haas_Mills_BIDC/Bechtel DT.cps | 29 ++++----- Haas_Mills_BIDC/Bechtel VF2.cps | 29 ++++----- Haas_Mills_BIDC/Bechtel VF4.cps | 35 ++++++----- 4 files changed, 98 insertions(+), 76 deletions(-) diff --git a/Flow_Waterjet_BIDC/Bechtel Waterjet.cps b/Flow_Waterjet_BIDC/Bechtel Waterjet.cps index 05ad654..57fd684 100644 --- a/Flow_Waterjet_BIDC/Bechtel Waterjet.cps +++ b/Flow_Waterjet_BIDC/Bechtel Waterjet.cps @@ -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; @@ -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" } }; @@ -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 @@ -106,6 +115,7 @@ function formatComment(comment) { } function writeComment(text) { + if (!getProperty("debugMode")) return; writeln(formatComment(text.substr(0, maximumLineLength - 2))); } @@ -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); } @@ -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)), ",", @@ -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)), ",", @@ -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() { @@ -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) { @@ -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)), ",", @@ -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) { @@ -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); } diff --git a/Haas_Mills_BIDC/Bechtel DT.cps b/Haas_Mills_BIDC/Bechtel DT.cps index a7d8a35..c618ce4 100644 --- a/Haas_Mills_BIDC/Bechtel DT.cps +++ b/Haas_Mills_BIDC/Bechtel DT.cps @@ -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.", @@ -110,7 +110,7 @@ properties = {/* ], value: "false", scope: "post" - },/* + }, throughSpindle: { title: "Allow Through Spindle Coolant", description: "Enables through spindle coolant, if off uses flood", @@ -417,7 +417,7 @@ 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, @@ -425,7 +425,7 @@ properties = {/* }, 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, @@ -433,7 +433,7 @@ properties = {/* }, 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, @@ -441,7 +441,7 @@ properties = {/* }, 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, @@ -486,6 +486,9 @@ staticProperties = { coolantPressure: "", singleResultsFile: true, useP9995: true, + hasAAxis: "false", + hasBAxis: "false", + hasCAxis: "false", postVersion: "DT1G8A21" }; @@ -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(); @@ -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.")); @@ -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; @@ -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; @@ -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}); } @@ -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")); diff --git a/Haas_Mills_BIDC/Bechtel VF2.cps b/Haas_Mills_BIDC/Bechtel VF2.cps index b46e4c2..091fbfc 100644 --- a/Haas_Mills_BIDC/Bechtel VF2.cps +++ b/Haas_Mills_BIDC/Bechtel VF2.cps @@ -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.", @@ -110,7 +110,7 @@ properties = {/* ], value: "false", scope: "post" - },/* + }, throughSpindle: { title: "Allow Through Spindle Coolant", description: "Enables through spindle coolant, if off uses flood", @@ -417,7 +417,7 @@ 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, @@ -425,7 +425,7 @@ properties = {/* }, 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, @@ -433,7 +433,7 @@ properties = {/* }, 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, @@ -441,7 +441,7 @@ properties = {/* }, 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, @@ -486,6 +486,9 @@ staticProperties = { coolantPressure: "", singleResultsFile: true, useP9995: true, + hasAAxis: "false", + hasBAxis: "false", + hasCAxis: "false", postVersion: "VF2G8A21" }; @@ -897,7 +900,6 @@ function prepareForToolCheck() { function writeToolMeasureBlock(tool, preMeasure) { var writeFunction = getProperty("measureToolsAtStart") ? writeBlock : writeOptionalBlock; - var comment = measureTool ? formatComment("MEASURE TOOL") : ""; if (!preMeasure) { prepareForToolCheck(); @@ -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.")); @@ -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; @@ -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; @@ -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}); } @@ -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")); diff --git a/Haas_Mills_BIDC/Bechtel VF4.cps b/Haas_Mills_BIDC/Bechtel VF4.cps index 7522560..359bc34 100644 --- a/Haas_Mills_BIDC/Bechtel VF4.cps +++ b/Haas_Mills_BIDC/Bechtel VF4.cps @@ -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.", @@ -110,7 +110,7 @@ properties = {/* ], value: "false", scope: "post" - },/* + }, throughSpindle: { title: "Allow Through Spindle Coolant", description: "Enables through spindle coolant, if off uses flood", @@ -417,7 +417,7 @@ 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, @@ -425,7 +425,7 @@ properties = {/* }, 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, @@ -433,7 +433,7 @@ properties = {/* }, 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, @@ -441,7 +441,7 @@ properties = {/* }, 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, @@ -486,6 +486,9 @@ staticProperties = { coolantPressure: "", singleResultsFile: true, useP9995: true, + hasAAxis: "false", + hasBAxis: "false", + hasCAxis: "false", postVersion: "VF4G8A21" }; @@ -896,7 +899,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(); @@ -1097,9 +1099,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.")); @@ -1118,7 +1120,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; @@ -1129,7 +1131,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; @@ -1142,7 +1144,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}); } @@ -2319,7 +2321,7 @@ function onSection() { // writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0)); writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(Stock_X_55)); writeBlock(gFormat.format(53), gFormat.format(0), yOutput.format(0)); - displayMedia("loadStock.jpg"); + displayMedia("loadStock.jpg", false); writeBlock(mFormat.format(0)); } @@ -2335,9 +2337,9 @@ function onSection() { writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool writeBlock(gFormat.format(55), gFormat.format(0), forceX.format(stockMidX), forceY.format(stockMidY)); - if (getProperty("hasAAxis") != "false" && getProperty("hasCAxis") != "false") { + if (staticProperties.hasAAxis != "false" && staticProperties.hasCAxis != "false") { writeBlock(gFormat.format(0), aOutput.format(0), cOutput.format(0)); - } else if (getProperty("hasAAxis") != "false") { + } else if (staticProperties.hasAAxis != "false") { writeBlock(gFormat.format(0), aOutput.format(0)); } displayMedia("xyWCSCheck.jpg", false); @@ -2820,6 +2822,7 @@ function onSection() { if (tool.type != TOOL_PROBE) { setCoolant(tool.coolant); + writeBlock(gFormat.format(4), "P500"); } writeComment("BEGIN OPERATION");