- Tolto funzioni per chiodature in doppio

- Anche se ci viene passata origine 1, si considera come fosse la 3
This commit is contained in:
andrea.villa
2026-04-07 11:43:46 +02:00
parent 5734560db2
commit bd7c69ac0a
2 changed files with 3 additions and 87 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ require( 'EmtGenerator')
EgtEnableDebug( false) EgtEnableDebug( false)
if not EmtModifyHeadAuxDirection then error( 'A newer version of the program is required (minimum 2.3j5)') end if not EmtModifyHeadAuxDirection then error( 'A newer version of the program is required (minimum 2.3j5)') end
PP_VER = '3.1d1_DEV6' PP_VER = '3.1d1_DEV7'
PP_NVER = '2.7.4.1' PP_NVER = '2.7.4.1'
-- Parametri macchina -- Parametri macchina
+2 -86
View File
@@ -63,9 +63,9 @@ end
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetOrigCorner( RefPos) local function GetOrigCorner( RefPos)
if RefPos == 1 then if RefPos == 1 then
return 'BR' return 'BL'
elseif RefPos == 2 then elseif RefPos == 2 then
return 'TR' return 'TL'
elseif RefPos == 3 then elseif RefPos == 3 then
return 'BL' return 'BL'
elseif RefPos == 4 then elseif RefPos == 4 then
@@ -76,90 +76,6 @@ local function GetOrigCorner( RefPos)
end end
WallData.GetOrigCorner = GetOrigCorner WallData.GetOrigCorner = GetOrigCorner
-------------------------------------------------------------------------------------------------------------
local function VerifyFeatureForDouble( Proc)
-- deve essere attiva
if Proc.Flg == 0 then return 0 end
-- non deve essere già associata
if Proc.Double then return 0 end
-- deve essere contorno libero
if not ( ( Proc.Grp == 0 or Proc.Grp == 3 or Proc.Grp == 4) and ( Proc.Prc == 250)) then return 0 end
-- non deve essere una svuotatura
if EgtGetInfo( Proc.Id, 'PCKT', 'i') == 1 then return 0 end
-- deve richiedere utensili opportuni
local nTool = EgtGetInfo( Proc.Id, 'CNT_DATA', 'i')
if nTool ~= 12 and nTool ~= 14 then return 0 end
-- deve avere una curva ausiliaria associata
local AuxId = EgtGetInfo( Proc.Id, 'AUXID', 'i')
if not AuxId then return 0 end
AuxId = AuxId + Proc.Id
-- questa curva deve essere una retta orientata come gli assi X o Y
if Proc.Box:getDimY() > 1 and Proc.Box:getDimX() > 1 then return 0 end
local ptS = EgtSP( AuxId, GDB_ID.ROOT)
local ptE = EgtEP( AuxId, GDB_ID.ROOT)
-- va bene se diretta come l'asse X
if abs( ptS:getY() - ptE:getY()) < 1 then
if ptS:getX() <ptE:getX() then
return 1, ptS, ptE
else
return 1, ptE, ptS
end
end
-- va bene se diretta come l'asse Y
if abs( ptS:getX() - ptE:getX()) < 1 then
return 2, ptS, ptE
end
-- non va bene
return 0
end
-------------------------------------------------------------------------------------------------------------
local function FindFeaturesInDouble( vProc, b3Raw)
if not WallData.T14_T12_DOUBLE then return end
local MIN_INTERAX = 1350
local MIN_EXTRA_Y = 400
for i = 1, #vProc do
local Proc = vProc[i]
local nType, ptS, ptE = VerifyFeatureForDouble( Proc)
-- se linea lungo X
if nType == 1 then
for j = i + 1, #vProc do
local OtherProc = vProc[j]
local nOtherType, ptOtherS, ptOtherE = VerifyFeatureForDouble( OtherProc)
if nOtherType == 1 and abs( ptS:getX() - ptOtherS:getX()) < 1 and abs( ptE:getX() - ptOtherE:getX()) < 1 then
-- verifico l'interasse come distanza tra i due inizi
local dDeltaY = ptS:getY() - ptOtherS:getY()
if dDeltaY >= MIN_INTERAX then
Proc.Double = 1
Proc.Delta = dDeltaY
EgtSetInfo( Proc.Id, 'CNT_DATA', '14')
OtherProc.Flg = 0
OtherProc.Double = -1
break
elseif dDeltaY <= -MIN_INTERAX then
OtherProc.Double = 1
OtherProc.Delta = -dDeltaY
EgtSetInfo( OtherProc.Id, 'CNT_DATA', '14')
Proc.Flg = 0
Proc.Double = -1
break
end
end
end
-- se altrimenti linea lungo Y
elseif nType == 2 then
local dLen = ptS:getY() - ptE:getY()
if abs( dLen) >= MIN_INTERAX + MIN_EXTRA_Y then
Proc.Double = 2
Proc.Delta = max( abs( dLen) / 2, MIN_INTERAX) * EgtIf( dLen > 0, 1, -1)
Proc.DblAcc = abs( dLen) - abs( Proc.Delta)
EgtSetInfo( Proc.Id, 'CNT_DATA', '14')
end
end
end
end
WallData.FindFeaturesInDouble = FindFeaturesInDouble
------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------
local function GetSawHeadSide( dSpeed, sHead) local function GetSawHeadSide( dSpeed, sHead)
if sHead == 'H2' then if sHead == 'H2' then