using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Drawing; using System.ComponentModel; namespace Project { public class ModelInfoV { [Browsable(false)] public string SPN { get; set; } //[Browsable(false)] //public Boolean SplitSPN { get; set; } [Browsable(false)] public string Title { get; set; } [Browsable(false)] public string Code { get; set; } [Browsable(false)] public int idx { get; set; } public string Motion { get; set; } public Boolean BCD_1D { get; set; } public Boolean BCD_QR { get; set; } public Boolean BCD_DM { get; set; } public UInt16 vOption { get; set; } public UInt16 vSIDInfo { get; set; } public UInt16 vJobInfo { get; set; } public UInt16 vSIDConv1 { get; set; } public string Def_Vname { get; set; } public string Def_MFG { get; set; } public Boolean IgnoreOtherBarcode { get; set; } public bool DisableCamera { get; set; } public bool DisablePrinter { get; set; } public bool CheckSIDExsit { get; set; } //public string ByPassSID { get; set; } public ModelInfoV() { vOption = vSIDInfo = vJobInfo = vSIDConv1 = 0; } public void ReadValue(DataSet1.OPModelRow dr) { this.Title = dr.Title; this.Code = dr.Code; this.idx = dr.idx; this.Motion = dr.Motion; this.BCD_1D = dr.BCD_1D; this.BCD_QR = dr.BCD_QR; this.BCD_DM = dr.BCD_DM; this.vOption = dr.vOption; this.vJobInfo = dr.vJobInfo; this.vSIDInfo = dr.vSIDInfo; this.vSIDConv1 = dr.vSIDConv; this.Def_MFG = dr.Def_MFG; this.Def_Vname = dr.Def_VName; this.IgnoreOtherBarcode = dr.IgnoreOtherBarcode; this.DisableCamera = dr.DisableCamera; this.DisablePrinter = dr.DisablePrinter; this.CheckSIDExsit = dr.CheckSIDExsit; //this.ByPassSID = dr.ByPassSID; } public bool WriteValue() { var model = PUB.mdm.GetDataV(this.Title); return WriteValue(ref model); } public bool WriteValue(ref DataSet1.OPModelRow dr) { try { dr.Title = this.Title; dr.Code = this.Code; dr.Motion = this.Motion; dr.BCD_1D = this.BCD_1D; dr.BCD_QR = this.BCD_QR; dr.BCD_DM = this.BCD_DM; dr.vOption = this.vOption; dr.vSIDInfo = this.vSIDInfo; dr.vJobInfo = this.vJobInfo; dr.vSIDConv = this.vSIDConv1; dr.Def_MFG = this.Def_MFG; dr.Def_VName = this.Def_Vname; dr.IgnoreOtherBarcode = this.IgnoreOtherBarcode; dr.DisableCamera = this.DisableCamera; dr.DisablePrinter = this.DisablePrinter; dr.CheckSIDExsit = this.CheckSIDExsit; dr.EndEdit(); PUB.mdm.SaveModelV(); return true; } catch (Exception ex) { PUB.log.AddE("write model error" + ex.Message); return false; } } } [TypeConverterAttribute(typeof(ExpandableObjectConverter))] public class RoiOffset { [DisplayName("Horizon"), Description("수직(Y축) 변화 값(+는 아래쪽,-는 위쪽)")] public double Y { get; set; } [DisplayName("Vertical"), Description("수평(X축) 변화 값(+는 오른쪽,-는 왼쪽)")] public double X { get; set; } [Browsable(false)] public bool IsEmpty { get { if (Y == 0 && X == 0) return true; else return false; } } public RoiOffset(double start = 0.0, double end = 0.0) { this.Y = start; this.X = end; } public override string ToString() { return string.Format("{0},{1}", Y, X); } public string toPointStr() { return string.Format("{0};{1}", Y, X); } } [TypeConverterAttribute(typeof(ExpandableObjectConverter))] public class Range { [DisplayName("시작값")] public uint Start { get; set; } [DisplayName("종료값")] public uint End { get; set; } [Browsable(false)] public bool IsEmpty { get { if (Start == 0 && End == 0) return true; else return false; } } public Range(UInt16 start, UInt16 end) : this((uint)start, (uint)end) { } public Range(uint start = 0, uint end = 0) { this.Start = start; this.End = end; } public static implicit operator RangeF(Range p) { return new RangeF((float)p.Start, (float)p.End); } public override string ToString() { return string.Format("{0}~{1}", Start, End); } } [TypeConverterAttribute(typeof(ExpandableObjectConverter))] public class RangeF { [DisplayName("시작값")] public float Start { get; set; } [DisplayName("종료값")] public float End { get; set; } [Browsable(false)] public bool IsEmpty { get { if (Start == 0f && End == 0f) return true; else return false; } } public RangeF(float start = 0f, float end = 0f) { this.Start = start; this.End = end; } public static implicit operator Range(RangeF p) { return new Range((uint)p.Start, (uint)p.End); } public override string ToString() { return string.Format("{0}~{1}", Start, End); } } [TypeConverterAttribute(typeof(ExpandableObjectConverter))] public class CVisionProcess { [Category("특수설정(개발자용)"), Description("미사용(DOT 인식시에 사용했음)")] public UInt16 halfKernel { get; set; } [Category("특수설정(개발자용)"), Description("미사용(DOT 인식시에 사용했음)")] public UInt16 Constant { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Dilate"), Description("미사용(DOT 인식시에 사용했음)")] public UInt16 dilate { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Erode"), Description("미사용(DOT 인식시에 사용했음)")] public UInt16 erode { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Open"), Description("미사용(DOT 인식시에 사용했음)")] public UInt16 open { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Open"), Description("미사용(DOT 인식시에 사용했음)")] public UInt32 segment_threshold { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Open"), Description("미사용(DOT 인식시에 사용했음)")] public Boolean isBlack { get; set; } [Category("특수설정(개발자용)"), DisplayName("MP_Open"), Description("미사용(DOT 인식시에 사용했음)")] public UInt32 judg_runcount { get; set; } [Category("유닛 감지"), DisplayName("밝기 기준값"), Description("입력된 값 이상의 데이터를 취합니다. 이 값이 낮을 수록 검출값이 높아지게 됩니다. 이 기준값으로 검출된 값으로 판정을 합니다. 유닛은 밝은 데이터를 보고 판정 하므로 이 기준값 이상의 데이터가 검출이 됩니다")] public byte detect_threhosld { get; set; } [Category("유닛 감지"), DisplayName("판정 기준값"), Description("판정을 하는 기준 값입니다. 밝기기준값으로 인해 검출된 값이 5000이라면. 이 판정 기준에 입력된 값이 5000보다 크면 유닛이 존재하는 것으로 판정하며, 그 보다 낮을 때에는 유닛이 없는 'Empty' 유닛으로 감지 됩니다")] public UInt16 detect_count { get; set; } [Category("유닛 감지"), DisplayName("*예외영역 판정기준"), Description("빈 유닛(=Empty) 일때 셔틀 프레임의 빛 반사가 심할 경우 해당 반사값에 의해 유닛이 감지됩니다. 그러한 데이터를 제거하기위해 이 값이 사용되며, 유닛검출에 사용하는 흰색영역의 값외에 추가로 검은색 덩어리를 검사합니다. 설정한 값사이의 검은색 덩어리가 검출되면 'Empty' 유닛으로 감지 됩니다")] public Point detect_blobrange { get; set; } [Category("2D 감지"), DisplayName("밝기 기준값"), Description("입력된 값 이하의 데이터를 취합니다. 이 값이 낮을 수록 검출값도 낮아지게 됩니다. 이 기준값으로 검출된 값으로 판정을 합니다. 2D는 어두운 데이터를 보고 판정 하므로 이 기준값 이하의 데이터가 검출이 됩니다")] public byte detectDM_threhosld { get; set; } [Category("2D 감지"), DisplayName("판정 기준값"), Description("판정을 하는 기준 값입니다. 밝기기준값으로 인해 검출된 값이 5000이라면. 이 판정 기준에 입력된 값이 5000보다 크면 ID가 존재하는 것으로 판정하며, 그 보다 낮을 때에는 ID가 없는 'New' 유닛으로 감지 됩니다")] public UInt16 detectDM_count { get; set; } public CVisionProcess() { } public override string ToString() { return "비젼 설정 값"; } } }