From 6fa9d69da922c8049f5acfcbb9ce9fd26811024c Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 16 四月 2020 17:10:57 +0800
Subject: [PATCH] 请合并代码

---
 ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs |  136 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 136 insertions(+), 0 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
new file mode 100755
index 0000000..4462aa1
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/DeviceGeneralInformationForm.cs
@@ -0,0 +1,136 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter.Device
+{
+    /// <summary>
+    /// 璁惧閫氱敤淇℃伅鐣岄潰
+    /// </summary>
+    public class DeviceGeneralInformationForm : EditorCommonForm
+    {
+        #region 鈻� 鍙橀噺澹版槑___________________________
+
+        #endregion
+
+        #region 鈻� 鍒濆鍖朹____________________________
+
+        /// <summary>
+        /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+        /// </summary>
+        /// <param name="i_deviceMac">璁惧MAC鍦板潃</param>
+        public void ShowForm(string i_deviceMac)
+        {
+            //璁剧疆澶撮儴淇℃伅
+            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uGeneralInformation));
+
+            //鍒濆鍖栦腑閮ㄤ俊鎭�
+            this.InitMiddleFrame(i_deviceMac);
+        }
+
+        /// <summary>
+        /// 鍒濆鍖栦腑閮ㄤ俊鎭�
+        /// </summary>
+        /// <param name="i_deviceMac">璁惧MAC鍦板潃</param>
+        private void InitMiddleFrame(string i_deviceMac)
+        {
+            //娓呯┖bodyFrame
+            this.ClearBodyFrame();
+
+            var listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_deviceMac);
+            var oTADevice = Common.LocalDevice.Current.GetOTADevice(i_deviceMac);
+            if (listDevice.Count == 0)
+            {
+                //閽堝鍗曠函鍙湁涓�涓�200绔偣鐨勮澶�
+                listDevice.Add(oTADevice);
+            }
+
+            var listView = new VerticalListControl(12);
+            listView.BackgroundColor = UserCenterColor.Current.White;
+            listView.Height = bodyFrameLayout.Height;
+            bodyFrameLayout.AddChidren(listView);
+
+            //璁惧鍚嶇О
+            var myInfoType = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
+            var rowName = new FrameRowControl(listView.rowSpace / 2);
+            rowName.UseClickStatu = false;
+            listView.AddChidren(rowName);
+            rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 400);
+            rowName.AddMostRightView(Language.StringByID(myInfoType.ConcreteTextId), 600);
+            rowName.AddBottomLine();
+
+            //璁惧鍨嬪彿
+            string strModel = listDevice[0].DriveCode > 0 ? Language.StringByID(R.MyInternationalizationString.uVirtualDriveDevice) : listDevice[0].ModelIdentifier;
+            if (strModel == string.Empty)
+            {
+                //鏃犳硶璇嗗埆
+                strModel = Language.StringByID(R.MyInternationalizationString.uUnDistinguish);
+            }
+            var rowType = new FrameRowControl(listView.rowSpace / 2);
+            rowType.UseClickStatu = false;
+            listView.AddChidren(rowType);
+            rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 400);
+            rowType.AddMostRightView(strModel, 600);
+            rowType.AddBottomLine();
+
+            //闀滃儚ID
+            var otaDevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
+            if (otaDevice != null)
+            {
+                var rowImage = new FrameRowControl(listView.rowSpace / 2);
+                rowImage.UseClickStatu = false;
+                listView.AddChidren(rowImage);
+                rowImage.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uImageId), 400);
+                rowImage.AddMostRightView(otaDevice.ImgTypeId.ToString(), 400);
+                rowImage.AddBottomLine();
+            }
+
+            if (oTADevice != null)
+            {
+                //鍥轰欢鐗堟湰
+                var rowVersion = new FrameRowControl(listView.rowSpace / 2);
+                rowVersion.UseClickStatu = false;
+                listView.AddChidren(rowVersion);
+                rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 400);
+                rowVersion.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 600);
+                rowVersion.AddBottomLine();
+
+                //纭欢鐗堟湰
+                var rowHard = new FrameRowControl(listView.rowSpace / 2);
+                rowHard.UseClickStatu = false;
+                listView.AddChidren(rowHard);
+                rowHard.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uHardwareVersion), 400);
+                rowHard.AddMostRightView(oTADevice.HwVersion.ToString(), 600);
+                rowHard.AddBottomLine();
+            }
+
+            //搴忓垪鍙�
+            var rowSerial = new FrameRowControl(listView.rowSpace / 2);
+            rowSerial.UseClickStatu = false;
+            listView.AddChidren(rowSerial);
+            rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 400);
+            rowSerial.AddMostRightView(listDevice[0].SerialNumber != string.Empty ? listDevice[0].SerialNumber : listDevice[0].DeviceAddr, 600);
+            rowSerial.AddBottomLine();
+
+            //MAC
+            var rowMac = new FrameRowControl(listView.rowSpace / 2);
+            rowMac.UseClickStatu = false;
+            listView.AddChidren(rowMac);
+            rowMac.AddLeftCaption("MAC", 300);
+            rowMac.AddMostRightView(listDevice[0].DeviceAddr, 600);
+            rowMac.AddBottomLine();
+
+            //鍒堕�犲晢
+            string strProtuct = listDevice[0].DriveCode > 0 ? "HDL" : listDevice[0].ManufacturerName;
+            var rowProtuct = new FrameRowControl(listView.rowSpace / 2);
+            rowProtuct.UseClickStatu = false;
+            listView.AddChidren(rowProtuct);
+            rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 400);
+            rowProtuct.AddMostRightView(strProtuct, 600);
+
+            listView.AdjustRealHeight(Application.GetRealHeight(23));
+        }
+
+        #endregion
+    }
+}

--
Gitblit v1.8.0