EgtCAM5 :
- Miglioramenti Db utensili.
This commit is contained in:
@@ -89,11 +89,72 @@ End Class
|
||||
|
||||
' Elemento del treeview che ha sottoelementi del suo stesso tipo
|
||||
Public Class InheritableTreeViewItem
|
||||
Inherits TreeViewItemBase
|
||||
Implements INotifyPropertyChanged
|
||||
|
||||
Friend m_Name As String
|
||||
Public Property Name As String
|
||||
Get
|
||||
Return m_Name
|
||||
End Get
|
||||
Set(value As String)
|
||||
If (value <> m_Name) Then
|
||||
m_Name = value
|
||||
NotifyPropertyChanged("Name")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Friend m_IsSelected As Boolean
|
||||
Public Overridable Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
NotifyPropertyChanged("IsSelected")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_isExpanded As Boolean
|
||||
Public Property IsExpanded As Boolean
|
||||
Get
|
||||
Return m_isExpanded
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isExpanded) Then
|
||||
m_isExpanded = value
|
||||
NotifyPropertyChanged("IsExpanded")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsActive As Boolean
|
||||
Public Property IsActive As Boolean
|
||||
Get
|
||||
Return m_IsActive
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If value <> m_IsActive Then
|
||||
m_IsActive = value
|
||||
NotifyPropertyChanged("IsActive")
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_IsEnabled As Boolean = True
|
||||
Public Property IsEnabled As Boolean
|
||||
Get
|
||||
Return m_IsEnabled
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
m_IsEnabled = value
|
||||
NotifyPropertyChanged("IsEnabled")
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_sPictureString As String
|
||||
Private m_Items As ObservableCollection(Of InheritableTreeViewItem)
|
||||
|
||||
Public Property PictureString As String
|
||||
Get
|
||||
Return m_sPictureString
|
||||
@@ -106,6 +167,7 @@ Public Class InheritableTreeViewItem
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Items As ObservableCollection(Of InheritableTreeViewItem)
|
||||
Public Property Items As ObservableCollection(Of InheritableTreeViewItem)
|
||||
Get
|
||||
Return m_Items
|
||||
@@ -115,15 +177,16 @@ Public Class InheritableTreeViewItem
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Sub New(Name As String)
|
||||
MyBase.New(Name)
|
||||
Me.Items = New ObservableCollection(Of InheritableTreeViewItem)
|
||||
Public Event PropertyChanged As PropertyChangedEventHandler Implements INotifyPropertyChanged.PropertyChanged
|
||||
|
||||
Public Sub NotifyPropertyChanged(propName As String)
|
||||
RaiseEvent PropertyChanged(Me, New PropertyChangedEventArgs(propName))
|
||||
End Sub
|
||||
|
||||
'Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
|
||||
' MyBase.New(Name, IsSelected, IsExpanded, IsActive)
|
||||
' Me.Items = New ObservableCollection(Of InheritableTreeViewItem)
|
||||
'End Sub
|
||||
Sub New(Name As String)
|
||||
Me.Name = Name
|
||||
Me.Items = New ObservableCollection(Of InheritableTreeViewItem)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTCAM5 + 250
|
||||
Public Const MSG_SIMULATION As Integer = MSG_EGTCAM5 + 300
|
||||
Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000
|
||||
Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1085
|
||||
Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1080
|
||||
Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1100
|
||||
Public Const MSG_MACHININGSERRORS As Integer = MSG_EGTCAM5 + 1220
|
||||
Public Const MSG_MISSINGKEYWD As Integer = 10100
|
||||
|
||||
+2
-1
@@ -191,12 +191,13 @@
|
||||
<DependentUpon>ToolsDbView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ToolsDbPage\ToolsDbViewModel.vb" />
|
||||
<Compile Include="ToolsDbPage\ToolTreeView.vb" />
|
||||
<Compile Include="ToolsDbPage\ToolTreeView2.vb" />
|
||||
<Compile Include="TopCommandBar\TopCommandBarView.xaml.vb">
|
||||
<DependentUpon>TopCommandBarView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TopCommandBar\TopCommandBarViewModel.vb" />
|
||||
<Compile Include="Utility.vb" />
|
||||
<Compile Include="ValidationGroup.vb" />
|
||||
<Page Include="AboutBoxWindow\AboutBoxView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -135,11 +135,11 @@ Public Class MachiningTreeViewItem
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
' If Machining is selected, set it as current and notify all machining's property
|
||||
' to refresh them values with those of the new selected machining
|
||||
If value Then
|
||||
@@ -1077,9 +1077,9 @@ Public Class MachiningTreeViewItem
|
||||
End If
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' Property that read and write to the Machining's database the Tool
|
||||
''' </summary>
|
||||
''' <summary>
|
||||
''' Property that read and write to the Machining's database the Tool
|
||||
''' </summary>
|
||||
Public Property SelectedTool As Integer
|
||||
Get
|
||||
Dim nUUID As String = String.Empty
|
||||
@@ -1318,11 +1318,11 @@ Public Class FamilyMachiningTreeViewItem
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -16,11 +16,11 @@ Public Class LayerTreeViewItem
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
If value Then
|
||||
' recupero l'Id del nuovo oggetto selezionato
|
||||
Application.Msn.NotifyColleagues(Application.UPDATEOBJINOBJTREE, Me.Id)
|
||||
|
||||
+6
-6
@@ -21,11 +21,11 @@ Public Class MachiningTreeViewExpanderItem
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
' If Machining is selected, set it as current and notify all machining's property
|
||||
' to refresh them values with those of the new selected machining
|
||||
If value Then
|
||||
@@ -80,11 +80,11 @@ Public Class FamilyMachiningTreeViewExpanderItem
|
||||
''' </summary>
|
||||
Public Overrides Property IsSelected As Boolean
|
||||
Get
|
||||
Return m_isSelected
|
||||
Return m_IsSelected
|
||||
End Get
|
||||
Set(value As Boolean)
|
||||
If (value <> m_isSelected) Then
|
||||
m_isSelected = value
|
||||
If (value <> m_IsSelected) Then
|
||||
m_IsSelected = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
+2
-2
@@ -52,10 +52,10 @@
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<!--<UniformGrid Rows="1">
|
||||
<UniformGrid Rows="1">
|
||||
<Button Content="Move Up" Command="{Binding MoveUpCommand}" CommandParameter="{Binding ElementName=OperationList,Path=SelectedItem}" Height="40"/>
|
||||
<Button Content="Move Down" Command="{Binding MoveDownCommand}" Height="40"/>
|
||||
</UniformGrid>-->
|
||||
</UniformGrid>
|
||||
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
|
||||
+70
-53
@@ -84,44 +84,44 @@ Namespace EgtCAM5
|
||||
Return m_SelectedOperation
|
||||
End Get
|
||||
Set(value As OperationListBoxItem)
|
||||
'If value IsNot m_SelectedOperation Then
|
||||
If Not IsNothing(value) Then
|
||||
' Verifico se c'è l'operazione precedente
|
||||
If m_LastMarkedOperationId <> GDB_ID.NULL Then
|
||||
' La deevidenzio
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
' Ne deseleziono la geometria
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
End If
|
||||
' Verifico se l'operazione è una disposizione
|
||||
If EgtGetOperationType(value.Id) = MCH_OY.DISP Then
|
||||
If value IsNot m_SelectedOperation Then
|
||||
If Not IsNothing(value) Then
|
||||
' Verifico se c'è l'operazione precedente
|
||||
If m_LastMarkedOperationId <> GDB_ID.NULL Then
|
||||
' La deevidenzio
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
' Ne deseleziono la geometria
|
||||
EgtDeselectAll()
|
||||
EgtDraw()
|
||||
End If
|
||||
' Verifico se l'operazione è una disposizione
|
||||
If EgtGetOperationType(value.Id) = MCH_OY.DISP Then
|
||||
|
||||
' L'operazione è una lavorazione
|
||||
Else
|
||||
' Imposto come corrente la lavorazione(operazione) selezionata
|
||||
Dim x = EgtSetCurrMachining(value.Id)
|
||||
' Evidenzio la lavorazione(operazione) selezionata
|
||||
EgtSetMark(value.Id)
|
||||
' Seleziono la geometria della lavorazione
|
||||
Dim CountIndex = 0
|
||||
Dim EntityIndex As Integer = 0
|
||||
Dim SubEntityIndex As Integer = 0 ' Nell'interfaccia non si usa ma devo comunque definirla perchè la funzione la restituisce obbligatoriamente
|
||||
While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
|
||||
If SubEntityIndex = GDB_ID.NULL Then
|
||||
EgtSelectObj(EntityIndex)
|
||||
End If
|
||||
CountIndex += 1
|
||||
End While
|
||||
EgtDraw()
|
||||
' La salvo come ultima operazione selezionata
|
||||
m_LastMarkedOperationId = value.Id
|
||||
' Notifico l'operazione selezionata all'expander dei parametri operazione
|
||||
Application.Msn.NotifyColleagues(Application.SELECTEDOPERATION, value)
|
||||
' L'operazione è una lavorazione
|
||||
Else
|
||||
' Imposto come corrente la lavorazione(operazione) selezionata
|
||||
EgtSetCurrMachining(value.Id)
|
||||
' Evidenzio la lavorazione(operazione) selezionata
|
||||
EgtSetMark(value.Id)
|
||||
' Seleziono la geometria della lavorazione
|
||||
Dim CountIndex = 0
|
||||
Dim EntityIndex As Integer = 0
|
||||
Dim SubEntityIndex As Integer = 0 ' Nell'interfaccia non si usa ma devo comunque definirla perchè la funzione la restituisce obbligatoriamente
|
||||
While EgtGetMachiningGeometry(CountIndex, EntityIndex, SubEntityIndex)
|
||||
If SubEntityIndex = GDB_ID.NULL Then
|
||||
EgtSelectObj(EntityIndex)
|
||||
End If
|
||||
CountIndex += 1
|
||||
End While
|
||||
EgtDraw()
|
||||
' La salvo come ultima operazione selezionata
|
||||
m_LastMarkedOperationId = value.Id
|
||||
' Notifico l'operazione selezionata all'expander dei parametri operazione
|
||||
Application.Msn.NotifyColleagues(Application.SELECTEDOPERATION, value)
|
||||
End If
|
||||
End If
|
||||
m_SelectedOperation = value
|
||||
End If
|
||||
m_SelectedOperation = value
|
||||
'End If
|
||||
OnPropertyChanged("SelectedOperation")
|
||||
End Set
|
||||
End Property
|
||||
@@ -495,14 +495,20 @@ Namespace EgtCAM5
|
||||
If SelectedIndex < 2 Then
|
||||
Return
|
||||
End If
|
||||
' Recupero Id entità precedente a quella selezionata
|
||||
' Recupero Id entità selezionata e precedente a quella selezionata
|
||||
Dim SelectedId As Integer = OperationList(SelectedIndex).Id
|
||||
Dim PreviousId As Integer = OperationList(SelectedIndex - 1).Id
|
||||
' Sposto l'entità selezionata
|
||||
EgtRelocate(SelectedOperation.Id, PreviousId, GDB_POS.BEFORE)
|
||||
' Ricarico la lista delle operazioni
|
||||
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
|
||||
' Riseleziono l'entità selezionata
|
||||
Me.SelectedOperation = DirectCast(param, OperationListBoxItem)
|
||||
' Sposto l'operazione selezionata nell'ambiente Egt
|
||||
If EgtRelocate(SelectedOperation.Id, PreviousId, GDB_POS.BEFORE) Then
|
||||
' Sposto l'operazione selezionata nella grafica
|
||||
OperationList.Move(SelectedIndex, SelectedIndex - 1)
|
||||
' Ricalcolo la lavorazione selezionata e la precedente
|
||||
EgtSetCurrMachining(PreviousId)
|
||||
EgtApplyMachining(False)
|
||||
EgtSetCurrMachining(SelectedId)
|
||||
EgtApplyMachining(False)
|
||||
EgtDraw()
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -533,18 +539,29 @@ Namespace EgtCAM5
|
||||
''' Execute the Point. This method is invoked by the PointCommand.
|
||||
''' </summary>
|
||||
Public Sub MoveDown(ByVal param As Object)
|
||||
If m_NewMachining Then
|
||||
NewMachining = False
|
||||
Else
|
||||
If Not IsNothing(SelectedOperation) Then
|
||||
' Smarco e deseleziono la geometria selezionata
|
||||
EgtResetMark(m_LastMarkedOperationId)
|
||||
EgtDeselectAll()
|
||||
If Not IsNothing(SelectedOperation) Then
|
||||
' Verifico se l'entità selezionata è una lavorazione o una disposizione,
|
||||
' se è una disposizione esco perchè non si possono spostare
|
||||
If SelectedOperation.Type = MCH_OY.DISP Then Return
|
||||
' Trovo indice dell'entità selezionata
|
||||
Dim SelectedIndex As Integer = OperationList.IndexOf(SelectedOperation)
|
||||
' Verifico che l'indice sia < della lunghezza della lista delle operazioni,altrimenti è già ultima e quindi non la posso spostare
|
||||
If SelectedIndex > OperationList.Count - 2 Then
|
||||
Return
|
||||
End If
|
||||
' Recupero Id entitàselezionata e successiva a quella selezionata
|
||||
Dim SelectedId As Integer = OperationList(SelectedIndex).Id
|
||||
Dim PostId As Integer = OperationList(SelectedIndex + 1).Id
|
||||
' Sposto l'operazione selezionata nell'ambiente Egt
|
||||
If EgtRelocate(SelectedOperation.Id, PostId, GDB_POS.AFTER) Then
|
||||
' Sposto l'operazione selezionata nella grafica
|
||||
OperationList.Move(SelectedIndex, SelectedIndex + 1)
|
||||
' Ricalcolo la lavorazione selezionata e la successiva
|
||||
EgtSetCurrMachining(SelectedId)
|
||||
EgtApplyMachining(False)
|
||||
EgtSetCurrMachining(PostId)
|
||||
EgtApplyMachining(False)
|
||||
EgtDraw()
|
||||
' Rimuovo l'operazione selezionata
|
||||
EgtRemoveOperation(SelectedOperation.Id)
|
||||
' Ricarico la lista delle operazioni
|
||||
Application.Msn.NotifyColleagues(Application.LOADOPERATIONLIST)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
+294
-247
@@ -11,7 +11,7 @@ Imports EgtCAM5.Utility
|
||||
''' It's an element in the treeview that represent the child of familytooltreeviewitem, but also the class that read and write in the tool's database
|
||||
''' </summary>
|
||||
Public Class ToolTreeViewItem
|
||||
Inherits ChildItem
|
||||
Inherits InheritableTreeViewItem
|
||||
Implements IDataErrorInfo
|
||||
|
||||
Private m_ErrorOnTool As Boolean
|
||||
@@ -81,6 +81,7 @@ Public Class ToolTreeViewItem
|
||||
If value Then
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrTool(Me.Name)
|
||||
'ReadToolParam()
|
||||
NotifyPropertyChanged("Corr")
|
||||
NotifyPropertyChanged("ExitPar")
|
||||
NotifyPropertyChanged("Type")
|
||||
@@ -125,8 +126,6 @@ Public Class ToolTreeViewItem
|
||||
If m_NewTool Then
|
||||
Application.Msn.NotifyColleagues(Application.REMOVETOOL, Me)
|
||||
End If
|
||||
'EgtTdbRemoveTool(Me.Name)
|
||||
'EgtTdbSave()
|
||||
End Select
|
||||
End If
|
||||
End If
|
||||
@@ -137,421 +136,374 @@ Public Class ToolTreeViewItem
|
||||
|
||||
End Property
|
||||
|
||||
Private m_Corr As Integer
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Corrector
|
||||
''' </summary>
|
||||
Public Property Corr As Integer
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim nCorr As Integer = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORR, nCorr)
|
||||
Return nCorr
|
||||
Return m_Corr
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.CORR, value)
|
||||
If value <> m_Corr Then
|
||||
m_Corr = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Exit As Integer
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Exit
|
||||
''' </summary>
|
||||
Public Property ExitPar As Integer
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim nExitPar As Integer = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nExitPar)
|
||||
Return nExitPar
|
||||
Return m_Exit
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.EXIT_, value)
|
||||
If value <> m_Exit Then
|
||||
m_Exit = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Type As Integer
|
||||
Private m_Type As Integer
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Type
|
||||
''' </summary>
|
||||
Public Property Type As Integer
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dType As Integer = 0
|
||||
Dim x = EgtTdbGetCurrToolParam(MCH_TP.TYPE, dType)
|
||||
m_Type = dType
|
||||
Return dType
|
||||
Return m_Type
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
m_Type = value
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TYPE, value)
|
||||
If value <> m_Type Then
|
||||
m_Type = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Coolant As Integer
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Coolant
|
||||
''' </summary>
|
||||
Public Property Coolant As Integer
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim nCoolant As Integer = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.COOLANT, nCoolant)
|
||||
Return nCoolant
|
||||
Return m_Coolant
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.COOLANT, value)
|
||||
If value <> m_Coolant Then
|
||||
m_Coolant = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_CornRad As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Corner Radius
|
||||
''' </summary>
|
||||
Public Property CornRad As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dCornRad As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORNRAD, dCornRad)
|
||||
Return LenToString(dCornRad, 4)
|
||||
Return LenToString(m_CornRad, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dCornRad As Double = 0
|
||||
StringToLen(value, dCornRad)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.CORNRAD, dCornRad)
|
||||
If value <> LenToString(m_CornRad, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_CornRad = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Diam As Double
|
||||
Private m_Diam As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Diameter
|
||||
''' </summary>
|
||||
Public Property Diam As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
m_Diam = dDiam
|
||||
Return LenToString(dDiam, 4)
|
||||
Return LenToString(m_Diam, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dDiam As Double = 0
|
||||
StringToLen(value, dDiam)
|
||||
m_Diam = dDiam
|
||||
UpdateSceneToolDraw(DrawUpdateSource.DIAM)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DIAM, dDiam)
|
||||
If value <> LenToString(m_Diam, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_Diam = dValue
|
||||
'UpdateSceneToolDraw(DrawUpdateSource.DIAM)
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TotDiam As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Total Diameter
|
||||
''' </summary>
|
||||
Public Property TotDiam As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTotDiam As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTDIAM, dTotDiam)
|
||||
Return LenToString(dTotDiam, 4)
|
||||
Return LenToString(m_TotDiam, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTotDiam As Double = 0
|
||||
StringToLen(value, dTotDiam)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dTotDiam)
|
||||
If value <> LenToString(m_TotDiam, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_TotDiam = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Feed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Feed
|
||||
''' </summary>
|
||||
Public Property Feed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dFeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
Return LenToString(dFeed, 3)
|
||||
Return LenToString(m_Feed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dFeed As Double = 0
|
||||
StringToLen(value, dFeed)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.FEED, dFeed)
|
||||
If value <> LenToString(m_Feed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_Feed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_EndFeed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the End Feed
|
||||
''' </summary>
|
||||
Public Property EndFeed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dEndFeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.ENDFEED, dEndFeed)
|
||||
Return LenToString(dEndFeed, 3)
|
||||
Return LenToString(m_EndFeed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dEndFeed As Double = 0
|
||||
StringToLen(value, dEndFeed)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.ENDFEED, dEndFeed)
|
||||
If value <> LenToString(m_EndFeed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_EndFeed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_StartFeed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Start Feed
|
||||
''' </summary>
|
||||
Public Property StartFeed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dStartFeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.STARTFEED, dStartFeed)
|
||||
Return LenToString(dStartFeed, 3)
|
||||
Return LenToString(m_StartFeed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dStartFeed As Double = 0
|
||||
StringToLen(value, dStartFeed)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.STARTFEED, dStartFeed)
|
||||
If value <> LenToString(m_StartFeed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_StartFeed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TipFeed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Tip Feed
|
||||
''' </summary>
|
||||
Public Property TipFeed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTipFeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TIPFEED, dTipFeed)
|
||||
Return LenToString(dTipFeed, 3)
|
||||
Return LenToString(m_TipFeed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTipFeed As Double = 0
|
||||
StringToLen(value, dTipFeed)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TIPFEED, dTipFeed)
|
||||
If value <> LenToString(m_TipFeed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_TipFeed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Len As Double
|
||||
Private m_Len As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Len
|
||||
''' </summary>
|
||||
Public Property Len As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dLen As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dLen)
|
||||
m_Len = dLen
|
||||
Return LenToString(dLen, 4)
|
||||
Return LenToString(m_Len, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dLen As Double = 0
|
||||
StringToLen(value, dLen)
|
||||
m_Len = dLen
|
||||
NotifyPropertyChanged("MaxMat")
|
||||
UpdateSceneToolDraw(DrawUpdateSource.LEN)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.LEN, dLen)
|
||||
If value <> LenToString(m_Len, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_Len = dValue
|
||||
End If
|
||||
'NotifyPropertyChanged("MaxMat")
|
||||
'UpdateSceneToolDraw(DrawUpdateSource.LEN)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_TotLen As Double
|
||||
Private m_TotLen As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Total Len
|
||||
''' </summary>
|
||||
Public Property TotLen As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTotLen As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTLEN, dTotLen)
|
||||
m_TotLen = dTotLen
|
||||
Return LenToString(dTotLen, 4)
|
||||
Return LenToString(m_TotLen, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dTotLen As Double = 0
|
||||
StringToLen(value, dTotLen)
|
||||
m_TotLen = dTotLen
|
||||
UpdateSceneToolDraw(DrawUpdateSource.TOTLEN)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dTotLen)
|
||||
If value <> LenToString(m_TotLen, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_TotLen = dValue
|
||||
End If
|
||||
'UpdateSceneToolDraw(DrawUpdateSource.TOTLEN)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_MaxMat As Double
|
||||
Private m_MaxMat As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Max Material
|
||||
''' </summary>
|
||||
Public Property MaxMat As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxMat As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, dMaxMat)
|
||||
m_MaxMat = dMaxMat
|
||||
Return LenToString(dMaxMat, 4)
|
||||
Return LenToString(m_MaxMat, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxMat As Double = 0
|
||||
StringToLen(value, dMaxMat)
|
||||
m_MaxMat = dMaxMat
|
||||
UpdateSceneToolDraw(DrawUpdateSource.MAXMAT)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, dMaxMat)
|
||||
If value <> LenToString(m_MaxMat, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_MaxMat = dValue
|
||||
End If
|
||||
'UpdateSceneToolDraw(DrawUpdateSource.MAXMAT)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_LonOffset As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Lon Offset
|
||||
''' </summary>
|
||||
Public Property LonOffset As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dLonOffset As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LONOFFSET, dLonOffset)
|
||||
Return LenToString(dLonOffset, 4)
|
||||
Return LenToString(m_LonOffset, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dLonOffset As Double = 0
|
||||
StringToLen(value, dLonOffset)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.LONOFFSET, dLonOffset)
|
||||
If value <> LenToString(m_LonOffset, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_LonOffset = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_RadOffset As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Rad Offset
|
||||
''' </summary>
|
||||
Public Property RadOffset As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dRadOffset As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.RADOFFSET, dRadOffset)
|
||||
Return LenToString(dRadOffset, 4)
|
||||
Return LenToString(m_RadOffset, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dRadOffset As Double = 0
|
||||
StringToLen(value, dRadOffset)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.RADOFFSET, dRadOffset)
|
||||
If value <> LenToString(m_RadOffset, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_RadOffset = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Speed As Double
|
||||
Private m_Speed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Speed
|
||||
''' </summary>
|
||||
Public Property Speed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dSpeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
Return DoubleToString(dSpeed, 3)
|
||||
Return DoubleToString(m_Speed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dSpeed As Double = 0
|
||||
StringToDouble(value, dSpeed)
|
||||
m_Speed = dSpeed
|
||||
EgtTdbSetCurrToolParam(MCH_TP.SPEED, dSpeed)
|
||||
If value <> LenToString(m_Speed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_Speed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_SideAng As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Side Angle
|
||||
''' </summary>
|
||||
Public Property SideAng As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dSideAng As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SIDEANG, dSideAng)
|
||||
Return LenToString(dSideAng, 3)
|
||||
Return LenToString(m_SideAng, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dSideAng As Double = 0
|
||||
StringToLen(value, dSideAng)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.SIDEANG, dSideAng)
|
||||
If value <> LenToString(m_SideAng, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_SideAng = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_MaxSpeed As Double
|
||||
Private m_MaxSpeed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Max Speed
|
||||
''' </summary>
|
||||
Public Property MaxSpeed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxSpeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXSPEED, dMaxSpeed)
|
||||
m_MaxSpeed = dMaxSpeed
|
||||
Return DoubleToString(dMaxSpeed, 3)
|
||||
Return DoubleToString(m_MaxSpeed, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxSpeed As Double = 0
|
||||
StringToDouble(value, dMaxSpeed)
|
||||
m_MaxSpeed = dMaxSpeed
|
||||
NotifyPropertyChanged("Speed")
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXSPEED, dMaxSpeed)
|
||||
If value <> LenToString(m_MaxSpeed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_MaxSpeed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Dim m_Thick As Double
|
||||
Private m_Thick As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Thick
|
||||
''' </summary>
|
||||
Public Property Thick As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dThick As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
m_Thick = dThick
|
||||
Return LenToString(dThick, 4)
|
||||
Return LenToString(m_Thick, 4)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dThick As Double = 0
|
||||
StringToLen(value, dThick)
|
||||
m_Thick = dThick
|
||||
UpdateSceneToolDraw(DrawUpdateSource.THICK)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.THICK, dThick)
|
||||
If value <> LenToString(m_Thick, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_Thick = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MaxAbsorption As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Max Absorption
|
||||
''' </summary>
|
||||
Public Property MaxAbsorption As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxAbsorption As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXABSORPTION, dMaxAbsorption)
|
||||
Return LenToString(dMaxAbsorption, 3)
|
||||
Return LenToString(m_MaxAbsorption, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMaxAbsorption As Double = 0
|
||||
StringToLen(value, dMaxAbsorption)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXABSORPTION, dMaxAbsorption)
|
||||
If value <> LenToString(m_MaxAbsorption, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_MaxAbsorption = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_MinFeed As Double
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Min Feed
|
||||
''' </summary>
|
||||
Public Property MinFeed As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMinFeed As Double = 0
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MINFEED, dMinFeed)
|
||||
Return LenToString(dMinFeed, 3)
|
||||
Return LenToString(m_MinFeed, 3)
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dMinFeed As Double = 0
|
||||
StringToLen(value, dMinFeed)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MINFEED, dMinFeed)
|
||||
If value <> LenToString(m_MinFeed, 4) Then
|
||||
Dim dValue As Double = 0
|
||||
StringToLen(value, dValue)
|
||||
m_MinFeed = dValue
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
@@ -561,91 +513,194 @@ Public Class ToolTreeViewItem
|
||||
''' </summary>
|
||||
Public Property Draw As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim sDraw As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DRAW, sDraw)
|
||||
m_Draw = sDraw
|
||||
Return sDraw
|
||||
Return m_Draw
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
If value = ToolDrawUUIDName Then
|
||||
value = m_Draw
|
||||
ElseIf value = ToolDrawUUIDName.Substring(0, ToolDrawUUIDName.Length - 1) Then
|
||||
value = String.Empty
|
||||
'EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
'If value = ToolDrawUUIDName Then
|
||||
' value = m_Draw
|
||||
'ElseIf value = ToolDrawUUIDName.Substring(0, ToolDrawUUIDName.Length - 1) Then
|
||||
' value = String.Empty
|
||||
'End If
|
||||
'm_Draw = value
|
||||
'UpdateSceneToolDraw(DrawUpdateSource.DRAW)
|
||||
If value <> m_Draw Then
|
||||
m_Draw = value
|
||||
End If
|
||||
m_Draw = value
|
||||
UpdateSceneToolDraw(DrawUpdateSource.DRAW)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DRAW, value)
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Head As String
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Head
|
||||
''' </summary>
|
||||
Public Property Head As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim sHead As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sHead)
|
||||
Return sHead
|
||||
Return m_Head
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.HEAD, value)
|
||||
If value <> m_Head Then
|
||||
m_Head = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_UserNotes As String
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the User Notes
|
||||
''' </summary>
|
||||
Public Property UserNotes As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim sUserNotes As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sUserNotes)
|
||||
Return sUserNotes
|
||||
Return m_UserNotes
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, value)
|
||||
If value <> m_UserNotes Then
|
||||
m_UserNotes = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_TcPos As String
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Tc Pos
|
||||
''' </summary>
|
||||
Public Property TcPos As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim sTcPos As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sTcPos)
|
||||
Return sTcPos
|
||||
Return m_TcPos
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TCPOS, value)
|
||||
If value <> m_TcPos Then
|
||||
m_TcPos = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private m_Uuid As String
|
||||
''' <summary>
|
||||
''' Property that read and write to the tool's database the Uuid
|
||||
''' </summary>
|
||||
Public Property Uuid As String
|
||||
Get
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim sUuid As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.UUID, sUuid)
|
||||
Return sUuid
|
||||
Return m_Uuid
|
||||
End Get
|
||||
Set(value As String)
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.UUID, value)
|
||||
If value <> m_Uuid Then
|
||||
m_Uuid = value
|
||||
End If
|
||||
End Set
|
||||
End Property
|
||||
|
||||
#End Region ' Tool Property
|
||||
|
||||
Private Sub ReadToolParam()
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim nValue As Integer = 0
|
||||
Dim dValue As Double = 0
|
||||
Dim sValue As String = String.Empty
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORR, nValue)
|
||||
Corr = nValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.EXIT_, nValue)
|
||||
ExitPar = nValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TYPE, nValue)
|
||||
Type = nValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.COOLANT, nValue)
|
||||
Coolant = nValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.CORNRAD, dValue)
|
||||
CornRad = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DIAM, dValue)
|
||||
Diam = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTDIAM, dValue)
|
||||
TotDiam = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.FEED, dValue)
|
||||
Feed = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.ENDFEED, dValue)
|
||||
EndFeed = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.STARTFEED, dValue)
|
||||
StartFeed = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TIPFEED, dValue)
|
||||
TipFeed = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LEN, dValue)
|
||||
Len = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TOTLEN, dValue)
|
||||
TotLen = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXMAT, dValue)
|
||||
MaxMat = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.LONOFFSET, dValue)
|
||||
LonOffset = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.RADOFFSET, dValue)
|
||||
RadOffset = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SPEED, dValue)
|
||||
Speed = DoubleToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.SIDEANG, dValue)
|
||||
SideAng = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXSPEED, dValue)
|
||||
MaxSpeed = DoubleToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.THICK, dValue)
|
||||
Thick = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MAXABSORPTION, dValue)
|
||||
MaxAbsorption = DoubleToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.MINFEED, dValue)
|
||||
MinFeed = LenToString(dValue, 4)
|
||||
EgtTdbGetCurrToolParam(MCH_TP.DRAW, sValue)
|
||||
Draw = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.HEAD, sValue)
|
||||
Head = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.USERNOTES, sValue)
|
||||
UserNotes = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.TCPOS, sValue)
|
||||
TcPos = sValue
|
||||
EgtTdbGetCurrToolParam(MCH_TP.UUID, sValue)
|
||||
Uuid = sValue
|
||||
End Sub
|
||||
|
||||
Private Sub WriteToolParam()
|
||||
EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
|
||||
Dim dValue As Double = 0
|
||||
EgtTdbSetCurrToolParam(MCH_TP.CORR, Corr)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.EXIT_, ExitPar)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TYPE, Type)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.COOLANT, Coolant)
|
||||
StringToLen(CornRad, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.CORNRAD, dValue)
|
||||
StringToLen(TotDiam, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TOTDIAM, dValue)
|
||||
StringToLen(Feed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.FEED, dValue)
|
||||
StringToLen(EndFeed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.ENDFEED, dValue)
|
||||
StringToLen(StartFeed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.STARTFEED, dValue)
|
||||
StringToLen(TipFeed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TIPFEED, dValue)
|
||||
StringToLen(Len, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.LEN, dValue)
|
||||
StringToLen(TotLen, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TOTLEN, dValue)
|
||||
StringToLen(MaxMat, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXMAT, dValue)
|
||||
StringToLen(LonOffset, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.LONOFFSET, dValue)
|
||||
StringToLen(RadOffset, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.RADOFFSET, dValue)
|
||||
StringToDouble(Speed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.SPEED, dValue)
|
||||
StringToLen(SideAng, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.SIDEANG, dValue)
|
||||
StringToDouble(MaxSpeed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXSPEED, dValue)
|
||||
StringToLen(Thick, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.THICK, dValue)
|
||||
StringToDouble(MaxAbsorption, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MAXABSORPTION, dValue)
|
||||
StringToLen(MinFeed, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.MINFEED, dValue)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.DRAW, Draw)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.HEAD, Head)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.USERNOTES, UserNotes)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.TCPOS, TcPos)
|
||||
EgtTdbSetCurrToolParam(MCH_TP.UUID, Uuid)
|
||||
End Sub
|
||||
|
||||
#Region "Constructors"
|
||||
|
||||
Sub New(Name As String)
|
||||
@@ -655,10 +710,6 @@ Public Class ToolTreeViewItem
|
||||
End Sub)
|
||||
End Sub
|
||||
|
||||
Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
|
||||
MyBase.New(Name, IsSelected, IsExpanded, IsActive)
|
||||
End Sub
|
||||
|
||||
#End Region ' Constructors
|
||||
|
||||
#Region "ToolSceneUpdate"
|
||||
@@ -1036,7 +1087,7 @@ End Class
|
||||
''' It's an element in the treeview that represent a folder, but also a tool family
|
||||
''' </summary>
|
||||
Public Class FamilyToolTreeViewItem
|
||||
Inherits ParentItem
|
||||
Inherits InheritableTreeViewItem
|
||||
|
||||
Private m_ToolType As MCH_TF
|
||||
''' <summary>
|
||||
@@ -1093,10 +1144,6 @@ Public Class FamilyToolTreeViewItem
|
||||
Me.PictureString = PicturePath
|
||||
End Sub
|
||||
|
||||
Sub New(Name As String, IsSelected As Boolean, IsExpanded As Boolean, IsActive As Boolean)
|
||||
MyBase.New(Name, IsSelected, IsExpanded, IsActive)
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
''' <summary>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,6 @@
|
||||
<sys:Int32 x:Key="NamePar">23</sys:Int32>
|
||||
<sys:Int32 x:Key="UserNotes">24</sys:Int32>
|
||||
<sys:Int32 x:Key="TcPos">25</sys:Int32>
|
||||
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid>
|
||||
@@ -64,96 +63,83 @@
|
||||
</UniformGrid>
|
||||
|
||||
<TreeView Name="ToolsTreeView" Grid.Row="1"
|
||||
ItemsSource="{Binding Path=ToolsList}">
|
||||
<TreeView.Resources>
|
||||
<!--Modifico HierarchicalDataTemplate del CathegoryItem per poter inserire immagine e testo e per -->
|
||||
<!--renderlo apribile con un solo click -->
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:FamilyToolTreeViewItem}" ItemsSource="{Binding Items}">
|
||||
ItemsSource="{Binding ToolsList}">
|
||||
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" />
|
||||
<TreeView.Resources>
|
||||
<HierarchicalDataTemplate DataType="{x:Type local:FamilyToolTreeViewItem}" ItemsSource="{Binding Items}">
|
||||
|
||||
</Grid>
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Assegna ai nodi ToolItem lo Style normale dei TreeViewItem, eliminando l'ombra, data dal
|
||||
multibinding quando sono attivi.-->
|
||||
<HierarchicalDataTemplate.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}" >
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsEnabled" Value="{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Style>
|
||||
</HierarchicalDataTemplate.ItemContainerStyle>
|
||||
<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Width="32" Margin="0,8,6,4" />
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" FontSize="15" Margin="10" />
|
||||
|
||||
</HierarchicalDataTemplate>
|
||||
<!--Modifico DataTemplate del ToolItem per poter inserire immagine e testo-->
|
||||
<DataTemplate DataType="{x:Type local:ToolTreeViewItem}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
|
||||
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
|
||||
<TextBlock Grid.Column="1" Text="{Binding Name}" Height="18" FontSize="15" Margin="10"/>
|
||||
</HierarchicalDataTemplate>
|
||||
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</TreeView.Resources>
|
||||
<DataTemplate DataType="{x:Type local:ToolTreeViewItem}">
|
||||
<Grid >
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Style dei nodi CathegoryItem che li riquadra di azzurro quando clicckati ed elimina l'ombra grigia -->
|
||||
<!--che si presenta quando la categoria rimane vuota (ombra causata dal multibinding). -->
|
||||
<TreeView.ItemContainerStyle>
|
||||
<Style TargetType="{x:Type TreeViewItem}">
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="IsEnabled" Value="{Binding IsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Style>
|
||||
</TreeView.ItemContainerStyle>
|
||||
<!--<Image Grid.Column="0" Source="{Binding PictureString}" Height="32" Margin="0,8,6,4" />-->
|
||||
<TextBlock Grid.Column="1" Text="{Binding NamePar}" Height="18" FontSize="15" Margin="10"/>
|
||||
|
||||
</TreeView>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
</TreeView.Resources>
|
||||
|
||||
</TreeView>
|
||||
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="1" Grid.RowSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Column="1" Grid.RowSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.Resources>
|
||||
<Grid.Resources>
|
||||
<!--Stile che modifica l'aspetto del messaggio d'errore-->
|
||||
<DataTemplate DataType="{x:Type ValidationError}">
|
||||
<TextBlock
|
||||
<DataTemplate DataType="{x:Type ValidationError}">
|
||||
<TextBlock
|
||||
FontStyle="Italic"
|
||||
Foreground="Red"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="0,1"
|
||||
Text="{Binding Path=ErrorContent}"
|
||||
/>
|
||||
</DataTemplate>
|
||||
</Grid.Resources>
|
||||
</DataTemplate>
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -186,14 +172,14 @@
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Column="0" Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
<ColumnDefinition Width="1*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="1*"/>
|
||||
<RowDefinition Height="1*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<TextBlock Text="{Binding MaxSpeedTxBl}" Style="{StaticResource ToolsTextBlock}"
|
||||
Visibility="{Binding Path=SelectedItem.Type, ElementName=ToolsTreeView,
|
||||
@@ -203,13 +189,13 @@
|
||||
Text="{Binding Path=SelectedItem.MaxSpeed,
|
||||
ElementName=ToolsTreeView, UpdateSourceTrigger=PropertyChanged}"
|
||||
Visibility="{Binding Path=SelectedItem.Type,
|
||||
ElementName=ToolsTreeView,
|
||||
ElementName=ToolsTreeView, UpdateSourceTrigger=PropertyChanged,
|
||||
Converter={StaticResource ToolParamVisibilityConverter},
|
||||
ConverterParameter={StaticResource MaxSpeed}}"/>
|
||||
<!--<ContentPresenter Grid.Row="1" Grid.ColumnSpan="2"
|
||||
<ContentPresenter Grid.Row="1" Grid.ColumnSpan="2"
|
||||
Content="{Binding ElementName=MaxSpeedTxBx,
|
||||
Path=(Validation.Errors).CurrentItem,
|
||||
UpdateSourceTrigger=PropertyChanged}"/>-->
|
||||
UpdateSourceTrigger=PropertyChanged}"/>
|
||||
|
||||
</Grid>
|
||||
|
||||
@@ -894,6 +880,7 @@
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
||||
<!--ContentControl che ospita la scena restituita sotto forma di WindowsFormsHost-->
|
||||
<ContentControl Content="{Binding ToolSceneHost}" Grid.Column="2"/>
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ Namespace EgtCAM5
|
||||
IniFile.m_ToolsDbSceneContext = m_ToolScene.GetCtx()
|
||||
' inibisco selezione diretta da Scene
|
||||
m_ToolScene.SetStatusNull()
|
||||
'EgtOpenFile("c:\EgtData\Varie\Temp\Fiera02.Nge")
|
||||
'OnPropertyChanged("SelectedMachine")
|
||||
m_bfirst = False
|
||||
End If
|
||||
@@ -286,7 +285,7 @@ Namespace EgtCAM5
|
||||
''' </summary>
|
||||
Private Sub LoadSelectedMachineTools()
|
||||
Dim ActiveToolsFamilies() As ToolsFamily = ReadActiveToolsFamilies()
|
||||
For Each ToolsFamily In ActiveToolsFamilies
|
||||
For Each ToolsFamily In ActiveToolsFamilies
|
||||
Dim FamilyTreeView As New FamilyToolTreeViewItem(ToolsFamily.FamilyName) ', ToolsFamily.FamilyId)
|
||||
ToolsList.Add(FamilyTreeView)
|
||||
Dim nType As Integer = 0
|
||||
@@ -450,7 +449,7 @@ Namespace EgtCAM5
|
||||
' Verifico che sia selezionato un utensile
|
||||
If TypeOf param Is ToolTreeViewItem Then
|
||||
Dim Tool As ToolTreeViewItem = DirectCast(param, ToolTreeViewItem)
|
||||
' Verifico che i parametri dell'utensile siano validi
|
||||
' Verifico che i parametri dell'utensile siano validi
|
||||
Return (Tool.IsValid And Tool.IsModified) Or Tool.NewTool
|
||||
Else
|
||||
Return False
|
||||
@@ -486,9 +485,9 @@ Namespace EgtCAM5
|
||||
' Cancello l'utensile
|
||||
EgtTdbRemoveTool(ToolToRemove.Name)
|
||||
' Rimuovo il nome dell'albero
|
||||
For Each ToolFamily In ToolsList
|
||||
If (ToolFamily.ToolType And ToolType) <> 0 Then
|
||||
ToolFamily.Items.Remove(ToolToRemove)
|
||||
For Each ToolFamily In ToolsList
|
||||
'If (ToolFamily.ToolType And ToolType) <> 0 Then
|
||||
' ToolFamily.Items.Remove(ToolToRemove)
|
||||
'End If
|
||||
Next
|
||||
Application.Msn.NotifyColleagues(Application.ERRORONTOOL, Nothing)
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
Imports System.ComponentModel
|
||||
|
||||
Module ValidationGroup
|
||||
|
||||
Public Delegate Function ValidationDelegate(propertyName As String) As String
|
||||
Public Delegate Sub PropertyChangedDelegate(propertyName As String)
|
||||
|
||||
<System.Runtime.CompilerServices.Extension> _
|
||||
Public Sub AddValidationGroup(Of T As {INotifyPropertyChanged, INotifyPropertyChanging})(obj As T, validationGroup As List(Of String), validationFlag As Boolean, validationDelegate As ValidationDelegate, propertyChangedDelegate As PropertyChangedDelegate)
|
||||
|
||||
' This delegate runs before a PropertyChanged event. If the property
|
||||
' being changed exists within the Validation Group, check for validation
|
||||
' errors on the other fields in the group. If there is an error with one
|
||||
' of them, set a flag to true.
|
||||
AddHandler obj.PropertyChanging, Sub(sender As Object, e As PropertyChangingEventArgs)
|
||||
If validationGroup.Contains(e.PropertyName) Then
|
||||
For Each [property] As String In validationGroup
|
||||
If validationDelegate([property]) IsNot Nothing Then
|
||||
validationFlag = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
' After the Property gets changed, if another field in this group was
|
||||
' invalid prior to the change, then raise the PropertyChanged event for
|
||||
' all other fields in the Validation Group to update them.
|
||||
' Also turn flag off so it doesn't get stuck in an infinite loop
|
||||
AddHandler obj.PropertyChanged, Sub(sender As Object, e As PropertyChangedEventArgs)
|
||||
If validationGroup.Contains(e.PropertyName) Then
|
||||
If validationFlag AndAlso validationDelegate(e.PropertyName) Is Nothing Then
|
||||
validationFlag = False
|
||||
For Each [property] As String In validationGroup
|
||||
propertyChangedDelegate([property])
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
Reference in New Issue
Block a user