From 992cc7d4433f8f9e9b0a930ec095973e056abe1c Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期一, 05 七月 2021 09:42:12 +0800 Subject: [PATCH] 20210705-1 代码备份 --- HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs | 4 HDL-ON_Android/Properties/AndroidManifest.xml | 2 HDL_ON/Entity/Function/Light.cs | 34 ++++ HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs | 101 ++++++------ HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs | 5 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 4 HDL_ON/DAL/DriverLayer/Control_Udp.cs | 18 + HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs | 4 HDL-ON_iOS/Info.plist | 4 HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs | 73 +++++---- HDL_ON/Common/HDLCommon.cs | 5 HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs | 18 + HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs | 1 HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs | 8 HDL_ON/DAL/DriverLayer/Packet.cs | 42 +++- .vs/HDL_APP_Project/xs/UserPrefs.xml | 61 ++----- HDL_ON/DAL/DriverLayer/Control.cs | 10 - HDL_ON/UI/MainPage.cs | 23 ++ HDL_ON/UI/UI1-Login/LoginPage.cs | 7 HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs | 5 HDL-ON_Android/Other/JPush/JPushReceiver.cs | 5 21 files changed, 259 insertions(+), 175 deletions(-) diff --git a/.vs/HDL_APP_Project/xs/UserPrefs.xml b/.vs/HDL_APP_Project/xs/UserPrefs.xml index f6f3f8d..39fadc2 100644 --- a/.vs/HDL_APP_Project/xs/UserPrefs.xml +++ b/.vs/HDL_APP_Project/xs/UserPrefs.xml @@ -1,20 +1,15 @@ -锘�<Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> +锘�<Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> - <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/Entity/Function/Scene.cs"> + <MonoDevelop.Ide.Workbench> <Files> - <File FileName="HDL_ON/Entity/Function/Function.cs" Line="1193" Column="45" /> - <File FileName="HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs" Line="141" Column="30" /> - <File FileName="HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs" Line="304" Column="1" /> - <File FileName="HDL_ON/DAL/Mqtt/MqttClient.cs" Line="367" Column="51" /> - <File FileName="HDL_ON/Entity/Enumerative/MyEnum.cs" Line="15" Column="6" /> - <File FileName="HDL_ON/Entity/Enumerative/Command.cs" Line="1713" Column="27" /> - <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" Line="631" Column="50" /> - <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="855" Column="46" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneAddPage.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs" Line="1" Column="1" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" Line="20" Column="41" /> - <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneCatchFunctionListPage.cs" Line="170" Column="82" /> - <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="440" Column="23" /> + <File FileName="HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs" Line="15" Column="35" /> + <File FileName="HDL_ON/Common/HDLCommon.cs" /> + <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs" /> + <File FileName="HDL-ON_Android/Application.cs" /> + <File FileName="HDL_ON/UI/MainPage.cs" Line="359" Column="40" /> + <File FileName="HDL_ON/UI/BindingResidence/BindingResidencePage.cs" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs" /> + <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" /> </Files> <Pads> <Pad Id="ProjectPad"> @@ -22,40 +17,21 @@ <Node name="HDL_APP_Project" expanded="True"> <Node name="HDL_ON" expanded="True"> <Node name="DAL" expanded="True"> - <Node name="DriverLayer" expanded="True" /> <Node name="Mqtt" expanded="True" /> - <Node name="Server" expanded="True" /> </Node> - <Node name="Entity" expanded="True"> - <Node name="Enumerative" expanded="True" /> - <Node name="Function" expanded="True"> - <Node name="Scene.cs" selected="True" /> - </Node> - </Node> + <Node name="Entity" expanded="True" /> <Node name="UI" expanded="True"> - <Node name="UI0-Public" expanded="True" /> - <Node name="UI1-Login" expanded="True" /> + <Node name="BindingResidence" expanded="True" /> <Node name="UI2" expanded="True"> - <Node name="2-Classification" expanded="True" /> <Node name="3-Intelligence" expanded="True"> <Node name="Scene" expanded="True" /> </Node> - <Node name="FuntionControlView" expanded="True"> - <Node name="1ContorlPage" expanded="True" /> - <Node name="FoolHeating" expanded="True" /> - <Node name="Light" expanded="True" /> - <Node name="Music" expanded="True" /> - </Node> + <Node name="4-PersonalCenter" expanded="True" /> </Node> </Node> </Node> - <Node name="HDL-ON_Android" expanded="True"> - <Node name="Assets" expanded="True" /> - </Node> - <Node name="HDL-ON_iOS" expanded="True"> - <Node name="Other" expanded="True" /> - <Node name="Resources" expanded="True" /> - </Node> + <Node name="HDL-ON_Android" expanded="True" selected="True" /> + <Node name="HDL-ON_iOS" expanded="True" /> </Node> </State> </Pad> @@ -67,13 +43,10 @@ <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> <String>Shared.IOS/Shared.IOS.csproj</String> </DisabledProjects> - <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> + <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> <MonoDevelop.Ide.DebuggingService.Breakpoints> - <BreakpointStore> - <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/FhControlPage.cs" line="79" column="1" /> - <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="44" column="1" /> - </BreakpointStore> + <BreakpointStore /> </MonoDevelop.Ide.DebuggingService.Breakpoints> <MultiItemStartupConfigurations /> </Properties> \ No newline at end of file diff --git a/HDL-ON_Android/Other/JPush/JPushReceiver.cs b/HDL-ON_Android/Other/JPush/JPushReceiver.cs index 87a58e9..2116ed2 100644 --- a/HDL-ON_Android/Other/JPush/JPushReceiver.cs +++ b/HDL-ON_Android/Other/JPush/JPushReceiver.cs @@ -65,6 +65,7 @@ Utlis.WriteLine("PushMes title : " + pushMes.Title); Utlis.WriteLine("PushMes message : " + pushMes.Content); Utlis.WriteLine("PushMes extras : " + pushMes.Extras); + Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); Shared.Application.RunOnMainThread(() => { HDLCommon.Current.AdjustPushMessage(pushMes); @@ -161,13 +162,15 @@ if (jpushExpandData != null && jpushExpandData.messageType != null) { pushMes.messageType = jpushExpandData.messageType; - pushMes.expantContent = jpushExpandData.expantContent; + pushMes.expantContent = jpushExpandData.expantContent; ; + pushMes.HomeId = jpushExpandData.homeId; Utlis.WriteLine("PushMes messageType : " + pushMes.messageType); } Utlis.WriteLine("PushMes title : " + pushMes.Title); Utlis.WriteLine("PushMes message : " + pushMes.Content); Utlis.WriteLine("PushMes extras : " + pushMes.Extras); + Utlis.WriteLine("PushMes HomeId : " + pushMes.HomeId); Shared.Application.RunOnMainThread(() => { Intent i = new Intent(context, typeof(BaseActivity));//Intent intent=new Intent( 璧峰缁勪欢瀵硅薄 , 鐩爣 Service.class); diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml index ff4004d..a12b1bc 100644 --- a/HDL-ON_Android/Properties/AndroidManifest.xml +++ b/HDL-ON_Android/Properties/AndroidManifest.xml @@ -1,5 +1,5 @@ 锘�<?xml version="1.0" encoding="utf-8"?> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202106291" android:versionName="1.2.202106291" package="com.hdl.onpro"> +<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107023" android:versionName="1.2.202107023" package="com.hdl.onpro"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> <!-- 鍙瀵硅鏉冮檺--> <uses-permission android:name="android.permission.CAMERA" /> diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index 33b4950..c90f41b 100644 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -104,9 +104,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> - <string>1.2.202106281</string> + <string>1.2.202107023</string> <key>CFBundleVersion</key> - <string>1.2.06281</string> + <string>1.2.07023</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs index 588b918..0bdaf43 100644 --- a/HDL_ON/Common/HDLCommon.cs +++ b/HDL_ON/Common/HDLCommon.cs @@ -452,6 +452,10 @@ { }; + while (MainPage.BasePageView.ChildrenCount > 1) + { + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 2; + } var skipPage = new MessageCenterPage(); MainPage.BasePageView.AddChidren(skipPage); skipPage.LoadPage(backAction); @@ -464,6 +468,7 @@ alarmPushConfirmDialog = null; }; + //闃叉澶氭寮圭獥澶勭悊 if (alarmPushConfirmDialog == null) { diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs index 8f82384..913c52a 100644 --- a/HDL_ON/DAL/DriverLayer/Control.cs +++ b/HDL_ON/DAL/DriverLayer/Control.cs @@ -406,16 +406,6 @@ } else { - ////杩滅▼閫氳 - //if (Ins.GatewayOnline_Local == false && Ins.GatewayOnline_Cloud == true) - //{ - // DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); - // //ALink鎺у埗銆丅us鎺у埗浣跨敤鍚屼竴涓帴鍙f帶鍒讹紝鐢变簯绔礋璐hВ鏋� - // var apiControlData = function.GetApiControlData(commandDictionary); - // var actionObjs = new List<ApiAlinkControlActionObj>(); - // actionObjs.Add(apiControlData); - // var pack = httpServer.ControlDevice(actionObjs); - //} //鏈湴閫氳 if (Ins.GatewayOnline_Local) { diff --git a/HDL_ON/DAL/DriverLayer/Control_Udp.cs b/HDL_ON/DAL/DriverLayer/Control_Udp.cs index 3c742c4..789428d 100644 --- a/HDL_ON/DAL/DriverLayer/Control_Udp.cs +++ b/HDL_ON/DAL/DriverLayer/Control_Udp.cs @@ -52,6 +52,15 @@ /// </summary> public void ControlBytesSend(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, int sendCount = 3) { +#if DEBUG + string ddd = ""; + foreach (var bb in gatewayBytes) + { + ddd += bb + ","; + } + MainPage.Log($"鍙戦�乥us鍛戒护:" + ((int)command).ToString("X").PadLeft(4,'0') + " : 鏁版嵁:" + ddd); +#endif + var control = new Control_Udp(); control.Send(new Target() { @@ -429,13 +438,16 @@ { case SPK.LightCCT: byte b0 = 100;//寮�鍏虫搷浣滀緷鎹畂n_off瀛楁锛屽疄闄呭紑鍏冲�间緷鎹産rightness锛屽綋on_off涓烘墦寮�锛宐rightness涓嶈兘涓�0 - if (function.trait_on_off.curValue.ToString() == "off") + if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) { - b0 = 0; + if (function.trait_on_off.curValue.ToString() == "off") + { + b0 = 0; + } } else { - b0 = Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Brightness)) == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); + b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));// == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); } var bytes0 = new byte[] { function.bus.LoopId, b0, diff --git a/HDL_ON/DAL/DriverLayer/Packet.cs b/HDL_ON/DAL/DriverLayer/Packet.cs index a5b60c5..2d28447 100644 --- a/HDL_ON/DAL/DriverLayer/Packet.cs +++ b/HDL_ON/DAL/DriverLayer/Packet.cs @@ -97,7 +97,8 @@ { ddd += bb + ","; } - MainPage.Log($"bus鍛戒护:"+ ((int)command) + " : 鏁版嵁:" + ddd); + MainPage.Log($"bus鍛戒护:" + ((int)command).ToString("X").PadLeft(4, '0') + " : 鏁版嵁:" + ddd); + //MainPage.Log($"bus鍛戒护:"+ ((int)command) + " : 鏁版嵁:" + ddd); #endif //澶勭悊鏄惁瑕侀噸鍙戞暟鎹� ManagerReceive(subnetID, deviceID, command, usefulBytes); @@ -227,25 +228,40 @@ break; case Command.SetLogicLoopColorACK: case Command.ReadLogicLoopColorACK: - foreach (var rgb in FunctionList.List.GetLightList()) + foreach (var lightTeme in FunctionList.List.GetLightList()) { - if (rgb.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) + if (lightTeme.GetBusId() == subnetID + "_" + deviceID + "_" + receiveBytes[0]) { - if (rgb.spk == SPK.LightRGB) + if (lightTeme.spk == SPK.LightRGB) { - rgb.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; + lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; if (receiveBytes[1] > 0) { - rgb.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); - rgb.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; + lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); + lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; } - new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, rgb); + new Light().SetRGBcolor(new byte[] { receiveBytes[6], receiveBytes[7], receiveBytes[8] }, lightTeme); - HomePage.UpdataFunctionStates(rgb); - RoomPage.UpdataStates(rgb); - FunctionPage.UpdataStates(rgb); - ClassificationPage.UpdataInfo(rgb); - RGBPage.UpdataStates(rgb); + HomePage.UpdataFunctionStates(lightTeme); + RoomPage.UpdataStates(lightTeme); + FunctionPage.UpdataStates(lightTeme); + ClassificationPage.UpdataInfo(lightTeme); + RGBPage.UpdataStates(lightTeme); + }else if(lightTeme.spk == SPK.LightCCT) + { + lightTeme.trait_on_off.curValue = receiveBytes[1] > 0 ? "on" : "off"; + if (receiveBytes[1] > 0) + { + lightTeme.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[1].ToString()); + lightTeme.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[1] + "%"; + } + new Light().SetCCT(new byte[] { receiveBytes[6], receiveBytes[7] }, lightTeme); + + HomePage.UpdataFunctionStates(lightTeme); + RoomPage.UpdataStates(lightTeme); + FunctionPage.UpdataStates(lightTeme); + ClassificationPage.UpdataInfo(lightTeme); + ColorTureLampPage.UpdataStatus(lightTeme); } } } diff --git a/HDL_ON/Entity/Function/Light.cs b/HDL_ON/Entity/Function/Light.cs index c7546c7..bb19c2f 100644 --- a/HDL_ON/Entity/Function/Light.cs +++ b/HDL_ON/Entity/Function/Light.cs @@ -32,6 +32,30 @@ return recolor; } /// <summary> + /// 鑾峰彇rgb棰滆壊鏁扮粍 + /// </summary> + /// <param name="function"></param> + /// <returns></returns> + public byte[] GetRGBbytes(Function function) + { + var color = function.GetAttrState(FunctionAttributeKey.RGB).Split(","); + + if (color.Length != 3) + { + color = new string[] { "100", "100", "100" }; + } + byte redColor = 0; + byte greenColor = 0; + byte blueColor = 0; + + byte.TryParse(color[0], out redColor); + byte.TryParse(color[1], out greenColor); + byte.TryParse(color[2], out blueColor); + + return new byte[] { redColor, greenColor, blueColor }; + } + + /// <summary> /// 鑾峰彇rgb 鎺у埗瀛楃涓� /// </summary> /// <returns></returns> @@ -68,6 +92,16 @@ function.SetAttrState(FunctionAttributeKey.RGB, color[0] + "," + color[1] + "," + color[2]); } + /// <summary> + /// 璁剧疆鑹叉俯 + /// </summary> + /// <param name="cct"></param> + /// <param name="function"></param> + public void SetCCT(byte[] cct,Function function) + { + function.SetAttrState(FunctionAttributeKey.CCT, cct[0] * 256 + cct[1]); + } + #endregion } diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index cc24670..59b607b 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -1,6 +1,7 @@ 锘縰sing System; using System.Collections.Generic; using HDL_ON.DAL; +using HDL_ON.Entity; using HDL_ON.UI; using HDL_ON.UI.CSS; using Shared; @@ -24,7 +25,7 @@ /// <summary> /// 鐗堟湰鍙� /// </summary> - public static string VersionString = "1.2.0629"; + public static string VersionString = "1.2.0702"; ///// <summary> ///// 瀹㈡埛绔被鍨� ///// </summary> @@ -97,6 +98,25 @@ #endif } } + + /// <summary> + /// 鍦烘櫙鏀寔鐨勫姛鑳藉垪琛� + /// </summary> + public static List<string> SceneSupportFunctionList = new List<string> { + SPK.LightCCT,SPK.LightDimming,SPK.LightSwitch,SPK.LightRGB, + SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, + SPK.AcIr,SPK.AcStandard, + SPK.FloorHeatStandard, + + }; + /// <summary> + /// 鎴块棿鍔熻兘鍒楄〃涓嶅姞杞界殑鍔熻兘鍒楄〃 + /// </summary> + public static List<string> RoomNotSupportFunctionList = new List<string> + { + SPK.EnergyStandard, + }; + public static void Show() @@ -335,6 +355,7 @@ { if (downloadData) { + DB_ResidenceData.Instance.EixtAccount(); ///鍒濆鍖朼pp鏁版嵁 Common.ApiUtlis.Ins.DownloadData(); }; diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index ad0b7f9..022b8bc 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -202,8 +202,9 @@ //return; if (b) { - etAccount.Text = "tf@smarttech.com.ua";//鍥藉璐﹀彿锛屾湁浣忓畢锛岀櫥褰曟棤娉曟樉绀� + //etAccount.Text = "tf@smarttech.com.ua";//鍥藉璐﹀彿锛屾湁浣忓畢锛岀櫥褰曟棤娉曟樉绀� //etAccount.Text = "13375012446";//娴嬭瘯鏈嶅姟鍣� + etAccount.Text = "13450425803"; //etAccount.Text = "1033326940@qq.com"; //etAccount.Text = "18022428438";//wjc //etAccount.Text = "13602944661";//kx @@ -214,13 +215,13 @@ } else { - etAccount.Text = "15626203746"; + //etAccount.Text = "15626203746"; //etAccount.Text = "15018447586";//闊充箰鏁伴噺鍒锋柊闂 //etAccount.Text = "464027401@qq.com";// //etAccount.Text = "15217626103";// //etAccount.Text = "13682244600";//娉㈠摜 //etAccount.Text = "13168123446";//鏄嗘槑閲戣寕椤圭洰锛屾柊椋庨棶棰� - //etAccount.Text = "BB01010101@evoyo.com";//鍙瀵硅 + etAccount.Text = "551775569@.com"; //etAccount.Text = "13168123446"; //etAccount.Text = "13676202754";//宸存灄鏈嶅姟鍣� //etAccount.Text = "13602944661";//kx diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs index 7198795..32ef478 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs @@ -18,7 +18,6 @@ { Application.RunOnMainThread((Action)(() => { - try { if (view == null || scrolView == null || updataFunction == null) @@ -111,7 +110,12 @@ #endregion case FunctionCategory.Curtain: #region 绐楀笜鏇存柊 - var percent = updataFunction.GetAttrState(FunctionAttributeKey.OnOff) == "off" ? 0 : 100; + var onoffString = updataFunction.GetAttrState(FunctionAttributeKey.OnOff); + if (onoffString == "stop") + { + return; + } + var percent = onoffString == "off" ? 0 : 100; if(updataFunction.GetAttributes().Contains(FunctionAttributeKey.Percent)) { string percentString = updataFunction.GetAttrState(FunctionAttributeKey.Percent); diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 246e637..e78c6d0 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -240,11 +240,11 @@ //澶у浘鏄剧ず if (OnAppConfig.Instance.IsShowBigPicture) { - LoadBigPirtureRoomRow(roomView, roomsShowed[i/2]); + LoadBigPirtureRoomRow(roomView, roomsShowed[i]); } else//鏃犲浘鏄剧ず { - LoadSmallPirtureRoomRow(roomView, roomsShowed[i/2]); + LoadSmallPirtureRoomRow(roomView, roomsShowed[i]); } } diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs index d480411..7012fba 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs @@ -331,8 +331,12 @@ { try { - //鍏ㄥ紑鍏ㄥ叧 - //if (DB_ResidenceData.Instance.GatewayType == 0 && !Control.Ins.IsRemote) + //浼戠湢鏃堕棿(ms) + int sleepTime = 100; + if(DB_ResidenceData.Instance.GatewayType == 0) + { + sleepTime = 200; + } if (Control.Ins.GatewayOnline_Local) { switch (functionCategory) @@ -344,7 +348,7 @@ Dictionary<string, string> d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); Control.Ins.SendWriteCommand(f, d); - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(sleepTime); } break; case ShowFunction.FloorHeating: @@ -354,7 +358,7 @@ Dictionary<string, string> d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); Control.Ins.SendWriteCommand(f, d); - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(sleepTime); } break; case ShowFunction.Light: @@ -364,7 +368,7 @@ Dictionary<string, string> d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); Control.Ins.SendWriteCommand(f, d); - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(sleepTime); } break; case ShowFunction.Electric: @@ -374,7 +378,7 @@ Dictionary<string, string> d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); Control.Ins.SendWriteCommand(f, d); - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(sleepTime); } break; case ShowFunction.FreshAir: @@ -384,7 +388,7 @@ Dictionary<string, string> d = new Dictionary<string, string>(); d.Add(FunctionAttributeKey.OnOff, f.trait_on_off.curValue.ToString()); Control.Ins.SendWriteCommand(f, d); - System.Threading.Thread.Sleep(100); + System.Threading.Thread.Sleep(sleepTime); } break; } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs index 61abb45..2f0e76b 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/CatchSceneAddPage.cs @@ -302,7 +302,10 @@ { if(temp.roomIds.Contains(catchRoom.roomId)) { - catchFunctionList.Add(temp); + if (MainPage.SceneSupportFunctionList.Contains(temp.spk)) + { + catchFunctionList.Add(temp); + } } } } diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs index 8e94a49..efb7272 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/NewSceneMenuListPage.cs @@ -63,43 +63,47 @@ addSceneView.AddChidren(btnAddSceneText); #endregion - #region 鎹曡幏鍦烘櫙 - FrameLayout catchSceneView = new FrameLayout() - { - Gravity = Gravity.CenterHorizontal, - Y =addSceneView.Bottom,//+ Application.GetRealWidth(10), - Width = Application.GetRealWidth(361), - Height = Application.GetRealWidth(202), - Radius = (uint)Application.GetRealWidth(12), - }; - bodyView.AddChidren(catchSceneView); - ImageView catchSceneImageView = new ImageView() + if (DB_ResidenceData.Instance.GatewayType == 0) { } + else { - Gravity = Gravity.CenterHorizontal, - Radius = (uint)Application.GetRealWidth(12), - ImagePath = "Intelligence/CreateScene2Bg.png", - }; - catchSceneView.AddChidren(catchSceneImageView); + #region 鎹曡幏鍦烘櫙 + FrameLayout catchSceneView = new FrameLayout() + { + Gravity = Gravity.CenterHorizontal, + Y = addSceneView.Bottom,//+ Application.GetRealWidth(10), + Width = Application.GetRealWidth(361), + Height = Application.GetRealWidth(202), + Radius = (uint)Application.GetRealWidth(12), + }; + bodyView.AddChidren(catchSceneView); - btnCatchSceneBg = new Button() - { - Radius = (uint)Application.GetRealWidth(12), - }; - catchSceneView.AddChidren(btnCatchSceneBg); + ImageView catchSceneImageView = new ImageView() + { + Gravity = Gravity.CenterHorizontal, + Radius = (uint)Application.GetRealWidth(12), + ImagePath = "Intelligence/CreateScene2Bg.png", + }; + catchSceneView.AddChidren(catchSceneImageView); - Button btnCatchSceneText = new Button() - { - Y = Application.GetRealWidth(126), - Height = Application.GetRealWidth(68), - TextColor = CSS_Color.MainBackgroundColor, - TextSize = CSS_FontSize.EmphasisFontSize_Secondary, - TextAlignment = TextAlignment.Center, - TextID = StringId.CatchScene, - }; - catchSceneView.AddChidren(btnCatchSceneText); - #endregion + btnCatchSceneBg = new Button() + { + Radius = (uint)Application.GetRealWidth(12), + }; + catchSceneView.AddChidren(btnCatchSceneBg); + Button btnCatchSceneText = new Button() + { + Y = Application.GetRealWidth(126), + Height = Application.GetRealWidth(68), + TextColor = CSS_Color.MainBackgroundColor, + TextSize = CSS_FontSize.EmphasisFontSize_Secondary, + TextAlignment = TextAlignment.Center, + TextID = StringId.CatchScene, + }; + catchSceneView.AddChidren(btnCatchSceneText); + #endregion + } /* #region 鐢靛奖鍦烘櫙 @@ -150,7 +154,10 @@ void LoadEventList() { LoadEvent_SkipAddScenePage(); - LoadEvent_SkipCatchScenePage(); + if (DB_ResidenceData.Instance.GatewayType != 0) + { + LoadEvent_SkipCatchScenePage(); + } } /// <summary> diff --git a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs index ede07c9..4df4dd8 100644 --- a/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs +++ b/HDL_ON/UI/UI2/3-Intelligence/Scene/SceneFunctionListChoosePage.cs @@ -130,6 +130,10 @@ foreach (var function in FunctionList.List.Functions) { + if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) + { + continue; + } if (function == null) { continue; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs index eee4090..6c82a05 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPage.cs @@ -262,6 +262,7 @@ } btnExit.MouseUpEventHandler = (sender, e) => { + MainPage.NoLoginMode = false; UserInfo.Current.ClearUserInfo(); HDLCommon.Current.Logout(); }; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs index 0200f20..3293e0d 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/RoomEditFunctionPage.cs @@ -164,6 +164,10 @@ foreach (var function in FunctionList.List.GetDeviceFunctionList()) { function.roomIds.Remove(null); + if(MainPage.RoomNotSupportFunctionList.Contains(function.spk)) + { + continue; + } if (function.roomIds.Count > 0 ) { allocatedList.Add(function); diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs index cb6f2da..bcbc5c1 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPage.cs @@ -58,6 +58,11 @@ Button btnFromFloor_Out; bool onDimmerBar = false; Function function; + + /// <summary> + /// 鏈�鍚庢墦寮�鐨勯鑹� + /// </summary> + byte[] lastColor = new byte[3] { 255, 255, 255 }; /// <summary> /// 鍒锋柊鏄剧ず淇℃伅 /// </summary> diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs index 5da48b0..b0c2522 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs @@ -95,21 +95,12 @@ int circleR = colorPicker.Width / 2 - Application.GetRealWidth(12); colorPicker.ColorChaged += (sender2, e2) => { - if (function.trait_on_off.curValue.ToString() == "off" - || pointIsRight == false) + if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) { //pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� return; } - if ((DateTime.Now - colorChangeTime).TotalMilliseconds > 200) - { - lightTemp.SetRGBcolor(e2,function); - colorChangeTime = DateTime.Now; - System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); - d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); - Control.Ins.SendWriteCommand(function, d); - } - + lastColor = e2; }; colorPicker.MouseDownEventHandler += (sender, e) => { @@ -126,56 +117,62 @@ //鏄剧ず鐧界偣 btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; - if (btnWhiteRound.Visible == true) - { - btnWhiteRound.Visible = false; - } - }; - colorPicker.MouseUpEventHandler += (sender, e) => - { - if (function.trait_on_off.curValue.ToString() == "off") - { - return; - } - pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); - if (pointIsRight == false) - { - //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� - return; - } - //鏄剧ず鐧界偣 - btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; - btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; if (btnWhiteRound.Visible == false) { btnWhiteRound.Visible = true; } }; - - - + colorPicker.MouseMoveEventHandler += (sender, e) => { //褰撻紶鏍囩偣涓嬩簨浠跺鐞� - if (function.trait_on_off.curValue.ToString() == "off") - { - return; - } - pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); - if (pointIsRight == false) - { - //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� - return; - } - //鏄剧ず鐧界偣 - btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; - btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; - if (btnWhiteRound.Visible == false) - { - btnWhiteRound.Visible = true; - } - btnCurColor.BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function)); + colorPicker.MouseDownEventHandler(sender, e); + //if (function.trait_on_off.curValue.ToString() == "off") + //{ + // return; + //} + //pointIsRight = this.CheckPoint(circleR, colorPicker.Width / 2, colorPicker.Height / 2, (int)e.X, (int)e.Y); + //if (pointIsRight == false) + //{ + // //鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� + // return; + //} + ////鏄剧ず鐧界偣 + //btnWhiteRound.X = (int)e.X - btnWhiteRound.Width / 2; + //btnWhiteRound.Y = (int)e.Y - btnWhiteRound.Height / 2; + //if (btnWhiteRound.Visible == false) + //{ + // btnWhiteRound.Visible = true; + //} + //btnCurColor.BackgroundColor = (uint)(0xFF000000 + lightTemp.GetRGBcolor(function)); }; + + var colorChangeEvent = new System.Threading.Thread(() => { + while (this.Parent != null) + { + if (function.trait_on_off.curValue.ToString() == "off" || pointIsRight == false) + { + //pointIsRight:鐐圭殑鍖哄煙涓嶆槸鍦嗙洏鍐� + continue; + } + + for (int i = 0; i < 3; i++) + { + if (lightTemp.GetRGBbytes(function)[i] != lastColor[i]) + { + function.SetAttrState(FunctionAttributeKey.RGB, lastColor); + lightTemp.SetRGBcolor(lastColor, function); + System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); + d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); + Control.Ins.SendWriteCommand(function, d); + break; + } + } + System.Threading.Thread.Sleep(200); + } + }); + colorChangeEvent.IsBackground = true; + colorChangeEvent.Start(); } /// <summary> -- Gitblit v1.8.0