Compare commits

...

10 Commits

5 changed files with 349 additions and 19 deletions
+177 -8
View File
@@ -240,6 +240,16 @@ Public Class MoveRawPartPage
' Se con ventose, le posiziono sul grezzo
If Not m_bByHand Then
Dim rmData As New RawMoveData
' inizializzo i dati del grezzo per il cacolo del peso
Dim MaxSinglePlugger As Double = 250
MaxSinglePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_SINGLEPLUGGER, MaxSinglePlugger, m_MainWindow.GetMachIniFile())
Dim MaxDoublePlugger As Double = 750
MaxDoublePlugger = GetPrivateProfileDouble(S_MACH_RAWMOVE, K_MACH_WEIGHT_DOUBLEPLUGGER, MaxDoublePlugger, m_MainWindow.GetMachIniFile())
Dim AverageDensity As Double = 2700
AverageDensity = GetPrivateProfileDouble(S_MATERIALS, K_AVERAGEDENSITY, AverageDensity, m_MainWindow.GetMachIniFile())
VacuumCups.GetWeightInformation(AverageDensity, MaxSinglePlugger, MaxDoublePlugger)
VacuumCups.GetRotationForExtraStrokeY(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEY, 0, m_MainWindow.GetMachIniFile()) <> 0)
VacuumCups.GetRotationForExtraStrokeX(GetPrivateProfileInt(S_MACH_RAWMOVE, K_MACH_ROTATEVACUUMFOREXTRASTROKEX, 0, m_MainWindow.GetMachIniFile()) <> 0)
If PutVacuumCupsOnRaw(nId, rmData) Then
' Visualizzo le ventose
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
@@ -249,10 +259,19 @@ Public Class MoveRawPartPage
' Reset eventuale messaggio
m_CurrProjPage.ClearMessage()
Else
' nascondo la visualizzazione delle ventose
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
' Aggiorno i dati
m_bRawWithCups = False
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
If VacuumCups.bOverWeight Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 4)) 'Pezzo troppo pesante : non si può muovere
ElseIf VacuumCups.bExtraStroke Then
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 5)) 'Pezzo oltre le corse : non si può muovere
Else
' Messaggio di avvertimento
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
End If
End If
End If
End If
@@ -263,6 +282,8 @@ Public Class MoveRawPartPage
End While
End Sub
#Region "Move Up/Down/Left/Right"
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
@@ -285,9 +306,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -322,9 +349,15 @@ Public Class MoveRawPartPage
Else
If m_bRawWithCups Then
Dim vtMove As New Vector3d(0, -m_dStep, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.y -= vtMove.y
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -342,9 +375,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -361,9 +400,15 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim vtMove As New Vector3d(-m_dStep, 0, 0)
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
m_CurrProjPage.ClearMessage()
VerifyReleasdPositionIsValid(vtMove)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtMoveRawPart(nRawId, vtMove) Then
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.x -= vtMove.x
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -373,6 +418,75 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
#End Region 'Move Up/Down/Left/Right
' verifica che la poszione da raggiungere sia nei limiti delle corse
Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
ptEndPointLift.x += vtMove.x
ptEndPointLift.y += vtMove.y
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, VacuumCups.dDegRotStartAng)
Case 1
' extra corsa sulla x-: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 2
' extra corsa sulla x+: devo ridurre del valore di extra corsa
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.x -= vtMove.x
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.x) <= EPS_SMALL * 100 Then
vtMove.x = 0
Else
vtMove.x -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.x += vtMove.x
bOk = False
Case 4
' extra corsa sulla y-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove - EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
Case 8
' extra corsa sulla y+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.y -= vtMove.y
Dim dMaxMove As Double = VacuumCups.GetExtraStrokeValue(sInfo)
If Math.Abs(dMaxMove - vtMove.y) <= EPS_SMALL * 100 Then
vtMove.y = 0
Else
vtMove.y -= dMaxMove + EPS_SMALL * 100
End If
ptEndPointLift.y += vtMove.y
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
Return bOk
End Function
Private Sub RotateCounterClockwiseBtn_Click(sender As Object, e As RoutedEventArgs) Handles RotateCounterClockwiseBtn.Click
' Solo movimento con ventose
If m_bByHand Then Return
@@ -380,14 +494,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -404,14 +528,24 @@ Public Class MoveRawPartPage
While nRawId <> GDB_ID.NULL
If m_bRawWithCups Then
Dim dAng As Double = -m_dRotation
' ----------- INIZIO verifica di essere entro i limiti macchina -----------
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
m_CurrProjPage.ClearMessage()
VerifyReleasdAngleIsValid(dAng, ptRawCen)
' ----------- FINE verifica di essere entro i limiti macchina -----------
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
' Recupero il centro del grezzo
Dim ptRawCen As Point3d
EgtGetRawPartCenter(nRawId, ptRawCen)
'' Recupero il centro del grezzo
'Dim ptRawCen As Point3d
'EgtGetRawPartCenter(nRawId, ptRawCen)
' Eseguo la rotazione della ventosa
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
' Memorizzo
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
Else
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
VacuumCups.dDegRotStartAng -= dAng
End If
Else
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
@@ -421,6 +555,41 @@ Public Class MoveRawPartPage
EgtDraw()
End Sub
Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean
Dim bOk As Boolean = True
' determino il punto finale dello spostamento
Dim ptEndPointLift As Point3d = VacuumCups.ptStartPointLift
Dim dDegRotEndAng As Double = VacuumCups.dDegRotStartAng + dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
Dim sInfo As String = String.Empty
Select Case VacuumCups.VerifyOutOfStrokes(ptEndPointLift, dDegRotEndAng)
Case 16
' extra corsa sulla c-
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg += VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
Case 34
' extra corsa sulla c+
EgtGetOutstrokeInfo(sInfo)
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_SIMULATIONPAGEUC + 2) & " " & sInfo) 'Extracorsa ...
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), -dAngDeg)
dDegRotEndAng -= dAngDeg
dAngDeg -= VacuumCups.GetExtraStrokeValue(sInfo) + EPS_SMALL
dDegRotEndAng += dAngDeg
ptEndPointLift.Rotate(ptCenter, Vector3d.Z_AX(), dAngDeg)
bOk = False
End Select
' il movimento del pezzo è accettabile, aggiorno le posizione per la verifica dello step successivo
VacuumCups.ptStartPointLift = ptEndPointLift
VacuumCups.dDegRotStartAng = dDegRotEndAng
Return bOk
End Function
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
Dim nRawId As Integer = EgtGetFirstSelectedObj()
While nRawId <> GDB_ID.NULL
+147 -4
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.Text.RegularExpressions
Module VacuumCups
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
@@ -10,7 +11,22 @@ Module VacuumCups
Private m_dPreferredRot As Double = 0
Private m_dPrefVertRotXMinus As Double = 0
Private m_dPrefVertRotXPlus As Double = 0
Private m_dPrefVertRotYMinus As Double = 0
Private m_dPrefVertRotYPlus As Double = 0
Private m_dDripRefAng As Double = 0
' dati carico massimo manipolatore
Private m_RawDensity As Double = 2500
Private m_RawWeight As Double = 0
Private m_MaxWeightSinglePlugger As Double = 250
Private m_MaxWeightDoublePlugger As Double = 750
Public bOverWeight As Boolean = False
' dati per rotazione ventose vicono al fine corsa Y e X
Private bRotateVacuumNearExtraStrokeY As Boolean = False
Private bRotateVacuumNearExtraStrokeX As Boolean = False
' dati stroke
Public bExtraStroke As Boolean = False
Public ptStartPointLift As Point3d
Public dDegRotStartAng As Double
' Nome del gruppo temporaneo per le ventose
Private Const VACTMP_GRP As String = "VacTmp"
@@ -50,6 +66,20 @@ Module VacuumCups
Return m_nVacType
End Function
' carico i dati macchina relativi al peso massimo movimentabile
Friend Sub GetWeightInformation(Density As Double, MaxSingle As Double, MaxDouble As Double)
m_RawDensity = Density
m_MaxWeightSinglePlugger = MaxSingle
m_MaxWeightDoublePlugger = MaxDouble
End Sub
Friend Sub GetRotationForExtraStrokeY(Rotate As Boolean)
bRotateVacuumNearExtraStrokeY = Rotate
End Sub
Friend Sub GetRotationForExtraStrokeX(Rotate As Boolean)
bRotateVacuumNearExtraStrokeX = Rotate
End Sub
Friend Function GetVacuumId() As Integer
Return m_nVacId
End Function
@@ -66,6 +96,8 @@ Module VacuumCups
' Identificativo riferimento della testa nella macchina
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
If nT1Id = GDB_ID.NULL Then Return False
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
' Creo gruppo temporaneo in cui copiarli
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
If m_nTempId = GDB_ID.NULL Then Return False
@@ -78,7 +110,9 @@ Module VacuumCups
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
' Angoli di rotazione preferiti per ventosa in verticale (lungo Y) a sinistra e a destra del centro tavola
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXMINUS, m_dPrefVertRotXMinus)
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTXPLUS, m_dPrefVertRotXPlus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYMINUS, m_dPrefVertRotYMinus)
EgtGetInfo(m_nVacId, KEY_VACLAY_PREFVROTYPLUS, m_dPrefVertRotYPlus)
' Direzione di riferimento per tagli Drip
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
@@ -165,6 +199,18 @@ Module VacuumCups
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
Dim ptKerfCen As Point3d
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
'-------------------- INIZIO CALCOLO PESO --------------------
' recupero l'area del grezzo da muovere
Dim RawArea As Double = 0
' superficie del grezzo senza considerare eventuali fori
EgtSurfFrGrossArea(nRKerfId, RawArea)
' volume calcolato in mmc
Dim RawVolume As Double = RawArea * b3Raw.DimZ()
' peso calolato in kg
m_RawWeight = RawVolume * m_RawDensity / Math.Pow(10, 9)
'-------------------- FINE CALCOLO PESO --------------------
' Eseguo ricerca
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
Return True
@@ -187,6 +233,7 @@ Module VacuumCups
Return False
End Function
' utilizzata per gestire la movimentazione dei pezzi per eseguire i drip
Friend Function PutVacuumCupsOnPart(nPartId As Integer,
ByRef rmData As RawMoveData, ByRef b3Part As BBox3d) As Boolean
' Ripristino posizione originale ventose
@@ -266,6 +313,7 @@ Module VacuumCups
Dim sCups() As String = Nothing
Dim sCups2() As String = Nothing
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
bExtraStroke = False
' Determino validità soluzioni della configurazione
Dim vtMove As New Vector3d
Dim ptRotCen As New Point3d
@@ -294,6 +342,7 @@ Module VacuumCups
Dim frCurrRef As New Frame3d
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
' Assegno dati noti al movimento del grezzo
rmData.m_nId = nRawId
rmData.m_vtRawMove = Vector3d.NULL()
@@ -368,6 +417,23 @@ Module VacuumCups
If b3Vac.IsEmpty() Then Return INFINITO
' Se box maggiore di quello del pezzo, scarto soluzione
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
'-------------------- INIZIO VERIFICA PESO --------------------
bOverWeight = False
Select Case GetPluggerFromCameras(sCups)
Case 2
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightDoublePlugger Then
bOverWeight = True
Return INFINITO
End If
Case 1
' se peso del grezzo oltre il limite consentito allora scarto la soluzione
If m_RawWeight > m_MaxWeightSinglePlugger Then
bOverWeight = True
Return INFINITO
End If
End Select
'-------------------- FINE VERIFICA PESO --------------------
' Recupero l'area della tavola
Dim b3Tab As New BBox3d
EgtGetTableArea(1, b3Tab)
@@ -383,13 +449,24 @@ Module VacuumCups
dRotAngDeg = dAngOrizzDeg
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
Dim dPreferredRot As Double = m_dPreferredRot
If Math.Abs( dRotAngDeg - 90) < 45 Or Math.Abs( dRotAngDeg - 270) < 45 Then
' -------------------- INIZIO GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
' verifico l'orientamento del pezzo
If bRotateVacuumNearExtraStrokeX And (Math.Abs(dRotAngDeg - 90) < 45 Or Math.Abs(dRotAngDeg - 270) < 45) Then
' se l'orientamento è verticale
If frMinRect.Orig().x < b3Tab.Center().x Then
dPreferredRot = m_dPrefVertRotXMinus
else
Else
dPreferredRot = m_dPrefVertRotXPlus
End If
End If
ElseIf bRotateVacuumNearExtraStrokeY And (Math.Abs(dRotAngDeg - 90) > 45 Or Math.Abs(dRotAngDeg - 270) > 45) Then
' se l'orientemanto è orizzontale e la macchina è stata abilitata
If frMinRect.Orig().y < b3Tab.Center().y Then
dPreferredRot = m_dPrefVertRotYPlus
Else
dPreferredRot = m_dPrefVertRotYMinus
End If
End If
' -------------------- FINE GESTIONE ROTAZIONE ASSE C PER NON ANDARE IN EXTRA-CORSA --------------------
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
dRotAngDeg -= dAngDelta
@@ -446,11 +523,55 @@ Module VacuumCups
' Applico movimento e rotazione al punto
ptRef.Move(vtMove)
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
' -------------- INIZIO verifica di essere nel limite delle corse macchina --------------
If VerifyOutOfStrokes(ptRef, dRotAngDeg) <> 0 Then
bExtraStroke = True
Return INFINITO
End If
' se la posizione è accettbaile allora salvo i dati
ptStartPointLift = ptRef
dDegRotStartAng = dRotAngDeg
' -------------- FINE verifica di essere nel limite delle corse macchina --------------
' Ne calcolo la distanza dal centro della tavola
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
Return dDist
End Function
' assegante le posizioni del centro delle ventose e l'angolo di posizionamento orizzontale verifica che la posizione sia raggiungibile
Public Function VerifyOutOfStrokes(ptRef As Point3d, dRotAngDeg As Double) As Integer
Dim dX, dY, dZ As Double
Dim nStat As Integer
Dim dCHome As Double
EgtGetAxisHomePos("C", dCHome)
' imposto la l'uscita della ventosa come fosse l'uscita di un utensile
EgtSetCalcTool("", "H4", 1)
EgtGetCalcPositions(ptRef, dRotAngDeg + dCHome, 0, nStat, dX, dY, dZ)
EgtVerifyOutstroke(dX, dY, dZ, dRotAngDeg + dCHome, 0, nStat)
Return nStat
End Function
' dall'informazione di extra corsa recupera il valore indicato
Public Function GetExtraStrokeValue(sInfo As String) As Double
Dim dExtraStroke As Double = 0
Dim sItems As String() = sInfo.Split("="c)
If sItems.Count = 2 Then
Dim nStartIndex As Integer = 0
For Each ItemChar As Char In sItems(1)
If ItemChar = "("c Then
Exit For
End If
nStartIndex += 1
Next
If nStartIndex > 0 Then
Dim sValue As String = sItems(1).Remove(nStartIndex, sItems(1).Count - nStartIndex)
StringToLen(sValue, dExtraStroke)
End If
End If
Return dExtraStroke
End Function
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
' Eseguo verifica delle ventose rispetto al grezzo
@@ -471,6 +592,28 @@ Module VacuumCups
Return bVacOk
End Function
' dato il vettore delle camere restituisco il quali attuatori sono coinvolti
Private Function GetPluggerFromCameras(sCups() As String) As Integer
Dim nCountPlunger As Integer = 1
Dim bPlugger1 As Boolean = False
Dim bPlugger2 As Boolean = False
For Each Camera As String In sCups
If (Camera.Contains("1") Or Camera.Contains("2") Or Camera.Contains("3")) Then
bPlugger1 = True
Else
bPlugger2 = True
End If
Next
' verifico quali sono le camere attive
If bPlugger1 And bPlugger2 Then
nCountPlunger = 2
ElseIf Not bPlugger1 And Not bPlugger2 Then
nCountPlunger = 0
End If
' restituisco il numero di Plugger in uso
Return nCountPlunger
End Function
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
' Assegno le informazioni
EgtSetInfo(nId, "Id", rmData.m_nId)
+2
View File
@@ -94,6 +94,8 @@ Module ConstGen
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
Public Const KEY_VACLAY_PREFVROTYMINUS As String = "PrefVertRotYMinus"
Public Const KEY_VACLAY_PREFVROTYPLUS As String = "PrefVertRotYPlus"
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
' Info in asse rotante ventosa per step discreti
+5
View File
@@ -228,6 +228,10 @@
Public Const S_MACH_RAWMOVE As String = "RawMove"
Public Const K_MACH_RM_ROTATE As String = "Rotate"
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
Public Const K_MACH_WEIGHT_SINGLEPLUGGER As String = "MaxWeightSinglePlugger"
Public Const K_MACH_WEIGHT_DOUBLEPLUGGER As String = "MaxWeightDoublePlugger"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEY As String = "RotateVacuumForExtraStrokeY"
Public Const K_MACH_ROTATEVACUUMFOREXTRASTROKEX As String = "RotateVacuumForExtraStrokeX"
Public Const S_MACH_REG As String = "Reg"
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
@@ -290,5 +294,6 @@
Public Const K_CURRMATERIAL As String = "CurrMaterial"
Public Const K_MATERIAL As String = "Material"
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
End Module
+18 -7
View File
@@ -1,4 +1,5 @@
Imports EgtUILib
Imports System.IO
Imports EgtUILib
Public Class InternalComponentPageUC
@@ -286,12 +287,22 @@ Public Class InternalComponentPageUC
If sCompoImage.Length <> 0 Then
Try
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
If File.Exists(sPath) Then
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
GetImage(index).Height = 65
GetImage(index).Width = 65
GetImage(index).Source = sCompoImageSource
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
Else
sCompoImage = String.Empty
GetImage(index).Height = 0
GetImage(index).Width = 0
CustomThickness.Right = 0
GetImage(index).Margin = CustomThickness
GetLabel(index).SetValue(Grid.ColumnProperty, 0)
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 2)
End If
Catch ex As Exception
EgtOutLog("Error loading image " & sCompoImage)
sCompoImage = String.Empty