| | |
| | | listView.BeginHeaderRefreshingAction += () =>
|
| | | {
|
| | | //刷新设备的话,主页需要重新刷新
|
| | | UserView.UserPage.Instance.RefreshForm = true;
|
| | | UserView.UserPage.Instance.RefreshAllForm = true;
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | |
| | | var listDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | | if (isShow == true)
|
| | | {
|
| | | //备注:面板中只显示真实的设备,其他属于绑定的回路不显示
|
| | | //获取这一堆设备时属于什么类型的
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(listDevice);
|
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | var listTemp = Common.LocalDevice.Current.GetMutilfunctionPanelByMac(listDevice);
|
| | | //展开模式时,扩大依据为:它有几个子控件
|
| | | heightValue = (listTemp.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
|
| | | //标题自己就是一个子控件
|
| | | if (rowInfo.frameTable.ChildrenCount == 1)
|
| | | {
|
| | | foreach (CommonDevice info in listTemp)
|
| | | {
|
| | | //加载它的列表
|
| | | this.AddDeviceDetailRow(rowInfo.frameTable, info, deviceEnumInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | {
|
| | | var listTemp = Common.LocalDevice.Current.GetPanelMatchEpointByMac(listDevice);
|
| | | //展开模式时,扩大依据为:它有几个子控件
|
| | | heightValue = (listTemp.Count + 1) * (ControlCommonResourse.ListViewRowHeight + rowInfo.frameTable.rowSpace);
|
| | | //标题自己就是一个子控件
|
| | |
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | }
|
| | | //简约环境面板的按键配置
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | {
|
| | |
|
| | | if (device.Type == DeviceType.FreshAir || device.Type == DeviceType.Thermostat)
|
| | | {
|
| | | var form = new DevicePanel.PanelSimpleEnvironmentButtonSettionForm();
|
| | | form.AddForm(device);
|
| | | }
|
| | | else
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | }
|
| | | //简约环境面板的按键配置
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleMultifunction)
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | //方悦面板
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
|
| | |
| | | string gwId = GatewayResourse.NowSelectGatewayId;
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | System.Threading.Thread.Sleep(2000);
|
| | | //这里主要只是获取在线状态
|
| | | var list = LocalDevice.Current.GetDeviceOnlineList(gwId);
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | if (this.Parent == null) { return; }
|
| | | //获取设备列表
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(gwId);
|
| | | var listCheck = new List<string>();
|
| | | foreach (var device in listDevice)
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | if (this.Parent == null) { return; }
|
| | | if (listCheck.Contains(device.DeviceAddr) == false)
|
| | | {
|
| | | //设置设备在线状态
|
| | | this.ReceiveDeviceStatu(list[i]);
|
| | | //只要一个回路即可
|
| | | listCheck.Add(device.DeviceAddr);
|
| | | var deviceInfo = Common.LocalDevice.Current.ReadDeviceEpointDeviceInfo(device);
|
| | | if (deviceInfo != null)
|
| | | {
|
| | | //变更在线状态
|
| | | device.IsOnline = deviceInfo.IsOnline;
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //设置设备在线状态
|
| | | this.ReceiveDeviceStatu(device);
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | | System.Threading.Thread.Sleep(30);
|
| | | }
|
| | |
|
| | | }, ShowErrorMode.NO);
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
|
| | | if (localDevice != null)
|
| | | {
|
| | | //在线状态一样的话,不需要刷新
|
| | | if (localDevice.IsOnline != device.IsOnline)
|
| | | {
|
| | | //保存状态
|
| | | localDevice.IsOnline = device.IsOnline;
|
| | | localDevice.ReSave();
|
| | | }
|
| | | //保存状态
|
| | | localDevice.IsOnline = device.IsOnline;
|
| | | }
|
| | |
|
| | | rowInfo.MenuRow.IsOnline = Common.LocalDevice.Current.CheckDeviceIsOnline(device);
|
| | |
| | | /// <param name="list">ota设备</param>
|
| | | private void CheckDeviceNewVersion(List<OTADevice> list)
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | await System.Threading.Tasks.Task.Delay(2000);
|
| | | System.Threading.Thread.Sleep(2000);
|
| | | foreach (var ota in list)
|
| | | {
|
| | | if (this.Parent == null)
|
| | |
| | | return;
|
| | | }
|
| | | //添加升级固件信息(成不成功都无所谓)
|
| | | var result = await HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
|
| | | var result = HdlFirmwareUpdateLogic.AddFirmwareVersionInfo(FirmwareLevelType.ZigbeeDevice, ota.HwVersion.ToString(), ota.ImgTypeId.ToString());
|
| | |
|
| | | //获取设备最新版本
|
| | | var deviceFirmware = HdlFirmwareUpdateLogic.GetFirmwareMostVersionInfo(FirmwareLevelType.ZigbeeDevice,
|
| | |
| | | }
|
| | |
|
| | | //拥有新版本
|
| | | Application.RunOnMainThread(() =>
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | if (this.dicRowInfo.ContainsKey(ota.DeviceAddr) == true)
|
| | | {
|
| | |
| | | if (device == null || device.DeviceAddr == null)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | //获取设备类型的
|
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device });
|
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_SimpleEnvironment)
|
| | | {
|
| | | foreach (var outClu in device.OutClusterList)
|
| | | {
|
| | | //去掉简约环境面板类的各种服务端设备,室内机不显示
|
| | | if (outClu.OutCluster == 513)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (dic.ContainsKey(device.DeviceAddr) == false)
|
| | | {
|
| | |
| | | }
|
| | | #endregion
|
| | |
|
| | | #region ■ 自定义智能音箱控件_____________________
|
| | | #region ■ 自定义智能音箱控件_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自定义网关控件
|