Initial commit
This commit is contained in:
117
Handler/Project/Class/ItemData.cs
Normal file
117
Handler/Project/Class/ItemData.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Project.Class
|
||||
{
|
||||
public class JobData
|
||||
{
|
||||
public enum ErrorCode
|
||||
{
|
||||
None = 0,
|
||||
BarcodeRead,
|
||||
Print,
|
||||
Camera,
|
||||
}
|
||||
public ErrorCode error = ErrorCode.None;
|
||||
public int No { get; set; }
|
||||
public VisionData VisionData;
|
||||
|
||||
public DateTime JobStart
|
||||
{
|
||||
get
|
||||
{
|
||||
if (this.VisionData == null) return new DateTime(1982, 11, 23);
|
||||
else return VisionData.STime;
|
||||
}
|
||||
}
|
||||
public DateTime JobEnd;
|
||||
public TimeSpan JobRun
|
||||
{
|
||||
get
|
||||
{
|
||||
if (JobEnd.Year == 1982) return new TimeSpan(0);
|
||||
else if (JobStart.Year == 1982) return new TimeSpan(0);
|
||||
else return JobEnd - JobStart;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 프린터에 명령을 전송한 시간
|
||||
/// </summary>
|
||||
public DateTime PrintTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 라벨을 추가한 시간
|
||||
/// </summary>
|
||||
public DateTime Attachtime { get; set; }
|
||||
|
||||
//작업데이터의 GUID(자료식별)
|
||||
public string guid { get; private set; }
|
||||
|
||||
//언로더포트위치(L/R)
|
||||
public string PortPos;
|
||||
|
||||
|
||||
//동작관련 메세지
|
||||
public string Message;
|
||||
|
||||
int idx;
|
||||
|
||||
|
||||
|
||||
public JobData(int idx_)
|
||||
{
|
||||
this.idx = idx_;
|
||||
Clear("INIT");
|
||||
}
|
||||
|
||||
public bool PrintAttach { get; set; }
|
||||
public bool PrintQRValid { get; set; }
|
||||
public string PrintQRValidResult { get; set; }
|
||||
public void Clear(string source)
|
||||
{
|
||||
|
||||
|
||||
No = 0;
|
||||
//JobStart = new DateTime(1982, 11, 23);
|
||||
JobEnd = new DateTime(1982, 11, 23);
|
||||
Attachtime = new DateTime(1982, 11, 23);
|
||||
PortPos = string.Empty;
|
||||
guid = Guid.NewGuid().ToString();
|
||||
Message = string.Empty;
|
||||
if (VisionData == null)
|
||||
VisionData = new VisionData(source);
|
||||
else
|
||||
VisionData.Clear(source, false);
|
||||
PrintAttach = false;
|
||||
PrintQRValid = false;
|
||||
PrintQRValidResult = string.Empty;
|
||||
PrintTime = new DateTime(1982, 11, 23);
|
||||
PUB.AddDebugLog($"item data {idx} clear by {source} guid={guid}");
|
||||
}
|
||||
|
||||
public void CopyTo(ref JobData obj)
|
||||
{
|
||||
if (obj == null) return;
|
||||
obj.No = this.No;
|
||||
obj.error = this.error;
|
||||
obj.JobEnd = this.JobEnd;
|
||||
obj.guid = this.guid;
|
||||
obj.PortPos = this.PortPos;
|
||||
obj.Message = this.Message;
|
||||
obj.PrintAttach = this.PrintAttach;
|
||||
obj.PrintQRValid = this.PrintQRValid;
|
||||
obj.PrintQRValidResult = this.PrintQRValidResult;
|
||||
obj.Attachtime = this.Attachtime;
|
||||
obj.PrintTime = this.PrintTime;
|
||||
PUB.AddDebugLog("아이템 복사 전 rid:" + this.VisionData.RID);
|
||||
this.VisionData.CopyTo(ref obj.VisionData);
|
||||
PUB.AddDebugLog($"아이템 복사 후 대상 rid : {obj.VisionData.RID}, guid={obj.guid}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user