From 88b60a998a4cd8cae54e017e9ae31b644347e382 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 06 七月 2022 09:31:28 +0800
Subject: [PATCH] 在离线更新
---
HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 54 +++++++++++++++++++++++++++++++++---------------------
1 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
index bdc7f95..fa374cc 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -94,23 +94,24 @@
//鍒锋柊鐣岄潰鐘舵��
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>
@@ -118,7 +119,18 @@
/// </summary>
private void InitFrameWhiteContent1()
{
- temp = (int)Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."));
+ //鑾峰彇娓╁害鍊�
+ var setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp);
+ var setTempString = setTempTemp.Replace(",", ".");
+ var setTempDouble = Convert.ToDouble(setTempString);
+ temp = Convert.ToInt32(setTempDouble);
+ if (temp <= 0)
+ {
+ //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨�
+ temp = 16;
+ device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString());
+ }
+
arcBar = new DiyArcSeekBar()
{
Gravity = Gravity.CenterHorizontal,
@@ -147,7 +159,7 @@
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()
{
@@ -158,7 +170,7 @@
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);
@@ -941,7 +953,7 @@
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);
};
@@ -1049,7 +1061,7 @@
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() ;
--
Gitblit v1.8.0