diff --git a/Constants/ConstIni.vb b/Constants/ConstIni.vb
index 03c7b23..2207590 100644
--- a/Constants/ConstIni.vb
+++ b/Constants/ConstIni.vb
@@ -90,6 +90,7 @@ Module ConstIni
Public Const K_MYPROJECTDIR As String = "ProjectDirectory"
Public Const K_TEMPLATEDIR As String = "TemplateDirectory"
Public Const K_MACHINDIR As String = "MachinDirectory"
+ Public Const K_MTABLE As String = "MTable"
Public Const S_REPORT As String = "Report"
Public Const K_REPORTDIR As String = "ReportDirectory"
diff --git a/OptionsWindow/OptionModule.vb b/OptionsWindow/OptionModule.vb
index 1b55165..fdbf6d3 100644
--- a/OptionsWindow/OptionModule.vb
+++ b/OptionsWindow/OptionModule.vb
@@ -11,6 +11,10 @@ Friend Module OptionModule
Friend m_LanguageList As New ObservableCollection(Of Language)
Friend m_SelectedLanguage As Language
+ ' Elenco delle MTable disponibili nella configurazione corrente
+ Friend m_MTableList As New ObservableCollection(Of MTable)
+ Friend m_SelectedMTable As MTable
+
Friend m_OptionLauncherList As New List(Of String)
Friend m_SelectedOptionLauncher As Integer = 0
Friend m_bLauncherOpenOnce As Boolean = False
@@ -391,6 +395,10 @@ Friend Module OptionModule
DefaultGetMmUnits(ConstCompo.S_GENERALINI, ConstCompo.K_MMUNITSINI, IsMM)
m_IsMM = IsMM
+ If GetCurrentMTableList() Then
+ ' abilito la modifica della MTbale solo se Debug superioere a 5
+ End If
+
Dim Width As String = String.Empty
DefaultGetPrivateProfileString(S_SIZE_INI, K_WIDTH_INI, "32", Width)
Utility.ConvertCompoConfig(Width, 500)
@@ -1000,6 +1008,59 @@ Friend Module OptionModule
End If
End Function
+ Public Function GetCurrentMTableList() As Boolean
+ If String.IsNullOrEmpty(IniFile.m_sDoorsDirPath) Then Return False
+ m_MTableList.Clear()
+ Dim sMTableDir As String = IniFile.m_sDoorsDirPath & "\MTables"
+ Dim Items As String() = Directory.GetFiles(sMTableDir)
+ ' recupero i file che hanno estemsione *.mtl
+ For Each MTableFile As String In Items
+ If MTableFile.EndsWith(".mtl") Then
+ Dim sName As String = Path.GetFileNameWithoutExtension(MTableFile).ToLower
+ Dim sPath As String = MTableFile
+ Dim bIsValid As Boolean = True
+ Dim ExcludeList As List(Of String) = GetExludeList()
+ For Each ExcludedItem As String In ExcludeList
+ If sName.ToLower.Contains(ExcludedItem) Then
+ bIsValid = False
+ Exit For
+ End If
+ Next
+ If bIsValid Then
+ sName = Path.GetFileNameWithoutExtension(MTableFile)
+ Dim LocalMTable As New MTable(sName.Trim, sPath.Trim)
+ m_MTableList.Add(LocalMTable)
+ End If
+ End If
+ Next
+ If m_MTableList.Count < 1 Then Return False
+ ' leggo il nome della MTable attiva
+ Dim sSelectedMTable As String = String.Empty
+ Dim nbSelected As Boolean = False
+ If GetMainPrivateProfileString(S_DOORS, K_MTABLE, "", sSelectedMTable) <> 0 Then
+ For Each ItemFile As MTable In m_MTableList
+ If ItemFile.FilePath.ToLower = sSelectedMTable.Trim.ToLower Then
+ m_SelectedMTable = ItemFile
+ nbSelected = True
+ Exit For
+ End If
+ Next
+ End If
+ If Not nbSelected Then m_SelectedMTable = m_MTableList(0)
+ Return True
+ End Function
+
+ Private Function GetExludeList() As List(Of String)
+ Dim LocalList As New List(Of String)
+ Dim sVal As String = String.Empty
+ GetMainPrivateProfileString(S_DOORS, "Exclude", "", sVal)
+ Dim sItems As String() = sVal.Split(","c)
+ For Each Item As String In sItems
+ LocalList.Add(Item.Trim)
+ Next
+ Return LocalList
+ End Function
+
End Module
' Classe che identifica una lingua del programma con nome e path del file dei messaggi
@@ -1032,3 +1093,33 @@ Public Class Language
End Sub
End Class
+
+Public Class MTable
+
+ Private m_sName As String
+ Private m_sFilePath As String
+
+ Public Property Name As String
+ Get
+ Return m_sName
+ End Get
+ Set(value As String)
+ m_sName = value
+ End Set
+ End Property
+
+ Public Property FilePath As String
+ Get
+ Return m_sFilePath
+ End Get
+ Set(value As String)
+ m_sFilePath = value
+ End Set
+ End Property
+
+ Sub New(sName As String, sFilePath As String)
+ Me.Name = sName
+ Me.FilePath = sFilePath
+ End Sub
+
+End Class
diff --git a/OptionsWindow/OptionsV.xaml b/OptionsWindow/OptionsV.xaml
index 8836193..14bc313 100644
--- a/OptionsWindow/OptionsV.xaml
+++ b/OptionsWindow/OptionsV.xaml
@@ -5,12 +5,14 @@
Title="{Binding Title}" Icon="/Resources/EgtDOOR.ico"
TitleBarBrush="{StaticResource EgaltechBlue1}"
BorderBrush="{StaticResource EgaltechBlue1}"
- WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30" IsResizable="False"
+ WindowStyle="None" ResizeMode="NoResize" TitleBarHeight="30"
+ IsResizable="True" IsMovable="True"
IsMinimizable="False" WindowStartupLocation="CenterScreen" ShowInTaskbar="False"
CloseCommand="{Binding CloseOptionsCommand,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}">
+
@@ -253,6 +255,55 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/OptionsWindow/OptionsViewModel.vb b/OptionsWindow/OptionsViewModel.vb
index 671e803..2836eac 100644
--- a/OptionsWindow/OptionsViewModel.vb
+++ b/OptionsWindow/OptionsViewModel.vb
@@ -83,6 +83,13 @@ Public Class OptionsVM
End Set
End Property
+ Private m_IsChangedConfig As Boolean = False
+ Public ReadOnly Property IsChangedConfig As Boolean
+ Get
+ Return m_IsChangedConfig
+ End Get
+ End Property
+
#End Region ' Hardware_part
@@ -104,6 +111,41 @@ Public Class OptionsVM
End Set
End Property
+ Public ReadOnly Property MTableList As ObservableCollection(Of MTable)
+ Get
+ Return OptionModule.m_MTableList
+ End Get
+ End Property
+
+ Public Property SelectedMTable As MTable
+ Get
+ Return OptionModule.m_SelectedMTable
+ End Get
+ Set(value As MTable)
+ If Not IsNothing(value) AndAlso value IsNot OptionModule.m_SelectedMTable Then
+ OptionModule.m_SelectedMTable = value
+ WriteMainPrivateProfileString(S_DOORS, K_MTABLE, OptionModule.m_SelectedMTable.FilePath)
+ NotifyPropertyChanged("SelectedMTable")
+ End If
+ End Set
+ End Property
+
+ Public Property ConfigDir As String
+ Get
+ Return IniFile.m_sDoorsDirPath
+ End Get
+ Set(value As String)
+ If value.Trim.ToLower <> IniFile.m_sDoorsDirPath.ToLower Then
+ IniFile.m_sDoorsDirPath = value
+ WriteMainPrivateProfileString(S_DOORS, K_BASEDIR, IniFile.m_sDoorsDirPath)
+ m_IsChangedConfig = GetCurrentMTableList()
+ NotifyPropertyChanged("SelectedMTable")
+ End If
+ NotifyPropertyChanged("MTableList")
+ NotifyPropertyChanged("ConfigDir")
+ End Set
+ End Property
+
Public ReadOnly Property MeasureUnitList As List(Of String)
Get
Return OptionModule.m_MeasureUnitList
@@ -1139,6 +1181,12 @@ Public Class OptionsVM
End Get
End Property
+ Public ReadOnly Property MTableAdvertMsg As String
+ Get
+ Return "The program has to be restarted."
+ End Get
+ End Property
+
Public ReadOnly Property MeasureUnit As String
Get
Return EgtMsg(50211)
@@ -1352,20 +1400,44 @@ Public Class OptionsVM
End Get
End Property
+ ' TabMsg
Public ReadOnly Property GeneralOption As String
Get
' 50729=General
Return EgtMsg(50729)
End Get
End Property
-
Public ReadOnly Property GeneralCam As String
Get
' 50730=Report
Return EgtMsg(50730)
End Get
End Property
+ Public ReadOnly Property ConfigOption As String
+ Get
+ Return "Config"
+ End Get
+ End Property
+ Public ReadOnly Property MTableMsg As String
+ Get
+ Return "MTable"
+ End Get
+ End Property
+
+ Public ReadOnly Property ConfigMsg As String
+ Get
+ Return "Door Config"
+ End Get
+ End Property
+
+ Public ReadOnly Property ConfigDirectoryMsg As String
+ Get
+ Return "Directory"
+ End Get
+ End Property
+
+ ' GenearlCamMsg
Public ReadOnly Property ExtLineLenMsg As String
Get
' Estensione linea
@@ -1959,6 +2031,15 @@ Public Class OptionsVM
Return
End If
TemplateDir = FolderBrowserDialog.SelectedPath
+ Case "ConfigDir"
+ Dim FolderBrowserDialog As New System.Windows.Forms.FolderBrowserDialog
+ FolderBrowserDialog.SelectedPath = IniFile.m_sDoorsDirPath
+ ' mostriamo la finestra di dialogo aperta fino alla directory MyProjects
+ If FolderBrowserDialog.ShowDialog <> Forms.DialogResult.OK Then
+ ' se la risposta รจ diversa da OK esce
+ Return
+ End If
+ ConfigDir = FolderBrowserDialog.SelectedPath
End Select
End Sub
diff --git a/RegexFunction.vb b/RegexFunction.vb
index 60082da..1dd797a 100644
--- a/RegexFunction.vb
+++ b/RegexFunction.vb
@@ -94,7 +94,7 @@ Module RegexFunction
MsgBoxResult = MessageBox.Show(sWarningMas, "Warning", MessageBoxButton.YesNo, MessageBoxImage.Warning)
If MsgBoxResult = MessageBoxResult.Yes Then
' Imposto nuova configurazione
- WriteMainPrivateProfileString("Doors", "BaseDir", sConfCompoPath)
+ WriteMainPrivateProfileString(S_DOORS, K_BASEDIR, sConfCompoPath)
' Imposto progetto corrente
WriteMainPrivateProfileString(S_LAUNCHERWINDOW, K_LASTPROJECT, Map.refAssemblyManagerVM.CurrProject.SelAssemblyName.Name)
' Imposto apertura automatica al prossimo avvio