agv 오류코드가 전송되도록함, 에뮬레이터에서 표시되게 함

This commit is contained in:
backuppc
2026-02-02 15:04:05 +09:00
parent 9bca8f67d1
commit b25be68986
5 changed files with 133 additions and 85 deletions

View File

@@ -13,6 +13,7 @@ using System.Windows.Forms.VisualStyles;
using static AGVEmulator.DevAGV;
using AGVNavigationCore.Controls;
using AGVNavigationCore.Models;
using System.Text;
namespace AGVEmulator
{
@@ -993,10 +994,29 @@ namespace AGVEmulator
}
rtStatus.Text = _remoteStatus.ToString();
tbErCode.Text = _remoteErrorCode.ToString();
tbErmsg.Text = _remoteErrorMessage;
string errCode = _remoteErrorCode.ToString();
string errMsg = _remoteErrorMessage;
if (_remoteErrorCode != ENIGProtocol.AGVErrorCode.None)
if (_remoteStatus.HWError > 0)
{
errCode = $"HW:{_remoteStatus.HWError:X4}" + (errCode == "None" ? "" : $" | {errCode}");
StringBuilder sbHw = new StringBuilder();
for (int i = 0; i < 16; i++)
{
if (((ushort)_remoteStatus.HWError & (1 << i)) != 0)
{
sbHw.Append($"{(DevAGV.eerror)i}, ");
}
}
errMsg = $"[HW] {sbHw}" + (string.IsNullOrEmpty(errMsg) ? "" : $" | {errMsg}");
}
tbErCode.Text = errCode;
tbErmsg.Text = errMsg;
if (_remoteErrorCode != ENIGProtocol.AGVErrorCode.None || _remoteStatus.HWError > 0)
{
tbErCode.BackColor = Color.Red;
tbErCode.ForeColor = Color.White;