From 4e3aaf96fe0bc94e8c55e7f47a911e09f2bafd64 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 26 Feb 2020 18:30:48 +0000 Subject: [PATCH] =?UTF-8?q?EgtCAM5=20:=20-=20corretto=20problema=20in=20DB?= =?UTF-8?q?=20utensili=20con=20attivazione=20quando=20si=20d=C3=A0=20nuovo?= =?UTF-8?q?=20nome=20ad=20utensile=20appena=20prima=20di=20attivarlo.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ToolsDbWindow/ToolTreeView.vb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ToolsDbWindow/ToolTreeView.vb b/ToolsDbWindow/ToolTreeView.vb index 2495bd8..d28941d 100644 --- a/ToolsDbWindow/ToolTreeView.vb +++ b/ToolsDbWindow/ToolTreeView.vb @@ -1000,24 +1000,22 @@ Public Class ToolTreeViewItem End Get End Property - Private m_PreviousCurrentTool As String = String.Empty Public Property Active As Boolean Get EgtSetCurrentContext(IniFile.m_ProjectSceneContext) ' salvo utensile corrente precedente - EgtTdbGetCurrToolParam(MCH_TP.NAME, m_PreviousCurrentTool) - Dim bChangeTool As Boolean = m_PreviousCurrentTool <> Me.Name + Dim PreviousCurrentTool As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.NAME, PreviousCurrentTool) + Dim bChangeTool As Boolean = PreviousCurrentTool <> Me.Name If bChangeTool Then EgtTdbSetCurrTool(Me.Name) Dim bActive As Boolean = False EgtTdbGetCurrToolParam(MCH_TP.ACTIVE, bActive) ' ripristino utensile corrente - If bChangeTool Then EgtTdbSetCurrTool(m_PreviousCurrentTool) + If bChangeTool Then EgtTdbSetCurrTool(PreviousCurrentTool) Return bActive End Get Set(value As Boolean) EgtSetCurrentContext(IniFile.m_ProjectSceneContext) - ' salvo utensile corrente precedente - 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 @@ -1034,13 +1032,16 @@ Public Class ToolTreeViewItem m_delIsEnabledBtns(SelTool.IsValid And Not SelTool.IsModified, SelTool.IsValid, True) End If End If + ' salvo utensile corrente precedente + Dim PreviousCurrentTool As String = String.Empty + EgtTdbGetCurrToolParam(MCH_TP.NAME, PreviousCurrentTool) ' se attivato, verifico che non sia in conflitto con altri utensili If value Then ' 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) + EgtTdbSetCurrTool(PreviousCurrentTool) Return End If End If @@ -1050,7 +1051,7 @@ Public Class ToolTreeViewItem EgtTdbSaveCurrTool() NotifyPropertyChanged("Active") ' ripristino utensile corrente - EgtTdbSetCurrTool(m_PreviousCurrentTool) + EgtTdbSetCurrTool(PreviousCurrentTool) End Set End Property #End Region ' Tool Property