diff --git a/Constants/ConstDoors.vb b/Constants/ConstDoors.vb
index fe241fc..eeb4776 100644
--- a/Constants/ConstDoors.vb
+++ b/Constants/ConstDoors.vb
@@ -12,4 +12,7 @@ Module ConstDoors
' File template per scrittura MTable
Public Const MTABLETEMPLATE_FILE As String = "MTableTemplate.ini"
+ ' File template per scrittura MTable
+ Public Const CURRMTABLE_FILE As String = "CurrMTable.ini"
+
End Module
diff --git a/MTableDb/MTableDbView.xaml b/MTableDb/MTableDbView.xaml
index abd036f..5170696 100644
--- a/MTableDb/MTableDbView.xaml
+++ b/MTableDb/MTableDbView.xaml
@@ -47,6 +47,10 @@
Style="{StaticResource MTableWindowButton}">
+
-
+
+
+
+
diff --git a/MTableDb/MTableDbViewModel.vb b/MTableDb/MTableDbViewModel.vb
index 9adf472..2c519e8 100644
--- a/MTableDb/MTableDbViewModel.vb
+++ b/MTableDb/MTableDbViewModel.vb
@@ -21,9 +21,8 @@ Namespace EgtCAM5
End Set
End Property
-#Region "Fields & Properties for graphical elements"
+#Region "Messages"
- Private m_Title As String
Public ReadOnly Property Title As String
Get
Return EgtMsg(MSG_MAINWINDOW + 20)
@@ -132,7 +131,13 @@ Namespace EgtCAM5
End Get
End Property
-#End Region
+ Public ReadOnly Property CurrMsg As String
+ Get
+ Return EgtMsg(MSG_DOORS + 25)
+ End Get
+ End Property
+
+#End Region ' Messages
#Region "ToolTip"
@@ -157,6 +162,11 @@ Namespace EgtCAM5
Return EgtMsg(MSG_DOORS + 4)
End Get
End Property
+ Public ReadOnly Property SetActiveTableToolTip As String
+ Get
+ Return EgtMsg(MSG_DOORS + 26)
+ End Get
+ End Property
#End Region ' ToolTip
@@ -165,6 +175,7 @@ Namespace EgtCAM5
Private m_cmdSaveTable As ICommand
Private m_cmdSaveTableAs As ICommand
Private m_cmdRemoveTable As ICommand
+ Private m_cmdSetActiveTable As ICommand
Private m_cmdAddMach As ICommand
Private m_cmdRemoveMach As ICommand
Private m_cmdAddRow As ICommand
@@ -178,6 +189,7 @@ Namespace EgtCAM5
Sub New()
EgtGetCurrMachineName(m_sPreviousActiveMachine)
UpdateTables()
+ SetActiveTable()
If m_TablesList.Count > 0 Then
m_TablesList(0).IsSelected = True
End If
@@ -216,6 +228,28 @@ Namespace EgtCAM5
End If
End Sub
+ Private Const MTABLENAME As String = "MTableName"
+ Private Const MTNAME As String = "MTName"
+
+ Private Sub SetActiveTable()
+ Dim ActiveMTableName As String = String.Empty
+ Dim ActiveMTableFilePath As String = Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\CurrMTable.lua"
+ If File.Exists(ActiveMTableFilePath) Then
+ Dim ReadFile As IEnumerable(Of String) = File.ReadLines(ActiveMTableFilePath)
+ For LineIndex As Integer = 0 To ReadFile.Count - 1
+ If ReadFile(LineIndex).Contains(MTABLENAME) Then
+ ActiveMTableName = TableUtility.SearchKey(ReadFile(LineIndex), MTNAME)
+ Exit For
+ End If
+ Next
+ For Index As Integer = 0 To m_TablesList.Count - 1
+ If m_TablesList(Index).TableName = ActiveMTableName Then
+ m_TablesList(Index).ActiveTable = True
+ End If
+ Next
+ End If
+ End Sub
+
#End Region
#Region "COMMANDS"
@@ -371,6 +405,48 @@ Namespace EgtCAM5
#End Region ' RemoveTableCommand
+#Region "SetActiveTableCommand"
+
+ '''
+ ''' Returns a command that do Exec.
+ '''
+ Public ReadOnly Property SetActiveTableCommand As ICommand
+ Get
+ If m_cmdSetActiveTable Is Nothing Then
+ m_cmdSetActiveTable = New RelayCommand(AddressOf SetActiveTable)
+ End If
+ Return m_cmdSetActiveTable
+ End Get
+ End Property
+
+ '''
+ ''' Execute the Exec. This method is invoked by the ExecCommand.
+ '''
+ Public Sub SetActiveTable(param As Object)
+ Dim SelectedMTable As MTableListBoxItem = DirectCast(param, MTableListBoxItem)
+ If IsNothing(SelectedMTable) Then Return
+ For Index As Integer = 0 To m_TablesList.Count - 1
+ If m_TablesList(Index).TableName = SelectedMTable.TableName Then
+ m_TablesList(Index).ActiveTable = True
+ Else
+ m_TablesList(Index).ActiveTable = False
+ End If
+ Next
+ ' Scrivo il file di configurazione con il nome di questa tavola
+ Dim FileContent As IEnumerable(Of String) = File.ReadLines(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE)
+ Dim NewTableFileContent As New List(Of String)
+ For LineIndex As Integer = 0 To FileContent.Count - 1
+ Dim sCurrLine As String = FileContent(LineIndex)
+ sCurrLine = sCurrLine.Replace(TableUtility.DATETIME, System.DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"))
+ sCurrLine = sCurrLine.Replace(TableUtility.TABLENAME, SelectedMTable.TableName)
+ NewTableFileContent.Add(sCurrLine)
+ Next
+ File.WriteAllLines(Path.ChangeExtension(Path.GetDirectoryName(IniFile.m_sTablesRoot) & "\" & CURRMTABLE_FILE, ".lua"), NewTableFileContent, Text.Encoding.UTF8)
+
+ End Sub
+
+#End Region ' SetActiveTableCommand
+
#Region "AddMachCommand"
'''
diff --git a/MTableDb/MTableListBox.vb b/MTableDb/MTableListBox.vb
index af2d9a4..1ac1b13 100644
--- a/MTableDb/MTableListBox.vb
+++ b/MTableDb/MTableListBox.vb
@@ -64,6 +64,30 @@ Public Class MTableListBoxItem
End Set
End Property
+ Private m_ActiveTable As Boolean
+ Public Property ActiveTable As Boolean
+ Get
+ Return m_ActiveTable
+ End Get
+ Set(value As Boolean)
+ If value <> m_ActiveTable Then
+ m_ActiveTable = value
+ NotifyPropertyChanged("StateColor")
+ End If
+ m_ActiveTable = value
+ End Set
+ End Property
+
+ Public ReadOnly Property StateColor As Brush
+ Get
+ If ActiveTable Then
+ Return Brushes.Blue
+ Else
+ Return Brushes.Transparent
+ End If
+ End Get
+ End Property
+
Private m_ActiveMachinesList As New ObservableCollection(Of MTableMachineListBoxItem)
Public Property ActiveMachinesList As ObservableCollection(Of MTableMachineListBoxItem)
Get
diff --git a/MTableDb/TableUtility.vb b/MTableDb/TableUtility.vb
index 4fc1bf7..52d5d47 100644
--- a/MTableDb/TableUtility.vb
+++ b/MTableDb/TableUtility.vb
@@ -3,8 +3,8 @@ Imports System.IO
Module TableUtility
- Private Const DATETIME As String = "%DATE_TIME%"
- Private Const TABLENAME As String = "%TABLE_NAME%"
+ Friend Const DATETIME As String = "%DATE_TIME%"
+ Friend Const TABLENAME As String = "%TABLE_NAME%"
Private Const MMACHINEDATA As String = ".MMachineData"
Private Const MACHNAME As String = "MachName"
Private Const NCGENERATE As String = "NcGenerate"
@@ -112,8 +112,7 @@ Module TableUtility
End If
End Sub
- Private Function SearchKey(sLine As String, sKey As String) As String
- Dim x = Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
+ Friend Function SearchKey(sLine As String, sKey As String) As String
Return Regex.Match(sLine, "[,|{|\s]" & sKey & "\s*=\s*['|\""]?(.*?)\s*?[,|}|'|\""]").Groups(1).Value
End Function
diff --git a/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml
new file mode 100644
index 0000000..b9b8592
--- /dev/null
+++ b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml
@@ -0,0 +1,11 @@
+
+
+
+
+
diff --git a/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml.vb b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml.vb
new file mode 100644
index 0000000..6529245
--- /dev/null
+++ b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogView.xaml.vb
@@ -0,0 +1,3 @@
+Public Class SingleFolderOpenFileDialogView
+
+End Class
diff --git a/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogViewModel.vb b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogViewModel.vb
new file mode 100644
index 0000000..40a8453
--- /dev/null
+++ b/SingleFolderOpenFileDialog/SingleFolderOpenFileDialogViewModel.vb
@@ -0,0 +1,3 @@
+Public Class SingleFolderOpenFileDialogViewModel
+
+End Class
diff --git a/StatusBar/StatusBarViewModel.vb b/StatusBar/StatusBarViewModel.vb
index 452cc17..9cab96c 100644
--- a/StatusBar/StatusBarViewModel.vb
+++ b/StatusBar/StatusBarViewModel.vb
@@ -250,9 +250,11 @@ Namespace EgtCAM5
End If
End Sub)
Application.Msn.Register(Application.MACHININGMODE_ISCHECKED, Sub()
+ StatusOutput = String.Empty
MachineListIsEnabled = False
End Sub)
Application.Msn.Register(Application.DRAWMODE_ISCHECKED, Sub()
+ StatusOutput = String.Empty
MachineListIsEnabled = True
End Sub)
' Installo funzione gestione eventi per lua