diff --git a/Common_ONE-PF.mlpe b/Common_ONE-PF.mlpe index 1f990c5..7131f65 100644 --- a/Common_ONE-PF.mlpe +++ b/Common_ONE-PF.mlpe @@ -96,10 +96,6 @@ function OnSimulStart() if DefTcPos2 then LoadFirstTool( 2, DefTcPos2) end - - -- se presenti, nascondo i tastatori - DeactivateProbeTool() - ExecStartHome() -- Se reset o home, esco if EMT.SIM1ST then return end @@ -134,8 +130,7 @@ function OnSimulStart() { Grp = 'Base', Sub = 'COLLISION', Name = 'TC1'}, { Grp = 'Base', Sub = 'COLLISION', Name = 'TC2'}, { Grp = 'Base', Sub = 'BELT', Name = 'COLLISION'}, - { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}, - { Grp = 'X1', Sub = 'COLLISION', Name = 'STM2'}} + { Grp = 'X1', Sub = 'COLLISION', Name = 'STM'}} if EgtGetHeadId( 'H21') then table.insert( McdData, { Grp = 'X2', Sub = 'COLLISION', Name = 'STM'}) @@ -667,7 +662,7 @@ function OnSimulToolDeselect( dPrevA) end -- se utensile non cambia e non è sega a catena, esco - if bSkipToolChange or ( ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD)) then return end + if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end -- deposito utensile EgtOutText( 'Tool change in progress...') -- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa @@ -2574,7 +2569,7 @@ function GetHeadSetFromTcPos( sTcPos) local TCPOS_2A = {} local TCPOS_2B = {} if EgtGetHeadId( 'H21') then - TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10', '501'} + TCPOS_1A = { 'T1', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1B = { 'T101'} TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} TCPOS_2B = { 'T111'} @@ -2582,7 +2577,7 @@ function GetHeadSetFromTcPos( sTcPos) TCPOS_1A = { 'T1', 'T2', 'T3', 'T4', 'T5', 'T6', 'T7', 'T8', 'T9', 'T10'} TCPOS_1B = { 'T101', 'T201'} TCPOS_1C = { 'T301'} - TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20', '502'} + TCPOS_2A = { 'T11', 'T12', 'T13', 'T14', 'T15', 'T16', 'T17', 'T18', 'T19', 'T20'} end for _, sVal in ipairs( TCPOS_1A) do if sVal == sTcPos then return 1, 1 end diff --git a/Common_ONE-PF.mlse b/Common_ONE-PF.mlse index 423206f..7b93c39 100644 --- a/Common_ONE-PF.mlse +++ b/Common_ONE-PF.mlse @@ -4,12 +4,6 @@ require( 'EmtGenerator') EgtEnableDebug( false) ---------------------------------------------------------------------- --- *** Generic Machinings *** ---------------------------------------------------------------------- -require( 'EmtGenMachining') ---------------------------------------------------------------------- - -- Carico libreria local BD = require( 'BeamData') @@ -974,46 +968,6 @@ function OnSpecialApplyMachining() -- Recupero la posizione della trave e dei carrelli al termine della precedente operazione local nPrevOpeId = EgtGetPrevActiveOperation( EMC.MCHID) - - -- Se esiste lavorazione precedente ed è una tastatura - if nPrevOpeId and EgtGetOperationType( nPrevOpeId) == MCH_OY.PROBING then - -- se stessa testa e montato già utensile corretto - -- recupero valori assi alla fine della lavorazione precedente e all'inizio della corrente - local vPrevAxes = EmtGetFinalAxesPos( nPrevOpeId, true) - local vCurrAxes = EmtGetInitialAxesPos( EMC.MCHID, true) - -- info lavorazione precedente - EgtSetCurrMachining( nPrevOpeId) - local sPrevTool = EgtGetMachiningParam( MCH_MP.TOOL) - local sPrevHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) - local nSetHead = GetHeadSet( sPrevHead) - local bPrevIsFirstHead = ( nSetHead == 1 or nSetHead == 11) - -- info lavorazione corrente - EgtSetCurrMachining( EMC.MCHID) - local sCurrTool = EgtGetMachiningParam( MCH_MP.TOOL) - local sCurrHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD) - nSetHead = GetHeadSet( sCurrHead) - local bCurrIsFirstHead = ( nSetHead == 1 or nSetHead == 11) - - -- se utensile corrente è compatibile (significa che è già stato precaricato) se stessa testa e con stessa configurazioen assi rotanti, annullo risalita - if IsToolCompatibleWithProbe( sCurrTool, sPrevTool) and bPrevIsFirstHead == bCurrIsFirstHead and abs( vCurrAxes[4] - vPrevAxes[4]) < 1 and abs( vCurrAxes[5] - vPrevAxes[5]) < 1 then - -- in lavorazione precedente elimino eventuale retrazione a Zmax - EmtRemoveRise( nPrevOpeId) - -- in lavorazione corrente elimino eventuale approccio da Zmax - EmtRemoveClimb( EMC.MCHID) - -- prendo sempre la Z massima tra le due - local vClimbPoint - if vCurrAxes[3] - 1.0 < vPrevAxes[3] then - vClimbPoint = vCurrAxes - vCurrAxes[3] = vPrevAxes[3] - elseif vPrevAxes[3] - 1.0 < vCurrAxes[3] then - vClimbPoint = vPrevAxes - vPrevAxes[3] = vCurrAxes[3] - end - EmtAddClimb( EMC.MCHID, vClimbPoint, 4, 1, 0) - end - end - - -- Recupero la posizione della trave e dei carrelli al termine della precedente operazione -- se precedente operazione non esiste, errore if not nPrevOpeId then EMC.ERR = 1 @@ -1540,7 +1494,6 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut) local dDistFront = - ptMax:getX() - LoadT - dHeadFront local dDistBack = ptMin:getX() + LoadT + EMC.LB - dHeadBack EgtOutLog( ' DistFront = ' .. EgtNumToString( dDistFront, 1) .. ' DistBack = ' .. EgtNumToString( dDistBack, 1), 3) - return dDistFront, dDistBack, dRollFront, dRollBack end