| | |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | while (true) |
| | | { |
| | | if(controlTime == DateTime.MinValue) |
| | | { |
| | | |
| | | } |
| | | else if (controlTime.AddSeconds(2)<DateTime.Now) |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | controlTime = DateTime.MinValue; |
| | | } |
| | | System.Threading.Thread.Sleep(1000); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // while (true) |
| | | // { |
| | | // if(controlTime == DateTime.MinValue) |
| | | // { |
| | | |
| | | // } |
| | | // else if (controlTime.AddSeconds(2)<DateTime.Now) |
| | | // { |
| | | // Control.Ins.SendReadCommand(device); |
| | | // controlTime = DateTime.MinValue; |
| | | // } |
| | | // System.Threading.Thread.Sleep(1000); |
| | | // } |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | //获取温度值 |
| | | 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, |
| | |
| | | arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; |
| | | arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; |
| | | arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; |
| | | arcBar.Progress = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); |
| | | arcBar.Progress = temp; |
| | | |
| | | btnTemp = new Button() |
| | | { |
| | |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 50, |
| | | IsBold = true, |
| | | Text = Convert.ToDouble( device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")).ToString(), |
| | | Text = Convert.ToDouble(temp).ToString(), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTemp); |
| | |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | controlTime = DateTime.Now; |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | |
| | | btnSwing.UnSelectedImagePath = acFunction.GetSwingIconPath(device.GetAttrState(FunctionAttributeKey.Swing), false); |
| | | btnWindSpeed.UnSelectedImagePath = acFunction.GetFanIconPath(device.GetAttrState(FunctionAttributeKey.FanSpeed), false); |
| | | temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); |
| | | |
| | | |
| | | |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString() ; |