diff --git a/EgtStoneLib/VacuumCups.vb b/EgtStoneLib/VacuumCups.vb index 3afbc03..fcb2f01 100644 --- a/EgtStoneLib/VacuumCups.vb +++ b/EgtStoneLib/VacuumCups.vb @@ -544,9 +544,9 @@ Module VacuumCups End Function ' dall'informazione di extra corsa recupera il valore indicato - Public Function GetExtraStrokeValue(sInfo) As Double + Public Function GetExtraStrokeValue(sInfo As String) As Double Dim dExtraStroke As Double = 0 - Dim sItems As String() = sInfo.Split("=") + 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) diff --git a/OptionPanel/MachiningTab/MoveRawModeVM.vb b/OptionPanel/MachiningTab/MoveRawModeVM.vb index a08a2a5..3699323 100644 --- a/OptionPanel/MachiningTab/MoveRawModeVM.vb +++ b/OptionPanel/MachiningTab/MoveRawModeVM.vb @@ -249,6 +249,7 @@ Public Class MoveRawModeVM NotifyPropertyChanged("MoveStep") End Sub + ' verifica che la posizione di rialascio sia corretta, altrimenti coreggo il vettore di posizione Private Function VerifyReleasdPositionIsValid(ByRef vtMove As Vector3d) As Boolean Dim bOk As Boolean = True ' determino il punto finale dello spostamento @@ -314,7 +315,7 @@ Public Class MoveRawModeVM VacuumCups.ptStartPointLift = ptEndPointLift Return bOk End Function - + ' verifica che la posizione di rialascio sia corretta, altrimenti coreggo l'angolo di posizione Private Function VerifyReleasdAngleIsValid(ByRef dAngDeg As Double, ByVal ptCenter As Point3d) As Boolean Dim bOk As Boolean = True ' determino il punto finale dello spostamento @@ -562,12 +563,19 @@ Public Class MoveRawModeVM While nRawId <> GDB_ID.NULL If m_bRawWithCups Then Dim dAng As Double = m_dRotationStep + ' ----------- INIZIO verifica di essere entro i limiti macchina ----------- + ' Recupero il centro del grezzo + Dim ptRawCen As Point3d + EgtGetRawPartCenter(nRawId, ptRawCen) + OmagOFFICEMap.refStatusBarVM.ClearOutputMessage() + 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) EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB) AddRawMoveData(nRawId, dAng, m_RawMoveDataList) + Else + VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng) + VacuumCups.dDegRotStartAng -= dAng End If Else OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING) @@ -597,12 +605,19 @@ Public Class MoveRawModeVM While nRawId <> GDB_ID.NULL If m_bRawWithCups Then Dim dAng As Double = -m_dRotationStep + ' ----------- INIZIO verifica di essere entro i limiti macchina ----------- + ' Recupero il centro del grezzo + Dim ptRawCen As Point3d + EgtGetRawPartCenter(nRawId, ptRawCen) + OmagOFFICEMap.refStatusBarVM.ClearOutputMessage() + 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) EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB) AddRawMoveData(nRawId, dAng, m_RawMoveDataList) + Else + VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng) + VacuumCups.dDegRotStartAng -= dAng End If Else OmagOFFICEMap.refStatusBarVM.SetOutputMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2), 3, MSG_TYPE.WARNING)