using CoreUnit.Common; using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Reflection; using System.Xml; using System.IO; namespace DB.Recipe { public class RecipeSystem { Dao m_db; /// /// Rnd : R&D 장비 /// CBW : CBW 랩설비 /// CBW_TRUMPF_SCANNER : CBW 랩설비 트럼프 스캐너 사용 /// CCWP : CCW 양극 /// CCWN : CCW 음국 /// CRW : CRW /// ABW : ABW /// public enum eMachineType { RnD, CBW, CBW_TRUMPF_SCANNER, CCWP, CCWN, CRW, ABW }; public enum eLaserType { RnD, TRUMPF, COHERENT }; // 2021-11-18 Wetech Yoon public enum eRTCBoardType { RTC5,RTC6}; public enum ePowerMeterCommType { USB, IP }; //LJB #region 로그 관리 관련 시스템 변수 [Browsable(true)] [ReadOnly(false)] [Category("Log")] [DisplayName("Log Level")] [Description("Definition of the log levle displayed in the log window\nHIGH: All Log\nMIDDLE: Alarm, Error, System, User Login, Communication\nLOW: Alarm, Error, System")] public CoreUnit.Common.LogUnit.eLogLevel LogLevel { get { lock (this) { return (CoreUnit.Common.LogUnit.eLogLevel)m_db.GetSystemRecipeEnumValue("LogLevel", typeof(LogUnit.eLogLevel), LogUnit.eLogLevel.HIGH); } } set { lock (this) { string id = Enum.GetName(typeof(CoreUnit.Common.LogUnit.eLogLevel), value); m_db.SetSystemRecipeValueForID("LogLevel", id); CoreUnit.Common.UtilUnit.logUnit.LogLevel = value; } } } [Browsable(true)] [ReadOnly(false)] [Category("Log")] [DisplayName("Debug Mode")] [Description("Use Debug Mode(Check Memory, Generate debug Log")] public bool EnableDebugMode { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("EnableDebugMode", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("EnableDebugMode", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Log")] [DisplayName("Log Deletion period(days)")] [Description("Set the period to delete logs stored in the database")] public uint LogDeletePeriod { get { lock (this) { return m_db.GetSystemRecipeUintValue("LogDeletePeriod",60); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LogDeletePeriod", value.ToString()); } } } #endregion //OMACS hochul.kim - 칠러 통신 연결 system 변수값 선언 #region Unit 통신 연결 변수 [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("칠러 통신 Port 번호")] [Description("칠러 통신 Port 번호")] public uint ChillerCommPortNo { get { lock (this) { return m_db.GetSystemRecipeUintValue("ChillerCommPortNo",1); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ChillerCommPortNo", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("칠러 통신 Baudrate 값")] [Description("칠러 통신 Baudrate 값")] public uint ChillerCommBaudrate { get { lock (this) { return m_db.GetSystemRecipeUintValue("ChillerCommBaudrate", 9600); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ChillerCommBaudrate", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("칠러 통신 Slave 주소")] [Description("칠러 통신 Slave 주소")] public uint ChillerCommSlaveAddress { get { lock (this) { return m_db.GetSystemRecipeUintValue("ChillerCommSlaveAddress",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ChillerCommSlaveAddress", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("셀트래커 Dll 경로")] [Description("셀트래커 Dll 경로")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string CellTrackerDllDirectory { get { lock (this) { return m_db.GetSystemRecipeStringValue("CellTrackerDllDirectory", ""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellTrackerDllDirectory", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("셀트래커2 Dll 경로")] [Description("셀트래커2 Dll 경로")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string CellTrackerDllDirectory2 { get { lock (this) { return m_db.GetSystemRecipeStringValue("CellTrackerDllDirectory2", ""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellTrackerDllDirectory2", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("셀트래커3 Dll 경로")] [Description("셀트래커3 Dll 경로")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string CellTrackerDllDirectory3 { get { lock (this) { return m_db.GetSystemRecipeStringValue("CellTrackerDllDirectory3", ""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellTrackerDllDirectory3", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("07.Unit 통신 환경 설정")] [DisplayName("셀트래커4 Dll 경로")] [Description("셀트래커4 Dll 경로")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string CellTrackerDllDirectory4 { get { lock (this) { return m_db.GetSystemRecipeStringValue("CellTrackerDllDirectory4", ""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellTrackerDllDirectory4", value); } } } #endregion #region 시스템 변수 [Browsable(true)] [ReadOnly(false)] [TypeConverter(typeof(PointFConverter))] [Category("Camera")] [DisplayName("Offset between scanner and camera(X,Y)")] [Description("Relative position value from the scanner center point to the camera center point")] public PointF ScannerCameraOffsetPos { get { lock (this) { return m_db.GetSystemRecipePointFValue("ScannerCameraOffsetPos", new PointF(0, 0)); } } set { lock (this) { string val = string.Format("{0:F3},{1:F3}", value.X, value.Y); m_db.SetSystemRecipeValueForID("ScannerCameraOffsetPos", val); } } } [Browsable(true)] [ReadOnly(false)] [Category("System Parameter")] [DisplayName("Auto Save")] [Description("Use Auto Save Clicking Welding button")] public bool AutoSave { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("AutoSave",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("AutoSave", value.ToString()); } } } [Browsable(true)] [ReadOnly(true)] [Category("System Parameter")] [DisplayName("Work Recipe File")] [Description("Work Recipe File Name folder namer included")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string WorkRecipeFile { get { lock (this) { return m_db.GetSystemRecipeStringValue("WorkRecipeFile",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("WorkRecipeFile", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("System Parameter")] [DisplayName("Power Calibration Center Beam File")] [Description("Power Calibration Center Beam File")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string PowerCalibrationCenterBeamCSVFile { get { lock (this) { return m_db.GetSystemRecipeStringValue("PowerCalibrationCenterBeamCSVFile",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("PowerCalibrationCenterBeamCSVFile", value); if (PowerCalibrationCenterBeamCSVFile != null && PowerCalibrationRingBeamCSVFile != null) Dao.WeldingLinesRecipe.laserPowerCalibrationParam.Initialize(PowerCalibrationCenterBeamCSVFile, PowerCalibrationRingBeamCSVFile); } } } [Browsable(true)] [ReadOnly(false)] [Category("System Parameter")] [DisplayName("Power Calibration Ring Beam File")] [Description("Power Calibration Ring Beam File")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string PowerCalibrationRingBeamCSVFile { get { lock (this) { return m_db.GetSystemRecipeStringValue("PowerCalibrationRingBeamCSVFile",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("PowerCalibrationRingBeamCSVFile", value); if (PowerCalibrationCenterBeamCSVFile != null && PowerCalibrationRingBeamCSVFile != null) Dao.WeldingLinesRecipe.laserPowerCalibrationParam.Initialize(PowerCalibrationCenterBeamCSVFile, PowerCalibrationRingBeamCSVFile); } } } [Browsable(true)] [ReadOnly(false)] [Category("System Parameter")] [DisplayName("Log On User")] [Description("Log On User")] public string LogOnUserAccount { get { lock (this) { return m_db.GetSystemRecipeStringValue("LogOnUserAccount",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LogOnUserAccount", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("System Parameter")] [DisplayName("Door InterLock Use")] [Description("Door InterLock Use")] public bool DoorInterLockUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("DoorInterLockUse",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("DoorInterLockUse", value.ToString()); } } } [Browsable(true)] //this property should be visible [ReadOnly(false)] //but just read only [Category("System Recipe")]// Category that I want [DisplayName("Machine Type")] // I want to say more, than just DisplayInt [Description("Machine Type")] // sample hint1 public eMachineType MachineType { get { lock (this) { return (eMachineType)m_db.GetSystemRecipeEnumValue("MachineType", typeof(eMachineType), eMachineType.RnD); } } set { lock (this) { string id = Enum.GetName(typeof(eMachineType), value); m_db.SetSystemRecipeValueForID("MachineType", id); } } } // 2021-11-18 Wetech Yoon [Browsable(true)] //this property should be visible [ReadOnly(false)] //but just read only [Category("System Recipe")]// Category that I want [DisplayName("LaserType")] // I want to say more, than just DisplayInt [Description("LaserType")] // sample hint1 public eLaserType LaserType { get { lock (this) { return (eLaserType)m_db.GetSystemRecipeEnumValue("LaserType", typeof(eLaserType), eLaserType.RnD); } } set { lock (this) { string id = Enum.GetName(typeof(eLaserType), value); m_db.SetSystemRecipeValueForID("LaserType", id); } } } [Browsable(true)] //this property should be visible [ReadOnly(false)] //but just read only [Category("System Recipe")]// Category that I want [DisplayName("RTC Board Type")] // I want to say more, than just DisplayInt [Description("RTC Board Type")] // sample hint1 public eRTCBoardType RTCBoardType { get { lock (this) { return (eRTCBoardType)m_db.GetSystemRecipeEnumValue("RTCBoardType", typeof(eRTCBoardType), eRTCBoardType.RTC6); } } set { lock (this) { string id = Enum.GetName(typeof(eRTCBoardType), value); m_db.SetSystemRecipeValueForID("RTCBoardType", id); } } } [Browsable(true)] //this property should be visible [ReadOnly(false)] //but just read only [Category("System Recipe")]// Category that I want [DisplayName("Language Type")] // I want to say more, than just DisplayInt [Description("Language Type")] // sample hint1 public CoreUnit.Common.UtilUnit.eLanguage LanguageType { get { lock (this) { return (CoreUnit.Common.UtilUnit.eLanguage)m_db.GetSystemRecipeEnumValue("LanguageType",typeof(UtilUnit.eLanguage), UtilUnit.eLanguage.Korean); } } set { lock (this) { string id = Enum.GetName(typeof(CoreUnit.Common.UtilUnit.eLanguage), value); m_db.SetSystemRecipeValueForID("LanguageType", id); } } } //LJB PowerMeter 통신 타입 USB, EtherNet/IP [Browsable(true)] //this property should be visible [ReadOnly(false)] //but just read only [Category("System Recipe")]// Category that I want [DisplayName("Power Meter Comm Type")] // I want to say more, than just DisplayInt [Description("Power Meter Comm Type")] // sample hint1 public ePowerMeterCommType PowerMeterCommType { get { lock (this) { return (ePowerMeterCommType)m_db.GetSystemRecipeEnumValue("PowerMeterCommType", typeof(ePowerMeterCommType), ePowerMeterCommType.IP); } } set { lock (this) { string id = Enum.GetName(typeof(ePowerMeterCommType), value); m_db.SetSystemRecipeValueForID("PowerMeterCommType", id); } } } #endregion #region CBW 랩설비 [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("레이저 위치 #1")] [Description("레이저 위치 #1 CBW 모델 초점 위치")] public double LaserPos1 { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("LaserPos1",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LaserPos1", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("레이저 위치 #2")] [Description("레이저 위치 #2 CFW 모델 초점 위치")] public double LaserPos2 { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("LaserPos2",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LaserPos2", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("대기 위치")] [Description("대기 위치")] public double WaitingPos { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("WaitingPos",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("WaitingPos", value); } } } public enum eCbwLabModel { CBW, CFW } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("모델 선택")] [Description("모델 선택 - CBW, CFW")] public eCbwLabModel LabModel { get { lock (this) { return (eCbwLabModel)m_db.GetSystemRecipeEnumValue("LabModel",typeof(eCbwLabModel), eCbwLabModel.CBW); } } set { lock (this) { string id = Enum.GetName(typeof(eCbwLabModel), value); m_db.SetSystemRecipeValueForID("LabModel", id); } } } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("출사 전 질소 시간(msec)")] [Description("출사 전 질소 시간(msec)")] public int N2OnBeforeLaser { get { lock (this) { return m_db.GetSystemRecipeIntValue("N2OnBeforeLaser",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("N2OnBeforeLaser", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("출사 후 질소 시간(msec)")] [Description("출사 후 질소 시간(msec)")] public int N2OffAfterLaser { get { lock (this) { return m_db.GetSystemRecipeIntValue("N2OffAfterLaser", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("N2OffAfterLaser", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("02.CBW 랩설비 모드 설정")] [DisplayName("스테이지 인터락 사용")] [Description("스테이지 인터락 사용")] public bool UseStageInterLock { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("UseStageInterLock", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("UseStageInterLock", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("01.CBW 랩설비")] [DisplayName("질소 사용 여부")] [Description("질소 사용 여부")] public bool UseN2Valve { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("UseN2Valve",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("UseN2Valve", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("02.CBW 랩설비 모드 설정")] [DisplayName("클램프 인터락 사용")] [Description("클램프 인터락 사용")] public bool UseClampInterLock { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("UseClampInterLock", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("UseClampInterLock", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("02.CBW 랩설비 모드 설정")] [DisplayName("집진기 인터락 사용")] [Description("집진기 인터락 사용")] public bool UseDustCollectorInterLock { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("UseDustCollectorInterLock", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("UseDustCollectorInterLock", value); } } } #endregion #region 필드 스캔 작업 [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Scan Field Size")] [Description("Scan Field Size")] [TypeConverter(typeof(System.Drawing.SizeFConverter))] public SizeF ScoutField { get { lock (this) { return m_db.GetSystemRecipeSizeFValue("ScoutField", new SizeF(10, 10)); } } set { lock (this) { string val = UtilUnit.ConvertStringStreamFromList(new List { value.Width, value.Height }); m_db.SetSystemRecipeValueForID("ScoutField", val); } } } [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Scan Field Size(Real)")] [Description("Scan Field Size")] [TypeConverter(typeof(System.Drawing.SizeFConverter))] public SizeF ScoutFieldCal { get { lock (this) { return m_db.GetSystemRecipeSizeFValue("ScoutFieldCal", new SizeF(10, 10)); } } set { lock (this) { string val = UtilUnit.ConvertStringStreamFromList(new List { value.Width, value.Height }); m_db.SetSystemRecipeValueForID("ScoutFieldCal", val); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("Scanner Camera Angle")] [Description("Scanner Camera Angle")] public double ScannerCameraAngle { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("ScannerCameraAngle",0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerCameraAngle", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("Scanner Camera XFlip")] [Description("Scanner Camera XFlip")] public bool ScannerCamerXFlip { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("ScannerCamerXFlip", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerCamerXFlip", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("Scanner Camera YFlip")] [Description("Scanner Camera YFlip")] public bool ScannerCamerYFlip { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("ScannerCamerYFlip", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerCamerYFlip", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("ScannerCameraPixelSize")] [Description("ScannerCameraPixelSize")] public double ScannerCameraPixelSize { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("ScannerCameraPixelSize",4.8); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerCameraPixelSize", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("ScannerCameraLensMagnification")] [Description("ScannerCameraLensMagnification")] public double ScannerCameraLensMagnification { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("ScannerCameraLensMagnification",0.522); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerCameraLensMagnification", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("APACameraPixelSize")] [Description("APACameraPixelSize")] public double APACameraPixelSize { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("APACameraPixelSize",4.8); } } set { lock (this) { m_db.SetSystemRecipeValueForID("APACameraPixelSize", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("APACameraLensMagnification")] [Description("APACameraLensMagnification")] public double APACameraLensMagnification { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("APACameraLensMagnification",0.522); } } set { lock (this) { m_db.SetSystemRecipeValueForID("APACameraLensMagnification", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Exposure Time(ms)")] [Description("Exposure Time(ms) during Scout")] public int ExposureTime { get { lock (this) { return m_db.GetSystemRecipeIntValue("ExposureTime",5000); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ExposureTime", value); } } } #region Canvas 관련 변수 [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 배경 색상")] [Description("Canvas 배경 색상")] public Color CanvasBackgroundColor { get { lock (this) { return m_db.GetSystemRecipeColorValue("CanvasBackgroundColor",Color.Black); } } set { string str = (value.A).ToString() + ',' + (value.R).ToString() + ',' + (value.G).ToString() + ',' + (value.B).ToString(); m_db.SetSystemRecipeValueForID("CanvasBackgroundColor", str.ToString()); } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 필드 색상")] [Description("Canvas 필드 색상")] public Color CanvasFieldColor { get { lock (this) { return m_db.GetSystemRecipeColorValue("CanvasFieldColor", Color.Black); } } set { string str = (value.A).ToString() + ',' + (value.R).ToString() + ',' + (value.G).ToString() + ',' + (value.B).ToString(); m_db.SetSystemRecipeValueForID("CanvasFieldColor", str.ToString()); } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 격자 색상")] [Description("Canvas 격자 색상")] public Color CanvasGridColor { get { lock (this) { return m_db.GetSystemRecipeColorValue("CanvasGridColor", Color.Black); } } set { string str = (value.A).ToString() + ',' + (value.R).ToString() + ',' + (value.G).ToString() + ',' + (value.B).ToString(); m_db.SetSystemRecipeValueForID("CanvasGridColor", str.ToString()); } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 색상 변경 유무")] [Description("Canvas 색상 변경 유무")] public bool EnableCanvasColor { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("EnableCanvasColor",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("EnableCanvasColor", value.ToString()); } } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 격자 유무")] [Description("Canvas 격자 유무")] public bool EnableCanvasGrid { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("EnableCanvasGrid",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("EnableCanvasGrid", value.ToString()); } } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas Grid Space")] [Description("Canvas Grid Space")] public double CanvasGridSpace { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("CanvasGridSpace",10); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CanvasGridSpace", value.ToString()); } } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas Zoom Max")] [Description("Canvas Zoom Max")] public double CanvasZoomMax { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("CanvasZoomMax",10); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CanvasZoomMax", value.ToString()); } } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas Zoom Min")] [Description("Canvas Zoom Min")] public double CanvasZoomMin { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("CanvasZoomMin",0.1); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CanvasZoomMin", value.ToString()); } } } [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas Background Size")] [Description("Canvas Background Size")] public float CanvasBackgroundSize { get { lock (this) { return (float)m_db.GetSystemRecipeDoubleValue("CanvasBackgroundSize", 120.0f); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CanvasBackgroundSize", value.ToString()); } } } //안오산-170223-스캐너 필드 이미지 저장 파일 로딩 기능 추가(V1.7.0) [Browsable(true)] [ReadOnly(false)]//수정 false [Category("Scout")] [DisplayName("Scout Image File")] [Description("Scout Image File")] [EditorAttribute(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string ScannerFieldImageFile { get { lock (this) { return m_db.GetSystemRecipeStringValue("ScannerFieldImageFile",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("ScannerFieldImageFile", value); } } } [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Show Scout Image")] [Description("Show Scout Image")] public bool EnableCanvasFieldImage { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("EnableCanvasFieldImage",true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("EnableCanvasFieldImage", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Canvas Image Resolition Ratio")] [Description("Canvas Image Resolition Ratio")] public double CanvasImageResolutionRatio { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("CanvasImageResolutionRatio",1); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CanvasImageResolutionRatio", value.ToString()); } } } #endregion #endregion #region Muscle Cylinder 관련 [Browsable(false)] [ReadOnly(true)] [Category("MuscleCylinder")] [DisplayName("Muscle Cylinder Set#1")] [Description("Muscle Cylinder Set#1")] public string MuscleCylinderSet1 { get { lock (this) { return m_db.GetSystemRecipeStringValue("MuscleCylinderSet1",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("MuscleCylinderSet1", value); } } } [Browsable(false)] [ReadOnly(true)] [Category("MuscleCylinder")] [DisplayName("Muscle Cylinder Set#2")] [Description("Muscle Cylinder Set#2")] public string MuscleCylinderSet2 { get { lock (this) { return m_db.GetSystemRecipeStringValue("MuscleCylinderSet2",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("MuscleCylinderSet2", value); } } } [Browsable(false)] [ReadOnly(true)] [Category("MuscleCylinder")] [DisplayName("Muscle Cylinder Set#3")] [Description("Muscle Cylinder Set#3")] public string MuscleCylinderSet3 { get { lock (this) { return m_db.GetSystemRecipeStringValue("MuscleCylinderSet3",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("MuscleCylinderSet3", value); } } } [Browsable(false)] [ReadOnly(true)] [Category("MuscleCylinder")] [DisplayName("Muscle Cylinder Set#4")] [Description("Muscle Cylinder Set#4")] public string MuscleCylinderSet4 { get { lock (this) { return m_db.GetSystemRecipeStringValue("MuscleCylinderSet4",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("MuscleCylinderSet4", value); } } } [Browsable(false)] [ReadOnly(true)] [Category("MuscleCylinder")] [DisplayName("Muscle Cylinder DO No")] [Description("Muscle Cylinder DO No")] public string MuscleCylinderDONo { get { lock (this) { return m_db.GetSystemRecipeStringValue("MuscleCylinderDONo",""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("MuscleCylinderDONo", value); } } } #endregion #region PLC 설정 [Browsable(true)] [ReadOnly(false)] [Category("PLC")] [DisplayName("PLC Interlock Use")] [Description("PLC와 Live Bit 통신연결 인터락 적용")] public bool PlcInterlockUse { get { return m_db.GetSystemRecipeBooleanValue("PlcInterlockUse", true); } set { m_db.SetSystemRecipeValueForID("PlcInterlockUse", value.ToString()); } } [Browsable(true)] [ReadOnly(false)] [Category("PLC")] [DisplayName("Shot Them All")] [Description("PLC Command에 상관없이 모든 지그에 용접 시퀀스 수행")] public bool PlcShotThemAll { get { return m_db.GetSystemRecipeBooleanValue("PlcShotThemAll", false); } set { m_db.SetSystemRecipeValueForID("PlcShotThemAll", value.ToString()); } } [Browsable(true)] [ReadOnly(false)] [Category("PLC")] [DisplayName("Position Compensation Use")] [Description("CCW : PLC에서 좌표 Offset을 전달 받아서 용접 좌표에 반영, ABW : Jig 별 Page 설정")] public bool PlcPositionCompensationUse { get { return m_db.GetSystemRecipeBooleanValue("PlcPositionCompensationUse", true); } set { m_db.SetSystemRecipeValueForID("PlcPositionCompensationUse", value.ToString()); } } #endregion #region 생산 관련 [Browsable(true)] [ReadOnly(true)] [Category("Product")] [DisplayName("Today Product Count")] [Description("Product count of today reset at 12 A.M.")] public uint TodayProductCount { get { lock (this) { return m_db.GetSystemRecipeUintValue("TodayProductCount", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("TodayProductCount", value.ToString()); } } } [Browsable(true)] [ReadOnly(true)] [Category("Product")] [DisplayName("Total Product Count")] [Description("Product count of today reset Only by reset button")] public uint TotalProductCount { get { lock (this) { return m_db.GetSystemRecipeUintValue("TotalProductCount", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("TotalProductCount", value.ToString()); } } } [Browsable(true)] [ReadOnly(true)] [Category("Product")] [DisplayName("Product Last Time")] [Description("Time when last Product produced")] public DateTime LastProductTime { get { lock (this) { return m_db.GetSystemRecipeDateTimeValue("LastProductTime", DateTime.MinValue); } } set { lock (this) { string val = UtilUnit.ConvertStringStreamFromDateTimeList(new List { value.Year, value.Month, value.Day, value.Hour, value.Minute, value.Second }); m_db.SetSystemRecipeValueForID("LastProductTime", val.ToString()); } } } #region Laser 관련 [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser Use")] [Description("Laser 사용유무")] public bool LaserUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LaserUse", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LaserUse", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser2 Use")] [Description("Laser2 사용유무")] public bool Laser2Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("Laser2Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("Laser2Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser3 Use")] [Description("Laser3 사용유무")] public bool Laser3Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("Laser3Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("Laser3Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser4 Use")] [Description("Laser4 사용유무")] public bool Laser4Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("Laser4Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("Laser4Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("AutoRun Laser Program No")] [Description("AutoRun Laser Program No")] public int AutoRunLaserProgramNo { get { return m_db.GetSystemRecipeIntValue("AutoRunLaserProgramNo", 0); } set { m_db.SetSystemRecipeValueForID("AutoRunLaserProgramNo", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("DryRun Laser Program No")] [Description("DryRun Laser Program No")] public int DryRunLaserProgramNo { get { return m_db.GetSystemRecipeIntValue("DryRunLaserProgramNo", 1); } set { m_db.SetSystemRecipeValueForID("DryRunLaserProgramNo", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Sync IO Reset Laser Program No")] [Description("Sync IO Reset Laser Program No")] public int SyncIoResetLaserProgramNo { get { return m_db.GetSystemRecipeIntValue("SyncIoResetLaserProgramNo", 9); } set { m_db.SetSystemRecipeValueForID("SyncIoResetLaserProgramNo", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Power Measure Laser Program No")] [Description("Power Measure Laser Program No")] public int PowerMeasureLaserProgramNo { get { return m_db.GetSystemRecipeIntValue("PowerMeasureLaserProgramNo", 2); } set { m_db.SetSystemRecipeValueForID("PowerMeasureLaserProgramNo", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("External Control Mode")] [Description("Control laser power or modulation by external control")] public bool ExternalControlMode { get { return m_db.GetSystemRecipeBooleanValue("ExternalControlMode", false); } set { m_db.SetSystemRecipeValueForID("ExternalControlMode", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser Set Power #1")] [Description("Laser Set Power #1(Watt) when using external control mode. [0~2000W]")] public int LaserSetPower1 { get { return m_db.GetSystemRecipeIntValue("LaserSetPower1", 1000); } set { m_db.SetSystemRecipeValueForID("LaserSetPower1", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser Set Power #2")] [Description("Laser Set Power #2(Watt) when using external control mode. [0~2000W]")] public int LaserSetPower2 { get { return m_db.GetSystemRecipeIntValue("LaserSetPower2", 1000); } set { m_db.SetSystemRecipeValueForID("LaserSetPower2", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser Set Power #3")] [Description("Laser Set Power #3(Watt) when using external control mode. [0~2000W]")] public int LaserSetPower3 { get { return m_db.GetSystemRecipeIntValue("LaserSetPower3", 1000); } set { m_db.SetSystemRecipeValueForID("LaserSetPower3", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Laser Set Power #4")] [Description("Laser Set Power #4(Watt) when using external control mode. [0~2000W]")] public int LaserSetPower4 { get { return m_db.GetSystemRecipeIntValue("LaserSetPower4", 1000); } set { m_db.SetSystemRecipeValueForID("LaserSetPower4", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Power Adjustment Ratio #1")] [Description("Power Adjustment Ratio #1 when using external control mode. [80.0~120.0%]. resolution = 0.1%")] public double PowerAdjustmentRatio1 { get { return m_db.GetSystemRecipeDoubleValue("PowerAdjustmentRatio1", 100.0); } set { m_db.SetSystemRecipeValueForID("PowerAdjustmentRatio1", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Power Adjustment Ratio #2")] [Description("Power Adjustment Ratio #2 when using external control mode. [80.0~120.0%]. resolution = 0.1%")] public double PowerAdjustmentRatio2 { get { return m_db.GetSystemRecipeDoubleValue("PowerAdjustmentRatio2", 100.0); } set { m_db.SetSystemRecipeValueForID("PowerAdjustmentRatio2", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Power Adjustment Ratio #3")] [Description("Power Adjustment Ratio #3 when using external control mode. [80.0~120.0%]. resolution = 0.1%")] public double PowerAdjustmentRatio3 { get { return m_db.GetSystemRecipeDoubleValue("PowerAdjustmentRatio3", 100.0); } set { m_db.SetSystemRecipeValueForID("PowerAdjustmentRatio3", value); } } [Browsable(true)] [ReadOnly(false)] [Category("Laser")] [DisplayName("Power Adjustment Ratio #4")] [Description("Power Adjustment Ratio #4 when using external control mode. [80.0~120.0%]. resolution = 0.1%")] public double PowerAdjustmentRatio4 { get { return m_db.GetSystemRecipeDoubleValue("PowerAdjustmentRatio4", 100.0); } set { m_db.SetSystemRecipeValueForID("PowerAdjustmentRatio4", value); } } #endregion #region LWM 관련 [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM Use")] [Description("LWM 사용유무")] public bool LWMUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWMUse", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWMUse", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM2")] [DisplayName("LWM2 Use")] [Description("LWM2 사용유무")] public bool LWM2Use //LJB { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM2Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM3")] [DisplayName("LWM3 Use")] [Description("LWM3 사용유무")] public bool LWM3Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM3Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM4")] [DisplayName("LWM4 Use")] [Description("LWM4 사용유무")] public bool LWM4Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM4Use", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM Program No")] [Description("LWM Program No (0~31)")] public int LWMProgramNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("LWMProgramNo", 3); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWMProgramNo", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM2")] [DisplayName("LWM2 Program No")] [Description("LWM2 Program No (0~31)")] public int LWM2ProgramNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("LWM2ProgramNo", 3); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2ProgramNo", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM3")] [DisplayName("LWM3 Program No")] [Description("LWM3 Program No (0~31)")] public int LWM3ProgramNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("LWM3ProgramNo", 3); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3ProgramNo", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM4")] [DisplayName("LWM4 Program No")] [Description("LWM4 Program No (0~31)")] public int LWM4ProgramNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("LWM4ProgramNo", 3); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4ProgramNo", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM")] [DisplayName("LWM Inspection OK Product Count")] [Description("LWM Inspection OK Product Count")] public uint LWM_Count_OK { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM_Count_OK", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM_Count_OK", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM2")] [DisplayName("LWM2 Inspection OK Product Count")] [Description("LWM2 Inspection OK Product Count")] public uint LWM2_Count_OK { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM2_Count_OK", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2_Count_OK", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM3")] [DisplayName("LWM3 Inspection OK Product Count")] [Description("LWM3 Inspection OK Product Count")] public uint LWM3_Count_OK { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM3_Count_OK", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3_Count_OK", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM4")] [DisplayName("LWM4 Inspection OK Product Count")] [Description("LWM4 Inspection OK Product Count")] public uint LWM4_Count_OK { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM4_Count_OK", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4_Count_OK", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM")] [DisplayName("LWM Inspection NG Product Count")] [Description("LWM Inspection NG Product Count")] public uint LWM_Count_NG { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM_Count_NG", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM_Count_NG", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM2")] [DisplayName("LWM2 Inspection NG Product Count")] [Description("LWM2 Inspection NG Product Count")] public uint LWM2_Count_NG { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM2_Count_NG", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2_Count_NG", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM3")] [DisplayName("LWM3 Inspection NG Product Count")] [Description("LWM3 Inspection NG Product Count")] public uint LWM3_Count_NG { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM3_Count_NG", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3_Count_NG", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM4")] [DisplayName("LWM4 Inspection NG Product Count")] [Description("LWM4 Inspection NG Product Count")] public uint LWM4_Count_NG { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM4_Count_NG", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4_Count_NG", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM NG Count Limit use")] [Description("LWM NG Count Limit use")] public bool LWM_NG_Count_Limit_Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM_NG_Count_Limit_Use", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM_NG_Count_Limit_Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM2")] [DisplayName("LWM2 NG Count Limit use")] [Description("LWM2 NG Count Limit use")] public bool LWM2_NG_Count_Limit_Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM2_NG_Count_Limit_Use", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2_NG_Count_Limit_Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM3")] [DisplayName("LWM3 NG Count Limit use")] [Description("LWM3 NG Count Limit use")] public bool LWM3_NG_Count_Limit_Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM3_NG_Count_Limit_Use", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3_NG_Count_Limit_Use", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM4")] [DisplayName("LWM4 NG Count Limit use")] [Description("LWM4 NG Count Limit use")] public bool LWM4_NG_Count_Limit_Use { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("LWM4_NG_Count_Limit_Use", true); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4_NG_Count_Limit_Use", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM")] [DisplayName("LWM Current NG Product Count")] [Description("LWM Current NG Product Count")] public uint LWM_Current_NG_Count { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM_Current_NG_Count", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM_Current_NG_Count", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM2")] [DisplayName("LWM2 Current NG Product Count")] [Description("LWM2 Current NG Product Count")] public uint LWM2_Current_NG_Count { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM2_Current_NG_Count", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM2_Current_NG_Count", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM3")] [DisplayName("LWM3 Current NG Product Count")] [Description("LWM3 Current NG Product Count")] public uint LWM3_Current_NG_Count { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM3_Current_NG_Count", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM3_Current_NG_Count", value.ToString()); } } } [Browsable(false)] [ReadOnly(true)] [Category("LWM4")] [DisplayName("LWM4 Current NG Product Count")] [Description("LWM4 Current NG Product Count")] public uint LWM4_Current_NG_Count { get { lock (this) { return m_db.GetSystemRecipeUintValue("LWM4_Current_NG_Count", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LWM4_Current_NG_Count", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM Connection Alarm Use")] [Description("LWM Connection Alarm 사용 유무")] public bool LWM_Connect_Alarm_Use { get { return m_db.GetSystemRecipeBooleanValue("LWM_Connect_Alarm_Use", true); } set { m_db.SetSystemRecipeValueForID("LWM_Connect_Alarm_Use", value.ToString()); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM NG Count Limit")] [Description("LWM NG Count Limit (10 ~ 1000)")] public uint LWM_NG_Count_Limit { get { return m_db.GetSystemRecipeUintValue("LWM_NG_Count_Limit", 100); } set { m_db.SetSystemRecipeValueForID("LWM_NG_Count_Limit", value.ToString()); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM1 data source folder")] [Description("LWM1 data source folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM1_DataSrcFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM1_DataSrcFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM1_DataSrcFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM2")] [DisplayName("LWM2 data source folder")] [Description("LWM2 data source folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM2_DataSrcFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM2_DataSrcFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM2_DataSrcFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM3")] [DisplayName("LWM3 data source folder")] [Description("LWM3 data source folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM3_DataSrcFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM3_DataSrcFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM3_DataSrcFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM4")] [DisplayName("LWM4 data source folder")] [Description("LWM4 data source folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM4_DataSrcFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM4_DataSrcFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM4_DataSrcFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM1 data destination folder")] [Description("LWM1 data destination folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM1_DataDstFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM1_DataDstFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM1_DataDstFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM2")] [DisplayName("LWM2 data destination folder")] [Description("LWM2 data destination folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM2_DataDstFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM2_DataDstFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM2_DataDstFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM3")] [DisplayName("LWM3 data destination folder")] [Description("LWM3 data destination folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM3_DataDstFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM3_DataDstFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM3_DataDstFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM4")] [DisplayName("LWM4 data destination folder")] [Description("LWM4 data destination folder")] [Editor(typeof(System.Windows.Forms.Design.FileNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM4_DataDstFolderPath { get { return m_db.GetSystemRecipeStringValue("LWM4_DataDstFolderPath", ""); } set { m_db.SetSystemRecipeValueForID("LWM4_DataDstFolderPath", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM data server upload folder")] [Description("LWM data server upload folder")] [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))] public string LWM_DataServerUploadFolder { get { return m_db.GetSystemRecipeStringValue("LWM_DataServerUploadFolder", ""); } set { m_db.SetSystemRecipeValueForID("LWM_DataServerUploadFolder", value); } } [Browsable(true)] [ReadOnly(false)] [Category("LWM")] [DisplayName("LWM data delete period(day)")] [Description("LWM data delete period(day)")] public int LWM_LogDeletePeriod { get { return m_db.GetSystemRecipeIntValue("LWM_LogDeletePeriod", 30); } set { m_db.SetSystemRecipeValueForID("LWM_LogDeletePeriod", value.ToString()); } } #endregion [Browsable(true)] [ReadOnly(false)] [Category("Distance Sensor")] [DisplayName("Distance Sensor Use")] [Description("변위센서 읽기기능 사용유무")] public bool DistanceSensorUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("DistanceSensorUse", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("DistanceSensorUse", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Distance Sensor")] [DisplayName("Distance Sensor Result Use")] [Description("변위센서 검사기능 사용유무")] public bool DistanceSensorResultUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("DistanceSensorResultUse", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("DistanceSensorResultUse", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Distance Sensor")] [DisplayName("Distance Sensor Range")] [Description("변위센서 허용오차 (0 ~ 3mm)")] public double DistanceSensorRange { get { lock (this) { return m_db.GetSystemRecipeDoubleValue("DistanceSensorRange", 3.0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("DistanceSensorRange", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Scanner")] [DisplayName("RTC Output Pulse Count NG Count")] [Description("RTC Output Pulse Count NG Count")] public uint RtcOutputPulseCountNGCount { get { lock (this) { return m_db.GetSystemRecipeUintValue("RTC_Output_Pulse_Count_NG_Count", 0); } } set { lock (this) { m_db.SetSystemRecipeValueForID("RTC_Output_Pulse_Count_NG_Count", value.ToString()); } } } [Browsable(true)] [ReadOnly(true)] [Category("Cell Tracker")] [DisplayName("Last Cell ID")] [Description("Last Cell ID")] public string Last_CellID { get { lock (this) { return m_db.GetSystemRecipeStringValue("Last_CellID", ""); } } set { lock (this) { m_db.SetSystemRecipeValueForID("Last_CellID", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("CRW Same Cell ID Interlock Use")] [Description("CRW Same Cell ID Interlock Use")] public bool SameCellIDInterlockUse { get { lock (this) { return m_db.GetSystemRecipeBooleanValue("SameCellIDInterlockUse", false); } } set { lock (this) { m_db.SetSystemRecipeValueForID("SameCellIDInterlockUse", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("Cell ID Start No")] [Description("Cell ID Start No")] public int CellIdStartNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("CellIdStartNo", 42); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellIdStartNo", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("Cell ID Length")] [Description("Cell ID Length")] public int CellIdLength { get { lock (this) { return m_db.GetSystemRecipeIntValue("CellIdLength", 36); } } set { lock (this) { m_db.SetSystemRecipeValueForID("CellIdLength", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("Lot ID Start No")] [Description("Lot ID Start No")] public int LotIdStartNo { get { lock (this) { return m_db.GetSystemRecipeIntValue("LotIdStartNo", 78); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LotIdStartNo", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("Lot ID Length")] [Description("Lot ID Length")] public int LotIdLength { get { lock (this) { return m_db.GetSystemRecipeIntValue("LotIdLength", 12); } } set { lock (this) { m_db.SetSystemRecipeValueForID("LotIdLength", value.ToString()); } } } [Browsable(true)] [ReadOnly(false)] [Category("Cell Tracker")] [DisplayName("Cell ID Receive Method")] [Description("Cell ID Receive Method [0:Queue, 1:Callback]")] public int CellIdReceiveMethod { get { return m_db.GetSystemRecipeIntValue("CellIdReceiveMethod", 0); } set { m_db.SetSystemRecipeValueForID("CellIdReceiveMethod", value.ToString()); } } #endregion public RecipeSystem(Dao db) { m_db = db; } #region 사용자 정의 함수 public void Initialize() { #region 변수가 데이터베이스에 있는지 확인하고 없으면 추가 #endregion //로그 레벨 설정(CoreUnit.Common.UtilUnit에 값 설정) CoreUnit.Common.UtilUnit.logUnit.LogLevel = LogLevel; if (MachineType == eMachineType.RnD) { SetBrowsableProperty("DoorInterLockUse", true); SetBrowsableProperty("APACameraLensMagnification", true); SetBrowsableProperty("APACameraPixelSize", true); SetBrowsableProperty("PowerCalibrationRingBeamCSVFile", true); } else if (MachineType == eMachineType.CBW) { SetBrowsableProperty("DoorInterLockUse", false); SetBrowsableProperty("APACameraLensMagnification", false); SetBrowsableProperty("APACameraPixelSize", false); SetBrowsableProperty("PowerCalibrationRingBeamCSVFile", false); } else if (MachineType == eMachineType.CBW_TRUMPF_SCANNER) { SetBrowsableProperty("DoorInterLockUse", false); SetBrowsableProperty("APACameraLensMagnification", false); SetBrowsableProperty("APACameraPixelSize", false); SetBrowsableProperty("PowerCalibrationRingBeamCSVFile", false); } if (MachineType != eMachineType.CCWP && MachineType != eMachineType.CCWN)//LJB AWB만 숨겼던것 CCW타입이 아닐때 숨기도록 { SetBrowsableProperty("Laser2Use", false); SetBrowsableProperty("Laser3Use", false); SetBrowsableProperty("Laser4Use", false); SetBrowsableProperty("AutoRunLaserProgramNo", false); SetBrowsableProperty("DryRunLaserProgramNo", false); SetBrowsableProperty("SyncIoResetLaserProgramNo", false); SetBrowsableProperty("PowerMeasureLaserProgramNo", false); SetBrowsableProperty("ExternalControlMode", false); SetBrowsableProperty("LaserSetPower1", false); SetBrowsableProperty("LaserSetPower2", false); SetBrowsableProperty("LaserSetPower3", false); SetBrowsableProperty("LaserSetPower4", false); SetBrowsableProperty("PowerAdjustmentRatio1", false); SetBrowsableProperty("PowerAdjustmentRatio2", false); SetBrowsableProperty("PowerAdjustmentRatio3", false); SetBrowsableProperty("PowerAdjustmentRatio4", false); SetBrowsableProperty("CellTrackerDllDirectory2", false); SetBrowsableProperty("CellTrackerDllDirectory3", false); SetBrowsableProperty("CellTrackerDllDirectory4", false); SetBrowsableProperty("LWM2Use", false); SetBrowsableProperty("LWM2ProgramNo", false); SetBrowsableProperty("LWM2_Count_OK", false); SetBrowsableProperty("LWM2_Count_NG", false); SetBrowsableProperty("LWM2_NG_Count_Limit_Use", false); SetBrowsableProperty("LWM2_Current_NG_Count", false); SetBrowsableProperty("LWM2_DataSrcFolderPath", false); SetBrowsableProperty("LWM2_DataDstFolderPath", false); SetBrowsableProperty("LWM3Use", false); SetBrowsableProperty("LWM3ProgramNo", false); SetBrowsableProperty("LWM3_Count_OK", false); SetBrowsableProperty("LWM3_Count_NG", false); SetBrowsableProperty("LWM3_NG_Count_Limit_Use", false); SetBrowsableProperty("LWM3_Current_NG_Count", false); SetBrowsableProperty("LWM3_DataSrcFolderPath", false); SetBrowsableProperty("LWM3_DataDstFolderPath", false); SetBrowsableProperty("LWM4Use", false); SetBrowsableProperty("LWM4ProgramNo", false); SetBrowsableProperty("LWM4_Count_OK", false); SetBrowsableProperty("LWM4_Count_NG", false); SetBrowsableProperty("LWM4_NG_Count_Limit_Use", false); SetBrowsableProperty("LWM4_Current_NG_Count", false); SetBrowsableProperty("LWM4_DataSrcFolderPath", false); SetBrowsableProperty("LWM4_DataDstFolderPath", false); } } #endregion #region PropertyGrid 관련 함수 /// /// Set the Browsable property. /// NOTE: Be sure to decorate the property with [Browsable(true)] /// /// Name of the variable /// Browsable Value private void SetBrowsableProperty(string strPropertyName, bool bIsBrowsable) { // Get the Descriptor's Properties PropertyDescriptor theDescriptor = TypeDescriptor.GetProperties(this.GetType())[strPropertyName]; // Get the Descriptor's "Browsable" Attribute BrowsableAttribute theDescriptorBrowsableAttribute = (BrowsableAttribute)theDescriptor.Attributes[typeof(BrowsableAttribute)]; FieldInfo isBrowsable = theDescriptorBrowsableAttribute.GetType().GetField("Browsable", BindingFlags.IgnoreCase | BindingFlags.NonPublic | BindingFlags.Instance); // Set the Descriptor's "Browsable" Attribute isBrowsable.SetValue(theDescriptorBrowsableAttribute, bIsBrowsable); } #endregion } public class RecipeModelList { public class ModelListParam { int m_modelNo; [XmlSerializable] public int ModelNo { get { return m_modelNo; } set { m_modelNo = value; } } string m_modelName; [XmlSerializable] public string ModelName { get { return m_modelName; } set { m_modelName = value; } } string m_modelFileName; [XmlSerializable] public string ModelFileName { get { return m_modelFileName; } set { m_modelFileName = value; } } double m_modelLaserFocusPos; [XmlSerializable] public double ModelLaserFocusPos { get { return m_modelLaserFocusPos; } set { m_modelLaserFocusPos = value; } } double m_modelWaitingPos; [XmlSerializable] public double ModelWaitingPos { get { return m_modelWaitingPos; } set { m_modelWaitingPos = value; } } public ModelListParam() { m_modelNo = 0; m_modelName = null; m_modelFileName = null; m_modelLaserFocusPos = 0; m_modelWaitingPos = 0; } } List m_modelListParam = new List(); public List ModelListParams { get { lock (this) { return m_modelListParam; } } set { lock (this) { m_modelListParam = value; } } } public void Reset() { } public void Load(string fileName) { try { StreamReader sr = new StreamReader(fileName); XmlDocument doc = new XmlDocument(); doc.Load(sr); sr.Dispose(); XmlElement root = doc.DocumentElement; foreach (XmlElement node in root.ChildNodes) { if (node.Name == "property") { XmlUtil.ParseProperty(node, this); } if (node.Name == "items") { ModelListParams.Clear(); foreach (XmlElement itemNode in node.ChildNodes) { Object param = new ModelListParam(); XmlUtil.ParseProperties(itemNode, param); ModelListParams.Add((ModelListParam)param); } } } } catch (Exception ex) { throw ex; } } public void Load() { FileInfo fi = new FileInfo(Properties.Settings.Default.ModelListParamFile); if (fi.Exists) { Load(Properties.Settings.Default.ModelListParamFile); } else { Save(); Load(Properties.Settings.Default.ModelListParamFile); } } public void Save() { Save(Properties.Settings.Default.ModelListParamFile); } public void Save(string fileName) { try { XmlTextWriter wr = new XmlTextWriter(fileName, null); wr.Formatting = Formatting.Indented; wr.WriteStartElement("RecipeModelList");//1.레시피 항목 wr.WriteStartElement("items"); //2.Items 항목 foreach (ModelListParam param in ModelListParams) { wr.WriteStartElement("ModelList");//3.ModelListParam 항목 XmlUtil.WriteProperties(param, wr); wr.WriteEndElement();//3.ModelListParam 항목 } wr.WriteEndElement();//2.Items 항목 wr.WriteEndElement();//1.레시피 항목 wr.Close(); } catch (Exception ex) { throw ex; } } public string[] SortModelListsToStringArray() { string[] totalStr = new string[ModelListParams.Count]; string subStr = null; for (int i = 0; i < ModelListParams.Count; i++) { subStr = ModelListParams[i].ModelNo + "." + ModelListParams[i].ModelName; totalStr[i] = subStr; } return totalStr; } } }