V1.0.2.0
* Added RS232/RS485 Packet Analyzer (Tools -> Packet Analyzer) * Updated BMS History register request/response length by model * Fixed decimal truncation issue in Brazil locale for DB/CSV Log and Excel Export
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -392,30 +392,46 @@ namespace LFP_Manager.Utils
|
||||
{
|
||||
int Max, Avg, Min, Sum;
|
||||
int MaxNo, MinNo;
|
||||
int validCount = 0;
|
||||
|
||||
Max = Avg = Min = Sum = 0;
|
||||
Max = Min = Sum = 0;
|
||||
MaxNo = MinNo = 0;
|
||||
|
||||
for (int i = 0; i < tempQty; i++)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
Max = Min = rSystemData.ValueData.CellTemperature[i];
|
||||
}
|
||||
Sum += rSystemData.ValueData.CellTemperature[i];
|
||||
short tempVal = rSystemData.ValueData.CellTemperature[i];
|
||||
if (tempVal == 0) continue; // 미연결 및 초기 0도 제외
|
||||
|
||||
if (Max < rSystemData.ValueData.CellTemperature[i])
|
||||
if (validCount == 0)
|
||||
{
|
||||
Max = rSystemData.ValueData.CellTemperature[i];
|
||||
Max = Min = tempVal;
|
||||
MaxNo = MinNo = i;
|
||||
}
|
||||
Sum += tempVal;
|
||||
validCount++;
|
||||
|
||||
if (Max < tempVal)
|
||||
{
|
||||
Max = tempVal;
|
||||
MaxNo = i;
|
||||
}
|
||||
if (Min > rSystemData.ValueData.CellTemperature[i])
|
||||
if (Min > tempVal)
|
||||
{
|
||||
Min = rSystemData.ValueData.CellTemperature[i];
|
||||
Min = tempVal;
|
||||
MinNo = i;
|
||||
}
|
||||
}
|
||||
Avg = Sum / tempQty;
|
||||
|
||||
if (validCount == 0)
|
||||
{
|
||||
Avg = 0;
|
||||
Min = 0;
|
||||
Max = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Avg = Sum / validCount;
|
||||
}
|
||||
|
||||
rSystemData.AvgData.avgTemp = (short)Avg;
|
||||
rSystemData.AvgData.maxTemp = (short)Max;
|
||||
|
||||
Reference in New Issue
Block a user