wxr
2022-09-27 0ee75b88cfe03e46289de0de96e8ed4580c797d3
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -90,11 +90,11 @@
            this.InitFrameWhiteContent1();
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(this.device);
            //this.RefreshNowDeviceStatuMemory(this.device);
            //刷新界面状态
            this.RefreshFormStatu();
            //读取状态
                        Control.Ins.SendReadCommand(device);
            Control.Ins.SendReadCommand(device);
            //new System.Threading.Thread(() =>
            //{
            //    while (true)
@@ -120,17 +120,17 @@
        private void InitFrameWhiteContent1()
        {
            //获取温度值
            var setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp);
            var setTempString = setTempTemp.Replace(",", ".");
            var setTempDouble = Convert.ToDouble(setTempString);
            temp = Convert.ToInt32(setTempDouble);
            string setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp);
            temp = (int) Convert.ToDouble(setTempTemp);
            if (temp <= 0)
            {
                //默认值改成16,2022年06月10日10:03:19 成甫要求的
                temp = 16;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
            }
            arcBar = new DiyArcSeekBar()
            {
                Gravity = Gravity.CenterHorizontal,
@@ -170,10 +170,13 @@
                TextColor = CSS_Color.FirstLevelTitleColor,
                TextSize = 50,
                IsBold = true,
                Text = Convert.ToDouble(temp).ToString(),
                Text = "111",
                TextAlignment = TextAlignment.Center,
            };
            btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
            btnTemp.Text = Convert.ToDouble(temp).ToString();
            FrameWhiteCentet1.AddChidren(btnTemp);
            btnTempUint = new Button()
            {
@@ -195,7 +198,7 @@
                Y = btnTemp.Bottom,
                Width = Application.GetRealWidth(120),
                Height = Application.GetRealHeight(20),
                Text = Language.StringByID(StringId.IndoorTemp) + "20°C",
                Text = Language.StringByID(StringId.Indoor) + " 20°C",
                TextColor = CSS_Color.PromptingColor1,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
            };
@@ -873,7 +876,7 @@
            if (this.device.sid != i_LocalDevice.sid) { return; }
            //刷新当前设备的状态缓存
            this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //this.RefreshNowDeviceStatuMemory(i_LocalDevice);
            //刷新界面状态
            this.RefreshFormStatu();
        }
@@ -912,6 +915,8 @@
                controlTime = DateTime.Now;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                //btnTempUint.X = btnTemp.Right;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -940,6 +945,8 @@
                controlTime = DateTime.Now;
                arcBar.Progress = temp;
                btnTemp.Text = temp.ToString();
                //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                //btnTempUint.X = btnTemp.Right;
                device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
                System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                d.Add(FunctionAttributeKey.SetTemp, temp.ToString());
@@ -953,7 +960,7 @@
                    device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                    btnTemp.Text = arcBar.Progress.ToString();
                    controlTime = DateTime.Now;
                    System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
                    Dictionary<string, string> d = new Dictionary<string, string>();
                    d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString());
                    Control.Ins.SendWriteCommand(device, d);
                };
@@ -961,6 +968,8 @@
                {
                    device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString());
                    btnTemp.Text = e.ToString();
                    //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                    //btnTempUint.X = btnTemp.Right;
                };
                //arcBar.MouseDownEventHandler = (sender, e) => {
                //    Console.WriteLine("ddd");
@@ -1053,7 +1062,9 @@
                }
                else
                {
                    btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C";
                    //device = FunctionList.List.Functions.Find((obj) => obj.sid == device.sid);
                    btnIndoorTemp.Text = Language.StringByID(StringId.Indoor) + " " + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.RoomTemp).Replace(",", "."))) + "°C";
                    btnMode.SelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode));
                    btnSwing.SelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing));
                    btnWindSpeed.SelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed));
@@ -1064,7 +1075,9 @@
                   
                    arcBar.Progress = temp;
                    btnTemp.Text = temp.ToString() ;
                    btnTemp.Text = temp.ToString();
                    //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5);
                    //btnTempUint.X = btnTemp.Right;
                    if (device.trait_on_off.curValue.ToString() == "on")
                    {
@@ -1103,15 +1116,5 @@
        #endregion
        #region ■ 一般方法___________________________
        /// <summary>
        /// 刷新当前设备的状态缓存
        /// </summary>
        private void RefreshNowDeviceStatuMemory(Function i_LocalDevice)
        {
        }
        #endregion
    }
}