--BasicCustomerStrategies.lua by Egalware s.r.l. 2024/04/02 -- Libreria strategie di base disponibili per i clienti -- 2024/04/02 PRIMA VERSIONE CALCOLO LAVORAZIONI CON STRATEGIE -- Tabella per definizione modulo local BasicCustomerStrategies = {} -- Include require( 'EgtBase') -- Carico i dati globali local BeamData = require( 'BeamData') local ID = require( 'Identity') ---------------------------------------------------------------------------------- -- *** EGALWARE *** ---------------------------------------------------------------------------------- local function GetStrategies_Egalware( Proc) local Strategy_Egalware = {} local Strategies_Egalware = {} -- TODO tabella da compleatare man mano che si inseriscono le varie strategie --------------------------------------------------------------------- -- Feature : Cut if true or ID.IsHeadCut( Proc) then -- TODO TOGLIERE IL true PER FORZARE IF!!! PROVVISORIO PER PROVARE STRATEGIE if Proc.Topology.Name == 'FEATURE' then Strategy_Egalware = { StrategyId = 'STR0001', Parameters = { { Value = '15', Name = 'Step', Type = 'd'}, { Value = 'false', Name = 'AntiSplint', Type = 'b'} } } table.insert( Strategies_Egalware, Strategy_Egalware) Strategy_Egalware = {} end --------------------------------------------------------------------- -- Feature : Cut elseif ID.IsSplitCut( Proc) then --------------------------------------------------------------------- -- Feature : Cut elseif ID.IsCut( Proc) then --------------------------------------------------------------------- -- Feature : Longitudinal Cut elseif ID.IsLongitudinalCut( Proc) then --------------------------------------------------------------------- -- Feature : Double Cut elseif ID.IsDoubleCut( Proc) then --------------------------------------------------------------------- -- Feature : Ridge or Valley Cut elseif ID.IsDoubleLongitudinalCut( Proc) then --------------------------------------------------------------------- -- Feature : Saw Cut elseif ID.IsSawCut( Proc) then --------------------------------------------------------------------- -- Feature : Slot elseif ID.IsSlot( Proc) then --------------------------------------------------------------------- -- Feature : Front Slot elseif ID.IsFrontSlot( Proc) then --------------------------------------------------------------------- -- Feature : Birds Mouth elseif ID.IsBirdsMouth( Proc) then --------------------------------------------------------------------- -- Feature : Hip or Valley Rafter Notch elseif ID.IsHipValleyRafterNotch( Proc) then --------------------------------------------------------------------- -- Feature : Ridge Lap elseif ID.IsRidgeLap( Proc) then --------------------------------------------------------------------- -- Feature : Lap Joint elseif ID.IsLapJoint( Proc) then --------------------------------------------------------------------- -- Feature : Notch/Rabbet elseif ID.IsNotchRabbet( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus elseif ID.IsBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Notch elseif ID.IsNotch( Proc) then --------------------------------------------------------------------- -- Feature : French Ridge Lap elseif ID.IsFrenchRidgeLap( Proc) then --------------------------------------------------------------------- -- Feature : Chamfer elseif ID.IsChamfer( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus Half Lap elseif ID.IsHalfBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus Front elseif ID.IsFrontBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Pocket elseif ID.IsPocket( Proc) then --------------------------------------------------------------------- -- Feature : Drilling elseif ID.IsDrilling( Proc) then --------------------------------------------------------------------- -- Feature : Tenon elseif ID.IsTenon( Proc) then --------------------------------------------------------------------- -- Feature : Mortise elseif ID.IsMortise( Proc) then --------------------------------------------------------------------- -- Feature : Front Mortise elseif ID.IsFrontMortise( Proc) then --------------------------------------------------------------------- -- Feature : House elseif ID.IsHouse( Proc) then --------------------------------------------------------------------- -- Feature : House Mortise elseif ID.IsHouseMortise( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Tenon elseif ID.IsDovetailTenon( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Mortise elseif ID.IsDovetailMortise( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Mortise Front elseif ID.IsFrontDovetailMortise( Proc) then --------------------------------------------------------------------- -- Feature : Marking elseif ID.IsMarking( Proc) then --------------------------------------------------------------------- -- Feature : Text elseif ID.IsText( Proc) then --------------------------------------------------------------------- -- Feature : Scarf Simple elseif ID.IsScarfSimple( Proc) then --------------------------------------------------------------------- -- Feature : Scarf Joint elseif ID.IsScarfJoint( Proc) then --------------------------------------------------------------------- -- Feature : Step Joint elseif ID.IsStepJoint( Proc) then --------------------------------------------------------------------- -- Feature : Step Joint Notch elseif ID.IsStepJointNotch( Proc) then --------------------------------------------------------------------- -- Feature : Planing elseif ID.IsPlaning( Proc) then --------------------------------------------------------------------- -- Feature : Front Profile elseif ID.IsFrontProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Concave Profile elseif ID.IsHeadConcaveProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Convex Profile elseif ID.IsHeadConvexProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Cambered Profile elseif ID.IsHeadCamberedProfile( Proc) then --------------------------------------------------------------------- -- Feature : Round Arch elseif ID.IsRoundArch( Proc) then --------------------------------------------------------------------- -- Feature : Head Profile elseif ID.IsHeadProfile( Proc) then --------------------------------------------------------------------- -- Feature : Sphere elseif ID.IsSphere( Proc) then --------------------------------------------------------------------- -- Feature : Triangle Cut elseif ID.IsTriangleCut( Proc) then --------------------------------------------------------------------- -- Feature : TyroleanDovetail elseif ID.IsTyroleanDovetail( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail elseif ID.IsDovetail( Proc) then --------------------------------------------------------------------- -- Feature : Free Contour elseif ID.IsFreeContour( Proc) then --------------------------------------------------------------------- -- Feature : Outline elseif ID.IsOutline( Proc) then --------------------------------------------------------------------- -- Feature : Aperture elseif ID.IsAperture( Proc) then --------------------------------------------------------------------- -- Feature : Variant elseif ID.IsVariant( Proc) then --------------------------------------------------------------------- end return Strategies_Egalware end ---------------------------------------------------------------------------------- -- *** ESSETRE *** ---------------------------------------------------------------------------------- local function GetStrategies_Essetre( Proc) local Strategy_Essetre = {} local Strategies_Essetre = {} -- TODO tabella da compleatare man mano che si inseriscono le varie strategie --------------------------------------------------------------------- -- Feature : Cut if true or ID.IsHeadCut( Proc) then -- TODO TOGLIERE IL true PER FORZARE IF!!! PROVVISORIO PER PROVARE STRATEGIE if Proc.Topology.Name == 'FEATURE' then Strategy_Essetre = { StrategyId = 'STR0001', Parameters = { { Value = '15', Name = 'Step', Type = 'd'}, { Value = 'false', Name = 'AntiSplint', Type = 'b'} } } table.insert( Strategies_Essetre, Strategy_Essetre) Strategy_Essetre = {} end --------------------------------------------------------------------- -- Feature : Cut elseif ID.IsSplitCut( Proc) then --------------------------------------------------------------------- -- Feature : Cut elseif ID.IsCut( Proc) then --------------------------------------------------------------------- -- Feature : Longitudinal Cut elseif ID.IsLongitudinalCut( Proc) then --------------------------------------------------------------------- -- Feature : Double Cut elseif ID.IsDoubleCut( Proc) then --------------------------------------------------------------------- -- Feature : Ridge or Valley Cut elseif ID.IsDoubleLongitudinalCut( Proc) then --------------------------------------------------------------------- -- Feature : Saw Cut elseif ID.IsSawCut( Proc) then --------------------------------------------------------------------- -- Feature : Slot elseif ID.IsSlot( Proc) then --------------------------------------------------------------------- -- Feature : Front Slot elseif ID.IsFrontSlot( Proc) then --------------------------------------------------------------------- -- Feature : Birds Mouth elseif ID.IsBirdsMouth( Proc) then --------------------------------------------------------------------- -- Feature : Hip or Valley Rafter Notch elseif ID.IsHipValleyRafterNotch( Proc) then --------------------------------------------------------------------- -- Feature : Ridge Lap elseif ID.IsRidgeLap( Proc) then --------------------------------------------------------------------- -- Feature : Lap Joint elseif ID.IsLapJoint( Proc) then --------------------------------------------------------------------- -- Feature : Notch/Rabbet elseif ID.IsNotchRabbet( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus elseif ID.IsBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Notch elseif ID.IsNotch( Proc) then --------------------------------------------------------------------- -- Feature : French Ridge Lap elseif ID.IsFrenchRidgeLap( Proc) then --------------------------------------------------------------------- -- Feature : Chamfer elseif ID.IsChamfer( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus Half Lap elseif ID.IsHalfBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Block Haus Front elseif ID.IsFrontBlockHaus( Proc) then --------------------------------------------------------------------- -- Feature : Pocket elseif ID.IsPocket( Proc) then --------------------------------------------------------------------- -- Feature : Drilling elseif ID.IsDrilling( Proc) then --------------------------------------------------------------------- -- Feature : Tenon elseif ID.IsTenon( Proc) then --------------------------------------------------------------------- -- Feature : Mortise elseif ID.IsMortise( Proc) then --------------------------------------------------------------------- -- Feature : Front Mortise elseif ID.IsFrontMortise( Proc) then --------------------------------------------------------------------- -- Feature : House elseif ID.IsHouse( Proc) then --------------------------------------------------------------------- -- Feature : House Mortise elseif ID.IsHouseMortise( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Tenon elseif ID.IsDovetailTenon( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Mortise elseif ID.IsDovetailMortise( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail Mortise Front elseif ID.IsFrontDovetailMortise( Proc) then --------------------------------------------------------------------- -- Feature : Marking elseif ID.IsMarking( Proc) then --------------------------------------------------------------------- -- Feature : Text elseif ID.IsText( Proc) then --------------------------------------------------------------------- -- Feature : Scarf Simple elseif ID.IsScarfSimple( Proc) then --------------------------------------------------------------------- -- Feature : Scarf Joint elseif ID.IsScarfJoint( Proc) then --------------------------------------------------------------------- -- Feature : Step Joint elseif ID.IsStepJoint( Proc) then --------------------------------------------------------------------- -- Feature : Step Joint Notch elseif ID.IsStepJointNotch( Proc) then --------------------------------------------------------------------- -- Feature : Planing elseif ID.IsPlaning( Proc) then --------------------------------------------------------------------- -- Feature : Front Profile elseif ID.IsFrontProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Concave Profile elseif ID.IsHeadConcaveProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Convex Profile elseif ID.IsHeadConvexProfile( Proc) then --------------------------------------------------------------------- -- Feature : Head Cambered Profile elseif ID.IsHeadCamberedProfile( Proc) then --------------------------------------------------------------------- -- Feature : Round Arch elseif ID.IsRoundArch( Proc) then --------------------------------------------------------------------- -- Feature : Head Profile elseif ID.IsHeadProfile( Proc) then --------------------------------------------------------------------- -- Feature : Sphere elseif ID.IsSphere( Proc) then --------------------------------------------------------------------- -- Feature : Triangle Cut elseif ID.IsTriangleCut( Proc) then --------------------------------------------------------------------- -- Feature : TyroleanDovetail elseif ID.IsTyroleanDovetail( Proc) then --------------------------------------------------------------------- -- Feature : Dovetail elseif ID.IsDovetail( Proc) then --------------------------------------------------------------------- -- Feature : Free Contour elseif ID.IsFreeContour( Proc) then --------------------------------------------------------------------- -- Feature : Outline elseif ID.IsOutline( Proc) then --------------------------------------------------------------------- -- Feature : Aperture elseif ID.IsAperture( Proc) then --------------------------------------------------------------------- -- Feature : Variant elseif ID.IsVariant( Proc) then --------------------------------------------------------------------- end return Strategies_Essetre end ---------------------------------------------------------------------------------- -- *** Esecuzione *** ---------------------------------------------------------------------------------- -- script delle strategie di base standard definito con cliente (statico e non modificabile) -- se non esiste JSON configurazione, o se non ha trovato nessuna strategia, prova a cercare in questi script function BasicCustomerStrategies.GetStrategiesFromBasicCustomerStrategies( Proc) local StrategiesFromScript = {} -- se nessuno script specifico in BeamData, si carica standard di default EGALWARE if not BeamData.STRATEGIES_SCRIPT or BeamData.STRATEGIES_SCRIPT == 'Egalware' then StrategiesFromScript = GetStrategies_Egalware( Proc) -- CLIENTE : ESSETRE elseif BeamData.STRATEGIES_SCRIPT == 'Essetre' then StrategiesFromScript = GetStrategies_Essetre( Proc) else StrategiesFromScript = nil end return StrategiesFromScript end ------------------------------------------------------------------------------------------------------------- return BasicCustomerStrategies