소스 검색

增加事件参数

@wang_qi0307 5 년 전
부모
커밋
6ad2225dc1
3개의 변경된 파일282개의 추가작업 그리고 7개의 파일을 삭제
  1. 0 5
      HOZProject/FormUnitControl.cs
  2. 272 0
      MeasureThread/Measure.cs
  3. 10 2
      WebManager/WebResult.cs

+ 0 - 5
HOZProject/FormUnitControl.cs

@@ -43,11 +43,6 @@ namespace HOZProject
         String[] sT;
         String[] firms;
         Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
-
-        int pw = 0;
-        int ph = 0;
-        int lw = 0;
-        int lh = 0;
         #endregion
 
         #region 构造函数

+ 272 - 0
MeasureThread/Measure.cs

@@ -43,11 +43,283 @@ namespace MeasureThread
         }
         private DateTime m_time;
 
+        public int Step_Code
+        {
+            get { return step_Code; }
+            set { step_Code = value; }
+        }
+        private int step_Code;
+
+        //图片信息
+        public class PictureInformation
+        {
+            public Boolean Is_Picture
+            {
+                get { return is_Picture; }
+                set { is_Picture = value; }
+            }
+            private Boolean is_Picture;
+
+            public String Picture_FullPath
+            {
+                get { return picture_FullPath; }
+                set { picture_FullPath = value; }
+            }
+            private String picture_FullPath;
+
+            public double Work_Voltage
+            {
+                get { return work_Voltage; }
+                set { work_Voltage = value; }
+            }
+            private double work_Voltage;
+
+            public double Magnification
+            {
+                get { return magnification; }
+                set { magnification = value; }
+            }
+            private double magnification;
+
+            public double Work_Distance
+            {
+                get { return work_Distance; }
+                set { work_Distance = value; }
+            }
+            private double work_Distance;
+
+            public String Work_Status
+            {
+                get { return work_Status; }
+                set { work_Status = value; }
+            }
+            private String work_Status;
+        }
+        //图片信息实例类
+        public PictureInformation Picture_Information
+        {
+            get { return picture_Information; }
+            set { picture_Information = value; }
+        }
+        private PictureInformation picture_Information;
+
+        //图像信息
+        public class ImageInformation
+        {
+            public int Method_Name
+            {
+                get { return method_Name; }
+                set { method_Name = value; }
+            }
+            private int method_Name;
+
+            public Source_Img_Degree_Direction SIDD;
+            public Cut_Position CP;
+            public Cut_Success CS;
+            public Trapezoid_Top_Center_Position TTCP;
+            public Auto_Foucs AF;
+            public Auto_Stigmatic AS;
+            public Center_Position_OffsetAngle_Direction CPOD;
+            public Measure_Size MS;
+
+            public ImageInformation()
+            {
+                SIDD = new Source_Img_Degree_Direction();
+                CP = new Cut_Position();
+                CS = new Cut_Success();
+                TTCP = new Trapezoid_Top_Center_Position();
+                AF = new Auto_Foucs();
+                AS = new Auto_Stigmatic();
+                CPOD = new Center_Position_OffsetAngle_Direction();
+                MS = new Measure_Size();
+            }
+
+            //1-计算原始图像偏移角度及方向
+            public class Source_Img_Degree_Direction
+            {
+                public Boolean Is_Image = false;
+
+                public double Degree
+                {
+                    get { return degree; }
+                    set { degree = value; }
+                }
+                private double degree;
+
+                public int Direction
+                {
+                    get { return direction; }
+                    set { direction = value; }
+                }
+                private int direction;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+            }
+
+            //2-计算切割点位置
+            public class Cut_Position
+            {
+                public Boolean Is_Image = false;
+
+                public double Offsetx
+                {
+                    get { return offsetx; }
+                    set { offsetx = value; }
+                }
+                private double offsetx;
+
+                public double Offsety
+                {
+                    get { return offsety; }
+                    set { offsety = value; }
+                }
+                private double offsety;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+            }
+
+            //3-是否切割成功
+            public class Cut_Success
+            {
+                public Boolean Is_Image = false;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+
+            }
+
+            //4-计算切割后图像梯形区域上边中心点坐标
+            public class Trapezoid_Top_Center_Position
+            {
+                public Boolean Is_Image = false;
+
+                public double TopCenterX
+                {
+                    get { return topCenterX; }
+                    set { topCenterX = value; }
+                }
+                private double topCenterX;
+
+                public double TopCenterY
+                {
+                    get { return topCenterY; }
+                    set { topCenterY = value; }
+                }
+                private double topCenterY;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+            }
+
+            //5-自动对焦
+            public class Auto_Foucs
+            {
+                public Boolean Is_Image = true;
+
+                public String Img_Path
+                {
+                    get { return img_Path; }
+                    set { img_Path = value; }
+                }
+                private String img_Path;
+            }
+
+            //6-自动像闪
+            public class Auto_Stigmatic
+            {
+                public Boolean Is_Image = true;
+
+                public String Img_Path
+                {
+                    get { return img_Path; }
+                    set { img_Path = value; }
+                }
+                private String img_Path;
+            }
+
+            //7-计算切割面区域中心坐标,以及偏移角度及方向
+            public class Center_Position_OffsetAngle_Direction
+            {
+                public Boolean Is_Image = false; 
+
+                public double CenterX
+                {
+                    get { return centerX; }
+                    set { centerX = value; }
+                }
+                private double centerX;
+
+                public double CenterY
+                {
+                    get { return centerY; }
+                    set { centerY = value; }
+                }
+                private double centerY;
+
+                public double Degree
+                {
+                    get { return degree; }
+                    set { degree = value; }
+                }
+                private double degree;
+
+                public int Direction
+                {
+                    get { return direction; }
+                    set { direction = value; }
+                }
+                private int direction;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+            }
+
+            //8-测量尺寸
+            public class Measure_Size
+            {
+                public Boolean Is_Image = false;
+
+                public int State
+                {
+                    get { return state; }
+                    set { state = value; }
+                }
+                private int state;
+            }
+        }
+
         public ThreadStatusEventArgs(string a_State)
         {
             this.m_state = a_State;
+            picture_Information = new PictureInformation();
         }
     }
+
+
+
+
     public class CutHolesStatusEventArgs
     {
         public string State

+ 10 - 2
WebManager/WebResult.cs

@@ -91,6 +91,8 @@ namespace WebManager
         /// 计算原始图像偏移角度及方向
         /// </summary>
         /// <param name="imagePath">图片路径</param>
+        /// <param name="imageType">孔类型</param>
+        /// <param name="firm">厂家类型</param>
         /// <returns>json字符串</returns>
         public void Img_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double degree, out int direction, out int state)
         {
@@ -122,13 +124,17 @@ namespace WebManager
         /// 计算切割点位置
         /// </summary>
         /// <param name="imagePath">图片路径</param>
+        /// <param name="imageType">孔类型</param>
+        /// <param name="firm">厂家类型</param>
         /// <returns>json字符串</returns>
-        public void Img_Cut_Position(String imagePath, out double offsetx, out double offsety, out int state)
+        public void Img_Cut_Position(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out int state)
         {
             this.webServer_Path = "test2";
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
+            json.Add("img_type", imageType);
+            json.Add("firm", firm);
             String res = RequestString(JsonConvert.SerializeObject(json));
             JObject jret = (JObject)JsonConvert.DeserializeObject(res);
             if (jret != null && jret.Property("img_name") != null && jret.Property("img_name").ToString() != "")
@@ -258,12 +264,14 @@ namespace WebManager
         /// </summary>
         /// <param name="imagePath">图片路径</param>
         /// <returns>json字符串</returns>
-        public void Img_Center_Position_OffsetAngle_Direction(String imagePath, out double offsetx, out double offsety, out double degree, out int direction, out int state)
+        public void Img_Center_Position_OffsetAngle_Direction(String imagePath, int imageType, String firm, out double offsetx, out double offsety, out double degree, out int direction, out int state)
         {
             this.webServer_Path = "test7";
             Update_Url();
             JObject json = new JObject();
             json.Add("img_path", imagePath);
+            json.Add("img_type", imageType);
+            json.Add("firm", firm);
             String res = RequestString(JsonConvert.SerializeObject(json));
             JObject jret = (JObject)JsonConvert.DeserializeObject(res);
             if (jret != null && jret.Property("img_name") != null && jret.Property("img_name").ToString() != "")