From cf96eb7bc3ec4c1a1bb95ec1a33ca46659b69d38 Mon Sep 17 00:00:00 2001 From: "luca.mazzoleni" Date: Tue, 7 Jan 2025 17:30:47 +0100 Subject: [PATCH] - aggiunta STR0005 - BladeToWaste --- Strategies/Standard/STR0005/STR0005.lua | 58 +++++++++++++++++++ Strategies/Standard/STR0005/STR0005Config.lua | 15 +++++ 2 files changed, 73 insertions(+) create mode 100644 Strategies/Standard/STR0005/STR0005.lua create mode 100644 Strategies/Standard/STR0005/STR0005Config.lua diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua new file mode 100644 index 0000000..7e026ce --- /dev/null +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -0,0 +1,58 @@ +-- Strategia: STR0005 +-- Descrizione +-- lama per taglio facce con cubetti se necessario +-- Feature: tagli singoli / doppi + +-- carico librerie +local BeamLib = require( 'BeamLib') +local BeamData = require( 'BeamData') +local MachiningLib = require( 'MachiningLib') +local FeatureLib = require( 'FeatureLib') +-- strategie di base +local FaceByBlade = require( 'FACEBYBLADE') + +-- Tabella per definizione modulo +local STR0005 = {} +local Strategy = {} + +------------------------------------------------------------------------------------------------------------- + +local function IsTopologyOk( Proc) + if Proc.Topology.bAllRightAngles and + ( Proc.Topology.sName == 'Pocket-5-Blind' or + Proc.Topology.sName == 'Groove-3-Through' or + Proc.Topology.sName == 'Groove-4-Blind' or + Proc.Topology.sName == 'Tunnel-4-Through') then + + return true + else + return false + end +end + + +function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) + -- TODO da implementare gestione feature lunghe e spezzatura + -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) + local StrategyLib = {} + StrategyLib.Config = require( 'STR0005\\STR0005Config') + Strategy.sName = StrategyLib.Config.sStrategyId + CustomParameters = BeamLib.GetUpdateCustomParameters( CustomParameters, StrategyLib.Config.Parameters) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( CustomParameters) + Strategy.Result = {} + Strategy.Result.sInfo = '' + + if not IsTopologyOk( Proc) then + local sErr = 'Feature '.. Proc.idFeature .. ' : strategy ' .. Strategy.sName .. ' not implemented' + EgtOutLog( sErr) + Strategy.Result.sStatus = 'Not-Applicable' + Strategy.Result.sInfo = 'Topology' + return false, Strategy.Result + end + + return bAreAllMachiningsAdded, Strategy.Result +end + +------------------------------------------------------------------------------------------------------------- + + return STR0005 \ No newline at end of file diff --git a/Strategies/Standard/STR0005/STR0005Config.lua b/Strategies/Standard/STR0005/STR0005Config.lua new file mode 100644 index 0000000..133f644 --- /dev/null +++ b/Strategies/Standard/STR0005/STR0005Config.lua @@ -0,0 +1,15 @@ +-- Parametri configurabili da cliente per strategia: STR0004 + +local STR0005Data = { + sStrategyId = 'STR0005', + Parameters = { + { sName = 'bForceLongcutBlade', sNameNge = 'USE_LONGCUT_BLADE', sValue = 'false', sDescriptionShort = 'Force ripping blade', sDescriptionLong = 'Force the use of ripping blade, designed for cuts parallel to the grain', sType = 'b', sMessageId = '', sMinUserLevel = '1'}, + { sName = 'dExtendAfterTail', sNameNge = 'EXTEND_AFTER_TAIL', sValue = 'false', sDescriptionShort = '', sDescriptionLong = '', sType = 'd', sMessageId = '', sMinUserLevel = '1'}, + { sName = 'sCanDamageNextPiece', sNameNge = 'DAMAGE_NEXT_PIECE', sValue = 'NEVER', sType = 'combo', sMinUserLevel = '1', + Choices = { sValue = 'NEVER', sDescriptionShort = '', sDescriptionLong = '', sMessageId = ''}, + { sValue = 'ONLY_IF_RAWPART', sDescriptionShort = '', sDescriptionLong = '', sMessageId = ''}, + { sValue = 'ALWAYS', sDescriptionShort = '', sDescriptionLong = '', sMessageId = ''}} + } +} + +return STR0005Data \ No newline at end of file