Browse Source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 year ago
parent
commit
40f12362ad

+ 3 - 4
OTSPartA_STDEditor/OTSPartA_STDEditor.csproj

@@ -198,16 +198,15 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Drawing" />
-    <Reference Include="System.Net.Http" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
     <Reference Include="WindowsBase" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="UI\NonLogicalUI\ConstantsEditor.cs">
+    <Compile Include="UI\ConstantsEditor.cs">
       <SubType>Form</SubType>
     </Compile>
-    <Compile Include="UI\NonLogicalUI\ConstantsEditor.Designer.cs">
+    <Compile Include="UI\ConstantsEditor.Designer.cs">
       <DependentUpon>ConstantsEditor.cs</DependentUpon>
     </Compile>
     <Compile Include="UI\NonLogicalUI\ProcessBar.cs">
@@ -306,7 +305,7 @@
     <Compile Include="UI\SubMidWindow.Designer.cs">
       <DependentUpon>SubMidWindow.cs</DependentUpon>
     </Compile>
-    <EmbeddedResource Include="UI\NonLogicalUI\ConstantsEditor.resx">
+    <EmbeddedResource Include="UI\ConstantsEditor.resx">
       <DependentUpon>ConstantsEditor.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="UI\NonLogicalUI\ProcessBar.resx">

+ 1 - 3
OTSPartA_STDEditor/UI/STDEditor.Designer.cs

@@ -73,7 +73,6 @@
             this.comboBox_Elem1 = new System.Windows.Forms.ComboBox();
             this.comboBox_Elem = new System.Windows.Forms.ComboBox();
             this.comboBox_ImgProperty = new System.Windows.Forms.ComboBox();
-            this.helpProvider1 = new System.Windows.Forms.HelpProvider();
             this.tabSTDStandrad.SuspendLayout();
             this.tabSTD.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView_SubElements)).BeginInit();
@@ -555,7 +554,7 @@
             // 
             this.label_help2.AutoSize = true;
             this.label_help2.Font = new System.Drawing.Font("宋体", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label_help2.Location = new System.Drawing.Point(523, 25);
+            this.label_help2.Location = new System.Drawing.Point(522, 25);
             this.label_help2.Name = "label_help2";
             this.label_help2.Size = new System.Drawing.Size(19, 19);
             this.label_help2.TabIndex = 20;
@@ -714,7 +713,6 @@
         public System.Windows.Forms.DataGridView dataGridView_SubElements;
         private System.Windows.Forms.Button button_PeriodicTableSwitch;
         private System.Windows.Forms.Button button_del;
-        private System.Windows.Forms.HelpProvider helpProvider1;
         private System.Windows.Forms.Label label_help2;
         private System.Windows.Forms.Label label_help1;
     }

+ 0 - 3
OTSPartA_STDEditor/UI/STDEditor.resx

@@ -117,7 +117,4 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
-  <metadata name="helpProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
 </root>

+ 29 - 77
OTSSysMgrApp/ControllerSettingForm.Designer.cs

@@ -72,10 +72,7 @@
             this.cb_Xdirection = new System.Windows.Forms.ComboBox();
             this.label_x = new System.Windows.Forms.Label();
             this.btn_continuousshot = new System.Windows.Forms.Button();
-            this.pictureBox3 = new System.Windows.Forms.PictureBox();
-            this.pictureBox4 = new System.Windows.Forms.PictureBox();
-            this.pictureBox2 = new System.Windows.Forms.PictureBox();
-            this.pictureBox1 = new System.Windows.Forms.PictureBox();
+            this.panel2 = new System.Windows.Forms.Panel();
             this.tabSetting.SuspendLayout();
             this.tabImage.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -89,10 +86,6 @@
             this.splitContainer1.Panel1.SuspendLayout();
             this.splitContainer1.Panel2.SuspendLayout();
             this.splitContainer1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
             // tabSetting
@@ -105,7 +98,7 @@
             this.tabSetting.Margin = new System.Windows.Forms.Padding(2);
             this.tabSetting.Name = "tabSetting";
             this.tabSetting.SelectedIndex = 0;
-            this.tabSetting.Size = new System.Drawing.Size(835, 736);
+            this.tabSetting.Size = new System.Drawing.Size(1050, 770);
             this.tabSetting.TabIndex = 2;
             // 
             // tabImage
@@ -122,7 +115,7 @@
             this.tabImage.Margin = new System.Windows.Forms.Padding(2);
             this.tabImage.Name = "tabImage";
             this.tabImage.Padding = new System.Windows.Forms.Padding(2);
-            this.tabImage.Size = new System.Drawing.Size(827, 710);
+            this.tabImage.Size = new System.Drawing.Size(1042, 744);
             this.tabImage.TabIndex = 1;
             this.tabImage.Text = "BSE测试";
             this.tabImage.UseVisualStyleBackColor = true;
@@ -157,7 +150,7 @@
             this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox2.Name = "groupBox2";
             this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox2.Size = new System.Drawing.Size(822, 665);
+            this.groupBox2.Size = new System.Drawing.Size(1029, 692);
             this.groupBox2.TabIndex = 13;
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "图像显示";
@@ -170,7 +163,7 @@
             this.panel1.Location = new System.Drawing.Point(2, 16);
             this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(818, 647);
+            this.panel1.Size = new System.Drawing.Size(1025, 674);
             this.panel1.TabIndex = 2;
             // 
             // pbImage
@@ -180,15 +173,14 @@
             this.pbImage.Location = new System.Drawing.Point(0, 0);
             this.pbImage.Margin = new System.Windows.Forms.Padding(2);
             this.pbImage.Name = "pbImage";
-            this.pbImage.Size = new System.Drawing.Size(818, 647);
-            this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pbImage.Size = new System.Drawing.Size(1025, 674);
             this.pbImage.TabIndex = 0;
             this.pbImage.TabStop = false;
             // 
             // btnClear
             // 
             this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnClear.Location = new System.Drawing.Point(750, 77);
+            this.btnClear.Location = new System.Drawing.Point(957, 77);
             this.btnClear.Margin = new System.Windows.Forms.Padding(2);
             this.btnClear.Name = "btnClear";
             this.btnClear.Size = new System.Drawing.Size(67, 50);
@@ -201,7 +193,7 @@
             // btnSaveImage
             // 
             this.btnSaveImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnSaveImage.Location = new System.Drawing.Point(550, 8);
+            this.btnSaveImage.Location = new System.Drawing.Point(478, 8);
             this.btnSaveImage.Margin = new System.Windows.Forms.Padding(2);
             this.btnSaveImage.Name = "btnSaveImage";
             this.btnSaveImage.Size = new System.Drawing.Size(67, 33);
@@ -214,7 +206,7 @@
             // btnDisplay
             // 
             this.btnDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnDisplay.Location = new System.Drawing.Point(756, 8);
+            this.btnDisplay.Location = new System.Drawing.Point(684, 8);
             this.btnDisplay.Margin = new System.Windows.Forms.Padding(2);
             this.btnDisplay.Name = "btnDisplay";
             this.btnDisplay.Size = new System.Drawing.Size(67, 33);
@@ -278,7 +270,7 @@
             this.tabXRay.Margin = new System.Windows.Forms.Padding(2);
             this.tabXRay.Name = "tabXRay";
             this.tabXRay.Padding = new System.Windows.Forms.Padding(2);
-            this.tabXRay.Size = new System.Drawing.Size(827, 710);
+            this.tabXRay.Size = new System.Drawing.Size(1042, 744);
             this.tabXRay.TabIndex = 0;
             this.tabXRay.Text = "X-Ray测试";
             this.tabXRay.UseVisualStyleBackColor = true;
@@ -441,13 +433,16 @@
             this.tabImage2.Location = new System.Drawing.Point(4, 22);
             this.tabImage2.Name = "tabImage2";
             this.tabImage2.Padding = new System.Windows.Forms.Padding(3);
-            this.tabImage2.Size = new System.Drawing.Size(827, 710);
+            this.tabImage2.Size = new System.Drawing.Size(1042, 744);
             this.tabImage2.TabIndex = 2;
             this.tabImage2.Text = "轴方向测试";
             this.tabImage2.UseVisualStyleBackColor = true;
             // 
             // splitContainer1
             // 
+            this.splitContainer1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
             this.splitContainer1.Location = new System.Drawing.Point(7, 8);
             this.splitContainer1.Name = "splitContainer1";
             this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
@@ -470,12 +465,9 @@
             // 
             // splitContainer1.Panel2
             // 
-            this.splitContainer1.Panel2.Controls.Add(this.pictureBox3);
-            this.splitContainer1.Panel2.Controls.Add(this.pictureBox4);
-            this.splitContainer1.Panel2.Controls.Add(this.pictureBox2);
-            this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);
-            this.splitContainer1.Size = new System.Drawing.Size(813, 695);
-            this.splitContainer1.SplitterDistance = 81;
+            this.splitContainer1.Panel2.Controls.Add(this.panel2);
+            this.splitContainer1.Size = new System.Drawing.Size(1029, 730);
+            this.splitContainer1.SplitterDistance = 85;
             this.splitContainer1.TabIndex = 3;
             // 
             // btn_Recommendedconfiguration
@@ -598,56 +590,23 @@
             this.btn_continuousshot.UseVisualStyleBackColor = true;
             this.btn_continuousshot.Click += new System.EventHandler(this.btn_continuousshot_Click);
             // 
-            // pictureBox3
-            // 
-            this.pictureBox3.BackColor = System.Drawing.Color.White;
-            this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pictureBox3.Location = new System.Drawing.Point(405, 305);
-            this.pictureBox3.Margin = new System.Windows.Forms.Padding(2);
-            this.pictureBox3.Name = "pictureBox3";
-            this.pictureBox3.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox3.TabIndex = 4;
-            this.pictureBox3.TabStop = false;
-            // 
-            // pictureBox4
-            // 
-            this.pictureBox4.BackColor = System.Drawing.Color.White;
-            this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pictureBox4.Location = new System.Drawing.Point(5, 305);
-            this.pictureBox4.Margin = new System.Windows.Forms.Padding(2);
-            this.pictureBox4.Name = "pictureBox4";
-            this.pictureBox4.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox4.TabIndex = 3;
-            this.pictureBox4.TabStop = false;
-            // 
-            // pictureBox2
-            // 
-            this.pictureBox2.BackColor = System.Drawing.Color.White;
-            this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pictureBox2.Location = new System.Drawing.Point(405, 5);
-            this.pictureBox2.Margin = new System.Windows.Forms.Padding(2);
-            this.pictureBox2.Name = "pictureBox2";
-            this.pictureBox2.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox2.TabIndex = 2;
-            this.pictureBox2.TabStop = false;
-            // 
-            // pictureBox1
-            // 
-            this.pictureBox1.BackColor = System.Drawing.Color.White;
-            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.pictureBox1.Location = new System.Drawing.Point(5, 5);
-            this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
-            this.pictureBox1.Name = "pictureBox1";
-            this.pictureBox1.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox1.TabIndex = 1;
-            this.pictureBox1.TabStop = false;
+            // panel2
+            // 
+            this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.panel2.Location = new System.Drawing.Point(0, 0);
+            this.panel2.Name = "panel2";
+            this.panel2.Size = new System.Drawing.Size(1029, 641);
+            this.panel2.TabIndex = 2;
+            this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
             // 
             // ControllerSettingForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
-            this.ClientSize = new System.Drawing.Size(835, 736);
+            this.ClientSize = new System.Drawing.Size(1050, 770);
             this.Controls.Add(this.tabSetting);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Margin = new System.Windows.Forms.Padding(2);
@@ -673,10 +632,6 @@
             this.splitContainer1.Panel2.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
             this.splitContainer1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
-            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -722,10 +677,7 @@
         private System.Windows.Forms.ComboBox cb_Xdirection;
         private System.Windows.Forms.Label label_x;
         private System.Windows.Forms.Button btn_continuousshot;
-        private System.Windows.Forms.PictureBox pictureBox3;
-        private System.Windows.Forms.PictureBox pictureBox4;
-        private System.Windows.Forms.PictureBox pictureBox2;
-        private System.Windows.Forms.PictureBox pictureBox1;
         private System.Windows.Forms.Button btn_Recommendedconfiguration;
+        private System.Windows.Forms.Panel panel2;
     }
 }

+ 54 - 28
OTSSysMgrApp/ControllerSettingForm.cs

@@ -10,6 +10,7 @@ using System.Collections;
 using System.Collections.Generic;
 using OTSCLRINTERFACE;
 using OTSModelSharp.ServiceCenter;
+using System.Drawing.Drawing2D;
 
 namespace OTSSysMgrApp
 {
@@ -1172,20 +1173,18 @@ namespace OTSSysMgrApp
 
         private void btn_continuousshot_Click(object sender, EventArgs e)
         {
-            pictureBox1.Image = null;
-            pictureBox2.Image = null;
-            pictureBox3.Image = null;
-            pictureBox4.Image = null;
-
-            pictureBox1.BorderStyle = BorderStyle.None;
-            pictureBox2.BorderStyle = BorderStyle.None;
-            pictureBox3.BorderStyle = BorderStyle.None;
-            pictureBox4.BorderStyle = BorderStyle.None;
-
             btn_continuousshot.Enabled = false;
             btn_confirm.Enabled = false;
             this.Refresh();
 
+            Graphics g = panel2.CreateGraphics();
+            //g.SmoothingMode = SmoothingMode.HighSpeed;
+            //g.CompositingQuality = CompositingQuality.HighSpeed;
+            g.PixelOffsetMode = PixelOffsetMode.HighQuality;//高质量低速度呈现
+
+            g.SmoothingMode = SmoothingMode.HighQuality;// 指定高质量、低速度呈现。
+            g.InterpolationMode = InterpolationMode.NearestNeighbor;
+
             ISemController m_Sem = SemController.GetSEMController();
             bool flag = m_Sem.Connect();
             //电镜设置对象
@@ -1225,14 +1224,6 @@ namespace OTSSysMgrApp
             {
                 width = Convert.ToInt32(cb_imageresolution.Text.Split('*')[0]);
                 height = Convert.ToInt32(cb_imageresolution.Text.Split('*')[1]);
-
-                pictureBox1.Height = pictureBox1.Width * height / width;
-                pictureBox2.Height = pictureBox1.Height;
-                pictureBox3.Height = pictureBox1.Height;
-                pictureBox4.Height = pictureBox1.Height;
-                pictureBox2.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y);
-                pictureBox3.Location = new Point(pictureBox1.Location.X, pictureBox1.Location.Y + pictureBox1.Height);
-                pictureBox4.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y + pictureBox1.Height);
             }
 
             this.Refresh();
@@ -1279,6 +1270,7 @@ namespace OTSSysMgrApp
                     //Thread.Sleep(50);
                     byte[] ImageByte = new byte[width * height];
                     bool resultValue = GetScanImage(width, height, "2", ref ImageByte);
+                    Size size = new Size(panel2.Width / 2, panel2.Height / 2);
 
                     if (resultValue)
                     {
@@ -1288,19 +1280,27 @@ namespace OTSSysMgrApp
                             switch (i)
                             {
                                 case 0:
-                                    pictureBox1.Image = bitmap;
+                                    Point point0 = new Point(0,0);
+                                    Rectangle rect0 = new Rectangle(point0,size);
+                                    g.DrawImage(bitmap,rect0);
                                     break;
                                 case 1:
-                                    pictureBox2.Image = bitmap;
+                                    Point point1 = new Point(panel2.Width / 2, 0);
+                                    Rectangle rect1 = new Rectangle(point1, size);
+                                    g.DrawImage(bitmap, rect1);
                                     break;
                                 case 2:
-                                    pictureBox4.Image = bitmap;
+                                    Point point2 = new Point(panel2.Width/2, panel2.Height / 2);
+                                    Rectangle rect2 = new Rectangle(point2, size);
+                                    g.DrawImage(bitmap, rect2);
                                     break;
                                 case 3:
-                                    pictureBox3.Image = bitmap;
+                                    Point point3 = new Point(0, panel2.Height / 2);
+                                    Rectangle rect3 = new Rectangle(point3, size);
+                                    g.DrawImage(bitmap, rect3);
                                     break;
                             }
-                            this.Refresh();
+                            //this.Refresh();
                         }
                     }
                 }
@@ -1309,11 +1309,6 @@ namespace OTSSysMgrApp
             catch (Exception ex)
             {
                 log.Error("continuousshot--错误信息:" + ex.ToString());
-
-                pictureBox1.BorderStyle = BorderStyle.FixedSingle;
-                pictureBox2.BorderStyle = BorderStyle.FixedSingle;
-                pictureBox3.BorderStyle = BorderStyle.FixedSingle;
-                pictureBox4.BorderStyle = BorderStyle.FixedSingle;
             }
             finally
             {
@@ -1322,6 +1317,8 @@ namespace OTSSysMgrApp
                 btn_continuousshot.Enabled = true;
                 btn_confirm.Enabled = true;
                 btn_continuousshot.Refresh();
+
+                g.Dispose();
             }
         }
 
@@ -1430,5 +1427,34 @@ namespace OTSSysMgrApp
                 recommendedConfiguration.Activate();
             }
         }
+
+        void DrawFrames()
+        {
+            Graphics g = panel2.CreateGraphics();
+            g.SmoothingMode = SmoothingMode.HighQuality;
+            Pen pen = new Pen(Color.Black);
+            g.DrawLine(pen,new Point(panel2.Width/2,0),new Point(panel2.Width / 2, panel2.Height));
+            g.DrawLine(pen, new Point(0, panel2.Height/2), new Point(panel2.Width, panel2.Height/2));
+
+            pen.Dispose();
+            g.Dispose();
+        }
+
+        void DrawField()
+        {
+            Graphics g = panel2.CreateGraphics();
+            g.SmoothingMode = SmoothingMode.HighQuality;
+            Pen pen = new Pen(Color.Black);
+            g.DrawLine(pen, new Point(panel2.Width / 2, 0), new Point(panel2.Width / 2, panel2.Height));
+            g.DrawLine(pen, new Point(0, panel2.Height / 2), new Point(panel2.Width, panel2.Height / 2));
+
+            pen.Dispose();
+            g.Dispose();
+        }
+
+        private void panel2_Paint(object sender, PaintEventArgs e)
+        {
+            DrawFrames();
+        }
     }
 }