- NaN = 미수신
- 0.0은 수신됐으나 측정값 0

Add WeldingLog
This commit is contained in:
최이근 2026-03-10 16:37:19 +09:00
parent f15800250e
commit d31020df72
3 changed files with 33 additions and 9 deletions

View File

@ -89,7 +89,7 @@ namespace ILSOS_CCW_H52A.Data
LotId = string.Empty; LotId = string.Empty;
CellId = string.Empty; CellId = string.Empty;
LbadAvg = 0.0; LbadAvg = double.NaN; // NaN = 미수신, 0.0은 수신됐으나 측정값 0
CheckSendCellinfo = false; CheckSendCellinfo = false;
ReportComplete = false; ReportComplete = false;

View File

@ -775,6 +775,7 @@ namespace ILSOS_CCW_H52A.Sequences
} else { } else {
if (canExist) if (canExist)
Log.E($"[QueueEmpty] Jig{_WeldingJigNo} canExist=true 이지만 큐가 비어있음"); Log.E($"[QueueEmpty] Jig{_WeldingJigNo} canExist=true 이지만 큐가 비어있음");
_CellTracker.getDummyData(out string lotId, out string cellId); _CellTracker.getDummyData(out string lotId, out string cellId);
recvInfo.LotId = lotId; recvInfo.LotId = lotId;
recvInfo.CellId = cellId; recvInfo.CellId = cellId;
@ -1003,15 +1004,19 @@ namespace ILSOS_CCW_H52A.Sequences
} }
} }
// List의 실행의 토글을 확인함 // List의 시작/종료 로그 — MOTF에서 LIST1 -> LIST2 전환 시 종료+시작 각각 기록
_Scanner.GetListPointer(out eListNo curList, out uint pos); _Scanner.GetListPointer(out eListNo curList, out uint pos);
var isBusy = _Scanner.GetBusyStatus(); var isBusy = _Scanner.GetBusyStatus();
if (!isBusy && (curList == eListNo.LIST1 || curList == eListNo.LIST2)) eListNo effectiveList = (!isBusy && (curList == eListNo.LIST1 || curList == eListNo.LIST2))
curList = eListNo.NONE; ? eListNo.NONE : curList;
var IsToggleListState = ChangeChecker.IsChangedInt("ListState", (int)curList); if (ChangeChecker.IsChangedInt("ListState", (int)effectiveList, out int prevListRaw)) {
if (IsToggleListState) var prevList = (eListNo)prevListRaw;
Log.I($"Fork Laser On({LaserIO}) Encoder X : ({encoderX}), Encoder Y : ({currentAngle}), PLC Rotary : ({CurrentPosPLC}), List {executeTarget?.ListNo}, JigNo : ({executeTarget?.JigNo})"); if (prevList != eListNo.NONE)
Log.I($"[ListEnd] List {prevList} 종료 >> LaserOn({LaserIO}) EncoderY({currentAngle:F3}) JigNo({executeTarget?.JigNo})");
if (effectiveList != eListNo.NONE)
Log.I($"[ListStart] List {effectiveList} 시작 >> LaserOn({LaserIO}) EncoderY({currentAngle:F3}) JigNo({executeTarget?.JigNo})");
}
for (int i = 0; i < _RotaryJigCount; i++) { for (int i = 0; i < _RotaryJigCount; i++) {
if (_PLC.ReadBit((int)eBitInput.PLC_USE_WELD_JIG_1 + i).data == false) { if (_PLC.ReadBit((int)eBitInput.PLC_USE_WELD_JIG_1 + i).data == false) {
@ -1035,8 +1040,9 @@ namespace ILSOS_CCW_H52A.Sequences
// 셀 식별 정보 + LBAD AVG는 스케줄러 슬롯에서 직접 읽음 (ReportSlot 또는 pendingSlot) // 셀 식별 정보 + LBAD AVG는 스케줄러 슬롯에서 직접 읽음 (ReportSlot 또는 pendingSlot)
// ReportSlot 단계에서는 지그 1회전(~320ms) 경과 → LBAD MES Report(~100ms) 보장 수신 // ReportSlot 단계에서는 지그 1회전(~320ms) 경과 → LBAD MES Report(~100ms) 보장 수신
var report = _CellScheduler.ActiveReportSlot; var report = _CellScheduler.ActiveReportSlot;
string lbadAvg = report.LbadAvg > 0 ? report.LbadAvg.ToString("F3") : "0"; bool lbadReceived = !double.IsNaN(report.LbadAvg);
if (report.LbadAvg <= 0) string lbadAvg = lbadReceived ? report.LbadAvg.ToString("F3") : "0";
if (!lbadReceived)
Log.W($"[LBAD] ReportSlot LbadAvg 미수신 >> CellId({report.CellId})"); Log.W($"[LBAD] ReportSlot LbadAvg 미수신 >> CellId({report.CellId})");
// 레시피·장비 계측값은 Status에서 읽음 (TodayProduct/TotalProduct 포함) // 레시피·장비 계측값은 Status에서 읽음 (TodayProduct/TotalProduct 포함)
var wd = Status.GetProcessingWeldingData(); var wd = Status.GetProcessingWeldingData();

View File

@ -57,5 +57,23 @@ namespace WeldingCommon.Utils
mappingInt[Resource] = value; mappingInt[Resource] = value;
return true; return true;
} }
public static bool IsChangedInt(string Resource, int value, out int prevalue, int defaultVal = 0)
{
if (mappingInt.ContainsKey(Resource) == false) {
mappingInt[Resource] = defaultVal;
prevalue = mappingInt[Resource];
return false;
}
if (mappingInt[Resource] == value) {
prevalue = value;
return false;
}
prevalue = mappingInt[Resource];
mappingInt[Resource] = value;
return true;
}
} }
} }