Browse Source

添加rbConnectHardware、rbDisconnectHardware、rbSysMgrApp

CXS 3 years ago
parent
commit
9c46794887

+ 52 - 0
OTSIncAMeasureApp/OTSIncAMeasureAppForm.Designer.cs

@@ -55,6 +55,7 @@
             this.rbSaveFile = new System.Windows.Forms.RibbonOrbMenuItem();
             this.rvSaveAsFile = new System.Windows.Forms.RibbonOrbMenuItem();
             this.rbSTDEdit = new System.Windows.Forms.RibbonButton();
+            this.rbSysMgrApp = new System.Windows.Forms.RibbonButton();
             this.rbReClassify = new System.Windows.Forms.RibbonButton();
             this.ribbonSeparator2 = new System.Windows.Forms.RibbonSeparator();
             this.rbAbout = new System.Windows.Forms.RibbonOrbMenuItem();
@@ -75,6 +76,8 @@
             this.ribRectangle = new System.Windows.Forms.RibbonButton();
             this.ribPolygon = new System.Windows.Forms.RibbonButton();
             this.rbPanelFunction = new System.Windows.Forms.RibbonPanel();
+            this.rbConnectHardware = new System.Windows.Forms.RibbonButton();
+            this.rbDisconnectHardware = new System.Windows.Forms.RibbonButton();
             this.rbStart = new System.Windows.Forms.RibbonButton();
             this.rbStop = new System.Windows.Forms.RibbonButton();
             this.rbCheckParam = new System.Windows.Forms.RibbonButton();
@@ -176,6 +179,7 @@
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rbSaveFile);
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rvSaveAsFile);
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rbSTDEdit);
+            this.rbMenu.OrbDropDown.MenuItems.Add(this.rbSysMgrApp);
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rbReClassify);
             this.rbMenu.OrbDropDown.MenuItems.Add(this.ribbonSeparator2);
             this.rbMenu.OrbDropDown.MenuItems.Add(this.rbAbout);
@@ -286,6 +290,21 @@
             this.rbSTDEdit.ToolTipTitle = null;
             this.rbSTDEdit.Click += new System.EventHandler(this.rbSTDEdit_Click_1);
             // 
+            // rbSysMgrApp
+            // 
+            this.rbSysMgrApp.AltKey = null;
+            this.rbSysMgrApp.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
+            this.rbSysMgrApp.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.rbSysMgrApp.Image = global::OTSMeasureApp.Properties.Resources.Ruler321;
+            this.rbSysMgrApp.SmallImage = global::OTSMeasureApp.Properties.Resources.Ruler321;
+            this.rbSysMgrApp.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.rbSysMgrApp.Tag = "rbSysMgrApp";
+            this.rbSysMgrApp.Text = "硬件连接测试";
+            this.rbSysMgrApp.ToolTip = null;
+            this.rbSysMgrApp.ToolTipImage = null;
+            this.rbSysMgrApp.ToolTipTitle = null;
+            this.rbSysMgrApp.Click += new System.EventHandler(this.rbSysMgrApp_Click);
+            // 
             // rbReClassify
             // 
             this.rbReClassify.AltKey = null;
@@ -555,12 +574,42 @@
             // 
             this.rbPanelFunction.ButtonMoreEnabled = false;
             this.rbPanelFunction.ButtonMoreVisible = false;
+            this.rbPanelFunction.Items.Add(this.rbConnectHardware);
+            this.rbPanelFunction.Items.Add(this.rbDisconnectHardware);
             this.rbPanelFunction.Items.Add(this.rbStart);
             this.rbPanelFunction.Items.Add(this.rbStop);
             this.rbPanelFunction.Items.Add(this.rbCheckParam);
             this.rbPanelFunction.Tag = "rbPanelFunction";
             this.rbPanelFunction.Text = "测量控制";
             // 
+            // rbConnectHardware
+            // 
+            this.rbConnectHardware.AltKey = null;
+            this.rbConnectHardware.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
+            this.rbConnectHardware.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.rbConnectHardware.Image = global::OTSMeasureApp.Properties.Resources.开始32;
+            this.rbConnectHardware.SmallImage = global::OTSMeasureApp.Properties.Resources.start16;
+            this.rbConnectHardware.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.rbConnectHardware.Tag = "rbConnectHardware";
+            this.rbConnectHardware.Text = "连接硬件";
+            this.rbConnectHardware.ToolTip = null;
+            this.rbConnectHardware.ToolTipImage = null;
+            this.rbConnectHardware.ToolTipTitle = null;
+            // 
+            // rbDisconnectHardware
+            // 
+            this.rbDisconnectHardware.AltKey = null;
+            this.rbDisconnectHardware.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Down;
+            this.rbDisconnectHardware.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.rbDisconnectHardware.Image = global::OTSMeasureApp.Properties.Resources.停止32;
+            this.rbDisconnectHardware.SmallImage = global::OTSMeasureApp.Properties.Resources.stop16;
+            this.rbDisconnectHardware.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.rbDisconnectHardware.Tag = "rbDisconnectHardware";
+            this.rbDisconnectHardware.Text = "断开连接";
+            this.rbDisconnectHardware.ToolTip = null;
+            this.rbDisconnectHardware.ToolTipImage = null;
+            this.rbDisconnectHardware.ToolTipTitle = null;
+            // 
             // rbStart
             // 
             this.rbStart.AltKey = null;
@@ -954,5 +1003,8 @@
         private System.Windows.Forms.RibbonButton rbCircleCenter;
         private System.Windows.Forms.RibbonOrbRecentItem ribbonOrbRecentItem1;
         private System.Windows.Forms.RibbonButton rbThreePoints;
+        public System.Windows.Forms.RibbonButton rbConnectHardware;
+        public System.Windows.Forms.RibbonButton rbDisconnectHardware;
+        public System.Windows.Forms.RibbonButton rbSysMgrApp;
     }
 }

+ 13 - 1
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1165,8 +1165,20 @@ namespace OTSMeasureApp
                 }
             }
         }
+        private void rbSysMgrApp_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSSysMgrApp.exe");
+                p.WaitForExit();
+            }
+            catch (Exception ex)
+            {
+                log.Error("OTSSysMgrApp:" + ex.ToString());
+            } 
+            
+        }
 
-  
         private void ribPolygon_Click(object sender, EventArgs e)
         {
             //修改工作样品的测量区域为矩形