old mode 100755
new mode 100644
| | |
| | | using ZigBee.Device; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.UserView; |
| | | using Shared.Phone.Device.DeviceLogic; |
| | | |
| | | namespace Shared.Phone.Device.AC |
| | | { |
| | |
| | | return; |
| | | } |
| | | deviceUI.CommonDevice.DeviceStatusReport = common.DeviceStatusReport; |
| | | var curTemp = (attriButeList[0].AttriButeData / 100 < ACControlBase.Temperature_High || attriButeList[0].AttriButeData / 100 > ACControlBase.Temperature_Low) ? attriButeList[0].AttriButeData / 100 : ACControlBase.Temperature_Default; |
| | | switch (attriButeList[0].AttributeId) |
| | | foreach(var attList in attriButeList) |
| | | { |
| | | case 0: |
| | | ac.currentLocalTemperature = curTemp; |
| | | ac.LastDateTime = DateTime.Now; |
| | | indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} ℃"; |
| | | //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} ℃"; |
| | | break; |
| | | |
| | | case 17: |
| | | ac.currentCoolingSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint; |
| | | } |
| | | |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case 18: |
| | | ac.currentHeatingSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 4) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint; |
| | | } |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case 4096: |
| | | ac.currentAutoSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 1) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentAutoSetpoint; |
| | | } |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | |
| | | case 28: |
| | | //此属性描述恒温设备正处于哪种模式 |
| | | //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8 |
| | | ac.currentSystemMode = attriButeList[0].AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | if (ac.currentSystemMode == 0) |
| | | { |
| | | switchBtn.IsSelected = false; |
| | | modeBtn.IsSelected = false; |
| | | var curTemp = (attList.AttriButeData / 100 < ACControlBase.Temperature_High && attList.AttriButeData / 100 > ACControlBase.Temperature_Low) ? attList.AttriButeData / 100 : ACControlBase.Temperature_Default; |
| | | switch (attList.AttributeId) |
| | | { |
| | | case 0: |
| | | ac.currentLocalTemperature = curTemp; |
| | | ac.LastDateTime = DateTime.Now; |
| | | indoorTemperatureBtn.Text = $"{Language.StringByID(R.MyInternationalizationString.Current)} {ac.currentLocalTemperature} ℃"; |
| | | //currentTemperatureBtn.Text = $"{ac.currentLocalTemperature} ℃"; |
| | | break; |
| | | case 17: |
| | | ac.currentCoolingSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentCoolingSetpoint; |
| | | } |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | case 18: |
| | | ac.currentHeatingSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 4) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentHeatingSetpoint; |
| | | } |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | case 4096: |
| | | ac.currentAutoSetpoint = curTemp; |
| | | if (ac.currentSystemMode == 1) |
| | | { |
| | | mArcScaleSeekBar.Progress = ac.currentAutoSetpoint; |
| | | } |
| | | ac.LastDateTime = DateTime.Now; |
| | | break; |
| | | case 28: |
| | | //此属性描述恒温设备正处于哪种模式 |
| | | //Off = 0 Auto = 1 Cool = 3 Heat = 4 FanOnly = 7 Dry = 8 |
| | | ac.currentSystemMode = attList.AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | if (ac.currentSystemMode == 0) |
| | | { |
| | | switchBtn.IsSelected = false; |
| | | modeBtn.IsSelected = false; |
| | | fanModeBtn.IsSelected = false; |
| | | FanSwingModeBtn.IsSelected = false; |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); |
| | | } |
| | | else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8) |
| | | { |
| | | switchBtn.IsSelected = true; |
| | | modeBtn.IsSelected = true; |
| | | fanModeBtn.IsSelected = true; |
| | | FanSwingModeBtn.IsSelected = true; |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); |
| | | } |
| | | modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode); |
| | | modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode); |
| | | currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode); |
| | | |
| | | mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac); |
| | | |
| | | fanModeBtn.IsSelected = false; |
| | | FanSwingModeBtn.IsSelected = false; |
| | | } |
| | | else if (ac.currentSystemMode == 1 || ac.currentSystemMode == 3 || ac.currentSystemMode == 4 || ac.currentSystemMode == 7 || ac.currentSystemMode == 8) |
| | | { |
| | | switchBtn.IsSelected = true; |
| | | modeBtn.IsSelected = true; |
| | | modeBtn.SelectedImagePath = ACControlBase.GetModeSelectedImagePathByModeId(ac.currentSystemMode); |
| | | modeBtn.UnSelectedImagePath = ACControlBase.GetModeUnSelectedImagePathByModeId(ac.currentSystemMode); |
| | | currentModeBtn.Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode); |
| | | |
| | | mArcScaleSeekBar.Progress = ACControlBase.GetCurrentModeTemperature(ac); |
| | | fanModeBtn.IsSelected = true; |
| | | FanSwingModeBtn.IsSelected = true; |
| | | } |
| | | break; |
| | | |
| | | case 4097: |
| | | //过虑网清洗标志:42 |
| | | ac.CleanStatu = attriButeList[0].AttriButeData == 42; |
| | | cleanStatu.Visible = ac.CleanStatu; |
| | | break; |
| | | |
| | | case 4099: |
| | | var value = Convert.ToString(attriButeList[0].AttriButeData, 2).PadLeft(16, '0'); |
| | | var modeStr = value.Substring(value.Length - 5, 5); |
| | | for (int j = 0; j < modeStr.Length; j++) |
| | | { |
| | | ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0; |
| | | } |
| | | break; |
| | | |
| | | mArcScaleSeekBar.IsClickable = ACControlBase.IsOpen(ac); |
| | | break; |
| | | case 4097: |
| | | //过虑网清洗标志:42 |
| | | ac.CleanStatu = attList.AttriButeData == 42; |
| | | cleanStatu.Visible = ac.CleanStatu; |
| | | break; |
| | | case 4099: |
| | | var value = Convert.ToString(attList.AttriButeData, 2).PadLeft(16, '0'); |
| | | var modeStr = value.Substring(value.Length - 5, 5); |
| | | for (int j = 0; j < modeStr.Length; j++) |
| | | { |
| | | ac.listSupportMode[j] = Convert.ToInt32(modeStr[j]) == 49 ? 1 : 0; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (common.DeviceStatusReport.CluterID == 514) |
| | | { |
| | | var attriButeList = common.DeviceStatusReport.AttriBute; |
| | | if (attriButeList == null || attriButeList.Count == 0) |
| | | { |
| | | return; |
| | | } |
| | | ac.DeviceStatusReport = common.DeviceStatusReport; |
| | | switch (attriButeList[0].AttributeId) |
| | | foreach(var attList in attriButeList) |
| | | { |
| | | case 0: |
| | | //风扇当前的工作模式 1=Low 2=Medium 3=High |
| | | ac.currentFanMode = attriButeList[0].AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | fanModeBtn.IsSelected = true; |
| | | fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode); |
| | | fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode); |
| | | break; |
| | | case 4096: |
| | | //风扇当前的扫风模式 |
| | | ac.currentFanSwingMode = attriButeList[0].AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | FanSwingModeBtn.IsSelected = true; |
| | | FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode); |
| | | FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode); |
| | | break; |
| | | switch (attList.AttributeId) |
| | | { |
| | | case 0: |
| | | //风扇当前的工作模式 1=Low 2=Medium 3=High |
| | | ac.currentFanMode = attList.AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | fanModeBtn.IsSelected = true; |
| | | fanModeBtn.SelectedImagePath = ACControlBase.GetFanModeSelectedImagePathByFanModeId(ac.currentFanMode); |
| | | fanModeBtn.UnSelectedImagePath = ACControlBase.GetFanModeUnSelectedImagePathByFanModeId(ac.currentFanMode); |
| | | break; |
| | | case 4096: |
| | | //风扇当前的扫风模式 |
| | | ac.currentFanSwingMode = attList.AttriButeData; |
| | | ac.LastDateTime = DateTime.Now; |
| | | FanSwingModeBtn.IsSelected = true; |
| | | FanSwingModeBtn.SelectedImagePath = ACControlBase.GetFanSwingModeSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode); |
| | | FanSwingModeBtn.UnSelectedImagePath = ACControlBase.GetFanSwingModeUnSelectedImagePathByFanSwingModeId(ac.currentFanSwingMode); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | //***新改 * **设备状态上报中,当CluterID = 3,证明设备在线,直接标记 |
| | |
| | | //发送读取状态命令 |
| | | UserView.UserHomeView.ReadStatus(ac, () => |
| | | { |
| | | ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ac.ReadLocalTemperature(); |
| | | ac.ReadCoolingSetpoint(); |
| | | ac.ReadHeatingSetpoint(); |
| | | ac.ReadAutoSetpoint(); |
| | | ac.ReadFanMode(); |
| | | ac.ReadSystemMode(); |
| | | ac.ReadSystemFansSwingMode(); |
| | | ac.ReadModeSupport(); |
| | | ac.ReadCleanStatu(); |
| | | ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取设备状态 |
| | | if ((DateTime.Now - ac.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | ac.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | ac.ReadLocalTemperature(); |
| | | ac.ReadCoolingSetpoint(); |
| | | ac.ReadHeatingSetpoint(); |
| | | ac.ReadAutoSetpoint(); |
| | | ac.ReadFanMode(); |
| | | ac.ReadSystemMode(); |
| | | ac.ReadSystemFansSwingMode(); |
| | | ac.ReadModeSupport(); |
| | | ac.ReadCleanStatu(); |
| | | ReadDeviceAttributeLogic.Instance.SendACStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | |
| | |
| | | var deviceNameBtn = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(184), |
| | | Width = Application.GetRealWidth(500), |
| | | Width = Application.GetRealWidth(600), |
| | | Height = Application.GetRealHeight(60), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Text = device.CommonDevice.DeviceEpointName, |
| | |
| | | Width = Application.GetRealWidth(671), |
| | | Height = Application.GetRealHeight(671), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | MinValue=ACControlBase.Temperature_Low, |
| | | MaxValue=ACControlBase.Temperature_High, |
| | | Progress=ACControlBase.GetCurrentModeTemperature(ac) |
| | | MinValue = ACControlBase.Temperature_Low, |
| | | MaxValue = ACControlBase.Temperature_High, |
| | | Progress = ACControlBase.GetCurrentModeTemperature(ac), |
| | | IsClickable = ACControlBase.IsOpen(ac) |
| | | }; |
| | | itemView.AddChidren(mArcScaleSeekBar); |
| | | if(ACControlBase.IsOpen(ac)) |
| | | { |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); |
| | | } |
| | | else |
| | | { |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); |
| | | } |
| | | mArcScaleSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | if (ac.currentSystemMode == 3 || ac.currentSystemMode == 8) |
| | |
| | | |
| | | currentModeBtn = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(599), |
| | | Y = Application.GetRealHeight(565), |
| | | Height = Application.GetRealHeight(80), |
| | | Width = Application.GetRealWidth(200), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | |
| | | Text = ACControlBase.GetModeNameByModeId(ac.currentSystemMode) |
| | | }; |
| | | itemView.AddChidren(currentModeBtn); |
| | | |
| | | |
| | | reduceTemperatureBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(268), |
| | | Y = Application.GetRealHeight(680), |
| | | Y = Application.GetRealHeight(650), |
| | | Width = Application.GetMinRealAverage(80), |
| | | Height = Application.GetMinRealAverage(80), |
| | | UnSelectedImagePath = "AC/Reduce.png" |
| | |
| | | |
| | | addTemperatureBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(628), |
| | | Y = Application.GetRealHeight(680), |
| | | X = Application.GetRealWidth(610), |
| | | Y = Application.GetRealHeight(650), |
| | | Width = Application.GetMinRealAverage(80), |
| | | Height = Application.GetMinRealAverage(80), |
| | | UnSelectedImagePath = "AC/Add.png" |
| | |
| | | private void Switch_MouseUpEvent(object sender, MouseEventArgs mouseEventArgs) |
| | | { |
| | | switchBtn.IsSelected = !switchBtn.IsSelected; |
| | | mArcScaleSeekBar.IsClickable = switchBtn.IsSelected; |
| | | if (switchBtn.IsSelected == true) |
| | | { |
| | | ac.Open(); |
| | | modeBtn.IsSelected = true; |
| | | fanModeBtn.IsSelected = true; |
| | | FanSwingModeBtn.IsSelected = true; |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCArcScaleSeekBarStartColor, ZigbeeColor.Current.GXCArcScaleSeekBarEndColor); |
| | | } |
| | | else |
| | | { |
| | |
| | | modeBtn.IsSelected = false; |
| | | fanModeBtn.IsSelected = false; |
| | | FanSwingModeBtn.IsSelected = false; |
| | | mArcScaleSeekBar.SetProgressBarColors(ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor, ZigbeeColor.Current.GXCWaveSeekBarUnSelectedColor); |
| | | } |
| | | } |
| | | |
| | |
| | | Width = Application.GetRealWidth(modeItem_Width - modeItem_X), |
| | | Height = Application.GetRealHeight(modeItem_Height), |
| | | TextColor = ZigbeeColor.Current.GXCTextBlackColor, |
| | | TextID = R.MyInternationalizationString.SelectFanMode, |
| | | TextID = R.MyInternationalizationString.SelectMode, |
| | | TextAlignment = TextAlignment.CenterLeft |
| | | }; |
| | | changeModeFL.AddChidren(changeModeBtn); |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #region ◆ 控制反馈_________________________ |
| | | |