diff --git a/Common_PF1250.mlpe b/Common_PF1250.mlpe index ef5e93f..7bebadd 100644 --- a/Common_PF1250.mlpe +++ b/Common_PF1250.mlpe @@ -530,8 +530,10 @@ function OnSimulToolSelect( dPosA) EMT.A2n = 'Y2' EMT.A3n = 'V1' EMT.A4n = 'V2' - -- se attivo Vmill - EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL) + -- se utensile non flottante, abilito per Vmill + if not EMT.TFLOAT then + EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL) + end -- se attivo Collision Check EMT.SAFEDIST = COLL_SAFE_DIST if EMT.COLLOBJ then @@ -575,7 +577,7 @@ function OnSimulToolDeselect( dPrevA) -- visualizzo utensile su TcPos ShowToolInTcPos( EMT.PREVTCPOS_H2, true) -- nascondo l'utensile sulla testa - EgtSetStatus( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_ST.OFF) + EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_MD.HIDDEN) -- se testa gruppo 1 elseif nNextSetHead == 1 and EMT.PREVTCPOS_H1 then -- deposito utensile fresa @@ -1265,6 +1267,18 @@ function OnSimulMoveStart() end EMT.ZMAX = nil EMT.TO_ZMAX = nil + + -- se aggregato flottante su inizio attacco va compresso + if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then + -- recupero lunghezza + local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL) + -- imposto compressione della parte flottante + SetFloatPos( EMT.HEAD, dOffsL) + -- imposto dati utensile in posizione compressa + EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL) + -- dichiaro che è compresso (assegnando Id entità di movimento) + EMT.TFLOAT_CMP = EMT.MOVEID + end end --------------------------------------------------------------------- @@ -1323,12 +1337,39 @@ function OnSimulMoveEnd() ExecMoveZmax( EMT.MCHSPLIT, bToXhome) EMT.TO_ZMAX = nil end + + -- se utensile flottante e movimento di compressione + if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then + -- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo) + if not EMT.TFLOAT_TH_COMPR_COLL then + local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach' + EmtSetLastError( 1222, sErr) + EgtOutLog( 'Error : ' .. sErr, 1) + else + EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1) + end + EMT.TFLOAT_TH_COMPR_COLL = nil + end + -- se aggregato flottante su fine uscita va rilasciato + if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then + -- reset compressione della parte flottante + SetFloatPos( EMT.HEAD, 0) + -- dichiaro che è rilasciato + EMT.TFLOAT_CMP = nil + end end --------------------------------------------------------------------- function OnSimulCollision() -- se prima collisione della lavorazione, la segnalo if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then + -- speciale per utensile flottante (suo holder contro il grezzo) + if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then + if EMT.MOVEID == EMT.TFLOAT_CMP then + EMT.TFLOAT_TH_COMPR_COLL = true + end + return + end local Class = '' if EMT.SIMCOBIND == 1001 or EMT.SIMCOBIND == 1011 then Class = 'T_'..EMT.HEAD diff --git a/Common_PF1250.mlse b/Common_PF1250.mlse index 94efe56..676260e 100644 --- a/Common_PF1250.mlse +++ b/Common_PF1250.mlse @@ -209,7 +209,7 @@ local SIC_V = 50 -- sicurezza da testa local MIN_ENG_V = 115 -- ingombro asse Z local MIN_ENG_RACK_V = 161 -- ingombro asse Z con cremagliera local MIN_ENG_XZ2_V = 180 -- ingombro assi XZ sotto -local MIN_Z2_FOR_ENG_XZ2_V = 250 + EgtIf( MaxZ2 > 1100, 300, 0) -- quota Z2 da cui considerare ingombro assi XZ sotto +local MIN_Z2_FOR_ENG_XZ2_V = 250 -- quota Z2 da cui considerare ingombro assi XZ sotto local AGG_V = MinDeltaYV -- ingombro rulli pressori + sicurezza local MaxLenSmT = 1500 -- massima lunghezza pezzo scaricato con nastri verdi local DIST_Y1MAX_LOAD = 100 -- distanza carrello Y1 da massimo asse al carico diff --git a/Essetre-PF1250.mlde b/Essetre-PF1250.mlde index 2371612..ca524fa 100644 --- a/Essetre-PF1250.mlde +++ b/Essetre-PF1250.mlde @@ -30,8 +30,8 @@ require( 'EmtGenerator') EgtEnableDebug( false) -PP_VER = '2.7b2' -PP_NVER = '2.7.2.2' +PP_VER = '2.7b3' +PP_NVER = '2.7.2.3' MIN_MACH_VER = '2.5k1' MACH_NAME = 'Essetre-PF1250' @@ -1126,6 +1126,37 @@ function GetPY2Light() return ( EgtGetInfo( PY2LightId, 'On') == '1') end +--------------------------------------------------------------------- +-- Funzione per impostare la posizione del rinvio flottante +function SetFloatPos( sHead, dPos) + -- recupero Id testa + local nHeadId = EgtGetHeadId( sHead) + if not nHeadId then return false end + -- se ci sono entità flottanti nel ToolHolder + local nRefId = EgtGetFirstNameInGroup( nHeadId, '_T1') + local vtTool = EgtFR( nRefId, GDB_ID.ROOT):getVersZ() + local nObjId = EgtGetFirstGroupInGroup( EgtGetFirstNameInGroup( nHeadId, 'T1')) + local FloatEntities = EgtGetInfoInGroup( nObjId, 'Float') + if FloatEntities and #FloatEntities > 0 then + -- il porta-utensile flottante non può comprimersi più di 10mm + if dPos > 10 then + local sErr = 'Floating Ring compressed more than 10mm' + EmtSetLastError( 1222, sErr) + EgtOutLog( 'Error : ' .. sErr, 1) + end + local dFloat = EgtGetInfo( FloatEntities[1], 'Float', 'd') + if abs( dPos - dFloat) > 10 * GEO.EPS_SMALL then + local vtMove = ( dPos - dFloat) * vtTool + -- sposto tutte le entità flottanti + for i = 1, #FloatEntities do + EgtMove( FloatEntities[i], vtMove, GDB_RT.GLOB) + EgtSetInfo( FloatEntities[i], 'Float', dPos) + end + end + return true + end + return false +end --------------------------------------------------------------------- -- Funzione per resettare tutte le attivazioni della macchina @@ -1134,6 +1165,9 @@ function OnResetMachine() EmtUnlinkAllFixturesFromGroups() SetPY1Light( false) SetPY2Light( false) + --resetto eventuale flottante + SetFloatPos( 'H11', 0) + SetFloatPos( 'H21', 0) -- nascondo Vmill local nRawId = EgtGetFirstRawPart() while nRawId do diff --git a/THolders/FloatingAggregate.nge b/THolders/FloatingAggregate.nge new file mode 100644 index 0000000..5df6dd0 Binary files /dev/null and b/THolders/FloatingAggregate.nge differ diff --git a/ToolNotes.ini b/ToolNotes.ini index 0d2c1ef..380b815 100644 --- a/ToolNotes.ini +++ b/ToolNotes.ini @@ -27,6 +27,7 @@ 2=d,SIDESTEP 3=d,SIDEDEPTH 4=s,DOUBLE +5=dr,TOOL_OVERHANG [MILL_NOTIP] 0=th,TH, @@ -34,6 +35,7 @@ 2=d,SIDESTEP 3=d,SIDEDEPTH 4=s,DOUBLE +5=dr,TOOL_OVERHANG [MORTISE_STD] 0=b,MORTISE diff --git a/UpdateLog.txt b/UpdateLog.txt index 062926f..1779ca6 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,12 @@ ==== Common_PF1250 Update Log ==== +Versione 2.7b4 (21/02/2025) +- (SIM-GEN) Ripristinato comportamento precedente calcolo posizione dei rulli di pinzaggio fatto con 2.7b2. +- (MLDE-SIM) Gestione aggregato flottante. Serve modifica MLDE. Ticket#2297 + +Versione 2.7b3 (06/02/2025) +- (SIM) Dopo aver scaricato utensile, si setta nota "HIDDEN" per dichiarare utensile non più sulla testa e non considerare le collisioni. + Versione 2.7b2 (04/02/2025) - (SIM-GEN) Piccola modifica nel calcolo posizione dei rulli di pinzaggio. diff --git a/Version.lua b/Version.lua index 8b18806..9db9255 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_PF1250', -- nome script PP standard - VERSION = '2.7b2', -- versione script + VERSION = '2.7b4', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }