EgtCAM5 :
- Migliorie varie.
This commit is contained in:
+33
-31
@@ -79,8 +79,8 @@ Public Class ToolTreeViewItem
|
||||
' If Tool is selected, set it as current and notify all tool's property
|
||||
' to refresh them values with those of the new selected tool
|
||||
If value Then
|
||||
Dim x = EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim y = EgtTdbSetCurrTool(Me.Name)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrTool(Me.Name)
|
||||
NotifyPropertyChanged("Corr")
|
||||
NotifyPropertyChanged("ExitPar")
|
||||
NotifyPropertyChanged("Type")
|
||||
@@ -113,7 +113,7 @@ Public Class ToolTreeViewItem
|
||||
' Otherwhise Tool is deselected, so it and the database will be saved to
|
||||
' keep the modify effective
|
||||
Else
|
||||
If EgtTdbIsCurrToolModified() And Me.IsValid Then
|
||||
If (EgtTdbIsCurrToolModified() And Me.IsValid) Or Me.NewTool Then
|
||||
|
||||
Select Case MsgBox(EgtMsg(MSG_TOOLSERRORS), MsgBoxStyle.YesNo, EgtMsg(MSG_TOOLSERRORS + 1))
|
||||
Case MsgBoxResult.Yes
|
||||
@@ -351,6 +351,7 @@ Public Class ToolTreeViewItem
|
||||
Dim dLen As Double = 0
|
||||
StringToLen(value, dLen)
|
||||
m_Len = dLen
|
||||
NotifyPropertyChanged("MaxMat")
|
||||
UpdateSceneToolDraw(DrawUpdateSource.LEN)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.LEN, dLen)
|
||||
End Set
|
||||
@@ -677,6 +678,7 @@ Public Class ToolTreeViewItem
|
||||
Dim bDrawNameExistError As Boolean = False
|
||||
Dim bDrawNameError As Boolean = False
|
||||
Dim bDrawingError As Boolean = False
|
||||
Dim m_bFirst As Boolean = True
|
||||
|
||||
Private Sub UpdateSceneToolDraw(UpdateSource As DrawUpdateSource)
|
||||
' Azzero errori
|
||||
@@ -685,11 +687,14 @@ Public Class ToolTreeViewItem
|
||||
bDrawNameExistError = False
|
||||
bDrawingError = False
|
||||
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, m_MaxMat)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, m_Thick)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_Diam)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, m_Len)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTLEN, m_TotLen)
|
||||
If m_NewTool And m_bFirst Then
|
||||
m_bFirst = False
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, m_MaxMat)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, m_Thick)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, m_Diam)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, m_Len)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTLEN, m_TotLen)
|
||||
End If
|
||||
|
||||
' Verifico proprietà draw
|
||||
If m_Draw = String.Empty OrElse IsUUID(Path.GetFileNameWithoutExtension(m_Draw)) Then
|
||||
@@ -947,51 +952,48 @@ Public Class ToolTreeViewItem
|
||||
End Function
|
||||
|
||||
Private Function ValidateMaxMat() As String
|
||||
If String.IsNullOrEmpty(m_Draw) Then
|
||||
If m_MaxMat < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 6)
|
||||
End If
|
||||
If m_MaxMat > m_Len + EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 7)
|
||||
End If
|
||||
If m_MaxMat < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 6)
|
||||
End If
|
||||
If m_MaxMat > m_Len + EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 7)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function ValidateThick() As String
|
||||
If (m_Type = MCH_TY.SAW_FLAT Or m_Type = MCH_TY.SAW_STD Or m_Type = MCH_TY.MORTISE_STD) And m_Draw = String.Empty And m_Thick < EPS_SMALL Then
|
||||
If (m_Type = MCH_TY.SAW_FLAT Or m_Type = MCH_TY.SAW_STD Or m_Type = MCH_TY.MORTISE_STD) And m_Thick < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 8)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function ValidateDiam() As String
|
||||
If m_Draw = String.Empty And m_Diam < EPS_SMALL Then
|
||||
If m_Diam < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 9)
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function ValidateLen() As String
|
||||
If m_Draw = String.Empty Then
|
||||
If m_Len < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 10)
|
||||
End If
|
||||
If m_Len > m_TotLen + EPS_SMALL Then
|
||||
Return "La lunghezza non può essere maggiore della lunghezza totale"
|
||||
End If
|
||||
If m_Len < EPS_SMALL Then
|
||||
Return EgtMsg(MSG_TOOLSERRORS + 10)
|
||||
End If
|
||||
If m_Len > m_TotLen + EPS_SMALL Then
|
||||
Return "La lunghezza non può essere maggiore della lunghezza totale"
|
||||
End If
|
||||
If m_Len < m_MaxMat Then
|
||||
Return "La lunghezza non può essere minore del massimo materiale"
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Private Function ValidateTotLen() As String
|
||||
If m_Draw = String.Empty Then
|
||||
If m_TotLen < EPS_SMALL Then
|
||||
Return "La lunghezza totale deve essere maggiore di zero"
|
||||
End If
|
||||
If m_TotLen < m_Len - EPS_SMALL Then
|
||||
Return "La lunghezza totale non può essere minore della lunghezza"
|
||||
End If
|
||||
If m_TotLen < EPS_SMALL Then
|
||||
Return "La lunghezza totale deve essere maggiore di zero"
|
||||
End If
|
||||
If m_TotLen < m_Len - EPS_SMALL Then
|
||||
Return "La lunghezza totale non può essere minore della lunghezza"
|
||||
End If
|
||||
Return Nothing
|
||||
End Function
|
||||
|
||||
Reference in New Issue
Block a user