Skip to content

Commit

Permalink
Sychronized Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Aug 6, 2021
1 parent 1773ebe commit ddbab91
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 20 deletions.
34 changes: 24 additions & 10 deletions Haas_Next_Generation/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ properties = {/*
value: "false",
scope: "post"
},/*
throughSpindle: {
title: "Allow Through Spindle Coolant",
description: "Enables through spindle coolant, if off uses flood",
type: "boolean",
group: 50,
value: true,
scope: "post"
},
useDPMFeeds: {
title: "Rotary moves use DPM feeds",
description: "Enable to output DPM feeds, disable for Inverse Time feeds with rotary axes moves.",
Expand Down Expand Up @@ -537,6 +545,10 @@ var secFormat = createFormat({decimals:3, forceDecimal:true}); // seconds - rang
var milliFormat = createFormat({decimals:0}); // milliseconds // range 1-9999
var taperFormat = createFormat({decimals:1, scale:DEG});

var forceX = createFormat({prefix:"X", decimals:4, forceDecimal:true});
var forceY = createFormat({prefix:"Y", decimals:4, forceDecimal:true});
var forceZ = createFormat({prefix:"Z", decimals:4, forceDecimal:true});

var xOutput = createVariable({prefix:"X"}, xyzFormat);
var yOutput = createVariable({prefix:"Y"}, xyzFormat);
var zOutput = createVariable({onchange: function() {retracted = false;}, prefix:"Z"}, xyzFormat);
Expand Down Expand Up @@ -914,9 +926,9 @@ function writeToolMeasureBlock(tool, preMeasure) {
(tool.bodyLength + tool.holderLength - LENGTH_TOLERANCE).toFixed(2) + "]] THEN #3000 = 1 (Tool length out of tolerance)");
if (probeType == 3) {
writeWords("IF [[#" + (2000 + tool.number) + " GT " +
writeWords("IF [[#" + (2400 + tool.number) + " GT " +
(tool.diameter + DIAM_TOLERANCE).toFixed(2) + "] OR [#" +
(2000 + tool.number) + " LT " +
(2400 + tool.number) + " LT " +
(tool.diameter - DIAM_TOLERANCE).toFixed(2) + "]] THEN #3000 = 1 (Tool diameter out of tolerance)");
}
}
Expand Down Expand Up @@ -1400,7 +1412,6 @@ function onOpen() {
}
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
//writeComment(comment);
if (getProperty("measureToolsAtStart")) {
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg");
Expand Down Expand Up @@ -2276,11 +2287,14 @@ function onSection() {
if (isFirstSection()) {
writeln("");
writeComment("STOCK PREP");
var Stock_X_55 = (stockUpperX - stockLowerX)/2;
writeln(macroFormat.format(100) + "=[[" + (Stock_X_55.toFixed(4) + "-" + macroFormat.format(5241)) + "]*-1.]");
writeWords("IF [" + macroFormat.format(100) + " GT 0.] THEN " + macroFormat.format(100) + "=0.");
writeWords("IF [" + macroFormat.format(100) + " LT " + (X_TRAVEL_LIMIT*-1) + "." + "] THEN " + macroFormat.format(100) + "=" + (X_TRAVEL_LIMIT*-1) + ".");
writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0));
var Stock_X_55 = (stockUpperX + stockLowerX)/2;
// TODO: Tolerance Checks
// writeln(macroFormat.format(100) + "=[" + macroFormat.format(5241) + "+" + xyzFormat.format(Stock_X_55) + "]");
// writeWords("IF [" + macroFormat.format(100) + " GT 0.] THEN " + macroFormat.format(100) + "=0.");
// writeWords("IF [" + macroFormat.format(100) + " LT " + (X_TRAVEL_LIMIT*-1) + "." + "] THEN " + macroFormat.format(100) + "=" + (X_TRAVEL_LIMIT*-1) + ".");
// 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");
writeBlock(mFormat.format(0));
}
Expand All @@ -2296,7 +2310,7 @@ function onSection() {
writeComment("Verify WCS");
writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool
writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY));
writeBlock(gFormat.format(55), gFormat.format(0), forceX.format(stockMidX), forceY.format(stockMidY));
displayMedia("xyWCSCheck.jpg");
writeBlock(mFormat.format(0), formatComment("Open door"));
/*
Expand Down Expand Up @@ -2481,7 +2495,7 @@ function onSection() {
onCommand(COMMAND_STOP_SPINDLE);
forceSpindleSpeed = true;
}
setCoolant(tool.coolant);
// setCoolant(tool.coolant);
} else if ((currentCoolantMode == COOLANT_THROUGH_TOOL) || (currentCoolantMode == COOLANT_AIR_THROUGH_TOOL) || (currentCoolantMode == COOLANT_FLOOD_THROUGH_TOOL)) {
onCommand(COMMAND_STOP_SPINDLE);
setCoolant(COOLANT_OFF);
Expand Down
34 changes: 24 additions & 10 deletions Haas_Next_Generation/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ properties = {/*
value: "false",
scope: "post"
},/*
throughSpindle: {
title: "Allow Through Spindle Coolant",
description: "Enables through spindle coolant, if off uses flood",
type: "boolean",
group: 50,
value: true,
scope: "post"
},
useDPMFeeds: {
title: "Rotary moves use DPM feeds",
description: "Enable to output DPM feeds, disable for Inverse Time feeds with rotary axes moves.",
Expand Down Expand Up @@ -537,6 +545,10 @@ var secFormat = createFormat({decimals:3, forceDecimal:true}); // seconds - rang
var milliFormat = createFormat({decimals:0}); // milliseconds // range 1-9999
var taperFormat = createFormat({decimals:1, scale:DEG});

var forceX = createFormat({prefix:"X", decimals:4, forceDecimal:true});
var forceY = createFormat({prefix:"Y", decimals:4, forceDecimal:true});
var forceZ = createFormat({prefix:"Z", decimals:4, forceDecimal:true});

var xOutput = createVariable({prefix:"X"}, xyzFormat);
var yOutput = createVariable({prefix:"Y"}, xyzFormat);
var zOutput = createVariable({onchange: function() {retracted = false;}, prefix:"Z"}, xyzFormat);
Expand Down Expand Up @@ -914,9 +926,9 @@ function writeToolMeasureBlock(tool, preMeasure) {
(tool.bodyLength + tool.holderLength - LENGTH_TOLERANCE).toFixed(2) + "]] THEN #3000 = 1 (Tool length out of tolerance)");
if (probeType == 3) {
writeWords("IF [[#" + (2000 + tool.number) + " GT " +
writeWords("IF [[#" + (2400 + tool.number) + " GT " +
(tool.diameter + DIAM_TOLERANCE).toFixed(2) + "] OR [#" +
(2000 + tool.number) + " LT " +
(2400 + tool.number) + " LT " +
(tool.diameter - DIAM_TOLERANCE).toFixed(2) + "]] THEN #3000 = 1 (Tool diameter out of tolerance)");
}
}
Expand Down Expand Up @@ -1400,7 +1412,6 @@ function onOpen() {
}
comment += " - " + getToolTypeName(tool.type);
writeComment(tool.description);
//writeComment(comment);
if (getProperty("measureToolsAtStart")) {
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6)); //Changes Tool
displayMedia("toolLoad" + tool.number + ".jpg");
Expand Down Expand Up @@ -2276,11 +2287,14 @@ function onSection() {
if (isFirstSection()) {
writeln("");
writeComment("STOCK PREP");
var Stock_X_55 = (stockUpperX - stockLowerX)/2;
writeln(macroFormat.format(100) + "=[[" + (Stock_X_55.toFixed(4) + "-" + macroFormat.format(5241)) + "]*-1.]");
writeWords("IF [" + macroFormat.format(100) + " GT 0.] THEN " + macroFormat.format(100) + "=0.");
writeWords("IF [" + macroFormat.format(100) + " LT " + (X_TRAVEL_LIMIT*-1) + "." + "] THEN " + macroFormat.format(100) + "=" + (X_TRAVEL_LIMIT*-1) + ".");
writeBlock(gFormat.format(53), "X" + macroFormat.format(100), yOutput.format(0));
var Stock_X_55 = (stockUpperX + stockLowerX)/2;
// TODO: Tolerance Checks
// writeln(macroFormat.format(100) + "=[" + macroFormat.format(5241) + "+" + xyzFormat.format(Stock_X_55) + "]");
// writeWords("IF [" + macroFormat.format(100) + " GT 0.] THEN " + macroFormat.format(100) + "=0.");
// writeWords("IF [" + macroFormat.format(100) + " LT " + (X_TRAVEL_LIMIT*-1) + "." + "] THEN " + macroFormat.format(100) + "=" + (X_TRAVEL_LIMIT*-1) + ".");
// 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");
writeBlock(mFormat.format(0));
}
Expand All @@ -2296,7 +2310,7 @@ function onSection() {
writeComment("Verify WCS");
writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool
writeBlock(gFormat.format(55), gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY));
writeBlock(gFormat.format(55), gFormat.format(0), forceX.format(stockMidX), forceY.format(stockMidY));
displayMedia("xyWCSCheck.jpg");
writeBlock(mFormat.format(0), formatComment("Open door"));
/*
Expand Down Expand Up @@ -2481,7 +2495,7 @@ function onSection() {
onCommand(COMMAND_STOP_SPINDLE);
forceSpindleSpeed = true;
}
setCoolant(tool.coolant);
// setCoolant(tool.coolant);
} else if ((currentCoolantMode == COOLANT_THROUGH_TOOL) || (currentCoolantMode == COOLANT_AIR_THROUGH_TOOL) || (currentCoolantMode == COOLANT_FLOOD_THROUGH_TOOL)) {
onCommand(COMMAND_STOP_SPINDLE);
setCoolant(COOLANT_OFF);
Expand Down

0 comments on commit ddbab91

Please sign in to comment.