Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
luca.mazzoleni
2023-10-30 09:14:38 +01:00
5 changed files with 49 additions and 77 deletions
-34
View File
@@ -1,34 +0,0 @@
{
"Lua.diagnostics.globals": [
"EgtGetStringFromIni",
"EgtExistsFile",
"EgtCopyFile",
"EgtEraseFile",
"EgtRenameFile",
"EmtGeneral",
"EmtBase",
"EmtAxis",
"EmtHead",
"EgtSetInfo",
"EgtOutLog",
"EgtGetIniFile",
"EgtMove",
"EgtGetFirstNameInGroup",
"EmtTable",
"EmtTcPos",
"EmtModifyAxisHome",
"EMC",
"EmtModifyExitPosition",
"EgtSetColor",
"EgtRemoveInfo",
"EmtUnlinkAllRawPartsFromGroups",
"EmtUnlinkAllFixturesFromGroups",
"EgtGetFirstRawPart",
"EgtGetFirstInGroup",
"EgtSetStatus",
"EgtGetNext",
"EgtGetNextRawPart",
"EgtGetMachiningParam",
"EgtGetHeadId"
]
}
+31 -24
View File
@@ -245,12 +245,10 @@ function OnDispositionEnd()
else
if #EMT.MDCHAR > 0 then
EmitRemark( 'PART UNLOAD')
end
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
if EMT.MDCHAR[i].Y1 then EMT.CHY_ON = true end
end
if #EMT.MDCHAR > 0 then
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
if EMT.MDCHAR[i].Y1 then EMT.CHY_ON = true end
end
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
-- se dopo c'è scarico spezzone devo mettere attesa termine esecuzione
@@ -371,8 +369,13 @@ end
---------------------------------------------------------------------
function OnMachiningEnd()
--MyOutput( ';Mach End')
-- Emissione split
-- Se Cut, aggiorno lunghezza
if EMT.MCHUSERNOTES:find( 'Cut', 1, true) then
EMT.LB = EMT.LT
end
-- Se ci sono movimenti carrelli da emettere (con Split e Split2 aggiorno lunghezza)
if #EMT.MDCHAR > 0 then
-- Intestazioni
if EMT.AUXTYPE == 'S' then
EmitRemark( 'PART SPLIT')
EMT.LB = EMT.LT
@@ -394,13 +397,14 @@ function OnMachiningEnd()
EmitZmax( false, true, EMT.R1, EMT.R2)
EMT.ZMAX = true
EmitRemark( 'PART SPLIT 2')
EMT.LB = EMT.LT
end
end
end
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
end
if #EMT.MDCHAR > 0 then
-- Emissione movimenti carrelli
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
end
-- Completamento
if EMT.AUXTYPE == 'S' then
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
@@ -433,6 +437,7 @@ function OnMachiningEnd()
end
end
end
-- Reset
EMT.MDCHAR = {}
EMT.AUXTYPE = nil
EMT.TO_ZMAX = nil
@@ -694,14 +699,14 @@ function OnRapid()
BhData.Y2 = ParkY2
BhData.ViseY2 = 2
end
if GetV1ToClose() then
if GetV1ToCloseTPA() then
BhData.V1 = EMT.V1NEXTPOS ; EMT.V1POS = BhData.V1
BhData.StatV1 = -2
elseif abs( EMT.V1POS - ParkV1) > 0.1 then
BhData.V1 = ParkV1 ; EMT.V1POS = BhData.V1
BhData.StatV1 = 1
end
if GetV2ToClose() then
if GetV2ToCloseTPA() then
BhData.V2 = EMT.V2NEXTPOS ; EMT.V2POS = BhData.V2
BhData.StatV2 = -2
elseif abs( EMT.V2POS - ParkV2) > 0.1 then
@@ -833,14 +838,14 @@ function OnRapid()
BhData.Y2 = ParkY2
BhData.ViseY2 = 2
end
if GetV1ToClose() then
if GetV1ToCloseTPA() then
BhData.V1 = EMT.V1NEXTPOS ; EMT.V1POS = BhData.V1
BhData.StatV1 = -2
elseif abs( EMT.V1POS - ParkV1) > 0.1 then
BhData.V1 = ParkV1 ; EMT.V1POS = BhData.V1
BhData.StatV1 = 1
end
if GetV2ToClose() then
if GetV2ToCloseTPA() then
BhData.V2 = EMT.V2NEXTPOS ; EMT.V2POS = BhData.V2
BhData.StatV2 = -2
elseif abs( EMT.V2POS - ParkV2) > 0.1 then
@@ -1616,17 +1621,19 @@ function PreparePostRotation( sCmd, nInd)
end
---------------------------------------------------------------------
function GetV1ToClose()
--MyOutput( string.format( 'L1m=%.3f L1M=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1]))
--MyOutput( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT))
return ( EMT.MAXMAX[1] <= EMT.V1NEXTPOS + RollCageMin and EMT.MAXMIN[1] + EMT.LB >= EMT.V1NEXTPOS + RollCageMax)
function GetV1ToCloseTPA()
local dMaxHeadPos = EMT.MAXMAX[1] + ( EMT.HOVM or 0) - ( EMT.X_OFF or 0)
local dMinTailPos = EMT.MAXMIN[1] + EMT.LB + EgtIf( IsStartOrMidPhase( EMT.PHASE), 0, ( EMT.HOVM or 0)) - ( EMT.X_OFF or 0)
--MyOutput( string.format( 'V1 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0)))
return ( dMaxHeadPos <= EMT.V1NEXTPOS + RollCageMin and dMinTailPos >= EMT.V1NEXTPOS + RollCageMax)
end
---------------------------------------------------------------------
function GetV2ToClose()
--MyOutput( string.format( 'L1m=%.3f L1M=%.3f', EMT.MAXMIN[1], EMT.MAXMAX[1]))
--MyOutput( string.format( 'LB=%.3f LT=%.3f', EMT.LB, EMT.LT))
return ( EMT.MAXMAX[1] <= EMT.V2NEXTPOS - RollCageMax and EMT.MAXMIN[1] + EMT.LB >= EMT.V2NEXTPOS - RollCageMin)
function GetV2ToCloseTPA()
local dMaxHeadPos = EMT.MAXMAX[1] + ( EMT.HOVM or 0) - ( EMT.X_OFF or 0)
local dMinTailPos = EMT.MAXMIN[1] + EMT.LB + EgtIf( IsStartOrMidPhase( EMT.PHASE), 0, ( EMT.HOVM or 0)) - ( EMT.X_OFF or 0)
--MyOutput( string.format( 'V2 MaxHeadPos=%.3f MinTailPos=%.3f BarLen=%.3f HeadOvm=%.3f', dMaxHeadPos, dMinTailPos, EMT.LB, ( EMT.HOVM or 0)))
return ( dMaxHeadPos <= EMT.V2NEXTPOS - RollCageMax and dMinTailPos >= EMT.V2NEXTPOS - RollCageMin)
end
---------------------------------------------------------------------
+12 -19
View File
@@ -1,4 +1,4 @@
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2023/06/28
-- Descrizione macchina Essetre-PF1250 by EgalTech s.r.l. 2023/10/29
-- 2021/08/03 ver 2.3h1 Prima versione.
-- 2021/09/14 ver 2.3i9 Estesa gestione sega a catena.
-- 2021/09/15 ver 2.3i10 Correzione gestione posizione rimanenza.
@@ -26,12 +26,14 @@
-- 2023/05/18 ver 2.5e3 Corretta gestione TC vari.
-- 2023/06/28 ver 2.5f1 Migliorie e correzioni nel posizionamento carrelli per feature di coda lunghe (Rossini).
-- 2023/09/29 ver 2.5i1 In BeamData e mlde aggiunta la lettura di alcuni parametri da Ts3Data.
-- 2023/10/12 ver 2.5j1 Sistemazioni per testa sotto più bassa quando in home.
-- 2023/10/29 ver 2.5j2 Correzione per calcolo se V1 e V2 vanno lasciati aperti e quindi in parcheggio (GetVnToCloseTPA).
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.5f1'
PP_VER = '2.5j2'
-- Parametri macchina
NumericalControl = 'TPA' -- NUM o TPA
@@ -125,15 +127,17 @@ Tc2Active = true
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250.data"
local sData = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
local sDataBeam = EgtGetSourceDir().."\\Beam\\Ts3Data.lua"
local sDataWall = EgtGetSourceDir().."\\Wall\\Ts3Data.lua"
if EgtExistsFile( sTs3Data) then
EgtCopyFile( sTs3Data, sData)
EgtCopyFile( sTs3Data, sDataBeam)
EgtCopyFile( sTs3Data, sDataWall)
local sTs3DataOld = sTs3Data..'.old'
EgtEraseFile( sTs3DataOld)
EgtRenameFile( sTs3Data, sTs3DataOld)
end
if EgtExistsFile( sData) then
local Machine = dofile( sData)
if EgtExistsFile( sDataBeam) then
local Machine = dofile( sDataBeam)
if Machine then
if Machine.Offsets then
--NumericalControl = EgtIf( Machine.Offsets.TIPO_CN == 0, 'NUM', 'TPA')
@@ -167,9 +171,9 @@ if EgtExistsFile( sData) then
if Machine.Offsets.PARK_Y2 then ParkMchY2 = Machine.Offsets.PARK_Y2 end
if Machine.Offsets.MIN_V2 then MinV2 = Machine.Offsets.MIN_V2 end
if Machine.Offsets.MAX_V2 then MaxV2 = Machine.Offsets.MAX_V2 end
if Machine.Offsets.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_FTZERO then LoadT = Machine.Offsets.DIST_FTZERO end
if Machine.Offsets.DELTA_CARICZERO then TurnerOffs = Machine.Offsets.DELTA_CARICZERO end
if Machine.Offsets.MIN_DELTAVY then MinDeltaYV = Machine.Offsets.MIN_DELTAVY + 0.1 end
if Machine.Offsets.DIST_UNLOAD then UnloadT = Machine.Offsets.DIST_UNLOAD end
if Machine.Offsets.PIVOT_T1 then MillOffs = Machine.Offsets.PIVOT_T1 end
if Machine.Offsets.PIVOT_T2 then Mill2Offs = Machine.Offsets.PIVOT_T2 end
@@ -319,17 +323,6 @@ local H13Id = EmtHead {
EgtSetInfo( H13Id, 'ZEXTRA', '200')
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
-- Dummy
EmtHead {
Name = 'H14',
Parent = 'B1',
HSet = 'H14',
Type = MCH_HT.STD,
Pos = Point3d(0,0,0),
TDir = Z_AX(),
ADir = X_AX(),
Rot1W = 0.2,
Geo = 'H14_HEAD/GEO'}
-- *** Testa 2 ***
local Z2Id = EmtAxis {
Name = 'Z2',
@@ -379,7 +372,7 @@ local B2Id = EmtAxis {
local vtMoveZ2 = Vector3d( 0, 0, Head2Z + 1181.0)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'SOLID'), vtMoveZ2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( Z2Id, 'COLLISION'), vtMoveZ2, GDB_RT.GLOB)
local vtMoveX2 = Vector3d( 0, Head2Y - 3435.9, Head2Z + 1181.0)
local vtMoveX2 = Vector3d( 0, Head2Y - 3635.9, Head2Z + 1181.0)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'SOLID'), vtMoveX2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( X2Id, 'COLLISION'), vtMoveX2, GDB_RT.GLOB)
EgtMove( EgtGetFirstNameInGroup( C2Id, 'SOLID'), vtMoveX2, GDB_RT.GLOB)
+6
View File
@@ -1856,6 +1856,12 @@ function IsMidPhase( nPhase)
return ( sVal == 'MID')
end
---------------------------------------------------------------------
function IsStartOrMidPhase( nPhase)
local sVal = GetPhaseType( nPhase)
return ( sVal == 'START' or sVal == 'MID')
end
---------------------------------------------------------------------
function IsMid2Phase( nPhase)
local sVal = GetPhaseType( nPhase)
Binary file not shown.