diff --git a/Application.xaml.vb b/Application.xaml.vb
index 9a724d1..7222589 100644
--- a/Application.xaml.vb
+++ b/Application.xaml.vb
@@ -28,14 +28,14 @@ Class Application
Friend Const CLOSEAPPLICATION As String = "CloseApplication"
Friend Const PROJECTPAGE_SELECTED As String = "ProjectPage_Selected"
Friend Const PROJECTPAGE_DESELECTED As String = "ProjectPage_Deselected"
- Friend Const PROJECTPAGE_DRAWMODE As String = "ProjectPage_DrawMode"
- Friend Const PROJECTPAGE_MACHININGMODE As String = "ProjectPage_MachiningMode"
+ Friend Const DRAWMODE_ISCHECKED As String = "DrawMode_IsChecked"
+ Friend Const MACHININGMODE_ISCHECKED As String = "MachiningMode_IsChecked"
Friend Const RESETSTATUS As String = "ResetStatus"
Friend Const LOADOPERATIONLIST As String = "LoadOperationList"
Friend Const UPDATEMAINWINDOWTITLE As String = "UpdateMainWindowTitle"
Friend Const EMITTITLE As String = "EmitTitle"
- Friend Const MACHININGISCHECKED As String = "MachiningIsChecked"
- Friend Const TOOLORMACHININGDBACTIVE As String = "ToolOrMachiningDbActive"
+ Friend Const SETMACHININGMODE As String = "SetMachiningMode"
+ Friend Const SETDRAWMODE As String = "SetDrawMode"
' ProjectPage messages
Friend Const NOTIFYCURRPOS As String = "NotifyCurrPos"
@@ -168,18 +168,15 @@ Class Application
Friend Const LOADSELECTEDMACHINE As String = "LoadSelectedMachine"
Friend Const LOADCURRENTMACHINE As String = "LoadCurrentMachine"
Friend Const SAVECURRENTMACHINE As String = "SaveCurrentMachine"
- Friend Const RELOADCURRENTMACHINE As String = "ReloadCurrentMachine"
' ToolsDbPage messages
Friend Const REMOVETOOL As String = "RemoveTool"
Friend Const ERRORONTOOL As String = "ErrorOnTool"
Friend Const SAVETOOLDRAW As String = "SaveToolDraw"
- Friend Const SETFIRSTTOOLFAMILY As String = "SetFirstToolFamily"
' MachiningsDbPage messages
Friend Const REMOVEMACHINING As String = "RemoveMachining"
Friend Const ERRORONMACHINING As String = "ErrorOnMachining"
- Friend Const SETFIRSTMACHININGFAMILY As String = "SetFirstMachiningFamily"
' TopCommandBar
Friend Const NEWPROJECT As String = "NewProject"
diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj
index 58b1758..cd17f22 100644
--- a/EgtCAM5.vbproj
+++ b/EgtCAM5.vbproj
@@ -126,16 +126,20 @@
+
+ DbPanelView.xaml
+
+
DoorsPanelView.xaml
-
+
MachiningsDbView.xaml
-
-
+
+
@@ -202,11 +206,11 @@
-
+
ToolsDbView.xaml
-
-
+
+
TopCommandBarView.xaml
@@ -217,11 +221,15 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
@@ -301,7 +309,7 @@
Designer
MSBuild:Compile
-
+
Designer
MSBuild:Compile
diff --git a/EgtCAM5Resources.xaml b/EgtCAM5Resources.xaml
index 074ba8f..a028eee 100644
--- a/EgtCAM5Resources.xaml
+++ b/EgtCAM5Resources.xaml
@@ -15,22 +15,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/MainWindow/MainWindowViewModel.vb b/MainWindow/MainWindowViewModel.vb
index 9b87b86..ddb1385 100644
--- a/MainWindow/MainWindowViewModel.vb
+++ b/MainWindow/MainWindowViewModel.vb
@@ -76,94 +76,49 @@ Namespace EgtCAM5
' GRAPHICAL FIELDS WITH PROPERTY
- ' ObservableCollection that contains all the main TabControl pages
- Private m_TabList As New ObservableCollection(Of TabViewModel)
- Public Property TabList As ObservableCollection(Of TabViewModel)
- Get
- Return m_TabList
- End Get
- Set(value As ObservableCollection(Of TabViewModel))
- m_TabList = value
- End Set
- End Property
-
- ' Fields that contains current selected page in the main TabControl
- Private m_SelectedTab As TabViewModel
- Public Property SelectedTab As TabViewModel
- Get
- Return m_SelectedTab
- End Get
- Set(value As TabViewModel)
- If value IsNot m_SelectedTab Then
- m_SelectedTab = value
- If TypeOf value Is ProjectViewModel Then
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- ProjectPageSelected = True
- Application.Msn.NotifyColleagues(Application.SETFIRSTMACHININGFAMILY)
- Application.Msn.NotifyColleagues(Application.SETFIRSTTOOLFAMILY)
- Application.Msn.NotifyColleagues(Application.TOOLORMACHININGDBACTIVE, False)
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- ElseIf TypeOf value Is ToolsDbViewModel Or TypeOf value Is MachiningsDbViewModel Then
- Application.Msn.NotifyColleagues(Application.TOOLORMACHININGDBACTIVE, True)
- Application.Msn.NotifyColleagues(Application.RELOADCURRENTMACHINE)
- ProjectPageSelected = False
- End If
- OnPropertyChanged("SelectedTab")
- If TypeOf value Is MachiningsDbViewModel Then
- ' Esce dal gruppo di lavorazione corrente per poter aprire le macchine del database
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- End If
- End If
- End Set
- End Property
-
- ' Fields that know if the ProjectPage is currently selected
- Private m_ProjectPageSelected As Boolean
- Public Property ProjectPageSelected As Boolean
- Get
- Return m_ProjectPageSelected
- End Get
- Set(value As Boolean)
- If value <> m_ProjectPageSelected Then
- m_ProjectPageSelected = value
- If value Then
- Application.Msn.NotifyColleagues(Application.PROJECTPAGE_SELECTED)
- Else
- Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DESELECTED)
- End If
- End If
- End Set
- End Property
-
- '
- Private m_StatusBar As New StatusBarView
+ Private m_StatusBar As StatusBarView
Private m_bfirst As Boolean = True
Public ReadOnly Property StatusBar As StatusBarView
Get
If m_bfirst Then
m_bfirst = False
+ m_StatusBar = New StatusBarView
m_StatusBar.DataContext = New StatusBarViewModel
End If
Return m_StatusBar
End Get
End Property
+
+ Private m_ProjectPage As ProjectView
+ Private m_bFirstProjectPage As Boolean = True
+ Public ReadOnly Property ProjectPage As ProjectView
+ Get
+ If m_bFirstProjectPage Then
+ m_bFirstProjectPage = False
+ m_ProjectPage = New ProjectView
+ m_ProjectPage.DataContext = New ProjectViewModel
+ End If
+ Return m_ProjectPage
+ End Get
+ End Property
+
#End Region
#Region "CONSTRUCTOR"
Sub New()
-
- RegisterMyMessages()
' INITIALIZE EGALTECH ENVIRONMENT
InitializeEgtEnvironment()
+ RegisterMyMessages()
+
AddHandler Application.Current.MainWindow.KeyDown, AddressOf MainWindow_KeyDown
' INITIALIZE GRAPHICS
- TabList.Add(New ProjectViewModel)
- TabList.Add(New ToolsDbViewModel)
- TabList.Add(New MachiningsDbViewModel)
- SelectedTab = TabList(0)
- OnPropertyChanged("SelectedTab")
+ 'TabList.Add(New ProjectViewModel)
+ 'TabList.Add(New ToolsDbViewModel)
+ 'TabList.Add(New MachiningsDbViewModel)
+ 'SelectedTab = TabList(0)
+ 'OnPropertyChanged("SelectedTab")
End Sub
#End Region ' Constructor
diff --git a/ProjectPage/DbPanel/DbPanelView.xaml b/ProjectPage/DbPanel/DbPanelView.xaml
new file mode 100644
index 0000000..ff630b4
--- /dev/null
+++ b/ProjectPage/DbPanel/DbPanelView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
diff --git a/ProjectPage/DbPanel/DbPanelView.xaml.vb b/ProjectPage/DbPanel/DbPanelView.xaml.vb
new file mode 100644
index 0000000..3e20699
--- /dev/null
+++ b/ProjectPage/DbPanel/DbPanelView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class DbPanelView
+
+End Class
diff --git a/ProjectPage/DbPanel/DbPanelViewModel.vb b/ProjectPage/DbPanel/DbPanelViewModel.vb
new file mode 100644
index 0000000..3a67e47
--- /dev/null
+++ b/ProjectPage/DbPanel/DbPanelViewModel.vb
@@ -0,0 +1,91 @@
+Imports EgtUILib
+
+Namespace EgtCAM5
+
+ Public Class DbPanelViewModel
+ Inherits ViewModelBase
+
+#Region "FIELDS & PROPERTIES"
+
+ ' Definizione comandi
+ Private m_cmdToolDb As ICommand
+ Private m_cmdMachDb As ICommand
+
+#End Region 'FIELDS & PROPERTIES
+
+#Region "COMMANDS"
+
+#Region "ToolDbCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property ToolDbCommand As ICommand
+ Get
+ If m_cmdToolDb Is Nothing Then
+ m_cmdToolDb = New RelayCommand(AddressOf ToolDb, AddressOf CanToolDb)
+ End If
+ Return m_cmdToolDb
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub ToolDb(ByVal param As Object)
+ Dim ToolDbWindow As New ToolsDbView
+ ToolDbWindow.Height = 614
+ ToolDbWindow.Width = 1024
+ ToolDbWindow.DataContext = New ToolsDbViewModel
+ ToolDbWindow.ShowDialog()
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanToolDb(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' ToolDbCommand
+
+#Region "MachDbCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property MachDbCommand As ICommand
+ Get
+ If m_cmdMachDb Is Nothing Then
+ m_cmdMachDb = New RelayCommand(AddressOf MachDb, AddressOf CanMachDb)
+ End If
+ Return m_cmdMachDb
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub MachDb(ByVal param As Object)
+ Dim MachDbWindow As New MachiningsDbView
+ MachDbWindow.Height = 614
+ MachDbWindow.Width = 1024
+ MachDbWindow.DataContext = New MachiningsDbViewModel
+ MachDbWindow.ShowDialog()
+ End Sub
+
+ '''
+ ''' Returns always true.
+ '''
+ Private Function CanMachDb(ByVal param As Object) As Boolean
+ Return True
+ End Function
+
+#End Region ' MachDbCommand
+
+#End Region ' COMMANDS
+
+
+ End Class
+
+End Namespace
\ No newline at end of file
diff --git a/ProjectPage/DoorsPanel/DoorsPanelView.xaml b/ProjectPage/DoorsPanel/DoorsPanelView.xaml
index d89685c..ac8f534 100644
--- a/ProjectPage/DoorsPanel/DoorsPanelView.xaml
+++ b/ProjectPage/DoorsPanel/DoorsPanelView.xaml
@@ -3,9 +3,11 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
-
+
+
+
diff --git a/ProjectPage/DrawPanel/DrawPanelView.xaml b/ProjectPage/DrawPanel/DrawPanelView.xaml
index b4485b7..d767e2a 100644
--- a/ProjectPage/DrawPanel/DrawPanelView.xaml
+++ b/ProjectPage/DrawPanel/DrawPanelView.xaml
@@ -9,7 +9,7 @@
-
+
@@ -55,7 +55,7 @@
-
+
@@ -84,7 +84,7 @@
-
+
@@ -128,7 +128,7 @@
-
+
diff --git a/ProjectPage/DrawPanel/DrawPanelViewModel.vb b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
index 475acec..5a46ca2 100644
--- a/ProjectPage/DrawPanel/DrawPanelViewModel.vb
+++ b/ProjectPage/DrawPanel/DrawPanelViewModel.vb
@@ -344,15 +344,10 @@ Namespace EgtCAM5
Sub New()
' Leggo stato expander da file ini
- Dim Draw2D = GetPrivateProfileInt(S_GENERAL, K_DRAW2D, 0)
- Draw2DIsExpanded = If(Draw2D = 0, False, True)
- Dim Draw3D = GetPrivateProfileInt(S_GENERAL, K_DRAW3D, 0)
- Draw3DIsExpanded = If(Draw3D = 0, False, True)
- Dim Modify = GetPrivateProfileInt(S_GENERAL, K_MODIFY, 0)
- ModifyIsExpanded = If(Modify = 0, False, True)
- Dim Transform = GetPrivateProfileInt(S_GENERAL, K_TRANSFORM, 0)
- TransformIsExpanded = If(Transform = 0, False, True)
-
+ Draw2DIsExpanded = If(GetPrivateProfileInt(S_GENERAL, K_DRAW2D, 0) = 0, False, True)
+ Draw3DIsExpanded = If(GetPrivateProfileInt(S_GENERAL, K_DRAW3D, 0) = 0, False, True)
+ ModifyIsExpanded = If(GetPrivateProfileInt(S_GENERAL, K_MODIFY, 0) = 0, False, True)
+ TransformIsExpanded = If(GetPrivateProfileInt(S_GENERAL, K_TRANSFORM, 0) = 0, False, True)
Application.Msn.Register(Application.CLOSEAPPLICATION, Sub()
WritePrivateProfileString(S_GENERAL, K_DRAW2D, If(m_Draw2DIsExpanded, "1", "0"))
WritePrivateProfileString(S_GENERAL, K_DRAW3D, If(m_Draw3DIsExpanded, "1", "0"))
diff --git a/ProjectPage/ExecutePanel/ExecutePanelView.xaml b/ProjectPage/ExecutePanel/ExecutePanelView.xaml
index 04fa440..cc008af 100644
--- a/ProjectPage/ExecutePanel/ExecutePanelView.xaml
+++ b/ProjectPage/ExecutePanel/ExecutePanelView.xaml
@@ -2,8 +2,8 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
+
+
diff --git a/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb b/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb
index fdd8424..af423ad 100644
--- a/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb
+++ b/ProjectPage/ExecutePanel/ExecutePanelViewModel.vb
@@ -52,7 +52,7 @@ Namespace EgtCAM5
Return True
End Function
-#End Region ' ExecCommand
+#End Region ' ExecCommand
#End Region ' COMMANDS
diff --git a/ProjectPage/GridPanel/GridPanelView.xaml b/ProjectPage/GridPanel/GridPanelView.xaml
index d3db45c..705faac 100644
--- a/ProjectPage/GridPanel/GridPanelView.xaml
+++ b/ProjectPage/GridPanel/GridPanelView.xaml
@@ -3,43 +3,43 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
index 064a01b..328895f 100644
--- a/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
+++ b/ProjectPage/OptionPanel/MachiningOptionPanel/MachiningsTreeViewExpander/MachiningTreeExpanderViewModel.vb
@@ -43,10 +43,10 @@ Namespace EgtCAM5
' Per caricare l'albero la prima volta che viene aperto
IsEnabled = False
LoadSelectedMachineMachinings()
- Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
- m_MachiningsList.Clear()
- LoadSelectedMachineMachinings()
- End Sub)
+ Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
+ m_MachiningsList.Clear()
+ LoadSelectedMachineMachinings()
+ End Sub)
Application.Msn.Register(Application.MACHININGTREEVIEWEXPANDERISENABLED, Sub(bValue As Boolean)
IsEnabled = bValue
End Sub)
diff --git a/ProjectPage/OptionPanel/OptionPanelView.xaml b/ProjectPage/OptionPanel/OptionPanelView.xaml
index 9167d57..604405f 100644
--- a/ProjectPage/OptionPanel/OptionPanelView.xaml
+++ b/ProjectPage/OptionPanel/OptionPanelView.xaml
@@ -4,10 +4,10 @@
xmlns:interactivity="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
-
+
diff --git a/ProjectPage/OptionPanel/OptionPanelViewModel.vb b/ProjectPage/OptionPanel/OptionPanelViewModel.vb
index e6c78fe..18154b3 100644
--- a/ProjectPage/OptionPanel/OptionPanelViewModel.vb
+++ b/ProjectPage/OptionPanel/OptionPanelViewModel.vb
@@ -6,53 +6,8 @@ Namespace EgtCAM5
Inherits ViewModelBase
Private m_DrawIsChecked As Boolean
- Public Property DrawIsChecked As Boolean
- Get
- Return m_DrawIsChecked
- End Get
- Set(value As Boolean)
- If value <> m_DrawIsChecked Then
- m_DrawIsChecked = value
- If value Then
- Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
- EgtResetCurrMachGroup()
- EgtZoom(ZM.ALL)
- Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
- End If
- OnPropertyChanged("ManageLayerExpander")
- OnPropertyChanged("InfoExpander")
- OnPropertyChanged("InputExpander")
- End If
- End Set
- End Property
- Private m_WorkIsChecked As Boolean
- Public Property WorkIsChecked As Boolean
- Get
- Return m_WorkIsChecked
- End Get
- Set(value As Boolean)
- If value <> m_WorkIsChecked Then
- m_WorkIsChecked = value
- If value Then
- Application.Msn.NotifyColleagues(Application.PROJECTPAGE_MACHININGMODE)
- Dim nId = EgtGetFirstMachGroup()
- If nId <> GDB_ID.NULL Then
- EgtSetCurrMachGroup(nId)
- Else
- EgtAddMachGroup("Mach01", "CMS-PF122R8RR")
- End If
- EgtZoom(ZM.ALL)
- Else
- ' Deevidenzio l'ultima operazione evidenziata
- Application.Msn.NotifyColleagues(Application.REMOVEMARKFROMLASTOPERATION)
- End If
- OnPropertyChanged("ManageLayerExpander")
- OnPropertyChanged("InfoExpander")
- OnPropertyChanged("InputExpander")
- End If
- End Set
- End Property
+ Private m_MachiningIsChecked As Boolean
' GRAPHICAL ELEMENTS
Private m_OperationExpander As OperationExpanderView
@@ -117,12 +72,21 @@ Namespace EgtCAM5
End Property
Sub New()
- ' Inizializzo la selezione della modilità Draw all'apertura del programma
- DrawIsChecked = True
- Application.Msn.Register(Application.MACHININGISCHECKED, Sub()
- WorkIsChecked = True
- OnPropertyChanged("WorkIsChecked")
+ Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
+ m_DrawIsChecked = False
+ m_MachiningIsChecked = True
+ OnPropertyChanged("ManageLayerExpander")
+ OnPropertyChanged("InfoExpander")
+ OnPropertyChanged("InputExpander")
+ End Sub)
+ Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
+ m_DrawIsChecked = True
+ m_MachiningIsChecked = False
+ OnPropertyChanged("ManageLayerExpander")
+ OnPropertyChanged("InfoExpander")
+ OnPropertyChanged("InputExpander")
End Sub)
+
End Sub
End Class
diff --git a/ProjectPage/ProjectView.xaml b/ProjectPage/ProjectView.xaml
index 9508b45..755ce6a 100644
--- a/ProjectPage/ProjectView.xaml
+++ b/ProjectPage/ProjectView.xaml
@@ -32,6 +32,10 @@
IsTopDockable="True" IsBottomDockable="True" IsLeftDockable="False" IsRightDockable="False">
+
+
+
diff --git a/ProjectPage/ProjectView.xaml.vb b/ProjectPage/ProjectView.xaml.vb
index a4f16a0..1c5c21b 100644
--- a/ProjectPage/ProjectView.xaml.vb
+++ b/ProjectPage/ProjectView.xaml.vb
@@ -36,24 +36,24 @@ Public Class ProjectView
If GetPrivateProfileFloatingWinPos(S_GENERAL, "OptionPanel", sState, nIndex, nLeft, nTop) And Not String.IsNullOrEmpty(sState) Then
PanelPositioning(OptionPanel, sState, nIndex, nLeft, nTop)
End If
- Application.Msn.Register(Application.PROJECTPAGE_DRAWMODE, Sub()
- ShowPanel.Visibility = Visibility.Visible
- ViewPanel.Visibility = Visibility.Visible
- InstrumentPanel.Visibility = Visibility.Visible
- GridPanel.Visibility = Visibility.Visible
- DoorsPanel.Visibility = Visibility.Visible
- DrawPanel.Visibility = Visibility.Visible
- OptionPanel.Visibility = Visibility.Visible
- End Sub)
- Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
- ShowPanel.Visibility = Visibility.Visible
- ViewPanel.Visibility = Visibility.Visible
- InstrumentPanel.Visibility = Visibility.Visible
- GridPanel.Visibility = Visibility.Visible
- DoorsPanel.Visibility = Visibility.Visible
- DrawPanel.Visibility = Visibility.Collapsed
- OptionPanel.Visibility = Visibility.Visible
- End Sub)
+ Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
+ ShowPanel.Visibility = Visibility.Visible
+ ViewPanel.Visibility = Visibility.Visible
+ InstrumentPanel.Visibility = Visibility.Visible
+ GridPanel.Visibility = Visibility.Visible
+ DoorsPanel.Visibility = Visibility.Visible
+ DrawPanel.Visibility = Visibility.Visible
+ OptionPanel.Visibility = Visibility.Visible
+ End Sub)
+ Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
+ ShowPanel.Visibility = Visibility.Visible
+ ViewPanel.Visibility = Visibility.Visible
+ InstrumentPanel.Visibility = Visibility.Visible
+ GridPanel.Visibility = Visibility.Visible
+ DoorsPanel.Visibility = Visibility.Visible
+ DrawPanel.Visibility = Visibility.Collapsed
+ OptionPanel.Visibility = Visibility.Visible
+ End Sub)
End Sub
Private Sub PanelPositioning(FloatingPanel As EgtFloatingPanel, sState As String, nIndex As Integer, nLeft As Integer, nTop As Integer)
diff --git a/ProjectPage/ProjectViewModel.vb b/ProjectPage/ProjectViewModel.vb
index 4113546..501b701 100644
--- a/ProjectPage/ProjectViewModel.vb
+++ b/ProjectPage/ProjectViewModel.vb
@@ -58,8 +58,6 @@ Namespace EgtCAM5
Sub New()
Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
- ' Funzione che contiene la registrazione alle funzioni che permettono di visualizzare e nascondere le finestre di disegno
- ManagePanelVisibility()
ManageClosingApplication()
RegisterMainWindowCommands()
' Inizializza i parametri della scena
@@ -217,7 +215,7 @@ Namespace EgtCAM5
' visualizzazione avanzata dei triangoli costituenti le superfici
Dim bShowTriaAdv As Boolean = (GetPrivateProfileInt(S_SCENE, K_SHOWTRIAADV, 1) <> 0)
EgtSetShowTriaAdv(bShowTriaAdv)
- Application.Msn.NotifyColleagues(Application.PROJECTPAGE_DRAWMODE)
+ Application.Msn.NotifyColleagues(Application.DRAWMODE_ISCHECKED)
' ObjTree non selezionato
Application.Msn.NotifyColleagues(Application.UPDATEOBJTREEOLDID, GDB_ID.NULL)
' nascondo input box
@@ -235,15 +233,15 @@ Namespace EgtCAM5
If Not String.IsNullOrWhiteSpace(sFile) Then
Dim nFileType As Integer = EgtGetFileType(sFile)
Select Case nFileType
- Case FT.NGE, FT.NFE
- m_Controller.OpenProject(sFile, False)
- bOpen = True
- Case FT.DXF, FT.STL, FT.CNC, FT.CSF, FT.BTL
- m_Controller.ImportProject(sFile, False)
- bOpen = True
- Case FT.TSC, FT.LUA
- m_Controller.Exec(sFile, False)
- bOpen = True
+ Case FT.NGE, FT.NFE
+ m_Controller.OpenProject(sFile, False)
+ bOpen = True
+ Case FT.DXF, FT.STL, FT.CNC, FT.CSF, FT.BTL
+ m_Controller.ImportProject(sFile, False)
+ bOpen = True
+ Case FT.TSC, FT.LUA
+ m_Controller.Exec(sFile, False)
+ bOpen = True
End Select
If IO.Path.GetExtension(sFile).ToLower() = ".ddf" Then
' Se manca direttorio uso quello di default
@@ -302,19 +300,6 @@ Namespace EgtCAM5
EgtSetGridColor(MinLnColor, MajLnColor)
End Sub
- '''
- ''' Method that manage the visibility of the ProjectPage's Panels
- '''
- Sub ManagePanelVisibility()
- Application.Msn.Register(Application.PROJECTPAGE_DRAWMODE, Sub()
- Me.sTabName = EgtMsg(MSG_MAINWINDOW + 1)
- End Sub)
- Application.Msn.Register(Application.PROJECTPAGE_MACHININGMODE, Sub()
- Me.sTabName = EgtMsg(MSG_MAINWINDOW + 2)
- End Sub)
-
- End Sub
-
'''
''' Method that manage the visibility of the ProjectPage's Panels
'''
diff --git a/ProjectPage/ViewPanel/ViewPanelView.xaml b/ProjectPage/ViewPanel/ViewPanelView.xaml
index fb38423..5f5af81 100644
--- a/ProjectPage/ViewPanel/ViewPanelView.xaml
+++ b/ProjectPage/ViewPanel/ViewPanelView.xaml
@@ -12,7 +12,6 @@
-
diff --git a/Special/Doors.vb b/Special/Doors.vb
index 348a1d8..53e870e 100644
--- a/Special/Doors.vb
+++ b/Special/Doors.vb
@@ -76,7 +76,7 @@ Public Module Doors
' Cursore standard
scene.Cursor = System.Windows.Forms.Cursors.Default
- Application.Msn.NotifyColleagues(Application.MACHININGISCHECKED)
+ Application.Msn.NotifyColleagues(Application.SETMACHININGMODE)
Return bOk
End Function
diff --git a/StatusBar/StatusBarViewModel.vb b/StatusBar/StatusBarViewModel.vb
index a05a173..bf38be3 100644
--- a/StatusBar/StatusBarViewModel.vb
+++ b/StatusBar/StatusBarViewModel.vb
@@ -132,7 +132,6 @@ Namespace EgtCAM5
EgtSetCurrMachine(m_SelectedMachine.Name)
IniFile.m_sDbsCurrMachIniFilePath = m_SelectedMachine.MachineDirPath & "\" & m_SelectedMachine.Name & ".ini"
IniFile.m_sTdbCurrMachToolsDirPath = m_SelectedMachine.MachineDirPath & "\Tools"
- Application.Msn.NotifyColleagues(Application.LOADSELECTEDMACHINE)
OnPropertyChanged("SelectedMachine")
End If
End Set
@@ -202,10 +201,6 @@ Namespace EgtCAM5
Application.Msn.Register(Application.SAVECURRENTMACHINE, Sub()
WritePrivateProfileString(S_MACH, K_CURRMACH, SelectedMachine.Name)
End Sub)
- Application.Msn.Register(Application.RELOADCURRENTMACHINE, Sub()
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- EgtSetCurrMachine(SelectedMachine.Name)
- End Sub)
End Sub
#End Region ' Constructor
diff --git a/ToolsDbPage/ToolTreeView.vb b/ToolsDbPage/ToolTreeView.vb
deleted file mode 100644
index 84d29b7..0000000
--- a/ToolsDbPage/ToolTreeView.vb
+++ /dev/null
@@ -1,1203 +0,0 @@
-Imports System.Collections.ObjectModel
-Imports System.ComponentModel
-Imports System.Text.RegularExpressions
-Imports System.IO
-Imports EgtUILib
-Imports EgtWPFLib5
-Imports EgtCAM5.Utility
-
-'''
-''' Class that represent a Tool in the treeview.
-''' 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
-'''
-Public Class ToolTreeViewItem
- Inherits InheritableTreeViewItem
- Implements IDataErrorInfo
-
- Private m_ErrorOnTool As Boolean
- Public Property ErrorOnTool As Boolean
- Get
- Return m_ErrorOnTool
- End Get
- Set(value As Boolean)
- If IsValid Then
- m_ErrorOnTool = False
- Application.Msn.NotifyColleagues(Application.ERRORONTOOL, Nothing)
- Else
- m_ErrorOnTool = True
- Application.Msn.NotifyColleagues(Application.ERRORONTOOL, Me)
- End If
- End Set
- End Property
-
-#Region "Tool Property"
-
- ' Variabile che indica se c'è un errore nel nome dell'utensile (ad esempio nome già utilizzato)
- Dim bErrorToolName As Boolean = False
- '''
- ''' Property that read and write to the tool's database the Name
- '''
- Public Property NamePar As String
- Get
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- Dim sNamePar As String = String.Empty
- EgtTdbGetCurrToolParam(MCH_TP.NAME, sNamePar)
- Return sNamePar
- End Get
- Set(value As String)
- bErrorToolName = False
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- If EgtTdbSetCurrToolParam(MCH_TP.NAME, value) Then
- Name = value
- Else
- bErrorToolName = True
- End If
- End Set
- End Property
-
- ' Variabile che indica se l'utensile è appena stato creato
- Dim m_NewTool As Boolean = False
- Public Property NewTool As Boolean
- Get
- Return m_NewTool
- End Get
- Set(value As Boolean)
- m_NewTool = value
- End Set
- End Property
-
- '''
- ''' Property that determines if the Tool is selected or not
- '''
- Public Overrides Property IsSelected As Boolean
- Get
- Return m_isSelected
- End Get
- Set(value As Boolean)
- If (value <> m_isSelected) Then
- m_isSelected = value
- ' 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
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- EgtTdbSetCurrTool(Me.Name)
- 'ReadToolParam()
- NotifyPropertyChanged("Corr")
- NotifyPropertyChanged("ExitPar")
- NotifyPropertyChanged("Type")
- NotifyPropertyChanged("Coolant")
- NotifyPropertyChanged("CornRad")
- NotifyPropertyChanged("Diam")
- NotifyPropertyChanged("TotDiam")
- NotifyPropertyChanged("Feed")
- NotifyPropertyChanged("EndFeed")
- NotifyPropertyChanged("StartFeed")
- NotifyPropertyChanged("TipFeed")
- NotifyPropertyChanged("Len")
- NotifyPropertyChanged("TotLen")
- NotifyPropertyChanged("MaxMat")
- NotifyPropertyChanged("LonOffset")
- NotifyPropertyChanged("RadOffset")
- NotifyPropertyChanged("Speed")
- NotifyPropertyChanged("SideAng")
- NotifyPropertyChanged("MaxSpeed")
- NotifyPropertyChanged("Thick")
- NotifyPropertyChanged("MaxAbsorption")
- NotifyPropertyChanged("MinFeed")
- NotifyPropertyChanged("Draw")
- NotifyPropertyChanged("Head")
- NotifyPropertyChanged("NamePar")
- NotifyPropertyChanged("UserNotes")
- NotifyPropertyChanged("TcPos")
- ' Aggiorno disegno utensile
- UpdateSceneToolDraw(DrawUpdateSource.DRAW)
- ' Otherwhise Tool is deselected, so it and the database will be saved to
- ' keep the modify effective
- Else
- If (EgtTdbIsCurrToolModified() And Me.IsValid) Or Me.NewTool Then
-
- Select Case MsgBox(EgtMsg(MSG_TOOLSERRORS), MsgBoxStyle.YesNo, EgtMsg(MSG_TOOLSERRORS + 1))
- Case MsgBoxResult.Yes
- m_NewTool = False
- EgtTdbSaveCurrTool()
- SaveToolDraw()
- EgtTdbSave()
- Case MsgBoxResult.No
- If m_NewTool Then
- Application.Msn.NotifyColleagues(Application.REMOVETOOL, Me)
- End If
- End Select
- End If
- End If
-
- End If
-
- End Set
-
- End Property
-
- Private m_Corr As Integer
- '''
- ''' Property that read and write to the tool's database the Corrector
- '''
- Public Property Corr As Integer
- Get
- Return m_Corr
- End Get
- Set(value As Integer)
- If value <> m_Corr Then
- m_Corr = value
- End If
- End Set
- End Property
-
- Private m_Exit As Integer
- '''
- ''' Property that read and write to the tool's database the Exit
- '''
- Public Property ExitPar As Integer
- Get
- Return m_Exit
- End Get
- Set(value As Integer)
- If value <> m_Exit Then
- m_Exit = value
- End If
- End Set
- End Property
-
- Private m_Type As Integer
- '''
- ''' Property that read and write to the tool's database the Type
- '''
- Public Property Type As Integer
- Get
- Return m_Type
- End Get
- Set(value As Integer)
- If value <> m_Type Then
- m_Type = value
- End If
- End Set
- End Property
-
- Private m_Coolant As Integer
- '''
- ''' Property that read and write to the tool's database the Coolant
- '''
- Public Property Coolant As Integer
- Get
- Return m_Coolant
- End Get
- Set(value As Integer)
- If value <> m_Coolant Then
- m_Coolant = value
- End If
- End Set
- End Property
-
- Private m_CornRad As Double
- '''
- ''' Property that read and write to the tool's database the Corner Radius
- '''
- Public Property CornRad As String
- Get
- Return LenToString(m_CornRad, 4)
- End Get
- Set(value As String)
- If value <> LenToString(m_CornRad, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_CornRad = dValue
- End If
- End Set
- End Property
-
- Private m_Diam As Double
- '''
- ''' Property that read and write to the tool's database the Diameter
- '''
- Public Property Diam As String
- Get
- Return LenToString(m_Diam, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Total Diameter
- '''
- Public Property TotDiam As String
- Get
- Return LenToString(m_TotDiam, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Feed
- '''
- Public Property Feed As String
- Get
- Return LenToString(m_Feed, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the End Feed
- '''
- Public Property EndFeed As String
- Get
- Return LenToString(m_EndFeed, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Start Feed
- '''
- Public Property StartFeed As String
- Get
- Return LenToString(m_StartFeed, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Tip Feed
- '''
- Public Property TipFeed As String
- Get
- Return LenToString(m_TipFeed, 4)
- End Get
- Set(value As String)
- If value <> LenToString(m_TipFeed, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_TipFeed = dValue
- End If
- End Set
- End Property
-
- Private m_Len As Double
- '''
- ''' Property that read and write to the tool's database the Len
- '''
- Public Property Len As String
- Get
- Return LenToString(m_Len, 4)
- End Get
- Set(value As String)
- 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
-
- Private m_TotLen As Double
- '''
- ''' Property that read and write to the tool's database the Total Len
- '''
- Public Property TotLen As String
- Get
- Return LenToString(m_TotLen, 4)
- End Get
- Set(value As String)
- 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
-
- Private m_MaxMat As Double
- '''
- ''' Property that read and write to the tool's database the Max Material
- '''
- Public Property MaxMat As String
- Get
- Return LenToString(m_MaxMat, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Lon Offset
- '''
- Public Property LonOffset As String
- Get
- Return LenToString(m_LonOffset, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Rad Offset
- '''
- Public Property RadOffset As String
- Get
- Return LenToString(m_RadOffset, 4)
- End Get
- Set(value As String)
- If value <> LenToString(m_RadOffset, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_RadOffset = dValue
- End If
- End Set
- End Property
-
- Private m_Speed As Double
- '''
- ''' Property that read and write to the tool's database the Speed
- '''
- Public Property Speed As String
- Get
- Return DoubleToString(m_Speed, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Side Angle
- '''
- Public Property SideAng As String
- Get
- Return LenToString(m_SideAng, 4)
- End Get
- Set(value As String)
- If value <> LenToString(m_SideAng, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_SideAng = dValue
- End If
- End Set
- End Property
-
- Private m_MaxSpeed As Double
- '''
- ''' Property that read and write to the tool's database the Max Speed
- '''
- Public Property MaxSpeed As String
- Get
- Return DoubleToString(m_MaxSpeed, 4)
- End Get
- Set(value As String)
- If value <> LenToString(m_MaxSpeed, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_MaxSpeed = dValue
- End If
- End Set
- End Property
-
- Private m_Thick As Double
- '''
- ''' Property that read and write to the tool's database the Thick
- '''
- Public Property Thick As String
- Get
- Return LenToString(m_Thick, 4)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Max Absorption
- '''
- Public Property MaxAbsorption As String
- Get
- Return LenToString(m_MaxAbsorption, 3)
- End Get
- Set(value As String)
- 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
- '''
- ''' Property that read and write to the tool's database the Min Feed
- '''
- Public Property MinFeed As String
- Get
- Return LenToString(m_MinFeed, 3)
- End Get
- Set(value As String)
- If value <> LenToString(m_MinFeed, 4) Then
- Dim dValue As Double = 0
- StringToLen(value, dValue)
- m_MinFeed = dValue
- End If
- End Set
- End Property
-
- Private m_Draw As String
- '''
- ''' Property that read and write to the tool's database the Draw
- '''
- Public Property Draw As String
- Get
- 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
- 'End If
- 'm_Draw = value
- 'UpdateSceneToolDraw(DrawUpdateSource.DRAW)
- If value <> m_Draw Then
- m_Draw = value
- End If
- End Set
- End Property
-
- Private m_Head As String
- '''
- ''' Property that read and write to the tool's database the Head
- '''
- Public Property Head As String
- Get
- Return m_Head
- End Get
- Set(value As String)
- If value <> m_Head Then
- m_Head = value
- End If
- End Set
- End Property
-
- Private m_UserNotes As String
- '''
- ''' Property that read and write to the tool's database the User Notes
- '''
- Public Property UserNotes As String
- Get
- Return m_UserNotes
- End Get
- Set(value As String)
- If value <> m_UserNotes Then
- m_UserNotes = value
- End If
- End Set
- End Property
-
- Private m_TcPos As String
- '''
- ''' Property that read and write to the tool's database the Tc Pos
- '''
- Public Property TcPos As String
- Get
- Return m_TcPos
- End Get
- Set(value As String)
- If value <> m_TcPos Then
- m_TcPos = value
- End If
- End Set
- End Property
-
- Private m_Uuid As String
- '''
- ''' Property that read and write to the tool's database the Uuid
- '''
- Public Property Uuid As String
- Get
- Return m_Uuid
- End Get
- Set(value As String)
- 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)
- MyBase.New(Name)
- Application.Msn.Register(Application.SAVETOOLDRAW, Sub()
- SaveToolDraw()
- End Sub)
- End Sub
-
-#End Region ' Constructors
-
-#Region "ToolSceneUpdate"
-
- ' Enum che indica le proprietà di disegno dell'utensile
- Friend Enum DrawUpdateSource
- DIAM = 0
- LEN = 1
- MAXMAT = 2
- THICK = 3
- DRAW = 4
- TOTLEN = 5
- End Enum
-
- ' Variabili che segnalano errori nel disegno dell'utensile
- Dim bToolMakerError As Boolean = False
- 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
- bToolMakerError = False
- bDrawNameError = False
- bDrawNameExistError = False
- bDrawingError = False
-
- 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
- CreateToolDraw(UpdateSource)
- Else
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- If IsNgeFile(m_Draw) Then
- If EgtOpenFile(IniFile.m_sTdbCurrMachToolsDirPath & "\" & m_Draw) Then
- EgtSetView(VT.TOP, False)
- EgtZoom(ZM.ALL)
- Else
- ' Errore
- bDrawNameExistError = True
- EgtNewFile()
- EgtSetView(VT.TOP, False)
- EgtZoom(ZM.ALL)
- End If
- Else
- ' Errore
- bDrawNameError = True
- EgtNewFile()
- EgtSetView(VT.TOP, False)
- EgtZoom(ZM.ALL)
- End If
- End If
- NotifyPropertyChanged("Draw")
- NotifyPropertyChanged("MaxMat")
- NotifyPropertyChanged("Thick")
- NotifyPropertyChanged("Diam")
- NotifyPropertyChanged("Len")
- NotifyPropertyChanged("TotLen")
- End Sub
-
- Private Sub CreateToolDraw(UpdateSource As DrawUpdateSource)
- ' Carico il relativo ToolHolder
- Dim ToolHolder As String = String.Empty
- ToolHolder = LoadToolHolder()
- If Not LoadToolMaker() OrElse Not CreateToolDraw(ToolHolder, UpdateSource) Then
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- EgtNewFile()
- End If
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- ' Aggiorno visualizzazione
- EgtSetView(VT.TOP, False)
- EgtZoom(ZM.ALL)
- ' Salvo il
- End Sub
-
- '''
- ''' Mathod that load the toolholder for the current tool (based on his head), or return an empty string
- '''
- Private Function LoadToolHolder() As String
- Dim sHolder As String = String.Empty
- EgtUILib.GetPrivateProfileString(S_TOOLHOLDER, Head & "." & ExitPar.ToString(), "", sHolder, IniFile.m_sDbsCurrMachIniFilePath)
- If String.IsNullOrWhiteSpace(sHolder) Then
- Return String.Empty
- Else
- Dim sHolderPath As String = String.Empty
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- EgtTdbGetToolHolderDir(sHolderPath)
- sHolderPath += "\" & sHolder
- Return sHolderPath
- End If
- End Function
-
- Private Function LoadToolMaker() As Boolean
- Dim sMaker As String = String.Empty
- EgtUILib.GetPrivateProfileString(S_TOOLS, ConvertTypeToString(Type), "", sMaker, IniFile.m_sDbsCurrMachIniFilePath)
- If String.IsNullOrWhiteSpace(sMaker) Then bToolMakerError = True
- ' Acquisisce solo il file lua, ma meglio impostare contesto disegno utensili (se ci sono chiamate...)
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- Return EgtLuaExecFile(IniFile.m_sToolMakersDir & "\" & sMaker)
- End Function
-
- Private Function ConvertTypeToString(Type As Integer) As String
- Select Case Type
- Case MCH_TY.DRILL_STD, MCH_TY.DRILL_LONG
- Return "StandardDrillMaker"
- Case MCH_TY.SAW_STD, MCH_TY.SAW_FLAT
- Return "StandardSawMaker"
- Case MCH_TY.MILL_STD, MCH_TY.MILL_NOTIP
- Return "StandardMillMaker"
- Case MCH_TY.MORTISE_STD
- Return "StandardMortiseMaker"
- Case MCH_TY.COMPO
- Return "StandardCompoMaker"
- End Select
- Return Nothing
- End Function
-
- Private Function CreateToolDraw(ToolHolder As String, UpdateSource As DrawUpdateSource) As Boolean
- Select Case Type
- Case MCH_TY.DRILL_STD
- ' imposto dati utensile
- EgtLuaSetGlobStringVar("TOOL.TOOLHOLDER", ToolHolder)
- EgtLuaSetGlobNumVar("TOOL.TOTLEN", m_TotLen)
- EgtLuaSetGlobNumVar("TOOL.LEN", m_Len)
- EgtLuaSetGlobNumVar("TOOL.DIAM", m_Diam)
- EgtLuaSetGlobNumVar("TOOL.MAXMAT", m_MaxMat)
- Case MCH_TY.SAW_STD
- ' imposto dati utensile
- EgtLuaSetGlobStringVar("TOOL.TOOLHOLDER", ToolHolder)
- EgtLuaSetGlobNumVar("TOOL.LEN", m_Len)
- EgtLuaSetGlobNumVar("TOOL.DIAM", m_Diam)
- Dim dCore As Double = If(Len >= Thick, m_Thick - 1, 2 * m_Len - m_Thick)
- EgtLuaSetGlobNumVar("TOOL.CORE", dCore)
- EgtLuaSetGlobNumVar("TOOL.THICK", m_Thick)
- EgtLuaSetGlobNumVar("TOOL.MAXMAT", m_MaxMat)
- Case MCH_TY.MILL_STD
- ' imposto dati utensile
- EgtLuaSetGlobStringVar("TOOL.TOOLHOLDER", ToolHolder)
- EgtLuaSetGlobNumVar("TOOL.LEN", m_Len)
- EgtLuaSetGlobNumVar("TOOL.DIAM", m_Diam)
- EgtLuaSetGlobNumVar("TOOL.MAXMAT", m_MaxMat)
- Case Else
- bDrawingError = True
- Draw = String.Empty
- Return False
- End Select
- ' passo all'ambiente di disegno dell'utensile
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- ' eseguo creazione utensile
- EgtLuaExecLine("CreateTool()")
- ' recupero errore
- Dim nErr As Integer = 999
- EgtLuaGetGlobIntVar("TOOL.ERR", nErr)
- bDrawingError = Not (nErr = 0)
- If bDrawingError And UpdateSource <> DrawUpdateSource.DRAW Then Draw = String.Empty
- Return (nErr = 0)
- End Function
-
- Private Function SaveToolDraw() As Boolean
- If m_Type = MCH_TY.DRILL_STD Or m_Type = MCH_TY.SAW_STD Or m_Type = MCH_TY.MILL_STD Then
- Dim x = EgtGetCurrentContext()
- ' nome e direttorio del file da salvare
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- Dim sDrawName As String = Uuid
- sDrawName = sDrawName & ".nge"
- Dim sPath As String = String.Empty
- EgtTdbGetToolDir(sPath)
- sPath = sPath & "\" & sDrawName
- ' passo all'ambiente di disegno dell'utensile
- Dim r = EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- Dim y = EgtGetCurrentContext()
- ' nascondo layer ausiliario
- Dim nAuxId As Integer = GDB_ID.NULL
- nAuxId = EgtGetFirstNameInGroup(EgtGetFirstGroupInGroup(GDB_ID.ROOT), "AUX")
- EgtSetStatus(nAuxId, GDB_ST.OFF)
- ' se lama devo ruotare -90 deg attorno a Z+
- If m_Type = MCH_TY.SAW_STD Then
- EgtRotate(EgtGetFirstGroupInGroup(GDB_ID.ROOT), Point3d.ORIG(), Vector3d.Z_AX(), -90, GDB_RT.GLOB)
- End If
- ' salvo il modello
- Dim z = EgtGetCurrentContext()
- Dim bOk As Boolean = EgtSaveFile(sPath, NGE.CMPTEXT)
- Dim e = EgtGetCurrentContext()
- ' eseguo controrotazione per lama
- If m_Type = MCH_TY.SAW_STD Then
- EgtRotate(EgtGetFirstGroupInGroup(GDB_ID.ROOT), Point3d.ORIG(), Vector3d.Z_AX(), 90, GDB_RT.GLOB)
- End If
- ' ripristino visualizzazione layer aux
- EgtSetStatus(nAuxId, GDB_ST.ON_)
- ' salvo nome del disegno utensile
- EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
- EgtTdbSetCurrToolParam(MCH_TP.DRAW, sDrawName)
- EgtTdbSaveCurrTool()
- Return bOk
- End If
- Return False
- End Function
-
-#End Region ' ToolSceneUpdate
-
-#Region "IDataErrorInfo Members"
-
- Private ReadOnly Property IDataErrorInfo_Error() As String Implements IDataErrorInfo.Error
- Get
- Return Nothing
- End Get
- End Property
-
- Public ReadOnly Property IDataErrorInfo_Item(ByVal propertyName As String) As String Implements IDataErrorInfo.Item
- Get
- ErrorOnTool = True
- Return Me.GetValidationError(propertyName)
- End Get
- End Property
-
-#End Region ' IDataErrorInfo Members
-
-#Region "Validation"
-
- '''
- ''' Returns true if this object has no validation errors.
- '''
- Public ReadOnly Property IsValid() As Boolean
- Get
- For Each [property] As String In ValidatedProperties
- If GetValidationError([property]) IsNot Nothing Then
- Return False
- End If
- Next [property]
-
- Return True
- End Get
- End Property
-
- Private Shared ReadOnly ValidatedProperties() As String = {"Draw", "MaxMat", "Thick", "Diam", "Len", "TotLen", "Speed", "NamePar"}
-
- Private Function GetValidationError(ByVal propertyName As String) As String
- If Array.IndexOf(ValidatedProperties, propertyName) < 0 Then
- Return Nothing
- End If
-
- Dim [error] As String = Nothing
-
- Select Case propertyName
- Case "Draw"
- [error] = Me.ValidateDraw()
- Case "MaxMat"
- [error] = Me.ValidateMaxMat()
- Case "Diam"
- [error] = Me.ValidateDiam()
- Case "Thick"
- [error] = Me.ValidateThick()
- Case "Len"
- [error] = Me.ValidateLen()
- Case "TotLen"
- [error] = Me.ValidateTotLen()
- Case "Speed"
- [error] = Me.ValidateSpeed()
- Case "NamePar"
- [error] = Me.ValidateName()
-
- Case Else
- 'Debug.Fail("Unexpected property being validated on Tool: " & propertyName)
- End Select
- Return [error]
- End Function
-
- Private Function ValidateDraw() As String
- If bDrawNameError Then
- Return EgtMsg(MSG_TOOLSERRORS + 2)
- End If
- If bDrawNameExistError Then
- Return EgtMsg(MSG_TOOLSERRORS + 3)
- End If
- If bToolMakerError Then
- Return EgtMsg(MSG_TOOLSERRORS + 4)
- End If
- If bDrawingError Then
- Return EgtMsg(MSG_TOOLSERRORS + 5)
- End If
- Return Nothing
- End Function
-
- Private Function ValidateMaxMat() As String
- 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_Thick < EPS_SMALL Then
- Return EgtMsg(MSG_TOOLSERRORS + 8)
- End If
- Return Nothing
- End Function
-
- Private Function ValidateDiam() As String
- If m_Diam < EPS_SMALL Then
- Return EgtMsg(MSG_TOOLSERRORS + 9)
- End If
- Return Nothing
- End Function
-
- Private Function ValidateLen() As String
- 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_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
-
- Private Function ValidateSpeed() As String
- If Math.Abs(m_Speed) > m_MaxSpeed + EPS_ZERO Then
- Return EgtMsg(MSG_TOOLSERRORS + 11)
- End If
- Return Nothing
- End Function
-
- Private Function ValidateName() As String
- If bErrorToolName Then
- Return EgtMsg(MSG_TOOLSERRORS + 12)
- End If
- Return Nothing
- End Function
-
- Private Shared Function IsStringMissing(ByVal value As String) As Boolean
- Return String.IsNullOrEmpty(value) OrElse value.Trim() = String.Empty
- End Function
-
- Private Shared Function IsNgeFile(FileName As String) As Boolean
- If IsStringMissing(FileName) Then
- Return False
- End If
-
- Dim pattern As String = "^.+\.(?:[nN][gG][eE])$"
-
- Dim x = Regex.IsMatch(FileName, pattern, RegexOptions.IgnoreCase)
- Return x
- End Function
-
-#End Region ' Validation
-
-End Class
-
-'''
-''' Class that represent a FamilyTool in the treeview.
-''' It's an element in the treeview that represent a folder, but also a tool family
-'''
-Public Class FamilyToolTreeViewItem
- Inherits InheritableTreeViewItem
-
- Private m_ToolType As MCH_TF
- '''
- ''' Property that determines the tool type of the family
- '''
- Public Property ToolType As MCH_TF
- Get
- Return m_ToolType
- End Get
- Set(value As MCH_TF)
- m_ToolType = value
- End Set
- End Property
-
- '''
- ''' Property that determines if the Tool is selected or not
- '''
- Public Overrides Property IsSelected As Boolean
- Get
- Return m_isSelected
- End Get
- Set(value As Boolean)
- If (value <> m_isSelected) Then
- m_isSelected = value
- If value Then
- EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
- EgtNewFile()
- EgtSetView(VT.TOP, False)
- EgtZoom(ZM.ALL)
- End If
- End If
- End Set
- End Property
-
- ' Proprietà che permette di nascondere tutti i parametri utensile grazie al binding ed al converter
- Public ReadOnly Property Type As Integer
- Get
- Return MCH_TY.NONE
- End Get
- End Property
-
- '''
- ''' Constructor that receive the name of the FamilyToolTreeViewItem, the ToolType, and set
- ''' the picture(Folder.png)
- '''
- Sub New(Name As String, ToolType As MCH_TF)
- MyBase.New(Name)
- Me.ToolType = ToolType
- Me.PictureString = "/Resources/TreeView/Folder.png"
- End Sub
-
- Sub New(Name As String, PicturePath As String)
- MyBase.New(Name)
- Me.PictureString = PicturePath
- End Sub
-
-End Class
-
-'''
-''' Class that represent a Converter that use tool type and param type, to set the visibility state of the param type.
-'''
-Public Class ToolParamVisibilityConverter
- Implements IValueConverter
-
- Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
- Select Case CInt(value)
- Case MCH_TY.NONE
- Return Visibility.Hidden
- Case MCH_TY.DRILL_STD
- Return SharedFieldsClass.Drill_Std(CInt(parameter))
- Case MCH_TY.DRILL_LONG
- Return SharedFieldsClass.Drill_Long(CInt(parameter))
- Case MCH_TY.SAW_STD
- Return SharedFieldsClass.Saw_Std(CInt(parameter))
- Case MCH_TY.SAW_FLAT
- Return SharedFieldsClass.Saw_Flat(CInt(parameter))
- Case MCH_TY.MILL_STD
- Return SharedFieldsClass.Mill_Std(CInt(parameter))
- Case MCH_TY.MILL_NOTIP
- Return SharedFieldsClass.Mill_NoTip(CInt(parameter))
- Case MCH_TY.MORTISE_STD
- Return SharedFieldsClass.Mortise_Std(CInt(parameter))
- Case MCH_TY.COMPO
- Return SharedFieldsClass.Compo(CInt(parameter))
- Case Else
- Return Visibility.Hidden
- End Select
- End Function
-
- Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
- Throw New NotImplementedException
- End Function
-
-End Class
-
-'''
-''' Class that represent a Converter that convert UUID to ***** in Draw param
-'''
-Public Class ToolDrawUUIDConverter
- Implements IValueConverter
-
- Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.Convert
- If IsUUID(Path.GetFileNameWithoutExtension(value.ToString)) Then
- Return ToolDrawUUIDName
- Else
- Return value.ToString
- End If
- End Function
-
- Public Function ConvertBack(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object Implements IValueConverter.ConvertBack
- Return value.ToString
- End Function
-End Class
diff --git a/ToolsDbPage/ToolTreeView2.vb b/ToolsDbWindow/ToolTreeView2.vb
similarity index 96%
rename from ToolsDbPage/ToolTreeView2.vb
rename to ToolsDbWindow/ToolTreeView2.vb
index 41ce770..020abfc 100644
--- a/ToolsDbPage/ToolTreeView2.vb
+++ b/ToolsDbWindow/ToolTreeView2.vb
@@ -15,6 +15,11 @@ Public Class FamilyToolTreeViewItem
m_IsSelected = value
If value Then
' The function that I want to call When Parent item is selected in the tree
+ EgtSetCurrentContext(IniFile.m_ToolsDbSceneContext)
+ EgtNewFile()
+ EgtSetView(VT.TOP, False)
+ EgtZoom(ZM.ALL)
+ EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
End If
NotifyPropertyChanged("IsSelected")
End If
diff --git a/ToolsDbPage/ToolsDbView.xaml b/ToolsDbWindow/ToolsDbView.xaml
similarity index 97%
rename from ToolsDbPage/ToolsDbView.xaml
rename to ToolsDbWindow/ToolsDbView.xaml
index 8d5ead0..096536a 100644
--- a/ToolsDbPage/ToolsDbView.xaml
+++ b/ToolsDbWindow/ToolsDbView.xaml
@@ -1,15 +1,16 @@
-
+ Title="{Binding Title}" Icon="/Resources/EgtCAM5.ico"
+ TitleBarBrush="{StaticResource EgaltechBlue1}"
+ BorderBrush="{StaticResource EgaltechBlue1}"
+ WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsMovable="False" IsResizable="False"
+ IsMinimizable="False" WindowStartupLocation="CenterScreen">
-
+
0
@@ -38,12 +39,12 @@
23
24
25
-
+
-
-
+
+
@@ -888,4 +889,4 @@
-
+
diff --git a/ToolsDbPage/ToolsDbView.xaml.vb b/ToolsDbWindow/ToolsDbView.xaml.vb
similarity index 100%
rename from ToolsDbPage/ToolsDbView.xaml.vb
rename to ToolsDbWindow/ToolsDbView.xaml.vb
diff --git a/ToolsDbPage/ToolsDbViewModel.vb b/ToolsDbWindow/ToolsDbViewModel.vb
similarity index 90%
rename from ToolsDbPage/ToolsDbViewModel.vb
rename to ToolsDbWindow/ToolsDbViewModel.vb
index 8bb9f40..9a32381 100644
--- a/ToolsDbPage/ToolsDbViewModel.vb
+++ b/ToolsDbWindow/ToolsDbViewModel.vb
@@ -10,6 +10,13 @@ Namespace EgtCAM5
Public Class ToolsDbViewModel
Inherits TabViewModel
+ Private m_Title As String
+ Public ReadOnly Property Title As String
+ Get
+ Return EgtMsg(MSG_MAINWINDOW + 3)
+ End Get
+ End Property
+
' Lista degli utensili
Private m_ToolsList As New ObservableCollection(Of FamilyToolTreeViewItem)
Public Property ToolsList As ObservableCollection(Of FamilyToolTreeViewItem)
@@ -51,6 +58,8 @@ Namespace EgtCAM5
Private m_cmdSave As ICommand
Private m_cmdRemove As ICommand
+#Region "MESSAGES"
+
'Definizione dei messaggi della pagina
Public ReadOnly Property CorrTxBl As String
Get
@@ -214,6 +223,8 @@ Namespace EgtCAM5
End Get
End Property
+#End Region
+
'''
''' Constructor
'''
@@ -221,7 +232,7 @@ Namespace EgtCAM5
' leggo direttorio toolmakers
GetPrivateProfileString(S_MACH, K_TOOLMAKERSDIR, "", IniFile.m_sToolMakersDir)
- Me.sTabName = EgtMsg(MSG_MAINWINDOW + 3)
+ LoadSelectedMachineTools()
Application.Msn.Register(Application.REMOVETOOL, Sub(ToolToRemove As ToolTreeViewItem)
Remove(ToolToRemove)
@@ -261,21 +272,6 @@ Namespace EgtCAM5
Next
End Sub)
- Application.Msn.Register(Application.LOADSELECTEDMACHINE, Sub()
- m_ToolsList.Clear()
- LoadSelectedMachineTools()
- End Sub)
- Application.Msn.Register(Application.SETFIRSTTOOLFAMILY, Sub()
- For Each ToolFamily In ToolsList
- For Each Tool In ToolFamily.Items
- Tool.IsSelected = False
- Next
- ToolFamily.IsExpanded = False
- ToolFamily.IsSelected = False
Next
- If ToolsList.Count > 0 Then
- ToolsList(0).IsSelected = True
- End If
- End Sub)
End Sub
@@ -289,6 +285,7 @@ Namespace EgtCAM5
ToolsList.Add(FamilyTreeView)
Dim nType As Integer = 0
Dim ToolName As String = String.Empty
+ EgtSetCurrentContext(IniFile.m_ProjectSceneContext)
If EgtTdbGetFirstTool(ToolsFamily.FamilyId, ToolName, nType) Then
FamilyTreeView.Items.Add(New ToolTreeViewItem(ToolName))
While EgtTdbGetNextTool(ToolsFamily.FamilyId, ToolName, nType)
diff --git a/TopCommandBar/TopCommandBarView.xaml b/TopCommandBar/TopCommandBarView.xaml
index 4836c17..079466c 100644
--- a/TopCommandBar/TopCommandBarView.xaml
+++ b/TopCommandBar/TopCommandBarView.xaml
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
+
@@ -25,6 +25,10 @@
+
+
+
+
diff --git a/TopCommandBar/TopCommandBarViewModel.vb b/TopCommandBar/TopCommandBarViewModel.vb
index 6b77970..9f33763 100644
--- a/TopCommandBar/TopCommandBarViewModel.vb
+++ b/TopCommandBar/TopCommandBarViewModel.vb
@@ -7,8 +7,14 @@ Namespace EgtCAM5
#Region "FIELDS & PROPERTIES"
- ' Variabile che indica se sono nelle pagine Tool o Machining Db
- Private m_ToolOrMachiningDbActive As Boolean = False
+ ' Definizione comandi
+ Private m_cmdNew As ICommand
+ Private m_cmdOpen As ICommand
+ Private m_cmdSave As ICommand
+ Private m_cmdSaveAs As ICommand
+ Private m_cmdInsert As ICommand
+ Private m_cmdImport As ICommand
+ Private m_cmdExport As ICommand
#Region "ToolTip"
@@ -51,23 +57,60 @@ Namespace EgtCAM5
#End Region ' ToolTip
- ' Definizione comandi
- Private m_cmdNew As ICommand
- Private m_cmdOpen As ICommand
- Private m_cmdSave As ICommand
- Private m_cmdSaveAs As ICommand
- Private m_cmdInsert As ICommand
- Private m_cmdImport As ICommand
- Private m_cmdExport As ICommand
+ Private m_DrawIsChecked As Boolean
+ Public Property DrawIsChecked As Boolean
+ Get
+ Return m_DrawIsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_DrawIsChecked Then
+ m_DrawIsChecked = value
+ If value Then
+ Application.Msn.NotifyColleagues(Application.DRAWMODE_ISCHECKED)
+ EgtResetCurrMachGroup()
+ EgtZoom(ZM.ALL)
+ Application.Msn.NotifyColleagues(Application.LOADOBJTREE)
+ End If
+ End If
+ End Set
+ End Property
+
+ Private m_MachiningIsChecked As Boolean
+ Public Property MachiningIsChecked As Boolean
+ Get
+ Return m_MachiningIsChecked
+ End Get
+ Set(value As Boolean)
+ If value <> m_MachiningIsChecked Then
+ m_MachiningIsChecked = value
+ If value Then
+ Dim nId = EgtGetFirstMachGroup()
+ If nId <> GDB_ID.NULL Then
+ EgtSetCurrMachGroup(nId)
+ Else
+ EgtAddMachGroup("Mach01", "CMS-PF122R8RR")
+ End If
+ Application.Msn.NotifyColleagues(Application.MACHININGMODE_ISCHECKED)
+ EgtZoom(ZM.ALL)
+ Else
+ ' Deevidenzio l'ultima operazione evidenziata
+ Application.Msn.NotifyColleagues(Application.REMOVEMARKFROMLASTOPERATION)
+ End If
+ End If
+ End Set
+ End Property
#End Region ' Fields & Properties
#Region "CONSTRUCTOR"
Sub New()
- Application.Msn.Register(Application.TOOLORMACHININGDBACTIVE, Sub(bValue As Boolean)
- m_ToolOrMachiningDbActive = bValue
- End Sub)
+ ' Inizializzo la selezione della modilità Draw all'apertura del programma
+ DrawIsChecked = True
+ Application.Msn.Register(Application.SETMACHININGMODE, Sub()
+ MachiningIsChecked = True
+ OnPropertyChanged("MachiningIsChecked")
+ End Sub)
End Sub
#End Region
@@ -99,7 +142,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanNew(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' NewCommand
@@ -129,7 +172,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanOpen(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' OpenCommand
@@ -159,7 +202,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanSave(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' SaveCommand
@@ -189,7 +232,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanSaveAs(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' SaveAsCommand
@@ -219,7 +262,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanInsert(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' InsertCommand
@@ -249,7 +292,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanImport(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' ImportCommand
@@ -279,7 +322,7 @@ Namespace EgtCAM5
''' Returns always true.
'''
Private Function CanExport(ByVal param As Object) As Boolean
- Return Not m_ToolOrMachiningDbActive
+ Return True
End Function
#End Region ' ExportCommand