| | |
| | | private BluetoothRadio radio = null;//蓝牙适配器 |
| | | private string sendFileName = null;//发送文件名 |
| | | private BluetoothAddress sendAddress = null;//发送目的地址 |
| | | |
| | | //private ObexListener listener = null;//监听器 |
| | | private Thread listenThread, sendThread;//发送/接收线程 |
| | | |
| | | private BluetoothClient myClient = null; |
| | | private string startCode = "[&start&]"; |
| | | private string endCode = "[&end&]"; |
| | |
| | | //IBoxFormScheme.Dock = DockStyle.Fill; |
| | | //IBoxFormScheme.SendData += SendText; |
| | | //xtraTabPage6.Controls.Add(IBoxFormScheme); |
| | | |
| | | } |
| | | |
| | | private void barButtonItem6_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | xtraTabPage2.Controls.Add(IBoxFormOverview); |
| | | xtraTabPage2.PageVisible = true; |
| | | xtraTabControl1.SelectedTabPage = xtraTabPage2; |
| | | |
| | | |
| | | } |
| | | |
| | | private void HideAll() |
| | |
| | | xtraTabPage1.Controls.Add(IBoxFormMonitor); |
| | | xtraTabPage1.PageVisible = true; |
| | | xtraTabControl1.SelectedTabPage = xtraTabPage1; |
| | | |
| | | } |
| | | |
| | | private void barButtonItem5_ItemClick(object sender, ItemClickEventArgs e) |
| | |
| | | //xtraTabPage7.Controls.Add(IBoxFormControll); |
| | | xtraTabPage7.PageVisible = true; |
| | | xtraTabControl1.SelectedTabPage = xtraTabPage7; |
| | | |
| | | } |
| | | |
| | | private void barButtonItem3_ItemClick_1(object sender, ItemClickEventArgs e) |
| | |
| | | xtraTabControl1.SelectedTabPage = xtraTabPage4; |
| | | } |
| | | |
| | | IBoxFormOverview IBoxFormOverview; |
| | | IBoxFormMonitor IBoxFormMonitor; |
| | | private IBoxFormOverview IBoxFormOverview; |
| | | private IBoxFormMonitor IBoxFormMonitor; |
| | | |
| | | //IBoxFormControll IBoxFormControll; |
| | | IBoxFormParams IBoxFormParams; |
| | | IBoxFormLog IBoxFormLog; |
| | | IBoxFormProtocol IBoxFormProtocol; |
| | | IBoxFormRule IBoxFormRule; |
| | | private IBoxFormParams IBoxFormParams; |
| | | |
| | | private IBoxFormLog IBoxFormLog; |
| | | private IBoxFormProtocol IBoxFormProtocol; |
| | | private IBoxFormRule IBoxFormRule; |
| | | |
| | | //IBoxFormScheme IBoxFormScheme; |
| | | IBoxFormSystemInfo IBoxFormSystemInfo; |
| | | IBoxFormDataFilter IBoxFormDataFilter; |
| | | IBoxFormEnergyAnalysis IBoxFormEnergyAnalysis; |
| | | private IBoxFormSystemInfo IBoxFormSystemInfo; |
| | | |
| | | private IBoxFormDataFilter IBoxFormDataFilter; |
| | | private IBoxFormEnergyAnalysis IBoxFormEnergyAnalysis; |
| | | |
| | | private void IBoxForm_Load(object sender, EventArgs e) |
| | | { |
| | |
| | | //MessageBoxHelper.ShowError("蓝牙设备连接失败"); |
| | | } |
| | | } |
| | | |
| | | private List<StationMonitorListGroupMobileDto> stationMonitors; |
| | | |
| | | private void SetOrder(string order) |
| | | { |
| | | var smsg = order.Split(new string[] { paramCode }, StringSplitOptions.RemoveEmptyEntries); |
| | |
| | | var getloglist = JsonHelper.Json2Object<List<IBoxLogViewModel>>(smsg[1].Trim()); |
| | | IBoxFormLog.BindData(getloglist, ConnectType == 1 ? true : false); |
| | | break; |
| | | |
| | | case "getbase": |
| | | var getbaselist = JsonHelper.Json2Object<List<StationMonitorListGroupMobileDto>>(smsg[1].Trim()); |
| | | if (IBoxFormOverview != null) |
| | |
| | | if (IBoxFormMonitor != null) |
| | | IBoxFormMonitor.SetRealRecord(getrealrecordlist, ConnectType == 1 ? true : false); |
| | | break; |
| | | |
| | | case "getparams": |
| | | var model = JsonHelper.Json2Object<IBoxConfigViewModel>(smsg[1].Trim()); |
| | | IBoxFormParams.BindData(model, ConnectType == 1 ? true : false); |
| | | break; |
| | | |
| | | case "getprotocol": |
| | | { |
| | | var pmodel = JsonHelper.Json2Object<IBoxProtocolViewModel>(smsg[1].Trim()); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | public Build _SelectedBuild; |
| | | private string filePath = "Data\\AnalyData_{0}.json"; |
| | | |
| | | |
| | | private void barButtonItem9_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | |
| | | HideAll(); |
| | | var _facilities = _ibox.facilities; |
| | | _SelectedBuild = new Build() |
| | |
| | | //IBoxFormScheme.SendData += SendText; |
| | | //xtraTabPage6.Controls.Add(IBoxFormScheme); |
| | | //xtraTabPage6.PageVisible = true; |
| | | |
| | | |
| | | } |
| | | |
| | | private int ConnectType = 1;//1:蓝牙连接,2:网络连接 |
| | | |
| | | private string HttpGet(string content) |
| | | { |
| | | Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); |
| | |
| | | case 1: |
| | | BluetoothHelper.GetInstance().SendData(content); |
| | | break; |
| | | |
| | | case 2: |
| | | var result = ""; |
| | | if (!splitCode.Any(s => content.Contains(s))) |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | private string IP; |
| | | |
| | | private void barButtonItem10_ItemClick(object sender, ItemClickEventArgs e) |
| | | { |
| | | if (barEditItem2.EditValue.ToString() == "2") |
| | |
| | | barButtonItem10.Visibility = barEditItem3.Visibility = BarItemVisibility.Never; |
| | | barBtnBlue.Visibility = barButtonItemNoConnect.Visibility = barButtonItemConnected.Visibility = barButtonItemClose.Visibility = BarItemVisibility.Always; |
| | | break; |
| | | |
| | | case "2": |
| | | ConnectType = 2; |
| | | barButtonItem10.Visibility = barEditItem3.Visibility = BarItemVisibility.Always; |
| | |
| | | { |
| | | barButtonItem5.Visibility = BarItemVisibility.Never; |
| | | } |
| | | radio = BluetoothRadio.Default;//获取当前PC的蓝牙适配器 |
| | | CheckForIllegalCrossThreadCalls = false;//不检查跨线程调用 |
| | | //this.gridView1.SetNormalView(); |
| | | |
| | | if (radio == null)//检查该电脑蓝牙是否可用 |
| | | try |
| | | { |
| | | radio = BluetoothRadio.Default;//获取当前PC的蓝牙适配器 |
| | | CheckForIllegalCrossThreadCalls = false;//不检查跨线程调用 |
| | | /* if (radio == null)//检查该电脑蓝牙是否可用 |
| | | { |
| | | MessageBoxHelper.ShowInfo("这个电脑蓝牙不可用!"); |
| | | }*/ |
| | | } |
| | | catch |
| | | { |
| | | MessageBoxHelper.ShowInfo("这个电脑蓝牙不可用!"); |
| | | } |
| | |
| | | |
| | | private void imageSlider1_Click(object sender, EventArgs e) |
| | | { |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | } |