diff --git a/CurrentProjectPageUC.xaml.vb b/CurrentProjectPageUC.xaml.vb index d22e5ae..72276e4 100644 --- a/CurrentProjectPageUC.xaml.vb +++ b/CurrentProjectPageUC.xaml.vb @@ -457,6 +457,10 @@ Public Class CurrentProjectPageUC HeightTxBx.Text = LenToString(m_dRawHeight, 2) End Sub + Friend Sub UpdateMachiningTxBx() + MachiningTxBx.Text = m_MainWindow.m_CurrentMachine.sCurrSawing + End Sub + ' Gestione fotografia della lastra Friend Function LoadPhoto(ByVal sPath As String) As Boolean diff --git a/MoveRawPartPage.xaml.vb b/MoveRawPartPage.xaml.vb index 198dc51..a09a119 100644 --- a/MoveRawPartPage.xaml.vb +++ b/MoveRawPartPage.xaml.vb @@ -31,13 +31,6 @@ Public Class MoveRawPartPage m_bActive = True ' Leggo tipo movimento grezzi m_bPerp = (GetPrivateProfileInt(S_RAWMOVE, K_PERPENDICULAR, 0, m_MainWindow.GetIniFile()) <> 0) - If m_bPerp Then - LeftBtn.Visibility = Windows.Visibility.Hidden - RightBtn.Visibility = Windows.Visibility.Hidden - Else - LeftBtn.Visibility = Windows.Visibility.Visible - RightBtn.Visibility = Windows.Visibility.Visible - End If ' Deseleziono tutto EgtDeselectAll() ' Recupero i tagli allungati prima definiti @@ -129,11 +122,11 @@ Public Class MoveRawPartPage End While ' Aggiorno visualizzazione EgtDraw() - ' carico i parametri di movimento + ' Carico i parametri di movimento m_dStep = GetPrivateProfileDouble(S_RAWMOVE, K_RAWSTEP, 50, m_MainWindow.GetIniFile()) StepMoveTxBx.Text = LenToString(m_dStep, 3) - ' se movimento perpendicolare determino direzione di movimento - If m_bPerp Then + ' Se movimento perpendicolare ed esiste taglio passante determino direzione di movimento + If m_bPerp And Cuts.Length() > 0 Then ' recupero taglio di separazione Dim nCutId As Integer = Cuts(0) ' recupero linea di base del taglio @@ -157,7 +150,18 @@ Public Class MoveRawPartPage ' Distanza iniziale m_dCurrDist = 0 End If + Else + m_bPerp = False End If + ' Aggirono interfaccia per taglio perpendicolare + If m_bPerp Then + LeftBtn.Visibility = Windows.Visibility.Hidden + RightBtn.Visibility = Windows.Visibility.Hidden + Else + LeftBtn.Visibility = Windows.Visibility.Visible + RightBtn.Visibility = Windows.Visibility.Visible + End If + End Sub Private Sub OnMyMouseDownScene(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles m_CurrProjPage.OnMouseDownScene @@ -204,8 +208,8 @@ Public Class MoveRawPartPage Private Sub UpBtn_Click(sender As Object, e As RoutedEventArgs) Handles UpBtn.Click Dim nRawId As Integer = EgtGetFirstSelectedObj() While nRawId <> GDB_ID.NULL + ' Se movimento perpendicolare, è allontanamento If m_bPerp Then - ' Allontanamento ' Recupero il centro del grezzo Dim nCentId As Integer = EgtGetFirstNameInGroup(nRawId, NAME_RAW_CENTER) Dim ptRawCen As Point3d @@ -220,6 +224,7 @@ Public Class MoveRawPartPage If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then m_dCurrDist += Math.Abs(dMove) End If + ' Altrimenti movimento Y + Else EgtMoveRawPart(nRawId, New Vector3d(0, m_dStep, 0)) End If @@ -231,8 +236,9 @@ Public Class MoveRawPartPage Private Sub DownBtn_Click(sender As Object, e As RoutedEventArgs) Handles DownBtn.Click Dim nRawId As Integer = EgtGetFirstSelectedObj() While nRawId <> GDB_ID.NULL + ' Se movimento perpendicolare, è avvicinamento If m_bPerp Then - ' Avvicinamento + ' Se sono già a contatto, non devo fare alcunché If m_dCurrDist < EPS_SMALL Then Return ' Recupero il centro del grezzo Dim nCentId As Integer = EgtGetFirstNameInGroup(nRawId, NAME_RAW_CENTER) @@ -248,6 +254,7 @@ Public Class MoveRawPartPage If EgtMoveRawPart(nRawId, dMove * m_vtDir) Then m_dCurrDist -= Math.Abs(dMove) End If + ' Altrimenti movimento Y - Else EgtMoveRawPart(nRawId, New Vector3d(0, -m_dStep, 0)) End If diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index 0a18c9e..80b7799 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -60,5 +60,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/RawPartPageUC.xaml.vb b/RawPartPageUC.xaml.vb index 038dc04..9b2b4ff 100644 --- a/RawPartPageUC.xaml.vb +++ b/RawPartPageUC.xaml.vb @@ -418,6 +418,8 @@ Public Class RawPartPageUC ' Imposto spessore del grezzo m_CurrProjPage.m_dRawHeight = GetRawHeight() m_CurrProjPage.UpdateHeightTxBx() + ' Aggiorno lavorazione in interfaccia + m_CurrProjPage.UpdateMachiningTxBx() ' Salvo nel file Ini le dimensioni del grezzo (sempre in mm) WritePrivateProfileString(S_RAWPART, K_RAWLENGTH, DoubleToString(m_RawLength, 2), m_MainWindow.GetIniFile()) WritePrivateProfileString(S_RAWPART, K_RAWWIDTH, DoubleToString(m_RawWidth, 2), m_MainWindow.GetIniFile()) diff --git a/SplitPageUC.xaml.vb b/SplitPageUC.xaml.vb index 584e035..e176f79 100644 --- a/SplitPageUC.xaml.vb +++ b/SplitPageUC.xaml.vb @@ -143,12 +143,7 @@ Public Class SplitPageUC ' Reset flag tipo uscita m_bToNext = False ' Abilitazione bottone Next - If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Then - NextBtn.IsEnabled = (GetDisabledCutsCount() > 0) - Else - PrevBtn.IsEnabled = False - NextBtn.IsEnabled = False - End If + EnableNextButton() End Sub Private Sub MachiningLsBx_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles MachiningLsBx.SelectionChanged @@ -238,11 +233,7 @@ Public Class SplitPageUC ' Imposto flag di modifica m_bModified = True ' Abilitazione bottone Next - If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Then - NextBtn.IsEnabled = (GetDisabledCutsCount() > 0) - Else - NextBtn.IsEnabled = False - End If + EnableNextButton() End Sub Private Sub AllOnBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOnBtn.Click @@ -258,11 +249,7 @@ Public Class SplitPageUC ' Imposto flag di modifica m_bModified = True ' Abilitazione bottone Next - If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Then - NextBtn.IsEnabled = (GetDisabledCutsCount() > 0) - Else - NextBtn.IsEnabled = False - End If + EnableNextButton() End Sub Private Sub AllOffBtn_Click(sender As Object, e As RoutedEventArgs) Handles AllOffBtn.Click @@ -278,11 +265,7 @@ Public Class SplitPageUC ' Imposto flag di modifica m_bModified = True ' Abilitazione bottone Next - If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Then - NextBtn.IsEnabled = (GetDisabledCutsCount() > 0) - Else - NextBtn.IsEnabled = False - End If + EnableNextButton() End Sub Private Sub CutBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutBtn.Click @@ -310,6 +293,8 @@ Public Class SplitPageUC End If EgtDraw() End If + ' Abilitazione bottone Next + EnableNextButton() End Sub Private Sub CutStartBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutStartBtn.Click @@ -333,6 +318,8 @@ Public Class SplitPageUC End If EgtDraw() End If + ' Abilitazione bottone Next + EnableNextButton() End Sub Private Sub CutEndBtn_Click(sender As Object, e As RoutedEventArgs) Handles CutEndBtn.Click @@ -356,6 +343,8 @@ Public Class SplitPageUC End If EgtDraw() End If + ' Abilitazione bottone Next + EnableNextButton() End Sub Private Sub NextBtn_Click(sender As Object, e As RoutedEventArgs) Handles NextBtn.Click @@ -434,6 +423,18 @@ Public Class SplitPageUC Return nCount End Function + Friend Function GetSplitCutsCount() As Integer + ' Determino il numero di tagli disabilitati + Dim nCount As Integer = 0 + For nI As Integer = 0 To m_MachiningList.Count() - 1 + If m_MachiningList(nI).m_bEnabled And + (m_MachiningList(nI).m_bAllStart Or m_MachiningList(nI).m_bAllEnd) Then + nCount += 1 + End If + Next + Return nCount + End Function + Friend Sub GetSplitCuts(ByRef Cuts() As Integer) ' Determino il numero di tagli di separazione Dim nCount As Integer = 0 @@ -457,6 +458,16 @@ Public Class SplitPageUC Cuts = MyCuts End Sub + Private Sub EnableNextButton() + ' Se abilitato manipolatore + If m_MainWindow.GetKeyOption(MainWindow.KEY_OPT.MAN_MANIP) Then + ' Ci deve essere almeno 1 taglio disabilitato e almeno 1 passante + NextBtn.IsEnabled = (GetDisabledCutsCount() > 0 And GetSplitCutsCount() > 0) + Else + NextBtn.IsEnabled = False + End If + End Sub + Private Sub NumberMachining(nI As Integer) ' Ingombro complessivo della lavorazione Dim ptMin, ptMax As Point3d diff --git a/ToolsDbPageUC.xaml.vb b/ToolsDbPageUC.xaml.vb index 68abc5b..cb8562f 100644 --- a/ToolsDbPageUC.xaml.vb +++ b/ToolsDbPageUC.xaml.vb @@ -611,7 +611,14 @@ Public Class ToolsDbPageUC ' Recupero tipo di variabile EgtSetCurrentContext(m_MainWindow.m_CurrentProjectPageUC.CurrentProjectScene.GetCtx()) Dim nType As Integer = GetVariableType() - If m_nToolType = MCH_TY.DRILL_STD Then + If m_nToolType = MCH_TY.SAW_STD Then + Select Case nType + Case MCH_TP.LEN + EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dVal) + Case MCH_TP.DIAM + EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dVal) + End Select + ElseIf m_nToolType = MCH_TY.DRILL_STD Then Select Case nType Case MCH_TP.LEN EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dVal)