From 623b1b77900ca2804d76426e5e0c003249eef324 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期一, 09 一月 2023 14:03:58 +0800 Subject: [PATCH] 方悦0.5精度空调 --- HDL_APP_Project.sln | 14 - HDL_ON/Entity/Function/Function.cs | 5 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 2 HDL-ON_Android/AgreementActivity.cs | 2 HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 395 +++++++++++++++++++------------------------ HDL_ON/UI/UI2/UserPage.cs | 5 HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs | 4 HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs | 14 + HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs | 60 +++--- HDL_ON/UI/UI1-Login/LoginPage.cs | 25 ++ SiriIntents/Server/HttpUtil.cs | 4 12 files changed, 250 insertions(+), 284 deletions(-) diff --git a/HDL-ON_Android/AgreementActivity.cs b/HDL-ON_Android/AgreementActivity.cs index eb2059d..dc866b1 100644 --- a/HDL-ON_Android/AgreementActivity.cs +++ b/HDL-ON_Android/AgreementActivity.cs @@ -71,7 +71,5 @@ Finish(); }; } - - } } \ No newline at end of file diff --git a/HDL_APP_Project.sln b/HDL_APP_Project.sln index 974923d..84800828 100644 --- a/HDL_APP_Project.sln +++ b/HDL_APP_Project.sln @@ -18,8 +18,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSdk", "UMSdk\UMSdk.csproj", "{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shared.IOS", "..\..\Downloads\Library\Shared.IOS\Shared.IOS.csproj", "{0048AB87-2130-4437-8F01-8CADAB787004}" -EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4 @@ -121,18 +119,6 @@ {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhone.Build.0 = Release|Any CPU {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhone.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|Any CPU.Build.0 = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhone.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhone.Build.0 = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {0048AB87-2130-4437-8F01-8CADAB787004}.Release|iPhoneSimulator.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index bf39c96..511a91e 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -17,8 +17,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 64034ec..63f24fe 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -983,6 +983,11 @@ /// </summary> public List<string> value = new List<string>(); /// <summary> + /// 姝ヨ繘 + /// 绌鸿皟娓╁害鎺у埗 0.5 1 + /// </summary> + public string step = "1"; + /// <summary> /// 鏈�澶у�� /// </summary> public int max = 100; diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index c0fdb87..a17b965 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -1505,12 +1505,33 @@ new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, curValue = "on", state = "on" }, new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, curValue = "cool", state = "cool" }, new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, curValue = "auto", state = "auto" }, - new FunctionAttributes() { key = "set_temp", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 }, + new FunctionAttributes() { key = "set_temp",step = "1", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 }, new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, curValue = "20", state = "20" }, new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, curValue = "20", state = "20" }, } }; ac.SaveFunctionFile(); + + var ac2 = new Function() + { + sid = "ac2", + deviceId = "ac2", + name = Language.CurrentLanguage == "Chinese" ? "瀹㈠巺绌鸿皟" : "AC", + spk = SPK.AcStandard, + roomIds = new List<string>() { room4.roomId }, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes() { key = "on_off", value = new List<string>() { "on", "off" }, curValue = "on", state = "on" }, + new FunctionAttributes() { key = "mode", value = new List<string>() { "cool", "heat", "fan", "auto", "dry" }, curValue = "cool", state = "cool" }, + new FunctionAttributes() { key = "fan", value = new List<string>() { "high", "medium", "low", "auto" }, curValue = "auto", state = "auto" }, + new FunctionAttributes() { key = "set_temp",step = "0.5", value = new List<string>() { "16", "30"}, curValue = "16", state = "16",max = 30,min = 16 }, + new FunctionAttributes() { key = "room_temp", value = new List<string>() { }, curValue = "20", state = "20" }, + new FunctionAttributes() { key = "swing", value = new List<string>() {"up_down", "left_right", "stop" }, curValue = "20", state = "20" }, + } + }; + ac2.SaveFunctionFile(); + + //var scene5 = new Scene() //{ // sid = "scene5", @@ -1531,7 +1552,7 @@ // collect = false, //}; //scene6.SaveSceneFile(); -#endregion + #endregion var lightSwitch6 = new Function() diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index 4de0786..398e637 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -608,7 +608,7 @@ /// </summary> void LoadContentView() { - if (!Common.ApiUtlis.Ins.DownloadDataComplete) + if (!Common.ApiUtlis.Ins.DownloadDataComplete && !MainPage.NoLoginMode) { var waitPage = new Loading(); MainPage.BaseView.AddChidren(waitPage); diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs index 69e0702..ffd324b 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs @@ -112,10 +112,16 @@ { #region 绐楀笜鏇存柊 var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); - //if (onoffString == "stop") - //{ - // return; - //} + var percentAttr = updataFunction.GetAttribute(FunctionAttributeKey.Percent); + if(percentAttr != null) + { + onoffString = percentAttr.curValue.ToString() == "0" ? "off" : "on"; + } + + if (onoffString == "stop") + { + return; + } var percent = onoffString == "off" ? 0 : 100; if (updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) { diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs index eb4ea70..f2a4587 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZoneBLL.cs @@ -203,16 +203,16 @@ { btnClose.MouseUpEventHandler = (sender, e) => { - if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� - { - new Tip() - { - CloseTime = 1, - Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - Direction = AMPopTipDirection.None, - }.Show(MainPage.BaseView); - return; - } + //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} btnClose.IsSelected = true; btnStop.IsSelected = false; btnOpen.IsSelected = false; @@ -225,16 +225,16 @@ btnStop.MouseUpEventHandler = (sender, e) => { - if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� - { - new Tip() - { - CloseTime = 1, - Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - Direction = AMPopTipDirection.None, - }.Show(MainPage.BaseView); - return; - } + //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} btnStop.IsSelected = true; btnClose.IsSelected = false; btnOpen.IsSelected = false; @@ -246,16 +246,16 @@ btnOpen.MouseUpEventHandler = (sender, e) => { - if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� - { - new Tip() - { - CloseTime = 1, - Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - Direction = AMPopTipDirection.None, - }.Show(MainPage.BaseView); - return; - } + //if (!function.online)//绂荤嚎涓嶅厑璁告搷浣� + //{ + // new Tip() + // { + // CloseTime = 1, + // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + // Direction = AMPopTipDirection.None, + // }.Show(MainPage.BaseView); + // return; + //} btnOpen.IsSelected = true; btnClose.IsSelected = false; btnStop.IsSelected = false; diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index be06592..3b3a26d 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -14,15 +14,16 @@ /// <summary> /// 绌鸿皟娓╁害鎺у埗鎺т欢 /// </summary> - DiyArcSeekBar arcBar; + //DiyArcSeekBar arcBar; + DiyImageSeekBar setTempBar; /// <summary> /// 鍑忓彿鎸夐挳 /// </summary> - Button btnMinus; + //Button btnMinus; /// <summary> /// 鍔犲彿鎸夐挳 /// </summary> - Button btnPlus; + //Button btnPlus; /// <summary> /// 娓╁害鎸夐挳 /// </summary> @@ -55,10 +56,6 @@ /// 鎺у埗鏃堕棿 /// </summary> DateTime controlTime = DateTime.MinValue.AddDays(10); - /// <summary> - /// 鎺у埗娓╁害 - /// </summary> - int temp = 16; #endregion @@ -95,23 +92,6 @@ this.RefreshFormStatu(); //璇诲彇鐘舵�� Control.Ins.SendReadCommand(device); - //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> @@ -121,7 +101,7 @@ { //鑾峰彇娓╁害鍊� string setTempTemp = device.GetAttrState(FunctionAttributeKey.SetTemp); - temp = (int) Convert.ToDouble(setTempTemp); + var temp = (int)Convert.ToDouble(setTempTemp); if (temp <= 0) { //榛樿鍊兼敼鎴�16,2022骞�06鏈�10鏃�10:03:19 鎴愮敨瑕佹眰鐨� @@ -130,99 +110,123 @@ } - - arcBar = new DiyArcSeekBar() + var setTempAttr = device.GetAttribute(FunctionAttributeKey.SetTemp); { - Gravity = Gravity.CenterHorizontal, - OpenAngle = 160, - ThumbImageHeight = Application.GetRealWidth(50), - ProgressBarColor = CSS_Color.MainColor, - OfflineProgressBarColor = CSS_Color.PromptingColor2, - ArcColor = CSS_Color.BackgroundColor, -#if __IOS__ - Y = Application.GetRealHeight(120 + 25), - Width = Application.GetRealWidth(260 - 40), - Height = Application.GetRealWidth(260 - 40), - SeekBarPadding = Application.GetRealWidth(8), -#else - Y = Application.GetRealHeight(120 + 40), - Width = Application.GetRealWidth(260 - 40), - Height = Application.GetRealWidth(260 - 40), - SeekBarPadding = Application.GetRealWidth(7), -#endif - - }; - FrameWhiteCentet1.AddChidren(arcBar); - - - arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; - arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; - arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; - arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; - arcBar.Progress = temp; - - btnTemp = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(206), - Width = Application.GetRealWidth(71), - Height = Application.GetRealWidth(60), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = 50, - IsBold = true, - Text = "111", - TextAlignment = TextAlignment.Center, - }; - btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); - btnTemp.Text = Convert.ToDouble(temp).ToString(); - FrameWhiteCentet1.AddChidren(btnTemp); + btnTemp = new Button() + { + Y = Application.GetRealHeight(121), + Gravity = Gravity.CenterHorizontal, + Height = Application.GetRealHeight(70), + TextAlignment = TextAlignment.TopCenter, + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = 60, + Text = "---", + IsBold = true, + }; + if(setTempAttr.step == "0.5") + { + btnTemp.Text = Convert.ToDouble(setTempAttr.curValue).ToString("0.0"); + } + else + { + btnTemp.Text = setTempAttr.curValue.ToString(); + } + btnTemp.Width = btnTemp.GetTextWidth(); + FrameWhiteCentet1.AddChidren(btnTemp); - btnTempUint = new Button() - { - X = btnTemp.Right, - Y = btnTemp.Y, - Width = Application.GetRealWidth(30), - Height = Application.GetRealHeight(30), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.EmphasisFontSize_Secondary, - IsBold = true, - TextAlignment = TextAlignment.CenterLeft, - Text = "掳C", - }; - FrameWhiteCentet1.AddChidren(btnTempUint); + btnTempUint = new Button() + { + X = btnTemp.Right, + Y = Application.GetRealHeight(131), + Width = Application.GetRealWidth(30), + Height = Application.GetRealHeight(30), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + IsBold = true, + TextAlignment = TextAlignment.CenterLeft, + Text = "掳C", + }; + FrameWhiteCentet1.AddChidren(btnTempUint); - btnIndoorTemp = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = btnTemp.Bottom, - Width = Application.GetRealWidth(120), - Height = Application.GetRealHeight(20), - Text = Language.StringByID(StringId.Indoor) + " 20掳C", - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - }; - FrameWhiteCentet1.AddChidren(btnIndoorTemp); + btnIndoorTemp = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = btnTemp.Bottom, + Width = Application.GetRealWidth(120), + Height = Application.GetRealHeight(30), + Text = Language.StringByID(StringId.Indoor) + " 20掳C", + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextAlignment = TextAlignment.TopCenter, + }; + FrameWhiteCentet1.AddChidren(btnIndoorTemp); - btnMinus = new Button() - { - X = Application.GetRealWidth(21), - Y = Application.GetRealHeight(263), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "Public/MinusSignIcon.png", - }; - FrameWhiteCentet1.AddChidren(btnMinus); + var setTempView = new FrameLayout() + { + Height = Application.GetRealHeight(80), + Y = Application.GetRealHeight(10) + btnIndoorTemp.Bottom, + }; + FrameWhiteCentet1.AddChidren(setTempView); - btnPlus = new Button() - { - X = Application.GetRealWidth(275), - Y = Application.GetRealHeight(263), - Width = Application.GetRealWidth(32), - Height = Application.GetRealWidth(32), - UnSelectedImagePath = "Public/PlusSignIcon.png", - }; - FrameWhiteCentet1.AddChidren(btnPlus); + var btnMinTemp = new Button() + { + X = Application.GetRealWidth(26), + Width = Application.GetRealWidth(18), + TextAlignment = TextAlignment.Center, + Text = setTempAttr.min.ToString(), + TextSize = 12, + TextColor = 0xFFC0C7D4, + }; + setTempView.AddChidren(btnMinTemp); + + setTempBar = new DiyImageSeekBar() + { + X = btnMinTemp.Right, + Y = Application.GetRealHeight(4), + Width = Application.GetRealWidth(240), + //Height = Application.GetRealHeight(41), + //ProgressBarColor = CSS_Color.MainColor, + //SeekBarBackgroundColor = CSS_Color.BackgroundColor, + //MinValue = 16, + //MaxValue = 30, + //IsProgressTextShow = false, + //ThumbImageHeight = 30, + + //Width = Application.GetRealWidth(238), + Height = Application.GetRealHeight(72), + SeekBarViewHeight = Application.GetRealHeight(14), + ThumbImagePath = "FunctionIcon/Acst/ThumbImage.png", + ThumbImageHeight = Application.GetRealHeight(51), + ProgressBarColor = device.trait_on_off.curValue.ToString() == "on" ? CSS_Color.MainColor : CSS_Color.DividingLineColor, + Progress = 0, + SeekBarPadding = Application.GetRealWidth(20), + IsProgressTextShow = false, + ProgressChangeDelayTime = 0, + }; + if (setTempAttr.step == "0.5") + { + setTempBar.MaxValue = (setTempAttr.max - setTempAttr.min) * 2; + } + else + { + setTempBar.MaxValue = (setTempAttr.max - setTempAttr.min); + } + setTempView.AddChidren(setTempBar); + + var btnMaxTemp = new Button() + { + X = setTempBar.Right, + Width = Application.GetRealWidth(18), + TextAlignment = TextAlignment.Center, + Text = setTempAttr.max.ToString(), + TextSize = 12, + TextColor = 0xFFC0C7D4, + }; + setTempView.AddChidren(btnMaxTemp); + + } + btnMode = new Button() { @@ -271,7 +275,33 @@ }; FrameWhiteCentet1.AddChidren(btnSwitch); - LoadEvent_TempChange(); + setTempBar.OnProgressChangedEvent = (sender, e) => { + if (setTempAttr.step == "0.5") + { + btnTemp.Text = (setTempAttr.min + ((double)e / 2)).ToString("0.0"); + } + else + { + btnTemp.Text = (setTempAttr.min + e).ToString(); + } + }; + setTempBar.OnStopTrackingTouchEvent = (sender,e) =>{ + temp = e; + device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); + if (setTempAttr.step == "0.5") + { + btnTemp.Text = (setTempAttr.min + ((double)e / 2)).ToString("0.0"); + } + else + { + btnTemp.Text = (setTempAttr.min + e).ToString(); + } + controlTime = DateTime.Now; + Dictionary<string, string> d = new Dictionary<string, string>(); + d.Add(FunctionAttributeKey.SetTemp, e.ToString()); + Control.Ins.SendWriteCommand(device, d); + }; + LoadEvent_AcStatesChange(); LoadDiv_IrView(); @@ -391,13 +421,14 @@ dialog.Close(); if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") { - arcBar.IsClickable = false; - arcBar.IsOffline = true; + + setTempBar.IsClickable = false; + setTempBar.IsOffline = true; } else { - arcBar.IsOffline = false; - arcBar.IsClickable = true; + setTempBar.IsOffline = false; + setTempBar.IsClickable = true; } }; btnModeIcon.MouseUpEventHandler = eventHandler1; @@ -890,96 +921,6 @@ /// </summary> void LoadEvent_TempChange() { - btnMinus.MouseUpEventHandler = (sender, e) => - { - //if (!device.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - //} - if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") - { - return; - } - - if (temp <= device.GetAttribute(FunctionAttributeKey.SetTemp).min) - { - return; - } - --temp; - Console.WriteLine($"temp == {temp}"); - 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()); - Control.Ins.SendWriteCommand(device, d); - }; - btnPlus.MouseUpEventHandler = (sender, e) => - { - //if (!device.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - //} - if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") - { - return; - } - if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) - { - return; - } - ++temp; - 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()); - Control.Ins.SendWriteCommand(device, d); - }; - //if (device.online) - { - arcBar.OnStopTrackingTouchEvent = (sender, e) => - { - temp = arcBar.Progress; - device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); - btnTemp.Text = arcBar.Progress.ToString(); - controlTime = DateTime.Now; - Dictionary<string, string> d = new Dictionary<string, string>(); - d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); - Control.Ins.SendWriteCommand(device, d); - }; - arcBar.OnProgressChangedEvent = (sender, e) => - { - 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"); - // MainPage.BasePageView.ScrollEnabled =false; - //}; - //arcBar.MouseUpEventHandler = (sender, e) => { - // Console.WriteLine("ddd2"); - // MainPage.BasePageView.ScrollEnabled = true; - //}; - } } /// <summary> @@ -1028,15 +969,13 @@ device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; if (device.trait_on_off.curValue.ToString() == "on") { - arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; btnSwitch.IsSelected = true; - arcBar.IsOffline = false; + setTempBar.IsOffline = false; } else { - arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; btnSwitch.IsBold = false; - arcBar.IsOffline = true; + setTempBar.IsOffline = true; } System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); @@ -1071,42 +1010,50 @@ btnMode.UnSelectedImagePath = acFunction.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode), false); 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(",", "."))); - + + if (device.GetAttribute(FunctionAttributeKey.SetTemp).step == "0.5") + { + var t = Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", ".")); + var temp = (int)(t * 2); + setTempBar.Progress = temp - device.GetAttribute(FunctionAttributeKey.SetTemp).min * 2; + btnTemp.Text = Convert.ToDouble(t).ToString("0.0"); + } + else + { + var temp = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp).Replace(",", "."))); + setTempBar.Progress = temp - device.GetAttribute(FunctionAttributeKey.SetTemp).min; + btnTemp.Text = temp.ToString(); + } - arcBar.Progress = temp; - btnTemp.Text = temp.ToString(); //btnTemp.Width = btnTemp.GetTextWidth() + Application.GetRealWidth(5); //btnTempUint.X = btnTemp.Right; if (device.trait_on_off.curValue.ToString() == "on") { btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = true; - arcBar.IsOffline = false; + setTempBar.IsOffline = false; btnSwitch.IsSelected = true; - arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") { - arcBar.IsClickable = false; + setTempBar.IsClickable = false; } else { - arcBar.IsClickable = true; + setTempBar.IsClickable = true; } } else { btnMode.IsSelected = btnSwing.IsSelected = btnWindSpeed.IsSelected = false; - arcBar.IsOffline = true; + setTempBar.IsOffline = true; btnSwitch.IsSelected = false; - arcBar.IsClickable = false; - arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; + setTempBar.IsClickable = false; } if(device.GetAttrState(FunctionAttributeKey.Mode) == "dry") { - arcBar.IsOffline = true; - arcBar.IsClickable = false; + setTempBar.IsOffline = true; + setTempBar.IsClickable = false; } } diff --git a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs index 75388ce..7bed343 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs @@ -659,6 +659,10 @@ int index = 1; foreach (var tempSensor in sensorList) { + if(index > 6) + { + break; + } if (tempSensor.sid == function.sid) { continue; diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs index fc552fb..6a3074f 100644 --- a/HDL_ON/UI/UI2/UserPage.cs +++ b/HDL_ON/UI/UI2/UserPage.cs @@ -125,10 +125,9 @@ { //娉ㄥ唽鎺ㄩ�両D RegisteredPush(); + //2020-12-07 澧炲姞鐗堟湰妫�娴嬫洿鏂版柟娉� + HDLCommon.Current.CheckIfNeedForceUpdate(); } - //2020-12-07 澧炲姞鐗堟湰妫�娴嬫洿鏂版柟娉� - HDLCommon.Current.CheckIfNeedForceUpdate(); - #if __Android__ //寮�鍚畾浣嶆湇鍔� try diff --git a/SiriIntents/Server/HttpUtil.cs b/SiriIntents/Server/HttpUtil.cs index 56a78a0..f61de04 100644 --- a/SiriIntents/Server/HttpUtil.cs +++ b/SiriIntents/Server/HttpUtil.cs @@ -16,8 +16,8 @@ /// 鍥哄畾鍩熷悕,姝e紡鐜 /// 鍏叡鍩熷悕灏辫繎瑙f瀽 /// </summary> - //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; - public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm + public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; + //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm /// <summary> /// RegionMark /// </summary> -- Gitblit v1.8.0