黄学彪
2020-04-28 e22fdb94322e6cec38e5e4a9aec13d431a133fde
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceAcDetailCardForm.cs
@@ -84,7 +84,7 @@
            //清洗滤网提示的FrameLayout
            this.frameClrean = new FrameLayout();
            frameClrean.Width = Application.GetRealWidth(600);
            frameClrean.Height = Application.GetMinRealAverage(69);
            frameClrean.Height = this.GetPictrueRealSize(69);
            frameClrean.X = ControlCommonResourse.XXLeft;
            frameClrean.Y = Application.GetRealHeight(35);
            frameWhiteBack.AddChidren(frameClrean);
@@ -117,8 +117,8 @@
            //空调控件的容器
            var frameAcBack = new FrameLayout();
            frameAcBack.Y = Application.GetRealHeight(412);
            frameAcBack.Width = Application.GetMinRealAverage(671);
            frameAcBack.Height = Application.GetMinRealAverage(671);
            frameAcBack.Width = this.GetPictrueRealSize(671);
            frameAcBack.Height = this.GetPictrueRealSize(671);
            frameAcBack.Gravity = Gravity.CenterHorizontal;
            frameWhiteBack.AddChidren(frameAcBack);
@@ -146,7 +146,7 @@
            //空调控件里面的那个显示制热,制冷的控件
            this.btnNowModeView = new NormalViewControl(200, 55, true);
            btnNowModeView.Y = Application.GetMinRealAverage(184);
            btnNowModeView.Y = this.GetPictrueRealSize(184);
            btnNowModeView.Gravity = Gravity.CenterHorizontal;
            btnNowModeView.Text = DeviceAcDetailCardMethord.GetModeNameByModeId(deviceAc.currentSystemMode);
            btnNowModeView.TextSize = 12;
@@ -157,8 +157,8 @@
            this.btnReduce = new IconViewControl(81);
            btnReduce.CanClick = isAcOpen;
            btnReduce.UnSelectedImagePath = "AC/Reduce.png";
            btnReduce.X = Application.GetMinRealAverage(132);
            btnReduce.Y = Application.GetMinRealAverage(268);
            btnReduce.X = this.GetPictrueRealSize(132);
            btnReduce.Y = this.GetPictrueRealSize(268);
            frameAcBack.AddChidren(btnReduce);
            btnReduce.ButtonClickEvent += (sender, e) =>
            {
@@ -173,7 +173,7 @@
            this.btnAdd = new IconViewControl(81);
            btnAdd.CanClick = isAcOpen;
            btnAdd.UnSelectedImagePath = "AC/Add.png";
            btnAdd.X = frameAcBack.Width - Application.GetMinRealAverage(81 + 132);
            btnAdd.X = frameAcBack.Width - this.GetPictrueRealSize(81 + 132);
            btnAdd.Y = btnReduce.Y;
            frameAcBack.AddChidren(btnAdd);
            btnAdd.ButtonClickEvent += (sender, e) =>
@@ -187,7 +187,7 @@
            //℃
            var btnUint = new NormalViewControl(100, 66, true);
            btnUint.Y = Application.GetMinRealAverage(366);
            btnUint.Y = this.GetPictrueRealSize(366);
            btnUint.Gravity = Gravity.CenterHorizontal;
            btnUint.TextAlignment = TextAlignment.Center;
            btnUint.Text = "℃";
@@ -358,14 +358,35 @@
            //发送进度值
            if (deviceAc.currentSystemMode == 3 || deviceAc.currentSystemMode == 8)
            {
                //如果住宅是虚拟住宅
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    this.canSetProgress = true;
                    deviceAc.currentCoolingSetpoint = value;
                    return;
                }
                deviceAc.SetCoolingTemperatureAsync(value * 100);
            }
            else if (deviceAc.currentSystemMode == 4)
            {
                //如果住宅是虚拟住宅
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    this.canSetProgress = true;
                    deviceAc.currentHeatingSetpoint = value;
                    return;
                }
                deviceAc.SetHeatingTemperatureAsync(value * 100);
            }
            else if (deviceAc.currentSystemMode == 1)
            {
                //如果住宅是虚拟住宅
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    this.canSetProgress = true;
                    deviceAc.currentAutoSetpoint = value;
                    return;
                }
                deviceAc.SetAutoTemperatureAsync(value * 100);
            }
        }
@@ -480,6 +501,16 @@
        /// <param name="fanSwingMode">Fan mode.</param>
        private void SetFanSwingComand(AC.FanSwingMode fanSwingMode)
        {
            //如果住宅为虚拟住宅,则直接修改缓存
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                deviceAc.currentFanSwingMode = (int)fanSwingMode;
                var tempDevice = new CommonDevice();
                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 };
                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 4096 } };
                this.CheckResponeResultStatu(ReceiveComandDiv.A设备属性上报, tempDevice);
                return;
            }
            var oldModel = (AC.FanSwingMode)deviceAc.currentFanSwingMode;
            if (oldModel == fanSwingMode)
            {
@@ -645,6 +676,32 @@
                //选择的是同一个
                return;
            }
            //如果住宅为虚拟住宅,则直接修改缓存
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                deviceAc.currentSystemMode = (int)mode;
                var tempDevice = new CommonDevice();
                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 };
                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } };
                this.CheckResponeResultStatu(ReceiveComandDiv.A设备属性上报, tempDevice);
                //送风的时候,没有温度的概念
                if (mode == AC.AcMode.FanOnly)
                {
                    //加减不可以点击
                    btnAdd.CanClick = false;
                    btnReduce.CanClick = false;
                }
                //如果原来的状态是送风的话
                else if (oldModel == AC.AcMode.FanOnly)
                {
                    //加减可以点击
                    btnAdd.CanClick = true;
                    btnReduce.CanClick = true;
                }
                return;
            }
            //检测是否获取网关反馈的结果,如果网关没有回复,则会弹出消息
            this.StartCheckResponeResult(this.listControl, (result) =>
            {
@@ -718,6 +775,20 @@
        /// <param name="isOpen"></param>
        private void SetSwitchComand(bool isOpen)
        {
            //如果住宅为虚拟住宅,则直接修改缓存
            if (Common.Config.Instance.Home.IsVirtually == true)
            {
                deviceAc.currentSystemMode = isOpen == true ? 3 : 0;
                var tempDevice = new CommonDevice();
                tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 513 };
                tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 28 } };
                this.CheckResponeResultStatu(ReceiveComandDiv.A设备属性上报, tempDevice);
                //加减是否可以点击
                btnAdd.CanClick = isOpen;
                btnReduce.CanClick = isOpen;
                return;
            }
            //检测是否获取网关反馈的结果,如果网关没有回复,则会弹出消息
            this.StartCheckResponeResult(this.listControl, (result) =>
            {
@@ -853,6 +924,17 @@
            rowFrame.ButtonClickEvent += (sender, e) =>
            {
                ((DialogCommonForm)frameBack.Parent.Parent).CloseForm();
                //如果住宅为虚拟住宅,则直接修改缓存
                if (Common.Config.Instance.Home.IsVirtually == true)
                {
                    deviceAc.currentFanMode = (int)i_div;
                    var tempDevice = new CommonDevice();
                    tempDevice.DeviceStatusReport = new CommonDevice.DeviceStatusReportData() { CluterID = 514 };
                    tempDevice.DeviceStatusReport.AttriBute = new List<CommonDevice.AttributeDataObj>() { new CommonDevice.AttributeDataObj() { AttributeId = 0 } };
                    this.CheckResponeResultStatu(ReceiveComandDiv.A设备属性上报, tempDevice);
                    return;
                }
                //发送风速命令
                this.SetAcWindSpeedComand(i_div);
            };