From 87bb94383e4c190e68bbe37c97865e4ae269ad0c Mon Sep 17 00:00:00 2001 From: will1742 Date: Tue, 6 Jul 2021 16:52:18 -0400 Subject: [PATCH] Removed Deprecated Code --- Haas_Next_Generation/haas vf2.cps | 56 +++++-------------------------- 1 file changed, 9 insertions(+), 47 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 6bf4ca8..b478f7e 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -652,7 +652,6 @@ function writeComment(text) { Returns the matching HAAS tool type for the tool. */ -// TODO FIX TOOL TYPE function getHaasToolType(toolType) { switch (toolType) { case TOOL_DRILL: @@ -689,45 +688,6 @@ function getHaasToolType(toolType) { } } -// 06/24/21 | Gavin Williams | will1742 -// 002 Improved Probing -// Added case for shell mills -// Added improved 9023 compatibility -/* -function getHaasProbingType(tool, use9023) { - var probeType; - switch (getHaasToolType(tool.type)) { - case 3: - probeType = ((tool.taperAngle > 0) ? 1 : 3); - break; - case 4: - probeType = 1; // rotate - break; - case 1: - case 2: - case 5: - case 6: - case 7: - probeType = 2; // non rotate - break; - case 0: - probeType = 3; // rotate length and dia - break; - default: - error(localize("Invalid HAAS tool type.")); - return -1; - } - - if (use9023) { - if (probeType == 2 || probeType == 3){ - return probeType + 10; - } - return 23; - } - - return probeType; -};*/ - function getHaasProbingType(toolType, use9023) { switch (getHaasToolType(toolType.type)) { case 3: @@ -2190,18 +2150,24 @@ function setAbsoluteMode(xyz, abc) { } function onSection() { + // 07/06/21 | Gavin Williams | will1742 + // 002 Improved Probing + // uses pencil to verify WCS, prompts user if (isFirstSection() && staticProperties.pencilWCSVerif) { var stockMidX = (stockUpperX + stockLowerX)/2; var stockMidY = (stockUpperY + stockLowerY)/2; writeln(""); writeComment("Verify WCS"); writeBlock("T" + toolFormat.format(19), mFormat.format(6)); //Changes Tool + writeBlock(gFormat.format(0), xOutput.format(stockMidX), yOutput.format(stockMidY)); displayMedia("Net Share/Media/xyWCSCheck.png"); writeBlock(mFormat.format(0), formatComment("Open door")); displayMedia("Net Share/Media/arrowDown.png"); var gotoRef = takeInput("Is the graphite probing device in the middle of the stock?", ['Y']); writeWords("N" + nFormat.format(gotoRef['Y']), mFormat.format(131), formatComment("End Multimedia")); + + // TODO fix work offset for pencil on Z approach writeBlock(gFormat.format(55), gFormat.format(43), hFormat.format(19), zOutput.format(stockTopZ)); displayMedia("Net Share/Media/zWCSCheck.png"); writeBlock(mFormat.format(0), formatComment("Open door")); @@ -2307,11 +2273,6 @@ function onSection() { writeRetract(Z); } } - - // 6/18/21 | Gavin Williams | will1742 - // Terminate any media that may have been active at beginning of section - // Issue 001: Input and validation - writeBlock(mFormat.format(131), formatComment("End multimedia")); if (insertToolCall || operationNeedsSafeStart) { @@ -2676,7 +2637,7 @@ function takeInput(prompt, options) { if (macroNumber > 549) macroNumber = 500; // init macro var to 0 - writeWords("#" + macroNumber + "=0", formatComment("Initialize macro variable")); + setMacro(macroNumber, 0, "Initialize macro variable"); // disply prompt and save response writeBlock(mFormat.format(109), "P" + nFormat.format(macroNumber), formatComment(prompt)); @@ -2712,13 +2673,14 @@ function takeInput(prompt, options) { // Added 06/15/21 | Gavin Williamas | will1742 // Issue 001 Input and validation -// Halts program until TA arrives. Returns to beginning of onSection +// Halts program until TA arrives. Jumps to gotoRef function getTA(file, seqNum, gotoRef) { writeWords("N" + nFormat.format(seqNum), gFormat.format(53), gFormat.format(0), zOutput.format(0.), formatComment("Retract spindle")); writeWords(mFormat.format(130), formatComment(file)); writeWords(mFormat.format(0), formatComment("Halt Program")); + writeWords(mFormat.format(131)); writeWords("GOTO" + nFormat.format(gotoRef), formatComment("Return to beginning of operation")); }