choieigun 6279c02cd6 [bugfix] 재시작할때 미보고 발생하는 케이스 수정
- pending(보류) data 추가
- Reset을 해야하는 이유는 최초 2번의 WeldingListUpload를 하기 위해 필요함
- Reset을 하니까 pending data 영역이 필요해짐

자동 시퀀스 간소화
- Sub Sequence를 자동 시퀀스 내에 함수 단위로 변경함
 .receive / report..
2026-03-01 10:24:29 +09:00

166 lines
7.4 KiB
C#

using Aurora.Api;
using Aurora.View;
using AuroraLaserScanner;
using CoreUnit.Control.UserControl.Canvas;
using Matrox.MatroxImagingLibrary;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WeldingCommon.Data
{
public class WeldingData : NotifyPropertyChangedBase, ICloneable
{
protected readonly Logger Log = new Logger("WeldingData");
private object _LockObj = new object();
// For View
// Main AutoRun Sequence 에서 한번에 Update 하여 view 에 보여 주기 위함.
// 아래 EDC 와 중복인 것도 있지만, 한번에 Update 되어야 혼란이 없을 것 같음.
private DateTime _AutoRunStartTime;
public DateTime AutoRunStartTime { get => _AutoRunStartTime; set => SetProperty(ref _AutoRunStartTime, value); }
private DateTime _WeldingStartTime; // 마지막 제품 Weld 시작 시각
public DateTime WeldingStartTime { get => _WeldingStartTime; set => SetProperty(ref _WeldingStartTime, value); }
private DateTime _WeldingEndTime; // 마지막 제품 생산 시각, LastProductTime
public DateTime WeldingEndTime { get => _WeldingEndTime; set => SetProperty(ref _WeldingEndTime, value); }
//private TimeSpan _WeldingSpanTime;
//public TimeSpan WeldingSpanTime { get => _WeldingSpanTime; set => SetProperty(ref _WeldingSpanTime, value); }
private string _WeldingSpanTimeMilliseconds;
public string WeldingSpanTimeMilliseconds { get => _WeldingSpanTimeMilliseconds; set => SetProperty(ref _WeldingSpanTimeMilliseconds, value); }
private uint _TodayProduct;
public uint TodayProduct { get => _TodayProduct; set => SetProperty(ref _TodayProduct, value); }
private uint _TotalProduct;
public uint TotalProduct { get => _TotalProduct; set => SetProperty(ref _TotalProduct, value); }
private string _CellId;
public string CellId { get => _CellId; set => SetProperty(ref _CellId, value); }
private string _LotId;
public string LotId { get => _LotId; set => SetProperty(ref _LotId, value); }
private int _RecipeNo;
public int RecipeNo { get => _RecipeNo; set => SetProperty(ref _RecipeNo, value); }
// =================================================================================================================
// For EDC <-> Sequence 사이의 정보를 주고 받기 위한 용도
private string _WeldStartTime;
public string WeldStartTime { get => _WeldStartTime; set => SetProperty(ref _WeldStartTime, value); }
private string _WeldTime;
public string WeldTime { get => _WeldTime; set => SetProperty(ref _WeldTime, value); }
// <EDC, SeqAutoRunSMW, SeqAutoRunLHS_Normal, SeqReceiveCellInfo>
private string _WorkCellId;
public string WorkCellId { get => _WorkCellId; set => SetProperty(ref _WorkCellId, value); }
private string _WorkLotId;
public string WorkLotId { get => _WorkLotId; set => SetProperty(ref _WorkLotId, value); }
private string _LBAD_Judge;
public string LBAD_Judge { get => _LBAD_Judge; set => SetProperty(ref _LBAD_Judge, value); }
private string _LDD_Judge;
public string LDD_Judge { get => _LDD_Judge; set => SetProperty(ref _LDD_Judge, value); }
// AutoRun <-> (FlyingVisionScout, SeqScout)
private MIL_ID _ScannerFiledImage;
public MIL_ID ScannerFiledImage { get => _ScannerFiledImage; set => SetProperty(ref _ScannerFiledImage, value); }
// =================================================================================================================
// Laser Parameter
private string _LaserPowerCore;
public string LaserPowerCore { get => _LaserPowerCore; set => SetProperty(ref _LaserPowerCore, value); }
private string _LaserPowerRing;
public string LaserPowerRing { get => _LaserPowerRing; set => SetProperty(ref _LaserPowerRing, value); }
private string _MarkSpeed;
public string MarkSpeed { get => _MarkSpeed; set => SetProperty(ref _MarkSpeed, value); }
private string _FocalLength;
public string FocalLength { get => _FocalLength; set => SetProperty(ref _FocalLength, value); }
private string _WeldingJigNo;
public string WeldingJigNo { get => _WeldingJigNo; set => SetProperty(ref _WeldingJigNo, value); }
private string _LaserPowerByLBAD;
public string LaserPowerByLBAD { get => _LaserPowerByLBAD; set => SetProperty(ref _LaserPowerByLBAD, value); }
private bool _CheckCanExist;
public bool CheckCanExist { get => _CheckCanExist; set => SetProperty(ref _CheckCanExist, value); }
private bool _CheckScannerListEnd;
public bool CheckScannerListEnd { get => _CheckScannerListEnd; set => SetProperty(ref _CheckScannerListEnd, value); }
[JsonIgnore]
public ActualProcessData APD { get => _APD; set => SetProperty(ref _APD, value); }
private ActualProcessData _APD = new ActualProcessData();
public WeldingData()
{
Clear();
}
public void Clear()
{
this.CellId = string.Empty;
this.LotId = string.Empty;
this.AutoRunStartTime = DateTime.MinValue;
this.WeldingStartTime = DateTime.MinValue;
this.WeldingEndTime = DateTime.MinValue;
this.WeldingSpanTimeMilliseconds = string.Empty;
this.TodayProduct = 0;
this.TotalProduct = 0;
this.RecipeNo = 0;
this.WeldStartTime = string.Empty;
this.WeldTime = string.Empty;
this.WorkCellId = string.Empty;
this.WorkLotId = string.Empty;
this.LBAD_Judge = string.Empty;
this.LDD_Judge = string.Empty;
this.LaserPowerCore = string.Empty;
this.LaserPowerRing = string.Empty;
this.MarkSpeed = string.Empty;
this.FocalLength = string.Empty;
this.WeldingJigNo = string.Empty;
this.LaserPowerByLBAD = string.Empty;
this.CheckCanExist = false;
this.CheckScannerListEnd = false;
}
public object Clone()
{
var clone = new WeldingData();
clone._CellId = _CellId;
clone._LotId = _LotId;
clone._AutoRunStartTime = _AutoRunStartTime;
clone._WeldingStartTime = _WeldingStartTime;
clone._WeldingEndTime = _WeldingEndTime;
clone._WeldingSpanTimeMilliseconds = _WeldingSpanTimeMilliseconds;
clone._TodayProduct = _TodayProduct;
clone._TotalProduct = _TotalProduct;
clone._RecipeNo = _RecipeNo;
clone._WeldStartTime = _WeldStartTime;
clone._WeldTime = _WeldTime;
clone._WorkCellId = _WorkCellId;
clone._WorkLotId = _WorkLotId;
clone._LBAD_Judge = _LBAD_Judge;
clone._LDD_Judge = _LDD_Judge;
clone._LaserPowerCore = _LaserPowerCore;
clone._LaserPowerRing = _LaserPowerRing;
clone._MarkSpeed = _MarkSpeed;
clone._FocalLength = _FocalLength;
clone._WeldingJigNo = _WeldingJigNo;
clone._LaserPowerByLBAD = _LaserPowerByLBAD;
clone._CheckCanExist = _CheckCanExist;
clone._CheckScannerListEnd = _CheckScannerListEnd;
return clone;
}
}
}