| | |
| | | /// 激活的设备地址
|
| | | /// </summary>
|
| | | private string actionDeviceKeys = null;
|
| | | /// <summary>
|
| | | /// 接收回复的端点
|
| | | /// </summary>
|
| | | private HashSet<int> listReceivePoint = new HashSet<int>();
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// <param name="i_diviceMac">设备Mac地址</param>
|
| | | public void ShowForm(string i_diviceMac)
|
| | | {
|
| | | this.listDevice = Common.LocalDevice.Current.GetDevicesByMac(i_diviceMac);
|
| | | this.listDevice = HdlDeviceCommonLogic.Current.GetDevicesByMac(i_diviceMac);
|
| | | //收集全部端点
|
| | | foreach (var device in this.listDevice)
|
| | | {
|
| | | listReceivePoint.Add(device.DeviceEpoint);
|
| | | }
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uIndoorUnitSettion));
|
| | |
|
| | |
| | |
|
| | | var btnIcon = new IconViewControl(78);
|
| | | btnIcon.Gravity = Gravity.Center;
|
| | | Common.LocalDevice.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | HdlDeviceCommonLogic.Current.SetDeviceIconToControl(btnIcon, device);
|
| | | btnIconBack.AddChidren(btnIcon);
|
| | | frameTable.ChangedChidrenBindMode(btnIconBack, ChidrenBindMode.BindEvent);
|
| | | rowInfo.btnIcon = btnIcon;
|
| | |
|
| | | //设备名称
|
| | | var btnDeviceName = new NormalViewControl(700, 60, true);
|
| | | btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
|
| | | btnDeviceName.X = Application.GetRealWidth(193);
|
| | | btnDeviceName.Y = Application.GetRealHeight(45);
|
| | | frameTable.AddChidren(btnDeviceName, ChidrenBindMode.BindEvent);
|
| | |
| | |
|
| | | frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | this.actionDeviceKeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | this.actionDeviceKeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
|
| | |
|
| | | var form = new IndoorUnitSettionForm();
|
| | | form.AddForm(device);
|
| | | };
|
| | |
|
| | | dicControl[Common.LocalDevice.Current.GetDeviceMainKeys(device)] = rowInfo;
|
| | | dicControl[HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device)] = rowInfo;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | }
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | for (int i = 0; i < listDevice.Count; i++)
|
| | | while (this.listReceivePoint.Count > 0 && this.Parent != null)
|
| | | {
|
| | | if (this.Parent == null)
|
| | | for (int i = 0; i < listDevice.Count; i++)
|
| | | {
|
| | | return;
|
| | | if (this.Parent == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //已经发送过了,就不用再发送
|
| | | if (this.listReceivePoint.Contains(listDevice[i].DeviceEpoint) == true)
|
| | | {
|
| | | //读取状态
|
| | | HdlDeviceAttributeLogic.Current.SendThermostatStatuComand(listDevice[i]);
|
| | | System.Threading.Thread.Sleep(200);
|
| | | }
|
| | | }
|
| | | //读取状态
|
| | | HdlDeviceAttributeLogic.Current.SendThermostatStatuComand(listDevice[i]);
|
| | | System.Threading.Thread.Sleep(200);
|
| | | //3秒后再次循环
|
| | | System.Threading.Thread.Sleep(3000);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | {
|
| | | HdlGatewayReceiveLogic.Current.AddAttributeEvent("IndoorUnitListFormEvent", ReceiveComandDiv.A设备属性上报, (device) =>
|
| | | {
|
| | | string mainkeys = Common.LocalDevice.Current.GetDeviceMainKeys(device);
|
| | | string mainkeys = HdlDeviceCommonLogic.Current.GetDeviceMainKeys(device);
|
| | | if (dicControl.ContainsKey(mainkeys) == false || device.DeviceStatusReport.CluterID != 513)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var localDevice = Common.LocalDevice.Current.GetDevice(mainkeys);
|
| | | var localDevice = HdlDeviceCommonLogic.Current.GetDevice(mainkeys);
|
| | | if (localDevice == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | //已经接收到数据,则移除端点
|
| | | this.listReceivePoint.Remove(device.DeviceEpoint);
|
| | |
|
| | | var rowInfo = dicControl[mainkeys];
|
| | | for (int i = 0; i < device.DeviceStatusReport.AttriBute.Count; i++)
|
| | |
| | | if (this.actionDeviceKeys != null && dicControl.ContainsKey(this.actionDeviceKeys) == true)
|
| | | {
|
| | | //刷新设备信息
|
| | | var device = Common.LocalDevice.Current.GetDevice(this.actionDeviceKeys);
|
| | | var device = HdlDeviceCommonLogic.Current.GetDevice(this.actionDeviceKeys);
|
| | | if (device != null)
|
| | | {
|
| | | var contr = dicControl[this.actionDeviceKeys];
|
| | | contr.btnDeviceName.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
|
| | | contr.btnDeviceName.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
|
| | | contr.btnRoom.Text = HdlRoomLogic.Current.GetRoomNameByDevice(device);
|
| | | }
|
| | | }
|