|
|
|
@ -80,12 +80,16 @@ public static class ModelConvert
|
|
|
|
|
else if (propertyType == FLOAT)
|
|
|
|
|
{
|
|
|
|
|
field.SetValue(t,
|
|
|
|
|
Convert.ChangeType(Math.Round(BitUtls.Byte2Float(bytes, start, length, scale) - offset, attribute.Round), propertyType), null);
|
|
|
|
|
Convert.ChangeType(
|
|
|
|
|
Math.Round(BitUtls.Byte2Float(bytes, start, length, scale) - offset, attribute.Round),
|
|
|
|
|
propertyType), null);
|
|
|
|
|
}
|
|
|
|
|
else if (propertyType == DOUBLE)
|
|
|
|
|
{
|
|
|
|
|
field.SetValue(t,
|
|
|
|
|
Convert.ChangeType(Math.Round(BitUtls.Byte2Double(bytes, start, length, scale) - offset, attribute.Round), propertyType), null);
|
|
|
|
|
Convert.ChangeType(
|
|
|
|
|
Math.Round(BitUtls.Byte2Double(bytes, start, length, scale) - offset, attribute.Round),
|
|
|
|
|
propertyType), null);
|
|
|
|
|
}
|
|
|
|
|
else if (propertyType == STRING)
|
|
|
|
|
{
|
|
|
|
@ -164,7 +168,7 @@ public static class ModelConvert
|
|
|
|
|
|
|
|
|
|
if (propertyType == USHORT)
|
|
|
|
|
{
|
|
|
|
|
return BitConverter.GetBytes((ushort)(((short)value + offset) / scale));
|
|
|
|
|
return BitConverter.GetBytes((ushort)(((ushort)value + offset) / scale));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (propertyType == SHORT)
|
|
|
|
|