using Aurora.Api; using CoreUnit.Common; using PropertyTools.DataAnnotations; using System; using System.Drawing; namespace WeldingCommon.Settings { public enum eSequenceType { Noraml, RCC, CellCenterOffset }; public enum eScoutType { Normal, FlyingVision } public enum eLaserType { RnD, IPG }; public enum eRTCBoardType { RTC5, RTC6 }; public enum eOffsetType { manual, CSV}; public enum eObjectGenType { ArcByAngle, FitArcsAndLines }; public class SystemParamPath { public const string SCANNER_FIELD_IMAGE_FILE_PATH = "D:\\ILSOSConfig\\ILSOS_PrismaticScanner\\_vision\\FieldScanImage\\Default\\DefaultFieldScanImage.Jpeg"; public const string WORK_RECIPE_FILE = "D:\\ILSOSConfig\\ILSOS_PrismaticScanner\\_config_recipe\\recipe#1\\TeachingEditor.json"; public const string CELL_HISTORY_FOLDER = "D:\\ILSOSConfig\\CellHistory"; public const string RECIPE_HISTORY_FOLDER = "D:\\ILSOSConfig\\RecipeHistory"; public const string RESOURCE_FOLDER = "D:\\ILSOSConfig\\ILSOS_PrismaticGun\\External\\Resource"; } public class SystemParameter : ISettingItem { //Browable False 항목은 ILSOS에서 필요없으나 LASA MainPage 로드를 위해 선언해둠.. 정리가 필요할 듯 [Browsable(false)] [ReadOnly(false)] [Category("Log")] [DisplayName("LogLevel")] public LogUnit.eLogLevel LogLevel { get; set; } = LogUnit.eLogLevel.HIGH; //Product Category는 양산 시 필요하면 Broawsable True로 설정함. [Browsable(true)] [ReadOnly(true)] [Category("Product")] [DisplayName("TotalProductCount")] public uint TotalProductCount { get; set; } = 0; [Browsable(true)] [ReadOnly(true)] [Category("Product")] [DisplayName("TodayProductCount")] public uint TodayProductCount { get; set; } = 0; [Browsable(false)] [ReadOnly(true)] [Category("Product")] [DisplayName("LastProductTime")] public DateTime LastProductTime { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("System")] [DisplayName("SequenceType")] public eSequenceType SequenceType { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("System")] [DisplayName("ScoutType")] public eScoutType ScoutType { get; set; } [Browsable(false)] [ReadOnly(false)] [Category("System")] [DisplayName("RTCBoardType")] public eRTCBoardType RTCBoardType { get; set; } [Browsable(false)] [ReadOnly(false)] [Category("System")] [DisplayName("LaserType")] public eLaserType LaserType { get; set; } [InputFilePath] [Browsable(true)] [ReadOnly(false)] [Category("System")] [DisplayName("WorkRecipeFile")] public string WorkRecipeFile { get; set; } = SystemParamPath.WORK_RECIPE_FILE; //LanguageType은 ILSOS의 언어 설정을 사용해야하나.. LASA 윈폼은 아래 LanguageType을 사용해서 변경해야할것으로 보임 [Browsable(false)] [ReadOnly(false)] [Category("System")] [DisplayName("LanguageType(Teaching)")] public UtilUnit.eLanguage LanguageType { get; set; } = UtilUnit.eLanguage.English; [Browsable(false)] [ReadOnly(false)] [Category("System")] [DisplayName("LogOnUserAccount")] public string LogOnUserAccount { get; set; } = "PRI"; [Browsable(false)] [ReadOnly(false)] [Category("Scout")] [DisplayName("CanvasBackgroundSize")] public double CanvasBackgroundSize { get; set; } = 120.0; [Browsable(false)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Canvas Image Resolution Ratio")] public double CanvasImageResolutionRatio { get; set; } = 1; [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("Scan Field Size(Init)")] public ILSOSSizeF ScoutField { get; set; } = new ILSOSSizeF(50.0f, 50.0f); [Browsable(false)] [ReadOnly(true)] [Category("Scout")] [DisplayName("Scan Field Size(Real)")] public ILSOSSizeF ScoutFieldCal { get; set; } = new ILSOSSizeF(50.0f, 50.0f); [Browsable(false)] [ReadOnly(false)] [Category("Scout")] [DisplayName("EnableCanvasFieldImage")] public bool EnableCanvasFieldImage { get; set; } = true; [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [InputFilePath] [DisplayName("ScoutImage File")] public string ScannerFieldImageFile { get; set; } = SystemParamPath.SCANNER_FIELD_IMAGE_FILE_PATH; [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("ScoutJumpSpeed")] public double FieldScanJumpSpeed { get; set; } = 4000; [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("ScoutJumpDelay")] public uint ScoutJumpDelay { get; set; } = 500; [Browsable(true)] [ReadOnly(false)] [Category("Scout")] [DisplayName("CameraExposureDelay")] public uint CameraExposureDelay { get; set; } = 5; //msec [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVThreshold")] public double CVThreshold { get; set; } = 37; [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("OffsetType")] public eOffsetType OffsetType { get; set; } = eOffsetType.manual; [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVShrinkPixel(1)")] public int CVShrinkPixel { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVShrinkPixel(2)")] public int CVShrinkPixel2 { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVShrinkPixel(3)")] public int CVShrinkPixel3 { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVShrinkPixel(4)")] public int CVShrinkPixel4 { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [InputFilePath] [DisplayName("OffsetCSVFile")] public string OffsetCSVFile { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("Radius")] public double Radius { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("Margin")] public int Margin { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("PointNum")] public int PointNum { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("DetectPointPercent")] public double DetectPointPercent { get; set; } [Browsable(false)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVMorpIterations")] public int CVMorpIterations { get; set; } = 23; [Browsable(false)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("CVMorpMaskSize")] public int CVMorpMaskSize { get; set; } = 5; // ----------- RCC Offset용 Reference Paramter ---------------- //pixel [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("Reference X")] public int ReferenceX { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("Reference Y")] public int ReferenceY { get; set; } //radian [Browsable(true)] [ReadOnly(false)] [Category("RCC Edge Parameter")] [DisplayName("Reference Theta")] public double ReferenceTh { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("ObjectGenType")] public eObjectGenType ObjectGenType { get; set; } [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("ObjectNumber")] public int ObjectNumber { get; set; } = 10; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("MergeDist")] public double dMergeDist { get; set; } = 10; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("MaxArcRadius")] public uint nMaxArcRadius { get; set; } = 1000; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("LineTolerance")] public uint nLineTolerance { get; set; } = 10; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("ArcTolerance")] public uint nArcTolerance { get; set; } = 10; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("LineDefualtWidth")] public float fLineDefualtWidth { get; set; } = 10; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawingImageCenterOffsetX")] public double DrawingImageCenterOffsetX { get; set; } = 0; [Browsable(false)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawingImageCenterOffsetY")] public double DrawingImageCenterOffsetY { get; set; } = 0; [Browsable(false)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("CVInnerCircleSize")] public double CVInnerCircleSize { get; set; } = 21; [Browsable(false)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("CVOuterCircleSize")] public double CVOuterCircleSize { get; set; } = 25; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawObjectDistanceMin")] public double DrawObjectDistanceMin { get; set; } = 21; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawObjectDistanceMax")] public double DrawObjectDistanceMax { get; set; } = 25; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawObjectDistanceRange")] public double DrawObjectDistanceRange { get; set; } = 0.5; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawObjectLengthSumDiffRange")] public double DrawObjectLengthSumDiffRange { get; set; } = 3.0; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("DrawObjectArcLengthMax")] public double DrawObjectArcLengthMax { get; set; } = 40; [Browsable(true)] [ReadOnly(false)] [Category("RCC GenObject Parameter")] [DisplayName("CenterXYDiffRange")] public double DrawObjectCenterXYDiffRange { get; set; } = 0.5; [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("CameraPixelSize")] public double CameraPixelSize { get; set; } = 6.9; [Browsable(true)] [ReadOnly(false)] [Category("Camera")] [DisplayName("LensMagnification")] public double LensMagnification { get; set; } = 0.3461; [Browsable(false)] [ReadOnly(false)] [Category("Calibration")] [InputFilePath] [DisplayName("PowerCalibrationCenterBeamCSVFile")] public string PowerCalibrationCenterBeamCSVFile { get; set; } = " "; [Browsable(false)] [ReadOnly(false)] [Category("Calibration")] [InputFilePath] [DisplayName("PowerCalibrationCenterBeamCSVFile")] public string PowerCalibrationRingBeamCSVFile { get; set; } = " "; [Browsable(true)] [ReadOnly(false)] [Category("Weld")] [DisplayName("WeldLinesTaskTimeOut[sec]")] public int WeldLinesTaskTimeOut { get; set; } = 120; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasBackgroundColor")] public Color CanvasBackgroundColor { get; set; } = Color.White; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasFieldColor")] public Color CanvasFieldColor { get; set; } = Color.Gray; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasGridColor")] public Color CanvasGridColor { get; set; } = Color.White; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasGridSpace")] public double CanvasGridSpace { get; set; } = 10; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasZoomMin")] public double CanvasZoomMin { get; set; } = 0.1; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("CanvasZoomMax")] public double CanvasZoomMax { get; set; } = 10; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("Canvas 격자 유무")] public bool EnableCanvasGrid { get; set; } = true; [Browsable(false)] [ReadOnly(false)] [Category("Canvas")] [DisplayName("EnableCanvasColor")] public bool EnableCanvasColor { get; set; } = true; [Browsable(true)] [ReadOnly(true)] [Category("LBAD")] [DisplayName("LBAD_Count_OK")] public uint LBAD_Count_OK { get; set; } = 0; [Browsable(true)] [ReadOnly(true)] [Category("LBAD")] [DisplayName("LBAD_Count_NG")] public uint LBAD_Count_NG { get; set; } = 0; [Browsable(true)] [ReadOnly(false)] [Category("CellPosMeasure")] [DisplayName("CellCenterOffsetX")] public double CellPosMeasureCenterOffsetX { get; set; } = 0; [Browsable(true)] [ReadOnly(false)] [Category("CellPosMeasure")] [DisplayName("CellCenterOffsetY")] public double CellPosMeasureCenterOffsetY { get; set; } = 0; [Category("Transfer")] [ReadOnly(false)] [DisplayName("ByPassMode")] public bool ByPassMode { get; set; } = false; [Browsable(true)] [ReadOnly(false)] [Category("Cell History")] [InputFilePath] [DisplayName("Cell History Folder Path")] public string CellHistoryFolderPath { get; set; } = SystemParamPath.CELL_HISTORY_FOLDER; [Browsable(true)] [ReadOnly(false)] [Category("Recipe Change History")] [InputFilePath] [DisplayName("Recipe Change History Folder Path")] public string RecipeHistoryFolderPath { get; set; } = SystemParamPath.RECIPE_HISTORY_FOLDER; [Browsable(true)] [ReadOnly(false)] [Category("Resource")] [InputFilePath] [DisplayName("Resource Folder Path")] public string ResourceFolderPath { get; set; } = SystemParamPath.RESOURCE_FOLDER; } public class ILSOSSizeF { private float width; private float height; public ILSOSSizeF(float width, float height) { this.Width = width; this.Height = height; } public float Width { get { return width; } set { width = value; } } public float Height { get { return height; } set { height = value; } } } }