update lang retrieval + update decoding bit struct
This commit is contained in:
@@ -256,7 +256,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
langName = cultureInfo.Parent.EnglishName;
|
||||
|
||||
// Setup the Path for enums
|
||||
filePath = THERMO_DICT_PATH + @"Enums_" + language + @".txt";
|
||||
filePath = THERMO_DICT_PATH + @"Enums_" + langName + @".txt";
|
||||
|
||||
// Read From File...
|
||||
dict01 = File.ReadAllLines(filePath, Encoding.Default)
|
||||
@@ -265,7 +265,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
.ToDictionary(line => line[0].Trim(), line => line[1].Trim());
|
||||
|
||||
// Setup the Path for labels
|
||||
filePath = THERMO_DICT_PATH + @"labels_" + language + @".txt";
|
||||
filePath = THERMO_DICT_PATH + @"labels_" + langName + @".txt";
|
||||
|
||||
// Read From File...
|
||||
dict02 = File.ReadAllLines(filePath, Encoding.Default)
|
||||
@@ -2680,7 +2680,8 @@ namespace CMS_CORE_Library.S7Net
|
||||
Id = S7.Net.Types.Int.FromByteArray(rawData.Skip(0).Take(2).ToArray());
|
||||
ActualDuration = S7.Net.Types.DInt.FromByteArray(rawData.Skip(2).Take(4).ToArray());
|
||||
ActualDelay = S7.Net.Types.DInt.FromByteArray(rawData.Skip(6).Take(4).ToArray());
|
||||
Stato = S7.Net.Types.Word.FromByteArray(rawData.Skip(10).Take(2).ToArray());
|
||||
// sono in realtà BIT STRUC --> reverse!
|
||||
Stato = S7.Net.Types.Word.FromByteArray(rawData.Skip(10).Take(2).Reverse().ToArray());
|
||||
// calcolo bit...
|
||||
Visible = (Stato & 1) == 1;
|
||||
Running = (Stato & 2) == 2;
|
||||
@@ -2701,7 +2702,7 @@ namespace CMS_CORE_Library.S7Net
|
||||
Buffer.BlockCopy(S7.Net.Types.Int.ToByteArray(Id), 0, answ, 0, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(ActualDuration), 0, answ, 2, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.DInt.ToByteArray(ActualDelay), 0, answ, 6, 4);
|
||||
Buffer.BlockCopy(S7.Net.Types.Word.ToByteArray(Stato), 0, answ, 10, 2);
|
||||
Buffer.BlockCopy(S7.Net.Types.Word.ToByteArray(Stato), 0, answ, 10, 1);
|
||||
return answ;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user