diff --git a/Common_FAST.mlpe b/Common_FAST.mlpe index 888888c..2b2d05e 100644 --- a/Common_FAST.mlpe +++ b/Common_FAST.mlpe @@ -515,6 +515,16 @@ function OnSimulToolSelect( dPosA) -- se aggregato per fresa tipo blockhaus elseif EMT.HEAD == 'H7' then EgtSetAxisPos( 'C', EgtIf( BD.RIGHT_LOAD, 180, 0)) + -- se aggregato flottante + elseif EMT.HEAD == 'H8' then + local dFloating = EgtGetValInNotes( EMT.USERNOTES, 'DIST_FLOATING', d) + -- local CustomAggreFloatOffs = 0 + -- local vtAggreMove = Vector3d( 0, 0, CustomAggreFloatOffs - 220) + -- EgtMove( EgtGetFirstNameInGroup( H8Id, 'MOVE'), vtAggreMove, GDB_RT.GLOB) + -- EgtMove( EgtGetFirstNameInGroup( H8Id, 'COLLISION'), vtAggreMove, GDB_RT.GLOB) + -- local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT)) + -- EgtMove( ExitId, vtMove) + end -- se punta lunga if EMT.TOTLEN > LONG_TOOL_MINLEN then @@ -649,6 +659,38 @@ function OnSimulMachiningStart() OnSimulToolSelect( dPosA) end end + +------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------ + -- TODO DA FARE!!!!! + -- PROBLEMI DA RISOLVERE: + -- 1 - Si spostano le geometrie ma non la lavorazione sul VMILL + -- 2 - ad oigni esecuzione, si sposta sempre. Bisogna ripristinare il precarico alla fine della lavorazione + -- 3 - La compensazione viene fatta quando l'utensile viene preso, ma dipende se preso da magazzino 1 o 2, altrimenti è al contrario + -- aggregato flottante + if EMT.HEAD == 'H8' then + if EMT.OFFSL then + EMT.PREV_OFFSL = EMT.OFFSL + end + EMT.OFFSL = - EgtGetMachiningParam( MCH_MP.OFFSL) + + -- si verifica se ci sono entità flottanti nel ToolHolder + local FloatEntities = {} + local nIdObj = EgtGetFirstNameInGroup( EgtGetFirstNameInGroup( EgtGetHeadId( EMT.HEAD), 'T1'), EMT.TOOL) + local nIdTool = EgtGetFirstNameInGroup( nIdObj, 'Tool_C') + FloatEntities = EgtGetInfoInGroup( nIdObj, 'Float') + if FloatEntities then + local vtMove = Vector3d( - ( EMT.OFFSL - ( EMT.PREV_OFFSL or 0)), 0, 0) + EgtMove( nIdTool, vtMove, GDB_RT.GLOB) + -- le entità flottanti vengono spostate alla giusta posizione + for i = 1, #FloatEntities do + EgtMove( FloatEntities[i], vtMove, GDB_RT.GLOB) + end + end + end +------------------------------------------------------------------------------------------------------------------ +------------------------------------------------------------------------------------------------------------------ + -- recupero alcuni dati della lavorazione EMT.MCHNAME = EgtGetOperationName( EMT.MCHID) EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE) diff --git a/Essetre-FAST.ini b/Essetre-FAST.ini index 7e15b82..664fa5e 100644 --- a/Essetre-FAST.ini +++ b/Essetre-FAST.ini @@ -60,6 +60,7 @@ H5.2=AngTransm.nge H6.1=AngTransm.nge H6.2=AngTransm.nge H7.1=AngTransmBH.nge +H8.1=FloatingAggregate.nge [Machinings] Drilling=1 @@ -93,6 +94,8 @@ H5=6603 H6=6603 ; Angular transmission H7=6617 +; Floating Aggregate +H8=6619 [SetUp] Default=Standard diff --git a/Essetre-FAST.mlde b/Essetre-FAST.mlde index 54fea5e..5784e30 100644 --- a/Essetre-FAST.mlde +++ b/Essetre-FAST.mlde @@ -90,7 +90,9 @@ BeamHeightForFixRot = 9999 -- per abilitare assegnare 500 CoeffVM = 0.5 NewTopC = true SafeXRotAxes = 150 -AggreBlockHaus = false +AggreBlockHaus = true +SecondToolChanger = true +FloatingAggregate = true -- leggo e aggiorno con parametri da BeamData if BD then @@ -159,13 +161,15 @@ if EgtExistsFile( sData) then if Machine.Offsets.MIN_JOIN_LL then MinJoinLL = Machine.Offsets.MIN_JOIN_LL end if Machine.Offsets.NEWTOPC then NewTopC = ( Machine.Offsets.NEWTOPC == 1) end if Machine.Offsets.AGGRE_BH then AggreBlockHaus = ( Machine.Offsets.AGGRE_BH == 1) end + if Machine.Offsets.SEC_TC then SecondToolChanger = ( Machine.Offsets.SEC_TC == 1) end end end end if SpecialBH then SecondSupport = 0 end --- TODO da rimuovere -AggreBlockHaus = true +-- compongo i gruppi appartenenti alla base +local sBaseAux = {'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'} +if SecondToolChanger then table.insert( sBaseAux, 5, 'BASE/TC2') end EmtGeneral { File='Essetre-FAST.nge', @@ -180,7 +184,8 @@ EmtGeneral { local BaseId = EmtBase { Name = 'Base', Geo='BASE/GEO', - Aux={'BASE/SOLID', 'BASE/TC', 'BASE/SIGN', 'BASE/COLLISION'}} + Aux = sBaseAux} + local XId = EmtAxis { Name = 'X', Parent = 'Base', @@ -340,6 +345,22 @@ if AggreBlockHaus then Geo = 'H7_HEAD/GEO', Aux = {'H7_HEAD/SOLID', 'H7_HEAD/COLLISION'}} end +-- Esistenza aggregato flottante +local H8Id +if FloatingAggregate then + H8Id = EmtHead { + Name = 'H8', + Parent = 'B', + HSet = 'H1', + Type = MCH_HT.STD, + Pos = Point3d( 0, 0, 0), + TDir = Z_AX(), + ADir = X_AX(), + Rot1W = 0.2, + OthColl = {'H2', 'B/SOLID', 'C/SOLID'}, + Geo = 'H8_HEAD/GEO'} +end + -- Morse local YId = EmtAxis { Name = 'Y', @@ -470,22 +491,83 @@ EmtTcPos { TDir = -X_AX(), ADir = -Y_AX(), Geo = 'BASE/T10'} -EmtTcPos { - Name = 'T11', - Parent = 'Base', - Pos = Point3d( 523.8, 88.0, -877.5), - TDir = -X_AX(), - ADir = -Y_AX(), - Geo = 'BASE/T11'} -if not SpecialBH then - EmtTcPos { - Name = 'T101', +if AggreBlockHaus then + local TcpSsId = EmtTcPos { + Name = 'T11', Parent = 'Base', - Pos = Point3d( -510.4, 113.2, -160.8), - TDir = X_AX(), - ADir = Z_AX(), - Geo = 'BASE/T101'} + Pos = Point3d( 678.3, -1.963, -877.5), + TDir = Y_AX(), + ADir = -X_AX(), + Geo = 'BASE/T121', + Aux = 'BASE/T121_HS'} else + EmtTcPos { + Name = 'T11', + Parent = 'Base', + Pos = Point3d( 523.8, 88.0, -877.5), + TDir = -X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T11'} +end + +-- ToolChanger 2 +if SecondToolChanger then + EmtTcPos { + Name = 'T21', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, 172.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T21'} + EmtTcPos { + Name = 'T22', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, 67.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T22'} + EmtTcPos { + Name = 'T23', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -37.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T23'} + EmtTcPos { + Name = 'T24', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -142.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T24'} + EmtTcPos { + Name = 'T25', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -247.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T25'} + EmtTcPos { + Name = 'T26', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -352.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T26'} + EmtTcPos { + Name = 'T27', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -457.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T27'} + EmtTcPos { + Name = 'T28', + Parent = 'Base', + Pos = Point3d( -503.2, 88.0, -562.5), + TDir = X_AX(), + ADir = -Y_AX(), + Geo = 'BASE/T28'} EmtTcPos { Name = 'T101', Parent = 'Base', @@ -493,59 +575,66 @@ else TDir = X_AX(), ADir = Z_AX(), Geo = 'BASE/T101S'} -end -if SecondSupport == 1 then - -- supporto per punta - EmtTcPos { - Name = 'T111', - Parent = 'Base', - Pos = Point3d( -510.4, 113.2, -329.8), - TDir = Z_AX(), - ADir = X_AX(), - Geo = 'BASE/T111'} -elseif SecondSupport == 2 then - -- supporto per mortasatrice - local TcpSsId = EmtTcPos { - Name = 'T111', - Parent = 'Base', - Pos = Point3d( -510.4, 113.2, -430.8), - TDir = X_AX(), - ADir = Z_AX(), - Geo = 'BASE/T111M'} - EgtSetInfo( TcpSsId, 'Mortiser', true) -elseif SecondSupport == 3 then - -- supporto per rinvio angolare - local TcpSsId = EmtTcPos { - Name = 'T91', - Parent = 'Base', - ExitNbr = 2, - Pos1 = Point3d( -710.4-150, 113.2, -329.8-170), - TDir1 = X_AX(), - Pos2 = Point3d( -710.4+150, 113.2, -329.8-170), - TDir2 = -X_AX(), - ADir = Z_AX(), - Geo = 'BASE/T91', - Aux = 'BASE/T91_HS'} -end -if SpecialBH then - EmtTcPos { - Name = 'T111', - Parent = 'Base', - Pos = Point3d( -810.4, 113.2, -329.8), - TDir = Y_AX(), - ADir = X_AX(), - Geo = 'BASE/T111S'} -end - -if AggreBlockHaus then - local TcpSsId = EmtTcPos { - Name = 'T121', - Parent = 'Base', - Pos = Point3d( 678.3, -1.963, -877.5), - TDir = Y_AX(), - ADir = -X_AX(), - Geo = 'BASE/T121', - Aux = 'BASE/T121_HS'} +else + if not SpecialBH then + EmtTcPos { + Name = 'T101', + Parent = 'Base', + Pos = Point3d( -510.4, 113.2, -160.8), + TDir = X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T101'} + else + EmtTcPos { + Name = 'T101', + Parent = 'Base', + Pos = Point3d( -510.4, 113.2, -1160.8), + TDir = X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T101S'} + end + if SecondSupport == 1 then + -- supporto per punta + EmtTcPos { + Name = 'T111', + Parent = 'Base', + Pos = Point3d( -510.4, 113.2, -329.8), + TDir = Z_AX(), + ADir = X_AX(), + Geo = 'BASE/T111'} + elseif SecondSupport == 2 then + -- supporto per mortasatrice + local TcpSsId = EmtTcPos { + Name = 'T111', + Parent = 'Base', + Pos = Point3d( -510.4, 113.2, -430.8), + TDir = X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T111M'} + EgtSetInfo( TcpSsId, 'Mortiser', true) + elseif SecondSupport == 3 then + -- supporto per rinvio angolare + local TcpSsId = EmtTcPos { + Name = 'T91', + Parent = 'Base', + ExitNbr = 2, + Pos1 = Point3d( -710.4-150, 113.2, -329.8-170), + TDir1 = X_AX(), + Pos2 = Point3d( -710.4+150, 113.2, -329.8-170), + TDir2 = -X_AX(), + ADir = Z_AX(), + Geo = 'BASE/T91', + Aux = 'BASE/T91_HS'} + end + if SpecialBH then + EmtTcPos { + Name = 'T111', + Parent = 'Base', + Pos = Point3d( -810.4, 113.2, -329.8), + TDir = Y_AX(), + ADir = X_AX(), + Geo = 'BASE/T111S'} + end end -- Aggiusto posizioni geometriche @@ -590,6 +679,9 @@ function OnSetHead() local ExitId = EgtGetFirstNameInGroup( EgtGetHeadId( EMC.HEAD), 'T'..tostring( EMC.EXIT)) EgtMove( ExitId, vtMove) end + -- aggregato flottante + elseif EMC.HEAD == 'H8' then + ; -- non si fa nulla end end end @@ -598,7 +690,7 @@ end -- Funzione per impostare spia stato morsa carrello Y function SetPYLight( bClosed) if not PYLightId then return end - EgtSetColor( PYLightId, EgtIf( bClosed, 'RED', 'LIME')) + EgtSetColor( PYLightId, EgtIf( bClosed, 'RED', 'LIME')) if bClosed then EgtSetInfo( PYLightId, 'On', '1') else diff --git a/Essetre-FAST.nge b/Essetre-FAST.nge index 347d323..53f4e6b 100644 Binary files a/Essetre-FAST.nge and b/Essetre-FAST.nge differ diff --git a/Essetre-FAST_Con testa H8.nge b/Essetre-FAST_Con testa H8.nge new file mode 100644 index 0000000..6a95bde Binary files /dev/null and b/Essetre-FAST_Con testa H8.nge differ diff --git a/Scripts/SetUp.lua b/Scripts/SetUp.lua index dde2731..6199abf 100644 --- a/Scripts/SetUp.lua +++ b/Scripts/SetUp.lua @@ -24,9 +24,7 @@ local INVALIDPOS = "" local POS = "Pos" -- Geom Set -local GS = {} - -local bAggreBlockHaus = ( EgtGetHeadId( 'H7') ~= nil) +local GS = {{"H1", "H7", "H8"}} -- Configurazione posizioni local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"}, @@ -39,23 +37,37 @@ local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"}, {Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G1"}, {Pos = "Pos9", TcPos = "T9", Head = "H1", Group = "G1"}, {Pos = "Pos10", TcPos = "T10", Head = "H1", Group = "G1"}, - {Pos = "Pos11", TcPos = EgtIf( bAggreBlockHaus, "T121", "T11"), Head = EgtIf( bAggreBlockHaus, "H7", "H1"), Group = "G1"}, + {Pos = "Pos11", TcPos = "T11", Head = "H1", Group = "G1"}, {Pos = "Pos12", TcPos = "T42", Head = "H2", Group = "G1"}, {Pos = "Pos13", TcPos = "T101", Head = "H3", Group = "G2"}} -local SecSuppId = EgtGetTcPosId( 'T111') -if SecSuppId then - local bMortiser = EgtGetInfo( SecSuppId, 'Mortiser', 'b') - if bMortiser then - table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H3", Group = "G2"}) - else - table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G2"}) + +local IsTC2Active = ( EgtGetFirstNameInGroup( EgtGetBaseId( 'Base'), 'TC2') ~= nil) +if IsTC2Active then + local PositionTableTC2={{Pos = "Pos14", TcPos = "T21", Head = "H1", Group = "G3"}, + {Pos = "Pos15", TcPos = "T22", Head = "H1", Group = "G3"}, + {Pos = "Pos16", TcPos = "T23", Head = "H1", Group = "G3"}, + {Pos = "Pos17", TcPos = "T24", Head = "H1", Group = "G3"}, + {Pos = "Pos18", TcPos = "T25", Head = "H1", Group = "G3"}, + {Pos = "Pos19", TcPos = "T26", Head = "H1", Group = "G3"}, + {Pos = "Pos20", TcPos = "T27", Head = "H1", Group = "G3"}, + {Pos = "Pos21", TcPos = "T28", Head = "H1", Group = "G3"}} + EgtJoinTables( PositionTable, PositionTableTC2) +else + local SecSuppId = EgtGetTcPosId( 'T111') + if SecSuppId then + local bMortiser = EgtGetInfo( SecSuppId, 'Mortiser', 'b') + if bMortiser then + table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H3", Group = "G2"}) + else + table.insert( PositionTable, {Pos = "Pos14", TcPos = "T111", Head = "H1", Group = "G2"}) + end + end + if EgtGetHeadId( 'H5') then + table.insert( PositionTable, {Pos = "Pos14", TcPos = "T91", Head = "H5", Group = "G2"}) end end -if EgtGetHeadId( 'H5') then - table.insert( PositionTable, {Pos = "Pos14", TcPos = "T91", Head = "H5", Group = "G2"}) -end -local UsePositionHead = true +local UsePositionHead = false local function IsInGeomSet( ToolHead, PosHead) for GsIndex = 1, #GS do diff --git a/THolders/FloatingAggregate.nge b/THolders/FloatingAggregate.nge new file mode 100644 index 0000000..e71a741 Binary files /dev/null and b/THolders/FloatingAggregate.nge differ diff --git a/ToolNotes.ini b/ToolNotes.ini index 0d2c1ef..d0afd81 100644 --- a/ToolNotes.ini +++ b/ToolNotes.ini @@ -27,6 +27,7 @@ 2=d,SIDESTEP 3=d,SIDEDEPTH 4=s,DOUBLE +5=dr,TH_LENGTH [MILL_NOTIP] 0=th,TH, @@ -34,6 +35,7 @@ 2=d,SIDESTEP 3=d,SIDEDEPTH 4=s,DOUBLE +5=dr,TH_LENGTH [MORTISE_STD] 0=b,MORTISE