Fix gestione endianness x carico e num giri (leggeva sbagliato con littleEndian...)

This commit is contained in:
Samuele E. Locatelli
2017-11-20 14:35:07 +01:00
parent e3e835aee4
commit 172268a36c
+8 -2
View File
@@ -2609,12 +2609,18 @@ namespace MTC_Adapter
// cicl su path x leggere le velocità dell'UnOp
for (int i = 0; i < numUnOp; i++)
{
// leggo valore Codice
locSpeedRate = BitConverter.ToUInt16(unOpSpeedMem, 2 * i);
// leggo valore Codice
locSpeedRate = BitConverter.ToUInt16(unOpSpeedMem, 2 * i);
// leggo 41° byte = indice 40 + 2*i x le var del carico UnOp
UnOpLoad = unOpSpeedMem[40 + i];
// eventuale fix bigEndian...
if (hasBigEndian)
{
locSpeedRate = Endian.SwapUInt16((ushort)locSpeedRate);
}
vettUnOp[i].mUnOpSpeed.Value = locSpeedRate;
vettUnOp[i].mUnOpLoad.Value = UnOpLoad;
vettUnOp[i].mUnOpSpeedOverr.Value = SpeedRateOver;