* 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:
2026-11-06 15:35:44 +09:00
parent 56e341a48a
commit e041527b56
42 changed files with 5888 additions and 160 deletions

View File

@@ -1,4 +1,4 @@
using LFP_Manager.DataStructure;
using LFP_Manager.DataStructure;
using LFP_Manager.Function;
using LFP_Manager.Utils;
using SnmpSharpNet;
@@ -516,34 +516,55 @@ namespace LFP_Manager.Threads
return;
var temperatures = systemData.ValueData.CellTemperature;
var validCount = Math.Min((int)tempSize, temperatures.Length);
var limitCount = Math.Min((int)tempSize, temperatures.Length);
var sum = 0;
int validCount = 0;
short maxVal = 0, minVal = 0;
int maxIdx = 0, minIdx = 0;
for (int i = 0; i < limitCount; i++)
{
var temp = temperatures[i];
if (temp == 0) continue; // 미연결 및 초기 0도 제외
if (validCount == 0)
{
maxVal = minVal = temp;
maxIdx = minIdx = i;
}
sum += temp;
validCount++;
if (temp > maxVal)
{
maxVal = temp;
maxIdx = i;
}
if (temp < minVal)
{
minVal = temp;
minIdx = i;
}
}
if (validCount == 0)
{
systemData.AvgData.avgTemp = 0;
return;
systemData.AvgData.maxTemp = 0;
systemData.AvgData.maxTempNum = 0;
systemData.AvgData.minTemp = 0;
systemData.AvgData.minTempNum = 0;
}
var sum = 0;
var max = new { value = temperatures[0], index = 0 };
var min = new { value = temperatures[0], index = 0 };
for (int i = 0; i < validCount; i++)
else
{
var temp = temperatures[i];
sum += temp;
if (temp > max.value)
max = new { value = temp, index = i };
if (temp < min.value)
min = new { value = temp, index = i };
systemData.AvgData.avgTemp = (short)(sum / validCount);
systemData.AvgData.maxTemp = maxVal;
systemData.AvgData.maxTempNum = maxIdx;
systemData.AvgData.minTemp = minVal;
systemData.AvgData.minTempNum = minIdx;
}
systemData.AvgData.avgTemp = (short)(sum / validCount);
systemData.AvgData.maxTemp = max.value;
systemData.AvgData.maxTempNum = max.index;
systemData.AvgData.minTemp = min.value;
systemData.AvgData.minTempNum = min.index;
}
/// <summary>