Skip to content

Commit

Permalink
Tool probing and loading options added
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Aug 23, 2021
1 parent fbbbd65 commit c09320d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Haas_Lathes_BIDC/Bechtel ST-20.cps
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,22 @@ properties = {
type: "boolean",
value: false,
scope: "post"
},
measureToolsAtStart: {
title: "Tool Probing",
description: "Tool loading and probing. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
scope: "post"
},
loadToolsAtStart: {
title: "Tool loading",
description: "Tool loading only. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: false,
scope: "post"
}
};

Expand Down Expand Up @@ -1344,14 +1360,18 @@ function onOpen() {
// will1742 | Gavin Williams | 8/10/21
// Auto probe tools
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
if (tools.getNumberOfTools() > 0 && (getProperty("measureToolsAtStart") || getProperty("loadToolsAtStart"))) {
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);
writeBlock("T" + toolFormat.format((tool.number - 3) >= 1 ? tool.number - 3 : tool.number + 9), mFormat.format(6));
writeBlock(mFormat.format(0));
writeComment("LOAD T" + tool.number + ": " + tool.description);
if (!getProperty("measureToolsAtStart")) {
writeln("");
continue;
}
writeToolMeasureBlockBIDC(tool);
}
}
Expand Down

0 comments on commit c09320d

Please sign in to comment.