diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index ecb6445..e1783e4 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -926,21 +926,70 @@ end ------------------------------------------------------------------------------------------------------------- -- funzione che controlla validità delle combinazioni proposte local function IsCombinationAvailable( sCombination, nUnloadPos) - -- TODO : DA COMPLETARE CON LE POSSIBILI TIPOLOGIA DI SCELTA ROTAZIONE - local ExtraRotation = EgtIf( nUnloadPos + 3 > 4, nUnloadPos + 3 - 4, nUnloadPos + 3) - - -- NON VALIDA SE : rotazione di partenza non attiva o se attiva la 3 rotazione(non gestita attualmente) - if string.sub( sCombination, nUnloadPos, nUnloadPos) ~= '1' or string.sub( sCombination, ExtraRotation, ExtraRotation) == '1' then - return false + -- BASIC : posizione di scarico come posizionamento iniziale + if not BEAM.BeamWall or BEAM.Rotation.Basic then + nUnloadPos = 1 + local ExtraRotation = nUnloadPos + 3 + if string.sub( sCombination, nUnloadPos, nUnloadPos) == '1' and string.sub( sCombination, ExtraRotation, ExtraRotation) == '0' then + if not BeamData.ROT90 and string.sub( sCombination, nUnloadPos+1, nUnloadPos+1) == '1' then + return false + elseif not BeamData.ROT180 and string.sub( sCombination, nUnloadPos+2, nUnloadPos+2) == '1' then + return false + else + return true + end + else + return false + end + -- NO ROTATION : solo posizione di partenza + elseif BEAM.Rotation.bNoRotation then + if sCombination == '1000' then + return true + else + return false + end + -- STANDARD : come BASIC ma ammesse anche le prerotazioni (posizione di scarico può essere diversa da posizione iniziale) + elseif BEAM.Rotation.Standard then + local ExtraRotation = EgtIf( nUnloadPos + 3 > 4, nUnloadPos + 3 - 4, nUnloadPos + 3) + if nUnloadPos == 2 or nUnloadPos == 4 then + return false + elseif string.sub( sCombination, nUnloadPos, nUnloadPos) == '1' and string.sub( sCombination, ExtraRotation, ExtraRotation) == '0' then + if not BeamData.ROT90 and string.sub( sCombination, nUnloadPos+1, nUnloadPos+1) == '1' then + return false + elseif not BeamData.ROT180 and string.sub( sCombination, nUnloadPos+2, nUnloadPos+2) == '1' then + return false + else + return true + end + else + return false + end + -- FULL COMBI : ammesso anche rotazione finale diversa da quella di partenza + elseif BEAM.Rotation.FullCombi then + local ExtraRotation = EgtIf( nUnloadPos + 3 > 4, nUnloadPos + 3 - 4, nUnloadPos + 3) + if string.sub( sCombination, nUnloadPos, nUnloadPos) ~= '1' or string.sub( sCombination, ExtraRotation, ExtraRotation) == '1' then + return false + else + if not BeamData.ROT90 and string.sub( sCombination, nUnloadPos+1, nUnloadPos+1) == '1' then + return false + elseif not BeamData.ROT180 and string.sub( sCombination, nUnloadPos+2, nUnloadPos+2) == '1' then + return false + else + return true + end + end else - return true + -- forzo comportamento BASIC + BEAM.Rotation.Basic = true + return IsCombinationAvailable( sCombination, nUnloadPos) end end ------------------------------------------------------------------------------------------------------------- -- funzione che decide le combinazioni di rotazione per lavorare la trave local function GetBestCombination( ListToCompare) - -- TODO scellta combinazione da fare!!! + -- TODO da sistemare. Verificare i parametri come vengono passati + local ChosenCombination = ListToCompare[1] return ChosenCombination @@ -1269,6 +1318,7 @@ function BeamExec.ProcessMachinings( PROCESSINGS, PARTS) -- Aggiornamento finale di tutto EgtSetCurrPhase( 1) local bApplOk, sApplErrors, sApplWarns = EgtApplyAllMachinings() + -- TODO a cosa serve questo ricalcolo? Con nuovo sistema si può eliminare? -- eventuale ricalcolo per macchine tipo PF (ma tengo warning del primo calcolo) if EgtExistsInfo( EgtGetCurrMachGroup(), 'RECALC') then EgtOutLog( ' **** RECALC ****')