Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| aa237fd744 |
@@ -129,6 +129,40 @@ Friend Module CamAuto
|
||||
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, "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, "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, "JoinEntity", nValInfo) Then
|
||||
If nValInfo = 0 Then Return False
|
||||
End If
|
||||
EgtRemoveInfo(nIdMy, "JoinEntity")
|
||||
nIdMy = EgtGetNext(nIdMy)
|
||||
End While
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Friend Function RemoveFinalEmptyPhases() As Boolean
|
||||
Dim nOpeId As Integer = EgtGetLastOperation()
|
||||
While nOpeId <> GDB_ID.NULL
|
||||
|
||||
@@ -109,6 +109,7 @@ Public Class CadCutPageUC
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx())
|
||||
' Se macchina fotografica collegata, faccio una foto
|
||||
@@ -144,6 +145,7 @@ Public Class CadCutPageUC
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.CurrProjGrid.Visibility = Windows.Visibility.Hidden
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Remove(Me)
|
||||
m_CurrProjPage.CurrentProjectPageGrid.Children.Add(m_MainWindow.m_RawPartPage)
|
||||
@@ -171,6 +173,7 @@ Public Class CadCutPageUC
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_DrawPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Draw
|
||||
@@ -180,6 +183,7 @@ Public Class CadCutPageUC
|
||||
m_MainWindow.TestOff()
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_MainWindow.MainWindowGrid.Children.Remove(m_MainWindow.m_CurrentProjectPageUC)
|
||||
m_MainWindow.MainWindowGrid.Children.Add(m_MainWindow.m_ImportPageUC)
|
||||
m_MainWindow.m_ActivePage = MainWindow.Pages.Import
|
||||
@@ -203,6 +207,7 @@ Public Class CadCutPageUC
|
||||
Private Sub SplitBtn_Click(sender As Object, e As RoutedEventArgs) Handles SplitBtn.Click
|
||||
m_MainWindow.DragRettangleOff()
|
||||
m_MainWindow.SplitCurvWJOff()
|
||||
m_MainWindow.StartCurvWJOff()
|
||||
m_CurrProjPage.m_SceneButtons.MeasureBtn.IsChecked = False
|
||||
EgtDeselectObj(m_NestPage.m_CurrSelectedCurv)
|
||||
m_ProjectMgr.TestBtn.IsChecked = False
|
||||
|
||||
@@ -99,14 +99,17 @@
|
||||
<Image Source="{DynamicResource ClockwiseRotateImg}" Width="65" Height="65" HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center" />
|
||||
</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}">
|
||||
<Image Source="{DynamicResource Inserisci-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<Button Name="StorePartBtn" Style="{DynamicResource OmagCut_YellowIconButton}">
|
||||
<Image Source="{DynamicResource Parcheggia-pezzoImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</Button>
|
||||
<ToggleButton Name="StartCurveWJBtn" Style="{DynamicResource OmagCut_YellowIconToggleButton}">
|
||||
<Image Source="{DynamicResource Inizio-Centro-FuoriImg}" Style="{StaticResource OmagCut_ArrowButtonIcon}"/>
|
||||
</ToggleButton>
|
||||
</UniformGrid>
|
||||
|
||||
<UniformGrid Name ="UG1" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" Columns="3" >
|
||||
|
||||
+130
-10
@@ -19,6 +19,9 @@ Public Class NestPageUC
|
||||
' 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
|
||||
Friend m_CurrSelectedCurv As Integer = GDB_ID.NULL
|
||||
@@ -103,10 +106,22 @@ Public Class NestPageUC
|
||||
If m_MainWindow.m_CurrentMachine.WaterJettingActive Then
|
||||
nColumsIn_UG1 += 1
|
||||
SplitCurveWJBtn.Visibility = Visibility.Visible
|
||||
SplitCurveWJBtn.ToolTip = "Split"
|
||||
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
|
||||
StartCurveWJBtn.ToolTip = "Start"
|
||||
Else
|
||||
StartCurveWJBtn.Visibility = Visibility.Collapsed
|
||||
End If
|
||||
UG0.Columns = nColumnIn_UG0
|
||||
End Sub
|
||||
|
||||
Private Sub NestPage_Loaded(sender As Object, e As RoutedEventArgs)
|
||||
@@ -249,8 +264,8 @@ Public Class NestPageUC
|
||||
' 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_bIsCheckedSplitCurveWJ <> GDB_ID.NULL Or m_bIsCheckedSplitCurveWJ = nIdMy Then
|
||||
EgtDeselectObj(m_bIsCheckedSplitCurveWJ)
|
||||
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)
|
||||
@@ -259,9 +274,9 @@ Public Class NestPageUC
|
||||
' verifico che la lavorazione associata sia di tipo waterjet
|
||||
If Not EgtGetGroupObjs(nIdWJ) Then
|
||||
m_nIdSelectedSideWJ = nIdMy
|
||||
Dim sValInfo As String = "1"
|
||||
If EgtGetInfo(nIdMy, "JoinEntity", sValInfo) Then
|
||||
If sValInfo = "1" Then
|
||||
Dim nValInfo As String = 1
|
||||
If EgtGetInfo(nIdMy, "JoinEntity", nValInfo) Then
|
||||
If nValInfo = 1 Then
|
||||
' separo il taglio
|
||||
EgtSetInfo(nIdMy, "JoinEntity", 0)
|
||||
Else
|
||||
@@ -291,6 +306,73 @@ Public Class NestPageUC
|
||||
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 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
|
||||
m_CurrProjPage.SetWarningMessage("Il contorno non è chiuso")
|
||||
Exit While
|
||||
End If
|
||||
' recupero il gruppo della lavorazione associata
|
||||
Dim nIdParentPart As Integer = EgtGetParent(nIdParent)
|
||||
Dim nIdPV As Integer = EgtGetFirstNameInGroup(nIdParentPart, "PV")
|
||||
Dim nIdWJ As Integer = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
|
||||
' verifico che la lavorazione associata sia di tipo waterjet
|
||||
If Not EgtGetGroupObjs(nIdWJ) Then
|
||||
EgtSetInfo(nIdParent, "Start", ptStartCurv)
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
' Aggiorno visualizzazione
|
||||
nIdWJ = EgtGetFirstNameInGroup(nIdPV, "Waterjet" & nIdMy.ToString & "S")
|
||||
' verco se
|
||||
m_nIdSelectedWaterJet = nIdWJ
|
||||
EgtSetMark(nIdWJ)
|
||||
EgtDraw()
|
||||
Exit While
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
nIdMy = EgtGetNextObjInSelWin()
|
||||
End While
|
||||
Return
|
||||
End Sub
|
||||
|
||||
#Region "DRAG RETTANGLE"
|
||||
|
||||
' funzione chiamata da OnMyMouseMoveScene: verifica che la selezione sia corretta (deve essere il lato di una figura rettangolare)
|
||||
@@ -600,6 +682,12 @@ Public Class NestPageUC
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
End Sub
|
||||
|
||||
Public Sub ResetStartCurvWJParam()
|
||||
EgtResetMark(m_nIdSelectedWaterJet)
|
||||
m_nIdSelectedWaterJet = GDB_ID.NULL
|
||||
|
||||
End Sub
|
||||
|
||||
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
|
||||
If Not m_bActive Or m_bRegister Then Return
|
||||
@@ -628,12 +716,18 @@ Public Class NestPageUC
|
||||
Return
|
||||
End If
|
||||
|
||||
' se in modalità SlitCurveWJ (separazione dei tagli WaterJet)
|
||||
' 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
|
||||
m_bDrag = False
|
||||
' Verifico se selezionato indicativo di pezzo
|
||||
@@ -683,10 +777,10 @@ Public Class NestPageUC
|
||||
|
||||
' Drag possibile
|
||||
m_bDrag = True
|
||||
Exit While
|
||||
Else
|
||||
' 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
|
||||
Exit While
|
||||
Else
|
||||
' 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
|
||||
Dim nRes As Integer = m_MainWindow.m_CadCutPageUC.m_ProjectMgr.ChangeTable()
|
||||
' se non è stata eseguita nessuna scelta esco dal ciclo
|
||||
If nRes = 0 Then Exit While
|
||||
@@ -909,6 +1003,11 @@ Public Class NestPageUC
|
||||
ResetSplitCurvWJParam()
|
||||
Return
|
||||
End If
|
||||
If m_bIsCheckedStartCurveWJ Then
|
||||
' deseleziono gli oggeti, resetto le variabili usate, aggiorno il disegno
|
||||
OnMyMouseDownSceneStartCurv(sender, e)
|
||||
Return
|
||||
End If
|
||||
|
||||
' Se eseguito drag
|
||||
If Not m_bDragToStart Then
|
||||
@@ -1953,6 +2052,8 @@ Public Class NestPageUC
|
||||
m_bIsCheckedDragRettangle = True
|
||||
SplitCurveWJBtn.IsChecked = False
|
||||
m_bIsCheckedSplitCurveWJ = False
|
||||
StartCurveWJBtn.IsChecked = False
|
||||
m_bIsCheckedStartCurveWJ = False
|
||||
Else
|
||||
m_bIsCheckedDragRettangle = False
|
||||
ResetDragRettangleParam()
|
||||
@@ -1967,6 +2068,8 @@ Public Class NestPageUC
|
||||
m_bIsCheckedSplitCurveWJ = True
|
||||
DragRettanleBtn.IsChecked = False
|
||||
m_bIsCheckedDragRettangle = False
|
||||
StartCurveWJBtn.IsChecked = False
|
||||
m_bIsCheckedStartCurveWJ = False
|
||||
Else
|
||||
m_bIsCheckedSplitCurveWJ = False
|
||||
' resetto i parametri di selezione dei lati
|
||||
@@ -1977,6 +2080,23 @@ Public Class NestPageUC
|
||||
EgtDraw()
|
||||
End Sub
|
||||
|
||||
Private Sub StartCurveWJBtn_Click() Handles StartCurveWJBtn.Click
|
||||
If StartCurveWJBtn.IsChecked Then
|
||||
m_bIsCheckedStartCurveWJ = True
|
||||
DragRettanleBtn.IsChecked = False
|
||||
m_bIsCheckedDragRettangle = False
|
||||
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
|
||||
' creo la lista delle famiglie di pezzi presenti in parcheggio
|
||||
GetFamilyGroupInPark()
|
||||
|
||||
@@ -573,6 +573,8 @@ Class MainWindow
|
||||
DragRettangleOff()
|
||||
' disabilito SplitCurv
|
||||
SplitCurvWJOff()
|
||||
' disattivo StartCurv
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = True
|
||||
@@ -631,6 +633,7 @@ Class MainWindow
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
@@ -686,6 +689,7 @@ Class MainWindow
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
@@ -740,6 +744,7 @@ Class MainWindow
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
@@ -795,6 +800,7 @@ Class MainWindow
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
@@ -845,6 +851,7 @@ Class MainWindow
|
||||
TestOff()
|
||||
DragRettangleOff()
|
||||
SplitCurvWJOff()
|
||||
StartCurvWJOff()
|
||||
Select Case m_ActivePage
|
||||
Case Pages.WorkInProgress
|
||||
WorkInProgressBtn.IsChecked = False
|
||||
@@ -1919,4 +1926,10 @@ Class MainWindow
|
||||
|
||||
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
|
||||
@@ -252,8 +252,10 @@ Public Class ProjectMgrUC
|
||||
EgtSetCurrentContext(m_CurrProjPage.CurrentProjectScene.GetCtx())
|
||||
' Cancello eventuali messaggi
|
||||
m_CurrProjPage.ClearMessage()
|
||||
' cancello tutti i tagli di separazione
|
||||
' cancello tutti i tagli di separazione (Waterjet)
|
||||
ResetAllSplitCurv()
|
||||
' cancello tutti i punti di inizio (Waterjet)
|
||||
ResetAllStartCurv()
|
||||
' Ricalcolo tutte le lavorazioni
|
||||
Dim nWarn As Integer = 0
|
||||
ResetAllMachinings(nWarn)
|
||||
|
||||
Reference in New Issue
Block a user