Skip to content

Commit

Permalink
Updated ST-20Y
Browse files Browse the repository at this point in the history
Fixed ST-20Y bug, same issue as ST-20 (when both load and measure tool properties are false, no blocks would print)
  • Loading branch information
pan261 authored and will1742 committed Sep 7, 2021
1 parent f09c2ec commit cf16a32
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions Haas_Lathes_BIDC/Bechtel ST-20Y.cps
Original file line number Diff line number Diff line change
Expand Up @@ -356,15 +356,15 @@ properties = {
description: "Tool loading and probing. By turning this off, you accept responsibility for any resulting crashes.",
group: 99,
type: "boolean",
value: true,
value: false,
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: true,
value: false,
scope: "post"
}
};
Expand Down Expand Up @@ -1440,25 +1440,25 @@ function onOpen() {
writeln("");
}

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);
}

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 (false) {
// check for duplicate tool number
for (var i = 0; i < getNumberOfSections(); ++i) {
Expand Down

0 comments on commit cf16a32

Please sign in to comment.