| | |
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | this.ScrollEnabled = false;
|
| | |
|
| | | //设置标题信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.DeviceManagement));
|
| | |
|
| | |
| | | //获取设备列表
|
| | | string gwID = HdlGatewayLogic.Current.GetGatewayId(GatewayResourse.NowSelectGateway);
|
| | | var listDevice = Common.LocalDevice.Current.GetDeviceByGatewayID(gwID);
|
| | | var listSpecialOta = Common.LocalDevice.Current.GetSpecialOtaDevice(gwID);
|
| | | listDevice.AddRange(listSpecialOta);
|
| | |
|
| | | this.dicRowInfo.Clear();
|
| | |
|
| | |
| | |
|
| | | //检测设备是否拥有定位的功能
|
| | | var listdevice = Common.LocalDevice.Current.GetDevicesByMac(deviceMac);
|
| | | if (Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
|
| | | if (listdevice.Count > 0 && Common.LocalDevice.Current.DeviceIsCanFixedPosition(listdevice[0]) == true)
|
| | | {
|
| | | //定位
|
| | | var btnPosition = new NormalViewControl(Application.GetRealWidth(184), rowMenu.Height, false);
|
| | |
| | | var form = new DeviceAirConditioner.IndoorUnitSettionForm();
|
| | | form.AddForm((AC)device);
|
| | | }
|
| | | //环境面板
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment)
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | //方悦面板
|
| | | else if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueTwo
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFour
|
| | | || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEight)
|
| | | {
|
| | | //干接点
|
| | | if (device.Type == DeviceType.OnOffSwitch)
|
| | | {
|
| | | //方悦面板的按键配置
|
| | | var form = new DevicePanel.PanelFangyueButtonSettionForm();
|
| | | form.AddForm(device);
|
| | | }
|
| | | //继电器
|
| | | else if (device.Type == DeviceType.OnOffOutput)
|
| | | {
|
| | | //方悦面板的功能配置
|
| | | var form = new DevicePanel.PanelFangyueButtonSettionForm();
|
| | | form.AddForm(device);
|
| | | }
|
| | | else
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | }
|
| | | //面板设备
|
| | | else if (deviceEnumInfo.BeloneType == DeviceBeloneType.A按键面板)
|
| | | {
|
| | |
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | }
|
| | | //温湿度
|
| | | else if (device.Type == DeviceType.TemperatureSensor)
|
| | | {
|
| | | var form = new DeviceFunctionSettionForm();
|
| | | form.AddForm(device, true);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | var localDevice = Common.LocalDevice.Current.GetDevicesByMac(deviceAddr);
|
| | | if (localDevice.Count == 0)
|
| | | {
|
| | | //入网之后,又把它删了
|
| | | return;
|
| | | //针对单纯只有一个200端点的设备
|
| | | var ota = Common.LocalDevice.Current.GetOTADevice(deviceAddr);
|
| | | if (ota == null)
|
| | | {
|
| | | //入网之后,又把它删了
|
| | | return;
|
| | | }
|
| | | localDevice.Add(ota);
|
| | | }
|
| | | var rowNewInfo = new DeviceObjRowInfo();
|
| | | rowNewInfo.DeviceMac = deviceAddr;
|
| | |
| | | if (this.nowActionDeviceMac != null)
|
| | | {
|
| | | var rowInfo = this.dicRowInfo[nowActionDeviceMac];
|
| | | //检测这个设备是否被删除
|
| | | if (Common.LocalDevice.Current.GetDevicesByMac(nowActionDeviceMac).Count == 0)
|
| | | //检测这个设备是否被删除 2020.01.13变更:追加Ota设备的判断
|
| | | if (Common.LocalDevice.Current.GetDevicesByMac(nowActionDeviceMac).Count == 0
|
| | | && Common.LocalDevice.Current.GetOTADevice(nowActionDeviceMac) == null)
|
| | | {
|
| | | //移除控件
|
| | | rowInfo.dicDetailRow = null;
|