-- MachiningLib.lua by Egaltech s.r.l. 2023/11/06 -- Libreria ricerca lavorazioni per Travi -- 2022/05/07 ES Profonde modifiche per scelta ottimale lavorazioni in macchine con più teste. -- 2022/07/27 Aggiunta la gestione del tipo di foratura "AngleDrill" per fori molto inclinati -- 2022/11/02 Modificata scelta utensile ottimizzata. Ora se c'è un utensile più grande disponibile si dà preferenza a quello. -- 2022/11/25 Per FindMilling implementata la possibilità di escludere la testa H3 dalla ricerca utensile. -- 2022/12/28 Per FindMilling e FindDrilling possibilità di escludere la testa H2 dalla ricerca utensile. -- 2023/01/31 Per FindPocketing implementata la possibilità di escludere le teste H2 o H3 dalla ricerca utensile. -- 2023/07/28 Aggiunta gestione del tipo di foratura "Drill_AT". -- 2023/11/06 Migliorie e correzioni alle forature con AngularTransmission ("_AT"). -- 2024/01/18 In FindSawing aggiunto il parametro opzionale dDepth. -- 2024/01/19 In FindSawing aggiunto parametro opzionale bConsiderCSimmEncumberance per considerare l'ingombro dell'asse C nel massimo materiale (default false). -- 2024/01/23 Nella GetMachinings vengono ora raccolti i parametri utensile necessari per i VerifyTool, scritti direttamente nella tabella Machining.Tool. -- Le lavorazioni possono essere ora ordinate per dimensioni utensile (Longest, Shortest, Biggest, Smallest) se passato l'apposito parametro SortingCriterion in FindMachining. Al momento implementato solo per FindSawing. -- 2024/03/01 In VerifyPocketing implementato l'ordinamento per dimensioni utensile. -- 2024/03/13 Aggiunta gestione Predrill -- Tabella per definizione modulo local MachiningLib = {} -- Include require( 'EgtBase') EgtOutLog( ' MachiningLib started', 1) -- Dati local BD = require( 'BeamData') -- librerie lavorazioni caricate con pcall perchè potrebbero non esserci local Cuttings, Millings, Pocketings, Sawings, Drillings, Probing if pcall( require, 'CutData') then Cuttings = require( 'CutData') end if pcall( require, 'MillingData') then Millings = require( 'MillingData') end if pcall( require, 'PocketingData') then Pocketings = require( 'PocketingData') end if pcall( require, 'SawingData') then Sawings = require( 'SawingData') end if pcall( require, 'DrillData') then Drillings = require( 'DrillData') end if pcall( require, 'ProbingData') then Probing = require( 'ProbingData') end -- tipo di teste macchina local ONE_HEAD = 1 -- una testa (Fast, One, Turn1T) local TWO_EQUAL_HEADS = 2 -- due teste uguali (PF, Turn) local TWO_UP_DOWN_HEADS = 3 -- due teste una sopra l'altra sotto (PF1250) local MachineHeadType = 0 -- testa correntementa attiva, e utensili correnti per ogni testa local nActiveHead = 0 local H1_TOOL = '' local H2_TOOL = '' -- testa e utensile della lavorazione restituita ma non ancora confermata local nNextMachHead = 0 local H1_NEXT_TOOL = '' local H2_NEXT_TOOL = '' -- teste con utensili fissi local vFixedHeads = {} --------------------------------------------------------------------- -- funzione che imposta il tipo di macchina corrente local function SetCurrMachineHeadType() -- se già inizializzato, esco if MachineHeadType and MachineHeadType >= 1 and MachineHeadType <= 3 then return end -- altrimenti, lo imposto if BD.DOWN_HEAD then MachineHeadType = TWO_UP_DOWN_HEADS elseif BD.TWO_EQUAL_HEADS then MachineHeadType = TWO_EQUAL_HEADS else MachineHeadType = ONE_HEAD end -- imposto eventuali teste con utensili fissi if BD.C_SIMM then vFixedHeads = { [31] = true} elseif BD.TURN then vFixedHeads = { [12] = true, [22] = true} else -- FAST vFixedHeads = { [2] = true} end end --------------------------------------------------------------------- -- setta ultimi testa e utensile utilizzati se compatibili con ottimizzazione testa local function ConfirmNextMachining() -- utensile corrente local sToolUuid = EgtGetMachiningParam( MCH_MP.TUUID) local sToolName = EgtTdbGetToolFromUUID( sToolUuid or '') EgtTdbSetCurrTool( sToolName or '') -- testa dell'utensile corrente local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local nHead = tonumber( sHead:sub( 2, #sHead)) + 0 if ( nHead < 10 and nHead >= 30) or vFixedHeads[nHead] then -- testa che non richiede ottimizzazione return elseif nHead >= 20 then nHead = 2 elseif nHead >= 10 then nHead = 1 end -- se la testa richiede ottimizzazione, confermo testa attiva nActiveHead = nHead if nActiveHead == 1 then H1_TOOL = sToolName elseif nActiveHead == 2 then H2_TOOL = sToolName end end --------------------------------------------------------------------- local function SetCurrMachiningAndTool( Machining) EgtMdbSetCurrMachining( Machining.Name) EgtTdbSetCurrTool( Machining.Tool.Name) local bActive = EgtFindToolInCurrSetup( Machining.Tool.Name) local sHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) local nHead = tonumber( sHead:sub( 2, #sHead)) local bH2 = ( nHead >= 21 and nHead <= 29) local bH3 = ( nHead >= 31 and nHead <= 39) local bFixed = ( vFixedHeads[nHead]) return bActive, Machining.Tool.Name, bH2, bFixed, bH3 end --------------------------------------------------------------------- function VerifyDrill( Machining, dDiam, dDepth, bH2) local dFreeLen = Machining.Tool.Length - Machining.Tool.ToolHolderLength - EgtMdbGetGeneralParam( MCH_GP.MAXDEPTHSAFE) if Machining.Tool.Diameter < dDiam + 10 * GEO.EPS_SMALL and Machining.Tool.Diameter > dDiam - BD.DRILL_TOL - 10 * GEO.EPS_SMALL and ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then return true, { TMaxMat = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = dFreeLen, H2 = bH2} end end --------------------------------------------------------------------- function VerifyDrillPocket( Machining, dDiam, dDepth, bH2) if Machining.Tool.Diameter < dDiam - 10 * GEO.EPS_SMALL and ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) then return true, { TMaxDepth = Machining.Tool.MaxMat, MaxToolLength = Machining.Tool.TotalLength, ToolDiam = Machining.Tool.Diameter, DiamTh = Machining.Tool.ToolHolderDiameter, FreeLen = Machining.Tool.MaxMat, H2 = bH2} end end --------------------------------------------------------------------- function VerifyMill( Machining, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bH2) if ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and ( Machining.Type ~= 'FloatingAggregate' or abs( Machining.Tool.MaxMat - dDepth) < 100 * GEO.EPS_SMALL) and ( not sTuuidMstr or sTuuidMstr == Machining.Tool.UUID) and ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and ( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then return true, { TMaxDepth = Machining.Tool.MaxMat, TDiam = Machining.Tool.Diameter, H2 = bH2} end end --------------------------------------------------------------------- function VerifyPocket( Machining, dMaxDiam, dDepth, dMaxTotLen, bH2) if ( not dMaxDiam or Machining.Tool.Diameter < dMaxDiam + GEO.EPS_SMALL) and ( not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL) and ( not dMaxTotLen or Machining.Tool.TotalLength < dMaxTotLen + GEO.EPS_SMALL) then return true, { TDiam = Machining.Tool.Diameter, TMaxDepth = Machining.Tool.MaxMat, H2 = bH2} end end --------------------------------------------------------------------- function VerifyChainSaw( Machining, dDepth, CSimmEncumberance, bH2) -- riduco il massimo materiale dell'ingombro asse C. Se non richiesto, arriverà un valore di CSimmEncumberance nullo Machining.Tool.MaxMat = min( Machining.Tool.MaxMat, Machining.Tool.TotalLength - CSimmEncumberance) if not dDepth or Machining.Tool.MaxMat > dDepth - GEO.EPS_SMALL then return true, { H2 = bH2} end end --------------------------------------------------------------------- function VerifyTool( Machining, MachiningType, Params, bH2) if MachiningType == MCH_MY.DRILLING then if Machining.SubType == 'Drill' or Machining.SubType == 'AngleDrill' or Machining.SubType == 'Predrill' then return VerifyDrill( Machining, Params.Diam, Params.Depth, bH2) elseif Machining.SubType == 'DrillPocket' then return VerifyDrillPocket( Machining, Params.Diam, Params.Depth, bH2) end elseif MachiningType == MCH_MY.SAWING then return ( not Params.Depth or Machining.Tool.MaxMat > Params.Depth - GEO.EPS_SMALL), { H2 = bH2} elseif MachiningType == MCH_MY.MILLING then return VerifyMill( Machining, Params.Depth, Params.TuuidMstr, Params.MaxDiam, Params.MaxTotLen, bH2) elseif MachiningType == MCH_MY.POCKETING then return VerifyPocket( Machining, Params.MaxDiam, Params.Depth, Params.MaxTotLen, bH2) elseif MachiningType == MCH_MY.MORTISING then return VerifyChainSaw( Machining, Params.Depth, Params.CSimmEncumberance, bH2) else return false end end --------------------------------------------------------------------- function GetMachinings( MachiningType, sType) local Machinings = {} -- leggo le lavorazioni disponibili if MachiningType == MCH_MY.DRILLING then if Drillings and type( Drillings) == "table" then Machinings = Drillings end elseif MachiningType == MCH_MY.SAWING then if Cuttings and type( Cuttings) == "table" then Machinings = Cuttings end elseif MachiningType == MCH_MY.MILLING then if Millings and type( Millings) == "table" then Machinings = Millings end elseif MachiningType == MCH_MY.POCKETING then if Pocketings and type( Pocketings) == "table" then Machinings = Pocketings end elseif MachiningType == MCH_MY.MORTISING then if Sawings and type( Sawings) == "table" then Machinings = Sawings end elseif MachiningType == MCH_MY.PROBING then if Probing and type( Probing) == "table" then Machinings = Probing end end -- scrivo i parametri utensile nella lavorazione local validMachinings = {} for i = 1, #Machinings do local Machining = Machinings[i] if EgtMdbSetCurrMachining( Machining.Name) then Machining.Tool = {} Machining.Tool.UUID = EgtMdbGetCurrMachiningParam( MCH_MP.TUUID) Machining.Tool.Name = EgtTdbGetToolFromUUID( Machining.Tool.UUID) if Machining.Tool.Name then if EgtTdbSetCurrTool( Machining.Tool.Name) then table.insert( validMachinings, Machining) -- se non è tastatura, recupero dati utensile if MachiningType ~= MCH_MY.PROBING then -- caso speciale utensile su aggregato flottante if MachiningType == MCH_MY.MILLING and sType == 'FloatingAggregate' then local sNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) Machining.Tool.MaxMat = EgtGetValInNotes( sNotes, 'TOOL_OVERHANG', 'd') or -1 elseif ( MachiningType == MCH_MY.MILLING) or ( MachiningType == MCH_MY.POCKETING) or ( MachiningType == MCH_MY.DRILLING and EgtStartsWith( sType, 'Pocket')) then Machining.Tool.MaxMat = EgtTdbGetCurrToolMaxDepth() else Machining.Tool.MaxMat = EgtTdbGetCurrToolParam( MCH_TP.MAXMAT) end if MachiningType == MCH_MY.DRILLING then if EgtStartsWith( Machining.Type, 'Drill') then Machining.SubType = 'Drill' elseif EgtStartsWith( Machining.Type, 'AngleDrill') then Machining.SubType = 'AngleDrill' elseif EgtStartsWith( Machining.Type, 'Pocket') then Machining.SubType = 'DrillPocket' elseif EgtStartsWith( Machining.Type, 'Predrill') then Machining.SubType = 'Predrill' end end Machining.Tool.Diameter = EgtTdbGetCurrToolParam( MCH_TP.DIAM) Machining.Tool.Length = EgtTdbGetCurrToolParam( MCH_TP.LEN) Machining.Tool.TotalLength = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN) Machining.Tool.ToolHolderDiameter = EgtTdbGetCurrToolThDiam() Machining.Tool.ToolHolderLength = EgtTdbGetCurrToolThLength() or 72 end end end end end -- ritorno la lista delle sole lavorazioni valide return validMachinings end --------------------------------------------------------------------- ---restituisce la lista delle lavorazioni ordinata secondo il criterio *sCriterion* ---@param Machinings table lista della lavorazioni da riordinare ---@param sCriterion string criterio di ordinamento ('Longest', 'Shortest', 'Biggest', 'Smallest') function ReorderMachinings( Machinings, sCriterion) -- funzioni di ordinamento local function SortMachiningsByLongestTool( Machining1, Machining2) if Machining1.Tool.MaxMat > Machining2.Tool.MaxMat + 10 * GEO.EPS_SMALL then return true else return false end end local function SortMachiningsByShortestTool( Machining1, Machining2) if Machining1.Tool.MaxMat < Machining2.Tool.MaxMat - 10 * GEO.EPS_SMALL then return true else return false end end local function SortMachiningsByBiggestTool( Machining1, Machining2) if Machining1.Tool.Diameter > Machining2.Tool.Diameter + 10 * GEO.EPS_SMALL then return true else return false end end local function SortMachiningsBySmallestTool( Machining1, Machining2) if Machining1.Tool.Diameter < Machining2.Tool.Diameter - 10 * GEO.EPS_SMALL then return true else return false end end -- ordinamento in base al criterio -- ordine di default, ossia quello che arriva dal database if not sCriterion then return -- prima gli utensili più lunghi elseif sCriterion == 'Longest' then table.sort( Machinings, SortMachiningsByLongestTool) -- prima gli utensili più corti elseif sCriterion == 'Shortest' then table.sort( Machinings, SortMachiningsByShortestTool) -- prima gli utensili con diametro più grande elseif sCriterion == 'Biggest' then table.sort( Machinings, SortMachiningsByBiggestTool) -- prima gli utensili con diametro più piccolo elseif sCriterion == 'Smallest' then table.sort( Machinings, SortMachiningsBySmallestTool) end end --------------------------------------------------------------------- function ReturnParams( MachiningType, MachiningName, sType, ToolParams) if MachiningType == MCH_MY.DRILLING then local _, sOrigType = EgtEndsWith( sType, '_H2') return MachiningName, sType, EgtIf( sOrigType == 'Drill' or sOrigType == 'Drill_AT' or sOrigType == 'AngleDrill' or sOrigType == 'Predrill' , ToolParams.TMaxMat, ToolParams.TMaxDepth), ToolParams.MaxToolLength, ToolParams.ToolDiam, ToolParams.DiamTh, ToolParams.FreeLen elseif MachiningType == MCH_MY.SAWING then return MachiningName, ToolParams.H2 elseif MachiningType == MCH_MY.MILLING then return MachiningName, ToolParams.TMaxDepth, ToolParams.TDiam, ToolParams.H2 elseif MachiningType == MCH_MY.POCKETING then return MachiningName, ToolParams.TDiam, ToolParams.TMaxDepth, ToolParams.H2 elseif MachiningType == MCH_MY.MORTISING then return MachiningName end end --------------------------------------------------------------------- local function FindMachining( MachiningType, sType, Params, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) local bOptimizeHeads = ( not sSortingCriterion or sSortingCriterion == '') if bTopHead == nil and bDownHead == nil then bTopHead = true bDownHead = false elseif bTopHead == nil then bTopHead = not bDownHead elseif bDownHead == nil then bDownHead = not bTopHead end if bExcludeH2 == nil then bExcludeH2 = false end if bExcludeH3 == nil then bExcludeH3 = false end SetCurrMachineHeadType() -- verifico se non richiesta testa sopra e macchina ha solo teste sopra if not bTopHead and MachineHeadType ~= TWO_UP_DOWN_HEADS and not BD.TURN then return nil end -- verifico se testa attiva va bene local sH1Mach = '' local sH1Tool = '' local sH1Param local sH2Mach = '' local sH2Tool = '' local sH2Param local Machinings = GetMachinings( MachiningType, sType) ReorderMachinings( Machinings, sSortingCriterion) local ForStart = 1 local ForEnd = #Machinings local ForStep = 1 -- le forature vanno scorse dal diametro maggiore al minore, a meno che non sia stato passato un ordinamento specifico if MachiningType == MCH_MY.DRILLING and ( not sSortingCriterion or sSortingCriterion == '') then ForStart = #Machinings ForEnd = 1 ForStep = -1 end if bOptimizeHeads or MachineHeadType == ONE_HEAD or MachineHeadType == TWO_EQUAL_HEADS or ( MachineHeadType == TWO_UP_DOWN_HEADS and not bDownHead) then _, sType = EgtEndsWith( sType, '_H2') elseif not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and not bTopHead and bDownHead then if not EgtEndsWith( sType, '_H2') then sType = sType .. '_H2' end end local MachineHeadUse = MachineHeadType if not bOptimizeHeads and MachineHeadUse == TWO_EQUAL_HEADS then MachineHeadUse = ONE_HEAD end if MachineHeadUse == TWO_UP_DOWN_HEADS and bTopHead and bDownHead then -- se posso usare entrambe le teste, la gestisco come una macchina a due teste da sopra MachineHeadUse = TWO_EQUAL_HEADS end -- variabile che definisce quando un utensile ha un diametro sostanzialmente più grande di un altro local dBiggerToolTolerance = 1.25 for i = ForStart, ForEnd, ForStep do local Machining = Machinings[i] local sMachiningType = Machining.Type if bOptimizeHeads or MachineHeadUse == TWO_EQUAL_HEADS then _, sMachiningType = EgtEndsWith( Machining.Type, '_H2') end -- recupero dati utensile local bToolActive, sToolName, bH2, bFixed, bH3 = SetCurrMachiningAndTool( Machining) if Machining.On and sMachiningType == sType and bToolActive and ( not bH2 or bH2 == not bExcludeH2) and ( not bH3 or bH3 == not bExcludeH3) then local bOk, ToolParams = VerifyTool( Machining, MachiningType, Params, bH2) if bOk then if MachineHeadUse == ONE_HEAD then return ReturnParams(MachiningType, Machining.Name, Machining.Type, ToolParams) elseif MachineHeadUse == TWO_EQUAL_HEADS then -- se nessuna testa attiva, prendo la prima lavorazione disponibile if nActiveHead == 0 then return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) -- verifico se posso usare lo stesso utensile della testa attiva elseif ( nActiveHead == 1 and not bH2 and sToolName == H1_TOOL) or ( nActiveHead == 2 and bH2 and sToolName == H2_TOOL) then -- se l'utensile sulla testa attiva è molto più piccolo rispetto a quelli salvati non lo scelgo, a meno che non siano entrambi grandi (truciolatori) if ( not sH1Param or not sH1Param.TDiam or ( sH1Param.TDiam < 75 and ToolParams.TDiam < 75 and sH1Param.TDiam < dBiggerToolTolerance * ToolParams.TDiam)) and ( not sH2Param or not sH2Param.TDiam or ( sH2Param.TDiam < 75 and ToolParams.TDiam < 75 and sH2Param.TDiam < 1.25 * ToolParams.TDiam)) then return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) end end -- segno le lavorazioni disponibili per entrambe le teste if bH2 then if not sH2Mach or sH2Mach == '' then sH2Mach = Machining.Name sH2Tool = sToolName sH2Param = ToolParams end else if not sH1Mach or sH1Mach == '' then sH1Mach = Machining.Name sH1Tool = sToolName sH1Param = ToolParams end end elseif MachineHeadUse == TWO_UP_DOWN_HEADS then if bTopHead and not bH2 then return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) elseif bDownHead and bH2 then return ReturnParams( MachiningType, Machining.Name, Machining.Type, ToolParams) end end end end end if MachineHeadUse == TWO_EQUAL_HEADS then -- se entrambi gli utensili sono piccoli (no truciolatori) e uno dei due è molto più grande dell'altro scelgo quello senza fare altre analisi if sH1Mach ~= "" and sH1Param.TDiam and sH2Mach ~= "" and sH2Param.TDiam then if sH1Param.TDiam < 75 or sH2Param.TDiam < 75 then if sH1Param.TDiam > dBiggerToolTolerance * sH2Param.TDiam then return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) elseif sH2Param.TDiam > dBiggerToolTolerance * sH1Param.TDiam then return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) end end end -- verifico se cambiare testa o cambiare utensile su quella corrente if nActiveHead == 1 then if sH2Mach ~= "" then return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen elseif sH1Mach ~= "" then return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen end elseif nActiveHead == 2 then if sH1Mach ~= "" then return ReturnParams( MachiningType, sH1Mach, sType, sH1Param) --return sH1Mach, sH1Param.Type, sH1Param.TMaxMat, sH1Param.MaxToolLength, sH1Param.ToolDiam, sH1Param.DiamTh, sH1Param.FreeLen elseif sH2Mach ~= "" then return ReturnParams( MachiningType, sH2Mach, sType, sH2Param) --return sH2Mach, sH2Param.Type, sH2Param.TMaxMat, sH2Param.MaxToolLength, sH2Param.ToolDiam, sH2Param.DiamTh, sH2Param.FreeLen end end end local bH2, sOrigType = EgtEndsWith( sType, '_H2') if not bOptimizeHeads and MachineHeadType == TWO_UP_DOWN_HEADS and bH2 and bTopHead then return FindMachining( MachiningType, sOrigType, Params, true, false) end end --------------------------------------------------------------------- function MachiningLib.FindCutting( sType, bTopHead, bDownHead, dDepth, sSortingCriterion) return FindMachining( MCH_MY.SAWING, sType, { Depth = dDepth}, bTopHead, bDownHead, nil, nil, sSortingCriterion) end --------------------------------------------------------------------- function MachiningLib.FindDrilling( dDiam, dDepth, bTopHead, bDownHead, bExcludeH2, bAngleTransmission, bIsPredrill, bExcludeH3, sSortingCriterion) local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5, sTypeMach -- se il foro è un predrill, cerco solo punte abilitate al Predrill if bIsPredrill then sTypeMach = 'Predrill' else sTypeMach = EgtIf( bAngleTransmission, 'Drill_AT', 'Drill') end MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, sTypeMach, { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) if ( not MachiningName or MachiningName == '') then MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, EgtIf( bAngleTransmission, 'Pocket_AT', 'Pocket'), { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) end if MachiningName and MachiningName ~= '' then return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 end end --------------------------------------------------------------------- function MachiningLib.FindAngleDrilling( dDiam, dDepth, bTopHead, bDownHead) local MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 = FindMachining( MCH_MY.DRILLING, 'AngleDrill', { Diam = dDiam, Depth = dDepth}, bTopHead, bDownHead) if MachiningName and MachiningName ~= '' then return MachiningName, MachiningType, Param1, Param2, Param3, Param4, Param5 end end --------------------------------------------------------------------- function MachiningLib.FindMilling( sType, dDepth, sTuuidMstr, dMaxDiam, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) return FindMachining( MCH_MY.MILLING, sType, { Depth = dDepth, TuuidMstr = sTuuidMstr, MaxDiam = dMaxDiam, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) end --------------------------------------------------------------------- function MachiningLib.FindPocketing( sType, dMaxDiam, dDepth, dMaxTotLen, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) return FindMachining( MCH_MY.POCKETING, sType, { MaxDiam = dMaxDiam, Depth = dDepth, MaxTotLen = dMaxTotLen}, bTopHead, bDownHead, bExcludeH2, bExcludeH3, sSortingCriterion) end --------------------------------------------------------------------- function MachiningLib.FindSawing( sType, dDepth, bConsiderCSimmEncumberance, sSortingCriterion) if not BD.C_SIMM_ENC then BD.C_SIMM_ENC = EgtIf( BD.C_SIMM, 180, 90) end return FindMachining( MCH_MY.MORTISING, sType, { Depth = dDepth, CSimmEncumberance = EgtIf( bConsiderCSimmEncumberance, BD.C_SIMM_ENC, 0)}, nil, nil, nil, nil, sSortingCriterion) end ------------------------------------------------------------------------------------------------------------- function MachiningLib.ApplyMachining( bRecalc, bApplyPost) local bResult = EgtApplyMachining( bRecalc, bApplyPost) if bResult then ConfirmNextMachining() end return bResult end ------------------------------------------------------------------------------------------------------------- return MachiningLib