Skip to content

Commit

Permalink
FIxed tool validation checking in Mills
Browse files Browse the repository at this point in the history
  • Loading branch information
pan261 committed Sep 14, 2021
1 parent 3ce1950 commit 72bcd93
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Haas_Mills_BIDC/Bechtel DT.cps
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ staticProperties = {
const X_TRAVEL_LIMIT = -20;
const Y_TRAVEL_LIMIT = -16;

const MAX_TOOL_NUM = 20;

var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines
// samples:
// {id: COOLANT_THROUGH_TOOL, on: 88, off: 89}
Expand Down Expand Up @@ -1367,7 +1369,7 @@ function onOpen() {
// also maybe anonymous
// TODO: tool.getNumberOfTools needs to be machine-specific constant
function invalidToolNum(toolNum) {
return (toolNum < 1 || toolNum > tools.getNumberOfTools() || tools.getTool(toolNum) == undefined);
return (toolNum < 1 || toolNum > MAX_TOOL_NUM);
}

// parse string for specific tools to load
Expand Down
4 changes: 3 additions & 1 deletion Haas_Mills_BIDC/Bechtel VF2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ staticProperties = {
const X_TRAVEL_LIMIT = -30;
const Y_TRAVEL_LIMIT = -15;

const MAX_TOOL_NUM = 20;

var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines
// samples:
// {id: COOLANT_THROUGH_TOOL, on: 88, off: 89}
Expand Down Expand Up @@ -1367,7 +1369,7 @@ function onOpen() {
// also maybe anonymous
// TODO: tool.getNumberOfTools needs to be machine-specific constant
function invalidToolNum(toolNum) {
return (toolNum < 1 || toolNum > tools.getNumberOfTools() || tools.getTool(toolNum) == undefined);
return (toolNum < 1 || toolNum > MAX_TOOL_NUM);
}

// parse string for specific tools to load
Expand Down
3 changes: 2 additions & 1 deletion Haas_Mills_BIDC/Bechtel VF4.cps
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ staticProperties = {
const X_TRAVEL_LIMIT = -50;
const Y_TRAVEL_LIMIT = -20;

const MAX_TOOL_NUM = 20;
var singleLineCoolant = false; // specifies to output multiple coolant codes in one line rather than in separate lines
// samples:
// {id: COOLANT_THROUGH_TOOL, on: 88, off: 89}
Expand Down Expand Up @@ -1367,7 +1368,7 @@ function onOpen() {
// also maybe anonymous
// TODO: tool.getNumberOfTools needs to be machine-specific constant
function invalidToolNum(toolNum) {
return (toolNum < 1 || toolNum > tools.getNumberOfTools() || tools.getTool(toolNum) == undefined);
return (toolNum < 1 || toolNum > MAX_TOOL_NUM);
}

// parse string for specific tools to load
Expand Down

0 comments on commit 72bcd93

Please sign in to comment.