fix machine serial try/catch error

This commit is contained in:
Samuele Locatelli
2020-07-07 14:08:00 +02:00
parent a03d6c8351
commit ee6d6f0331
+13 -6
View File
@@ -560,12 +560,19 @@ namespace Thermo.Active.Utils
{
machineNumber = "0000";
}
if (containsLetters)
// Convert ASCII string to a single INT
intMachineVal = SupportFunctions.ConvertAsciiStringToInt(machineNumber);
else
// Convert string of digits to a INT
intMachineVal = int.Parse(machineNumber);
try
{
if (containsLetters)
// Convert ASCII string to a single INT
intMachineVal = SupportFunctions.ConvertAsciiStringToInt(machineNumber);
else
// Convert string of digits to a INT
intMachineVal = int.Parse(machineNumber);
}
catch
{
intMachineVal = 0;
}
}
//----- Chipher Private Class ---------------------------------