Add QRValidation project to repository
- Added QRValidation vision control system - Includes CapCleaningControl UI components - WebSocket-based barcode validation system - Support for Crevis PLC integration - Test projects for PLC emulator, motion, IO panel, and Modbus 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
208
QRValidation/CapCleaningControl/CItem.cs
Normal file
208
QRValidation/CapCleaningControl/CItem.cs
Normal file
@@ -0,0 +1,208 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Drawing;
|
||||
namespace UIControl
|
||||
{
|
||||
[Serializable]
|
||||
public class CItem
|
||||
{
|
||||
public Boolean Active { get; set; }
|
||||
public Boolean PLCWriteNo { get; set; }
|
||||
public Boolean PLCWriteSize { get; set; }
|
||||
public Boolean Delete { get; set; }
|
||||
/// <summary>
|
||||
/// 어떠한 포트에서 픽업 되었는지
|
||||
/// </summary>
|
||||
public int iPort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 출력 포트
|
||||
/// </summary>
|
||||
public int oPort { get; set; }
|
||||
|
||||
public Boolean ExistError { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 배출여부
|
||||
/// </summary>
|
||||
public int ErrorOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 크기는 어떠한지(7 or 13)
|
||||
/// </summary>
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 존번호 0~10
|
||||
/// </summary>
|
||||
public int ZoneIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 피커에의해서 드랍된 시간
|
||||
/// </summary>
|
||||
public DateTime DropTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 차수별 일련번호
|
||||
/// </summary>
|
||||
public UInt16 Seq { get; set; }
|
||||
|
||||
public DateTime BarcodeStart { get; set; }
|
||||
public DateTime BarcodeEnd { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 바코드 처리가 완료디었는가?
|
||||
/// 종료일자가 설정되면 처리완료로 합니다.
|
||||
/// 201028
|
||||
/// </summary>
|
||||
public Boolean BarcodeProcess
|
||||
{
|
||||
get
|
||||
{
|
||||
if (BarcodeEnd.Year == 1982) return false;
|
||||
else if (BarcodeEnd <= BarcodeStart) return false;
|
||||
else return true;
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime PlcStartTime { get; set; }
|
||||
public DateTime PlcEndTime { get; set; }
|
||||
|
||||
public DateTime ZoneIntime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 컨베이어에 들어온 시간
|
||||
/// 피커에서 드랍되면 dropTime 과 동일하며, 외부에서 들어오면 센서가 최초 감지한 시간이 된다
|
||||
/// </summary>
|
||||
public DateTime InTime { get; set; }
|
||||
public DateTime OutTime { get; set; }
|
||||
public Rectangle Rect { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// jobhistory에 연결되는 데이터 키
|
||||
/// </summary>
|
||||
public string JGUID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 바코드 데이터와 연결되는 키값
|
||||
/// </summary>
|
||||
public string BGUID { get; set; }
|
||||
public string RID { get; set; }
|
||||
public string SID { get; set; }
|
||||
public string VLOT { get; set; }
|
||||
public string BarcodeRaw { get; set; }
|
||||
public string BarcodeMsg { get; set; }
|
||||
public Boolean Processing { get; set; }
|
||||
public Boolean Complete { get; set; }
|
||||
public string GUID { get; private set; }
|
||||
public int Qty { get; set; }
|
||||
public int QtyAcc { get; set; }
|
||||
public int QtyMax { get; set; }
|
||||
public List<string> UnloaderMsg { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 바코드의 완료여부, timeout 혻은 설정 되었을때 적용
|
||||
/// </summary>
|
||||
public Boolean BarcodeDone { get; set; }
|
||||
|
||||
public Boolean hasBarcode
|
||||
{
|
||||
get
|
||||
{
|
||||
return !string.IsNullOrEmpty(RID);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 지정한 문자가 포함되어잇다면 true 반환
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
/// <returns></returns>
|
||||
public Boolean CheckMessage(string msg)
|
||||
{
|
||||
if (UnloaderMsg == null || UnloaderMsg.Count < 1) return false;
|
||||
foreach (var item in UnloaderMsg)
|
||||
if (item.Contains(msg)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public void AddMessage(string msg)
|
||||
{
|
||||
if (this.UnloaderMsg.Contains(msg) == false)
|
||||
UnloaderMsg.Add(msg);
|
||||
}
|
||||
public void ClearMessage()
|
||||
{
|
||||
this.UnloaderMsg.Clear();
|
||||
}
|
||||
|
||||
public CItem()
|
||||
{
|
||||
ExistError = false;
|
||||
Active = true;
|
||||
Complete = false;
|
||||
PLCWriteNo = false;
|
||||
PLCWriteSize = false;
|
||||
Qty = 0;
|
||||
QtyAcc = 0; //200913 누계
|
||||
QtyMax = 0; //200913 최대값
|
||||
UnloaderMsg = new List<string>();
|
||||
ErrorOut = 0;
|
||||
this.GUID = Guid.NewGuid().ToString();
|
||||
BGUID = string.Empty;
|
||||
JGUID = string.Empty;
|
||||
VLOT = string.Empty;
|
||||
Seq = 0;
|
||||
SID = string.Empty;
|
||||
BarcodeRaw = string.Empty;
|
||||
BarcodeMsg = string.Empty;
|
||||
RID = string.Empty;
|
||||
Rect = Rectangle.Empty;
|
||||
Delete = false;
|
||||
Processing = false;
|
||||
DropTime = DateTime.Parse("1982-11-23");
|
||||
BarcodeStart = DateTime.Parse("1982-11-23");
|
||||
BarcodeEnd = DateTime.Parse("1982-11-23");
|
||||
PlcStartTime = DateTime.Parse("1982-11-23");
|
||||
PlcEndTime = DateTime.Parse("1982-11-23");
|
||||
InTime = DateTime.Parse("1982-11-23");
|
||||
OutTime = DateTime.Parse("1982-11-23");
|
||||
ZoneIntime = DateTime.Parse("1982-11-23");
|
||||
|
||||
ZoneIndex = -1;
|
||||
oPort = -1;
|
||||
iPort = -1;
|
||||
Size = string.Empty;
|
||||
}
|
||||
public CItem Clone()
|
||||
{
|
||||
var item = new CItem();
|
||||
item.Qty = Qty;
|
||||
item.Seq = Seq;//0;
|
||||
item.SID = SID;// string.Empty;
|
||||
item.VLOT = VLOT;
|
||||
item.BarcodeRaw = BarcodeRaw;//string.Empty;
|
||||
item.BarcodeMsg = BarcodeMsg;//string.Empty;
|
||||
item.RID = RID;//string.Empty;
|
||||
item.Rect = Rect;//Rectangle.Empty;
|
||||
item.Delete = Delete;//DropTime;//;
|
||||
item.ExistError = ExistError;
|
||||
|
||||
item.DropTime = DropTime;// DateTime.Parse("1982-11-23");
|
||||
item.BarcodeStart = BarcodeStart;// DateTime.Parse("1982-11-23");
|
||||
item.BarcodeEnd = BarcodeEnd;//DropTime;//.Parse("1982-11-23");
|
||||
item.PlcStartTime = PlcStartTime;//DateTime.Parse("1982-11-23");
|
||||
item.PlcEndTime = PlcEndTime;// DateTime.Parse("1982-11-23");
|
||||
item.InTime = InTime;//DropTime;//.Parse("1982-11-23");
|
||||
item.OutTime = OutTime;//DateTime.Parse("1982-11-23");
|
||||
item.ZoneIntime = ZoneIntime;//DateTime.Parse("1982-11-23");
|
||||
item.ZoneIndex = ZoneIndex;
|
||||
item.oPort = oPort;
|
||||
item.iPort = iPort;
|
||||
item.Size = Size;
|
||||
return item;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user