EgtCAM5 :

- correzioni parametro Active in ToolDb.
This commit is contained in:
Emmanuele Sassi
2019-09-25 14:49:42 +00:00
parent 24f7de3390
commit d736b37ff4
+14 -4
View File
@@ -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