Skip to content

Commit

Permalink
Removed Deprecated Code
Browse files Browse the repository at this point in the history
  • Loading branch information
will1742 committed Jul 6, 2021
1 parent e493c15 commit 87bb943
Showing 1 changed file with 9 additions and 47 deletions.
56 changes: 9 additions & 47 deletions Haas_Next_Generation/haas vf2.cps
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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"));
}

Expand Down

0 comments on commit 87bb943

Please sign in to comment.