| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Org.BouncyCastle.Bcpg.OpenPgp; |
| | | using Shared.Common; |
| | | using ZigBee.Common; |
| | | using ZigBee.Device; |
| | |
| | | /// PM目标名字 |
| | | /// </summary> |
| | | private string bindPmName = string.Empty; |
| | | /// <summary> |
| | | /// 被绑目标是新风 |
| | | /// </summary> |
| | | private CommonDevice bindFreshAirDev; |
| | | /// <summary> |
| | | /// 被绑目标是温度 |
| | | /// </summary> |
| | | private CommonDevice bindTemperatureDev; |
| | | /// <summary> |
| | | /// 被绑目标是湿度 |
| | | /// </summary> |
| | | private CommonDevice bindHumidityDev; |
| | | /// <summary> |
| | | /// 被绑目标是PM2.5 |
| | | /// </summary> |
| | | private CommonDevice bindPMDev; |
| | | |
| | | #endregion |
| | |
|
| | | |
| | | #region ■ 初始化_____________________________
|
| | | |
| | | /// <summary>
|
| | |
| | | public void ShowForm(CommonDevice i_device)
|
| | | {
|
| | | this.deviceObj = i_device;
|
| | | //获取数据
|
| | | ReadDoorLockUserInfo(deviceObj);
|
| | | //获取数据 |
| | | ReadDoorLockUserInfo(deviceObj); |
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uPanelSettion));
|
| | |
| | | this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uDeviceEditor), 1028);
|
| | |
|
| | | //初始化菜单行
|
| | | this.InitMenuRow(); |
| | | |
| | | //初始化桌布完成 |
| | | this.InitMenuRow();
|
| | |
|
| | | //初始化桌布完成
|
| | | tableContr.FinishInitControl();
|
| | | tableContr = null;
|
| | |
|
| | |
| | | {
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | }; |
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化菜单行
|
| | | /// </summary>
|
| | | private void InitMenuRow()
|
| | | { |
| | | {
|
| | | this.listview.RemoveAll();
|
| | | //添加新风目标 |
| | | this.AddFreshAirRow(); |
| | |
| | | }); |
| | | } |
| | | #endregion |
| | | |
| | |
|
| | | #region ■ 新风目标_________________________ |
| | | /// <summary> |
| | | /// 新风目标行 |
| | |
| | | //底线
|
| | | rowNewWind.AddBottomLine();
|
| | | //右箭头
|
| | | rowNewWind.AddRightArrow(); |
| | | rowNewWind.AddRightArrow();
|
| | | |
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing);
|
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | if (!string.IsNullOrEmpty(bindFreshAirName)) |
| | | { |
| | | msg = bindFreshAirName; |
| | | } |
| | | var btnNewWindStatu = rowNewWind.AddMostRightView(msg, 700);
|
| | |
|
| | | |
| | | rowNewWind.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 1); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindFreshAirDev, 1); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | }); |
| | | }; |
| | | |
| | | //var form = new PanelFangyueFreshAirTargetForm(); |
| | | //form.AddForm(this.deviceObj, string.Empty, 3); |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | curControlDev.bindList.Add(bDev); |
| | | var device = Common.LocalDevice.Current.GetDevice(bDev.BindMacAddr, bDev.BindEpoint); |
| | | |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | //新风面板的新风设备,则不显示 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | if (device.Type == DeviceType.FreshAir) |
| | | { |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { device }); |
| | | //新风面板的新风设备,则不显示 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | | continue; |
| | | } |
| | | bindFreshAirName = device.DeviceEpointName; |
| | | bindFreshAirDev = device; |
| | | } |
| | | if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | bindTemperatureName = device.DeviceEpointName; |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | { |
| | | bindTemperatureName = device.DeviceEpointName; |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bD.SensorDiv == 2) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | | { |
| | | bindHumidityName = device.DeviceEpointName; |
| | | bindHumidityDev = device; |
| | | } |
| | | //if (device.Type == DeviceType.FreshAir) |
| | | //{ |
| | | // bindPmName = device.DeviceEpointName; |
| | | //} |
| | | if (device.Type == DeviceType.PMSensor) |
| | | { |
| | | bindPmName = device.DeviceEpointName; |
| | | bindPMDev = device; |
| | | } |
| | | } |
| | | result = true; |
| | | } |
| | |
| | | var btnPMStatu = rowPM.AddMostRightView(msg, 700); |
| | | rowPM.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 4); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindPMDev, 4); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | var btnTemperatureStatu = rowTemPerature.AddMostRightView(msg, 700); |
| | | rowTemPerature.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 2); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindTemperatureDev, 2); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |
| | |
| | | var btnHumidityStatu = rowHumidity.AddMostRightView(msg, 700); |
| | | rowHumidity.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, 3); |
| | | var addDevicePage = new Shared.Phone.UserCenter.DeviceBind.PanelFangyueFreshAirTargetsForm(this.deviceObj, bindHumidityDev, 3); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(addDevicePage); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | addDevicePage.Show(); |