From 7186aec547b311c7d63d4e4f7de28772c3a0997b Mon Sep 17 00:00:00 2001 From: Emmanuele Sassi Date: Tue, 4 Oct 2016 09:35:55 +0000 Subject: [PATCH] =?UTF-8?q?EgtCAM5=20:=20-=20Aggiunta=20pagina=20MTables?= =?UTF-8?q?=20con=20abbozzo=20di=20gestione=20tabelle.=20-=20Aggiunta=20ge?= =?UTF-8?q?stione=20della=20visualizzazione=20dei=20gruppi=20macchina.=20-?= =?UTF-8?q?=20Aggiunta=20possibilit=C3=A0=20di=20eseguire=20script=20di=20?= =?UTF-8?q?disposizione=20quando=20si=20passa=20in=20lavorazione.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application.xaml.vb | 3 +- Constants/ConstIni.vb | 4 + Constants/ConstMachIni.vb | 3 + Constants/ConstMsg.vb | 2 + EgtCAM5.vbproj | 8 ++ IniFile.vb | 4 + MTableDb/MTableDbView.xaml | 83 +++++++++++++++++++ MTableDb/MTableDbView.xaml.vb | 3 + MTableDb/MTableDbViewModel.vb | 52 ++++++++++++ ProjectPage/DbPanel/DbPanelView.xaml | 2 + ProjectPage/DbPanel/DbPanelViewModel.vb | 30 ++++++- .../MachGroupPanel/MachGroupPanelView.xaml | 4 +- .../MachGroupPanel/MachGroupPanelViewModel.vb | 73 +++++++++++++++- ProjectPage/ProjectView.xaml.vb | 4 +- ProjectPage/ProjectViewModel.vb | 2 + StatusBar/StatusBarViewModel.vb | 1 + TopCommandBar/TopCommandBarViewModel.vb | 31 +++---- 17 files changed, 282 insertions(+), 27 deletions(-) create mode 100644 MTableDb/MTableDbView.xaml create mode 100644 MTableDb/MTableDbView.xaml.vb create mode 100644 MTableDb/MTableDbViewModel.vb diff --git a/Application.xaml.vb b/Application.xaml.vb index f88df09..150da68 100644 --- a/Application.xaml.vb +++ b/Application.xaml.vb @@ -165,7 +165,8 @@ Class Application Friend Const SELECTEDOPERATION As String = "SelectedOperation" ' MachiningGroupPanel - Friend Const LOADMACHGROUP As String = "LoadMachGroup" + Friend Const INITIALIZEMACHGROUPS As String = "InitializeMachGroups" + Friend Const MACHGROUPSRESULT As String = "MachGroupsResult" ' MachiningOptionPanel ' MachiningTreeViewExpander diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb index 01ebd56..8d7b7fe 100644 --- a/Constants/ConstIni.vb +++ b/Constants/ConstIni.vb @@ -106,6 +106,10 @@ Module ConstIni Public Const K_SELGEOMMORTISING As String = "SelGeomMortising" Public Const K_SELGEOMSAWROUGHING As String = "SelGeomSawRoughing" Public Const K_SELGEOMSAWFINISHING As String = "SelGeomSawFinishing" + Public Const K_MACHININGGROUP As String = "MachiningGroup" + + Public Const S_TABLE As String = "Table" + Public Const K_TABLESDIR As String = "TablesDir" Public Const S_SIMUL As String = "Simul" Public Const K_SLIDERX As String = "SliderX" diff --git a/Constants/ConstMachIni.vb b/Constants/ConstMachIni.vb index dd7be0e..7122c78 100644 --- a/Constants/ConstMachIni.vb +++ b/Constants/ConstMachIni.vb @@ -35,4 +35,7 @@ Public Const K_MANUALPOS As String = "ManualPos" Public Const K_MANUALNAME As String = "ManualName" + Public Const S_DISPOSITION As String = "Disposition" + Public Const K_INITSCRIPT As String = "InitScript" + End Module diff --git a/Constants/ConstMsg.vb b/Constants/ConstMsg.vb index d495e5c..5e1f541 100644 --- a/Constants/ConstMsg.vb +++ b/Constants/ConstMsg.vb @@ -10,6 +10,8 @@ Public Const MSG_GRIDVIEWPANEL As Integer = MSG_EGTCAM5 + 250 Public Const MSG_SIMULATION As Integer = MSG_EGTCAM5 + 300 Public Const MSG_OPERATION As Integer = MSG_EGTCAM5 + 400 + Public Const MSG_DISPOSITION As Integer = MSG_EGTCAM5 + 430 + Public Const MSG_DISPOSITIONERRORS As Integer = MSG_EGTCAM5 + 460 Public Const MSG_TOOLSDBPAGE As Integer = MSG_EGTCAM5 + 1000 Public Const MSG_TOOLSERRORS As Integer = MSG_EGTCAM5 + 1100 Public Const MSG_MACHININGSDBPAGE As Integer = MSG_EGTCAM5 + 1200 diff --git a/EgtCAM5.vbproj b/EgtCAM5.vbproj index 1589104..769b330 100644 --- a/EgtCAM5.vbproj +++ b/EgtCAM5.vbproj @@ -131,6 +131,10 @@ + + MTableDbView.xaml + + OptionsView.xaml @@ -241,6 +245,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/IniFile.vb b/IniFile.vb index 5e5d58b..931bffd 100644 --- a/IniFile.vb +++ b/IniFile.vb @@ -27,6 +27,7 @@ Module IniFile Friend m_sIniFile As String Friend m_sTempDir As String Friend m_sMachinesRoot As String + Friend m_sTablesRoot As String Friend m_ProjectMode As ProjectModeOpt Friend m_bMmUnits As Boolean @@ -54,10 +55,13 @@ Module IniFile Friend m_sMachineName As String Friend m_sCurrMachIniFilePath As String Friend m_sCurrMachToolsDirPath As String + Friend m_sCurrMachScriptsDirPath As String ' Variabile che contiene la path della cartella che contiene i ToolMaker Friend m_sToolMakersDir As String = String.Empty ' Variabile che contiene il contesto della scena presente nel database utensili Friend m_ToolsDbSceneContext As Integer = 0 + ' Variabile che dice se sono abilitati i gruppi di lavorazione + Friend m_bMachiningGroup As Boolean Public Function GetPrivateProfileInt(IpAppName As String, IpKeyName As String, nDefault As Integer) As Integer Return EgtUILib.GetPrivateProfileInt(IpAppName, IpKeyName, nDefault, m_sIniFile) diff --git a/MTableDb/MTableDbView.xaml b/MTableDb/MTableDbView.xaml new file mode 100644 index 0000000..187c6aa --- /dev/null +++ b/MTableDb/MTableDbView.xaml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MTableDb/MTableDbView.xaml.vb b/MTableDb/MTableDbView.xaml.vb new file mode 100644 index 0000000..8f37f4d --- /dev/null +++ b/MTableDb/MTableDbView.xaml.vb @@ -0,0 +1,3 @@ +Public Class MTableDbView + +End Class diff --git a/MTableDb/MTableDbViewModel.vb b/MTableDb/MTableDbViewModel.vb new file mode 100644 index 0000000..b6da7db --- /dev/null +++ b/MTableDb/MTableDbViewModel.vb @@ -0,0 +1,52 @@ +Imports System.Collections.ObjectModel +Imports System.IO +Imports EgtUILib + +Namespace EgtCAM5 + + Public Class MTableDbViewModel + Inherits TabViewModel + + Private m_TablesList As New ObservableCollection(Of String) + Public Property TablesList As ObservableCollection(Of String) + Get + Return m_TablesList + End Get + Set(value As ObservableCollection(Of String)) + m_TablesList = value + End Set + End Property + + Private m_Title As String + Public ReadOnly Property Title As String + Get + Return EgtMsg(MSG_MAINWINDOW + 20) + End Get + End Property + + Sub New() + SearchTables() + End Sub + + Private Sub SearchTables() + '' Leggo dal file ini il direttorio per le Table + 'If GetPrivateProfileString(S_TABLE, K_TABLESDIR, "", m_sTablesRoot) = 0 _ + ' Or not My.Computer.FileSystem.DirectoryExists(m_sTablesRoot) Then + ' ' Se non lo trovo mando messaggio di errore e chiudo la finestra + ' MessageBox.Show("ERROR IN LOADING TABLES", "Tables dir not found.") + 'End If + ' se trovo la cartella carico la lista di tabelle + + + Dim TempArray As String() = Directory.GetDirectories(IniFile.m_sMachinesRoot) + If TempArray.Count = 0 Then + 'esci + End If + For Each Table In My.Computer.FileSystem.GetFiles("c:\EgtData\Doors\MTables\") + m_TablesList.Add(Path.GetFileNameWithoutExtension(Table)) + Next + End Sub + + End Class + +End Namespace \ No newline at end of file diff --git a/ProjectPage/DbPanel/DbPanelView.xaml b/ProjectPage/DbPanel/DbPanelView.xaml index ff630b4..47eabea 100644 --- a/ProjectPage/DbPanel/DbPanelView.xaml +++ b/ProjectPage/DbPanel/DbPanelView.xaml @@ -7,6 +7,8 @@ Style="{StaticResource GridViewPanelButton}" Width="55" Content="ToolDb"/>