Release v1.1.1.2: Fix FW update reply and update Anti-Theft error 0x4000 alarm display
- Fix FW update freezing at first 128B by setting ReplyFlag=true in RequestFlashWrite and handling FW Update timeouts in csUartThread - Update Operating Status: remove Anti-Theft from Status (0x0004 -> TRIP) and display TRIP (Anti-Theft) in Alarm when errorCode is 0x4000 - Sync Status/Alarm string mapping in csLog for CSV data logging - Bump assembly version to v1.1.1.2
This commit is contained in:
@@ -704,16 +704,8 @@ namespace LFP_Manager.Controls
|
|||||||
lbStatus.ForeColor = System.Drawing.Color.Magenta;
|
lbStatus.ForeColor = System.Drawing.Color.Magenta;
|
||||||
break;
|
break;
|
||||||
case 0x0004: // TRIP
|
case 0x0004: // TRIP
|
||||||
if (SystemData.StatusData.protection == 0)
|
|
||||||
{
|
|
||||||
lbStatus.Text = "TRIP (Anti-Theft)";
|
|
||||||
lbStatus.ForeColor = Color.Red;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lbStatus.Text = "TRIP";
|
lbStatus.Text = "TRIP";
|
||||||
lbStatus.ForeColor = Color.Red;
|
lbStatus.ForeColor = Color.Red;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 0x0008: // Chg-Lmt
|
case 0x0008: // Chg-Lmt
|
||||||
lbStatus.Text = "CHG-LIMIT";
|
lbStatus.Text = "CHG-LIMIT";
|
||||||
@@ -745,7 +737,12 @@ namespace LFP_Manager.Controls
|
|||||||
if (SystemData.ShelfCommFail == false)
|
if (SystemData.ShelfCommFail == false)
|
||||||
{
|
{
|
||||||
// Alarm Display
|
// Alarm Display
|
||||||
if (SystemData.StatusData.protection != 0)
|
if (((ushort)SystemData.StatusData.errorCode & 0x4000) == 0x4000)
|
||||||
|
{
|
||||||
|
lbAlarm.Text = "TRIP (Anti-Theft)";
|
||||||
|
lbAlarm.ForeColor = Color.Red;
|
||||||
|
}
|
||||||
|
else if (SystemData.StatusData.protection != 0)
|
||||||
{
|
{
|
||||||
lbAlarm.Text = "FAULT";
|
lbAlarm.Text = "FAULT";
|
||||||
lbAlarm.ForeColor = Color.Red;
|
lbAlarm.ForeColor = Color.Red;
|
||||||
@@ -781,7 +778,12 @@ namespace LFP_Manager.Controls
|
|||||||
if (SystemData.ShelfCommFail == false)
|
if (SystemData.ShelfCommFail == false)
|
||||||
{
|
{
|
||||||
// Alarm Display
|
// Alarm Display
|
||||||
if (SystemData.StatusData.batteryStatus == 0)
|
if (((ushort)SystemData.StatusData.errorCode & 0x4000) == 0x4000)
|
||||||
|
{
|
||||||
|
lbAlarm.Text = "TRIP (Anti-Theft)";
|
||||||
|
lbAlarm.ForeColor = System.Drawing.Color.Red;
|
||||||
|
}
|
||||||
|
else if (SystemData.StatusData.batteryStatus == 0)
|
||||||
{
|
{
|
||||||
lbAlarm.Text = "NORMAL";
|
lbAlarm.Text = "NORMAL";
|
||||||
lbAlarm.ForeColor = System.Drawing.Color.Green;
|
lbAlarm.ForeColor = System.Drawing.Color.Green;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
@@ -457,7 +457,7 @@ namespace LFP_Manager
|
|||||||
sdata[sdata.Length - 1] = crc[0]; // CRCL
|
sdata[sdata.Length - 1] = crc[0]; // CRCL
|
||||||
|
|
||||||
FwSentLength = data.Length;
|
FwSentLength = data.Length;
|
||||||
OnSendUartData?.Invoke((ushort)SystemId, sdata, false);
|
OnSendUartData?.Invoke((ushort)SystemId, sdata, true);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
|||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.1.1.1")]
|
[assembly: AssemblyVersion("1.1.1.2")]
|
||||||
[assembly: AssemblyFileVersion("1.1.1.1")]
|
[assembly: AssemblyFileVersion("1.1.1.2")]
|
||||||
|
|||||||
@@ -213,7 +213,29 @@ namespace LFP_Manager.Threads
|
|||||||
public void SetWriteReg(ushort WriteAddr, byte[] WriteData, bool ReplyFlag)
|
public void SetWriteReg(ushort WriteAddr, byte[] WriteData, bool ReplyFlag)
|
||||||
{
|
{
|
||||||
if (WriteData == null) return;
|
if (WriteData == null) return;
|
||||||
TUartTxItem item = new TUartTxItem(UartTxType.WriteReg, SystemId, WriteAddr, (ushort)WriteData.Length, WriteData, ReplyFlag, Config.RecvWaitTime);
|
|
||||||
|
UartTxType txType = UartTxType.WriteReg;
|
||||||
|
int timeoutMs = Config.RecvWaitTime;
|
||||||
|
bool expectReply = ReplyFlag;
|
||||||
|
|
||||||
|
// FW 업데이트 패킷 감지 (Target ID: 0x7F 또는 FW 명령어)
|
||||||
|
if (WriteData.Length >= 2 && WriteData[0] == 0x7F)
|
||||||
|
{
|
||||||
|
txType = UartTxType.FwUpdate;
|
||||||
|
byte cmd = WriteData[1];
|
||||||
|
if (cmd == csSerialCommFunction.FW_FLASH_ERASE_CMD) // 0x43 Erase
|
||||||
|
{
|
||||||
|
expectReply = true;
|
||||||
|
timeoutMs = Math.Max(Config.RecvWaitTime, 5000); // Flash Erase 대기시간 (섹터 지우기 최대 수 초 소요)
|
||||||
|
}
|
||||||
|
else if (cmd == csSerialCommFunction.FW_FLASH_WRITE_CMD) // 0x31 Write
|
||||||
|
{
|
||||||
|
expectReply = true;
|
||||||
|
timeoutMs = Math.Max(Config.RecvWaitTime, 2000); // Flash Write 128B 응답 대기
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TUartTxItem item = new TUartTxItem(txType, SystemId, WriteAddr, (ushort)WriteData.Length, WriteData, expectReply, timeoutMs);
|
||||||
EnqueueTx(item);
|
EnqueueTx(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -311,9 +311,6 @@ namespace LFP_Manager.Utils
|
|||||||
result = "FLOATING";
|
result = "FLOATING";
|
||||||
break;
|
break;
|
||||||
case 0x0004:
|
case 0x0004:
|
||||||
if (aProtection == 0)
|
|
||||||
result = "TRIP (Anti-Theft)";
|
|
||||||
else
|
|
||||||
result = "TRIP";
|
result = "TRIP";
|
||||||
break;
|
break;
|
||||||
case 0x0008:
|
case 0x0008:
|
||||||
@@ -329,12 +326,13 @@ namespace LFP_Manager.Utils
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetAlarmString(short aAlarm)
|
private static string GetAlarmString(short aAlarm, short aErrorCode = 0)
|
||||||
{
|
{
|
||||||
string result = "";
|
string result = "";
|
||||||
bool[] rackStatus = csUtils.Int16ToBitArray(aAlarm);
|
bool[] rackStatus = csUtils.Int16ToBitArray(aAlarm);
|
||||||
|
|
||||||
if (aAlarm == 0) result = "NORMAL";
|
if (((ushort)aErrorCode & 0x4000) == 0x4000) result = "TRIP (Anti-Theft)";
|
||||||
|
else if (aAlarm == 0) result = "NORMAL";
|
||||||
else if (aAlarm == 1) result = "WARNING";
|
else if (aAlarm == 1) result = "WARNING";
|
||||||
else if (aAlarm == 2) result = "FAULT";
|
else if (aAlarm == 2) result = "FAULT";
|
||||||
else if (aAlarm == 3) result = "WARMING UP";
|
else if (aAlarm == 3) result = "WARMING UP";
|
||||||
@@ -460,7 +458,7 @@ namespace LFP_Manager.Utils
|
|||||||
, sData.Information.BMS_SN_Str // 4 MODEL
|
, sData.Information.BMS_SN_Str // 4 MODEL
|
||||||
, GetCommStatus(sConfig, sData) // 5 COMM STATUS
|
, GetCommStatus(sConfig, sData) // 5 COMM STATUS
|
||||||
, GetStatusString(sData.StatusData.status, sData.StatusData.protection) // 6 STATUS
|
, GetStatusString(sData.StatusData.status, sData.StatusData.protection) // 6 STATUS
|
||||||
, GetAlarmString(sData.StatusData.batteryStatus) // 7 ALARM
|
, GetAlarmString(sData.StatusData.batteryStatus, sData.StatusData.errorCode) // 7 ALARM
|
||||||
);
|
);
|
||||||
|
|
||||||
sdata += String.Format(
|
sdata += String.Format(
|
||||||
|
|||||||
Reference in New Issue
Block a user