diff --git a/BatchProcessNew.lua b/BatchProcessNew.lua index a287c60..1d8b171 100644 --- a/BatchProcessNew.lua +++ b/BatchProcessNew.lua @@ -105,11 +105,8 @@ local dRawH local function GetDataConfig() -- recupero utensili dal magazzino BeamExec.GetToolsFromDB() - -- se si utilizza interfaccia B&W, si carica il file JSON - local bIsBeamWall = BEAM.BW - if bIsBeamWall then - BeamExec.GetStrategiesFromJSONinBD() - end + -- recupero parametri generali da progetto + BeamExec.GetGeneralParameters() -- TODO da gestire eventuali errori bloccanti return true end @@ -579,10 +576,16 @@ if bToProcess then PARTS[i].CombinationList = BeamExec.GetAvailableCombinations( PARTS[i], bCalcBestPieceUnloadPosition) PARTS[i].SplittingPoints = BeamLib.GetPartSplittingPoints( PARTS[i]) PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} + PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or nil + PARTS[i].GeneralParameters = {} + -- si carica configurazione lavorazioni + BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig) + -- TODO leggere qui i parametri generali pezzo? -- sovramateriale in testa al pezzo local dDeltaS = max( PARTS[i].dPosX - ( dBarLen - dLen), 0) PARTS[i].dHeadOverMaterial = dDeltaS + -- lunghezza grezzo (comprende sovramateriale di testa e mm tagliati in coda dalla lavorazione, tipicamente 5.4mm dello spessore lama) local dCrawLen = PARTS[i].dRawLength -- materiale tolto in coda dalla lavorazione di separazione diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index cec9362..70f3654 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -29,12 +29,13 @@ EgtMdbSave() -- *** variabili globali *** ------------------------------------------------------------------------------------------------------------- TOOLS = {} -- tabella contenente tutti gli utensili -STRATEGIES = nil -- tabella contenente le strategie disponibili per ogni feature +STRATEGIES = {} -- tabella contenente le strategie disponibili per ogni feature STRATEGIES_CONFIG = {} -- tabella contenente i parametri 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 RESULT = {} -- tabella contenente il risultato, feature per feature, dell'applicazione della strategia scelta e il resoconto dell'analisi fatta +GENERAL_PARAMETERS = {} -- tabella contenente i parametri generali ------------------------------------------------------------------------------------------------------------- -- *** COSTANTI *** TODO -> DA SPOSTARE IN BEAMDATA??? @@ -206,23 +207,38 @@ function BeamExec.GetToolsFromDB() end ------------------------------------------------------------------------------------------------------------- -function BeamExec.GetStrategiesFromJSONinBD() - -- si legge il JSON contenente la configurazione da utilizzare (nome del file salvato nel BeamData) - local sMachDir = EgtGetCurrMachineDir() - if BeamData.STRATEGIES_CONFIG_FILE then - local sFile = sMachDir .. '\\Beam\\AISetup\\' .. BeamData.STRATEGIES_CONFIG_FILE +function BeamExec.GetGeneralParameters() + local CompleteList = {} + local sFile = BEAM.BASEDIR .. '\\Strategies\\GeneralParameters.json' + -- se non esiste file JSON, esco subito + if not EgtExistsFile( sFile) then + return + end + + CompleteList = BeamLib.ImportFileJSON( sFile) + + GENERAL_PARAMETERS = BeamLib.LoadGeneralParametersInList( CompleteList) +end + +------------------------------------------------------------------------------------------------------------- +function BeamExec.GetStrategiesFromJSONinBD( sAISetupConfigName) + -- si legge il JSON contenente la configurazione da utilizzare solo se non è già stato importato + if sAISetupConfigName and not STRATEGIES[sAISetupConfigName] then + local sMachDir = EgtGetCurrMachineDir() + local sFile = sMachDir .. '\\Beam\\AISetup\\' .. sAISetupConfigName .. '.json' -- se non esiste file JSON, annullo la lista contenente le strategie if not EgtExistsFile( sFile) then - STRATEGIES = nil + STRATEGIES[sAISetupConfigName] = nil return end - + local FeatureList = {} FeatureList = BeamLib.ImportFileJSON( sFile) -- metto la tabella letta nella lista globale STRATEGIES - STRATEGIES = {} - STRATEGIES.FeatureList = FeatureList + STRATEGIES[sAISetupConfigName] = {} + STRATEGIES[sAISetupConfigName].FeatureList = FeatureList.FEATURE + STRATEGIES[sAISetupConfigName].sAISetupConfigName = sAISetupConfigName end end @@ -463,6 +479,11 @@ function BeamExec.ProcessBeams( dRawW, dRawH, dRawL, dOvmHead, dOvmMid, PARTS, b PARTS[i].SplittingPoints = BeamLib.GetPartSplittingPoints( PARTS[i]) PARTS[i].NotClampableLength = { STD = { dHead = 0, dTail = 0}, SIDE = { dHead = 0, dTail = 0}, DOWN = { dHead = 0, dTail = 0}} PARTS[i].dHeadOverMaterial = dDeltaS + PARTS[i].sAISetupConfig = EgtGetInfo( PARTS[i].id, 'AISETUP', 's') or nil + PARTS[i].GeneralParameters = {} + -- si carica configurazione lavorazioni + BeamExec.GetStrategiesFromJSONinBD( PARTS[i].sAISetupConfig) + -- TODO leggere qui i parametri generali pezzo? else local sOut = 'Error: part L(' .. EgtNumToString( dPartLen, 1) .. ') too big for raw part L(' .. EgtNumToString( dLen - 0.1, 1) .. ')' return false, sOut @@ -522,11 +543,11 @@ end ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- -local function GetStrategies( Proc) +local function GetStrategies( Proc, sAISetupConfigName) local AvailableStrategiesForProc = nil -- se la lista STRATEGIES è stata letta da JSON (quindi non è vuota), ritorno le strategie possibili - if STRATEGIES and #STRATEGIES.FeatureList > 0 then - AvailableStrategiesForProc = BeamLib.GetStrategiesFromList( Proc, STRATEGIES) + if STRATEGIES and sAISetupConfigName and STRATEGIES[sAISetupConfigName] and #STRATEGIES[sAISetupConfigName].FeatureList > 0 then + AvailableStrategiesForProc = BeamLib.GetStrategiesFromList( Proc, STRATEGIES[sAISetupConfigName]) 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 @@ -638,7 +659,7 @@ local function CollectFeatures( Part, dRotIndex) Proc.AvailableStrategies = vForcedStrategy -- altrimenti cerco tra le strategie disponibili else - Proc.AvailableStrategies = GetStrategies( Proc) + Proc.AvailableStrategies = GetStrategies( Proc, Part.sAISetupConfig) end -- se ci sono strategie disponibili, aggiungo a lista delle feature da lavorare if Proc.AvailableStrategies and #Proc.AvailableStrategies > 0 then diff --git a/LuaLibs/BeamLib.lua b/LuaLibs/BeamLib.lua index 0957578..340e656 100644 --- a/LuaLibs/BeamLib.lua +++ b/LuaLibs/BeamLib.lua @@ -458,14 +458,40 @@ function BeamLib.GetMaxNzDefault( vtNFace, Tool) return 0 end +-- TODO bisogna recuperare il nome del parametro NGE, perchè in questo caso è forzato +------------------------------------------------------------------------------------------------------------- +function BeamLib.GetPieceGeneralParameters( Part, sParameterName) + local sValue = nil + -- si caricano i parametri generali riferiti al pezzo + sValue = EgtGetInfo( Part.id, sParameterName, 's') + return sValue +end + +------------------------------------------------------------------------------------------------------------- +local function GetInheritedParameter( Part, sSourceParamName) + local sValue = nil + if sSourceParamName and #sSourceParamName > 0 then + -- se il parametro è già stato letto + if Part.GeneralParameters[sSourceParamName] then + sValue = Part.GeneralParameters[sSourceParamName] + -- altrimenti lo recupero + else + Part.GeneralParameters[sSourceParamName] = BeamLib.GetPieceGeneralParameters( Part, sSourceParamName) + sValue = Part.GeneralParameters[sSourceParamName] or + GENERAL_PARAMETERS.PIECE[sSourceParamName] or GENERAL_PARAMETERS.BTL[sSourceParamName] or GENERAL_PARAMETERS.PROJECT[sSourceParamName] or nil + end + end + return sValue +end + ------------------------------------------------------------------------------------------------------------- -- si traduce la tabella dei parametri con tutte le informazioni in una lista contenente i parametri utilizzabili con accesso diretto -function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, DefaultStrategyParamList) +function BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, DefaultStrategyParamList) local UpdatedParameters = {} -- TODO serve controllare se campo 'sStrategyId' congruente tra il Config (DefaultStrategyParamList) e i parametri custom (CustomParameters)? if DefaultStrategyParamList and DefaultStrategyParamList.ParameterList and #DefaultStrategyParamList.ParameterList > 0 then -- lettura e settaggio parametri finali per la strategia (customizzati o default) - for i=1, #DefaultStrategyParamList.ParameterList do + for i = 1, #DefaultStrategyParamList.ParameterList do local xParameterValue = nil -- se strategia forzata, leggo eventuali parametri nelle info if CustomParameters and CustomParameters.bForcedStrategy then @@ -477,7 +503,7 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default end -- altrimenti i parametri custom si trovano già su questa lista elseif CustomParameters and CustomParameters.ParameterList then - for j=1, #CustomParameters.ParameterList do + for j = 1, #CustomParameters.ParameterList do if CustomParameters.ParameterList[j].sName == DefaultStrategyParamList.ParameterList[i].sName or CustomParameters.ParameterList[j].sName == DefaultStrategyParamList.ParameterList[i].sNameNge then xParameterValue = CustomParameters.ParameterList[j].sValue @@ -488,7 +514,12 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default -- se non arriva forzato da strategia, oppure se non è stato configurato da cliente, si prende default if xParameterValue == nil then - xParameterValue = DefaultStrategyParamList.ParameterList[i].sValue + -- se il parametro strategia è da ereditare da un parametro globale + if DefaultStrategyParamList.ParameterList[i].sSource and #DefaultStrategyParamList.ParameterList[i].sSource > 0 then + xParameterValue = GetInheritedParameter( Part, DefaultStrategyParamList.ParameterList[i].sSource) + else + xParameterValue = DefaultStrategyParamList.ParameterList[i].sValue + end end if DefaultStrategyParamList.ParameterList[i].sType == 'b' then @@ -503,13 +534,92 @@ function BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, Default else --DefaultStrategyParamList[i].sType == 's' or DefaultStrategyParamList[i].sType == 'combo' UpdatedParameters[DefaultStrategyParamList.ParameterList[i].sName] = xParameterValue end - end end return UpdatedParameters end +------------------------------------------------------------------------------------------------------------- +-- si traduce la tabella dei parametri con tutte le informazioni in una lista contenente i parametri utilizzabili con accesso diretto +function BeamLib.LoadGeneralParametersInList( DefaultGeneralParamList) + local UpdatedParameters = { PROJECT = {}, BTL = {}, PIECE = {}} + -- aggiornamento parametri PROJECT + if DefaultGeneralParamList and DefaultGeneralParamList.PROJECT then + local idProjectInfo = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'ProjectInfo') or GDB_ID.NULL + for i = 1, #DefaultGeneralParamList.PROJECT do + local sParamNameNGE = DefaultGeneralParamList.PROJECT[i].sNameNge + local xParameterValue = EgtGetInfo( idProjectInfo, sParamNameNGE, 's') or DefaultGeneralParamList.PROJECT[i].sValue + -- salvataggio dato su lista con accesso diretto + if DefaultGeneralParamList.PROJECT[i].sType == 'b' then + UpdatedParameters.PROJECT[DefaultGeneralParamList.PROJECT[i].sName] = xParameterValue == 'true' or xParameterValue == '1' or xParameterValue == true + elseif DefaultGeneralParamList.PROJECT[i].sType == 'd' then + if #DefaultGeneralParamList.PROJECT[i].sValue > 0 then + UpdatedParameters.PROJECT[DefaultGeneralParamList.PROJECT[i].sName] = tonumber( xParameterValue) + -- stringa vuota equivale a non passare alcun valore (deciderà la strategia) + else + UpdatedParameters.PROJECT[DefaultGeneralParamList.PROJECT[i].sName] = nil + end + else --DefaultGeneralParamList[i].sType == 's' or DefaultGeneralParamList[i].sType == 'combo' + UpdatedParameters.PROJECT[DefaultGeneralParamList.PROJECT[i].sName] = xParameterValue + end + end + end + + -- TODO GESTIRE IL CASO IN CUI IN UN PROGETTO CI SIANO PIU' DI UN BTL + -- aggiornamento parametri BTL + if DefaultGeneralParamList and DefaultGeneralParamList.BTL then + local idBTLInfo = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL + for i = 1, #DefaultGeneralParamList.BTL do + if DefaultGeneralParamList.BTL[i].sType == 'inherited' then + UpdatedParameters.BTL[DefaultGeneralParamList.BTL[i].sName] = UpdatedParameters.PROJECT[DefaultGeneralParamList.BTL[i].sName] + else + local sParamNameNGE = DefaultGeneralParamList.BTL[i].sNameNge + + local xParameterValue = EgtGetInfo( idBTLInfo, sParamNameNGE, 's') or DefaultGeneralParamList.BTL[i].sValue + -- salvataggio dato su lista con accesso diretto + if DefaultGeneralParamList.BTL[i].sType == 'b' then + UpdatedParameters.BTL[DefaultGeneralParamList.BTL[i].sName] = xParameterValue == 'true' or xParameterValue == '1' or xParameterValue == true + elseif DefaultGeneralParamList.BTL[i].sType == 'd' then + if #DefaultGeneralParamList.BTL[i].sValue > 0 then + UpdatedParameters.BTL[DefaultGeneralParamList.BTL[i].sName] = tonumber( xParameterValue) + -- stringa vuota equivale a non passare alcun valore (deciderà la strategia) + else + UpdatedParameters.BTL[DefaultGeneralParamList.BTL[i].sName] = nil + end + else --DefaultGeneralParamList[i].sType == 's' or DefaultGeneralParamList[i].sType == 'combo' + UpdatedParameters.BTL[DefaultGeneralParamList.BTL[i].sName] = xParameterValue + end + end + end + end + + -- aggiornamento parametri PIECE (in questo momento si salva solo il default, poi lo si aggiorna pezzo per pezzo) + if DefaultGeneralParamList and DefaultGeneralParamList.PIECE then + for i = 1, #DefaultGeneralParamList.PIECE do + if DefaultGeneralParamList.PIECE[i].sType == 'inherited' then + UpdatedParameters.PIECE[DefaultGeneralParamList.PIECE[i].sName] = UpdatedParameters.BTL[DefaultGeneralParamList.PIECE[i].sName] or UpdatedParameters.PROJECT[DefaultGeneralParamList.PIECE[i].sName] + else + local xParameterValue = DefaultGeneralParamList.PIECE[i].sValue or nil + -- salvataggio dato su lista con accesso diretto + if DefaultGeneralParamList.PIECE[i].sType == 'b' then + UpdatedParameters.PIECE[DefaultGeneralParamList.PIECE[i].sName] = xParameterValue == 'true' or xParameterValue == '1' or xParameterValue == true + elseif DefaultGeneralParamList.PIECE[i].sType == 'd' then + if #DefaultGeneralParamList.PIECE[i].sValue > 0 then + UpdatedParameters.PIECE[DefaultGeneralParamList.PIECE[i].sName] = tonumber( xParameterValue) + -- stringa vuota equivale a non passare alcun valore (deciderà la strategia) + else + UpdatedParameters.PIECE[DefaultGeneralParamList.PIECE[i].sName] = nil + end + else --DefaultGeneralParamList[i].sType == 's' or DefaultGeneralParamList[i].sType == 'combo' + UpdatedParameters.PIECE[DefaultGeneralParamList.PIECE[i].sName] = xParameterValue + end + end + end + end + + return UpdatedParameters +end --------------------------------------------------------------------- function BeamLib.GetChainSawInitAngs( vtN, vtO, nInd) if BeamData.GetChainSawInitAngs then diff --git a/LuaLibs/MachiningLib.lua b/LuaLibs/MachiningLib.lua index fee9b88..0f44849 100644 --- a/LuaLibs/MachiningLib.lua +++ b/LuaLibs/MachiningLib.lua @@ -1386,6 +1386,8 @@ function MachiningLib.PrepareMachiningsForSorting( Part) end if MachiningCurrent.ptCenter:getX() > dNextSplitX - 10 * GEO.EPS_SMALL and MachiningCurrent.ptCenter:getX() < dPreviousSplitX + 10 * GEO.EPS_SMALL then MachiningCurrent.nPartSegment = j + else + MachiningCurrent.nPartSegment = -1 end end else diff --git a/Process.lua b/Process.lua index 79fad63..de88d5c 100644 --- a/Process.lua +++ b/Process.lua @@ -163,11 +163,8 @@ end local function GetDataConfig() -- recupero utensili dal magazzino 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 - BeamExec.GetStrategiesFromJSONinBD() - end + -- recupero parametri generali da progetto + BeamExec.GetGeneralParameters() -- TODO da gestire eventuali errori bloccanti return true end diff --git a/Strategies/GeneralParameters.json b/Strategies/GeneralParameters.json new file mode 100644 index 0000000..fcaf605 --- /dev/null +++ b/Strategies/GeneralParameters.json @@ -0,0 +1,147 @@ + +{ + "PROJECT" : [ + { + "nGroup": "1", + "sName": "GEN_sPiecesLoadingPosition", + "sNameNge": "GEN_PIECES_LOADING", + "sValue": "BTL_POSITION", + "sDescriptionShort": "Part loading position", + "sDescriptionLong": "", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "BTL_POSITION", + "sDescriptionShort": "Last piece position as BTL", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BEST_ROTATION", + "sDescriptionShort": "Allow piece rotations", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "BEST_POSITION", + "sDescriptionShort": "Allow piece rotation and inversion", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + }, + { + "nGroup": "1", + "sName": "GEN_sPieceRotation", + "sNameNge": "GEN_PIECE_ROTATION", + "sValue": "IF_NECESSARY", + "sDescriptionShort": "Part rotating acceptability", + "sDescriptionLong": "Acceptability of rotating the part between machining steps", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "NOT_ALLOWED", + "sDescriptionShort": "Rotation not allowed", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "IF_NECESSARY", + "sDescriptionShort": "Rotation allowed only if strictly necessary", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "MODERATE_IMPACT", + "sDescriptionShort": "Rotation acceptable with moderate impact", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "NO_CONSTRAINT", + "sDescriptionShort": "Rotation easily acceptable / no constraint", + "sDescriptionLong": "", + "sMessageId": "" + } + ] + }, + { + "nGroup": "1", + "sName": "GEN_sMachiningStrategy", + "sNameNge": "GEN_MACHINING_STRATEGY", + "sValue": "BALANCED", + "sDescriptionShort": "Machining Strategy", + "sDescriptionLong": "", + "sType": "combo", + "sMinUserLevel": "1", + "Choices": [ + { + "sValue": "BALANCED", + "sDescriptionShort": "Balanced", + "sDescriptionLong": "", + "sMessageId": "" + }, + { + "sValue": "FASTEST", + "sDescriptionShort": "Fastest", + "sDescriptionLong": "Prefer fastest strategies", + "sMessageId": "" + }, + { + "sValue": "HIGH_QUALITY", + "sDescriptionShort": "High quality", + "sDescriptionLong": "Prefer strategies with an high-quality", + "sMessageId": "" + } + ] + }, + { + "nGroup": "2", + "sName": "GEN_dMaxWasteLength", + "sNameNge": "GEN_MAX_WASTE_LENGTH", + "sValue": "300", + "sDescriptionShort": "Maximum Waste Length for Dice-cut", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "5" + }, + { + "nGroup": "2", + "sName": "GEN_dMaxWasteVolume", + "sNameNge": "GEN_MAX_WASTE_VOLUME", + "sValue": "6000000", + "sDescriptionShort": "Maximum Waste Volume for Dice-cut", + "sDescriptionLong": "", + "sType": "d", + "sMessageId": " ", + "sMinUserLevel": "5" + } + ], + "BTL" : [ + { + "sName": "GEN_sPieceRotation", + "sType": "inherited", + "sMinUserLevel": "1" + }, + { + "sName": "GEN_sMachiningStrategy", + "sType": "inherited", + "sMinUserLevel": "1" + } + ], + "PIECE" : [ + { + "sName": "GEN_sPieceRotation", + "sType": "inherited", + "sMinUserLevel": "1" + }, + { + "sName": "GEN_sMachiningStrategy", + "sType": "inherited", + "sMinUserLevel": "1" + } + ] +} \ No newline at end of file diff --git a/Strategies/Standard/HEADCUT/HEADCUT.json b/Strategies/Standard/HEADCUT/HEADCUT.json index 8ac0cd5..ba26a06 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.json +++ b/Strategies/Standard/HEADCUT/HEADCUT.json @@ -22,26 +22,6 @@ "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": "bReduceBladePath", "sNameNge": "REDUCE_BLADE_PATH", @@ -71,6 +51,16 @@ "sType": "b", "sMessageId": " ", "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sSource": "GEN_dMaxWasteLength", + "sMinUserLevel": "5" + }, + { + "sName": "dMaxWasteVolume", + "sSource": "GEN_dMaxWasteVolume", + "sMinUserLevel": "5" } ] } diff --git a/Strategies/Standard/HEADCUT/HEADCUT.lua b/Strategies/Standard/HEADCUT/HEADCUT.lua index b5b314c..70b41cd 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.lua +++ b/Strategies/Standard/HEADCUT/HEADCUT.lua @@ -27,7 +27,7 @@ function HEADCUT.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.SplitStrategy = {} Strategy.Result = {} Strategy.Machining = {} diff --git a/Strategies/Standard/STR0001/STR0001.json b/Strategies/Standard/STR0001/STR0001.json index b753b80..961d191 100644 --- a/Strategies/Standard/STR0001/STR0001.json +++ b/Strategies/Standard/STR0001/STR0001.json @@ -42,26 +42,6 @@ "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": "bReduceBladePath", "sNameNge": "REDUCE_BLADE_PATH", @@ -128,6 +108,16 @@ "sSubType": "MCH_TF.MILL", "sMessageId": " ", "sMinUserLevel": "1" + }, + { + "sName": "dMaxWasteLength", + "sSource": "GEN_dMaxWasteLength", + "sMinUserLevel": "5" + }, + { + "sName": "dMaxWasteVolume", + "sSource": "GEN_dMaxWasteVolume", + "sMinUserLevel": "5" } ] } \ No newline at end of file diff --git a/Strategies/Standard/STR0001/STR0001.lua b/Strategies/Standard/STR0001/STR0001.lua index 119472e..56e2f54 100644 --- a/Strategies/Standard/STR0001/STR0001.lua +++ b/Strategies/Standard/STR0001/STR0001.lua @@ -297,7 +297,7 @@ function STR0001.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = {} Strategy.Result = {} Strategy.Result.dTimeToMachine = 0 diff --git a/Strategies/Standard/STR0002/STR0002.lua b/Strategies/Standard/STR0002/STR0002.lua index b955df0..5c06932 100644 --- a/Strategies/Standard/STR0002/STR0002.lua +++ b/Strategies/Standard/STR0002/STR0002.lua @@ -486,7 +486,7 @@ function STR0002.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = {} Strategy.Result = {} Strategy.Result.dTimeToMachine = 0 diff --git a/Strategies/Standard/STR0003/STR0003.lua b/Strategies/Standard/STR0003/STR0003.lua index 134850b..b7f7afe 100644 --- a/Strategies/Standard/STR0003/STR0003.lua +++ b/Strategies/Standard/STR0003/STR0003.lua @@ -182,7 +182,7 @@ function STR0003.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Result = {} Strategy.Result.sInfo = '' Blade.Result = {} diff --git a/Strategies/Standard/STR0004/STR0004.lua b/Strategies/Standard/STR0004/STR0004.lua index eb7c6af..8deeec0 100644 --- a/Strategies/Standard/STR0004/STR0004.lua +++ b/Strategies/Standard/STR0004/STR0004.lua @@ -106,7 +106,7 @@ function STR0004.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Result = {} Strategy.Result.sInfo = '' Chainsaw.Result = {} diff --git a/Strategies/Standard/STR0005/STR0005.lua b/Strategies/Standard/STR0005/STR0005.lua index 35853ac..134d9ad 100644 --- a/Strategies/Standard/STR0005/STR0005.lua +++ b/Strategies/Standard/STR0005/STR0005.lua @@ -52,7 +52,7 @@ function STR0005.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Result = {} Strategy.Result.sInfo = '' Blade.Result = {} diff --git a/Strategies/Standard/STR0006/STR0006.lua b/Strategies/Standard/STR0006/STR0006.lua index 017540f..6225794 100644 --- a/Strategies/Standard/STR0006/STR0006.lua +++ b/Strategies/Standard/STR0006/STR0006.lua @@ -252,7 +252,7 @@ function STR0006.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = {} Strategy.Result = {} local Results = {} diff --git a/Strategies/Standard/STR0007/STR0007.lua b/Strategies/Standard/STR0007/STR0007.lua index ad8d50e..c1f01bd 100644 --- a/Strategies/Standard/STR0007/STR0007.lua +++ b/Strategies/Standard/STR0007/STR0007.lua @@ -326,7 +326,7 @@ function STR0007.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0008/STR0008.lua b/Strategies/Standard/STR0008/STR0008.lua index ccd0fe5..b666391 100644 --- a/Strategies/Standard/STR0008/STR0008.lua +++ b/Strategies/Standard/STR0008/STR0008.lua @@ -230,7 +230,7 @@ function STR0008.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0009/STR0009.lua b/Strategies/Standard/STR0009/STR0009.lua index af49681..1b88a17 100644 --- a/Strategies/Standard/STR0009/STR0009.lua +++ b/Strategies/Standard/STR0009/STR0009.lua @@ -168,7 +168,7 @@ function STR0009.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machinings = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0010/STR0010.lua b/Strategies/Standard/STR0010/STR0010.lua index f89a277..18a153e 100644 --- a/Strategies/Standard/STR0010/STR0010.lua +++ b/Strategies/Standard/STR0010/STR0010.lua @@ -168,7 +168,7 @@ function STR0010.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machinings = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0011/STR0011.lua b/Strategies/Standard/STR0011/STR0011.lua index df14470..1ccb65f 100644 --- a/Strategies/Standard/STR0011/STR0011.lua +++ b/Strategies/Standard/STR0011/STR0011.lua @@ -244,7 +244,7 @@ function STR0011.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machinings = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0012/STR0012.lua b/Strategies/Standard/STR0012/STR0012.lua index 1ae5b25..a349639 100644 --- a/Strategies/Standard/STR0012/STR0012.lua +++ b/Strategies/Standard/STR0012/STR0012.lua @@ -26,7 +26,7 @@ function STR0012.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Result = {} Strategy.Result.sInfo = '' RidgeLap.Result = {} diff --git a/Strategies/Standard/STR0013/STR0013.lua b/Strategies/Standard/STR0013/STR0013.lua index 37d9971..532669e 100644 --- a/Strategies/Standard/STR0013/STR0013.lua +++ b/Strategies/Standard/STR0013/STR0013.lua @@ -154,7 +154,7 @@ function STR0013.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machinings = {} Strategy.Result = {} diff --git a/Strategies/Standard/STR0014/STR0014.lua b/Strategies/Standard/STR0014/STR0014.lua index e50dcaf..00863c0 100644 --- a/Strategies/Standard/STR0014/STR0014.lua +++ b/Strategies/Standard/STR0014/STR0014.lua @@ -40,7 +40,7 @@ function STR0014.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Machining = MachiningLib.InitMachiningParameters( MCH_MY.MILLING) Strategy.Result = {} Strategy.Result.dTimeToMachine = 0 diff --git a/Strategies/Standard/STR0015/STR0015.lua b/Strategies/Standard/STR0015/STR0015.lua index 8bebfad..9521a68 100644 --- a/Strategies/Standard/STR0015/STR0015.lua +++ b/Strategies/Standard/STR0015/STR0015.lua @@ -690,7 +690,7 @@ function STR0015.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.Chamfer = {} Strategy.Chamfer.Machinings = {} Strategy.Chamfer.Result = {} diff --git a/Strategies/Standard/TAILCUT/TAILCUT.lua b/Strategies/Standard/TAILCUT/TAILCUT.lua index 72dcec3..61fc28f 100644 --- a/Strategies/Standard/TAILCUT/TAILCUT.lua +++ b/Strategies/Standard/TAILCUT/TAILCUT.lua @@ -27,7 +27,7 @@ function TAILCUT.Make( bAddMachining, Proc, Part, CustomParameters) local StrategyLib = {} StrategyLib.Config = STRATEGIES_CONFIG[CustomParameters.sStrategyId] Strategy.sName = StrategyLib.Config.sStrategyId - Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, CustomParameters, StrategyLib.Config) + Strategy.Parameters = BeamLib.LoadCustomParametersInStrategy( Proc, Part, CustomParameters, StrategyLib.Config) Strategy.SplitStrategy = {} Strategy.Result = {} Strategy.Machining = {}