| | |
| | | { |
| | | cardContr = new Controls.DevicePmSensorRowControl(); |
| | | } |
| | | // 空气质量传感器 |
| | | else if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | //获取设备类型 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | cardContr = new Controls.DeviceAirQualitySensorRowControl(); |
| | | } |
| | | } |
| | | //彩灯(调光器) |
| | | else if (device.Type == DeviceType.DimmableLight) |
| | | { |
| | |
| | | } |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | int sendCount = 0; |
| | | while (listView.Parent != null) |
| | | { |
| | | bool hadSend = false; |
| | |
| | | //发送获取状态的命令 |
| | | listContr[i].SendStatuComand(); |
| | | hadSend = true; |
| | | System.Threading.Thread.Sleep(200); |
| | | System.Threading.Thread.Sleep(300); |
| | | } |
| | | } |
| | | if (hadSend == false) |
| | |
| | | //如果已经全部回路都接收了网关回复,则不再二次发送 |
| | | break; |
| | | } |
| | | System.Threading.Thread.Sleep(2000); |
| | | sendCount++; |
| | | if (sendCount == 2) |
| | | { |
| | | //就发2次 |
| | | break; |
| | | } |
| | | System.Threading.Thread.Sleep(5000); |
| | | } |
| | | |
| | | }, ShowErrorMode.NO); |