qin
2025-03-06 06eff2094e17b8ed3452e44a6d77b729a7621919
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
using System.Data;
using Yw.WinFrmUI;
 
namespace IBox.WinFrmUI
{
    public partial class IBoxFormSystemInfo : DocumentPage
    {
        private string startCode = "[&start&]";
        private string endCode = "[&end&]";
        private string paramCode = "[&param&]";
        private string getstoreCode = "getstore";
        public IBoxFormSystemInfo()
        {
            this.PageTitle.Caption = "设备信息";
            InitializeComponent();
        }
 
        private void EboxFormSystemInfo_Load(object sender, EventArgs e)
        {
            Thread.Sleep(500);
            SendText(startCode + getstoreCode + paramCode + endCode);
        }
        public event EventHandler<string> SendData;
        private void SendText(string content)
        {
            //BluetoothHelper.GetInstance().SendData(content);
            SendData?.Invoke(null, content);
        }
 
        public void BindData(SystemInfoViewModel model, bool isBlue)
        {
            textEdit1.Text = model.Lan0IpAddress.Replace("\n", "");
            textEdit2.Text = model.Wlan0IpAddress.Replace("\n", "");
            textEdit3.Text = model.SystemVersion;
            textEdit4.Text = model.TotalRunTime;
            textEdit10.Text = model.CurrentTime.Replace(";","");
            var dic = GetDuDic(model.Du);
            textEdit5.Text = GetDuString(dic, "/usr/ebox");
            textEdit6.Text = GetDuString(dic, "/usr/ebox/Data");
            textEdit7.Text = GetDuString(dic, "/usr/ebox/DataDockingConsole");
            textEdit8.Text = GetDuString(dic, "/usr/ebox/PostDataConsole");
            textEdit9.Text = GetDuString(dic, "/usr/ebox/WebServer");
            textEdit11.Text = model.MemUse;
        }
 
        private Dictionary<string, string> GetDuDic(string du)
        {
            //8.2M:/usr/ebox/Data; 生成Dictionary<string,string>
            return du.Substring(0,du.Length - 1).Split(';').Select(c => c.Split(':')).ToDictionary(b => b[1], b => b[0]);
        }
 
        private string GetDuString(Dictionary<string, string> du, string type)
        {
            return du[type];
        }
    }
}