diff --git a/LuaLibs/BasicCustomerStrategies.lua b/LuaLibs/BasicCustomerStrategies.lua index cd754ca..3651fcf 100644 --- a/LuaLibs/BasicCustomerStrategies.lua +++ b/LuaLibs/BasicCustomerStrategies.lua @@ -9,28 +9,9 @@ local BasicCustomerStrategies = {} require( 'EgtBase') -- Carico i dati globali -local BD = require( 'BeamData') +local BeamData = require( 'BeamData') local ID = require( 'Identity') ----------------------------------------------------------------------------------- --- *** Esecuzione *** ----------------------------------------------------------------------------------- - --- si legge lo script delle strategie di base definito con cliente (statico e non modificabile) -function BasicCustomerStrategies.GetStrategiesFromBasicCustomerStrategies( Proc) - local StrategiesFromScript = {} - - -- se non esiste JSON e nessuan info in BeamData, si carica standard di default EGALWARE - if not STRATEGIES and not BD.STRATEGIES_SCRIPT then - StrategiesFromScript = GetStrategies_Egalware( Proc) - -- CLIENTE : ESSETRE - elseif BD.STRATEGIES_SCRIPT == 'Essetre' then - StrategiesFromScript = GetStrategies_Essetre( Proc) - else - StrategiesFromScript = nil - end - return StrategiesFromScript -end ---------------------------------------------------------------------------------- -- *** EGALWARE *** @@ -38,8 +19,164 @@ end 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 ID.IsHeadCut( Proc) then + --------------------------------------------------------------------- + -- 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 @@ -51,9 +188,215 @@ local function GetStrategies_Essetre( Proc) local Strategies_Essetre = {} -- TODO tabella da compleatare man mano che si inseriscono le varie strategie + + --------------------------------------------------------------------- + -- Feature : Cut + if ID.IsHeadCut( Proc) then + --------------------------------------------------------------------- + -- Feature : Cut + elseif ID.IsSplitCut( Proc) then + if Proc.Topology.Name == 'FEATURE' then + Strategy_Essetre = { + StrategyID = 'STR0010', + Parameters = { + { + { Value = '15', Name = 'Step', Type = 'd'}, + { Value = '2', Name = 'Depth', Type = 'd'}, + { Value = 'false', Name = 'AntiSplint', Type = 'b'} + } + } + } + table.insert( Strategies_Essetre, Strategy_Essetre) + Strategy_Essetre = {} + end + --------------------------------------------------------------------- + -- Feature : Cut + elseif ID.IsCut( Proc) then + if Proc.Topology.Name == 'FEATURE' then + Strategy_Essetre = { + StrategyID = 'STR0001', + Parameters = { + { + { Value = '15', Name = 'Step', Type = 'd'}, + { Value = '2', Name = 'Depth', Type = 'd'}, + { Value = 'false', Name = 'AntiSplint', Type = 'b'} + } + } + } + table.insert( Strategies_Essetre, Strategy_Essetre) + Strategy_Essetre = {} + end + --------------------------------------------------------------------- + -- 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 \ No newline at end of file diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index c5274dd..f01e37f 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -9,7 +9,7 @@ local BeamExec = {} require( 'EgtBase') -- Carico i dati globali -local BD = require( 'BeamData') +local BeamData = require( 'BeamData') -- carico librerie local BeamLib = require( 'BeamLib') @@ -20,7 +20,7 @@ local FaceData = require( 'FaceData') EgtOutLog( ' BeamExec started', 1) -EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BD.COLL_SIC) +EgtMdbSetGeneralParam( MCH_GP.MAXDEPTHSAFE, BeamData.COLL_SIC) EgtMdbSave() ------------------------------------------------------------------------------------------------------------- @@ -97,6 +97,8 @@ function BeamExec.GetToolsFromDB() -- se verifica condizioni minime, recupero tutti gli altri dati if bToolLoadedOnSetup and sToolType then + -- TODO Tool.AName -> da rimuovere perchè non serve. Per il momento lo manteniamo solo perchè è più facile vedere e interpretare la lista utensili nella watch di zerobrane + -- Nell'utilizzo, si legge sempre il Tool.Name Tool.AName = Tool.Name Tool.TcPos = sToolTCPos Tool.Family = sToolFamily @@ -112,6 +114,7 @@ function BeamExec.GetToolsFromDB() Tool.Feeds.StartFeed = EgtTdbGetCurrToolParam( MCH_TP.STARTFEED) Tool.Feeds.EndFeed = EgtTdbGetCurrToolParam( MCH_TP.ENDFEED) Tool.Feeds.TipFeed = EgtTdbGetCurrToolParam( MCH_TP.TIPFEED) + -- TODO serve funzione in BeamData che data la posizione dell'utensile e della testa, capisca il montaggio (testa sopra - testa sotto - aggregato - ecc...) Tool.Head = EgtTdbGetCurrToolParam( MCH_TP.HEAD) Tool.UUID = EgtTdbGetCurrToolParam( MCH_TP.UUID) Tool.UserNotes = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) @@ -182,7 +185,6 @@ local function ImportFileJSON( sFileToImport) end local content = readAll( sFileToImport) - return JSON:decode( content) end @@ -190,9 +192,13 @@ end function BeamExec.GetStrategiesFromJSONinBD() -- si legge il JSON contenente la configurazione da utilizzare (nome del file salvato nel BeamData) local sMachDir = EgtGetCurrMachineDir() - if BD.STRATEGIES_CONFIG_FILE then - local sFile = sMachDir .. '\\Beam\\' .. BD.STRATEGIES_CONFIG_FILE - if not sFile then return end + if BeamData.STRATEGIES_CONFIG_FILE then + local sFile = sMachDir .. '\\Beam\\' .. BeamData.STRATEGIES_CONFIG_FILE + -- se non esiste file JSON, annullo la lista contenente le strategie + if not EgtExistsFile( sFile) then + STRATEGIES = nil + return + end local FeaturesList = {} FeaturesList = ImportFileJSON( sFile) @@ -209,8 +215,8 @@ end function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, bMachGroupOk) -- default per nuove costanti qualora non definite - BD.OVM_BLADE_HBEAM = ( BD.OVM_BLADE_HBEAM or 11) - BD.OVM_CHAIN_HBEAM = ( BD.OVM_CHAIN_HBEAM or 8) + BeamData.OVM_BLADE_HBEAM = ( BeamData.OVM_BLADE_HBEAM or 11) + BeamData.OVM_CHAIN_HBEAM = ( BeamData.OVM_CHAIN_HBEAM or 8) -- sovramateriale intermedio nullo se non definito dOvmMid = ( dOvmMid or 0) @@ -243,9 +249,9 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b -- Area tavola local b3Tab = EgtGetTableArea() -- Calcolo posizione estremo TR/BR della tavola rispetto a sua origine in BL - local dPosY = EgtIf( BD.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BD.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BD.RIGHT_LOAD, 0, b3Tab:getDimY())) - BD.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0) - BD.PosXR = EgtIf( BD.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) + local dPosY = EgtIf( BeamData.CENTER_BEAM, ( b3Tab:getDimY() + dRawW * EgtIf( BeamData.RIGHT_LOAD, -1, 1)) / 2, EgtIf( BeamData.RIGHT_LOAD, 0, b3Tab:getDimY())) + BeamData.OriXR = Point3d( b3Tab:getDimX(), dPosY, 0) + BeamData.PosXR = EgtIf( BeamData.RIGHT_LOAD, MCH_CR.BR, MCH_CR.TR) -- Impostazione dell'attrezzaggio di default EgtImportSetup() @@ -256,7 +262,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b local nPrevRaw, dPrevDelta local DeltaS = dOvmHead local DeltaSMin = 0 - local DeltaE = BD.OVM_MID + local DeltaE = BeamData.OVM_MID for i = 1, #vBeam do -- assegno identificativo pezzo local Pz = vBeam[i].Id @@ -285,8 +291,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b local CrawLen = min( PartLen + DeltaS + DeltaE, Len) local Delta = CrawLen - PartLen - DeltaS -- creo e posiziono il grezzo - local nRaw = EgtAddRawPart( Point3d(0,0,0), CrawLen, dRawW, dRawH, BD.RAWCOL) - EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR) + local nRaw = EgtAddRawPart( Point3d(0,0,0), CrawLen, dRawW, dRawH, BeamData.RAWCOL) + EgtMoveToCornerRawPart( nRaw, BeamData.OriXR, BeamData.PosXR) EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0)) -- assegno ordine in lavorazione Cnt = Cnt + 1 @@ -333,7 +339,7 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b return false, sOut end -- se rimasto troppo poco grezzo, esco - --if Len < BD.MinRaw then break end + --if Len < BeamData.MinRaw then break end DeltaS = 0 end if nPrevRaw then @@ -342,8 +348,8 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam, b -- Se rimasto materiale aggiungo grezzo dell'avanzo if Len > 10 then - local nRaw = EgtAddRawPart( Point3d(0,0,0), Len, dRawW, dRawH, BD.RAWCOL) - EgtMoveToCornerRawPart( nRaw, BD.OriXR, BD.PosXR) + local nRaw = EgtAddRawPart( Point3d(0,0,0), Len, dRawW, dRawH, BeamData.RAWCOL) + EgtMoveToCornerRawPart( nRaw, BeamData.OriXR, BeamData.PosXR) EgtMoveRawPart( nRaw, Vector3d( Len - dRawL, 0, 0)) -- assegno ordine in lavorazione Cnt = Cnt + 1 @@ -355,19 +361,19 @@ end ------------------------------------------------------------------------------------------------------------- function BeamExec.CalcMinUnloadableRaw( dRawW, dRawH) - if BD.GetMinUnloadableRaw then - BD.MinRaw = BD.GetMinUnloadableRaw( dRawW, dRawH) + if BeamData.GetMinUnloadableRaw then + BeamData.MinRaw = BeamData.GetMinUnloadableRaw( dRawW, dRawH) else local H_S = 200 local H_L = 400 -- Determinazione minimo grezzo scaricabile if dRawH <= H_S then - BD.MinRaw = BD.MINRAW_S + BeamData.MinRaw = BeamData.MINRAW_S elseif dRawH <= H_L then local Coeff = ( dRawH - H_S) / ( H_L - H_S) - BD.MinRaw = ( 1 - Coeff) * BD.MINRAW_S + Coeff * BD.MINRAW_L + BeamData.MinRaw = ( 1 - Coeff) * BeamData.MINRAW_S + Coeff * BeamData.MINRAW_L else - BD.MinRaw = BD.MINRAW_L + BeamData.MinRaw = BeamData.MINRAW_L end end end @@ -384,7 +390,7 @@ local function GetStrategiesFromGlobalList( Proc) -- cerco tra le topologie for j = 1, #STRATEGIES.Features[i].Topologies do -- se trovo la topologia - if Proc.Topology.Name == #STRATEGIES.Features[i].Topologies[j].Name then + if Proc.Topology.Name == STRATEGIES.Features[i].Topologies[j].Name then -- ritorno le strategie disponibili per la feature che sto analizzando return STRATEGIES.Features[i].Topologies[j].Strategies end @@ -396,71 +402,46 @@ end ------------------------------------------------------------------------------------------------------------- local function GetStrategies( Proc) - local AvailableStrategiesForProc = {} + local AvailableStrategiesForProc = nil -- se la lista STRATEGIES è stata letta da JSON (quindi non è vuota), ritorno le strategie possibili - if STRATEGIES then + if STRATEGIES and #STRATEGIES.Features > 0 then AvailableStrategiesForProc = GetStrategiesFromGlobalList( Proc) - -- altrimenti lancio script che setta le strategie in modo statico, come definito con cliente - else + end + -- se non ho trovato strategie disponibili nel JSON, o se JSON non presente, lancio script che setta le strategie in modo statico, come definito con cliente + if not AvailableStrategiesForProc then AvailableStrategiesForProc = BCS.GetStrategiesFromBasicCustomerStrategies( Proc) end - -- TODO se ci sono strategie, posso caricare qui le varie librerie delle strategie + -- TODO se ci sono strategie, posso caricare qui le varie librerie delle strategie. Oppure farlo quando si lanciano return AvailableStrategiesForProc end ------------------------------------------------------------------------------------------------------------- local function GetFeatureForcedStrategy( Proc) - local ForcedStrategiesForProc = {} - local ForcedStrategyForProc = {} - local ForcedParametersForProc = {} - local ForcedParameter = {} + -- cerco nelle note se è stata forzata una strategia specifica local sStrategyID = EgtGetInfo( Proc.Id, 'STRATEGY', 's') + -- se è presente la strategia forzata if sStrategyID then - -- importo JSON della strategia per leggere nomi parametri configurabili - local sJSONFile = BEAM.BASEDIR .. '\\Strategies\\' .. sStrategyID .. '\\' .. sStrategyID .. '.lua' - -- se non trovo file esco - if not sJSONFile then return end + local StrategyData = require( sStrategyID .. '\\' .. sStrategyID .. 'Config.lua') + -- se ID strategia letto in NGE è differente da quello letto nella strategia, esco subito + if StrategyData.StrategyID ~= sStrategyID then return nil end - local JSONStrategy = {} - JSONStrategy = ImportFileJSON( sJSONFile) - - -- cerco tra le feature del JSON strategia - for i = 1, #JSONStrategy.Features do - -- se trovo la feature - if Proc.Prc == JSONStrategy.Features[i].Prc and Proc.Grp == JSONStrategy.Features[i].Grp then - -- cerco tra le topologie - for j = 1, #JSONStrategy.Features[i].Topologies do - -- se trovo la topologia - if Proc.Topology.Name == JSONStrategy.Features[i].Topologies[j].Name then - -- leggo i parametri - for k = 1, #JSONStrategy.Features[i].Topologies[j].Parameters do - local sParameterNameToSearch = sStrategyID .. '_' .. JSONStrategy.Features[i].Topologies[j].Parameters[k].Name - -- leggo i parametri configurabili della strategia sulla Proc - local xValue = EgtGetInfo( Proc.Id, sParameterNameToSearch, JSONStrategy.Features[i].Topologies[j].Parameters[k].Type) - -- salvo in lista il parametro letto se presente, altrimenti prendo quello nel JSON di default. Teoricamernte dovrebbero esserci sempre tutti - if xValue then - ForcedParameter.Value = xValue - else - ForcedParameter.Value = JSONStrategy.Features[i].Topologies[j].Parameters[k].Name - end - ForcedParameter.Name = JSONStrategy.Features[i].Topologies[j].Parameters[k].Name - table.insert( ForcedStrategyForProc, ForcedParameter) - end - end - end + -- cerco e aggiorno i parametri come sono settati nel processing + for i = 1, #StrategyData do + local sParameterToRead = StrategyData.StrategyID .. '_' .. StrategyData.Parameters[i].Name + ForcedParameterForProc = EgtGetInfo( Proc.Id, sParameterToRead, 's') + -- se ho trovato il valore, lo sovrascrivo al default + if ForcedParameterForProc then + StrategyData.Parameters[i].Value = ForcedParameterForProc end end - ForcedStrategyForProc.StrategyID = sStrategyID - ForcedStrategyForProc.Parameters = ForcedParametersForProc - -- per il momento sarà sempre e solo una strategia, ma la inserisco comunque in una lista per analogia con gestione standard - table.insert( ForcedStrategiesForProc, ForcedStrategyForProc) - else - ForcedStrategiesForProc = nil + -- ritorno la lista strategia con parametri + local StrategyToProc = {} + table.insert( StrategyToProc, StrategyData) + return StrategyToProc end - - return ForcedStrategiesForProc + return nil end ------------------------------------------------------------------------------------------------------------- @@ -529,7 +510,7 @@ local function CollectFeatures( PartId, b3Raw) Proc.Strategies = GetStrategies( Proc) end -- se ci sono strategie disponibili, aggiungo a lista delle feature da lavorare - if Proc.Strategies then + if Proc.Strategies and #Proc.Strategies > 0 then table.insert( vProc, Proc) -- altrimenti errore (non ci sono strategie per lavorare la topologia riconosciuta) else @@ -568,9 +549,9 @@ local function GetFeatureInfoAndDependency( vProc, b3Raw) Proc.PassedByHole = true end -- verifiche per specchiature - if BD.DOWN_HEAD or BD.TWO_EQUAL_HEADS then + if BeamData.DOWN_HEAD or BeamData.TWO_EQUAL_HEADS then -- forature - if BD.DOUBLE_HEAD_DRILLING and ID.IsDrilling( Proc) and ID.IsDrilling( ProcB) and not Proc.Mirror then + if BeamData.DOUBLE_HEAD_DRILLING and ID.IsDrilling( Proc) and ID.IsDrilling( ProcB) and not Proc.Mirror then if AreDrillingsMirrored( Proc, ProcB, b3Raw) then Proc.Mirror = ProcB end @@ -591,12 +572,12 @@ function BeamExec.ProcessFeatures() while nRawId do -- verifico che il grezzo contenga pezzi oppure sia abbastanza lungo da essere scaricato coi carrelli local nPartId = EgtGetFirstPartInRawPart( nRawId) - if not nPartId and EgtGetRawPartBBox( nRawId):getDimX() < BD.MinRaw then break end + if not nPartId and EgtGetRawPartBBox( nRawId):getDimX() < BeamData.MinRaw then break end -- aggiungo la fase, se non è la prima if nOrd == 1 then EgtSetCurrPhase( 1) else - BeamLib.AddPhaseWithRawParts( nRawId, BD.OriXR, BD.PosXR, 0) + BeamLib.AddPhaseWithRawParts( nRawId, BeamData.OriXR, BeamData.PosXR, 0) end local nPhase = EgtGetCurrPhase() local nDispId = EgtGetPhaseDisposition( nPhase) diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index d8ee03d..0d026fc 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -11,9 +11,6 @@ require( 'EgtBase') EgtOutLog( ' BeamLib started', 1) --- Dati -local BD = require( 'BeamData') - --TODO refactoring di queste funzioni ------------------------------------------------------------------------------------------------------------- @@ -196,7 +193,7 @@ function BeamLib.Is3EdgesApprox( Proc, idFace, nAddGrpId) -- recupero il numero effettivo di lati local _, nEntityCount = EgtCurveDomain( nContourId) local nEdges = nEntityCount - if nEntityCount and nEntityCount == 3 then + if nEntityCount and nEntityCount == 3 then bResult = true -- rimuovo i lati molto corti dal conteggio totale elseif nEntityCount then diff --git a/LuaLibs/FaceData.lua b/LuaLibs/FaceData.lua index 5568d8f..9b7f28c 100644 --- a/LuaLibs/FaceData.lua +++ b/LuaLibs/FaceData.lua @@ -5,9 +5,6 @@ -- Tabella per definizione modulo local FaceData = {} --- Carico i dati globali -local BD = require( 'BeamData') - -- carico librerie local BeamLib = require( 'BeamLib') @@ -68,6 +65,7 @@ local function GetAdjacentFaces( Proc, idFace) if vAdj[idFace + 1][i] and vAdj[idFace + 1][i] ~= 0 and ( idFace + 1 ~= i) then local _, ptP1, ptP2 = EgtSurfTmFacetsContact( Proc.Id, idFace, i - 1, GDB_ID.ROOT) local dLength = dist( ptP1, ptP2) + AdjacentFaces[i] = {} AdjacentFaces[i].Id = i - 1 AdjacentFaces[i].LengthOnMainFace = dLength end @@ -82,7 +80,9 @@ function FaceData.GetFacesByAdjacencyNumber( Proc) local FacesByAdjacencyNumber = {} for i = 1, Proc.Fct do - -- TODO questo non funziona!! + if not FacesByAdjacencyNumber[#Proc.Faces[i].Adjacencies] then + FacesByAdjacencyNumber[#Proc.Faces[i].Adjacencies] = {} + end table.insert( FacesByAdjacencyNumber[#Proc.Faces[i].Adjacencies], i - 1) end @@ -107,10 +107,10 @@ local function GetBottomFace( Proc) local dMinElevation = GEO.INFINITO for i = 1, #vBottomFace do for j = 1, Proc.Fct do - if vBottomFace[i] == Proc.Face[j].Id then - if Proc.Face[j].Elevation < dMinElevation then - dMinElevation = Proc.Face[j].Elevation - nBottomFace = Proc.Face[j].Id + if vBottomFace[i] == Proc.Faces[j].Id then + if Proc.Faces[j].Elevation < dMinElevation then + dMinElevation = Proc.Faces[j].Elevation + nBottomFace = Proc.Faces[j].Id end end end @@ -120,11 +120,11 @@ local function GetBottomFace( Proc) end BottomFace.Id = nBottomFace - BottomFace.FrameHV = Proc.Face[nBottomFace + 1].FrameHV - BottomFace.Width = Proc.Face[nBottomFace + 1].Width - BottomFace.Height = Proc.Face[nBottomFace + 1].Height - BottomFace.Elevation = Proc.Face[nBottomFace + 1].Elevation - BottomFace.VtN = Proc.Face[nBottomFace + 1].VtN + BottomFace.FrameHV = Proc.Faces[nBottomFace + 1].FrameHV + BottomFace.Width = Proc.Faces[nBottomFace + 1].Width + BottomFace.Height = Proc.Faces[nBottomFace + 1].Height + BottomFace.Elevation = Proc.Faces[nBottomFace + 1].Elevation + BottomFace.VtN = Proc.Faces[nBottomFace + 1].VtN return BottomFace end @@ -168,8 +168,8 @@ local function GetLongFaces( Proc, MainFaces) for i = 1, Proc.Fct do if ( i - 1) ~= idBottomFace and ( i - 1) ~= LongFaces[1].Id then local bIsAdjacent = false - for j = 1, #Proc.Face[i].Adjacences do - if Proc.Face[i].Adjacences[j].Id == LongFaces[i].Id then + for j = 1, #Proc.Faces[i].Adjacences do + if Proc.Faces[i].Adjacences[j].Id == LongFaces[i].Id then bIsAdjacent = true end end @@ -183,12 +183,12 @@ local function GetLongFaces( Proc, MainFaces) for i = 1, #LongFaces do for j = 1, Proc.Fct do - if LongFaces[i].Id == Proc.Face[j].Id then - LongFaces[i].Frame = Proc.Face[j].FrameHV - LongFaces[i].Width = Proc.Face[j].Width - LongFaces[i].Height = Proc.Face[j].Height - LongFaces[i].Elevation = Proc.Face[j].Elevation - LongFaces[i].VtN = Proc.Face[j].VtN + if LongFaces[i].Id == Proc.Faces[j].Id then + LongFaces[i].Frame = Proc.Faces[j].FrameHV + LongFaces[i].Width = Proc.Faces[j].Width + LongFaces[i].Height = Proc.Faces[j].Height + LongFaces[i].Elevation = Proc.Faces[j].Elevation + LongFaces[i].VtN = Proc.Faces[j].VtN end end end @@ -198,10 +198,11 @@ end ------------------------------------------------------------------------------------------------------------- function FaceData.GetFacesInfo( Proc, b3Raw) - Faces = {} + local Faces = {} local b3Solid = EgtGetBBoxGlob( EgtGetFirstNameInGroup( Proc.PartId, 'Box') or GDB_ID.NULL, GDB_BB.STANDARD) for i = 1, Proc.Fct do + Faces[i] = {} Faces[i].Id = i - 1 Faces[i].VtN = EgtSurfTmFacetNormVersor( Proc.Id, i - 1, GDB_ID.ROOT ) if Proc.Fct < 6 then @@ -228,7 +229,7 @@ function FaceData.GetMainFaces( Proc) local MainFaces = {} -- faccia di fondo - if Proc.FeatureTopology.Family == 'Rabbet' or Proc.FeatureTopology.Family == 'VGroove' or Proc.FeatureTopology.Family == 'Groove' or Proc.FeatureTopology.Family == 'Pocket' then + if Proc.Topology.Family == 'Rabbet' or Proc.Topology.Family == 'VGroove' or Proc.Topology.Family == 'Groove' or Proc.Topology.Family == 'Pocket' then MainFaces.BottomFace = GetBottomFace( Proc) MainFaces.LongFaces = GetLongFaces( Proc, MainFaces) end diff --git a/LuaLibs/FeatureData.lua b/LuaLibs/FeatureData.lua index 0a254fd..e6a83da 100644 --- a/LuaLibs/FeatureData.lua +++ b/LuaLibs/FeatureData.lua @@ -6,7 +6,7 @@ local FeatureData = {} -- Carico i dati globali -local BD = require( 'BeamData') +local BeamData = require( 'BeamData') -- carico librerie local BeamLib = require( 'BeamLib') @@ -118,7 +118,7 @@ end -- restituisce una stringa con il nome esteso della topologia della feature -- *famiglia - numero di facce - passante* local function GetTopologyName( sFamily, nNumberOfFaces, bIsThrough) - return sFamily .. '-' .. nNumberOfFaces .. '-' .. EgtIf( bIsThrough, 'Through', 'Blind') + return sFamily .. '-' .. tostring( nNumberOfFaces) .. '-' .. EgtIf( bIsThrough, 'Through', 'Blind') end --------------------------------------------------------------------- @@ -188,7 +188,7 @@ local function ClassifyTopology( Proc, b3Raw) FeatureTopology.Family = sFamily FeatureTopology.IsThrough = bIsThrough FeatureTopology.AllRightAngles = bAllRightAngles - FeatureTopology.Name = GetTopologyName( sFamily, bIsThrough, bAllRightAngles) + FeatureTopology.Name = GetTopologyName( sFamily, Proc.Fct, bIsThrough) FeatureTopology.AdjacencyMatrix = vAdj -- feature che necessita di essere catalogata, ma non si capisce come else @@ -222,8 +222,8 @@ function FeatureData.GetDrillingData( Proc) -- verifico se foro da adattare if EgtExistsInfo( Proc.Id, 'DiamUser') then if AuxId then AuxId = AuxId + Proc.Id end - if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BD.USER_HOLE_DIAM and BD.USER_HOLE_DIAM > 1 then - EgtModifyArcRadius( AuxId, BD.USER_HOLE_DIAM / 2) + if AuxId and EgtGetType( AuxId) == GDB_TY.CRV_ARC and BeamData.USER_HOLE_DIAM and BeamData.USER_HOLE_DIAM > 1 then + EgtModifyArcRadius( AuxId, BeamData.USER_HOLE_DIAM / 2) end end diff --git a/LuaLibs/Identity.lua b/LuaLibs/Identity.lua index 31fd1e1..9d4a4b6 100644 --- a/LuaLibs/Identity.lua +++ b/LuaLibs/Identity.lua @@ -5,6 +5,21 @@ -- Tabella per definizione modulo local Identity = {} +--------------------------------------------------------------------- +------------------ EGALWARE FEATURES ------------------------------ +--------------------------------------------------------------------- +-- Feature : Head Cut +function Identity.IsHeadCut( Proc) + return ( Proc.Grp == 1 and Proc.Prc == 340) +end +--------------------------------------------------------------------- +-- Feature : Split Cut +function Identity.IsSplitCut( Proc) + return ( Proc.Grp == 2 and Proc.Prc == 350) +end + +--------------------------------------------------------------------- +------------------ STANDARD FEATURES ------------------------------ --------------------------------------------------------------------- -- Feature : Cut function Identity.IsCut( Proc) diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index 2ce06e3..3f4b08c 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -10,8 +10,5 @@ require( 'EgtBase') EgtOutLog( ' MachiningLib started', 1) --- Dati -local BD = require( 'BeamData') - ------------------------------------------------------------------------------------------------------------- return MachiningLib diff --git a/Process.lua b/Process.lua index 3c824bc..422ac4f 100644 --- a/Process.lua +++ b/Process.lua @@ -3,14 +3,16 @@ -- Si opera sulla macchina corrente -- 2024/04/02 PRIMA VERSIONE + -- Intestazioni require( 'EgtBase') _ENV = EgtProtectGlobal() EgtEnableDebug( true) --- TODO caricare strategie come librerie -- Imposto direttorio libreria specializzata per Travi EgtAddToPackagePath( BEAM.BASEDIR .. '\\LuaLibs\\?.lua') +-- Imposto direttorio strategie. N.B. Le strategie dovranno essere caricate con il nome del direttorio padre +EgtAddToPackagePath( BEAM.BASEDIR .. '\\Strategies') -- Verifico che la macchina corrente sia abilitata per la lavorazione delle Travi local sMachDir = EgtGetCurrMachineDir() @@ -34,11 +36,15 @@ EgtOutLog( '*** Beam Process Start ***', 1) _G.package.loaded.BeamExec = nil _G.package.loaded.BeamLib = nil _G.package.loaded.BeamData = nil -local BE = require( 'BeamExec') -local BL = require( 'BeamLib') +_G.package.loaded.Identity = nil +_G.package.loaded.BasicCustomerStrategies = nil +_G.package.loaded.FeatureData = nil +_G.package.loaded.FaceData = nil + +local BeamExec = require( 'BeamExec') -- Carico i dati globali -local BD = require( 'BeamData') +local BeamData = require( 'BeamData') -- Variabili di modulo local vBeam = {} @@ -123,11 +129,11 @@ end ------------------------------------------------------------------------------------------------------------- local function GetDataConfig() -- recupero utensili dal magazzino - BE.GetToolsFromDB() + BeamExec.GetToolsFromDB() -- se si utilizza interfaccia B&W, si carica il file JSON local bIsBeamWall = true -- TODO serve parametro per capire se stiamo utilizzando B&W if bIsBeamWall then - BE.GetStrategiesFromJSONinBD() + BeamExec.GetStrategiesFromJSONinBD() end -- TODO da gestire eventuali errori bloccanti return true @@ -138,23 +144,23 @@ end ------------------------------------------------------------------------------------------------------------- local function MyProcessBeams() -- Determinazione minimo grezzo scaricabile - BE.CalcMinUnloadableRaw( dRawW, dRawH) + BeamExec.CalcMinUnloadableRaw( dRawW, dRawH) -- Lunghezza totale delle travi local dTotLen = 0 for i = 1, #vBeam - 1 do dTotLen = dTotLen + vBeam[i].Box:getDimX() end - dTotLen = dTotLen + max( vBeam[#vBeam].Box:getDimX(), BD.MinRaw) - local dAddLen = BD.OVM_HEAD + ( #vBeam - 1) * BD.OVM_MID - EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BD.MinRaw + BD.OVM_MID, 1), 1) + dTotLen = dTotLen + max( vBeam[#vBeam].Box:getDimX(), BeamData.MinRaw) + local dAddLen = BeamData.OVM_HEAD + ( #vBeam - 1) * BeamData.OVM_MID + EgtOutLog( 'Ltot : '..EgtNumToString( dTotLen, 1) .. ' Lagg : '..EgtNumToString( dAddLen, 1)..' MinUnloadRaw : '.. EgtNumToString( BeamData.MinRaw + BeamData.OVM_MID, 1), 1) -- Richiedo lunghezza del grezzo, sovramateriale di testa, forzatura verticale e ordinamento automatico secondo la lunghezza local vsVal = EgtDialogBox( 'Lavora Travi' .. ' (Ltot='..EgtNumToString( dTotLen + dAddLen + 0.5, 0).. - ', Lmax='..EgtNumToString( BD.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BD.MinRaw + BD.OVM_MID, 0)..')', - {'Lunghezza grezzo', EgtNumToString( BD.STD_RAW, 0)}, - {'Sovramateriale di testa', EgtNumToString( BD.OVM_HEAD, 0)}, - {'Offset intermedio', EgtNumToString( BD.OVM_MID, 0)}, + ', Lmax='..EgtNumToString( BeamData.MAX_RAW, 0)..',MinUlr='..EgtNumToString( BeamData.MinRaw + BeamData.OVM_MID, 0)..')', + {'Lunghezza grezzo', EgtNumToString( BeamData.STD_RAW, 0)}, + {'Sovramateriale di testa', EgtNumToString( BeamData.OVM_HEAD, 0)}, + {'Offset intermedio', EgtNumToString( BeamData.OVM_MID, 0)}, {'Forza sezione verticale', ' CB:true,*false'}, {'Ordina per lunghezza', ' CB:true,*false'}, {'Calcolo Lavorazioni', ' CB:*Da progetto,Ricalcolo standard,Ricalcolo IA'}) @@ -171,7 +177,7 @@ local function MyProcessBeams() return false end if dRawL < GEO.EPS_SMALL then dRawL = dTotLen + dAddLen + 0.5 end - dRawL = min( dRawL, BD.MAX_RAW) + dRawL = min( dRawL, BeamData.MAX_RAW) local dOvmHead = EgtEvalNumExpr( vsVal[2]) if not dOvmHead then local sOut = 'Sovramateriale di testa errato : ' .. vsVal[2] @@ -197,21 +203,21 @@ local function MyProcessBeams() EgtOutLog( 'Lraw : ' .. EgtNumToString( dRawL, 1) .. ' Lovm : '.. EgtNumToString( dOvmHead, 1), 1) -- Verifico sezione barra non troppo grande - if not BD.MAX_WIDTH2 or not BD.MAX_HEIGHT2 then - if ( dRawW > BD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BD.MAX_HEIGHT + 10 * GEO.EPS_SMALL) then + if not BeamData.MAX_WIDTH2 or not BeamData.MAX_HEIGHT2 then + if ( dRawW > BeamData.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BeamData.MAX_HEIGHT + 10 * GEO.EPS_SMALL) then local sOut = 'Sezione (' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' .. - 'oltre i limiti della macchina (' .. EgtNumToString( BD.MAX_WIDTH, 2) .. ' x ' .. EgtNumToString( BD.MAX_HEIGHT, 2) .. ') ' + 'oltre i limiti della macchina (' .. EgtNumToString( BeamData.MAX_WIDTH, 2) .. ' x ' .. EgtNumToString( BeamData.MAX_HEIGHT, 2) .. ') ' EgtOutLog( sOut) EgtOutBox( sOut, 'Lavora Travi', 'WARNING') EgtDraw() return false end else - if ( dRawW > BD.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BD.MAX_HEIGHT + 10 * GEO.EPS_SMALL) and - ( dRawW > BD.MAX_WIDTH2 + 10 * GEO.EPS_SMALL or dRawH > BD.MAX_HEIGHT2 + 10 * GEO.EPS_SMALL) then + if ( dRawW > BeamData.MAX_WIDTH + 10 * GEO.EPS_SMALL or dRawH > BeamData.MAX_HEIGHT + 10 * GEO.EPS_SMALL) and + ( dRawW > BeamData.MAX_WIDTH2 + 10 * GEO.EPS_SMALL or dRawH > BeamData.MAX_HEIGHT2 + 10 * GEO.EPS_SMALL) then local sOut = 'Sezione (' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' .. - 'oltre i limiti della macchina (' .. EgtNumToString( BD.MAX_WIDTH, 2) .. ' x ' .. EgtNumToString( BD.MAX_HEIGHT, 2) .. ') ' .. - 'e (' .. EgtNumToString( BD.MAX_WIDTH2, 2) .. ' x ' .. EgtNumToString( BD.MAX_HEIGHT2, 2) .. ')' + 'oltre i limiti della macchina (' .. EgtNumToString( BeamData.MAX_WIDTH, 2) .. ' x ' .. EgtNumToString( BeamData.MAX_HEIGHT, 2) .. ') ' .. + 'e (' .. EgtNumToString( BeamData.MAX_WIDTH2, 2) .. ' x ' .. EgtNumToString( BeamData.MAX_HEIGHT2, 2) .. ')' EgtOutLog( sOut) EgtOutBox( sOut, 'Lavora Travi', 'WARNING') EgtDraw() @@ -220,9 +226,9 @@ local function MyProcessBeams() end -- Verifico sezione barra non troppo piccola - if dRawW < BD.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < BD.MIN_HEIGHT - 10 * GEO.EPS_SMALL then + if dRawW < BeamData.MIN_WIDTH - 10 * GEO.EPS_SMALL or dRawH < BeamData.MIN_HEIGHT - 10 * GEO.EPS_SMALL then local sOut = 'Sezione (' .. EgtNumToString( dRawW, 2) .. ' x ' .. EgtNumToString( dRawH, 2) .. ') ' .. - 'sotto i limiti della macchina (' .. EgtNumToString( BD.MIN_WIDTH, 2) .. ' x ' .. EgtNumToString( BD.MIN_HEIGHT, 2) .. ')' + 'sotto i limiti della macchina (' .. EgtNumToString( BeamData.MIN_WIDTH, 2) .. ' x ' .. EgtNumToString( BeamData.MIN_HEIGHT, 2) .. ')' EgtOutLog( sOut) EgtOutBox( sOut, 'Lavora Travi', 'WARNING') EgtDraw() @@ -250,7 +256,7 @@ local function MyProcessBeams() end -- Sistemo le travi nel grezzo - local bOk, sErr = BE.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam) + local bOk, sErr = BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, vBeam) if not bOk then EgtOutLog( sErr) EgtOutBox( sErr, 'Lavora Travi', 'ERROR') @@ -264,8 +270,7 @@ end -- *** Inserimento delle lavorazioni nelle travi *** ------------------------------------------------------------------------------------------------------------- local function MyProcessFeatures() - - local bOk, Stats = BE.ProcessFeatures() + local bOk, Stats = BeamExec.ProcessFeatures() local nErrCnt = 0 local nWarnCnt = 0 local sOutput = '' diff --git a/Strategies/STR0001/STR0001.lua b/Strategies/STR0001/STR0001.lua new file mode 100644 index 0000000..e69de29 diff --git a/Strategies/STR0001/STR0001Config.lua b/Strategies/STR0001/STR0001Config.lua new file mode 100644 index 0000000..27e090f --- /dev/null +++ b/Strategies/STR0001/STR0001Config.lua @@ -0,0 +1,16 @@ +-- Parametri configurabili da cliente per strategia: STR0001 + +local STR0001Data = { + { + StrategyID = 'STR0001', + Parameters = { + { + { Value = '15', Name = 'Step', Description = 'Questo è lo step di lavorazione', Type = 'd'}, + { Value = '2', Name = 'Depth', Description = 'Affondamento lavorazione', Type = 'd'}, + { Value = 'false', Name = 'AntiSplint', Description = 'Antischeggia', Type = 'b'} + } + } + } +} + +return STR0001Data \ No newline at end of file diff --git a/Strategies/STR0002/STR0002.lua b/Strategies/STR0002/STR0002.lua new file mode 100644 index 0000000..e69de29 diff --git a/Strategies/STR0002/STR0002Config.lua b/Strategies/STR0002/STR0002Config.lua new file mode 100644 index 0000000..e69de29