diff --git a/HardwareManager/Hardware.vb b/HardwareManager/Hardware.vb index cade418..ed25d7b 100644 --- a/HardwareManager/Hardware.vb +++ b/HardwareManager/Hardware.vb @@ -1876,7 +1876,7 @@ Public Class Hardware ' cerco un numero finito di parametri For IndexParam As Integer = 0 To IndexParamDDF - 1 If LineIndex + ParamIndex > sFile.Count - 1 Then Return False - ' recuro il nome del parametro + ' recupero il nome del parametro KeyParam = Trim(RegexFunction.KeyParamLine(sFile(LineIndex + ParamIndex))) While String.IsNullOrEmpty(KeyParam) And LineIndex + ParamIndex < sFile(LineIndex + ParamIndex).Count ParamIndex += 1 diff --git a/MainWindow/MainWindowModel.vb b/MainWindow/MainWindowModel.vb index 4b27440..2a9a1dc 100644 --- a/MainWindow/MainWindowModel.vb +++ b/MainWindow/MainWindowModel.vb @@ -57,8 +57,8 @@ Friend Class MainWindowModel EgtUILib.GetPrivateProfileString(S_LICENCE, K_KEY, "", sKey, sLicFile) EgtSetKey(sKey) ' Recupero livello e opzioni della chiave - Dim bKey As Boolean = EgtGetKeyLevel(3279, 2512, 1, IniFile.m_nKeyLevel) And - EgtGetKeyOptions(3279, 2512, 1, IniFile.m_nKeyOptions) + Dim bKey As Boolean = EgtGetKeyLevel(3279, 2601, 1, IniFile.m_nKeyLevel) And + EgtGetKeyOptions(3279, 2601, 1, IniFile.m_nKeyOptions) 'Inizializzazione generale di EgtInterface m_nDebug = GetMainPrivateProfileInt(S_GENERAL, K_DEBUG, 0) Dim sLogFile As String = IniFile.m_sTempDir & "\" & GENLOG_FILE_NAME.Replace("#", m_nInstance.ToString()) diff --git a/My Project/AssemblyInfo.vb b/My Project/AssemblyInfo.vb index f2777db..be94e33 100644 --- a/My Project/AssemblyInfo.vb +++ b/My Project/AssemblyInfo.vb @@ -72,5 +72,5 @@ Imports System.Windows ' by using the '*' as shown below: ' - - + + diff --git a/Utility.vb b/Utility.vb index 7d9dc26..1000bd8 100644 --- a/Utility.vb +++ b/Utility.vb @@ -304,7 +304,32 @@ Public Module Utility Return "0.0000" End If End Select - ElseIf sValue.Contains("(") And sValue.Contains(")") And Not sValue.Contains("inch") Then + ElseIf sValue.Contains("(") And sValue.Contains(")") And sValue.Contains("mm") Then + sValue = Trim(sValue.Replace("mm", "")) + If sValue.StartsWith("(") And sValue.EndsWith(")") Then + Dim ArrayString() As Char = StringToChar(sValue) + ArrayString(0) = CChar("§") + ArrayString(ArrayString.Count - 1) = CChar("§") + sValue = CharToString(ArrayString, sValue) + sValue = Trim(sValue.Replace("§", "")) + End If + If String.IsNullOrEmpty(sValue) Then Return "0.0000" + ' ricevo un valore in inches + Select Case OptionModule.m_SelectedMeasureUnit + Case ConstGen.MM ' se la configurazione è inches non faccio conversioni + If StringToDouble(sValue, dVal) Then + Return sValue + Else + Return "0.0000" + End If + Case ConstGen.VAL_INCHES ' se la configurazione è in mm faccio la conevrsione + If MmToInches(sValue) Then + Return sValue + Else + Return "0.0000" + End If + End Select + ElseIf sValue.Contains("(") And sValue.Contains(")") And (Not sValue.Contains("inch") Or Not sValue.Contains("mm")) Then 'sValue = Regex.Match(sValue, "\s*\((.*?)\s*\)\s*\.*").Groups(1).Value If String.IsNullOrEmpty(sValue) Then Return "0.0000" ' ricevo un valore in mm @@ -379,6 +404,10 @@ Public Module Utility ' non eseguo nessun tipo di conversione Return True Else + ' la configurazione è già in mm quindi non devo convertire + If OptionModule.m_IsMM Then + Return True + End If Return InchesToMm(sMeasure) End If Return False