| | |
| | | /// <summary> |
| | | /// PM目标名字 |
| | | /// </summary> |
| | | private string bindPmName = string.Empty; |
| | | private string bindPMName = string.Empty; |
| | | /// <summary> |
| | | /// Co2目标名字 |
| | | /// </summary> |
| | | private string bindCo2Name = string.Empty; |
| | | /// <summary> |
| | | /// 被绑目标是空调 |
| | | /// </summary> |
| | |
| | | /// 被绑目标是PM2.5 |
| | | /// </summary> |
| | | private CommonDevice bindPMDev; |
| | | /// <summary> |
| | | /// 被绑目标是PM2.5 |
| | | /// </summary> |
| | | private CommonDevice bindCo2Dev; |
| | | // <summary> |
| | | /// 按键中被绑定的目标列表 |
| | | /// </summary> |
| | |
| | | bodyFrameLayout.AddChidren(btnFinish); |
| | | btnFinish.ButtonClickEvent += (sender, e) => |
| | | { |
| | | //关闭自身 |
| | | this.CloseForm(); |
| | | //关闭自身 |
| | | this.CloseForm(); |
| | | }; |
| | | } |
| | | |
| | |
| | | this.AddTemperatureSensorRow(); |
| | | //添加湿度来源 |
| | | this.AddHumiditySourceRow(); |
| | | //添加CO2来源 |
| | | //this.AddCO2Row(); |
| | | //数据矫正 |
| | | this.DataCorrectionRow(); |
| | | //亮度调节 |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | CommonPage.Loading.Start(""); |
| | | }); |
| | | |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); |
| | | bool result = false; |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.InitMenuRow(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | this.InitMenuRow(); |
| | | CommonPage.Loading.Hide(); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | } |
| | | else if (device.Type == DeviceType.TemperatureSensor) |
| | | { |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindTemperatureDev = device; |
| | | if (bDev.BindCluster == 1026) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | bindTemperatureDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1029) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | bindHumidityDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1066) |
| | | { |
| | | bindPMName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindPMDev = device; |
| | | } |
| | | if (bDev.BindCluster == 1037) |
| | | { |
| | | bindCo2Name = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindCo2Dev = device; |
| | | } |
| | | } |
| | | if (bD.SensorDiv == 2) |
| | | else |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindHumidityDev = device; |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindTemperatureDev = device; |
| | | } |
| | | else if (bD.SensorDiv == 2) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | } |
| | | else if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | |
| | | } |
| | | if (bDev.BindCluster == 1066) |
| | | { |
| | | bindPmName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindPMName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindPMDev = device; |
| | | } |
| | | } |
| | |
| | | var bD = device as TemperatureSensor; |
| | | if (bD.SensorDiv == 1) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindTemperatureDev = device; |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | if (bDev.BindCluster == 1026) |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.TemperatureSensor); |
| | | bindTemperatureDev = device; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | bindTemperatureName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindTemperatureDev = device; |
| | | } |
| | | } |
| | | if (bD.SensorDiv == 2) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device); |
| | | bindHumidityDev = device; |
| | | } |
| | | |
| | | //空气质量传感器 |
| | | if (deviceEnumInfo.ConcreteType == Common.DeviceConcreteType.AirQualitySensor) |
| | | { |
| | | if (bDev.BindCluster == 1029) |
| | | { |
| | | bindHumidityName = Common.LocalDevice.Current.GetDeviceEpointName(device) + "-" + Language.StringByID(R.MyInternationalizationString.HumiditySensor); |
| | | bindHumidityDev = device; |
| | | } |
| | | } |
| | | } |
| | | else if (device.Type == DeviceType.FreshAirHumiditySensor) |
| | |
| | | |
| | | paneTargetsBaseFormp.actionAcTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnAcStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | } |
| | | else |
| | | { |
| | | btnAcStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnAcStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindAcDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnAcStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | |
| | | rowNewWind.ButtonClickEvent += (sender, e) => |
| | | { |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); |
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueFreshAir) |
| | | { |
| | | this.deviceObj.DeviceEpoint = 1; |
| | |
| | | paneTargetsBaseFormp.Show(); |
| | | paneTargetsBaseFormp.actionFreshAirTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnNewWindStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | } |
| | | else |
| | | { |
| | | btnNewWindStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnNewWindStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindFreshAirDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnNewWindStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | //右箭头 |
| | | rowPM.AddRightArrow(); |
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | if (!string.IsNullOrEmpty(bindPmName)) |
| | | if (!string.IsNullOrEmpty(bindPMName)) |
| | | { |
| | | msg = bindPmName; |
| | | msg = bindPMName; |
| | | } |
| | | var btnPMStatu = rowPM.AddMostRightView(msg, 700); |
| | | rowPM.ButtonClickEvent += (sender, e) => |
| | |
| | | paneTargetsBaseFormp.Show(); |
| | | paneTargetsBaseFormp.actionPMTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPMStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | } |
| | | else |
| | | { |
| | | btnPMStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnPMStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindPMDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnPMStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | paneTargetsBaseFormp.Show(); |
| | | paneTargetsBaseFormp.actionTemperatureTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnTemperatureStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | } |
| | | else |
| | | { |
| | | btnTemperatureStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnTemperatureStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindTemperatureDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnTemperatureStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | paneTargetsBaseFormp.Show(); |
| | | paneTargetsBaseFormp.actionHumidityTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnHumidityStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindHumidityDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnHumidityStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | | |
| | | #region ■ CO2来源_________________________ |
| | | /// <summary> |
| | | /// CO2来源行 |
| | | /// </summary> |
| | | private void AddCO2Row() |
| | | { |
| | | //获取设备类型的 |
| | | var deviceEnumInfo = Common.LocalDevice.Current.GetMyDeviceEnumInfo(new List<CommonDevice>() { deviceObj }); |
| | | if (deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_FangyueEnvironment || deviceEnumInfo.ConcreteType == DeviceConcreteType.ButtonPanel_SimpleEnvironment) |
| | | { |
| | | return; |
| | | } |
| | | //CO2 |
| | | var rowCo2 = new FrameRowControl(listview.rowSpace / 2); |
| | | listview.AddChidren(rowCo2); |
| | | rowCo2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.CO2Source), 600); |
| | | //底线 |
| | | rowCo2.AddBottomLine(); |
| | | //右箭头 |
| | | rowCo2.AddRightArrow(); |
| | | var msg = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | if (!string.IsNullOrEmpty(bindCo2Name)) |
| | | { |
| | | msg = bindCo2Name; |
| | | } |
| | | var btnCo2Statu = rowCo2.AddMostRightView(msg, 700); |
| | | rowCo2.ButtonClickEvent += (sender, e) => |
| | | { |
| | | this.deviceObj.DeviceEpoint = 1; |
| | | var paneTargetsBaseFormp = new PaneTargetsBaseForm(this.deviceObj, bindPMDev, BindInfo.BindType.CO2); |
| | | Shared.Phone.UserView.HomePage.Instance.AddChidren(paneTargetsBaseFormp); |
| | | Shared.Phone.UserView.HomePage.Instance.PageIndex += 1; |
| | | paneTargetsBaseFormp.Show(); |
| | | paneTargetsBaseFormp.actionPMTarget += (bindName) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | if (string.IsNullOrEmpty(bindName)) |
| | | { |
| | | btnHumidityStatu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | } |
| | | else |
| | | { |
| | | btnHumidityStatu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | btnCo2Statu.Text = Language.StringByID(R.MyInternationalizationString.nothing); |
| | | bindPMDev = null; |
| | | } |
| | | else |
| | | { |
| | | btnCo2Statu.Text = bindName; |
| | | } |
| | | }); |
| | | }; |
| | | }; |
| | | } |
| | | #endregion |
| | |
| | | btnIcon.InitControl(); |
| | | btnIcon.ButtonClickEvent += ((sender, e) => |
| | | { |
| | | //显示右上角菜单界面 |
| | | this.ShowTopRightMenu(); |
| | | //显示右上角菜单界面 |
| | | this.ShowTopRightMenu(); |
| | | }); |
| | | } |
| | | |
| | |
| | | string deviceMenu = Language.StringByID(R.MyInternationalizationString.uFixedPosition); |
| | | frame.AddRowMenu(deviceMenu, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () => |
| | | { |
| | | //发送定位功能 |
| | | Common.LocalDevice.Current.SetFixedPositionCommand(deviceObj); |
| | | //发送定位功能 |
| | | Common.LocalDevice.Current.SetFixedPositionCommand(deviceObj); |
| | | }); |
| | | } |
| | | |