fix: 레시피 화면 IO 미연결 시 null 가드 (OnMonitoring)

시뮬 모드가 아니고 IO보드가 없으면 IODevice._iOUnit이 null이라
OnMonitoring의 ReadDI(11/15)에서 NRE 발생(현장 PC에서 레시피 메뉴 진입 시).
IsConnected()로 미연결을 선검사해 폴링을 스킵, 프로그램이 꺼지지 않도록 함.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
노도연 2026-06-18 20:32:35 +09:00
parent 95ef7b97c0
commit a312e4ec8a

View File

@ -179,8 +179,14 @@ namespace WeldingCommon.Views
}
try
{
// 시뮬 아님 + IO보드 없음 → _iOUnit == null → ReadDI에서 NRE로 꺼짐.
// IsConnected()가 _iOUnit null/미연결을 체크하므로, 미연결이면 폴링 스킵(꺼짐 방지).
if (_IODevice == null || !_IODevice.IsConnected())
{
IsLaserReady = false;
}
// 변경 후 (260618: IO 결선 변경 12&24 → 11&15)
if (_IODevice.ReadDI(11) && _IODevice.ReadDI(15))
else if (_IODevice.ReadDI(11) && _IODevice.ReadDI(15))
{
IsLaserReady = true;
}
@ -188,7 +194,7 @@ namespace WeldingCommon.Views
{
IsLaserReady = false;
}
}
catch (Exception ex)
{