From cd03fee84032071d09aba74970653bb42aa9b2ca Mon Sep 17 00:00:00 2001 From: will1742 Date: Mon, 28 Jun 2021 10:24:38 -0400 Subject: [PATCH] Added cases for K Factor --- Haas_Next_Generation/haas vf2.cps | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Haas_Next_Generation/haas vf2.cps b/Haas_Next_Generation/haas vf2.cps index 097d4bf..d2eadbd 100644 --- a/Haas_Next_Generation/haas vf2.cps +++ b/Haas_Next_Generation/haas vf2.cps @@ -809,7 +809,7 @@ function getHaasProbingTypeBIDC(tool, use9023) { if (tool.type == TOOL_MILLING_FORM) { return formatCNumber(NO_PROBING, use9023); } - formatCNumber(LEN_NON_ROT, use9023); + return formatCNumber(LEN_NON_ROT, use9023); case HAAS_END_MILL: return formatCNumber((tool.type == TOOL_MILLING_TAPERED ? LEN_ROT : LEN_DIA_ROT), use9023); case HAAS_BALL_NOSE: @@ -828,19 +828,24 @@ function getHaasKFactorBIDC(tool) { switch (getHaasToolTypeBIDC(tool.type)) { case HAAS_SHELL: case HAAS_END_MILL: - // TODO: Add cases - return DEFAULT_HAAS_K_FACTOR; + if (tool.type == TOOL_BORING_BAR || tool.type == TOOL_MILLING_END_FLAT) { + return DEFAULT_HAAS_K_FACTOR; + } + if (tool.type == TOOL_MILLING_FACE && tool.taperAngle != 0) { + return NULL_HAAS_K_FACTOR; + } + return DEFAULT_HAAS_K_FACTOR + tool.cornerRadius; case HAAS_BALL_NOSE: if (tool.type == TOOL_MILLING_RADIUS) { return NULL_HAAS_K_FACTOR; } - return tool.diameter + DEFAULT_HAAS_K_FACTOR; + return DEFAULT_HAAS_K_FACTOR + tool.diameter; case HAAS_CENTER: case HAAS_PROBE: case HAAS_DRILL: case HAAS_TAP: if (tool.type == TOOL_MILLING_THREAD) { - return tool.getThreadPitch() + DEFAULT_HAAS_K_FACTOR; + return DEFAULT_HAAS_K_FACTOR + tool.getThreadPitch(); } return NULL_HAAS_K_FACTOR; default: