| | |
| | | public partial class IBoxFormMonitor : DocumentPage |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | //Stopwatch sw = new Stopwatch(); |
| | | //string swstr=string.Empty; |
| | |
| | | |
| | | private void simpleButton1_Click(object sender, EventArgs e) |
| | | { |
| | | Search(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 查询 |
| | | /// </summary> |
| | | public void Search() |
| | | { |
| | | if (currModel == null) |
| | | { |
| | | MessageBoxHelper.ShowWarning("请先选中监测数据!"); |
| | |
| | | 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; |
| | | } |
| | | var order = IBoxHelper.HttpGet(content); |
| | | var result = IBoxHelper.GetContent(order); |
| | | |
| | | switch (smsg[0].Trim()) |
| | | { |
| | | case IBoxHelper.getbaseCode: |
| | | { |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var model = JsonHelper.Json2Object<List<StationMonitorListGroupMobileDto>>(result); |
| | | BindGrid(model, false); |
| | | } |
| | | break; |
| | | } |
| | | case IBoxHelper.getrealrecordCode: |
| | | { |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var getrealrecordlist = JsonHelper.Json2Object<List<MonitorRealRecord>>(result); |
| | | SetRealRecord(getrealrecordlist, false); |
| | | } |
| | | break; |
| | | } |
| | | case IBoxHelper.gethistoryrecordCode: |
| | | { |
| | | if (!string.IsNullOrEmpty(result)) |
| | | { |
| | | var b = result.Split('|')[1]; |
| | | var gethistoryrecordlist = new List<MonitorRecord>(); |
| | | |
| | | if (!string.IsNullOrEmpty(b)) |
| | | { |
| | | var c = b.Split('|'); |
| | | foreach (var item in c) |
| | | { |
| | | var m = new MonitorRecord().FromString(item); |
| | | gethistoryrecordlist.Add(m); |
| | | } |
| | | } |
| | | SetChartData(gethistoryrecordlist, false); |
| | | } |
| | | break; |
| | | } |
| | | default: |
| | | IBoxHelper.HttpGet(content); |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowWarning("网络连接失败,请检查网络"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void simpleButton5_Click(object sender, EventArgs e) |