Skip to content

Commit

Permalink
Revert "fixed bug with loadTools and measureTools are both 'false'"
Browse files Browse the repository at this point in the history
This reverts commit 0c71dc7.
  • Loading branch information
will1742 committed Sep 7, 2021
1 parent d7f2ced commit 55e1655
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions Haas_Lathes_BIDC/Bechtel ST-20.cps
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ properties = {
description: "Tool loading and probing. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: false,
value: true,
scope: "post"
},
loadToolsAtStart: {
Expand Down Expand Up @@ -1363,20 +1363,22 @@ function onOpen() {
writeln("");
}

writeln("");
// will1742 | Gavin Williams | 8/10/21
// Auto probe tools
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var compensationOffset = tool.isTurningTool() ? tool.compensationOffset : tool.lengthOffset;
var toolPosition = toolFormat.format(tool.number * 100 + compensationOffset % 100);
var writeLoad = getProperty("loadToolsAtStart") ? writeBlock : writeOptionalBlock;
writeLoad("T" + toolFormat.format((tool.number - 3) >= 1 ? tool.number - 3 : tool.number + 9), mFormat.format(6));
writeLoad(mFormat.format(0));
writeComment("LOAD T" + tool.number + ": " + tool.description);
writeToolMeasureBlockBIDC(tool);
if (getProperty("loadToolsAtStart") || getProperty("measureToolsAtStart")) {
writeln("");
// will1742 | Gavin Williams | 8/10/21
// Auto probe tools
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var compensationOffset = tool.isTurningTool() ? tool.compensationOffset : tool.lengthOffset;
var toolPosition = toolFormat.format(tool.number * 100 + compensationOffset % 100);
var writeLoad = getProperty("loadToolsAtStart") ? writeBlock : writeOptionalBlock;
writeLoad("T" + toolFormat.format((tool.number - 3) >= 1 ? tool.number - 3 : tool.number + 9), mFormat.format(6));
writeLoad(mFormat.format(0));
writeComment("LOAD T" + tool.number + ": " + tool.description);
writeToolMeasureBlockBIDC(tool);
}
}
}

Expand Down

0 comments on commit 55e1655

Please sign in to comment.