黄学彪
2019-09-30 404cdc88627f942df7944af04ee05b9d527752d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using 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 listView = new FrameListControl(12);
            listView.BackgroundColor = UserCenterColor.Current.White;
            listView.Height = Application.GetRealHeight(876);
            bodyFrameLayout.AddChidren(listView);
 
            //设备名称
            var rowName = new FrameRowControl(listView.rowSpace / 2);
            rowName.UseClickStatu = false;
            listView.AddChidren(rowName);
            rowName.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDeviceName), 300);
            rowName.AddMostRightView(Common.LocalDevice.Current.GetDeviceObjectText(listDevice), 600);
            rowName.AddBottomLine();
 
            //设备型号
            var rowType = new FrameRowControl(listView.rowSpace / 2);
            rowType.UseClickStatu = false;
            listView.AddChidren(rowType);
            rowType.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uModelIdentifier), 300);
            rowType.AddMostRightView(listDevice[0].ModelIdentifier, 600);
            rowType.AddBottomLine();
 
            //固件版本
            var oTADevice = Common.LocalDevice.Current.GetOTADevice(listDevice[0].DeviceAddr);
            if (oTADevice != null)
            {
                var rowVersion = new FrameRowControl(listView.rowSpace / 2);
                rowVersion.UseClickStatu = false;
                listView.AddChidren(rowVersion);
                rowVersion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uFirmwareVersion), 300);
                rowVersion.AddMostRightView(Common.LocalDevice.Current.AppendVersion(oTADevice.ImgVersion), 600);
                rowVersion.AddBottomLine();
            }
 
            //序列号
            var rowSerial = new FrameRowControl(listView.rowSpace / 2);
            rowSerial.UseClickStatu = false;
            listView.AddChidren(rowSerial);
            rowSerial.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSerialNumber), 300);
            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();
 
            //制造商
            var rowProtuct = new FrameRowControl(listView.rowSpace / 2);
            rowProtuct.UseClickStatu = false;
            listView.AddChidren(rowProtuct);
            rowProtuct.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uManufacturerName), 300);
            rowProtuct.AddMostRightView(listDevice[0].ManufacturerName, 600);
        }
 
        #endregion
    }
}