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/Curtain/CurtainModulePageBLL.cs | 3 HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 4 HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 19 +++ HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 20 ++-- HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs | 5 HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs | 2 HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs | 80 ++++++++-------- HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 24 ++-- HDL_ON/Entity/Function/Function.cs | 4 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 60 ++++++++++++ HDL_ON/DAL/Server/HttpUtil.cs | 4 HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs | 5 HDL_ON/DAL/DriverLayer/Control.cs | 4 SiriIntents/Server/HttpUtil.cs | 4 15 files changed, 171 insertions(+), 72 deletions(-) diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 5714db0..ad0df71 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -94,7 +94,7 @@ } set { - //if (_GatewayOnline_Local != value) + if (_GatewayOnline_Local != value) { _GatewayOnline_Local = value; if (value) @@ -129,7 +129,7 @@ } set { - //if (_GatewayOnline_Cloud != value) + if (_GatewayOnline_Cloud != value) { _GatewayOnline_Cloud = value; if(GatewayOnline_Local) diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index 72fa068..4917487 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 2b47116..d7e0056 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -1021,6 +1021,10 @@ /// </summary> public const string RoomTemp = "room_temp"; /// <summary> + /// 瀹ゅ唴婀垮害 + /// </summary> + public const string RoomHumidity = "room_humidity"; + /// <summary> /// value /// </summary> public const string Value = "value"; diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index 4ee35e8..87c90f9 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -188,6 +188,10 @@ var acPage = new AcControlPage(); acPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; + case SPK.HvacCac: + var cacPage = new CacControlPage(); + cacPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); + break; case SPK.IrLearn: var irLearinPage = new IrLearnPage(); irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index c13e415..0fbcc3f 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -607,6 +607,25 @@ //new FunctionAttributes(){ key = "",curValue = "",state = "" }, } }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯娓╂帶鍣�", + spk = SPK.HvacCac, + attributes = new List<FunctionAttributes> + { + new FunctionAttributes(){ key = "on_off",curValue = "on",state = "on" }, + new FunctionAttributes(){ key = "cac_valve",curValue = "on",state = "on" },//姣涚粏闃� + new FunctionAttributes(){ key = "fh_valve",curValue = "on",state = "on" },//鍦版殩闃� + new FunctionAttributes(){ key = "mode",curValue = "cool",state = "cool", value = new List<string>{ "cool","heat","fan"} }, + new FunctionAttributes(){ key = "set_temp",curValue = "20",state = "20",min = 16,max = 30 }, + new FunctionAttributes(){ key = "room_temp",curValue = "20",state = "20" }, + new FunctionAttributes(){ key = "dew_point_temp",curValue = "20",state = "20" },//闇茬偣娓╁害 + new FunctionAttributes(){ key = "surface_temp",curValue = "20",state = "20" },//琛ㄩ潰娓╁害 + new FunctionAttributes(){ key = "energy_saving",curValue = "true",state = "true" },//鑺傝兘 + new FunctionAttributes(){ key = "room_humidity",curValue = "66",state = "66" }, + //new FunctionAttributes(){ key = "",curValue = "",state = "" }, + } + }); //FunctionList.List.Functions.Add(new Function //{ diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index 8185dc9..852711b 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -100,6 +100,66 @@ { btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; } + else if (function.spk == SPK.HvacCac) + { + var btnHumidityIcon = new Button() + { + X = Application.GetRealWidth(51), + Y = Application.GetRealHeight(66), + Width = Application.GetRealWidth(17), + Height = Application.GetRealWidth(17), + UnSelectedImagePath = "Public/DeviceInfoIcon/HumidityIcon.png", + }; + bodyDiv.AddChidren(btnHumidityIcon); + var btnHumidityValues = new TextButton() + { + X = btnHumidityIcon.Right + Application.GetRealWidth(4), + Y = Application.GetRealHeight(66), + Gravity = Gravity.CenterVertical, + TextColor = CSS_Color.MainBackgroundColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = function.GetAttrState(FunctionAttributeKey.RoomHumidity) + "%", + TextAlignment = TextAlignment.CenterLeft, + }; + btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); + bodyDiv.AddChidren(btnHumidityValues); + + Button btnTempIcon = new Button() + { + X = btnHumidityValues.Right + Application.GetRealWidth(20), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(17), + Height = Application.GetMinRealAverage(17), + UnSelectedImagePath = "Public/DeviceInfoIcon/TempIcon.png", + }; + bodyDiv.AddChidren(btnTempIcon); + + var btnTempValues = new TextButton() + { + X = btnTempIcon.Right + Application.GetRealWidth(4), + Gravity = Gravity.CenterVertical, + TextColor = CSS_Color.MainBackgroundColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + Text = function.GetAttrState(FunctionAttributeKey.RoomTemp) + "掳", + TextAlignment = TextAlignment.CenterLeft, + }; + btnTempValues.Width = btnTempValues.GetTextWidth(); + btnTempValues.Width = btnTempValues.GetTextWidth(); + bodyDiv.AddChidren(btnTempIcon); + + var btnJinMaoIcon = new Button() + { + X = Application.GetRealWidth(238), + Y = Application.GetRealHeight(64), + Width = Application.GetRealWidth(102), + Height = Application.GetRealHeight(29), + UnSelectedImagePath = "FunctionIcon/CAC/JinMaoIcon.png" + }; + bodyDiv.AddChidren(btnJinMaoIcon); + + + + } else { if (function.spk == SPK.ClothesHanger)//鏅捐。鏋� diff --git a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs index f7af085..fa374cc 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs @@ -120,7 +120,10 @@ 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 鎴愮敨瑕佹眰鐨� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs index 9602f7c..ee198c9 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainDreamPage.cs @@ -424,24 +424,24 @@ { btnCurtainClose.MouseUpEventHandler = (sender, e) => { - //if (!function.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - // return; - //} - new System.Threading.Thread(() => - { - System.Threading.Thread.Sleep(2000); - Application.RunOnMainThread(() => + if (!function.online) { - btnCurtainClose.IsSelected = false; - }); - }) + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } + new System.Threading.Thread(() => + { + System.Threading.Thread.Sleep(2000); + Application.RunOnMainThread(() => + { + btnCurtainClose.IsSelected = false; + }); + }) { IsBackground = true }.Start(); function.trait_on_off.curValue = "off"; function.SetAttrState(FunctionAttributeKey.Percent, 0); @@ -453,17 +453,17 @@ btnCurtainStop.MouseUpEventHandler = (sender, e) => { - //if (!function.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - // return; - //} - onCurtainAnimation = false; + if (!function.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } + onCurtainAnimation = false; new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -481,17 +481,17 @@ btnCurtainOpen.MouseUpEventHandler = (sender, e) => { - //if (!function.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - // return; - //} - new System.Threading.Thread(() => + if (!function.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } + new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); Application.RunOnMainThread(() => @@ -508,7 +508,7 @@ CurtainAnimation(100); }; - //if (function.online) + if (function.online) { btnCurtainStop.MouseDownEventHandler = (sender, e) => { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs index 242fb61..4572af5 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/CurtainModulePageBLL.cs @@ -80,6 +80,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -124,6 +125,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -147,6 +149,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs index 87044d5..56f5bde 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/MotorCurtainPageBLL.cs @@ -145,6 +145,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { @@ -173,6 +174,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } onCurtainAnimation = false; new System.Threading.Thread(() => @@ -200,6 +202,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { @@ -218,7 +221,7 @@ CurtainAnimation(100); }; - if (!function.online) + if (function.online) { btnCurtainStop.MouseDownEventHandler = (sender, e) => { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs index 94bfddc..a431833 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Curtain/RollingShutterPageBLL.cs @@ -146,6 +146,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { @@ -174,6 +175,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -199,6 +201,7 @@ Text = Language.StringByID(StringId.DeviceOfflineCannotOption), Direction = AMPopTipDirection.None, }.Show(MainPage.BaseView); + return; } new System.Threading.Thread(() => { @@ -235,7 +238,7 @@ // DriverLayer.Control.Ins.SendWriteCommand(function, d); //}; - if (!function.online) + if (function.online) { btnCurtainStop.MouseDownEventHandler = (sender, e) => diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs index 7dab158..0fc3660 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/FanPageBLL.cs @@ -108,7 +108,7 @@ { IsBackground = true }.Start(); }; - if (!function.online) + if (function.online) { barGradualChange.OnProgressChangedEvent = (sender, e) => { diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs index a79ca26..97304ad 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs @@ -145,18 +145,18 @@ { dimmerBar.OnStopTrackingTouchEvent = (sender, e) => { - //if (!function.online) - //{ - // new Tip() - // { - // CloseTime = 1, - // Text = Language.StringByID(StringId.DeviceOfflineCannotOption), - // Direction = AMPopTipDirection.None, - // }.Show(MainPage.BaseView); - // return; - //} - //onDimmerBar = false; - curDimmerStatus = false; + if (!function.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } + //onDimmerBar = false; + curDimmerStatus = false; function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs index 046ed07..b45f539 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs @@ -216,16 +216,16 @@ dimmerBar.OnStopTrackingTouchEvent = (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; + } curDimmerStatus = false; function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); 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