This commit is contained in:
罗圣
2016-09-01 10:50:02 +08:00
parent 9d07328625
commit 2ddb028baf

View File

@@ -81,7 +81,7 @@ namespace Modbus.Net
{ {
Area = area, Area = area,
Address = (int) Math.Floor(initNum), Address = (int) Math.Floor(initNum),
GetCount = (int)Math.Ceiling(((int)Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(address.Area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]), GetCount = (int)Math.Ceiling((Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(address.Area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
DataType = typeof (byte), DataType = typeof (byte),
OriginalAddresses = originalAddresses.ToList(), OriginalAddresses = originalAddresses.ToList(),
}); });
@@ -101,7 +101,7 @@ namespace Modbus.Net
{ {
Area = area, Area = area,
Address = (int)Math.Floor(initNum), Address = (int)Math.Floor(initNum),
GetCount = (int)Math.Ceiling(((int)Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]), GetCount = (int)Math.Ceiling((Math.Floor(preNum) - (int)Math.Floor(initNum)) * AddressTranslator.GetAreaByteLength(area) + BigEndianValueHelper.Instance.ByteLength[preType.FullName]),
DataType = typeof (byte), DataType = typeof (byte),
OriginalAddresses = originalAddresses.ToList() OriginalAddresses = originalAddresses.ToList()
}); });