From 72bcd9306acd06cf33c1ff0b5ff5a628fa2cbfbd Mon Sep 17 00:00:00 2001 From: pan261 Date: Tue, 14 Sep 2021 13:54:42 -0400 Subject: [PATCH] FIxed tool validation checking in Mills --- Haas_Mills_BIDC/Bechtel DT.cps | 4 +++- Haas_Mills_BIDC/Bechtel VF2.cps | 4 +++- Haas_Mills_BIDC/Bechtel VF4.cps | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Haas_Mills_BIDC/Bechtel DT.cps b/Haas_Mills_BIDC/Bechtel DT.cps index 2a04feb..9ddc390 100644 --- a/Haas_Mills_BIDC/Bechtel DT.cps +++ b/Haas_Mills_BIDC/Bechtel DT.cps @@ -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} @@ -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 diff --git a/Haas_Mills_BIDC/Bechtel VF2.cps b/Haas_Mills_BIDC/Bechtel VF2.cps index 108f24e..e95f503 100644 --- a/Haas_Mills_BIDC/Bechtel VF2.cps +++ b/Haas_Mills_BIDC/Bechtel VF2.cps @@ -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} @@ -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 diff --git a/Haas_Mills_BIDC/Bechtel VF4.cps b/Haas_Mills_BIDC/Bechtel VF4.cps index 882c1c2..7522560 100644 --- a/Haas_Mills_BIDC/Bechtel VF4.cps +++ b/Haas_Mills_BIDC/Bechtel VF4.cps @@ -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} @@ -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