diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index a49df77..1f51e76 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -28,11 +28,12 @@ EgtMdbSave() ------------------------------------------------------------------------------------------------------------- -- *** variabili globali *** ------------------------------------------------------------------------------------------------------------- -TOOLS = {} -- tabella contenente tutti gli utensili -STRATEGIES = nil -- tabella contenente le strategie disponibili per ogni feature -MACHININGS = {} -- tabella contenente le lavorazioni da applicare +TOOLS = {} -- tabella contenente tutti gli utensili +STRATEGIES = nil -- tabella contenente le strategie disponibili per ogni feature +STRATEGIES_CONFIG = {} -- tabella contenente i paraemtri di default delle strategie disponibili +MACHININGS = {} -- tabella contenente le lavorazioni da applicare MACHININGS.Info = {} -PROCESSINGS = {} -- tabella contenente tutte le informazioni di ogni feature, processate per ogni rotazione +PROCESSINGS = {} -- tabella contenente tutte le informazioni di ogni feature, processate per ogni rotazione ------------------------------------------------------------------------------------------------------------- -- *** COSTANTI *** TODO -> DA SPOSTARE IN BEAMDATA??? @@ -250,7 +251,6 @@ local function IsCombinationAvailable( sCombination, nUnloadPos, bSquareSection) BEAM.Rotation.Basic = true end - -------------------------------------------------------------------------- -- TODO scelta combinazione forzato DA RIMUOVERE!! Serve modifica al BEAM. BEAM.BeamWall = true @@ -574,14 +574,6 @@ local function GetFeatureForcedStrategy( Proc) -- se è presente la strategia forzata if sStrategyId then - -- eseguo file config con i parametri di default - local StrategyData = require( sStrategyId .. '\\' .. sStrategyId .. 'Config') - - -- se ID strategia non esiste oppure ID letto in NGE è differente da quello letto nella strategia, esco subito - if not StrategyData or StrategyData.sStrategyId ~= sStrategyId then - return nil - end - -- si prepara tabella strategia. In questa fase si salva solo id strategia e il fatto che è stata forzata. I parametri forzati vengono letti all'esecuzioen della strategia local StrategyToProc = {} local ParamList = {} @@ -803,19 +795,31 @@ local function GetFeatureInfoAndDependency( vProcSingleRot, Part) end ------------------------------------------------------------------------------------------------------------- --- caricamento librerie strategie (standard o speciali) se presenti nella Proc come strategie disponibili per questo Processing +-- caricamento librerie strategie (standard o speciali) se presenti nella Proc come strategie disponibili per questo Processing local function RunStrategyLibraries( sStrategyId) - local StrategyConfigName = sStrategyId .. '\\' .. sStrategyId .. 'Config' + -- file script local StrategyScriptName = sStrategyId .. '\\' .. sStrategyId - local StrategyConfigPathStandard = BEAM.BASEDIR .. '\\Strategies\\Standard\\' .. StrategyConfigName .. '.lua' local StrategyScriptPathStandard = BEAM.BASEDIR .. '\\Strategies\\Standard\\' .. StrategyScriptName .. '.lua' - local StrategyConfigPathSpecial = BEAM.BASEDIR .. '\\Strategies\\Special\\' .. StrategyConfigName .. '.lua' local StrategyScriptPathSpecial = BEAM.BASEDIR .. '\\Strategies\\Special\\' .. StrategyScriptName .. '.lua' + -- file config + local StrategyConfigName = sStrategyId .. '\\' .. sStrategyId .. 'Config.json' + local StrategyConfigPathStandard = BEAM.BASEDIR .. '\\Strategies\\Standard\\' .. StrategyConfigName + local StrategyConfigPathSpecial = BEAM.BASEDIR .. '\\Strategies\\Special\\' .. StrategyConfigName + local StrategyLib = {} if ( EgtExistsFile( StrategyConfigPathStandard) and EgtExistsFile( StrategyScriptPathStandard)) or ( EgtExistsFile( StrategyConfigPathSpecial) and EgtExistsFile( StrategyScriptPathSpecial)) then - StrategyLib.Config = require( StrategyConfigName) + -- caricamento script strategia come libreria StrategyLib.Script = require( StrategyScriptName) + -- se config strategia non ancora caricato, importo il JSON + if not STRATEGIES_CONFIG[sStrategyId] then + if EgtExistsFile( StrategyConfigPathStandard) then + STRATEGIES_CONFIG[sStrategyId] = ImportFileJSON( StrategyConfigPathStandard) + else + STRATEGIES_CONFIG[sStrategyId] = ImportFileJSON( StrategyConfigPathSpecial) + end + end + StrategyLib.Config = STRATEGIES_CONFIG[sStrategyId] return StrategyLib else return {} diff --git a/Process.lua b/Process.lua index a8e5ef1..0451a01 100644 --- a/Process.lua +++ b/Process.lua @@ -46,9 +46,7 @@ _G.package.loaded.DiceCut = nil _G.package.loaded.Logs = nil -- strategie di base sempre presenti _G.package.loaded['HEADCUT\\HEADCUT'] = nil -_G.package.loaded['HEADCUT\\HEADCUTConfig'] = nil _G.package.loaded['TAILCUT\\TAILCUT'] = nil -_G.package.loaded['TAILCUT\\TAILCUTConfig'] = nil -- TODO controllare se c'è un modo migliore per resettare librerie delle strategie caricate precedentemente -- Per ottimizzare potremmo anche ciclare solo fino al numero di strategie raggiunto per il momento. @@ -57,13 +55,9 @@ _G.package.loaded['TAILCUT\\TAILCUTConfig'] = nil for i = 1, 9999 do local IdSTRTemp = EgtReplaceString( tostring( i/10000, 4), '0.', '') local sLibraryToReload = "STR" .. IdSTRTemp .. "\\STR" .. IdSTRTemp - local sLibraryConfigToReload = sLibraryToReload .. "Config" if _G.package.loaded[sLibraryToReload] then _G.package.loaded[sLibraryToReload] = nil end - if _G.package.loaded[sLibraryConfigToReload] then - _G.package.loaded[sLibraryConfigToReload] = nil - end end local vtCoreStrategiesNames = EgtFindAllFiles( BEAM.BASEDIR .. '\\StrategyLibs\\*.lua') for i = 1, #vtCoreStrategiesNames do diff --git a/Strategies/Standard/HEADCUT/HEADCUT.lua b/Strategies/Standard/HEADCUT/HEADCUT.lua index dc22783..cd208ac 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.lua +++ b/Strategies/Standard/HEADCUT/HEADCUT.lua @@ -24,7 +24,7 @@ local Strategy = {} ------------------------------------------------------------------------------------------------------------- local function LoadStrategyParameters( Proc, CustomParameters) local StrategyLib = {} - StrategyLib.Config = require( 'HEADCUT\\HEADCUTConfig') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Result = {} diff --git a/Strategies/Standard/HEADCUT/HEADCUTConfig.json b/Strategies/Standard/HEADCUT/HEADCUTConfig.json index 5aed6e2..02db2f3 100644 --- a/Strategies/Standard/HEADCUT/HEADCUTConfig.json +++ b/Strategies/Standard/HEADCUT/HEADCUTConfig.json @@ -1,37 +1,36 @@ -[ - { - "sStrategyId": "HEADCUT", - "Parameters" : [ - { - "Name": "dDepthChamfer", - "sNameNge": "DEPTH_CHAMFER", - "sValue": "0", - "sDescriptionShort": "Depth Chamfer", - "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bForceChainSaw", - "sNameNge": "FORCE_CHAIN", - "sValue": "false", - "sDescriptionShort": "Force to use chain saw", - "sDescriptionLong": "Force to use chain saw", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bFinishWithMill", - "sNameNge": "MILL_FINISH", - "sValue": "true", - "sDescriptionShort": "Finish with mill", - "sDescriptionLong": "Use a mill to finish the surface if split with chain saw", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - } - ] - } -] +{ + "sStrategyId": "HEADCUT", + "Parameters" : [ + { + "sName": "dDepthChamfer", + "sNameNge": "DEPTH_CHAMFER", + "sValue": "0", + "sDescriptionShort": "Depth Chamfer", + "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bForceChainSaw", + "sNameNge": "FORCE_CHAIN", + "sValue": "false", + "sDescriptionShort": "Force to use chain saw", + "sDescriptionLong": "Force to use chain saw", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bFinishWithMill", + "sNameNge": "MILL_FINISH", + "sValue": "true", + "sDescriptionShort": "Finish with mill", + "sDescriptionLong": "Use a mill to finish the surface if split with chain saw", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + } + ] +} + diff --git a/Strategies/Standard/STR0001/STR0001.lua b/Strategies/Standard/STR0001/STR0001.lua index f6fb0d1..3262aff 100644 --- a/Strategies/Standard/STR0001/STR0001.lua +++ b/Strategies/Standard/STR0001/STR0001.lua @@ -195,7 +195,7 @@ end function STR0001.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0001\\STR0001Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machining = {} diff --git a/Strategies/Standard/STR0001/STR0001Config.json b/Strategies/Standard/STR0001/STR0001Config.json index fa2ce2d..682b603 100644 --- a/Strategies/Standard/STR0001/STR0001Config.json +++ b/Strategies/Standard/STR0001/STR0001Config.json @@ -1,101 +1,98 @@ - -[ - { - "sStrategyId": "STR0001", - "Parameters" : [ - { - "Name": "dOverMatOnLength", - "sNameNge": "OVM_LENGTH", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dOverMatOnRadius", - "sNameNge": "OVM_RADIUS", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon width", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "nMaxMillingPaths", - "sNameNge": "MAX_PATHS", - "sValue": "3", - "sDescriptionShort": "Maximum number of milling passes", - "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bUseDTToolOnPocketing", - "sNameNge": "ALLOW_DT_POCKET", - "sValue": "true", - "sDescriptionShort": "Use DoveTail tool to pocket", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteLength", - "sNameNge": "MAX_WASTE_LENGTH", - "sValue": "300", - "sDescriptionShort": "Maximum Waste Length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteVolume", - "sNameNge": "MAX_WASTE_VOLUME", - "sValue": "6000000", - "sDescriptionShort": "Maximum Waste Volume", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "sCuttingStrategy", - "sNameNge": "EXEC_TENON_SURF", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "BLADE_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "MILL_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "CHAINSAW_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0001", + "Parameters" : [ + { + "sName": "dOverMatOnLength", + "sNameNge": "OVM_LENGTH", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dOverMatOnRadius", + "sNameNge": "OVM_RADIUS", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon width", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "nMaxMillingPaths", + "sNameNge": "MAX_PATHS", + "sValue": "3", + "sDescriptionShort": "Maximum number of milling passes", + "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bUseDTToolOnPocketing", + "sNameNge": "ALLOW_DT_POCKET", + "sValue": "true", + "sDescriptionShort": "Use DoveTail tool to pocket", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sNameNge": "MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "Maximum Waste Length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteVolume", + "sNameNge": "MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "Maximum Waste Volume", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "sCuttingStrategy", + "sNameNge": "EXEC_TENON_SURF", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BLADE_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "MILL_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "CHAINSAW_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0002/STR0002.lua b/Strategies/Standard/STR0002/STR0002.lua index d6fcd3f..4373530 100644 --- a/Strategies/Standard/STR0002/STR0002.lua +++ b/Strategies/Standard/STR0002/STR0002.lua @@ -402,7 +402,7 @@ end function STR0002.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0002\\STR0002Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machining = {} diff --git a/Strategies/Standard/STR0002/STR0002Config.json b/Strategies/Standard/STR0002/STR0002Config.json index 6c55d64..9b9b7ba 100644 --- a/Strategies/Standard/STR0002/STR0002Config.json +++ b/Strategies/Standard/STR0002/STR0002Config.json @@ -1,27 +1,25 @@ -[ - { - "sStrategyId": "STR0002", - "Parameters" : [ - { - "Name": "dMaxCornerRadius", - "sNameNge": "MAX_CORNER_RADIUS", - "sValue": "15", - "sDescriptionShort": "Max radius left on corners", - "sDescriptionLong": "Radius-limit left by the tool at each corner of the feature", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bAntiSplint", - "sNameNge": "ANTISPLINT", - "sValue": "false", - "sDescriptionShort": "Use Anti-Splint strategy", - "sDescriptionLong": "The strategy will apply blade cuts on corner to avoid wood splint", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0002", + "Parameters" : [ + { + "sName": "dMaxCornerRadius", + "sNameNge": "MAX_CORNER_RADIUS", + "sValue": "15", + "sDescriptionShort": "Max radius left on corners", + "sDescriptionLong": "Radius-limit left by the tool at each corner of the feature", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bAntiSplint", + "sNameNge": "ANTISPLINT", + "sValue": "false", + "sDescriptionShort": "Use Anti-Splint strategy", + "sDescriptionLong": "The strategy will apply blade cuts on corner to avoid wood splint", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0003/STR0003.lua b/Strategies/Standard/STR0003/STR0003.lua index 3f88e6d..22b7424 100644 --- a/Strategies/Standard/STR0003/STR0003.lua +++ b/Strategies/Standard/STR0003/STR0003.lua @@ -168,7 +168,7 @@ end function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0003\\STR0003Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Result = {} diff --git a/Strategies/Standard/STR0003/STR0003Config.json b/Strategies/Standard/STR0003/STR0003Config.json index e90c63c..b3f3118 100644 --- a/Strategies/Standard/STR0003/STR0003Config.json +++ b/Strategies/Standard/STR0003/STR0003Config.json @@ -1,97 +1,92 @@ - -[ - { - "sStrategyId": "STR0003", - "Parameters" : [ - { - "Name": "bFinishWithChainSaw", - "sNameNge": "ALLOW_FINISH_CHAINSAW", - "sValue": "true", - "sDescriptionShort": "Finish with chainsaw if needed", - "sDescriptionLong": "Finish with chainsaw if needed", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dExtendAfterTail", - "sNameNge": "EXTEND_AFTER_TAIL", - "sValue": "", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "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" - }, - { - "Name": "bNotCompleteWithBladeRadius", - "sNameNge": "NOT_COMPLETE_WITH_BLADE_RADIUS", - "sValue": "true", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bUseZigZagMortising", - "sNameNge": "USE_ZIGZAG_CHAINSAW", - "sValue": "false", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bSortBySegment", - "sNameNge": "SORT_BY_SEGMENT", - "sValue": "true", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "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": "" - } - ] - } - ] - } -] - - +{ + "sStrategyId": "STR0003", + "Parameters" : [ + { + "sName": "bFinishWithChainSaw", + "sNameNge": "ALLOW_FINISH_CHAINSAW", + "sValue": "true", + "sDescriptionShort": "Finish with chainsaw if needed", + "sDescriptionLong": "Finish with chainsaw if needed", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dExtendAfterTail", + "sNameNge": "EXTEND_AFTER_TAIL", + "sValue": "", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "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": "bNotCompleteWithBladeRadius", + "sNameNge": "NOT_COMPLETE_WITH_BLADE_RADIUS", + "sValue": "true", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bUseZigZagMortising", + "sNameNge": "USE_ZIGZAG_CHAINSAW", + "sValue": "false", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bSortBySegment", + "sNameNge": "SORT_BY_SEGMENT", + "sValue": "true", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "b", + "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": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0004/STR0004.lua b/Strategies/Standard/STR0004/STR0004.lua index f76ed32..ccdf1e1 100644 --- a/Strategies/Standard/STR0004/STR0004.lua +++ b/Strategies/Standard/STR0004/STR0004.lua @@ -92,7 +92,7 @@ end function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0004\\STR0004Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Result = {} diff --git a/Strategies/Standard/STR0004/STR0004Config.json b/Strategies/Standard/STR0004/STR0004Config.json index d32d321..b9c919d 100644 --- a/Strategies/Standard/STR0004/STR0004Config.json +++ b/Strategies/Standard/STR0004/STR0004Config.json @@ -1,54 +1,52 @@ -[ - { - "sStrategyId": "STR0004", - "Parameters" : [ - { - "Name": "bUseZigZagMortising", - "sNameNge": "USE_ZIGZAG_CHAINSAW", - "sValue": "false", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dExtendAfterTail", - "sNameNge": "EXTEND_AFTER_TAIL", - "sValue": "", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "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": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0004", + "Parameters" : [ + { + "sName": "bUseZigZagMortising", + "sNameNge": "USE_ZIGZAG_CHAINSAW", + "sValue": "false", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dExtendAfterTail", + "sNameNge": "EXTEND_AFTER_TAIL", + "sValue": "", + "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": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 4d46259..436027b 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -22,7 +22,7 @@ Blade.Result = {} function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri da default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0005\\STR0005Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Result = {} diff --git a/Strategies/Standard/STR0005/STR0005Config.json b/Strategies/Standard/STR0005/STR0005Config.json index 56de04c..41f744a 100644 --- a/Strategies/Standard/STR0005/STR0005Config.json +++ b/Strategies/Standard/STR0005/STR0005Config.json @@ -1,151 +1,149 @@ -[ - { - "sStrategyId": "STR0005", - "Parameters" : [ - { - "Name": "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" - }, - { - "Name": "dExtendAfterTail", - "sNameNge": "EXTEND_AFTER_TAIL", - "sValue": "", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "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": "" - } - ] - }, - { - "Name": "sCuttingStrategy", - "sNameNge": "CUTTING_STRATEGY", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "DROP_WASTE", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "KEEP_WASTE_ATTACHED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - }, - { - "Name": "dMaxWasteLength", - "sNameNge": "MAX_WASTE_LENGTH", - "sValue": "300", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteVolume", - "sNameNge": "MAX_WASTE_VOLUME", - "sValue": "6000000", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dStripWidth", - "sNameNge": "STRIP_WIDTH", - "sValue": "5", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMinZAngleTopBlade", - "sNameNge": "MIN_Z_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxYAngleTopBlade", - "sNameNge": "MAX_Y_ANGLE_TOP_BLADE", - "sValue": "", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bFinishWithMill", - "sNameNge": "ALLOW_FINISH_MILL", - "sValue": "true", - "sDescriptionShort": "Clean blade radius with mill", - "sDescriptionLong": "Clean blade radius with mill", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMillingOffsetFromSide", - "sNameNge": "MILLING_OFFSET_SIDE", - "sValue": "1", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - } - ] - } -] \ No newline at end of file +{ + "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": "", + "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": "" + } + ] + }, + { + "sName": "sCuttingStrategy", + "sNameNge": "CUTTING_STRATEGY", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "DROP_WASTE", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "KEEP_WASTE_ATTACHED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + }, + { + "sName": "dMaxWasteLength", + "sNameNge": "MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteVolume", + "sNameNge": "MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dStripWidth", + "sNameNge": "STRIP_WIDTH", + "sValue": "5", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMinZAngleTopBlade", + "sNameNge": "MIN_Z_ANGLE_TOP_BLADE", + "sValue": "", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxYAngleTopBlade", + "sNameNge": "MAX_Y_ANGLE_TOP_BLADE", + "sValue": "", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bFinishWithMill", + "sNameNge": "ALLOW_FINISH_MILL", + "sValue": "true", + "sDescriptionShort": "Clean blade radius with mill", + "sDescriptionLong": "Clean blade radius with mill", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMillingOffsetFromSide", + "sNameNge": "MILLING_OFFSET_SIDE", + "sValue": "1", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0006/STR0006.lua b/Strategies/Standard/STR0006/STR0006.lua index 4e029b7..d047d13 100644 --- a/Strategies/Standard/STR0006/STR0006.lua +++ b/Strategies/Standard/STR0006/STR0006.lua @@ -160,7 +160,7 @@ end function STR0006.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0006\\STR0006Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machining = {} diff --git a/Strategies/Standard/STR0006/STR0006Config.json b/Strategies/Standard/STR0006/STR0006Config.json index c199759..874b8fc 100644 --- a/Strategies/Standard/STR0006/STR0006Config.json +++ b/Strategies/Standard/STR0006/STR0006Config.json @@ -1,90 +1,88 @@ -[ - { - "sStrategyId": "STR0006", - "Parameters" : [ - { - "Name": "dOverMatOnLength", - "sNameNge": "OVM_LENGTH", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dOverMatOnRadius", - "sNameNge": "OVM_RADIUS", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon width", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "nMaxMillingPaths", - "sNameNge": "MAX_PATHS", - "sValue": "3", - "sDescriptionShort": "Maximum number of milling passes", - "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteLength", - "sNameNge": "MAX_WASTE_LENGTH", - "sValue": "300", - "sDescriptionShort": "Maximum Waste Length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteVolume", - "sNameNge": "MAX_WASTE_VOLUME", - "sValue": "6000000", - "sDescriptionShort": "Maximum Waste Volume", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "sCuttingStrategy", - "sNameNge": "EXEC_TENON_SURF", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "BLADE_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "MILL_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "CHAINSAW_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0006", + "Parameters" : [ + { + "sName": "dOverMatOnLength", + "sNameNge": "OVM_LENGTH", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dOverMatOnRadius", + "sNameNge": "OVM_RADIUS", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon width", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "nMaxMillingPaths", + "sNameNge": "MAX_PATHS", + "sValue": "3", + "sDescriptionShort": "Maximum number of milling passes", + "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sNameNge": "MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "Maximum Waste Length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteVolume", + "sNameNge": "MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "Maximum Waste Volume", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "sCuttingStrategy", + "sNameNge": "EXEC_TENON_SURF", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BLADE_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "MILL_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "CHAINSAW_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0007/STR0007.lua b/Strategies/Standard/STR0007/STR0007.lua index 63b04ac..fbcd96e 100644 --- a/Strategies/Standard/STR0007/STR0007.lua +++ b/Strategies/Standard/STR0007/STR0007.lua @@ -303,7 +303,7 @@ end function STR0007.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0007\\STR0007Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machining = {} diff --git a/Strategies/Standard/STR0007/STR0007Config.json b/Strategies/Standard/STR0007/STR0007Config.json index 012c1d5..5342eb1 100644 --- a/Strategies/Standard/STR0007/STR0007Config.json +++ b/Strategies/Standard/STR0007/STR0007Config.json @@ -1,110 +1,108 @@ -[ - { - "sStrategyId": "STR0007", - "Parameters" : [ - { - "Name": "dOverMatOnLength", - "sNameNge": "OVM_LENGTH", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dOverMatOnRadius", - "sNameNge": "OVM_RADIUS", - "sValue": "0", - "sDescriptionShort": "Overmaterial on tenon width", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "nMaxMillingPaths", - "sNameNge": "MAX_PATHS", - "sValue": "3", - "sDescriptionShort": "Maximum number of milling passes", - "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bUseDTToolOnPocketing", - "sNameNge": "ALLOW_DT_POCKET", - "sValue": "true", - "sDescriptionShort": "Use DoveTail tool in case of pocketing", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bAntiSplint", - "sNameNge": "ANTI_SPLINT", - "sValue": "true", - "sDescriptionShort": "Add Anti-Splint", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteLength", - "sNameNge": "MAX_WASTE_LENGTH", - "sValue": "300", - "sDescriptionShort": "Maximum Waste Length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteVolume", - "sNameNge": "MAX_WASTE_VOLUME", - "sValue": "6000000", - "sDescriptionShort": "Maximum Waste Volume", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "sCuttingStrategy", - "sNameNge": "EXEC_CUT_SURF", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "BLADE_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "MILL_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "CHAINSAW_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0007", + "Parameters" : [ + { + "sName": "dOverMatOnLength", + "sNameNge": "OVM_LENGTH", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dOverMatOnRadius", + "sNameNge": "OVM_RADIUS", + "sValue": "0", + "sDescriptionShort": "Overmaterial on tenon width", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "nMaxMillingPaths", + "sNameNge": "MAX_PATHS", + "sValue": "3", + "sDescriptionShort": "Maximum number of milling passes", + "sDescriptionLong": "Maximum number of milling passes. If more passes are required, pocketing is performed", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bUseDTToolOnPocketing", + "sNameNge": "ALLOW_DT_POCKET", + "sValue": "true", + "sDescriptionShort": "Use DoveTail tool in case of pocketing", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bAntiSplint", + "sNameNge": "ANTI_SPLINT", + "sValue": "true", + "sDescriptionShort": "Add Anti-Splint", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sNameNge": "MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "Maximum Waste Length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteVolume", + "sNameNge": "MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "Maximum Waste Volume", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "sCuttingStrategy", + "sNameNge": "EXEC_CUT_SURF", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BLADE_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "MILL_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "CHAINSAW_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0008/STR0008.lua b/Strategies/Standard/STR0008/STR0008.lua index 38096b1..59eaff7 100644 --- a/Strategies/Standard/STR0008/STR0008.lua +++ b/Strategies/Standard/STR0008/STR0008.lua @@ -223,7 +223,7 @@ end function STR0008.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0008\\STR0008Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machining = {} diff --git a/Strategies/Standard/STR0008/STR0008Config.json b/Strategies/Standard/STR0008/STR0008Config.json index 7567115..41b5b80 100644 --- a/Strategies/Standard/STR0008/STR0008Config.json +++ b/Strategies/Standard/STR0008/STR0008Config.json @@ -1,80 +1,78 @@ -[ - { - "sStrategyId": "STR0008", - "Parameters" : [ - { - "Name": "dOverMatOnLength", - "sNameNge": "OVM_LENGTH", - "sValue": "0", - "sDescriptionShort": "Overmaterial on mortise length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dOverMatOnRadius", - "sNameNge": "OVM_RADIUS", - "sValue": "0", - "sDescriptionShort": "Overmaterial on mortise width", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteLength", - "sNameNge": "MAX_WASTE_LENGTH", - "sValue": "300", - "sDescriptionShort": "Maximum Waste Length", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dMaxWasteVolume", - "sNameNge": "MAX_WASTE_VOLUME", - "sValue": "6000000", - "sDescriptionShort": "Maximum Waste Volume", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "sCuttingStrategy", - "sNameNge": "EXEC_CUT_SURF", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "BLADE_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "MILL_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "CHAINSAW_FORCED", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0008", + "Parameters" : [ + { + "sName": "dOverMatOnLength", + "sNameNge": "OVM_LENGTH", + "sValue": "0", + "sDescriptionShort": "Overmaterial on mortise length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dOverMatOnRadius", + "sNameNge": "OVM_RADIUS", + "sValue": "0", + "sDescriptionShort": "Overmaterial on mortise width", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sNameNge": "MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "Maximum Waste Length", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteVolume", + "sNameNge": "MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "Maximum Waste Volume", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "sCuttingStrategy", + "sNameNge": "EXEC_CUT_SURF", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BLADE_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "MILL_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "CHAINSAW_FORCED", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/STR0009/STR0009.lua b/Strategies/Standard/STR0009/STR0009.lua index 233ef20..b850940 100644 --- a/Strategies/Standard/STR0009/STR0009.lua +++ b/Strategies/Standard/STR0009/STR0009.lua @@ -162,7 +162,7 @@ end function STR0009.Make( bAddMachining, Proc, Part, CustomParameters) -- carico parametri de default e li aggiorno con quelli passati dal chiamante (potrebbero non essere congruenti) local StrategyLib = {} - StrategyLib.Config = require( 'STR0009\\STR0009Config') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.Machinings = {} diff --git a/Strategies/Standard/STR0009/STR0009Config.json b/Strategies/Standard/STR0009/STR0009Config.json index 51ba70c..51894ca 100644 --- a/Strategies/Standard/STR0009/STR0009Config.json +++ b/Strategies/Standard/STR0009/STR0009Config.json @@ -1,78 +1,76 @@ -[ - { - "sStrategyId": "STR0009", - "Parameters" : [ - { - "Name": "dDepthChamfer", - "sNameNge": "DEPTH_CHAMFER", - "sValue": "0", - "sDescriptionShort": "Depth Chamfer", - "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dOverMaterial", - "sNameNge": "OVERMAT", - "sValue": "0", - "sDescriptionShort": "Overmaterial", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bForceStrip", - "sNameNge": "FORCE_STRIP", - "sValue": "false", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dStripWidth", - "sNameNge": "STRIP_WIDTH", - "sValue": "0", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "dExtendArc", - "sNameNge": "EXTEND_ARC", - "sValue": "0", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "sActivateDouble", - "sNameNge": "DOUBLE", - "sValue": "AUTO", - "sType": "combo", - "sMinUserLevel": "1", - "Choices": [ - { - "sValue": "AUTO", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - }, - { - "sValue": "NEVER", - "sDescriptionShort": "", - "sDescriptionLong": "", - "sMessageId": "" - } - ] - } - ] - } -] \ No newline at end of file +{ + "sStrategyId": "STR0009", + "Parameters" : [ + { + "sName": "dDepthChamfer", + "sNameNge": "DEPTH_CHAMFER", + "sValue": "0", + "sDescriptionShort": "Depth Chamfer", + "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dOverMaterial", + "sNameNge": "OVERMAT", + "sValue": "0", + "sDescriptionShort": "Overmaterial", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bForceStrip", + "sNameNge": "FORCE_STRIP", + "sValue": "false", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dStripWidth", + "sNameNge": "STRIP_WIDTH", + "sValue": "0", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "dExtendArc", + "sNameNge": "EXTEND_ARC", + "sValue": "0", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "sActivateDouble", + "sNameNge": "DOUBLE", + "sValue": "AUTO", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "AUTO", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "NEVER", + "sDescriptionShort": "", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/TAILCUT/TAILCUT.lua b/Strategies/Standard/TAILCUT/TAILCUT.lua index 555d8da..45bdb3a 100644 --- a/Strategies/Standard/TAILCUT/TAILCUT.lua +++ b/Strategies/Standard/TAILCUT/TAILCUT.lua @@ -23,7 +23,7 @@ end ------------------------------------------------------------------------------------------------------------- function TAILCUT.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} - StrategyLib.Config = require( 'TAILCUT\\TAILCUTConfig') + StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) Strategy.SplitStrategy = {} diff --git a/Strategies/Standard/TAILCUT/TAILCUTConfig.json b/Strategies/Standard/TAILCUT/TAILCUTConfig.json index 1065c5d..42a0f83 100644 --- a/Strategies/Standard/TAILCUT/TAILCUTConfig.json +++ b/Strategies/Standard/TAILCUT/TAILCUTConfig.json @@ -1,48 +1,45 @@ -[ - { - "sStrategyId": "TAILCUT", - "Parameters" : [ - { - "Name": "dDepthChamfer", - "sNameNge": "DEPTH_CHAMFER", - "sValue": "0", - "sDescriptionShort": "Depth Chamfer", - "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", - "sType": "d", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bForceChainSaw", - "sNameNge": "FORCE_CHAIN", - "sValue": "false", - "sDescriptionShort": "Force to use chain saw", - "sDescriptionLong": "Force to use chain saw", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bExecutePreCut", - "sNameNge": "EXEC_PRECUT", - "sValue": "true", - "sDescriptionShort": "Force to add PreCuts", - "sDescriptionLong": "Autocam will apply a machining on the theoric zero, to avoid collision if the theoric piece length doesn't correspond to the real length", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - }, - { - "Name": "bFinishWithMill", - "sNameNge": "MILL_FINISH", - "sValue": "true", - "sDescriptionShort": "Finish with mill", - "sDescriptionLong": "Use a mill to finish the surface if split with chain saw", - "sType": "b", - "sMessageId": " ", - "sMinUserLevel": "1" - } - ] - } -] - \ No newline at end of file +{ + "sStrategyId": "TAILCUT", + "Parameters" : [ + { + "sName": "dDepthChamfer", + "sNameNge": "DEPTH_CHAMFER", + "sValue": "0", + "sDescriptionShort": "Depth Chamfer", + "sDescriptionLong": "Depth of the V-Mill to execute chamfers on cut-edges", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bForceChainSaw", + "sNameNge": "FORCE_CHAIN", + "sValue": "false", + "sDescriptionShort": "Force to use chain saw", + "sDescriptionLong": "Force to use chain saw", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bExecutePreCut", + "sNameNge": "EXEC_PRECUT", + "sValue": "true", + "sDescriptionShort": "Force to add PreCuts", + "sDescriptionLong": "Autocam will apply a machining on the theoric zero, to avoid collision if the theoric piece length doesn't correspond to the real length", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + }, + { + "sName": "bFinishWithMill", + "sNameNge": "MILL_FINISH", + "sValue": "true", + "sDescriptionShort": "Finish with mill", + "sDescriptionLong": "Use a mill to finish the surface if split with chain saw", + "sType": "b", + "sMessageId": " ", + "sMinUserLevel": "1" + } + ] +} \ No newline at end of file