Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4aaf1d084e | |||
| 4bcbe8d290 | |||
| 8484087c69 | |||
| 116289cac5 | |||
| 30ee1bcf99 | |||
| a1d7983704 | |||
| 636d3a9eca | |||
| bd70bf1ec9 | |||
| d66b331478 | |||
| aecb8ed442 | |||
| 3e72b216a6 | |||
| 5baa701681 | |||
| e3a1330889 | |||
| aa237fd744 | |||
| ccfc8f89e4 | |||
| a2e28fa134 | |||
| d8c16a34f0 | |||
| 1847154a29 | |||
| 2362c8df61 | |||
| 54127e61ec | |||
| aaa39c3779 | |||
| 78fc3118ab | |||
| 4ff2ac1063 | |||
| edab1024c3 | |||
| 5092385ea4 | |||
| 6cde63cd2e | |||
| 0107fc022b | |||
| a69418c6f5 | |||
| c79e1b0327 | |||
| f53b6e0bd5 | |||
| fc7b4d276c | |||
| 95460ecbb2 | |||
| de203b55fa | |||
| 0a8dbb3557 | |||
| 1f66a8f4ef | |||
| 93b432284d | |||
| 677c3af3b7 | |||
| eb22771d06 |
@@ -101,6 +101,74 @@ Friend Module CamAuto
|
|||||||
Return True
|
Return True
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllSplitCurv() As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
|
||||||
|
EgtErase(IdAuxLayer)
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
nIdPart = EgtGetNextPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||||
|
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' elimino il layer dei flag di separazione "AUX_SPLIT_WJ"
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(nIdPart, INFO_AUX_SPLIT_WJ)
|
||||||
|
EgtErase(IdAuxLayer)
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Friend Function ResetAllStartCurv() As Boolean
|
||||||
|
Dim bOk As Boolean = True
|
||||||
|
Dim nIdPart As Integer = EgtGetFirstPart()
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
|
||||||
|
nIdPart = EgtGetNextPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Dim nRawId As Integer = CamAuto.GetCurrentRaw()
|
||||||
|
nIdPart = EgtGetFirstPartInRawPart(nRawId)
|
||||||
|
While nIdPart <> GDB_ID.NULL
|
||||||
|
' accedo al Layer OutLoop
|
||||||
|
Dim nIdLayerOutLoop As Integer = EgtGetFirstNameInGroup(nIdPart, NAME_OUTLOOP)
|
||||||
|
EgtRemoveInfo(nIdLayerOutLoop, INFO_START)
|
||||||
|
nIdPart = EgtGetNextPartInRawPart(nIdPart)
|
||||||
|
End While
|
||||||
|
Return bOk
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' verifico che il contorno passato non sia stato separato
|
||||||
|
Friend Function VerifyOutLoopIsClosed(nIdLayerOutLoop As Integer)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstInGroup(nIdLayerOutLoop)
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
Dim nValInfo As Integer = 1
|
||||||
|
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
|
||||||
|
If nValInfo = 0 Then Return False
|
||||||
|
End If
|
||||||
|
EgtRemoveInfo(nIdMy, INFO_JOINENTITY)
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Friend Function RemoveFinalEmptyPhases() As Boolean
|
Friend Function RemoveFinalEmptyPhases() As Boolean
|
||||||
Dim nOpeId As Integer = EgtGetLastOperation()
|
Dim nOpeId As Integer = EgtGetLastOperation()
|
||||||
While nOpeId <> GDB_ID.NULL
|
While nOpeId <> GDB_ID.NULL
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ Public Class CadCutPageUC
|
|||||||
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
Private Sub PhotoBtn_Click(sender As Object, e As RoutedEventArgs) Handles PhotoBtn.Click
|
||||||
m_MainWindow.TestOff()
|
m_MainWindow.TestOff()
|
||||||
m_MainWindow.DragRettangleOff()
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
' Se macchina fotografica collegata, faccio una foto
|
' Se macchina fotografica collegata, faccio una foto
|
||||||
@@ -142,6 +144,8 @@ Public Class CadCutPageUC
|
|||||||
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
|
Private Sub RawPartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RawPartBtn.Click
|
||||||
m_MainWindow.TestOff()
|
m_MainWindow.TestOff()
|
||||||
m_MainWindow.DragRettangleOff()
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
|
||||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
|
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
|
||||||
@@ -168,6 +172,8 @@ Public Class CadCutPageUC
|
|||||||
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
|
Private Sub DrawBtn_Click(sender As Object, e As RoutedEventArgs) Handles DrawBtn.Click
|
||||||
m_MainWindow.TestOff()
|
m_MainWindow.TestOff()
|
||||||
m_MainWindow.DragRettangleOff()
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
||||||
@@ -176,6 +182,8 @@ Public Class CadCutPageUC
|
|||||||
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
|
Private Sub ImportBtn_Click(sender As Object, e As RoutedEventArgs) Handles ImportBtn.Click
|
||||||
m_MainWindow.TestOff()
|
m_MainWindow.TestOff()
|
||||||
m_MainWindow.DragRettangleOff()
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
||||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
||||||
@@ -198,6 +206,8 @@ Public Class CadCutPageUC
|
|||||||
|
|
||||||
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
|
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
|
||||||
m_MainWindow.DragRettangleOff()
|
m_MainWindow.DragRettangleOff()
|
||||||
|
m_MainWindow.SplitCurvWJOff()
|
||||||
|
m_MainWindow.StartCurvWJOff()
|
||||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
|
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
|
||||||
m_ProjectMgr.TestBtn.IsChecked = False
|
m_ProjectMgr.TestBtn.IsChecked = False
|
||||||
|
|||||||
+271
-10
@@ -28,6 +28,8 @@ Public Class MoveRawPartPage
|
|||||||
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
Private m_RawMoveDataList As New List(Of RawMoveData) ' dati di movimento
|
||||||
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
Private m_bRawWithCups As Boolean = False ' flag per pezzo corrente con ventose
|
||||||
|
|
||||||
|
Private m_CurrRawOnVacuum As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
Private Sub MoveRawPartPage_Initialized(sender As Object, e As EventArgs) Handles Me.Initialized
|
||||||
' Assegno testi
|
' Assegno testi
|
||||||
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
RemovePartBtn.Content = EgtMsg(MSG_MOVERAWPAGEUC + 1) 'Rimuovi
|
||||||
@@ -230,16 +232,48 @@ Public Class MoveRawPartPage
|
|||||||
If nParentId = nRawGroupId Then
|
If nParentId = nRawGroupId Then
|
||||||
Dim nStat As Integer = GDB_ST.ON_
|
Dim nStat As Integer = GDB_ST.ON_
|
||||||
EgtGetStatus(nId, nStat)
|
EgtGetStatus(nId, nStat)
|
||||||
|
' Se il pezzo corrente è selezionato allora lo disattivo -> deposito del pezzo
|
||||||
If nStat = GDB_ST.SEL Then
|
If nStat = GDB_ST.SEL Then
|
||||||
EgtSetStatus(nId, GDB_ST.ON_)
|
EgtSetStatus(nId, GDB_ST.ON_)
|
||||||
' Se con ventose, le nascondo
|
' prima di rilasciare il pezzo verifico che non vada in collisione con altri pezzi sulla tavola
|
||||||
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
If VerifyCollisionWithOtherRawPart(nId) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(nId, GDB_ST.SEL)
|
||||||
|
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||||
|
Else
|
||||||
|
' Se con ventose, le nascondo
|
||||||
|
If Not m_bByHand Then EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
|
End If
|
||||||
Else
|
Else
|
||||||
|
|
||||||
|
' verifico che il pezzo precedente possa essere depositato correttamente
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||||
|
EgtDraw()
|
||||||
|
' esco dal ciclo, prima devo depositare correttamente il pezzo
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' salvo l'indice del pezzo correntemente attaccato alle ventose
|
||||||
|
m_CurrRawOnVacuum = nId
|
||||||
|
|
||||||
|
' Deseleziono tutto e abilito la selezione del pezzo corrente
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
EgtSetStatus(nId, GDB_ST.SEL)
|
EgtSetStatus(nId, GDB_ST.SEL)
|
||||||
' Se con ventose, le posiziono sul grezzo
|
' Se con ventose, le posiziono sul grezzo
|
||||||
If Not m_bByHand Then
|
If Not m_bByHand Then
|
||||||
Dim rmData As New RawMoveData
|
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
|
If PutVacuumCupsOnRaw(nId, rmData) Then
|
||||||
' Visualizzo le ventose
|
' Visualizzo le ventose
|
||||||
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
EgtSetStatus(GetVacuumId(), GDB_ST.ON_)
|
||||||
@@ -249,10 +283,18 @@ Public Class MoveRawPartPage
|
|||||||
' Reset eventuale messaggio
|
' Reset eventuale messaggio
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
Else
|
Else
|
||||||
|
' nascondo la visualizzazione delle ventose
|
||||||
|
EgtSetStatus(GetVacuumId(), GDB_ST.OFF)
|
||||||
' Aggiorno i dati
|
' Aggiorno i dati
|
||||||
m_bRawWithCups = False
|
m_bRawWithCups = False
|
||||||
' Messaggio di avvertimento
|
If VacuumCups.bOverWeight Then
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
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
|
End If
|
||||||
End If
|
End If
|
||||||
@@ -261,8 +303,52 @@ Public Class MoveRawPartPage
|
|||||||
End If
|
End If
|
||||||
nId = EgtGetNextObjInSelWin()
|
nId = EgtGetNextObjInSelWin()
|
||||||
End While
|
End While
|
||||||
|
|
||||||
|
' clicco su un oggetto che non è un grezzo -> verifico che il pezzo precedente possa essere depositato correttamente
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||||
|
EgtDraw()
|
||||||
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' Veririfica che il grezzo non entri in colliosione con altri pezzi
|
||||||
|
Private Function VerifyCollisionWithOtherRawPart(nIdOnVacumm As Integer) As Boolean
|
||||||
|
If nIdOnVacumm = GDB_ID.NULL Then Return False
|
||||||
|
' Creo gruppo temporaneo in cui generare le superfici per la veririfica di collisione
|
||||||
|
Dim m_nTempId As Integer = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
|
EgtSetName(m_nTempId, "RawTemp")
|
||||||
|
Dim nIdActualRawOutLine As Integer = EgtGetFirstNameInGroup(nIdOnVacumm, "RawOutline")
|
||||||
|
Dim ActualRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdActualRawOutLine)
|
||||||
|
Dim nCurrPhase As Integer = EgtGetCurrPhase()
|
||||||
|
Dim nRawGroupId = EgtGetParent(EgtGetFirstRawPart())
|
||||||
|
Dim nIdRaw As Integer = EgtGetFirstRawPart()
|
||||||
|
' ciclo su tutti i grezzi per veririficare eventuali collisioni
|
||||||
|
While nIdRaw <> GDB_ID.NULL
|
||||||
|
' verifico la fase del grezzo
|
||||||
|
If EgtVerifyRawPartCurrPhase(nIdRaw) And nIdOnVacumm <> nIdRaw Then
|
||||||
|
' recupero il contorno del pezzo
|
||||||
|
Dim nIdRawOutLine As Integer = EgtGetFirstNameInGroup(nIdRaw, "RawOutline")
|
||||||
|
Dim nIdRawFlatRegion As Integer = EgtCreateSurfFlatRegion(m_nTempId, nIdRawOutLine)
|
||||||
|
If EgtSurfFrIntersect(nIdRawFlatRegion, ActualRawFlatRegion) Then
|
||||||
|
If EgtExistsObj(nIdRawFlatRegion) Then
|
||||||
|
EgtErase(m_nTempId)
|
||||||
|
' esiste una intersezione delle superfici
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdRaw = EgtGetNextRawPart(nIdRaw)
|
||||||
|
End While
|
||||||
|
EgtErase(m_nTempId)
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
#Region "Move Up/Down/Left/Right"
|
||||||
|
|
||||||
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
|
Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click
|
||||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
@@ -285,9 +371,15 @@ Public Class MoveRawPartPage
|
|||||||
Else
|
Else
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(0, m_dStep, 0)
|
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
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -322,9 +414,15 @@ Public Class MoveRawPartPage
|
|||||||
Else
|
Else
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(0, -m_dStep, 0)
|
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
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.y -= vtMove.y
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -342,9 +440,15 @@ Public Class MoveRawPartPage
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(m_dStep, 0, 0)
|
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
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -361,9 +465,15 @@ Public Class MoveRawPartPage
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim vtMove As New Vector3d(-m_dStep, 0, 0)
|
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
|
If EgtMoveRawPart(nRawId, vtMove) Then
|
||||||
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
EgtMove(GetVacuumId(), vtMove, GDB_RT.GLOB)
|
||||||
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
AddRawMoveData(nRawId, vtMove, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.x -= vtMove.x
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -373,6 +483,77 @@ Public Class MoveRawPartPage
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
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
|
||||||
|
|
||||||
|
#Region "Rotate CounterClockWise/ClockWise"
|
||||||
|
|
||||||
Private Sub RotateCounterClockwiseBtn_Click(sender As Object, e As RoutedEventArgs) Handles RotateCounterClockwiseBtn.Click
|
Private Sub RotateCounterClockwiseBtn_Click(sender As Object, e As RoutedEventArgs) Handles RotateCounterClockwiseBtn.Click
|
||||||
' Solo movimento con ventose
|
' Solo movimento con ventose
|
||||||
If m_bByHand Then Return
|
If m_bByHand Then Return
|
||||||
@@ -380,14 +561,24 @@ Public Class MoveRawPartPage
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim dAng As Double = m_dRotation
|
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
|
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||||
' Recupero il centro del grezzo
|
'' Recupero il centro del grezzo
|
||||||
Dim ptRawCen As Point3d
|
'Dim ptRawCen As Point3d
|
||||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
'EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
' Eseguo la rotazione della ventosa
|
' Eseguo la rotazione della ventosa
|
||||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||||
' Memorizzo
|
' Memorizzo
|
||||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||||
|
VacuumCups.dDegRotStartAng -= dAng
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -404,14 +595,24 @@ Public Class MoveRawPartPage
|
|||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
If m_bRawWithCups Then
|
If m_bRawWithCups Then
|
||||||
Dim dAng As Double = -m_dRotation
|
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
|
If EgtRotateRawPart(nRawId, Vector3d.Z_AX(), dAng) Then
|
||||||
' Recupero il centro del grezzo
|
'' Recupero il centro del grezzo
|
||||||
Dim ptRawCen As Point3d
|
'Dim ptRawCen As Point3d
|
||||||
EgtGetRawPartCenter(nRawId, ptRawCen)
|
'EgtGetRawPartCenter(nRawId, ptRawCen)
|
||||||
' Eseguo la rotazione della ventosa
|
' Eseguo la rotazione della ventosa
|
||||||
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
EgtRotate(GetVacuumId(), ptRawCen, Vector3d.Z_AX(), dAng, GDB_RT.GLOB)
|
||||||
' Memorizzo
|
' Memorizzo
|
||||||
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
AddRawMoveData(nRawId, dAng, m_RawMoveDataList)
|
||||||
|
Else
|
||||||
|
VacuumCups.ptStartPointLift.Rotate(ptRawCen, Vector3d.Z_AX(), dAng)
|
||||||
|
VacuumCups.dDegRotStartAng -= dAng
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
m_CurrProjPage.SetWarningMessage(EgtMsg(MSG_MOVERAWPAGEUC + 2)) 'Pezzo troppo piccolo : non si può muovere
|
||||||
@@ -421,6 +622,44 @@ Public Class MoveRawPartPage
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Rotate CounterClockWise/ClockWise
|
||||||
|
|
||||||
|
' verifica che la rotazione da raggiungere sia nei limiti delle corse
|
||||||
|
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
|
Private Sub RemovePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles RemovePartBtn.Click
|
||||||
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
Dim nRawId As Integer = EgtGetFirstSelectedObj()
|
||||||
While nRawId <> GDB_ID.NULL
|
While nRawId <> GDB_ID.NULL
|
||||||
@@ -658,6 +897,17 @@ Public Class MoveRawPartPage
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
Private Sub PrevBtn_Click(sender As Object, e As RoutedEventArgs) Handles PrevBtn.Click
|
||||||
|
' verifico che il pezzo sia depositabile
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||||
|
EgtDraw()
|
||||||
|
' non cambio pagina
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Torno alla fase precedente
|
' Torno alla fase precedente
|
||||||
@@ -669,6 +919,17 @@ Public Class MoveRawPartPage
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click
|
||||||
|
' verifico che il pezzo sia depositabile
|
||||||
|
If VerifyCollisionWithOtherRawPart(m_CurrRawOnVacuum) Then
|
||||||
|
' mantengo la selezione del pezzo
|
||||||
|
EgtSetStatus(m_CurrRawOnVacuum, GDB_ST.SEL)
|
||||||
|
m_CurrProjPage.SetErrorMessage("Collisione pezzi")
|
||||||
|
EgtDraw()
|
||||||
|
' non cambio pagina
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' resetto l'inidice del pezzo da mnovimentare
|
||||||
|
m_CurrRawOnVacuum = GDB_ID.NULL
|
||||||
' Deseleziono tutto
|
' Deseleziono tutto
|
||||||
EgtDeselectAll()
|
EgtDeselectAll()
|
||||||
' Passo alla pagina delle spezzature
|
' Passo alla pagina delle spezzature
|
||||||
|
|||||||
+10
-4
@@ -99,23 +99,29 @@
|
|||||||
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||||
VerticalAlignment="Center" />
|
VerticalAlignment="Center" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Name ="UG0" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" Columns="3" >
|
||||||
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="InsertPartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Name="StorePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="StorePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
|
<ToggleButton Name="StartCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource StartWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" >
|
||||||
<Button Name="RemovePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
<Button Name="RemovePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||||
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Elimina-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</Button>
|
</Button>
|
||||||
<ToggleButton Name="DragRettanleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
<ToggleButton Name="DragRettanleBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
<Image Source="{DynamicResource Drag_RettangleImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
<Image Source="{DynamicResource Drag_RettangleImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
|
<ToggleButton Name="SplitCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||||
|
<Image Source="{DynamicResource SplitWJImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||||
|
</ToggleButton>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
|
|
||||||
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
|
<UniformGrid Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="3" Columns="2" >
|
||||||
|
|||||||
+438
-9
@@ -16,12 +16,18 @@ Public Class NestPageUC
|
|||||||
' dati per DragRettangoli (estensio/accorciamento dei rettangoli trascinando un lato)
|
' dati per DragRettangoli (estensio/accorciamento dei rettangoli trascinando un lato)
|
||||||
Private m_bIsVisibleDragRettangle As Boolean = False
|
Private m_bIsVisibleDragRettangle As Boolean = False
|
||||||
Friend m_bIsCheckedDragRettangle As Boolean = False
|
Friend m_bIsCheckedDragRettangle As Boolean = False
|
||||||
|
' dati per attivare disattivare le lavorazioni WaterJet
|
||||||
|
Private m_bIsVisibleSliptCurveWJ As Boolean = False
|
||||||
|
Friend m_bIsCheckedSplitCurveWJ As Boolean = False
|
||||||
|
' dati per attivare disattivare la selezione del pubnto di inizio
|
||||||
|
Private m_bIsVisibleStarCurvetWJ As Boolean = False
|
||||||
|
Friend m_bIsCheckedStartCurveWJ As Boolean = False
|
||||||
|
|
||||||
' Id della curva e del taglio selezionati per eseguire il test
|
' Id della curva e del taglio selezionati per eseguire il test
|
||||||
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
||||||
Friend m_CurrSelectedSawCurv As Integer = GDB_ID.NULL
|
Friend m_CurrSelectedSawCurv As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
' Id del rettangolo, del traglio e della curva da modificare tramite Drag
|
' Id del rettangolo, del taglio e della curva da modificare tramite Drag
|
||||||
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
Private m_nIdSelectedOutLoopRettangle As Integer = GDB_ID.NULL
|
||||||
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
|
Private m_nIdSelectedRegionRettangle As Integer = GDB_ID.NULL
|
||||||
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
|
Private m_nIdSelectedSawRettangle As Integer = GDB_ID.NULL
|
||||||
@@ -33,6 +39,10 @@ Public Class NestPageUC
|
|||||||
Private m_sTextContent As String = String.Empty
|
Private m_sTextContent As String = String.Empty
|
||||||
Private m_dRettangleIsModified As Boolean = False
|
Private m_dRettangleIsModified As Boolean = False
|
||||||
|
|
||||||
|
' Id dei lato WJ da separare tramite comando ON_OFF
|
||||||
|
Private m_nIdSelectedSideWJ As Integer = GDB_ID.NULL
|
||||||
|
Private m_nIdSelectedWaterJet As Integer = GDB_ID.NULL
|
||||||
|
|
||||||
Enum PART_POS As Integer
|
Enum PART_POS As Integer
|
||||||
IN_TABLE = -1
|
IN_TABLE = -1
|
||||||
NONE_TABLE = 0
|
NONE_TABLE = 0
|
||||||
@@ -85,13 +95,36 @@ Public Class NestPageUC
|
|||||||
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
|
SelectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 4) 'Select All - Seleziona Tutto
|
||||||
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
DeselectAllBtn.ToolTip = EgtMsg(MSG_NESTPAGEUC + 5) 'Deselect All - Deseleziona Tutto
|
||||||
|
|
||||||
|
Dim nColumsIn_UG1 As Integer = 2
|
||||||
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
' gestisco la visualizzazione del comando PAN (per il drag dei rettangoli)
|
||||||
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
m_bIsVisibleDragRettangle = (GetPrivateProfileInt(S_NEST, K_DRAG_RETTANGLE, 0, m_MainWindow.GetIniFile()) <> 0)
|
||||||
If Not m_bIsVisibleDragRettangle Then
|
If Not m_bIsVisibleDragRettangle Then
|
||||||
UG1.Columns = 1
|
nColumsIn_UG1 = 1
|
||||||
DragRettanleBtn.Visibility = Visibility.Collapsed
|
DragRettanleBtn.Visibility = Visibility.Collapsed
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' gestisco la visualizzazione del comando Splt (per i tagli waterjet)
|
||||||
|
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
|
||||||
|
nColumsIn_UG1 += 1
|
||||||
|
SplitCurveWJBtn.Visibility = Visibility.Visible
|
||||||
|
'91133=Separa
|
||||||
|
SplitCurveWJBtn.ToolTip = EgtMsg(91133)
|
||||||
|
Else
|
||||||
|
SplitCurveWJBtn.Visibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
UG1.Columns = nColumsIn_UG1
|
||||||
|
|
||||||
|
Dim nColumnIn_UG0 As Integer = 2
|
||||||
|
' gestisco la visualizzazione del comando Punto_Inizio (per i tagli waterjet)
|
||||||
|
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
|
||||||
|
nColumnIn_UG0 += 1
|
||||||
|
StartCurveWJBtn.Visibility = Visibility.Visible
|
||||||
|
' 91132=Start
|
||||||
|
StartCurveWJBtn.ToolTip = EgtMsg(91132)
|
||||||
|
Else
|
||||||
|
StartCurveWJBtn.Visibility = Visibility.Collapsed
|
||||||
|
End If
|
||||||
|
UG0.Columns = nColumnIn_UG0
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||||
@@ -191,7 +224,7 @@ Public Class NestPageUC
|
|||||||
End If
|
End If
|
||||||
' recupero il gruppo della lavorazione associata
|
' recupero il gruppo della lavorazione associata
|
||||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||||
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
Dim nIdSaw As Integer = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||||
If Not EgtGetGroupObjs(nIdSaw) Then
|
If Not EgtGetGroupObjs(nIdSaw) Then
|
||||||
m_CurrSelectedSawCurv = nIdSaw
|
m_CurrSelectedSawCurv = nIdSaw
|
||||||
@@ -209,6 +242,161 @@ Public Class NestPageUC
|
|||||||
Return
|
Return
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
' funzione per la selezione dei lati su cui operare la separazione del tagli waterjet
|
||||||
|
Private Sub OnMyMouseDownSceneSplitCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||||
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
|
If Not m_bActive Or m_bRegister Then Return
|
||||||
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||||
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||||
|
Not m_bIsCheckedSplitCurveWJ Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
' Se esiste un elemento selezionato
|
||||||
|
EgtResetMark(m_nIdSelectedWaterJet)
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||||
|
Dim nSelMy As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
Dim sLayer As String = String.Empty
|
||||||
|
' layer di origine
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
||||||
|
' recupero il nome del Layer
|
||||||
|
EgtGetName(nIdParent, sLayer)
|
||||||
|
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
||||||
|
If sLayer = NAME_OUTLOOP Then
|
||||||
|
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
||||||
|
If m_nIdSelectedSideWJ <> GDB_ID.NULL Or m_nIdSelectedSideWJ = nIdMy Then
|
||||||
|
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||||
|
End If
|
||||||
|
' recupero il gruppo della lavorazione associata
|
||||||
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||||
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||||
|
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet associate a questo Part
|
||||||
|
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
||||||
|
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
|
||||||
|
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
|
||||||
|
' se non esiste almeno 1 Preview di tipo WaterJet
|
||||||
|
If ListGroup.Count > 0 Then
|
||||||
|
m_nIdSelectedSideWJ = nIdMy
|
||||||
|
Dim nValInfo As String = 1
|
||||||
|
Dim nNewValInfo As Integer = nValInfo
|
||||||
|
If EgtGetInfo(nIdMy, INFO_JOINENTITY, nValInfo) Then
|
||||||
|
If nValInfo = 1 Then
|
||||||
|
nNewValInfo = 0
|
||||||
|
Else
|
||||||
|
nNewValInfo = 1
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
' se manca l'info allora il taglio sValInfo = "1" quindi separo il taglio
|
||||||
|
nNewValInfo = 0
|
||||||
|
End If
|
||||||
|
EgtSetInfo(nIdMy, INFO_JOINENTITY, nNewValInfo)
|
||||||
|
' Ricalcolo tutte le lavorazioni
|
||||||
|
Dim nWarn As Integer = 0
|
||||||
|
ResetAllMachinings(nWarn)
|
||||||
|
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
||||||
|
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
||||||
|
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
||||||
|
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
||||||
|
' assegno un identificativo grafico per inidcare che è un taglio separato
|
||||||
|
If nNewValInfo = 0 Then
|
||||||
|
AssignFlagOnGraphic(nIdMy, nIdParentPart)
|
||||||
|
Else
|
||||||
|
EraseFlagOnGraphic(nIdMy, nIdParentPart)
|
||||||
|
End If
|
||||||
|
m_nIdSelectedWaterJet = nIdWJ
|
||||||
|
' salvo il valore del PreView evidenziato
|
||||||
|
EgtSetMark(nIdWJ)
|
||||||
|
EgtSelectObj(nIdMy)
|
||||||
|
EgtDraw()
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdMy = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
Return
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' funzione per la selezione del punto di inizio tagli waterjet (percorso chiuso)
|
||||||
|
Private Sub OnMyMouseDownSceneStartCurv(sender As Object, e As System.Windows.Forms.MouseEventArgs)
|
||||||
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
|
If Not m_bActive Or m_bRegister Then Return
|
||||||
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||||
|
If e.Button <> Windows.Forms.MouseButtons.Left Or
|
||||||
|
Not m_bIsCheckedStartCurveWJ Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Acquisisco punto da disegno
|
||||||
|
Dim ptStartCurv As New Point3d
|
||||||
|
EgtUnProjectPoint(e.Location, ptStartCurv)
|
||||||
|
' Aggiusto Z punto acquisito (è in globale)
|
||||||
|
Dim ptRawMax As New Point3d
|
||||||
|
Dim ptRawMin As New Point3d
|
||||||
|
If GetRawBox(ptRawMin, ptRawMax) Then
|
||||||
|
ptStartCurv.z = ptRawMax.z
|
||||||
|
End If
|
||||||
|
|
||||||
|
' Se esiste un elemento selezionato
|
||||||
|
EgtResetMark(m_nIdSelectedWaterJet)
|
||||||
|
' Verifico se selezionato indicativo di pezzo
|
||||||
|
EgtSetObjFilterForSelWin(False, True, False, False, False)
|
||||||
|
Dim nSelMy As Integer
|
||||||
|
EgtSelect(e.Location, Scene.DIM_SEL, Scene.DIM_SEL, nSelMy)
|
||||||
|
Dim nIdMy As Integer = EgtGetFirstObjInSelWin()
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
Dim sLayer As String = String.Empty
|
||||||
|
' layer di origine
|
||||||
|
Dim nIdParent As Integer = EgtGetParent(nIdMy)
|
||||||
|
' recupero il nome del Layer
|
||||||
|
EgtGetName(nIdParent, sLayer)
|
||||||
|
' solo se il nome del layer è quello associato ad un lato esterno allora procedo con l'evidenziazione
|
||||||
|
If sLayer = NAME_OUTLOOP Or sLayer = NAME_INLOOP Then
|
||||||
|
If EgtGetType(nIdMy) = GDB_TY.CRV_ARC OrElse EgtGetType(nIdMy) = GDB_TY.CRV_COMPO OrElse EgtGetType(nIdMy) = GDB_TY.CRV_LINE Then
|
||||||
|
' verifico che il contorno sia chiuso, altrimenti esco
|
||||||
|
If Not VerifyOutLoopIsClosed(nIdParent) Then
|
||||||
|
' 91131=Il contorno non è chiuso
|
||||||
|
m_CurrProjPage.SetWarningMessage(EgtMsg(91131))
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
' recupero il gruppo della lavorazione associata
|
||||||
|
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||||
|
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, NAME_PREVIEW)
|
||||||
|
' VERIFICA: recupero l'elenco delle Preview di Tipo WaterJet_n_S associate a questo Part
|
||||||
|
Dim ListGroup As List(Of Integer) = ResearchGropuWJ(nIdParent, nIdPV)
|
||||||
|
' VERIFICA: se esistono delle lavorazioni associate al percorso OutLoop di tipo Saw allora non procedo
|
||||||
|
Dim ListGroupSaw As List(Of Integer) = ResearchGropuSaw(nIdParent, nIdPV)
|
||||||
|
' se non esiste almeno 1 Preview di tipo WaterJet
|
||||||
|
If ListGroup.Count = 1 And ListGroupSaw.Count = 0 Then
|
||||||
|
EgtSetInfo(nIdParent, INFO_START, ptStartCurv)
|
||||||
|
' Ricalcolo tutte le lavorazioni
|
||||||
|
Dim nWarn As Integer = 0
|
||||||
|
ResetAllMachinings(nWarn)
|
||||||
|
' recupero l'indice del PreView che deve essere acceso per indicare la selezione
|
||||||
|
ListGroup = ResearchGropuWJ(nIdParent, nIdPV)
|
||||||
|
Dim nIdWJ As Integer = GetPVIdFromIdSide(ListGroup, nIdMy)
|
||||||
|
GetCurrentPVFromIdSide(ListGroup, nIdMy, nIdWJ, nIdParent)
|
||||||
|
m_nIdSelectedWaterJet = nIdWJ
|
||||||
|
EgtSetMark(nIdWJ)
|
||||||
|
EgtDraw()
|
||||||
|
Exit While
|
||||||
|
Else
|
||||||
|
' 91131=Il contorno non è chiuso
|
||||||
|
m_CurrProjPage.SetWarningMessage(EgtMsg(91131))
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
nIdMy = EgtGetNextObjInSelWin()
|
||||||
|
End While
|
||||||
|
Return
|
||||||
|
End Sub
|
||||||
|
|
||||||
#Region "DRAG RETTANGLE"
|
#Region "DRAG RETTANGLE"
|
||||||
|
|
||||||
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
|
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
|
||||||
@@ -216,7 +404,7 @@ Public Class NestPageUC
|
|||||||
' Verifico di essere il gestore attivo e non in modalità registrazione
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
If Not m_bActive Or m_bRegister Then Return
|
If Not m_bActive Or m_bRegister Then Return
|
||||||
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
' Si può selezionare solo con il tasto sinistro e se il bottone TEST Attivo
|
||||||
If e.Button <> Windows.Forms.MouseButtons.Left then
|
If e.Button <> Windows.Forms.MouseButtons.Left Then
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' Verifico se selezionato indicativo di pezzo
|
' Verifico se selezionato indicativo di pezzo
|
||||||
@@ -511,6 +699,186 @@ Public Class NestPageUC
|
|||||||
|
|
||||||
#End Region ' Drag Rettangolo
|
#End Region ' Drag Rettangolo
|
||||||
|
|
||||||
|
#Region "SPLIT/START CURVE"
|
||||||
|
|
||||||
|
' restituisce l'elenco dei Gruppi Waterjet associati al contorno indicato
|
||||||
|
Public Function ResearchGropuWJ(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
|
||||||
|
Dim ListOfGroupPV As New List(Of Integer)
|
||||||
|
Dim nIdGroup As Integer = GDB_ID.NULL
|
||||||
|
Dim nIdMy As Integer = GDB_ID.NULL
|
||||||
|
' recupero il primo lato dall'elenco dei lati della figura
|
||||||
|
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
|
||||||
|
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
' verifico se esiste una Preview associata al lato
|
||||||
|
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
|
||||||
|
If nIdGroup <> GDB_ID.NULL Then
|
||||||
|
ListOfGroupPV.Add(nIdGroup)
|
||||||
|
End If
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
Return ListOfGroupPV
|
||||||
|
End Function
|
||||||
|
|
||||||
|
' restituisce l'elenco dei Gruppi Saw associati al contorno indicato
|
||||||
|
Public Function ResearchGropuSaw(nIdOutLoop As Integer, nIdPV As Integer) As List(Of Integer)
|
||||||
|
Dim ListOfGroupPV As New List(Of Integer)
|
||||||
|
Dim nIdGroup As Integer = GDB_ID.NULL
|
||||||
|
Dim nIdMy As Integer = GDB_ID.NULL
|
||||||
|
' recupero il primo lato dall'elenco dei lati della figura
|
||||||
|
nIdMy = EgtGetFirstInGroup(nIdOutLoop)
|
||||||
|
' altrimenti cerco all'interno del layer OutLoop per ogni lato la lavorazione associata
|
||||||
|
While nIdMy <> GDB_ID.NULL
|
||||||
|
' verifico se esiste una Preview associata al lato
|
||||||
|
nIdGroup = EgtGetFirstNameInGroup(nIdPV, "Saw" & nIdMy.ToString)
|
||||||
|
If nIdGroup <> GDB_ID.NULL Then
|
||||||
|
ListOfGroupPV.Add(nIdGroup)
|
||||||
|
End If
|
||||||
|
nIdMy = EgtGetNext(nIdMy)
|
||||||
|
End While
|
||||||
|
Return ListOfGroupPV
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Function GetPVIdFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer) As Integer
|
||||||
|
Dim IdWaterjetPV As Integer = GDB_ID.NULL
|
||||||
|
For Each nIdItem As Integer In ListGroup
|
||||||
|
Dim sName As String = String.Empty
|
||||||
|
If EgtGetName(nIdItem, sName) Then
|
||||||
|
If sName.Contains(nIdMy.ToString) Then
|
||||||
|
IdWaterjetPV = nIdItem
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Return IdWaterjetPV
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Public Sub GetCurrentPVFromIdSide(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, nIdParent As Integer)
|
||||||
|
Dim nObjInGroup As Integer = EgtGetGroupObjs(nIdParent)
|
||||||
|
Dim nCount As Integer = 0
|
||||||
|
GetNextSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
||||||
|
If nIdWj <> GDB_ID.NULL Then Return
|
||||||
|
GetPrevSideJoint(ListGroup, nIdMy, nIdWj, nCount, nObjInGroup)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
||||||
|
Private Sub GetNextSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
||||||
|
Dim nValInfo As Integer = 1
|
||||||
|
' espressione di controllo per evitare di generare Loop infinito
|
||||||
|
If nCount > nObjInGroup Then Return
|
||||||
|
If nIdWj = GDB_ID.NULL Then
|
||||||
|
Dim nIdWJNext As Integer = EgtGetNext(nIdMy)
|
||||||
|
If nIdWJNext = GDB_ID.NULL Then nIdWJNext = EgtGetFirstInGroup(EgtGetParent(nIdMy))
|
||||||
|
nCount += 1
|
||||||
|
EgtGetInfo(nIdWJNext, INFO_JOINENTITY, nValInfo)
|
||||||
|
If nValInfo = 1 Then
|
||||||
|
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJNext)
|
||||||
|
If nIdWj <> GDB_ID.NULL Then Return
|
||||||
|
Else
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
'nIdWJNext = EgtGetNext(nIdWJNext)
|
||||||
|
GetNextSideJoint(ListGroup, nIdWJNext, nIdWj, nCount, nObjInGroup)
|
||||||
|
If nIdWj <> GDB_ID.NULL Then Return
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' funzione ricorsiva per la ricerca del lato al quale è associata la PreView
|
||||||
|
Private Sub GetPrevSideJoint(ListGroup As List(Of Integer), nIdMy As Integer, ByRef nIdWj As Integer, ByRef nCount As Integer, nObjInGroup As Integer)
|
||||||
|
Dim nValInfo As Integer = 1
|
||||||
|
' espressione di controllo per evitare di generare Loop infinito
|
||||||
|
If nCount > nObjInGroup Then Return
|
||||||
|
If nIdWj = GDB_ID.NULL Then
|
||||||
|
Dim nIdWJPrev As Integer = EgtGetPrev(nIdMy)
|
||||||
|
' se arrivato al primo valore allora continuo la ricerca dall'ultimo
|
||||||
|
If nIdWJPrev = GDB_ID.NULL Then nIdWJPrev = EgtGetLastInGroup(EgtGetParent(nIdMy))
|
||||||
|
nCount += 1
|
||||||
|
EgtGetInfo(nIdWJPrev, INFO_JOINENTITY, nValInfo)
|
||||||
|
If nValInfo = 1 Then
|
||||||
|
nIdWj = GetPVIdFromIdSide(ListGroup, nIdWJPrev)
|
||||||
|
If nIdWj <> GDB_ID.NULL Then Return
|
||||||
|
Else
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
'nIdWJPrev = EgtGetPrev(nIdWJPrev)
|
||||||
|
GetPrevSideJoint(ListGroup, nIdWJPrev, nIdWj, nCount, nObjInGroup)
|
||||||
|
If nIdWj <> GDB_ID.NULL Then Return
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub ResetSplitCurvWJParam()
|
||||||
|
EgtDeselectObj(m_nIdSelectedSideWJ)
|
||||||
|
EgtResetMark(m_nIdSelectedWaterJet)
|
||||||
|
m_nIdSelectedSideWJ = GDB_ID.NULL
|
||||||
|
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
' ricevo l'ID del percorso di lavorazione WJ al quale associo una etichetta grafica con scritto "S"
|
||||||
|
Private Sub AssignFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
|
||||||
|
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
|
||||||
|
If IdAuxLayer = GDB_ID.NULL Then
|
||||||
|
IdAuxLayer = EgtCreateGroup(IdParentPart)
|
||||||
|
EgtSetName(IdAuxLayer, INFO_AUX_SPLIT_WJ)
|
||||||
|
End If
|
||||||
|
' recupero il punto medio del segmento selezionato
|
||||||
|
Dim MidPoint As Point3d
|
||||||
|
EgtMidPoint(nIdMy, GDB_RT.GLOB, MidPoint)
|
||||||
|
'Dim nIdTextFlag As Integer = EgtCreateText(IdAuxLayer, MidPoint, "*", 20, GDB_RT.GLOB)
|
||||||
|
Dim nIdTextFlag As Integer = GetCreateFlagText(nIdMy, IdAuxLayer)
|
||||||
|
EgtSetColor(nIdTextFlag, New Color3d(255, 0, 0))
|
||||||
|
EgtSetName(nIdTextFlag, "RefSide_" & nIdMy.ToString)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function GetCreateFlagText(nId As Integer, nIdLayer As Integer, Optional sText As String = "*") As Integer
|
||||||
|
' recupero il punto medio
|
||||||
|
Dim MidPoint As Point3d
|
||||||
|
EgtMidPoint(nId, GDB_RT.GLOB, MidPoint)
|
||||||
|
' recupero la direzione del vettore nel punto medio
|
||||||
|
Dim vVers As Vector3d
|
||||||
|
EgtMidVector(nId, GDB_RT.GLOB, vVers)
|
||||||
|
vVers.Normalize()
|
||||||
|
vVers.Rotate(Vector3d.Z_AX, 90)
|
||||||
|
' Ingombro complessivo della lavorazione
|
||||||
|
Dim ptMin, ptMax As Point3d
|
||||||
|
EgtStartPoint(nId, GDB_RT.GLOB, ptMin)
|
||||||
|
EgtEndPoint(nId, GDB_RT.GLOB, ptMax)
|
||||||
|
' Metto il numero nel centro
|
||||||
|
Dim dRadXY = Point3d.DistXY(ptMin, ptMax)
|
||||||
|
Dim dHtxt As Double = 50
|
||||||
|
Dim dRat As Double = 0.75
|
||||||
|
If dRadXY < 200 Then
|
||||||
|
dHtxt = 40
|
||||||
|
dRat = 0.6
|
||||||
|
ElseIf dRadXY < 25 Then
|
||||||
|
dHtxt = 25
|
||||||
|
dRat = 0.5
|
||||||
|
End If
|
||||||
|
' determino la posizione del flag
|
||||||
|
MidPoint.x += vVers.x * dHtxt / 2
|
||||||
|
MidPoint.y += vVers.y * dHtxt / 2
|
||||||
|
|
||||||
|
Return EgtCreateTextAdv(nIdLayer, MidPoint, 0, sText, "", 300, False, dHtxt, dRat, 0, INS_POS.MC, GDB_RT.GLOB)
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Sub EraseFlagOnGraphic(nIdMy As Integer, IdParentPart As Integer)
|
||||||
|
' cerco se esiste già un layer nominato "AUX_SPLIT_WJ", altrimenti lo creo
|
||||||
|
Dim IdAuxLayer As Integer = EgtGetFirstNameInGroup(IdParentPart, INFO_AUX_SPLIT_WJ)
|
||||||
|
If IdAuxLayer = GDB_ID.NULL Then Return
|
||||||
|
Dim nIdTextFlag As Integer = EgtGetFirstNameInGroup(IdAuxLayer, "RefSide_" & nIdMy.ToString)
|
||||||
|
EgtErase(nIdTextFlag)
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub ResetStartCurvWJParam()
|
||||||
|
EgtResetMark(m_nIdSelectedWaterJet)
|
||||||
|
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
#End Region ' Split/Start Curve
|
||||||
|
|
||||||
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene
|
||||||
' Verifico di essere il gestore attivo e non in modalità registrazione
|
' Verifico di essere il gestore attivo e non in modalità registrazione
|
||||||
If Not m_bActive Or m_bRegister Then Return
|
If Not m_bActive Or m_bRegister Then Return
|
||||||
@@ -539,6 +907,18 @@ Public Class NestPageUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' se in modalità SplitCurveWJ (separazione dei tagli WaterJet)
|
||||||
|
If m_bIsCheckedSplitCurveWJ Then
|
||||||
|
OnMyMouseDownSceneSplitCurv(sender, e)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
|
' se in modalità StartCurveWJ (punto di inzio taglio waterjet)
|
||||||
|
If m_bIsCheckedStartCurveWJ Then
|
||||||
|
OnMyMouseDownSceneStartCurv(sender, e)
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Per default no drag
|
' Per default no drag
|
||||||
m_bDrag = False
|
m_bDrag = False
|
||||||
' Verifico se selezionato indicativo di pezzo
|
' Verifico se selezionato indicativo di pezzo
|
||||||
@@ -588,10 +968,10 @@ Public Class NestPageUC
|
|||||||
|
|
||||||
' Drag possibile
|
' Drag possibile
|
||||||
m_bDrag = True
|
m_bDrag = True
|
||||||
Exit While
|
Exit While
|
||||||
Else
|
Else
|
||||||
' verifico se l'elemento selezionato è il nome della tavola
|
' verifico se l'elemento selezionato è il nome della tavola
|
||||||
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
|
If EgtGetType(nId) = GDB_TY.EXT_TEXT AndAlso (sNamePartId = MAIN_TAB Or sNamePartId = SECOND_TAB) Then
|
||||||
Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
||||||
' se non è stata eseguita nessuna scelta esco dal ciclo
|
' se non è stata eseguita nessuna scelta esco dal ciclo
|
||||||
If nRes = 0 Then Exit While
|
If nRes = 0 Then Exit While
|
||||||
@@ -802,12 +1182,19 @@ Public Class NestPageUC
|
|||||||
If Not m_bActive Then Return
|
If Not m_bActive Then Return
|
||||||
' verifico che non sia attivo il comando Test
|
' verifico che non sia attivo il comando Test
|
||||||
If m_bSelectCurv Then Return
|
If m_bSelectCurv Then Return
|
||||||
' verifico che non sia attivo il comando di Drag dei rettangoli
|
' verifico che sia attivo il comando di Drag dei rettangoli
|
||||||
If m_bIsCheckedDragRettangle Then
|
If m_bIsCheckedDragRettangle Then
|
||||||
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
||||||
ResetDragRettangleParam()
|
ResetDragRettangleParam()
|
||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
|
' verifico che sia attivo il comando di modifica tagli waterjet
|
||||||
|
If m_bIsCheckedSplitCurveWJ Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
If m_bIsCheckedStartCurveWJ Then
|
||||||
|
Return
|
||||||
|
End If
|
||||||
|
|
||||||
' Se eseguito drag
|
' Se eseguito drag
|
||||||
If Not m_bDragToStart Then
|
If Not m_bDragToStart Then
|
||||||
@@ -1850,6 +2237,12 @@ Public Class NestPageUC
|
|||||||
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
|
Private Sub DragRettangle_Click() Handles DragRettanleBtn.Click
|
||||||
If DragRettanleBtn.IsChecked Then
|
If DragRettanleBtn.IsChecked Then
|
||||||
m_bIsCheckedDragRettangle = True
|
m_bIsCheckedDragRettangle = True
|
||||||
|
SplitCurveWJBtn.IsChecked = False
|
||||||
|
ResetSplitCurvWJParam()
|
||||||
|
m_bIsCheckedSplitCurveWJ = False
|
||||||
|
StartCurveWJBtn.IsChecked = False
|
||||||
|
ResetStartCurvWJParam()
|
||||||
|
m_bIsCheckedStartCurveWJ = False
|
||||||
Else
|
Else
|
||||||
m_bIsCheckedDragRettangle = False
|
m_bIsCheckedDragRettangle = False
|
||||||
ResetDragRettangleParam()
|
ResetDragRettangleParam()
|
||||||
@@ -1859,6 +2252,42 @@ Public Class NestPageUC
|
|||||||
EgtDraw()
|
EgtDraw()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub SplitCurveWJBtn_Click() Handles SplitCurveWJBtn.Click
|
||||||
|
If SplitCurveWJBtn.IsChecked Then
|
||||||
|
m_bIsCheckedSplitCurveWJ = True
|
||||||
|
DragRettanleBtn.IsChecked = False
|
||||||
|
m_bIsCheckedDragRettangle = False
|
||||||
|
StartCurveWJBtn.IsChecked = False
|
||||||
|
ResetStartCurvWJParam()
|
||||||
|
m_bIsCheckedStartCurveWJ = False
|
||||||
|
Else
|
||||||
|
m_bIsCheckedSplitCurveWJ = False
|
||||||
|
' resetto i parametri di selezione dei lati
|
||||||
|
ResetSplitCurvWJParam()
|
||||||
|
m_CurrProjPage.ClearMessage()
|
||||||
|
ShowParkedParts()
|
||||||
|
End If
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub StartCurveWJBtn_Click() Handles StartCurveWJBtn.Click
|
||||||
|
If StartCurveWJBtn.IsChecked Then
|
||||||
|
m_bIsCheckedStartCurveWJ = True
|
||||||
|
DragRettanleBtn.IsChecked = False
|
||||||
|
m_bIsCheckedDragRettangle = False
|
||||||
|
ResetSplitCurvWJParam()
|
||||||
|
SplitCurveWJBtn.IsChecked = False
|
||||||
|
m_bIsCheckedSplitCurveWJ = False
|
||||||
|
Else
|
||||||
|
m_bIsCheckedStartCurveWJ = False
|
||||||
|
' resetto i parametri di selezione dei lati
|
||||||
|
ResetStartCurvWJParam()
|
||||||
|
m_CurrProjPage.ClearMessage()
|
||||||
|
ShowParkedParts()
|
||||||
|
End If
|
||||||
|
EgtDraw()
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Sub StorePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StorePartBtn.Click
|
Private Sub StorePartBtn_Click(sender As Object, e As RoutedEventArgs) Handles StorePartBtn.Click
|
||||||
' creo la lista delle famiglie di pezzi presenti in parcheggio
|
' creo la lista delle famiglie di pezzi presenti in parcheggio
|
||||||
GetFamilyGroupInPark()
|
GetFamilyGroupInPark()
|
||||||
|
|||||||
@@ -1467,8 +1467,37 @@ Public Class SplitPageUC
|
|||||||
' assegno numerazione
|
' assegno numerazione
|
||||||
NumberDirectionMachining(nI)
|
NumberDirectionMachining(nI)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
|
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||||
|
Dim ActiveMachLst As New List(Of Integer)
|
||||||
|
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||||
|
ActiveMachLst.Add(ItemSplitMach.Ind)
|
||||||
|
Next
|
||||||
|
' -------------------- Recupero le lavorazioni indicate come attive --------------------
|
||||||
|
|
||||||
' Preparo la lista degli Item
|
' Preparo la lista degli Item
|
||||||
ShowMachiningList()
|
ShowMachiningList()
|
||||||
|
|
||||||
|
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||||
|
|
||||||
|
For Each Item As SplitMach In m_MachiningList
|
||||||
|
EgtSetInfo(Item.m_nId, INFO_MCH_USER_OFF, True)
|
||||||
|
Next
|
||||||
|
|
||||||
|
For nIndex As Integer = 0 To ActiveMachLst.Count - 1
|
||||||
|
For Each ItemSplitMach As NameIdLsBxItem In m_ItemList
|
||||||
|
If ItemSplitMach.Ind = ActiveMachLst(nIndex) Then
|
||||||
|
EgtRemoveInfo(m_MachiningList(ItemSplitMach.Ind).m_nId, INFO_MCH_USER_OFF)
|
||||||
|
m_MachiningList(ItemSplitMach.Ind).m_bEnabled = True
|
||||||
|
ItemSplitMach.bIsActive = True
|
||||||
|
' sistemo colore
|
||||||
|
ColorMachining(m_MachiningList(ItemSplitMach.Ind))
|
||||||
|
Exit For
|
||||||
|
End If
|
||||||
|
Next
|
||||||
|
Next
|
||||||
|
' -------------------- Riattivo le lavorazioni precedenti --------------------
|
||||||
|
|
||||||
' Aggiorno visualizzazione
|
' Aggiorno visualizzazione
|
||||||
EgtDraw()
|
EgtDraw()
|
||||||
' Aggiono abilitazione bottoni
|
' Aggiono abilitazione bottoni
|
||||||
@@ -1799,6 +1828,15 @@ Public Class SplitPageUC
|
|||||||
vtXY.Normalize()
|
vtXY.Normalize()
|
||||||
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
|
Dim ptCen As Point3d = Point3d.Media(ptMin, ptMax) + vtXY * If(Not b2ndLav, -0.8, 0.8) * dHtxt
|
||||||
ptCen.z = ptMax.z + 1
|
ptCen.z = ptMax.z + 1
|
||||||
|
|
||||||
|
' ricavo la posizione del punto (se waterjet separata)
|
||||||
|
If m_MachiningList(nI).m_nType = MCH_OY.WATERJETTING Or m_MachiningList(nI).m_nType = MCH_OY.MILLING Then
|
||||||
|
Dim ptMid As Point3d
|
||||||
|
Dim vVers As Vector3d
|
||||||
|
MidPointOfCurve(m_MachiningList(nI).m_nId, ptMid, vVers)
|
||||||
|
ptCen = ptMid ' + vVers * If(Not b2ndLav, -0.8, 0.8) * dHtxt
|
||||||
|
End If
|
||||||
|
|
||||||
If bNumber Then
|
If bNumber Then
|
||||||
Dim nNbrId As Integer = EgtCreateTextAdv( m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
|
Dim nNbrId As Integer = EgtCreateTextAdv( m_nNbrGrpId, ptCen, 0, (nI + 1).ToString(), "",
|
||||||
300, False, dHtxt, dRat, 0, INS_POS.MC)
|
300, False, dHtxt, dRat, 0, INS_POS.MC)
|
||||||
@@ -1853,6 +1891,36 @@ Public Class SplitPageUC
|
|||||||
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
|
Return EgtGetBBoxGlob(nPvId, GDB_BB.STANDARD, ptMin, ptMax)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Function MidPointOfCurve(nOperId As Integer, ByRef ptMid As Point3d, ByRef vVers As Vector3d) As Boolean
|
||||||
|
Dim nPvId As Integer = GDB_ID.NULL
|
||||||
|
EgtGetInfo(EgtGetFirstNameInGroup(nOperId, NAME_PREVIEW), INFO_PV_ONPART_ID, nPvId)
|
||||||
|
' creo un layer ausiliario per creare la curva composita
|
||||||
|
Dim AuxLayer As Integer = EgtCreateGroup(nPvId)
|
||||||
|
' imposto la lavorazione corrente
|
||||||
|
EgtSetCurrMachining(nOperId)
|
||||||
|
' recupero tutte le entità della lavorazione corrente
|
||||||
|
Dim nInd As Integer = 0
|
||||||
|
Dim nIdCurr As Integer
|
||||||
|
Dim nSub As Integer
|
||||||
|
Dim CurveCompoList As New List(Of Integer)
|
||||||
|
While EgtGetMachiningGeometry(nInd, nIdCurr, nSub)
|
||||||
|
CurveCompoList.Add(nIdCurr)
|
||||||
|
nInd += 1
|
||||||
|
End While
|
||||||
|
Dim PtNearStart As Point3d
|
||||||
|
Dim nIdCutPath As Integer = EgtCreateCurveCompoByChain(AuxLayer, CurveCompoList.ToArray, PtNearStart, False)
|
||||||
|
Dim dLength As Double = 0
|
||||||
|
EgtCurveLength(nIdCutPath, dLength)
|
||||||
|
Dim dParam As Double = 0
|
||||||
|
EgtCurveParamAtLength(nIdCutPath, dLength / 2, dParam)
|
||||||
|
EgtAtParamPoint(nIdCutPath, dParam, GDB_RT.GLOB, ptMid)
|
||||||
|
EgtAtParamVector(nIdCutPath, dParam, -1, vVers)
|
||||||
|
vVers.Normalize()
|
||||||
|
vVers.Rotate(Vector3d.Z_AX, 90)
|
||||||
|
EgtErase(AuxLayer)
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Private Function AddMachiningDirection( ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
|
Private Function AddMachiningDirection( ptStart As Point3d, vtDir As Vector3d, dLen As Double, bTwin As Boolean) As Integer
|
||||||
Dim dArrX As Double = dLen * Math.Cos( 30 * Math.PI / 180)
|
Dim dArrX As Double = dLen * Math.Cos( 30 * Math.PI / 180)
|
||||||
Dim dArrY As Double = dLen * Math.Sin( 30 * Math.PI / 180)
|
Dim dArrY As Double = dLen * Math.Sin( 30 * Math.PI / 180)
|
||||||
|
|||||||
+147
-4
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports EgtUILib
|
||||||
|
Imports System.Text.RegularExpressions
|
||||||
|
|
||||||
Module VacuumCups
|
Module VacuumCups
|
||||||
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
' Tipo manipolatore con ventosa (0=assente, 1=dietro, 2=laterale)
|
||||||
@@ -10,7 +11,22 @@ Module VacuumCups
|
|||||||
Private m_dPreferredRot As Double = 0
|
Private m_dPreferredRot As Double = 0
|
||||||
Private m_dPrefVertRotXMinus As Double = 0
|
Private m_dPrefVertRotXMinus As Double = 0
|
||||||
Private m_dPrefVertRotXPlus 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
|
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
|
' Nome del gruppo temporaneo per le ventose
|
||||||
Private Const VACTMP_GRP As String = "VacTmp"
|
Private Const VACTMP_GRP As String = "VacTmp"
|
||||||
@@ -50,6 +66,20 @@ Module VacuumCups
|
|||||||
Return m_nVacType
|
Return m_nVacType
|
||||||
End Function
|
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
|
Friend Function GetVacuumId() As Integer
|
||||||
Return m_nVacId
|
Return m_nVacId
|
||||||
End Function
|
End Function
|
||||||
@@ -66,6 +96,8 @@ Module VacuumCups
|
|||||||
' Identificativo riferimento della testa nella macchina
|
' Identificativo riferimento della testa nella macchina
|
||||||
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
Dim nT1Id As Integer = EgtGetFirstNameInGroup(EgtGetHeadId(VACUUM_HEAD), HEAD_FIRST_EXIT)
|
||||||
If nT1Id = GDB_ID.NULL Then Return False
|
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
|
' Creo gruppo temporaneo in cui copiarli
|
||||||
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
m_nTempId = EgtCreateGroup(GDB_ID.ROOT)
|
||||||
If m_nTempId = GDB_ID.NULL Then Return False
|
If m_nTempId = GDB_ID.NULL Then Return False
|
||||||
@@ -78,7 +110,9 @@ Module VacuumCups
|
|||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_PREFROT, m_dPreferredRot)
|
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
|
' 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_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
|
' Direzione di riferimento per tagli Drip
|
||||||
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
EgtGetInfo( m_nVacId, KEY_VACLAY_DRIPREFDIR, m_dDripRefAng)
|
||||||
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
' Nascondo il gruppo ma rendo visibili le curve di contorno delle ventose
|
||||||
@@ -165,6 +199,18 @@ Module VacuumCups
|
|||||||
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
|
EgtGetBBoxGlob(nRKerfId, GDB_BB.STANDARD, b3Kerf)
|
||||||
Dim ptKerfCen As Point3d
|
Dim ptKerfCen As Point3d
|
||||||
EgtCentroid(nRKerfId, GDB_ID.ROOT, ptKerfCen)
|
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
|
' Eseguo ricerca
|
||||||
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
If FindVacuumCupsOnRaw(nRawId, ptRawCen, b3Kerf, ptKerfCen, nKerfId, nRKerfId, rmData) Then
|
||||||
Return True
|
Return True
|
||||||
@@ -187,6 +233,7 @@ Module VacuumCups
|
|||||||
Return False
|
Return False
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
' utilizzata per gestire la movimentazione dei pezzi per eseguire i drip
|
||||||
Friend Function PutVacuumCupsOnPart(nPartId As Integer,
|
Friend Function PutVacuumCupsOnPart(nPartId As Integer,
|
||||||
ByRef rmData As RawMoveData, ByRef b3Part As BBox3d) As Boolean
|
ByRef rmData As RawMoveData, ByRef b3Part As BBox3d) As Boolean
|
||||||
' Ripristino posizione originale ventose
|
' Ripristino posizione originale ventose
|
||||||
@@ -266,6 +313,7 @@ Module VacuumCups
|
|||||||
Dim sCups() As String = Nothing
|
Dim sCups() As String = Nothing
|
||||||
Dim sCups2() As String = Nothing
|
Dim sCups2() As String = Nothing
|
||||||
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
If Not GetVacuumCupSelection(nI, sCups, sCups2) Then Return False
|
||||||
|
bExtraStroke = False
|
||||||
' Determino validità soluzioni della configurazione
|
' Determino validità soluzioni della configurazione
|
||||||
Dim vtMove As New Vector3d
|
Dim vtMove As New Vector3d
|
||||||
Dim ptRotCen As New Point3d
|
Dim ptRotCen As New Point3d
|
||||||
@@ -294,6 +342,7 @@ Module VacuumCups
|
|||||||
Dim frCurrRef As New Frame3d
|
Dim frCurrRef As New Frame3d
|
||||||
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
EgtFrame(m_nRefId, GDB_ID.ROOT, frCurrRef)
|
||||||
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
|
Dim vtDelta As Vector3d = frCurrRef.Orig() - ptRawCen
|
||||||
|
|
||||||
' Assegno dati noti al movimento del grezzo
|
' Assegno dati noti al movimento del grezzo
|
||||||
rmData.m_nId = nRawId
|
rmData.m_nId = nRawId
|
||||||
rmData.m_vtRawMove = Vector3d.NULL()
|
rmData.m_vtRawMove = Vector3d.NULL()
|
||||||
@@ -368,6 +417,23 @@ Module VacuumCups
|
|||||||
If b3Vac.IsEmpty() Then Return INFINITO
|
If b3Vac.IsEmpty() Then Return INFINITO
|
||||||
' Se box maggiore di quello del pezzo, scarto soluzione
|
' Se box maggiore di quello del pezzo, scarto soluzione
|
||||||
If b3Vac.Radius() > b3Raw.Radius() Then Return INFINITO
|
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
|
' Recupero l'area della tavola
|
||||||
Dim b3Tab As New BBox3d
|
Dim b3Tab As New BBox3d
|
||||||
EgtGetTableArea(1, b3Tab)
|
EgtGetTableArea(1, b3Tab)
|
||||||
@@ -383,13 +449,24 @@ Module VacuumCups
|
|||||||
dRotAngDeg = dAngOrizzDeg
|
dRotAngDeg = dAngOrizzDeg
|
||||||
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
If b3Vac.DimY() > b3Vac.DimX() + EPS_SMALL Then dRotAngDeg -= 90
|
||||||
Dim dPreferredRot As Double = m_dPreferredRot
|
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
|
If frMinRect.Orig().x < b3Tab.Center().x Then
|
||||||
dPreferredRot = m_dPrefVertRotXMinus
|
dPreferredRot = m_dPrefVertRotXMinus
|
||||||
else
|
Else
|
||||||
dPreferredRot = m_dPrefVertRotXPlus
|
dPreferredRot = m_dPrefVertRotXPlus
|
||||||
End If
|
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)
|
Dim dAngDelta As Double = If( Math.Abs( b3Vac.DimY() - b3Vac.DimX()) < 10 * EPS_SMALL, 90, 180)
|
||||||
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
While dRotAngDeg - dPreferredRot >= dAngDelta / 2
|
||||||
dRotAngDeg -= dAngDelta
|
dRotAngDeg -= dAngDelta
|
||||||
@@ -446,11 +523,55 @@ Module VacuumCups
|
|||||||
' Applico movimento e rotazione al punto
|
' Applico movimento e rotazione al punto
|
||||||
ptRef.Move(vtMove)
|
ptRef.Move(vtMove)
|
||||||
ptRef.Rotate(ptRotCen, Vector3d.Z_AX(), dRotAngDeg)
|
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
|
' Ne calcolo la distanza dal centro della tavola
|
||||||
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
|
Dim dDist As Double = Point3d.DistXY(ptRef, b3Tab.Center())
|
||||||
Return dDist
|
Return dDist
|
||||||
End Function
|
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,
|
Private Function TestVacuumCups(nCups() As Integer, nRawRegId As Integer,
|
||||||
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
|
vtMove As Vector3d, ptRotCen As Point3d, dRotAngDeg As Double) As Boolean
|
||||||
' Eseguo verifica delle ventose rispetto al grezzo
|
' Eseguo verifica delle ventose rispetto al grezzo
|
||||||
@@ -471,6 +592,28 @@ Module VacuumCups
|
|||||||
Return bVacOk
|
Return bVacOk
|
||||||
End Function
|
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
|
Friend Function SaveOneMoveInfo(nId As Integer, rmData As RawMoveData) As Boolean
|
||||||
' Assegno le informazioni
|
' Assegno le informazioni
|
||||||
EgtSetInfo(nId, "Id", rmData.m_nId)
|
EgtSetInfo(nId, "Id", rmData.m_nId)
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ Module ConstGen
|
|||||||
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
|
Public Const KEY_VACLAY_PREFROT As String = "PreferredRot"
|
||||||
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
|
Public Const KEY_VACLAY_PREFVROTXMINUS As String = "PrefVertRotXMinus"
|
||||||
Public Const KEY_VACLAY_PREFVROTXPLUS As String = "PrefVertRotXPlus"
|
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
|
' Info in gruppo layout per direzione di riferimento ventose per tagli da sotto
|
||||||
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
|
Public Const KEY_VACLAY_DRIPREFDIR As String = "DripRefDir"
|
||||||
' Info in asse rotante ventosa per step discreti
|
' Info in asse rotante ventosa per step discreti
|
||||||
@@ -185,6 +187,8 @@ Module ConstGen
|
|||||||
Public Const INFO_TOTAREA As String = "TotArea"
|
Public Const INFO_TOTAREA As String = "TotArea"
|
||||||
' Info per area da produrre dei pezzi del progetto
|
' Info per area da produrre dei pezzi del progetto
|
||||||
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
Public Const INFO_TOPRODAREA As String = "ToProdArea"
|
||||||
|
' Info per nome progetti
|
||||||
|
Public Const INFO_PROJNAME As String = "ProjName"
|
||||||
|
|
||||||
' Nome layer delle regioni
|
' Nome layer delle regioni
|
||||||
Public Const NAME_REGION As String = "Region"
|
Public Const NAME_REGION As String = "Region"
|
||||||
@@ -300,6 +304,12 @@ Module ConstGen
|
|||||||
Public Const INFO_PARTOK As String = "POK"
|
Public Const INFO_PARTOK As String = "POK"
|
||||||
' Info in pezzo per stato rotazione
|
' Info in pezzo per stato rotazione
|
||||||
Public Const INFO_PARTROT As String = "ROT"
|
Public Const INFO_PARTROT As String = "ROT"
|
||||||
|
' Info in entità in OutLoop per indicare se è separata WaterJet
|
||||||
|
Public Const INFO_JOINENTITY As String = "JoinEntity"
|
||||||
|
' Nome layer per "*" inidcanti un lato separato nel taglio WaterJet
|
||||||
|
Public Const INFO_AUX_SPLIT_WJ As String = "AUX_SPLIT_WJ"
|
||||||
|
' Info in OutLoop per punto inzio lavorazione WaterJet
|
||||||
|
Public Const INFO_START As String = "Start"
|
||||||
|
|
||||||
' Nome di pezzo che è una cornice
|
' Nome di pezzo che è una cornice
|
||||||
Public Const NAME_FRAME As String = "Frame"
|
Public Const NAME_FRAME As String = "Frame"
|
||||||
|
|||||||
@@ -228,6 +228,10 @@
|
|||||||
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
Public Const S_MACH_RAWMOVE As String = "RawMove"
|
||||||
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
Public Const K_MACH_RM_ROTATE As String = "Rotate"
|
||||||
Public Const K_MACH_RM_FINALMOVE As String = "FinalMove"
|
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 S_MACH_REG As String = "Reg"
|
||||||
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
|
Public Const K_MACH_MAX_ROT_ANG As String = "MaxRotAng"
|
||||||
@@ -290,5 +294,6 @@
|
|||||||
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
Public Const K_CURRMATERIAL As String = "CurrMaterial"
|
||||||
Public Const K_MATERIAL As String = "Material"
|
Public Const K_MATERIAL As String = "Material"
|
||||||
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
|
Public Const K_FROMDBWATERJET As String = "FromDBWaterJet"
|
||||||
|
Public Const K_AVERAGEDENSITY As String = "AverageDensity"
|
||||||
|
|
||||||
End Module
|
End Module
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
Imports EgtUILib
|
Imports System.IO
|
||||||
|
Imports EgtUILib
|
||||||
|
|
||||||
Public Class InternalComponentPageUC
|
Public Class InternalComponentPageUC
|
||||||
|
|
||||||
@@ -286,12 +287,22 @@ Public Class InternalComponentPageUC
|
|||||||
If sCompoImage.Length <> 0 Then
|
If sCompoImage.Length <> 0 Then
|
||||||
Try
|
Try
|
||||||
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
|
Dim sPath As String = m_MainWindow.GetResourcesDir() & "\" & sCompoImage
|
||||||
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
|
If File.Exists(sPath) Then
|
||||||
GetImage(index).Height = 65
|
sCompoImageSource = ImageConverter.ConvertFromString(sPath)
|
||||||
GetImage(index).Width = 65
|
GetImage(index).Height = 65
|
||||||
GetImage(index).Source = sCompoImageSource
|
GetImage(index).Width = 65
|
||||||
GetLabel(index).SetValue(Grid.ColumnProperty, 1)
|
GetImage(index).Source = sCompoImageSource
|
||||||
GetLabel(index).SetValue(Grid.ColumnSpanProperty, 1)
|
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
|
Catch ex As Exception
|
||||||
EgtOutLog("Error loading image " & sCompoImage)
|
EgtOutLog("Error loading image " & sCompoImage)
|
||||||
sCompoImage = String.Empty
|
sCompoImage = String.Empty
|
||||||
|
|||||||
+36
-4
@@ -323,8 +323,8 @@ Class MainWindow
|
|||||||
' Verifico abilitazione nesting automatico
|
' Verifico abilitazione nesting automatico
|
||||||
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
m_bAutoNest = Not String.IsNullOrWhiteSpace(sNestKey)
|
||||||
' Recupero opzioni della chiave
|
' Recupero opzioni della chiave
|
||||||
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2404, 1, m_nKeyLevel) And
|
Dim bKey As Boolean = EgtGetKeyLevel(9423, 2405, 1, m_nKeyLevel) And
|
||||||
EgtGetKeyOptions(9423, 2404, 1, m_nKeyOptions)
|
EgtGetKeyOptions(9423, 2405, 1, m_nKeyOptions)
|
||||||
' Verifico abilitazione prodotto
|
' Verifico abilitazione prodotto
|
||||||
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
Dim bProd As Boolean = GetKeyOption(KEY_OPT.CUT_BASE)
|
||||||
' Inizializzazione generale di EgtInterface
|
' Inizializzazione generale di EgtInterface
|
||||||
@@ -571,6 +571,10 @@ Class MainWindow
|
|||||||
TestOff()
|
TestOff()
|
||||||
' disabilito DragRettangle
|
' disabilito DragRettangle
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
' disabilito SplitCurv
|
||||||
|
SplitCurvWJOff()
|
||||||
|
' disattivo StartCurv
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = True
|
WorkInProgressBtn.IsChecked = True
|
||||||
@@ -628,6 +632,8 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
TestOff()
|
TestOff()
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
SplitCurvWJOff()
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = False
|
WorkInProgressBtn.IsChecked = False
|
||||||
@@ -682,6 +688,8 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
TestOff()
|
TestOff()
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
SplitCurvWJOff()
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = False
|
WorkInProgressBtn.IsChecked = False
|
||||||
@@ -735,6 +743,8 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
TestOff()
|
TestOff()
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
SplitCurvWJOff()
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = False
|
WorkInProgressBtn.IsChecked = False
|
||||||
@@ -789,6 +799,8 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
TestOff()
|
TestOff()
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
SplitCurvWJOff()
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = False
|
WorkInProgressBtn.IsChecked = False
|
||||||
@@ -838,6 +850,8 @@ Class MainWindow
|
|||||||
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
m_CurrentProjectPageUC.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||||
TestOff()
|
TestOff()
|
||||||
DragRettangleOff()
|
DragRettangleOff()
|
||||||
|
SplitCurvWJOff()
|
||||||
|
StartCurvWJOff()
|
||||||
Select Case m_ActivePage
|
Select Case m_ActivePage
|
||||||
Case Pages.WorkInProgress
|
Case Pages.WorkInProgress
|
||||||
WorkInProgressBtn.IsChecked = False
|
WorkInProgressBtn.IsChecked = False
|
||||||
@@ -1144,10 +1158,15 @@ Class MainWindow
|
|||||||
Private Sub OnIdle()
|
Private Sub OnIdle()
|
||||||
' Recupero il tipo di progetto
|
' Recupero il tipo di progetto
|
||||||
Dim nPrjType As Integer = m_CurrentProjectPageUC.GetCurrentProjectType()
|
Dim nPrjType As Integer = m_CurrentProjectPageUC.GetCurrentProjectType()
|
||||||
|
' Verifico presenza testa H1 per lama/fresa (nel contesto principale)
|
||||||
|
Dim nCurrCtx As Integer = EgtGetCurrentContext()
|
||||||
|
EgtSetCurrentContext(m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||||
|
Dim bHeadH1 As Boolean = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
||||||
|
EgtSetCurrentContext(nCurrCtx)
|
||||||
' Aggiorno interfaccia
|
' Aggiorno interfaccia
|
||||||
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
CadCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FRAMES)
|
||||||
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
FrameCutBtn.IsEnabled = (nPrjType <> CurrentProjectPageUC.PRJ_TYPE.FLATS) AndAlso bHeadH1
|
||||||
' DirectCutBtn.IsEnabled = (EgtGetHeadId("H1") <> GDB_ID.NULL)
|
' DirectCutBtn.IsEnabled = bHeadH1
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
' Nomi dei file per OmagVIEW
|
' Nomi dei file per OmagVIEW
|
||||||
@@ -1905,4 +1924,17 @@ Class MainWindow
|
|||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Sub SplitCurvWJOff()
|
||||||
|
m_CadCutPageUC.m_NestPage.SplitCurveWJBtn.IsChecked = False
|
||||||
|
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedSplitCurveWJ = False
|
||||||
|
m_CadCutPageUC.m_NestPage.ResetSplitCurvWJParam()
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Public Sub StartCurvWJOff()
|
||||||
|
m_CadCutPageUC.m_NestPage.StartCurveWJBtn.IsChecked = False
|
||||||
|
Me.m_CadCutPageUC.m_NestPage.m_bIsCheckedStartCurveWJ = False
|
||||||
|
m_CadCutPageUC.m_NestPage.ResetStartCurvWJParam()
|
||||||
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
@@ -62,5 +62,5 @@ Imports System.Windows
|
|||||||
' by using the '*' as shown below:
|
' by using the '*' as shown below:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.4.4.1")>
|
<Assembly: AssemblyVersion("2.4.5.4")>
|
||||||
<Assembly: AssemblyFileVersion("2.4.4.1")>
|
<Assembly: AssemblyFileVersion("2.4.5.4")>
|
||||||
|
|||||||
@@ -1255,6 +1255,12 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Resources\GenerateCN.png" />
|
<Resource Include="Resources\GenerateCN.png" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\SPLIT-WJ.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Resource Include="Resources\NewIcons\START-WJ.png" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
<PostBuildEvent>IF "$(PlatformName)"=="x86" IF "$(ConfigurationName)" == "Release" copy $(TargetPath) c:\EgtProg\OmagCUT\OmagCUTR32.exe
|
||||||
|
|||||||
@@ -107,6 +107,8 @@
|
|||||||
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
|
||||||
|
|
||||||
<!--Machine-->
|
<!--Machine-->
|
||||||
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
|
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
|
||||||
|
|||||||
@@ -175,6 +175,8 @@
|
|||||||
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
<BitmapImage x:Key="Seleziona-tuttoImg" UriSource="Resources/NewIcons/Seleziona-tutto.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
<BitmapImage x:Key="Deseleziona-tuttoImg" UriSource="Resources/NewIcons/Deseleziona-tutto.png"></BitmapImage>
|
||||||
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
<BitmapImage x:Key="Drag_RettangleImg" UriSource="Resources/NewIcons/Drag_Rettangle.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="StartWJImg" UriSource="Resources/NewIcons/START-WJ.png"></BitmapImage>
|
||||||
|
<BitmapImage x:Key="SplitWJImg" UriSource="Resources/NewIcons/SPLIT-WJ.png"></BitmapImage>
|
||||||
|
|
||||||
<!--Machine-->
|
<!--Machine-->
|
||||||
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
|
<BitmapImage x:Key="DatiMacchinaImg" UriSource="Resources/NewIcons/DatiMacchina.png"></BitmapImage>
|
||||||
|
|||||||
@@ -252,6 +252,10 @@ Public Class ProjectMgrUC
|
|||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
' Cancello eventuali messaggi
|
' Cancello eventuali messaggi
|
||||||
m_CurrProjPage.ClearMessage()
|
m_CurrProjPage.ClearMessage()
|
||||||
|
' cancello tutti i tagli di separazione (Waterjet)
|
||||||
|
ResetAllSplitCurv()
|
||||||
|
' cancello tutti i punti di inizio (Waterjet)
|
||||||
|
ResetAllStartCurv()
|
||||||
' Ricalcolo tutte le lavorazioni
|
' Ricalcolo tutte le lavorazioni
|
||||||
Dim nWarn As Integer = 0
|
Dim nWarn As Integer = 0
|
||||||
ResetAllMachinings(nWarn)
|
ResetAllMachinings(nWarn)
|
||||||
@@ -353,6 +357,14 @@ Public Class ProjectMgrUC
|
|||||||
Return
|
Return
|
||||||
End If
|
End If
|
||||||
' ---------------------------- Fine modalità test --------------------------------------------
|
' ---------------------------- Fine modalità test --------------------------------------------
|
||||||
|
' se esiste salvo il nome del progetto
|
||||||
|
Dim sCurrProjName As String = String.Empty
|
||||||
|
GetPrivateProfileString(S_GENERAL, K_LASTNAMEPROJ, "", sCurrProjName, m_MainWindow.GetIniFile())
|
||||||
|
If Not String.IsNullOrEmpty(sCurrProjName) Then
|
||||||
|
EgtSetInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME, sCurrProjName)
|
||||||
|
Else
|
||||||
|
EgtRemoveInfo(EgtGetFirstNameInGroup(GDB_ID.ROOT, NAME_PROJMARK), INFO_PROJNAME)
|
||||||
|
End If
|
||||||
|
|
||||||
Dim bOk As Boolean = True
|
Dim bOk As Boolean = True
|
||||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
Reference in New Issue
Block a user