V1.0.1.8 -- 2025/12/20

* BMS History Function Improved
This commit is contained in:
2025-12-20 12:24:39 +09:00
parent ea26bb8214
commit 56e341a48a
12 changed files with 651 additions and 121 deletions

View File

@@ -1,7 +1,8 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using System.IO.Ports;
using System.Windows.Forms;
using LFP_Manager.DataStructure;
using LFP_Manager.Function;
using LFP_Manager.Utils;
@@ -460,10 +461,11 @@ namespace LFP_Manager.Threads
break;
case 2: // Firmware update packet
if (OnPrint != null)
{
OnPrint(this, csLog.trx_data_print(_readBuffer, _readPosition, 1));
}
SafeRaiseOnPrint(csLog.trx_data_print(_readBuffer, _readPosition, 1));
//if (OnPrint != null)
//{
// OnPrint(this, csLog.trx_data_print(_readBuffer, _readPosition, 1));
//}
_timeoutCount = 0;
ProcessFirmwareResponse();
break;
@@ -702,5 +704,22 @@ namespace LFP_Manager.Threads
}
#endregion
#region SAFE CALLS
private void SafeRaiseOnPrint(string msg)
{
var handler = OnPrint; // 복사
if (handler == null) return;
// 비차단 + 예외격리: 핸들러를 ThreadPool에서 실행
Task.Run(() =>
{
try { handler.Invoke(this, msg); }
catch (Exception ex) { /* 내부 로깅 */ }
});
}
#endregion
}
}