From df121d5d8685336632aee169541dd811b518bcfd Mon Sep 17 00:00:00 2001
From: wells.liu <wells.liu@broconcentric.com>
Date: 星期一, 06 七月 2020 11:06:45 +0800
Subject: [PATCH] 板卡界面及窗口显示

---
 src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.cs               |   26 +++++++-
 src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.cs          |    6 +-
 src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.resx        |    0 
 src/Bro.UI.Device.Winform/Bro.UI.Device.Winform.csproj                      |   12 ++--
 src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.Designer.cs      |   31 +++++++---
 src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.Designer.cs |   72 ++++++++++++------------
 6 files changed, 89 insertions(+), 58 deletions(-)

diff --git a/src/Bro.UI.Device.Winform/Bro.UI.Device.Winform.csproj b/src/Bro.UI.Device.Winform/Bro.UI.Device.Winform.csproj
index 5b0a3f6..4d1cb18 100644
--- a/src/Bro.UI.Device.Winform/Bro.UI.Device.Winform.csproj
+++ b/src/Bro.UI.Device.Winform/Bro.UI.Device.Winform.csproj
@@ -107,11 +107,11 @@
     <Compile Include="MotionCard\CtrlMotionCardIOStatus.Designer.cs">
       <DependentUpon>CtrlMotionCardIOStatus.cs</DependentUpon>
     </Compile>
-    <Compile Include="MotionCard\CtrlMotionCardOperationBase.cs">
-      <SubType>UserControl</SubType>
+    <Compile Include="MotionCard\FrmMotionCardOperationBase.cs">
+      <SubType>Form</SubType>
     </Compile>
-    <Compile Include="MotionCard\CtrlMotionCardOperationBase.Designer.cs">
-      <DependentUpon>CtrlMotionCardOperationBase.cs</DependentUpon>
+    <Compile Include="MotionCard\FrmMotionCardOperationBase.Designer.cs">
+      <DependentUpon>FrmMotionCardOperationBase.cs</DependentUpon>
     </Compile>
     <Compile Include="CtrlPLCRunBase.cs">
       <SubType>UserControl</SubType>
@@ -145,8 +145,8 @@
     <EmbeddedResource Include="MotionCard\CtrlMotionCardIOStatus.resx">
       <DependentUpon>CtrlMotionCardIOStatus.cs</DependentUpon>
     </EmbeddedResource>
-    <EmbeddedResource Include="MotionCard\CtrlMotionCardOperationBase.resx">
-      <DependentUpon>CtrlMotionCardOperationBase.cs</DependentUpon>
+    <EmbeddedResource Include="MotionCard\FrmMotionCardOperationBase.resx">
+      <DependentUpon>FrmMotionCardOperationBase.cs</DependentUpon>
     </EmbeddedResource>
     <EmbeddedResource Include="CtrlPLCRunBase.resx">
       <DependentUpon>CtrlPLCRunBase.cs</DependentUpon>
diff --git a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.Designer.cs b/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.Designer.cs
index 86ab685..dc93c7a 100644
--- a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.Designer.cs
+++ b/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.Designer.cs
@@ -32,6 +32,7 @@
             this.groupBox2 = new System.Windows.Forms.GroupBox();
             this.listBoxMsg = new System.Windows.Forms.ListBox();
             this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
+            this.buttonMotionCardOperation = new System.Windows.Forms.Button();
             this.tableLayoutPanel1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.SuspendLayout();
@@ -40,24 +41,25 @@
             // 
             this.tableLayoutPanel1.ColumnCount = 1;
             this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 2);
-            this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 0);
+            this.tableLayoutPanel1.Controls.Add(this.groupBox2, 0, 3);
+            this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1);
+            this.tableLayoutPanel1.Controls.Add(this.buttonMotionCardOperation, 0, 0);
             this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
-            this.tableLayoutPanel1.RowCount = 3;
+            this.tableLayoutPanel1.RowCount = 4;
+            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 110F));
-            this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(615, 511);
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(615, 587);
             this.tableLayoutPanel1.TabIndex = 5;
             // 
             // groupBox2
             // 
             this.groupBox2.Controls.Add(this.listBoxMsg);
             this.groupBox2.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.groupBox2.Location = new System.Drawing.Point(3, 403);
+            this.groupBox2.Location = new System.Drawing.Point(3, 479);
             this.groupBox2.Name = "groupBox2";
             this.groupBox2.Size = new System.Drawing.Size(609, 105);
             this.groupBox2.TabIndex = 10;
@@ -78,10 +80,20 @@
             // flowLayoutPanel1
             // 
             this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 3);
+            this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 33);
             this.flowLayoutPanel1.Name = "flowLayoutPanel1";
-            this.flowLayoutPanel1.Size = new System.Drawing.Size(609, 194);
+            this.flowLayoutPanel1.Size = new System.Drawing.Size(609, 217);
             this.flowLayoutPanel1.TabIndex = 11;
+            // 
+            // buttonMotionCardOperation
+            // 
+            this.buttonMotionCardOperation.Location = new System.Drawing.Point(3, 3);
+            this.buttonMotionCardOperation.Name = "buttonMotionCardOperation";
+            this.buttonMotionCardOperation.Size = new System.Drawing.Size(97, 24);
+            this.buttonMotionCardOperation.TabIndex = 12;
+            this.buttonMotionCardOperation.Text = "鏉垮崱鎿嶄綔";
+            this.buttonMotionCardOperation.UseVisualStyleBackColor = true;
+            this.buttonMotionCardOperation.Click += new System.EventHandler(this.buttonMotionCardOperation_Click);
             // 
             // CtrlMotionCardRunBase
             // 
@@ -89,7 +101,7 @@
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.Controls.Add(this.tableLayoutPanel1);
             this.Name = "CtrlMotionCardRunBase";
-            this.Size = new System.Drawing.Size(615, 511);
+            this.Size = new System.Drawing.Size(615, 587);
             this.tableLayoutPanel1.ResumeLayout(false);
             this.groupBox2.ResumeLayout(false);
             this.ResumeLayout(false);
@@ -101,5 +113,6 @@
         private System.Windows.Forms.GroupBox groupBox2;
         private System.Windows.Forms.ListBox listBoxMsg;
         private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
+        private System.Windows.Forms.Button buttonMotionCardOperation;
     }
 }
diff --git a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.cs b/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.cs
index 142fc16..d3f0c1d 100644
--- a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.cs
+++ b/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardRunBase.cs
@@ -8,10 +8,11 @@
 using System.Threading.Tasks;
 using System.Windows.Forms;
 using Bro.Common.Interface;
+using Bro.Common.Base;
 
 namespace Bro.UI.Device.Winform
 {
-    public partial class CtrlMotionCardRunBase : UserControl
+    public partial class CtrlMotionCardRunBase : UserControl, IRunCtrl
     {
         public CtrlMotionCardRunBase()
         {
@@ -21,20 +22,37 @@
         public CtrlMotionCardRunBase(IDevice device)
         {
             InitializeComponent();
+            Device = device;
 
+            InitialLayout();
             //CvImage = new Canvas();
             //CvImage.IsShowElementList = false;
             //CvImage.IsShowROITool = false;
             //CvImage.Dock = DockStyle.Fill;
             //Controls.Add(CvImage);
-
-            //Device = device;
-
             //Camera.OnImageUpdated += Camera_UpdateShowImage;
             //Camera.OnElementsUpdated += Camera_OnElementsUpdated;
             //Camera.OnCameraOpModeChanged += Camera_OnCameraOpModeChanged;
 
             //InitialToolBarVisible(); 
         }
+
+        private void InitialLayout()
+        {
+
+        }
+
+        public IDevice Device { get; set; }
+
+        protected MotionCardBase MotionCard
+        {
+            get => Device as MotionCardBase;
+        }
+
+        private void buttonMotionCardOperation_Click(object sender, EventArgs e)
+        {
+            FrmMotionCardOperationBase motionCardOperationBase = new FrmMotionCardOperationBase(Device);
+            motionCardOperationBase.Show();
+        }
     }
 }
diff --git a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.Designer.cs b/src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.Designer.cs
similarity index 94%
rename from src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.Designer.cs
rename to src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.Designer.cs
index bd4de03..fd5bb86 100644
--- a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.Designer.cs
+++ b/src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.Designer.cs
@@ -1,6 +1,6 @@
 锘縩amespace Bro.UI.Device.Winform
 {
-    partial class CtrlMotionCardOperationBase
+    partial class FrmMotionCardOperationBase
     {
         /// <summary> 
         /// 蹇呴渶鐨勮璁″櫒鍙橀噺銆�
@@ -28,12 +28,14 @@
         /// </summary>
         private void InitializeComponent()
         {
-            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CtrlMotionCardOperationBase));
+            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMotionCardOperationBase));
             this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
             this.tabControl1 = new System.Windows.Forms.TabControl();
             this.tabPage1 = new System.Windows.Forms.TabPage();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.tableLayoutPanel3 = new System.Windows.Forms.TableLayoutPanel();
+            this.groupBoxPara = new System.Windows.Forms.GroupBox();
+            this.propGrid = new System.Windows.Forms.PropertyGrid();
             this.groupBoxCommBtn = new System.Windows.Forms.GroupBox();
             this.btnStart = new System.Windows.Forms.Button();
             this.buttonClearStatus = new System.Windows.Forms.Button();
@@ -41,14 +43,12 @@
             this.buttonServoEnable = new System.Windows.Forms.Button();
             this.buttonSmoothStop = new System.Windows.Forms.Button();
             this.buttonPositionReset = new System.Windows.Forms.Button();
-            this.groupBoxPara = new System.Windows.Forms.GroupBox();
-            this.propGrid = new System.Windows.Forms.PropertyGrid();
             this.tableLayoutPanel1.SuspendLayout();
             this.tabControl1.SuspendLayout();
             this.tabPage2.SuspendLayout();
             this.tableLayoutPanel3.SuspendLayout();
-            this.groupBoxCommBtn.SuspendLayout();
             this.groupBoxPara.SuspendLayout();
+            this.groupBoxCommBtn.SuspendLayout();
             this.SuspendLayout();
             // 
             // tableLayoutPanel1
@@ -61,7 +61,7 @@
             this.tableLayoutPanel1.Name = "tableLayoutPanel1";
             this.tableLayoutPanel1.RowCount = 1;
             this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel1.Size = new System.Drawing.Size(500, 720);
+            this.tableLayoutPanel1.Size = new System.Drawing.Size(484, 681);
             this.tableLayoutPanel1.TabIndex = 0;
             // 
             // tabControl1
@@ -72,7 +72,7 @@
             this.tabControl1.Location = new System.Drawing.Point(3, 3);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
-            this.tabControl1.Size = new System.Drawing.Size(494, 714);
+            this.tabControl1.Size = new System.Drawing.Size(478, 675);
             this.tabControl1.TabIndex = 12;
             // 
             // tabPage1
@@ -80,7 +80,7 @@
             this.tabPage1.Location = new System.Drawing.Point(4, 22);
             this.tabPage1.Name = "tabPage1";
             this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage1.Size = new System.Drawing.Size(486, 688);
+            this.tabPage1.Size = new System.Drawing.Size(470, 649);
             this.tabPage1.TabIndex = 0;
             this.tabPage1.Text = "蹇嵎鎿嶄綔";
             this.tabPage1.UseVisualStyleBackColor = true;
@@ -91,7 +91,7 @@
             this.tabPage2.Location = new System.Drawing.Point(4, 22);
             this.tabPage2.Name = "tabPage2";
             this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
-            this.tabPage2.Size = new System.Drawing.Size(486, 688);
+            this.tabPage2.Size = new System.Drawing.Size(470, 649);
             this.tabPage2.TabIndex = 1;
             this.tabPage2.Text = "閫氱敤鎿嶄綔";
             this.tabPage2.UseVisualStyleBackColor = true;
@@ -108,8 +108,28 @@
             this.tableLayoutPanel3.RowCount = 2;
             this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 120F));
             this.tableLayoutPanel3.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
-            this.tableLayoutPanel3.Size = new System.Drawing.Size(480, 682);
+            this.tableLayoutPanel3.Size = new System.Drawing.Size(464, 643);
             this.tableLayoutPanel3.TabIndex = 0;
+            // 
+            // groupBoxPara
+            // 
+            this.groupBoxPara.Controls.Add(this.propGrid);
+            this.groupBoxPara.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.groupBoxPara.Location = new System.Drawing.Point(3, 123);
+            this.groupBoxPara.Name = "groupBoxPara";
+            this.groupBoxPara.Size = new System.Drawing.Size(458, 517);
+            this.groupBoxPara.TabIndex = 13;
+            this.groupBoxPara.TabStop = false;
+            this.groupBoxPara.Text = "鍙傛暟";
+            // 
+            // propGrid
+            // 
+            this.propGrid.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.propGrid.Location = new System.Drawing.Point(3, 17);
+            this.propGrid.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
+            this.propGrid.Name = "propGrid";
+            this.propGrid.Size = new System.Drawing.Size(452, 497);
+            this.propGrid.TabIndex = 1;
             // 
             // groupBoxCommBtn
             // 
@@ -122,7 +142,7 @@
             this.groupBoxCommBtn.Dock = System.Windows.Forms.DockStyle.Fill;
             this.groupBoxCommBtn.Location = new System.Drawing.Point(3, 3);
             this.groupBoxCommBtn.Name = "groupBoxCommBtn";
-            this.groupBoxCommBtn.Size = new System.Drawing.Size(474, 114);
+            this.groupBoxCommBtn.Size = new System.Drawing.Size(458, 114);
             this.groupBoxCommBtn.TabIndex = 1;
             this.groupBoxCommBtn.TabStop = false;
             this.groupBoxCommBtn.Text = "鍏叡鎿嶄綔";
@@ -138,7 +158,7 @@
             this.btnStart.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
             this.btnStart.Location = new System.Drawing.Point(309, 23);
             this.btnStart.Name = "btnStart";
-            this.btnStart.Size = new System.Drawing.Size(159, 54);
+            this.btnStart.Size = new System.Drawing.Size(143, 54);
             this.btnStart.TabIndex = 5;
             this.btnStart.Text = "  鍚�  鍔�";
             this.btnStart.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
@@ -189,40 +209,20 @@
             this.buttonPositionReset.Text = "浣嶇疆娓呴浂";
             this.buttonPositionReset.UseVisualStyleBackColor = true;
             // 
-            // groupBoxPara
-            // 
-            this.groupBoxPara.Controls.Add(this.propGrid);
-            this.groupBoxPara.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.groupBoxPara.Location = new System.Drawing.Point(3, 123);
-            this.groupBoxPara.Name = "groupBoxPara";
-            this.groupBoxPara.Size = new System.Drawing.Size(474, 556);
-            this.groupBoxPara.TabIndex = 13;
-            this.groupBoxPara.TabStop = false;
-            this.groupBoxPara.Text = "鍙傛暟";
-            // 
-            // propGrid
-            // 
-            this.propGrid.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.propGrid.Location = new System.Drawing.Point(3, 17);
-            this.propGrid.Margin = new System.Windows.Forms.Padding(2, 3, 2, 3);
-            this.propGrid.Name = "propGrid";
-            this.propGrid.Size = new System.Drawing.Size(468, 536);
-            this.propGrid.TabIndex = 1;
-            // 
-            // CtrlMotionCardOperationBase
+            // FrmMotionCardOperationBase
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(484, 681);
             this.Controls.Add(this.tableLayoutPanel1);
-            this.Name = "CtrlMotionCardOperationBase";
-            this.Size = new System.Drawing.Size(500, 720);
+            this.Name = "FrmMotionCardOperationBase";
             this.tableLayoutPanel1.ResumeLayout(false);
             this.tabControl1.ResumeLayout(false);
             this.tabPage2.ResumeLayout(false);
             this.tableLayoutPanel3.ResumeLayout(false);
+            this.groupBoxPara.ResumeLayout(false);
             this.groupBoxCommBtn.ResumeLayout(false);
             this.groupBoxCommBtn.PerformLayout();
-            this.groupBoxPara.ResumeLayout(false);
             this.ResumeLayout(false);
 
         }
diff --git a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.cs b/src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.cs
similarity index 92%
rename from src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.cs
rename to src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.cs
index 9dc252a..cfe0328 100644
--- a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.cs
+++ b/src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.cs
@@ -7,9 +7,9 @@
 
 namespace Bro.UI.Device.Winform
 {
-    public partial class CtrlMotionCardOperationBase : UserControl, IRunCtrl
+    public partial class FrmMotionCardOperationBase : Form
     {
-        public CtrlMotionCardOperationBase()
+        public FrmMotionCardOperationBase()
         {
             InitializeComponent();
         }
@@ -27,7 +27,7 @@
         }
 
 
-        public CtrlMotionCardOperationBase(IDevice device)
+        public FrmMotionCardOperationBase(IDevice device)
         {
             InitializeComponent();
 
diff --git a/src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.resx b/src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.resx
similarity index 100%
rename from src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.resx
rename to src/Bro.UI.Device.Winform/MotionCard/FrmMotionCardOperationBase.resx

--
Gitblit v1.8.0