From 00ab1b5282ada6ffdc78b3dd46f0ce08726a51e6 Mon Sep 17 00:00:00 2001 From: qin <a@163.com> Date: 星期四, 20 三月 2025 13:47:24 +0800 Subject: [PATCH] 优化IBox界面 --- WinFrmUI/IBox.WinFrmUI/Form/IBoxFormLog.cs | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 53 insertions(+), 2 deletions(-) diff --git a/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormLog.cs b/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormLog.cs index 8bff9c6..f499f2d 100644 --- a/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormLog.cs +++ b/WinFrmUI/IBox.WinFrmUI/Form/IBoxFormLog.cs @@ -61,11 +61,54 @@ public event EventHandler<string> SendData; private void SendText(string content) { - //BluetoothHelper.GetInstance().SendData(content); - SendData?.Invoke(null, content); + if (SendData != null) + { + SendData?.Invoke(null, content); + + } + else + { + if (IBoxHelper.Ping()) + { + var smsg = content.Split(new string[] { IBoxHelper.paramCode, IBoxHelper.startCode }, StringSplitOptions.RemoveEmptyEntries); + if (smsg.Length < 2) + { + return; + } + switch (smsg[0].Trim()) + { + case IBoxHelper.getlogCode: + { + var order = IBoxHelper.HttpGet(content); + var result = IBoxHelper.GetContent(order); + if (!string.IsNullOrEmpty(result)) + { + var model = JsonHelper.Json2Object<List<IBoxLogViewModel>>(result); + BindData(model,false); + } + break; + } + default: + IBoxHelper.HttpGet(content); + break; + } + } + else + { + MessageBoxHelper.ShowWarning("缃戠粶杩炴帴澶辫触锛岃妫�鏌ョ綉缁�"); + } + } } private void simpleButton1_Click(object sender, EventArgs e) + { + Search(); + } + + /// <summary> + /// 鏌ヨ + /// </summary> + public void Search() { //鏌ヨ var m = new GetCalcValueModel() @@ -81,6 +124,14 @@ private void simpleButton2_Click(object sender, EventArgs e) { + Clear(); + } + + /// <summary> + /// 娓呯┖ + /// </summary> + public void Clear() + { //娓呯┖ this.Invoke(new Action(() => { -- Gitblit v1.9.3