From d8dd712b682362671ed81554ce4e5a2979f78cc8 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期二, 20 九月 2022 13:27:56 +0800 Subject: [PATCH] 绿建科技系统 --- HDL_ON/UI/UI2/1-HomePage/HomePage.cs | 146 ++++++-- HDL-ON_Android/Assets/Language.ini | 1 HDL_ON/HDL_ON.projitems | 4 HDL-ON_Android/HDL-ON_Android.csproj | 9 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/MsgViewBg.png | 0 HDL_ON/Entity/Enumerative/MyEnum.cs | 4 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/NightIcon.png | 0 HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs | 95 +++++ HDL_ON/UI/MainPage.cs | 5 HDL_ON/UI/UI1-Login/LoginPage.cs | 4 HDL_ON/Entity/Function/Acst.cs | 102 +++++ HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CollectionIcon.png | 0 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TopViewBg.png | 0 HDL_ON/Entity/DB_ResidenceData.cs | 4 HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs | 32 + HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs | 585 ++++++++++++++++++++++++++++++++ HDL_ON/Entity/FunctionList.cs | 20 + HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOnIcon.png | 0 HDL_ON/Entity/Function/Function.cs | 11 HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs | 4 HDL_ON/Common/R.cs | 8 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CoolIcon.png | 0 HDL_ON/DAL/Server/HttpServerRequest.cs | 4 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOffIcon.png | 0 HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TempAndHumiBack.png | 0 25 files changed, 992 insertions(+), 46 deletions(-) diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini index 98c4cac..a4cc1c6 100644 --- a/HDL-ON_Android/Assets/Language.ini +++ b/HDL-ON_Android/Assets/Language.ini @@ -1771,6 +1771,7 @@ 566=褰撳墠鍙戠數鍔熺巼: ----w 567=鐢垫睜SOC: --% 568=杩愯鏁伴噺/鎬绘暟閲�: --/-- +569=浜哄眳鐜 diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CollectionIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CollectionIcon.png new file mode 100644 index 0000000..3fba8ae --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CollectionIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CoolIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CoolIcon.png new file mode 100644 index 0000000..cbb4456 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/CoolIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/MsgViewBg.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/MsgViewBg.png new file mode 100644 index 0000000..52f647c --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/MsgViewBg.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/NightIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/NightIcon.png new file mode 100644 index 0000000..186be2e --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/NightIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOffIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOffIcon.png new file mode 100644 index 0000000..56b8ee1 --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOffIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOnIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOnIcon.png new file mode 100644 index 0000000..8a363cd --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/PowerOnIcon.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TempAndHumiBack.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TempAndHumiBack.png new file mode 100644 index 0000000..4f0f76d --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TempAndHumiBack.png Binary files differ diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TopViewBg.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TopViewBg.png new file mode 100644 index 0000000..f08940f --- /dev/null +++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Acst/blue/TopViewBg.png Binary files differ diff --git a/HDL-ON_Android/HDL-ON_Android.csproj b/HDL-ON_Android/HDL-ON_Android.csproj index 8a801ff..850c8cb 100644 --- a/HDL-ON_Android/HDL-ON_Android.csproj +++ b/HDL-ON_Android/HDL-ON_Android.csproj @@ -290,6 +290,14 @@ <AndroidAsset Include="Assets\h5\static\img\co2-reduction-ic.9c75228c.png" /> <AndroidAsset Include="Assets\h5\static\img\equal-plant-ic.7ef6befa.png" /> <AndroidAsset Include="Assets\h5\static\img\coal-save-ic.6c5fd125.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\PowerOnIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\NightIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\CoolIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\TempAndHumiBack.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\CollectionIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\TopViewBg.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\PowerOffIcon.png" /> + <AndroidAsset Include="Assets\Phone\FunctionIcon\Acst\blue\MsgViewBg.png" /> </ItemGroup> <ItemGroup> <AndroidResource Include="Resources\values\colors.xml" /> @@ -1498,6 +1506,7 @@ <Folder Include="Zxing\" /> <Folder Include="Assets\Phone\FunctionIcon\CAC\" /> <Folder Include="Assets\Phone\FunctionIcon\Panel\" /> + <Folder Include="Assets\Phone\FunctionIcon\Acst\" /> </ItemGroup> <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs index 4f1fb79..bd61d6c 100644 --- a/HDL_ON/Common/R.cs +++ b/HDL_ON/Common/R.cs @@ -4,7 +4,13 @@ { public static class StringId { - + /// <summary> + /// 绉戞妧 + /// </summary> + public const int Acst = 569; + /// <summary> + /// 杩愯鏁伴噺/鎬绘暟閲�: --/-- + /// </summary> public const int OperationDataTotalData = 568; /// <summary> /// 鐢垫睜SOC diff --git a/HDL_ON/DAL/Server/HttpServerRequest.cs b/HDL_ON/DAL/Server/HttpServerRequest.cs index 1bf4aaf..e1833f4 100644 --- a/HDL_ON/DAL/Server/HttpServerRequest.cs +++ b/HDL_ON/DAL/Server/HttpServerRequest.cs @@ -551,7 +551,7 @@ { foreach (var home in homeList) { - if (home.isBindGateway) + if (home.isBindGateway)//鏄惁缁戝畾缃戝叧 { UserInfo.Current.regionList.Add(home); //鏂扮粦瀹氱殑浣忓畢锛岀洿鎺ュ垏鎹㈠埌鏂颁綇瀹� @@ -1414,7 +1414,7 @@ MainPage.cityInfo.weather = jt.GetValue("Weather").ToString(); MainPage.cityInfo.lowestTemperature = jt.GetValue("lowestTemperature").ToString(); MainPage.cityInfo.highestTemperature = jt.GetValue("highestTemperature").ToString(); - + MainPage.CityWeatherAction?.Invoke(); break; } catch (Exception ex) diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index 0113d52..cd346ad 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -78,7 +78,7 @@ ShowFunction.FreshAir,ShowFunction.DoorLock, ShowFunction.Panel,ShowFunction.SecurityMonitoring, ShowFunction.Sensor,ShowFunction.VideoIntercom, - ShowFunction.SecurityCenter + ShowFunction.SecurityCenter,ShowFunction.Acst, }); instance.SaveResidenceData(); instance.residenceImage = "Classification/Room/Roombg.png"; @@ -119,7 +119,7 @@ ShowFunction.FreshAir,ShowFunction.DoorLock, ShowFunction.Panel,ShowFunction.SecurityMonitoring, ShowFunction.Sensor,ShowFunction.VideoIntercom, - ShowFunction.SecurityCenter + ShowFunction.SecurityCenter,ShowFunction.Acst, }); instance.SupportFacePass = false; instance.SaveResidenceData(); diff --git a/HDL_ON/Entity/Enumerative/MyEnum.cs b/HDL_ON/Entity/Enumerative/MyEnum.cs index 1282a71..8e4c806 100644 --- a/HDL_ON/Entity/Enumerative/MyEnum.cs +++ b/HDL_ON/Entity/Enumerative/MyEnum.cs @@ -173,6 +173,10 @@ /// 瀹夐槻涓績 /// </summary> SecurityCenter = 0x22, + /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// </summary> + Acst = 0x23, } diff --git a/HDL_ON/Entity/Function/Acst.cs b/HDL_ON/Entity/Function/Acst.cs new file mode 100644 index 0000000..5d01728 --- /dev/null +++ b/HDL_ON/Entity/Function/Acst.cs @@ -0,0 +1,102 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON.Entity +{ + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// </summary> + public class Acst + { + public Acst() + { + } + + } + + #region 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 鎬绘帶 + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 鎬绘帶 + /// </summary> + public class AcstParent : Function + { + + } + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 鎬绘帶 + /// 灞炴�ф灇涓� + /// </summary> + public enum AcstParent_AttrEnum + { + on_off,// 寮�鍏� + mode,//妯″紡 + scene,// 鍦烘櫙 WR + day_electricity,// 浠婃棩鑰楃數閲忥紙kW路h锛� R float 0-999999 + month_electricity,// 鏈湀鑰楃數閲忥紙kW路h锛� R float 0-999999 + total_electricity,// 鎬昏�楃數閲忥紙kW路h锛� R float 0-999999 + active_power,// 鐢ㄧ數鍔熺巼 R float 0-999999 + room_temp,// 瀹ゅ唴娓╁害 R -30 - 100 + room_humidity,// 瀹ゅ唴婀垮害 R float % 0-100 + co2,// CO2鍊� R integer %d ppm + tvoc,// tvoc鍊� R integer %d mg/m3 + pm25,// PM2.5鍊� R integer %d ppm + } + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 鎬绘帶 + /// 妯″紡灞炴�у�兼灇涓� + /// </summary> + public enum AcstParent_Attr_ModeValueEnum + { + cool,//鍒跺喎 + heat,//鍒剁儹 + fan,//閫氶 + dry,//闄ゆ箍 + humidity,//鍔犳箍 + heat_humidity,//鍒剁儹鍔犳箍 + } + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 鎬绘帶 + /// 鍦烘櫙灞炴�у�兼灇涓� + /// </summary> + public enum AcstParent_Attr_SceneValueEnum + { + at_home,//鍦ㄥ + leave_home,//绂诲 + sleep,//鐫$湢 + } + + #endregion + + + #region 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級瀛愭帶 + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 瀛愭帶 + /// </summary> + public class AcstSub + { + + } + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺 锛堢豢寤猴級 + /// 瀛愭帶 + /// 灞炴�ф灇涓� + /// </summary> + public enum AcstSub_AttrEnum + { + on_off,// 寮�鍏� WR string on/off on + set_temp,// 璁剧疆娓╁害 WR float -30-100 + set_temp_step,// 娓╁害鍔犲噺 W string up/down + room_temp,// 瀹ゅ唴娓╁害 R float + room_humidity,// 瀹ゅ唴婀垮害 R float % 0-100 + } + + #endregion + + + +} diff --git a/HDL_ON/Entity/Function/Function.cs b/HDL_ON/Entity/Function/Function.cs index 878603c..176e38a 100644 --- a/HDL_ON/Entity/Function/Function.cs +++ b/HDL_ON/Entity/Function/Function.cs @@ -1318,6 +1318,17 @@ public const string OtherCommon = "other.common"; /// <summary> + /// 绌鸿皟绉戞妧绯荤粺锛堢豢寤猴級 + /// 鎬绘帶 + /// </summary> + public const string AcstParent = "acst.parent"; + /// <summary> + /// 绌鸿皟绉戞妧绯荤粺锛堢豢寤猴級 + /// 瀛愭帶 + /// </summary> + public const string AcstSub = "acst.sub"; + + /// <summary> /// 闂ㄩ攣 /// </summary> public const string DoorLock = "security.door"; diff --git a/HDL_ON/Entity/FunctionList.cs b/HDL_ON/Entity/FunctionList.cs index cf3f154..c1b9c0c 100644 --- a/HDL_ON/Entity/FunctionList.cs +++ b/HDL_ON/Entity/FunctionList.cs @@ -41,6 +41,26 @@ public List<Function> Functions = new List<Function>(); /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// 鎬绘帶鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Function> GetAcstParentList() + { + return Functions.FindAll((obj) => obj.spk == SPK.AcstParent); + } + + /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// 瀛愭帶鍒楄〃 + /// </summary> + /// <returns></returns> + public List<Function> GetAcstSubList() + { + return Functions.FindAll((obj) => obj.spk == SPK.AcstSub); + } + + /// <summary> /// 绌鸿皟鍒楄〃 /// </summary> /// <returns></returns> diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems index ef69777..40874b3 100644 --- a/HDL_ON/HDL_ON.projitems +++ b/HDL_ON/HDL_ON.projitems @@ -515,6 +515,9 @@ <Compile Include="$(MSBuildThisFileDirectory)DAL\DriverLayer\Control_Tcp.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\InverterInfo.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\H5Page.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)Entity\Function\Acst.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Acst\AcstParentPage.cs" /> + <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Acst\AcstSubPage.cs" /> </ItemGroup> <ItemGroup> <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" /> @@ -541,5 +544,6 @@ <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorEnvironment\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\LightScene\" /> <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\" /> + <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Acst\" /> </ItemGroup> </Project> \ No newline at end of file diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs index a4ba8f6..eb5fa78 100644 --- a/HDL_ON/UI/MainPage.cs +++ b/HDL_ON/UI/MainPage.cs @@ -37,6 +37,11 @@ /// </summary> public static Entity.CityInfo cityInfo = new Entity.CityInfo(); /// <summary> + /// 鍩庡競澶╂皵淇℃伅antion + /// </summary> + public static Action CityWeatherAction = null; + + /// <summary> /// 澶╂皵鍒锋柊action /// </summary> public static Action RefreshAir; diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 7f8e495..d1035fb 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -218,7 +218,7 @@ //etAccount.Text = "13450425807";//榛勭婧� knx椤圭洰 etAccount.Text = "18244942707"; etAccount.Text = "tf@smarttech.com.ua"; - etAccount.Text = "13418062953"; + etAccount.Text = "15871702179"; } else { @@ -251,7 +251,7 @@ //etAccount.Text = "s.savinov@hdlautomation.ru"; } b = !b; - etPassword.Text = "123456"; + etPassword.Text = "qunhui105113"; if(etAccount.Text == "13418062953") { etPassword.Text = "a123456"; diff --git a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs index 4f5815c..024382e 100644 --- a/HDL_ON/UI/UI2/1-HomePage/HomePage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/HomePage.cs @@ -193,36 +193,6 @@ #if DEBUG btnResidenceName.MouseUpEventHandler = (sender, e) => { - var imageUrl = ImageUtlis.Current.GetSceneDefaultIconList(); - - if (imageUrl != null) - { - - } - //if (UserInfo.Current.VerOpenDoorPw || string.IsNullOrEmpty(UserInfo.Current.doorPasswordString)) - //{ - // var page = new DoorLockUnlockPage(new Function()); - // MainPage.BasePageView.AddChidren(page); - // page.LoadView(); - // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - //} - //else - //{ - // Control.Ins.OneKeyUnlocking(new Function(), UserInfo.Current.doorPasswordString); - //} - - //ddd++; - // Function function_online = FunctionList.List.GetLightList().Find((obj) => obj.sid == "0001017DB92D2602020100010101"); - // if(ddd%2 == 0) - // { - // function_online.online = true; - // } - // else - // { - // function_online.online = false; - // } - // HomePage.LoadEvent_RefreshDevcieOnline(function_online); - }; #endif @@ -586,16 +556,118 @@ #if DEBUG FunctionList.List.Functions.Add(new Function { - name = "娴嬭瘯姊﹀够绐楀笜", - spk = SPK.CurtainDream, - sid = "1234577", - attributes = new List<FunctionAttributes> { - new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, - new FunctionAttributes(){ key = "percent",curValue= "100",state = "100" }, - new FunctionAttributes(){ key = "angle",curValue= "0",state = "0" }, + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺鎬绘帶", + spk = SPK.AcstParent, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstParent_AttrEnum.mode.ToString(),curValue = AcstParent_Attr_ModeValueEnum.cool.ToString(),state = AcstParent_Attr_ModeValueEnum.cool.ToString(), + value = new List<string> + { + AcstParent_Attr_ModeValueEnum.cool.ToString(), + AcstParent_Attr_ModeValueEnum.dry.ToString(), + AcstParent_Attr_ModeValueEnum.fan.ToString(), + AcstParent_Attr_ModeValueEnum.heat.ToString(), + AcstParent_Attr_ModeValueEnum.humidity.ToString(), + AcstParent_Attr_ModeValueEnum.heat_humidity.ToString(), + } + }, + new FunctionAttributes(){ key = AcstParent_AttrEnum.scene.ToString(), curValue = AcstParent_Attr_SceneValueEnum.at_home.ToString(), state = AcstParent_Attr_SceneValueEnum.at_home.ToString(), + value = new List<string>() + { + AcstParent_Attr_SceneValueEnum.at_home.ToString(), + AcstParent_Attr_SceneValueEnum.leave_home.ToString(), + AcstParent_Attr_SceneValueEnum.sleep.ToString(), + } + }, + new FunctionAttributes(){ key = AcstParent_AttrEnum.day_electricity.ToString(),curValue = "99",state = "99"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.month_electricity.ToString(),curValue = "999",state = "999"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.total_electricity.ToString(),curValue = "9999",state = "9999"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.active_power.ToString(),curValue = "9999",state = "9999"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.co2.ToString(),curValue = "266",state = "266"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.tvoc.ToString(),curValue = "666",state = "666"}, + new FunctionAttributes(){ key = AcstParent_AttrEnum.pm25.ToString(),curValue = "36",state = "36"}, } }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺瀛愭帶-1", + spk = SPK.AcstSub, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstSub_AttrEnum.set_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + } + }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺瀛愭帶-2", + spk = SPK.AcstSub, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstSub_AttrEnum.set_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + } + }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺瀛愭帶-3", + spk = SPK.AcstSub, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstSub_AttrEnum.set_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + } + }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺瀛愭帶-4", + spk = SPK.AcstSub, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstSub_AttrEnum.set_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + } + }); + FunctionList.List.Functions.Add(new Function + { + name = "娴嬭瘯-绌鸿皟绉戞妧绯荤粺瀛愭帶-5", + spk = SPK.AcstSub, + attributes = new List<FunctionAttributes>() + { + new FunctionAttributes(){ key = FunctionAttributeKey.OnOff ,curValue = "on",state = "on" }, + new FunctionAttributes(){ key = AcstSub_AttrEnum.set_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_temp.ToString(),curValue = "26",state = "26"}, + new FunctionAttributes(){ key = AcstSub_AttrEnum.room_humidity.ToString(),curValue = "66",state = "66"}, + } + }); + + + + + //FunctionList.List.Functions.Add(new Function + //{ + // name = "娴嬭瘯姊﹀够绐楀笜", + // spk = SPK.CurtainDream, + // sid = "1234577", + // attributes = new List<FunctionAttributes> { + // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, + // new FunctionAttributes(){ key = "percent",curValue= "100",state = "100" }, + // new FunctionAttributes(){ key = "angle",curValue= "0",state = "0" }, + // } + //}); + //FunctionList.List.Functions.Add(new Function //{ // name = "娴嬭瘯姣背娉紶鎰熷櫒", diff --git a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs index 1ee95b0..834fac3 100644 --- a/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs +++ b/HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs @@ -731,6 +731,11 @@ // functionCount = 1; //} break; + case ShowFunction.Acst: + functionCount = FunctionList.List.GetAcstParentList().Count; + functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; + break; + } @@ -788,6 +793,7 @@ if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir && item != ShowFunction.Music && item != ShowFunction.EnergyMonitoring && item != ShowFunction.SecurityCenter + && item != ShowFunction.Acst && functionCount != 0) { Button btnFunctionCount = new Button() @@ -1050,11 +1056,35 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; break; + case ShowFunction.Acst: + btnName.TextID = StringId.Acst; + Button btnAcstPower = new Button() + { + X = Application.GetRealWidth(120), + Y = specialList.Contains(index) ? Application.GetRealWidth(160) : Application.GetRealWidth(117), + Width = Application.GetRealWidth(32), + Height = Application.GetRealWidth(32), + SelectedImagePath = "Public/PowerOpen.png", + UnSelectedImagePath = "Public/PowerClose.png", + IsSelected = functionOnCount > 0, + Tag = item + "_AllControl", + }; + functionView.AddChidren(btnAcstPower); + btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { + //缁垮缓绉戞妧绯荤粺todo + var page = new AcstParentPage(); + MainPage.BasePageView.AddChidren(page); + page.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + }; + break; + } //鐣岄潰璺宠浆--闊充箰璺宠浆鑷繁鐨勭晫闈�--鐜璺宠浆鑷繁鐨勭晫闈� if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring && item != ShowFunction.DoorLock - && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item) + && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item + && ShowFunction.Acst != item) { btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { diff --git a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs index db7cfe9..0c2265f 100644 --- a/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs +++ b/HDL_ON/UI/UI2/2-Classification/FunctionControlZone.cs @@ -67,7 +67,7 @@ btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/{function.IconName}.png"; - + if (SPK.CurtainSpkList().Contains(function.spk)) {//绐楀笜娌℃湁寮�鍏虫寜閽� CurtainFragment(); @@ -243,6 +243,8 @@ } + else if (function.spk == SPK.AcstParent) { + } else { if (function.spk == SPK.ClothesHanger)//鏅捐。鏋� diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs new file mode 100644 index 0000000..582e49d --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstParentPage.cs @@ -0,0 +1,585 @@ +锘縰sing System; +using HDL_ON.Entity; +using Shared; + +namespace HDL_ON.UI +{ + + + /// <summary> + /// 缁垮缓绉戞妧绯荤粺 + /// 鎬绘帶涓婚〉 + /// </summary> + public class AcstParentPage : FrameLayout + { + VerticalScrolViewLayout bodyView; + Function function; + /// <summary> + /// 褰撳墠鏃舵棰滆壊 + /// </summary> + uint curColor = CSS.CSS_Color.MainColor; + + public AcstParentPage() + { + this.function = FunctionList.List.GetAcstParentList()[0]; + this.BackgroundColor = CSS.CSS_Color.BackgroundColor; + bodyView = new VerticalScrolViewLayout(); + this.AddChidren(bodyView); + + + + + } + + public void InitGetWeatherAction() + { + MainPage.CityWeatherAction = () => { + + }; + } + + public void LoadPage() + { + #region 澶撮儴淇℃伅鍖哄煙 + FrameLayout topView = new FrameLayout() + { + Height = Application.GetRealHeight(181), + BackgroundColor = 0xFFb0eafa, + }; + bodyView.AddChidren(topView); + + var backView = new FrameLayout() + { + Y = Application.GetRealHeight(32), + Width = Application.GetRealWidth(100), + Height = Application.GetRealHeight(34), + BackgroundColor = 0x33333333, + }; + topView.AddChidren(backView); + + Button btnBackIcon = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(40), + Height = Application.GetRealWidth(28), + UnSelectedImagePath = "Public/BackIcon.png", + }; + backView.AddChidren(btnBackIcon); + + btnBackIcon.MouseUpEventHandler = (sender, e) => { + this.RemoveFromParent(); + }; + + var btnHelloText = new Button() + { + X = Application.GetRealWidth(25), + Y = Application.GetRealHeight(55), + Width = Application.GetRealWidth(200), + Height = Application.GetRealHeight(38), + TextSize = 20, + TextColor = 0xFFFFFFFF, + TextAlignment = TextAlignment.CenterLeft, + }; + topView.AddChidren(btnHelloText); + var curTime = DateTime.Now; + if (curTime.Hour >= 8 && curTime.Hour < 12) + { + btnHelloText.Text = "涓婂崍濂�"; + } + else if (curTime.Hour >= 12 && curTime.Hour < 18) + { + btnHelloText.Text = "涓嬪崍濂�"; + } + else + { + btnHelloText.Text = "鏅氫笂濂�"; + } + + var btnOutdoorTemp = new Button() + { + X = Application.GetRealWidth(25), + Y = Application.GetRealHeight(90), + Width = Application.GetRealWidth(85), + Height = Application.GetRealHeight(66), + TextColor = 0xFFFFFFFF, + TextSize = 50, + TextAlignment = TextAlignment.TopLeft, + Text = MainPage.cityInfo.temperature + "掳" + }; + topView.AddChidren(btnOutdoorTemp); + + var btnWeather = new Button() + { + X = btnOutdoorTemp.Right, + Y = Application.GetRealHeight(95), + Width = Application.GetRealWidth(80), + Height = Application.GetRealHeight(26), + Text = MainPage.cityInfo.weather, + TextColor = 0xFFFFFFFF, + TextSize = 14, + TextAlignment = TextAlignment.CenterLeft, + }; + topView.AddChidren(btnWeather); + + + + + var environmentalView = new FrameLayout() + { + Y = Application.GetRealHeight(150), + Height = Application.GetRealHeight(32), + }; + topView.AddChidren(environmentalView); + + var btnHumidityIcon = new Button() + { + X = Application.GetRealWidth(25), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/DeviceInfoIcon/HumidityIcon.png", + }; + environmentalView.AddChidren(btnHumidityIcon); + + var btnHumidityValues = new TextButton() + { + X = btnHumidityIcon.Right + Application.GetRealWidth(4), + Gravity = Gravity.CenterVertical, + TextColor = 0xFFFFFFFF, + TextSize = 16, + Text = MainPage.cityInfo.humidity + "%", + TextAlignment = TextAlignment.CenterLeft, + }; + btnHumidityValues.Width = btnHumidityValues.GetTextWidth(); + environmentalView.AddChidren(btnHumidityValues); + + var btnPm25Icon = new Button() + { + X = btnHumidityValues.Right + Application.GetRealWidth(14), + Gravity = Gravity.CenterVertical, + Width = Application.GetMinRealAverage(16), + Height = Application.GetMinRealAverage(16), + UnSelectedImagePath = "Public/DeviceInfoIcon/Pm25Icon.png", + }; + environmentalView.AddChidren(btnPm25Icon); + + var btnPm25Values = new TextButton() + { + X = btnPm25Icon.Right + Application.GetRealWidth(4), + Gravity = Gravity.CenterVertical, + TextColor = 0xFFFFFFFF, + TextSize = 16, + Text = MainPage.cityInfo.pm25, + TextAlignment = TextAlignment.CenterLeft, + }; + btnPm25Values.Width = btnPm25Values.GetTextWidth(); + environmentalView.AddChidren(btnPm25Values); + + + #endregion + + bodyView.AddChidren(new Button + { + Height = Application.GetRealHeight(8), + }); + + #region 鏁版嵁 + var infoView = new FrameLayout() + { + Y = topView.Bottom, + Height = Application.GetRealHeight(104), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(infoView); + + var infoContentView = new FrameLayout() + { + Gravity = Gravity.Center, + Width = Application.GetRealWidth(343), + Height = Application.GetRealHeight(72), + BackgroundColor = 0x22222222, + }; + infoView.AddChidren(infoContentView); + + #region 浼犳劅鍣ㄦ暟鎹� + int sensorCount = 0; + var tempObj = function.GetAttribute(AcstParent_AttrEnum.room_temp.ToString()); + if(tempObj!= null) + { + sensorCount++; + } + var humiObj = function.GetAttribute(AcstParent_AttrEnum.room_humidity.ToString()); + if(humiObj != null) + { + sensorCount++; + } + var pm25Obj = function.GetAttribute(AcstParent_AttrEnum.pm25.ToString()); + if (pm25Obj != null) + { + sensorCount++; + } + var co2Obj = function.GetAttribute(AcstParent_AttrEnum.co2.ToString()); + if (co2Obj != null) + { + sensorCount++; + } + var tvocObj = function.GetAttribute(AcstParent_AttrEnum.tvoc.ToString()); + if (tvocObj != null) + { + sensorCount++; + } + + var sensorListView = new HorizontalScrolViewLayout() + { + Width = Application.GetRealWidth(60 * sensorCount), + Gravity = Gravity.Center, + }; + infoContentView.AddChidren(sensorListView); + + if (tempObj != null) + { + new SensorDiyView(sensorListView, curColor, tempObj.curValue.ToString() + "掳", "娓╁害"); + } + if (humiObj != null) + { + new SensorDiyView(sensorListView, curColor, humiObj.curValue.ToString() + "%", "婀垮害"); + } + if (pm25Obj != null) + { + new SensorDiyView(sensorListView, curColor, pm25Obj.curValue.ToString(), "PM2.5"); + } + if (co2Obj != null) + { + new SensorDiyView(sensorListView, curColor, co2Obj.curValue.ToString(), "CO2"); + } + if (tvocObj != null) + { + new SensorDiyView(sensorListView, curColor, tvocObj.curValue.ToString(), "TVOC"); + } + #endregion + + #region 鑳借�楁暟鎹� + int energyCount = 0; + var dayObj = function.GetAttribute(AcstParent_AttrEnum.day_electricity.ToString()); + if (dayObj != null) + { + energyCount++; + } + var monthObj = function.GetAttribute(AcstParent_AttrEnum.month_electricity.ToString()); + if (monthObj != null) + { + energyCount++; + } + var totalObj = function.GetAttribute(AcstParent_AttrEnum.total_electricity.ToString()); + if (totalObj != null) + { + energyCount++; + } + + var energyListView = new HorizontalScrolViewLayout() + { + Width = Application.GetRealWidth(60 * energyCount), + Gravity = Gravity.Center, + Visible = false, + }; + infoContentView.AddChidren(energyListView); + if (dayObj != null) + { + new SensorDiyView(energyListView, curColor, dayObj.curValue.ToString(), "浠婃棩鑰楃數"); + } + if (monthObj != null) + { + new SensorDiyView(energyListView, curColor, monthObj.curValue.ToString(), "鏈湀鑰楃數"); + } + if (totalObj != null) + { + new SensorDiyView(energyListView, curColor, totalObj.curValue.ToString(), "鎬昏�楃數閲�"); + } + + var btnChangeClick = new Button(); + infoView.AddChidren(btnChangeClick); + + bool showSensor = true; + EventHandler<MouseEventArgs> changeInfoEvent = (sender, e) => { + if (showSensor) + { + sensorListView.Visible = false; + showSensor = false; + energyListView.Visible = true; + } + else + { + sensorListView.Visible = true; + showSensor = true; + energyListView.Visible = false; + } + }; + btnChangeClick.MouseUpEventHandler = changeInfoEvent; + + + #endregion + + #endregion + + #region 瀛愭帶鍒楄〃 + + var subTitleView = new FrameLayout() + { + Height = Application.GetRealHeight(54), + }; + bodyView.AddChidren(subTitleView); + + var btnCollection = new Button() + { + X = Application.GetRealWidth(6), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(39), + Height = Application.GetRealHeight(39), + UnSelectedImagePath = "Function/Acst/CollectionIcon_bule.png", + }; + subTitleView.AddChidren(btnCollection); + + var btnTitleText = new Button() + { + X = btnCollection.Right, + Text = "鎴戠殑瀹跺涵", + TextSize = 16, + TextColor = 0xFF242424, + TextAlignment = TextAlignment.CenterLeft, + IsBold = true, + }; + subTitleView.AddChidren(btnTitleText); + + int subFunctionCount = 0; + + var subFunctionListView = new HorizontalScrolViewLayout() + { + Height = Application.GetRealHeight(88), + }; + bodyView.AddChidren(subFunctionListView); + + foreach(var sub in FunctionList.List.GetAcstSubList()) + { + if(subFunctionCount > 0 && subFunctionCount % 2 == 0) + { + subFunctionListView = new HorizontalScrolViewLayout() + { + Height = Application.GetRealHeight(88), + }; + bodyView.AddChidren(subFunctionListView); + } + + subFunctionListView.AddChidren(new Button { Width = Application.GetRealWidth(16) }); + + var subFunctionView = new FrameLayout() { + Width = Application.GetRealWidth(164), + Height = Application.GetRealHeight(72), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + }; + subFunctionListView.AddChidren(subFunctionView); + + var btnRoomInfo = new Button() + { + X = Application.GetRealWidth(18), + Height = Application.GetRealHeight(40), + TextAlignment = TextAlignment.CenterLeft, + TextColor = 0xFF1b3053, + TextSize = 13, + Text = sub.GetRoomListName(), + }; + subFunctionView.AddChidren(btnRoomInfo); + + + var btnSubTempIcon = new Button() + { + X = Application.GetRealWidth(16), + Y = Application.GetRealHeight(47), + Width = Application.GetMinRealAverage(11), + Height = Application.GetMinRealAverage(11), + UnSelectedImagePath = "FunctionIcon/CAC/HvacCacTempIcon.png", + }; + subFunctionView.AddChidren(btnSubTempIcon); + var btnSubTempValues = new TextButton() + { + X = btnSubTempIcon.Right, + Y = Application.GetRealHeight(45), + Height = Application.GetRealHeight(14), + Width = Application.GetRealWidth(22), + TextColor =0xFF1b3035, + TextSize = 10, + Text = sub.GetAttrState(AcstSub_AttrEnum.room_temp.ToString()) + "掳C", + TextAlignment = TextAlignment.CenterLeft, + }; + subFunctionView.AddChidren(btnSubTempValues); + + Button btnSubHumidityIcon = new Button() + { + X = btnSubTempValues.Right + Application.GetRealWidth(5), + Y = Application.GetRealHeight(47), + Width = Application.GetMinRealAverage(11), + Height = Application.GetMinRealAverage(11), + UnSelectedImagePath = "FunctionIcon/CAC/HvacCacHumidityIcon.png", + }; + subFunctionView.AddChidren(btnSubHumidityIcon); + + var btnSubHumidityValues = new TextButton() + { + X = btnSubHumidityIcon.Right, + Y = Application.GetRealHeight(45), + Height = Application.GetRealHeight(14), + Width = Application.GetRealWidth(22), + TextColor = 0xFF1b3053, + TextSize = 10, + Text = sub.GetAttrState(AcstSub_AttrEnum.room_humidity.ToString()) + "%", + TextAlignment = TextAlignment.CenterLeft, + }; + subFunctionView.AddChidren(btnSubHumidityValues); + + + var btnSubPower = new Button() + { + X = Application.GetRealWidth(121), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(28), + Height = Application.GetRealWidth(28), + BackgroundColor = curColor, + Text = "寮�鍏�", + TextAlignment = TextAlignment.Center, + }; + subFunctionView.AddChidren(btnSubPower); + + + + subFunctionCount++; + } + + #endregion + + + + + + + + + + bodyView.AddChidren(new Button() + { + Height = Application.GetRealHeight(72), + }); + + + #region 搴曢儴鎺у埗鏍� + var bottomView = new FrameLayout() + { + Y = Application.GetRealHeight(667 - 56), + Height = Application.GetRealHeight(56), + BackgroundColor = CSS.CSS_Color.MainBackgroundColor, + }; + this.AddChidren(bottomView); + + var btnModeControl = new Button() + { + X = Application.GetRealWidth(89), + Gravity = Gravity.CenterVertical, + Width = Application.GetRealWidth(38), + Height = Application.GetRealWidth(38), + BackgroundColor = curColor, + Text = "妯″紡", + TextAlignment = TextAlignment.Center, + }; + bottomView.AddChidren(btnModeControl); + btnModeControl.MouseUpEventHandler = (sender, e) => + { + + }; + + var btnPowerControl = new Button() + { + Gravity = Gravity.Center, + Width = Application.GetRealWidth(38), + Height = Application.GetRealWidth(38), + BackgroundColor = curColor, + Text = "寮�鍏�", + TextAlignment = TextAlignment.Center, + }; + bottomView.AddChidren(btnPowerControl); + + + var btnWorkSceneControl = new Button() + { + Gravity = Gravity.CenterVertical, + X = Application.GetRealWidth(249), + Width = Application.GetRealWidth(38), + Height = Application.GetRealWidth(38), + BackgroundColor = curColor, + Text = "鍦烘櫙", + TextAlignment = TextAlignment.Center, + }; + bottomView.AddChidren(btnWorkSceneControl); + + + + + #endregion + + + + + + + + InitGetWeatherAction(); + + } + + + + } + + + public class SensorDiyView + { + private FrameLayout contentView; + private Button btnValue; + private Button btnText; + public string Tag; + + public SensorDiyView(HorizontalScrolViewLayout view,uint color,string value,string text) + { + contentView = new FrameLayout() + { + Width = Application.GetRealWidth(60), + Height = Application.GetRealHeight(72), + }; + view.AddChidren(contentView); + + btnValue = new Button() + { + Y = Application.GetRealHeight(10), + Height = Application.GetRealHeight(72 - 37), + TextAlignment = TextAlignment.Center, + TextColor = color, + TextSize = 20, + Text = value, + }; + contentView.AddChidren(btnValue); + + btnText = new Button() + { + Y = Application.GetRealHeight(72 - 37), + Height = Application.GetRealHeight(37), + TextAlignment = TextAlignment.Center, + TextColor = 0xFF949AA5, + TextSize = 12, + Text = text, + }; + contentView.AddChidren(btnText); + } + + public void UpdateValue(string value) + { + btnText.Text = value; + } + } +} diff --git a/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs new file mode 100644 index 0000000..2945763 --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/Acst/AcstSubPage.cs @@ -0,0 +1,95 @@ +锘縰sing System; +using Shared; + +namespace HDL_ON.UI +{ + public class AcstSubPage : FrameLayout + { + FrameLayout bodyView; + + string imageFolder = "blue"; + + public AcstSubPage() + { + bodyView = this; + } + + + + public void LoadPage() + { + //涓�涓儗鏅浘鐗� + var framePic = new FrameLayout(); + framePic.Y = Application.GetRealHeight(120); + framePic.Width = Application.GetRealWidth(303); + framePic.Height = Application.GetRealHeight(175); + framePic.Gravity = Gravity.CenterHorizontal; + framePic.BackgroundImagePath = $"FunctionIcon/Acst/{imageFolder}/TempAndHumiBack.png"; + this.FrameWhiteCentet1.AddChidren(framePic); + + //瀹ゅ唴婀垮害 鐨勫鍣�(涓轰簡閲嶆柊璁$畻鍧愭爣浣跨敤) + int frameWidth = framePic.Width / 2 - this.GetPictrueRealSize(21); + var frameHumidity = new FrameLayout(); + frameHumidity.X = this.GetPictrueRealSize(21); + frameHumidity.Y = this.GetPictrueRealSize(12); + frameHumidity.Width = frameWidth; + frameHumidity.Height = frameWidth; + framePic.AddChidren(frameHumidity); + //瀹ゅ唴婀垮害鍊� + this.btnHumidity = new NormalViewControl(20, this.GetPicChidrenTextHeight(30), false); + btnHumidity.Y = this.GetPictrueRealSize(39); + btnHumidity.TextSize = 30; + btnHumidity.TextColor = CSS_Color.FirstLevelTitleColor; + btnHumidity.TextAlignment = TextAlignment.TopCenter; + frameHumidity.AddChidren(btnHumidity); + //% + this.btnHumidityUnit = new NormalViewControl(10, 10, true); + btnHumidityUnit.Y = btnHumidity.Y + this.GetPictrueRealSize(8); + btnHumidityUnit.TextColor = CSS_Color.TextualColor; + btnHumidityUnit.Text = "%"; + btnHumidityUnit.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel; + btnHumidityUnit.Width = btnHumidityUnit.GetRealWidthByText(); + frameHumidity.AddChidren(btnHumidityUnit); + //瀹ゅ唴婀垮害 + var btnHumidityView = new NormalViewControl(frameHumidity.Width, this.GetPicChidrenTextHeight(18), false); + btnHumidityView.Y = btnHumidity.Bottom + this.GetPictrueRealSize(8); + btnHumidityView.TextAlignment = TextAlignment.Center; + btnHumidityView.TextColor = CSS_Color.TextualColor; + btnHumidityView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnHumidityView.TextID = StringId.IndoorHumidity; + frameHumidity.AddChidren(btnHumidityView); + + //瀹ゅ唴娓╁害 鐨勫鍣�(涓轰簡閲嶆柊璁$畻鍧愭爣浣跨敤) + var frameTemperature = new FrameLayout(); + frameTemperature.Y = frameHumidity.Y; + frameTemperature.X = frameHumidity.Right; + frameTemperature.Width = frameWidth; + frameTemperature.Height = frameWidth; + framePic.AddChidren(frameTemperature); + //瀹ゅ唴娓╁害鍊� + this.btnTemperature = new NormalViewControl(20, this.GetPicChidrenTextHeight(30), false); + btnTemperature.Y = btnHumidity.Y; + btnTemperature.TextSize = 30; + btnTemperature.TextColor = CSS_Color.FirstLevelTitleColor; + btnTemperature.TextAlignment = TextAlignment.TopCenter; + btnTemperature.GetRealWidthByText(); + frameTemperature.AddChidren(btnTemperature); + //鈩� + this.btnTemperatureUnit = new NormalViewControl(10, 10, true); + btnTemperatureUnit.Y = btnTemperature.Y + this.GetPictrueRealSize(8); + btnTemperatureUnit.TextColor = CSS_Color.TextualColor; + btnTemperatureUnit.Text = "鈩�"; + btnTemperatureUnit.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel; + btnTemperatureUnit.Width = btnTemperatureUnit.GetRealWidthByText(); + frameTemperature.AddChidren(btnTemperatureUnit); + //瀹ゅ唴娓╁害 + var btnTemperatureView = new NormalViewControl(frameTemperature.Width, this.GetPicChidrenTextHeight(18), false); + btnTemperatureView.Y = btnTemperature.Bottom + this.GetPictrueRealSize(8); + btnTemperatureView.TextAlignment = TextAlignment.Center; + btnTemperatureView.TextColor = CSS_Color.TextualColor; + btnTemperatureView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnTemperatureView.TextID = StringId.IndoorTemp; + frameTemperature.AddChidren(btnTemperatureView); + } + } +} -- Gitblit v1.8.0