diff --git a/LuaLibs/BeamExec.lua b/LuaLibs/BeamExec.lua index 1afb16c..37d9357 100644 --- a/LuaLibs/BeamExec.lua +++ b/LuaLibs/BeamExec.lua @@ -571,6 +571,24 @@ local function GetFeatureForcedStrategy( Proc) return nil end +------------------------------------------------------------------------------------------------------------- +local function AdjustPrcGrp( Proc, bPartIsInverted) + local nNewPrc = { nPrc = Proc.nPrc, nGrp = Proc.nGrp} + + -- se pezzo invertito + if bPartIsInverted then + -- il taglio di testa diventa taglio di coda + if ID.IsHeadCut( Proc) then + _, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsTailCut( Proc) + -- il taglio di coda diventa taglio di testa + elseif ID.IsTailCut( Proc) then + _, nNewPrc.nPrc, nNewPrc.nGrp = ID.IsHeadCut( Proc) + end + end + + return nNewPrc.nPrc, nNewPrc.nGrp +end + ------------------------------------------------------------------------------------------------------------- local function CollectFeatures( Part, dRotIndex) -- recupero le feature @@ -599,6 +617,8 @@ local function CollectFeatures( Part, dRotIndex) Proc.idFeature = EgtGetInfo( Proc.id, 'PRID', 's') or Proc.id Proc.nGrp = nGrp Proc.nPrc = nPrc + -- aggiorno info feature in caso di pezzo invertito + Proc.nPrc, Proc.nGrp = AdjustPrcGrp( Proc, dRotIndex > 4) Proc.nFlg = 1 Proc.nFct = EgtSurfTmFacetCount( ProcId) or 0 Proc.idCut = EgtGetInfo( EgtGetParent( EgtGetParent( ProcId)), 'CUTID', 'i') or 0 @@ -1581,16 +1601,18 @@ function BeamExec.ProcessMachinings( PARTS) -- salvo sul PART la posizione di partenza che รจ stata scelta PARTS[nPart].nInitialPosition = MatrixResult.nInitialPosition + local nOffsetIndex = EgtIf( PARTS[nPart].bPartIsInverted, 4, 0) -- aggiunge tagli testa e coda in fasi opportune local nRotHeadCut = MatrixResult.nInitialPosition + MACHININGS.Info.nHeadCutRotation - 1 if nRotHeadCut > 4 then nRotHeadCut = nRotHeadCut - 4 end + nRotHeadCut = nRotHeadCut + nOffsetIndex local nRotSplitCut = MatrixResult.nInitialPosition + MACHININGS.Info.nSplitCutRotation - 1 if nRotSplitCut > 4 then nRotSplitCut = nRotSplitCut - 4 end - + nRotSplitCut = nRotSplitCut + nOffsetIndex -- setto nella Proc l'indice rotazione nella quale deve essere lavorata PROCESSINGS[nPart].Rotation[nRotHeadCut][MatrixResult.nIndexHeadCutInVProc].nIndexRotation = nRotHeadCut PROCESSINGS[nPart].Rotation[nRotSplitCut][MatrixResult.nIndexTailCutInVProc].nIndexRotation = nRotSplitCut diff --git a/LuaLibs/Identity.lua b/LuaLibs/Identity.lua index e1f600f..508d819 100644 --- a/LuaLibs/Identity.lua +++ b/LuaLibs/Identity.lua @@ -10,12 +10,18 @@ local Identity = {} --------------------------------------------------------------------- -- Feature : Head Cut function Identity.IsHeadCut( Proc) - return ( Proc.nGrp == 1 and Proc.nPrc == 340) + local bIdentity = ( Proc.nGrp == 1 and Proc.nPrc == 340) + local idPrc = 340 + local idGrp = 1 + return bIdentity, idPrc, idGrp end --------------------------------------------------------------------- -- Feature : Tail Cut function Identity.IsTailCut( Proc) - return ( Proc.nGrp == 2 and Proc.nPrc == 350) + local bIdentity = ( Proc.nGrp == 2 and Proc.nPrc == 350) + local idPrc = 350 + local idGrp = 2 + return bIdentity, idPrc, idGrp end --------------------------------------------------------------------- diff --git a/Strategies/Standard/HEADCUT/HEADCUT.lua b/Strategies/Standard/HEADCUT/HEADCUT.lua index a7ad22b..f0e5802 100644 --- a/Strategies/Standard/HEADCUT/HEADCUT.lua +++ b/Strategies/Standard/HEADCUT/HEADCUT.lua @@ -227,6 +227,10 @@ function HEADCUT.Make( bAddMachining, Proc, Part, CustomParameters) Strategy.SplitStrategy = GetSplitStrategy( Proc, Part) if bAddMachining then + + -- forzo nome feature, potrebbe essere stata invertita con taglio di coda + EgtSetName( Proc.id, 'StartCut') + -- inserimento smussi su spigoli del taglio if Strategy.Parameters.bMakeChamfer then MakeChamfer() diff --git a/Strategies/Standard/TAILCUT/TAILCUT.lua b/Strategies/Standard/TAILCUT/TAILCUT.lua index 5901050..b00c7f7 100644 --- a/Strategies/Standard/TAILCUT/TAILCUT.lua +++ b/Strategies/Standard/TAILCUT/TAILCUT.lua @@ -59,6 +59,9 @@ function TAILCUT.Make( bAddMachining, Proc, Part, CustomParameters) -- se devo applicare le lavorazioni if bAddMachining then + -- forzo nome feature, potrebbe essere stata invertita con taglio di coda + EgtSetName( Proc.id, 'EndCut') + -- inserimento smussi su spigoli del taglio if Strategy.Parameters.bMakeChamfer then MakeChamfer()