Prechádzať zdrojové kódy

添加设备联网信息查看界面

章政 7 rokov pred
rodič
commit
68fd427ed8

+ 269 - 0
UAS_DeviceMonitor/Device/Information/DeviceDetailInfo.Designer.cs

@@ -0,0 +1,269 @@
+using UAS_DeviceMonitor.CustomerControl.ValueLabel;
+
+namespace UAS_DeviceMonitor.Device.Infomation
+{
+    partial class DeviceDetailInfo
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.groupControl1 = new DevExpress.XtraEditors.GroupControl();
+            this.dnc_type = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.dnc_upperip = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.labelControl6 = new DevExpress.XtraEditors.LabelControl();
+            this.labelControl5 = new DevExpress.XtraEditors.LabelControl();
+            this.dnc_mac = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.dnc_gateway = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.labelControl4 = new DevExpress.XtraEditors.LabelControl();
+            this.dnc_port = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.labelControl3 = new DevExpress.XtraEditors.LabelControl();
+            this.dnc_ip = new UAS_DeviceMonitor.CustomerControl.ValueLabel.ValueLabel();
+            this.labelControl2 = new DevExpress.XtraEditors.LabelControl();
+            this.labelControl1 = new DevExpress.XtraEditors.LabelControl();
+            this.GridDeviceDetailInfo = new DevExpress.XtraGrid.GridControl();
+            this.GridViewDeviceDetailInfo = new DevExpress.XtraGrid.Views.Grid.GridView();
+            this.DC_CODE = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.DC_NAME = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.DPC_ENABLE = new DevExpress.XtraGrid.Columns.GridColumn();
+            ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).BeginInit();
+            this.groupControl1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.GridDeviceDetailInfo)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceDetailInfo)).BeginInit();
+            this.SuspendLayout();
+            // 
+            // groupControl1
+            // 
+            this.groupControl1.Controls.Add(this.dnc_type);
+            this.groupControl1.Controls.Add(this.dnc_upperip);
+            this.groupControl1.Controls.Add(this.labelControl6);
+            this.groupControl1.Controls.Add(this.labelControl5);
+            this.groupControl1.Controls.Add(this.dnc_mac);
+            this.groupControl1.Controls.Add(this.dnc_gateway);
+            this.groupControl1.Controls.Add(this.labelControl4);
+            this.groupControl1.Controls.Add(this.dnc_port);
+            this.groupControl1.Controls.Add(this.labelControl3);
+            this.groupControl1.Controls.Add(this.dnc_ip);
+            this.groupControl1.Controls.Add(this.labelControl2);
+            this.groupControl1.Controls.Add(this.labelControl1);
+            this.groupControl1.Location = new System.Drawing.Point(12, 12);
+            this.groupControl1.Name = "groupControl1";
+            this.groupControl1.Size = new System.Drawing.Size(286, 349);
+            this.groupControl1.TabIndex = 0;
+            this.groupControl1.Text = "设备联网信息";
+            // 
+            // dnc_type
+            // 
+            this.dnc_type.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_type.Location = new System.Drawing.Point(71, 204);
+            this.dnc_type.Name = "dnc_type";
+            this.dnc_type.Size = new System.Drawing.Size(0, 16);
+            this.dnc_type.TabIndex = 23;
+            // 
+            // dnc_upperip
+            // 
+            this.dnc_upperip.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_upperip.Location = new System.Drawing.Point(71, 173);
+            this.dnc_upperip.Name = "dnc_upperip";
+            this.dnc_upperip.Size = new System.Drawing.Size(0, 16);
+            this.dnc_upperip.TabIndex = 22;
+            // 
+            // labelControl6
+            // 
+            this.labelControl6.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl6.Location = new System.Drawing.Point(13, 204);
+            this.labelControl6.Name = "labelControl6";
+            this.labelControl6.Size = new System.Drawing.Size(32, 16);
+            this.labelControl6.TabIndex = 21;
+            this.labelControl6.Text = "类型";
+            // 
+            // labelControl5
+            // 
+            this.labelControl5.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl5.Location = new System.Drawing.Point(13, 171);
+            this.labelControl5.Name = "labelControl5";
+            this.labelControl5.Size = new System.Drawing.Size(48, 16);
+            this.labelControl5.TabIndex = 20;
+            this.labelControl5.Text = "上级IP";
+            // 
+            // dnc_mac
+            // 
+            this.dnc_mac.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_mac.Location = new System.Drawing.Point(71, 137);
+            this.dnc_mac.Name = "dnc_mac";
+            this.dnc_mac.Size = new System.Drawing.Size(0, 16);
+            this.dnc_mac.TabIndex = 19;
+            // 
+            // dnc_gateway
+            // 
+            this.dnc_gateway.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_gateway.Location = new System.Drawing.Point(71, 106);
+            this.dnc_gateway.Name = "dnc_gateway";
+            this.dnc_gateway.Size = new System.Drawing.Size(0, 16);
+            this.dnc_gateway.TabIndex = 18;
+            // 
+            // labelControl4
+            // 
+            this.labelControl4.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl4.Location = new System.Drawing.Point(13, 140);
+            this.labelControl4.Name = "labelControl4";
+            this.labelControl4.Size = new System.Drawing.Size(24, 16);
+            this.labelControl4.TabIndex = 6;
+            this.labelControl4.Text = "MAC";
+            // 
+            // dnc_port
+            // 
+            this.dnc_port.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_port.Location = new System.Drawing.Point(71, 74);
+            this.dnc_port.Name = "dnc_port";
+            this.dnc_port.Size = new System.Drawing.Size(0, 16);
+            this.dnc_port.TabIndex = 17;
+            // 
+            // labelControl3
+            // 
+            this.labelControl3.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl3.Location = new System.Drawing.Point(13, 106);
+            this.labelControl3.Name = "labelControl3";
+            this.labelControl3.Size = new System.Drawing.Size(32, 16);
+            this.labelControl3.TabIndex = 5;
+            this.labelControl3.Text = "网关";
+            // 
+            // dnc_ip
+            // 
+            this.dnc_ip.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.dnc_ip.Location = new System.Drawing.Point(71, 41);
+            this.dnc_ip.Name = "dnc_ip";
+            this.dnc_ip.Size = new System.Drawing.Size(0, 16);
+            this.dnc_ip.TabIndex = 16;
+            // 
+            // labelControl2
+            // 
+            this.labelControl2.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl2.Location = new System.Drawing.Point(13, 74);
+            this.labelControl2.Name = "labelControl2";
+            this.labelControl2.Size = new System.Drawing.Size(32, 16);
+            this.labelControl2.TabIndex = 4;
+            this.labelControl2.Text = "端口";
+            // 
+            // labelControl1
+            // 
+            this.labelControl1.Appearance.Font = new System.Drawing.Font("黑体", 12F);
+            this.labelControl1.Location = new System.Drawing.Point(13, 41);
+            this.labelControl1.Name = "labelControl1";
+            this.labelControl1.Size = new System.Drawing.Size(16, 16);
+            this.labelControl1.TabIndex = 0;
+            this.labelControl1.Text = "IP";
+            // 
+            // GridDeviceDetailInfo
+            // 
+            this.GridDeviceDetailInfo.Location = new System.Drawing.Point(310, 12);
+            this.GridDeviceDetailInfo.MainView = this.GridViewDeviceDetailInfo;
+            this.GridDeviceDetailInfo.Name = "GridDeviceDetailInfo";
+            this.GridDeviceDetailInfo.Size = new System.Drawing.Size(431, 349);
+            this.GridDeviceDetailInfo.TabIndex = 2;
+            this.GridDeviceDetailInfo.ViewCollection.AddRange(new DevExpress.XtraGrid.Views.Base.BaseView[] {
+            this.GridViewDeviceDetailInfo});
+            // 
+            // GridViewDeviceDetailInfo
+            // 
+            this.GridViewDeviceDetailInfo.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
+            this.DC_CODE,
+            this.DC_NAME,
+            this.DPC_ENABLE});
+            this.GridViewDeviceDetailInfo.GridControl = this.GridDeviceDetailInfo;
+            this.GridViewDeviceDetailInfo.Name = "GridViewDeviceDetailInfo";
+            // 
+            // DC_CODE
+            // 
+            this.DC_CODE.Caption = "指令编号";
+            this.DC_CODE.FieldName = "DC_CODE";
+            this.DC_CODE.Name = "DC_CODE";
+            this.DC_CODE.OptionsColumn.AllowEdit = false;
+            this.DC_CODE.Visible = true;
+            this.DC_CODE.VisibleIndex = 0;
+            // 
+            // DC_NAME
+            // 
+            this.DC_NAME.Caption = "指令名称";
+            this.DC_NAME.FieldName = "DC_NAME";
+            this.DC_NAME.Name = "DC_NAME";
+            this.DC_NAME.OptionsColumn.AllowEdit = false;
+            this.DC_NAME.Visible = true;
+            this.DC_NAME.VisibleIndex = 1;
+            // 
+            // DPC_ENABLE
+            // 
+            this.DPC_ENABLE.Caption = "是否启用";
+            this.DPC_ENABLE.FieldName = "DPC_ENABLE";
+            this.DPC_ENABLE.Name = "DPC_ENABLE";
+            this.DPC_ENABLE.OptionsColumn.AllowEdit = false;
+            this.DPC_ENABLE.Visible = true;
+            this.DPC_ENABLE.VisibleIndex = 2;
+            // 
+            // DeviceDetailInfo
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 14F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(747, 373);
+            this.Controls.Add(this.GridDeviceDetailInfo);
+            this.Controls.Add(this.groupControl1);
+            this.FormBorderEffect = DevExpress.XtraEditors.FormBorderEffect.None;
+            this.MaximizeBox = false;
+            this.Name = "DeviceDetailInfo";
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = " ";
+            this.Load += new System.EventHandler(this.DeviceStatusInfo_Load);
+            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.DeviceStatusInfo_KeyDown);
+            ((System.ComponentModel.ISupportInitialize)(this.groupControl1)).EndInit();
+            this.groupControl1.ResumeLayout(false);
+            this.groupControl1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.GridDeviceDetailInfo)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.GridViewDeviceDetailInfo)).EndInit();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private DevExpress.XtraEditors.GroupControl groupControl1;
+        private DevExpress.XtraEditors.LabelControl labelControl4;
+        private DevExpress.XtraEditors.LabelControl labelControl3;
+        private DevExpress.XtraEditors.LabelControl labelControl2;
+        private DevExpress.XtraEditors.LabelControl labelControl1;
+        private ValueLabel dnc_mac;
+        private ValueLabel dnc_gateway;
+        private ValueLabel dnc_port;
+        private ValueLabel dnc_ip;
+        private DevExpress.XtraGrid.GridControl GridDeviceDetailInfo;
+        private DevExpress.XtraGrid.Views.Grid.GridView GridViewDeviceDetailInfo;
+        private DevExpress.XtraEditors.LabelControl labelControl5;
+        private DevExpress.XtraEditors.LabelControl labelControl6;
+        private ValueLabel dnc_type;
+        private ValueLabel dnc_upperip;
+        private DevExpress.XtraGrid.Columns.GridColumn DC_CODE;
+        private DevExpress.XtraGrid.Columns.GridColumn DC_NAME;
+        private DevExpress.XtraGrid.Columns.GridColumn DPC_ENABLE;
+    }
+}

+ 51 - 0
UAS_DeviceMonitor/Device/Information/DeviceDetailInfo.cs

@@ -0,0 +1,51 @@
+using System;
+using DevExpress.XtraEditors;
+using UAS_DeviceMonitor.DataOperate;
+using UAS_DeviceMonitor.Entity;
+using System.Data;
+using System.Text;
+using UAS_DeviceMonitor.PublicMethod;
+using System.Windows.Forms;
+
+namespace UAS_DeviceMonitor.Device.Infomation
+{
+    public partial class DeviceDetailInfo : XtraForm
+    {
+        DataHelper dh = SystemInf.dh;
+
+        StringBuilder sql = new StringBuilder();
+
+        string de_code = "";
+
+        public DeviceDetailInfo()
+        {
+            InitializeComponent();
+        }
+
+        public DeviceDetailInfo(string DevcieCode)
+        {
+            InitializeComponent();
+            de_code = DevcieCode;
+            Text = DevcieCode;
+        }
+
+        private void DeviceStatusInfo_Load(object sender, EventArgs e)
+        {
+            DataTable dt = (DataTable)dh.ExecuteSql("select * from devicenetconfig where dnc_decode='" + de_code + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                BaseUtil.SetFormValue(Controls, dt);
+            }
+            dt = (DataTable)dh.ExecuteSql("select dc_code,dc_name,dpc_enable from devicepollingconfig left join devicecommand on dpc_dccode=dc_code where dpc_decode='" + de_code + "'", "select");
+            GridDeviceDetailInfo.DataSource = dt;
+        }
+
+        private void DeviceStatusInfo_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Escape)
+            {
+                Close();
+            }
+        }
+    }
+}

+ 120 - 0
UAS_DeviceMonitor/Device/Information/DeviceDetailInfo.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 4 - 1
UAS_DeviceMonitor/Main.cs

@@ -123,7 +123,10 @@ namespace UAS_DeviceMonitor
         #region 设备列表界面
         private void GridViewDeviceList_RowCellClick(object sender, RowCellClickEventArgs e)
         {
-            XtraMessageBox.Show(e.RowHandle.ToString());
+            string de_code = GridViewDeviceList.GetRowCellValue(e.RowHandle, "DE_CODE").ToString();
+            DeviceDetailInfo ddi = new DeviceDetailInfo(de_code);
+            ddi.StartPosition = FormStartPosition.CenterScreen;
+            ddi.ShowDialog();
         }
         #endregion
 

+ 9 - 0
UAS_DeviceMonitor/UAS_DeviceMonitor.csproj

@@ -197,6 +197,12 @@
     <Compile Include="Device\Command\FormNewCommand.Designer.cs">
       <DependentUpon>FormNewCommand.cs</DependentUpon>
     </Compile>
+    <Compile Include="Device\Information\DeviceDetailInfo.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="Device\Information\DeviceDetailInfo.Designer.cs">
+      <DependentUpon>DeviceDetailInfo.cs</DependentUpon>
+    </Compile>
     <Compile Include="Device\Information\DeviceStatusInfo.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -245,6 +251,9 @@
     <EmbeddedResource Include="Device\Command\FormNewCommand.resx">
       <DependentUpon>FormNewCommand.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="Device\Information\DeviceDetailInfo.resx">
+      <DependentUpon>DeviceDetailInfo.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="Device\Information\DeviceStatusInfo.resx">
       <DependentUpon>DeviceStatusInfo.cs</DependentUpon>
     </EmbeddedResource>