From d736b37ff4b4818fea59294036bfea52dd87d6be Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Wed, 25 Sep 2019 14:49:42 +0000 Subject: [PATCH] EgtCAM5 : - correzioni parametro Active in ToolDb. --- ToolsDbWindow/ToolTreeView.vb | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/ToolsDbWindow/ToolTreeView.vb b/ToolsDbWindow/ToolTreeView.vb index 935932f..4430b75 100644 --- a/ToolsDbWindow/ToolTreeView.vb +++ b/ToolsDbWindow/ToolTreeView.vb @@ -1017,13 +1017,21 @@ Public Class ToolTreeViewItem Set(value As Boolean) EgtSetCurrentContext(IniFile.m_ProjectSceneContext) ' salvo utensile corrente precedente - Dim t = EgtTdbGetCurrToolParam(MCH_TP.NAME, m_PreviousCurrentTool) + EgtTdbGetCurrToolParam(MCH_TP.NAME, m_PreviousCurrentTool) ' verifico se l'utensile selezionato è modificato Dim SelTool As ToolTreeViewItem = m_delGetSelectedTool() If Not IsNothing(SelTool) AndAlso SelTool.IsModified Then ' chiedo di salvare - If MessageBox.Show(String.Format(EgtMsg(6144), Me.Name), EgtMsg(6143), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then + If MessageBox.Show(String.Format(EgtMsg(6144), SelTool.Name), EgtMsg(6143), MessageBoxButton.YesNo, MessageBoxImage.Question) <> MessageBoxResult.Yes Then Return + Else + SelTool.WriteToolParam() + SelTool.m_Name = SelTool.m_Name.Trim() + SelTool.WriteToolName() + EgtTdbSaveCurrTool() + SelTool.NewTool = False + SelTool.IsModifiedReset() + m_delIsEnabledBtns(SelTool.IsValid And Not SelTool.IsModified, SelTool.IsValid, True) End If End If ' se attivato, verifico che non sia in conflitto con altri utensili @@ -1031,16 +1039,18 @@ Public Class ToolTreeViewItem ' verifico se c'è un utensile con la stessa posizione If Not VerifyAllPositions() Then MessageBox.Show(EgtMsg(6145), EgtMsg(6126), MessageBoxButton.OK, MessageBoxImage.Exclamation) + ' ripristino utensile corrente + EgtTdbSetCurrTool(m_PreviousCurrentTool) Return End If End If ' lo scrivo nel Db EgtTdbSetCurrTool(Me.Name) EgtTdbSetCurrToolParam(MCH_TP.ACTIVE, value) - Dim y = EgtTdbSaveCurrTool() + EgtTdbSaveCurrTool() NotifyPropertyChanged("Active") ' ripristino utensile corrente - Dim X = EgtTdbSetCurrTool(m_PreviousCurrentTool) + EgtTdbSetCurrTool(m_PreviousCurrentTool) End Set End Property #End Region ' Tool Property