DLL/Android/Shared.Droid.JLCountryCode.dllold mode 100755 new mode 100644 Binary files differ
HDL-ON_Android/Assets/Language.ini
@@ -411,6 +411,7 @@ 426=Air dry time 427=Disinfect time 428=Anion Time 429=Real time power consumption: {0}kw 429=H 430=Min @@ -424,11 +425,12 @@ 438=humidity:{0}% air:{1} wind:{2} 1000=Indoor Humidity 1001=V-chip 1002=Anion 1003=Sterilization 1004=Humidification 1004=Humidify 1005=Filter Element Reset 1006=Lighting 1007=Automatic @@ -500,7 +502,18 @@ 1073=Please turn on Bluetooth 1074=Location information(GBS) unavailable 1075=Network unavailable 1076=Select infrared remote control 1076=Select infrared remote control 1077=Air Fresh 1078=Residual filter screen 1079=Energy 1080=Ventilated ;别看下面都一样,都是UI特殊要求整的,再加上考虑英文长度 1081=1st Gear 1082=2nd Gear 1083=3rd Gear 1084=1st Gear 1085=2nd Gear 1086=3rd Gear 5000=Music 5001=Group @@ -1186,6 +1199,7 @@ 436=已添加功能 437=设备列表 438=湿度:{0}% 空气:{1} 风速:{2}级 439=实时功耗: {0}kW 1000=室内湿度 1001=童锁 @@ -1264,6 +1278,17 @@ 1074=位置信息(GBS)不可用 1075=网络不可用 1076=选择红外遥控器 1077=新风 1078=当前滤网剩余 1079=节能 1080=通风 1081=1档 1082=2档 1083=3档 1084=风速1档 1085=风速2档 1086=风速3档 4000=可视对讲 HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Comfortable.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/ComfortableSelect.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Energy.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/EnergySelect.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan1Select.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan2Select.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Fan3Select.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Humidification.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/HumidificationSelect.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/Ventilate.png
HDL-ON_Android/Assets/Phone/FunctionIcon/AirFresh/VentilateSelect.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Energy/EnergyDrodDownIcon.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_blue.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_white.png
HDL-ON_Android/Assets/Phone/FunctionIcon/Icon/airFreshjinmao.png
HDL-ON_Android/HDL-ON_Android.csproj
@@ -336,6 +336,7 @@ <Folder Include="Assets\Phone\FunctionIcon\Electrical\ClothesHanger\" /> <Folder Include="Assets\Phone\PirIcon\" /> <Folder Include="Assets\Phone\VideoIcon\" /> <Folder Include="Assets\Phone\FunctionIcon\Energy\" /> </ItemGroup> <ItemGroup /> <ItemGroup> @@ -1076,16 +1077,30 @@ <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\0.png" /> <AndroidAsset Include="Assets\Phone\PirIcon\add.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AC\More.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Energy\EnergyDrodDownIcon.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\VentilateSelect.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\EnergySelect.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan2Select.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan3.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Energy.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan2.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\ComfortableSelect.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan1.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan3Select.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\TempAndHumiBack.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Comfortable.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Humidification.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\HumidificationSelect.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Ventilate.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\Fan1Select.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\Fan\DialogTitleMenuGroud2.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\airFreshjinmao.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_blue.png" /> <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_white.png" /> </ItemGroup> <ItemGroup> <AndroidNativeLibrary Include="libs\armeabi-v7a\libelianjni.so" /> <AndroidNativeLibrary Include="libs\armeabi-v7a\libjcore127.so" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\ys\ys.csproj"> <Project>{DF065E3F-C3A1-4908-9582-000974B7C290}</Project> <Name>ys</Name> </ProjectReference> </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" /> 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="202103262" android:versionName="1.1.202103262" package="com.hdl.onpro"> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103302" android:versionName="1.1.202103302" package="com.hdl.onpro"> <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> <!-- 定位权限--> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> HDL-ON_Android/Resources/Resource.designer.cs
Diff too large HDL-ON_iOS/HDL-ON_iOS.csproj
@@ -446,6 +446,7 @@ <Folder Include="Resources\Phone\FunctionIcon\ArmSensor\" /> <Folder Include="Resources\Phone\FunctionIcon\Electrical\ClothesHanger\" /> <Folder Include="Resources\Phone\FunctionIcon\EnvirSensor\" /> <Folder Include="Resources\Phone\FunctionIcon\Energy\" /> </ItemGroup> <ItemGroup> <InterfaceDefinition Include="LaunchScreen.storyboard" /> @@ -1195,6 +1196,26 @@ <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TvocIcon.png" /> <BundleResource Include="Resources\Phone\PirIcon\add.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AC\More.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Energy\EnergyDrodDownIcon.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\VentilateSelect.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\EnergySelect.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan2Select.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan3.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Energy.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan2.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\ComfortableSelect.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan1.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan3Select.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\TempAndHumiBack.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Comfortable.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Humidification.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\HumidificationSelect.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Ventilate.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\Fan1Select.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\Fan\DialogTitleMenuGroud2.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\airFreshjinmao.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_blue.png" /> <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\airFreshjinmao_white.png" /> </ItemGroup> <ItemGroup> <ITunesArtwork Include="iTunesArtwork" /> HDL-ON_iOS/Info.plist
@@ -104,9 +104,9 @@ <key>UIStatusBarStyle</key> <string>UIStatusBarStyleLightContent</string> <key>CFBundleShortVersionString</key> <string>1.1.202103262</string> <string>1.1.202103301</string> <key>CFBundleVersion</key> <string>202103262</string> <string>202103301</string> <key>NSLocationWhenInUseUsageDescription</key> <string>Use geographic location to provide services such as weather</string> <key>NSAppleMusicUsageDescription</key> HDL-ON_iOS/Resources/Language.ini
@@ -411,6 +411,7 @@ 426=Air dry time 427=Disinfect time 428=Anion Time 429=Real time power consumption: {0}kw 429=H 430=Min @@ -423,13 +424,11 @@ 437=Device List 438=humidity:{0}% air:{1} wind:{2} 1000=Indoor Humidity 1000=Room Humidity 1001=V-chip 1002=Anion 1003=Sterilization 1004=Humidification 1004=Humidify 1005=Filter Element Reset 1006=Lighting 1007=Automatic @@ -501,7 +500,18 @@ 1073=Please turn on Bluetooth 1074=Location information(GBS) unavailable 1075=Network unavailable 1076=Select infrared remote control 1076=Select infrared remote control 1077=Air Fresh 1078=Residual filter screen 1079=Energy 1080=Ventilated ;别看下面都一样,都是UI特殊要求整的,再加上考虑英文长度 1081=1st Gear 1082=2nd Gear 1083=3rd Gear 1084=1st Gear 1085=2nd Gear 1086=3rd Gear 5000=Music 5001=Group @@ -1187,6 +1197,7 @@ 436=已添加功能 437=设备列表 438=湿度:{0}% 空气:{1} 风速:{2}级 439=实时功耗: {0}kW 1000=室内湿度 1001=童锁 @@ -1265,6 +1276,17 @@ 1074=位置信息(GBS)不可用 1075=网络不可用 1076=选择红外遥控器 1077=新风 1078=当前滤网剩余 1079=节能 1080=通风 1081=1档 1082=2档 1083=3档 1084=风速1档 1085=风速2档 1086=风速3档 4000=可视对讲 4001=通话记录 HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Comfortable.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/ComfortableSelect.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Energy.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/EnergySelect.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan1.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan1Select.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan2.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan2Select.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan3.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Fan3Select.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Humidification.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/HumidificationSelect.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/TempAndHumiBack.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/Ventilate.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/AirFresh/VentilateSelect.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Electrical/Fan/DialogTitleMenuGroud2.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Energy/EnergyDrodDownIcon.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_blue.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/HomeIcon/airFreshjinmao_white.png
HDL-ON_iOS/Resources/Phone/FunctionIcon/Icon/airFreshjinmao.png
HDL_APP_Project.sln
@@ -9,8 +9,6 @@ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Blufi", "HdlBluWi\Blufi.csproj", "{2DDF4C3C-6998-432E-9F43-6786D82F0630}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ys", "ys\ys.csproj", "{DF065E3F-C3A1-4908-9582-000974B7C290}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -57,17 +55,5 @@ {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Debug|iPhone.Build.0 = Debug|Any CPU {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.ActiveCfg = Release|Any CPU {2DDF4C3C-6998-432E-9F43-6786D82F0630}.Release|iPhone.Build.0 = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.Build.0 = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.Build.0 = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.ActiveCfg = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.Build.0 = Debug|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.ActiveCfg = Release|Any CPU {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.Build.0 = Release|Any CPU EndGlobalSection EndGlobal HDL_ON/Common/ApiUtlis.cs
@@ -277,6 +277,13 @@ //===================读取逻辑列表========================== UI.UI2.Intelligence.Automation.MainView.GetLogicList(); //===================读取可视对讲数据========================== var flVideoInfo = HttpRequest.CheckFlVideo(); if(flVideoInfo.Code == StateCode.SUCCESS) { FunctionList.List.videoIntercom = Newtonsoft.Json.JsonConvert.DeserializeObject<UI.UI2.FuntionControlView.Video.VideoMethod.VideoClouds>(flVideoInfo.Data.ToString()); } } catch (Exception ex) { HDL_ON/Common/R.cs
@@ -4,7 +4,7 @@ { public static class StringId { //public const int EnergyMonitoring = 439; public const int RealTimePowerConsumption = 439; public const int EnvirSensorValueTip = 438; public const int DeviceList = 437; public const int AddedDevice = 436; @@ -739,7 +739,47 @@ /// <summary> /// 选择红外遥控器 /// </summary> public const int ChooseInfraredRemoteControl = 1076; public const int ChooseInfraredRemoteControl = 1076; /// <summary> /// 新风 /// </summary> public const int AirFresh = 1077; /// <summary> /// 当前滤网剩余 /// </summary> public const int ResidualFilterScreen = 1078; /// <summary> /// 节能 /// </summary> public const int Energy = 1079; /// <summary> /// 通风 /// </summary> public const int Ventilated = 1080; /// <summary> /// 1档 /// </summary> public const int OneGear = 1081; /// <summary> /// 2档 /// </summary> public const int TwoGear = 1082; /// <summary> /// 3档 /// </summary> public const int ThreeGear = 1083; /// <summary> /// 风速1档 /// </summary> public const int FanOneGear = 1084; /// <summary> /// 风速2档 /// </summary> public const int FanTwoGear = 1085; /// <summary> /// 风速3档 /// </summary> public const int FanThreeGear = 1086; public const int keshiduijiang = 4000; HDL_ON/DAL/DriverLayer/Control_Udp.cs
@@ -699,46 +699,60 @@ case SPK.AirFreshJinmao: //1 新风编号 1~200 //2 类型 第三方类型 0:金茂新风 //3 开关 0 - 关机,1 - 开机 byte switchValue = 0; if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff) == true && commandDictionary[FunctionAttributeKey.OnOff] == "on") { switchValue = 1; } //4 运行模式 1 - 通风,2 - 加湿 byte airFreshMode = 1; if (function.GetAttrState(FunctionAttributeKey.Mode) == "fan") if (commandDictionary.ContainsKey(FunctionAttributeKey.Mode) == true && commandDictionary[FunctionAttributeKey.Mode] == "humidification") { airFreshMode = 2; } //5 节能舒适选择 1 - 舒适,2 - 节能 byte airFreshEnergy = 1; if( function.GetAttrState(FunctionAttributeKey.Energy)=="true") if (commandDictionary.ContainsKey(FunctionAttributeKey.Energy) == true && commandDictionary[FunctionAttributeKey.Energy] == "true") { airFreshEnergy = 2; } //6 风速档位 0 - 自动,1 - 1档,2 - 2档,3 - 3档 byte airFreshFan = 0; switch(function.GetAttrState(FunctionAttributeKey.FanSpeed)) if (commandDictionary.ContainsKey(FunctionAttributeKey.FanSpeed) == true) { case "auto": airFreshFan = 0; break; case "level_1": airFreshFan = 1; break; case "level_2": airFreshFan = 2; break; case "level_3": airFreshFan = 3; break; switch (commandDictionary[FunctionAttributeKey.FanSpeed]) { case "auto": airFreshFan = 0; break; case "level_1": airFreshFan = 1; break; case "level_2": airFreshFan = 2; break; case "level_3": airFreshFan = 3; break; } } //7 湿度设定 % //8 室内温度值 ℃ //9 室内湿度值 ℃ //10 过滤网剩余 % //11 过滤网使用超时 1 超时 0 无 ControlBytesSend(Command.FreshAirControl_JinMao, subnetId, deviceId, new byte[] { function.bus.LoopId,0, function.trait_on_off.curValue.ToString() == "on" ? (byte)1 : (byte)0 , function.bus.LoopId,0, switchValue , airFreshMode,airFreshEnergy, airFreshFan, Convert.ToByte( function.GetAttrState(FunctionAttributeKey.Humidity)), Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Humidity)), 0,0,0,0 //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorTemp)), //Convert.ToByte( function.GetAttrState(FunctionAttributeKey.IndoorHumidity)), HDL_ON/DAL/DriverLayer/Packet.cs
@@ -97,7 +97,7 @@ { ddd += bb + ","; } MainPage.Log(ddd); MainPage.Log(((int)command) + " : " + ddd); #endif //处理是否要重发数据 ManagerReceive(subnetID, deviceID, command, usefulBytes); @@ -666,8 +666,8 @@ /// 10 过滤网剩余 % /// 11 过滤网使用超时 1 超时 0 无 true/false airFresh.SetAttrState(FunctionAttributeKey.OnOff, receiveBytes[2] == 0 ? "off" : "on"); airFresh.SetAttrState(FunctionAttributeKey.Mode, receiveBytes[3] == 1 ? "humidification" : "fan"); airFresh.SetAttrState(FunctionAttributeKey.Energy, receiveBytes[4] == 1 ? "true" : "false"); airFresh.SetAttrState(FunctionAttributeKey.Mode, receiveBytes[3] == 1 ? "fan" : "humidification"); airFresh.SetAttrState(FunctionAttributeKey.Energy, receiveBytes[4] == 1 ? "false" : "true"); switch (receiveBytes[5]) { case 0: @@ -688,6 +688,8 @@ airFresh.SetAttrState(FunctionAttributeKey.IndoorHumidity, receiveBytes[8].ToString()); airFresh.SetAttrState(FunctionAttributeKey.FilterRemain, receiveBytes[9].ToString()); airFresh.SetAttrState(FunctionAttributeKey.FilterTimeout, receiveBytes[10] == 1 ? "true" : "false"); //设备状态推送 Stan.HdlFormLogic.Current.DeviceStatuPush(airFresh, true); } break; } HDL_ON/DAL/Server/HttpServerRequest.cs
@@ -492,8 +492,7 @@ Address = mHome.homeAddress, isAllowCreateScene = mHome.isAllowCreateScene, }; if (home.isBindGateway) //if (home.isBindGateway) { UserInfo.Current.regionList.Add(home); } @@ -2226,11 +2225,25 @@ public ResponsePackNew EZGetChildToken() { Dictionary<string, object> d = new Dictionary<string, object>(); //d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); var requestJson = HttpUtil.GetSignRequestJson(d); return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); } #endregion #region 可视对讲 /// <summary> /// 检查住宅是否绑定丰林,并获取门口机列表 /// </summary> /// <returns></returns> public ResponsePackNew CheckFlVideo() { Dictionary<string, object> d = new Dictionary<string, object>(); d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); var requestJson = HttpUtil.GetSignRequestJson(d); var pack = HttpUtil.RequestHttpsPostFroHome( NewAPI.API_POST_FL_Check, requestJson); return pack; } #endregion } } HDL_ON/Entity/Function/Function.cs
@@ -1070,6 +1070,23 @@ } #endregion #region 能源 /// <summary> /// 能源模块 /// </summary> public const string EnergyStandard = "energy.standard"; /// <summary> /// 能源spk列表 /// </summary> /// <returns></returns> public static List<string> EnergySpkList() { var spkList = new List<string>(); spkList.Add(EnergyStandard); return spkList; } #endregion #region 音乐 /// <summary> /// (音乐) HDL_ON/Entity/FunctionList.cs
@@ -80,6 +80,17 @@ var spkList = SPK.AirFreshSpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } /// <summary> /// 能源列表 /// </summary> /// <returns></returns> public List<Function> GetEnergyList() { var spkList = SPK.EnergySpkList(); return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } #region 家电列表 electricals /// <summary> /// 家电列表 @@ -117,6 +128,14 @@ return Functions.FindAll((obj) => spkList.Contains(obj.spk)); } /// <summary> /// 可视对讲列表 /// </summary> public UI.UI2.FuntionControlView.Video.VideoMethod.VideoClouds videoIntercom; /// <summary> /// 场景列表 /// </summary> public List<Scene> scenes = new List<Scene>(); /// <summary> HDL_ON/HDL_ON.projitems
@@ -390,6 +390,8 @@ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage_AddIrButton.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EnergyMainPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\ESOnVideo.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Energy\EchartsOption_Energy.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AirFreshControlPage.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoMethod.cs" /> <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\VideoSend.cs" /> </ItemGroup> HDL_ON/UI/MainPage.cs
@@ -20,7 +20,7 @@ /// <summary> /// 版本号 /// </summary> public static string VersionString = "1.1.0326"; public static string VersionString = "1.2.0330"; ///// <summary> ///// 客户端类型 ///// </summary> HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -142,6 +142,10 @@ case SPK.IrLearn: var irLearinPage = new IrLearnPage(); irLearinPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; case SPK.AirFreshJinmao: var airFresh1 = new AirFreshControlPage(); airFresh1.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); break; } }; HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
@@ -360,13 +360,18 @@ /// <summary> /// 根据文本,计算它需要的总行数 /// </summary> /// <param name="i_width">当值为-1时,需要父控件,真实值</param> /// <returns></returns> public int GetRealRowCountByText() public int GetRealRowCountByText(int i_width = -1) { if (i_width == -1) { i_width = this.Width; } //先获取它的真实宽度 int realWidth = this.GetRealWidthByText(); int row = realWidth / this.Width; if (realWidth % this.Width > 0) int row = realWidth / i_width; if (realWidth % i_width > 0) { row++; } HDL_ON/UI/UI0-Stan/Controls/FrameLayoutControls/FrameRowControl.cs
@@ -126,7 +126,8 @@ } var btnCaption = new NormalViewControl(i_width, i_height, real); btnCaption.X = XX; //2021.03.18 整英文版,加上自动换行 btnCaption.IsMoreLines = true; btnCaption.Text = i_caption; return btnCaption; @@ -329,6 +330,8 @@ btnContr.TextColor = CSS_Color.PromptingColor1; btnContr.Text = i_text; btnContr.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; //2021.03.18 整英文版,加上自动换行 btnContr.IsMoreLines = true; return btnContr; } HDL_ON/UI/UI0-Stan/Form/Base/CommonFormBase.cs
@@ -215,6 +215,24 @@ return Application.GetRealWidth(i_size); } /// <summary> /// 获取图片里面,子控件文本的高度 /// </summary> /// <param name="i_height">高度</param> /// <returns></returns> public int GetPicChidrenTextHeight(int i_height) { int value1 = Application.GetRealHeight(i_height); int value2 = Application.GetRealWidth(i_height); //当宽度比率大于高度时,用宽度 if (value2 > value1) { return value2; } //否则,考虑到显示完全的问题,需要使用高度比率 return value1; } #endregion #region ■ 反射方法___________________________ @@ -274,9 +292,11 @@ return myMethod.Invoke(form, parameter); } catch (Exception ex) { //出现未知错误,数据丢失 HdlMessageLogic.Current.ShowAppProgramIsError(ex); { #if DEBUG //出现未知错误,数据丢失 HdlMessageLogic.Current.ShowAppProgramIsError(ex); #endif return null; } } HDL_ON/UI/UI0-Stan/Form/Base/EditorCommonForm.cs
@@ -290,7 +290,7 @@ #region ■ 添加列表消息显示控件_______________ /// <summary> /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标 /// 添加列表消息显示控件,返回的是最后一个控件的底部坐标(没看懂这个函数前,请勿使用) /// </summary> /// <param name="frameTable">桌布容器控件</param> /// <param name="i_msg">显示的消息(换行请使用【{0}】进行分割)</param> @@ -303,12 +303,37 @@ /// <para>注:除了新建这个函数的开发者以外,都不建议把这个值不设置为true</para> /// <para>说明:以最长的控件的X轴为基准,所有控件的X轴都变成一致</para> /// </param> /// <param name="i_width">文本宽度,真实值,当为-1时,内部自动计算</param> /// <returns></returns> public int AddListMsgControls(FrameLayout frameTable, string i_msg, int i_fontSize, uint i_fontColor, int i_height, int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false) int i_yy, TextAlignment alignment = TextAlignment.Center, bool special = false, int i_width = -1) { var listMsg = i_msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); int defultWidth = this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2; int defultWidth = 0; if (this.bodyFrameLayout != null) { defultWidth = i_width == -1 ? this.bodyFrameLayout.Width - HdlControlResourse.XXLeft * 2 : i_width; } else { defultWidth = i_width == -1 ? frameTable.Width - HdlControlResourse.XXLeft * 2 : i_width; } //如果只是一行的时候 bool isMoreLine = false; if (listMsg.Length == 1) { var btnTemp = new ButtonCtrBase(); btnTemp.TextSize = i_fontSize; btnTemp.Text = i_msg; int rowCount = btnTemp.GetRealRowCountByText(defultWidth); //它的高度由行数决定(理论上应该都是1行,这里做特殊处理而已) if (rowCount > 1) { i_height = i_height * rowCount; isMoreLine = true; } } var listContr = new List<NormalViewControl>(); int minXX = 10086;//控件集合最小的X轴 @@ -322,6 +347,11 @@ btnMsg.TextColor = i_fontColor; btnMsg.TextSize = i_fontSize; btnMsg.Text = strMsg; if (isMoreLine == true) { //可以换行 btnMsg.IsMoreLines = isMoreLine; } //特殊处理 if (special == true && alignment == TextAlignment.Center) HDL_ON/UI/UI0-Stan/Logic/HdlDeviceStatuPushLogic.cs
@@ -44,28 +44,8 @@ if (localDevice != null) { foreach (var attr in updateData) { //var localAttr2 = localDevice.attributes.Find((obj) => obj.key == attr.key); //if (localAttr2 == null) //{ // //本身它就没有这个属性,则不处理 // continue; //} ////更改属性值 //localAttr2.curValue = attr.value; //var localAttr = localDevice.status.Find((obj) => obj.key == attr.key); //if (localAttr == null) //{ // //status是当前设备上报过的属性才会存在,也就是它的个数有可能和attributes不一致 // localAttr = new AttributesStatus() { key = attr.key, value = attr.value }; // localDevice.status.Add(localAttr); //} ////更改属性值 //localAttr.value = attr.value; localDevice.SetAttrState(attr.key, attr.value); { localDevice.SetAttrState(attr.key, attr.value); } //全部界面推送 HdlFormLogic.Current.DeviceStatuPush(localDevice); HDL_ON/UI/UI0-Stan/Logic/HdlFormLogic.cs
@@ -147,7 +147,8 @@ /// 设备状态更新推送 /// </summary> /// <param name="i_LocalDevice">本地设备对象</param> public void DeviceStatuPush(Entity.Function i_LocalDevice) /// <param name="refreshCardContr">是否刷新主页,分类,房间等等的设备卡片的状态,默认不刷新(此变量目前是给bus接收那里使用的)</param> public void DeviceStatuPush(Entity.Function i_LocalDevice, bool refreshCardContr = false) { HdlThreadLogic.Current.RunMain(() => { @@ -155,11 +156,37 @@ { this.ListActionForm[i]?.DeviceStatuPush(i_LocalDevice); } if (refreshCardContr == true) { //刷新主页,分类,房间等等的设备卡片状态 this.RefreshAllDeviceCardControl(i_LocalDevice); } }, ShowErrorMode.NO); } #endregion #region ■ 手动刷新各设备卡片_________________ /// <summary> /// 手动刷新主页,分类,房间等等的设备卡片状态 /// </summary> /// <param name="i_device">需要刷新的设备对象</param> public void RefreshAllDeviceCardControl(Entity.Function i_device) { //刷新主页 UI.HomePage.UpdataFunctionStates(i_device); //刷新分类 UI.ClassificationPage.UpdataInfo(i_device); //刷新房间 UI.RoomPage.UpdataStates(i_device); //刷新功能 UI.FunctionPage.UpdataStates(i_device); } #endregion #region ■ 一般方法___________________________ /// <summary> HDL_ON/UI/UI1-Login/LoginPage.cs
@@ -204,7 +204,10 @@ } else { etAccount.Text = "18316120654";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374 etAccount.Text = "BB01010101@evoyo.com";//可视对讲 //etAccount.Text = "13168123446"; //etAccount.Text = "13602944661";//kx //etAccount.Text = "18316120654";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374 //15971583093 gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 国外服务器测试 } b = !b; HDL_ON/UI/UI2/2-Classification/ClassificaitionPublicBLL.cs
@@ -59,6 +59,7 @@ case FunctionCategory.AC: case FunctionCategory.FloorHeat: case FunctionCategory.Electric: case FunctionCategory.AirFresh: #region 按钮状态更新 if (cTag == updataFunction.sid + "_Switch") { HDL_ON/UI/UI2/2-Classification/ClassificationPage.cs
@@ -495,12 +495,16 @@ case ShowFunction.Panel: break; case ShowFunction.SecurityMonitoring: functionCount = 1; //functionCount = 1; break; case ShowFunction.Sensor: functionCount = FunctionList.List.GetArmSensorList().Count; break; case ShowFunction.VideoIntercom: if (FunctionList.List.videoIntercom != null) { functionCount = 1; } break; } @@ -801,12 +805,20 @@ break; case ShowFunction.VideoIntercom: btnName.TextID = StringId.VideoIntercom; btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { var mainView = new HDL_ON.UI.UI2.FuntionControlView.Video.MainView(); MainPage.BasePageView.AddChidren(mainView); mainView.Show(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; break; } //界面跳转--音乐跳转自己的界面--环境跳转自己的界面 if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring && ShowFunction.EnergyMonitoring!= item) && ShowFunction.EnergyMonitoring!= item && ShowFunction.VideoIntercom != item) { btnFunctionViewBg.MouseUpEventHandler = (sender, e) => { HDL_ON/UI/UI2/2-Classification/ClassificationPageBLL.cs
@@ -51,6 +51,10 @@ case SPK.ClothesHanger: vv = ShowFunction.Electric; break; case SPK.AirFreshJinmao: case SPK.AirFreshStandard: vv = ShowFunction.FreshAir; break; } UpdataFunctionOnCount(vv, function.spk); UpdataCloseAllButton(function); @@ -118,6 +122,9 @@ case ShowFunction.Electric: btnText = FunctionList.List.GetElectricals().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); break; case ShowFunction.FreshAir: btnText = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count.ToString(); break; } if (btn.Tag.ToString() == functionCategory + "_onCount") { HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -108,6 +108,10 @@ else if (titleId == StringId.Sensor) { functionList.AddRange(FunctionList.List.GetArmSensorList()); } else if (titleId == StringId.FreshAir) { functionList.AddRange(FunctionList.List.GetAirFreshList()); } functionList.OrderByDescending(o => o.controlCounter).ToList(); HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs
@@ -260,6 +260,7 @@ { EventHandler<MouseEventArgs> eventHandler = (sender, e) => { var page = new BrandListPage();// AddThirdPartyBrandListpage(); // BrandListPage(); MainPage.BasePageView.AddChidren(page); page.LoadPage(); HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AcControlPage.cs
@@ -485,8 +485,8 @@ var bodyView = new FrameLayout() { Y = Application.GetRealHeight(423), Height = Application.GetRealHeight(296), Y = Application.GetRealHeight(427),//667 Height = Application.GetRealHeight(240), BackgroundColor = CSS_Color.MainBackgroundColor, }; div.AddChidren(bodyView); @@ -496,7 +496,6 @@ Y = Application.GetRealHeight(16), Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(296+200), }; bodyView.AddChidren(contentView); HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs
New file @@ -0,0 +1,686 @@ using System; using System.Collections.Generic; using System.Text; using HDL_ON.DriverLayer; using HDL_ON.Entity; using HDL_ON.Stan; using HDL_ON.UI.CSS; using Shared; namespace HDL_ON.UI { /// <summary> /// 金茂新风设备的控制界面 /// </summary> public class AirFreshControlPage : DeviceFunctionCardCommonForm { #region ■ 变量声明___________________________ /// <summary> /// 室内湿度控件 /// </summary> private NormalViewControl btnHumidity = null; /// <summary> /// %控件 /// </summary> private NormalViewControl btnHumidityUnit = null; /// <summary> /// 室内温度控件 /// </summary> private NormalViewControl btnTemperature = null; /// <summary> /// ℃控件 /// </summary> private NormalViewControl btnTemperatureUnit = null; /// <summary> /// 当前滤网剩余控件 /// </summary> private NormalViewControl btnFilterScreen = null; /// <summary> /// 节能/舒适图标控件 /// </summary> private IconViewControl btnMode1 = null; /// <summary> /// 节能/舒适文本控件 /// </summary> private NormalViewControl btnMode1View = null; /// <summary> /// 通风/加湿图标控件 /// </summary> private IconViewControl btnMode2 = null; /// <summary> /// 通风/加湿文本控件 /// </summary> private NormalViewControl btnMode2View = null; /// <summary> /// 风速图标控件 /// </summary> private IconViewControl btnFan = null; /// <summary> /// 风速文本控件 /// </summary> private NormalViewControl btnFanView = null; /// <summary> /// 开关图标 /// </summary> private IconViewControl btnSwitch = null; /// <summary> /// 新风数据 /// </summary> private AirFreshData airFreshData = new AirFreshData(); /// <summary> /// 各种文本 /// </summary> private Dictionary<string, string> dicText = new Dictionary<string, string>(); #endregion #region ■ 初始化_____________________________ /// <summary> /// 初始化白色区域的内容 /// </summary> public override void InitFrameWhiteContent() { base.SetTitleText(Language.StringByID(StringId.AirFresh)); //这个东西加个空格 this.dicText["滤网剩余"] = Language.StringByID(StringId.ResidualFilterScreen) + " "; this.dicText["节能"] = Language.StringByID(StringId.Energy); this.dicText["舒适"] = Language.StringByID(StringId.Comfortable); this.dicText["通风"] = Language.StringByID(StringId.Ventilated); this.dicText["加湿"] = Language.StringByID(StringId.Humidification); this.dicText["1档"] = Language.StringByID(StringId.OneGear); this.dicText["2档"] = Language.StringByID(StringId.TwoGear); this.dicText["3档"] = Language.StringByID(StringId.ThreeGear); //刷新当前设备的状态缓存 this.RefreshNowDeviceStatuMemory(this.device); //初始化第一个索引页的内容 this.InitFrameWhiteContent1(); } /// <summary> /// 初始化第一个索引页的内容 /// </summary> private void InitFrameWhiteContent1() { //一个背景图片 var framePic = new FrameLayout(); framePic.Y = Application.GetRealHeight(120); framePic.Width = this.GetPictrueRealSize(303); framePic.Height = this.GetPictrueRealSize(175); framePic.Gravity = Gravity.CenterHorizontal; framePic.BackgroundImagePath = "FunctionIcon/AirFresh/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); //当前滤网剩余0% this.btnFilterScreen = new NormalViewControl(this.FrameWhiteCentet1.Width, Application.GetRealHeight(18), false); btnFilterScreen.Y = framePic.Bottom; btnFilterScreen.TextAlignment = TextAlignment.Center; btnFilterScreen.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; btnFilterScreen.TextColor = CSS_Color.MainColor; this.FrameWhiteCentet1.AddChidren(btnFilterScreen); //节能/舒适图标 this.btnMode1 = new IconViewControl(28); btnMode1.X = Application.GetRealWidth(42); btnMode1.Y = btnFilterScreen.Bottom + Application.GetRealHeight(61); this.FrameWhiteCentet1.AddChidren(btnMode1); btnMode1.ButtonClickEvent += (sender, e) => { //显示节能/舒适选择界面 this.ShowMode1SelectView(); }; //节能/舒适文本 this.btnMode1View = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); btnMode1View.Y = btnMode1.Bottom + Application.GetRealHeight(6); btnMode1View.TextAlignment = TextAlignment.Center; btnMode1View.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; btnMode1View.TextColor = CSS_Color.TextualColor; this.FrameWhiteCentet1.AddChidren(btnMode1View); //通风/加湿图标 this.btnMode2 = new IconViewControl(28); btnMode2.Y = btnMode1.Y; btnMode2.Gravity = Gravity.CenterHorizontal; this.FrameWhiteCentet1.AddChidren(btnMode2); btnMode2.ButtonClickEvent += (sender, e) => { //显示通风/加湿选择界面 this.ShowMode2SelectView(); }; //通风/加湿文本 this.btnMode2View = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); btnMode2View.X = btnMode1View.Right; btnMode2View.Y = btnMode2.Bottom + Application.GetRealHeight(6); btnMode2View.TextAlignment = TextAlignment.Center; btnMode2View.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; btnMode2View.TextColor = CSS_Color.TextualColor; this.FrameWhiteCentet1.AddChidren(btnMode2View); //风速图标 this.btnFan = new IconViewControl(28); btnFan.X = this.FrameWhiteCentet1.Width - btnMode1.X - btnFan.IconSize; btnFan.Y = btnMode1.Y; this.FrameWhiteCentet1.AddChidren(btnFan); btnFan.ButtonClickEvent += (sender, e) => { //显示风速选择界面 this.ShowFanSelectView(); }; //风速文本 this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); btnFanView.X = btnMode2View.Right; btnFanView.Y = btnFan.Bottom + Application.GetRealHeight(6); btnFanView.TextAlignment = TextAlignment.Center; btnFanView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; btnFanView.TextColor = CSS_Color.TextualColor; this.FrameWhiteCentet1.AddChidren(btnFanView); //开关图标 this.btnSwitch = new IconViewControl(40); btnSwitch.Gravity = Gravity.CenterHorizontal; btnSwitch.Y = Application.GetRealHeight(468); btnSwitch.UnSelectedImagePath = "Public/PowerClose.png"; btnSwitch.SelectedImagePath = "Public/PowerOpen.png"; FrameWhiteCentet1.AddChidren(btnSwitch); btnSwitch.ButtonClickEvent += (sender, e) => { //发送开关命令 this.SendSwitchComand(); }; //刷新界面状态 this.RefreshFormStatu(); } #endregion #region ■ 显示节能/舒适选择界面______________ /// <summary> /// 显示节能/舒适选择界面 /// </summary> private void ShowMode1SelectView() { //整个灰色界面 var frameBack = new Dialog(); var dialogBody = new NormalFrameLayout(); frameBack.AddChidren(dialogBody); dialogBody.ButtonClickEvent = (sender, e) => { frameBack.Close(); }; frameBack.Show(); //菜单控件(模式) var menuContr = new DialogTitleMenuControl(2, Language.StringByID(StringId.Mode)); menuContr.X = Application.GetRealWidth(6); menuContr.Y = Application.GetRealHeight(277); menuContr.Width = Application.GetRealWidth(160); menuContr.Height = Application.GetRealHeight(154); dialogBody.AddChidren(menuContr); //节能 var iconPath = this.airFreshData.Energy == "true" ? "FunctionIcon/AirFresh/EnergySelect.png" : "FunctionIcon/AirFresh/Energy.png"; menuContr.AddRowMenu(this.dicText["节能"], iconPath, this.airFreshData.Energy == "true", () => { frameBack.Close(); //发送节能命令 this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "true"); }); //舒适 iconPath = this.airFreshData.Energy == "false" ? "FunctionIcon/AirFresh/ComfortableSelect.png" : "FunctionIcon/AirFresh/Comfortable.png"; menuContr.AddRowMenu(this.dicText["舒适"], iconPath, this.airFreshData.Energy == "false", () => { frameBack.Close(); //发送舒适命令 this.SendOtherComand(this.btnMode1, FunctionAttributeKey.Energy, "false"); }); } #endregion #region ■ 显示通风/加湿选择界面______________ /// <summary> /// 显示通风/加湿选择界面 /// </summary> private void ShowMode2SelectView() { //整个灰色界面 var frameBack = new Dialog(); var dialogBody = new NormalFrameLayout(); frameBack.AddChidren(dialogBody); dialogBody.ButtonClickEvent = (sender, e) => { frameBack.Close(); }; frameBack.Show(); //菜单控件(模式) var menuContr = new DialogTitleMenuControl(2, Language.StringByID(StringId.Mode)); menuContr.Y = Application.GetRealHeight(277); menuContr.Gravity = Gravity.CenterHorizontal; menuContr.Width = Application.GetRealWidth(160); menuContr.Height = Application.GetRealHeight(154); dialogBody.AddChidren(menuContr); //通风 var iconPath = this.airFreshData.Mode == "fan" ? "FunctionIcon/AirFresh/VentilateSelect.png" : "FunctionIcon/AirFresh/Ventilate.png"; menuContr.AddRowMenu(this.dicText["通风"], iconPath, this.airFreshData.Mode == "fan", () => { frameBack.Close(); //发送通风命令 this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "fan"); }); //加湿 iconPath = this.airFreshData.Mode == "humidification" ? "FunctionIcon/AirFresh/HumidificationSelect.png" : "FunctionIcon/AirFresh/Humidification.png"; menuContr.AddRowMenu(this.dicText["加湿"], iconPath, this.airFreshData.Mode == "humidification", () => { frameBack.Close(); //发送加湿命令 this.SendOtherComand(this.btnMode2, FunctionAttributeKey.Mode, "humidification"); }); } #endregion #region ■ 显示风速选择界面___________________ /// <summary> /// 显示风速选择界面 /// </summary> private void ShowFanSelectView() { //整个灰色界面 var frameBack = new Dialog(); var dialogBody = new NormalFrameLayout(); frameBack.AddChidren(dialogBody); dialogBody.ButtonClickEvent = (sender, e) => { frameBack.Close(); }; frameBack.Show(); //菜单控件(风速) var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.FanSpeed)); menuContr.X = Application.GetRealWidth(209); menuContr.Y = Application.GetRealHeight(231); menuContr.Width = Application.GetRealWidth(160); menuContr.Height = Application.GetRealHeight(199); dialogBody.AddChidren(menuContr); //1档 var iconPath = this.airFreshData.Fan == "level_1" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png"; menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.airFreshData.Fan == "level_1", () => { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_1"); }); //2档 iconPath = this.airFreshData.Fan == "level_2" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png"; menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.airFreshData.Fan == "level_2", () => { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_2"); }); //3档 iconPath = this.airFreshData.Fan == "level_3" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png"; menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.airFreshData.Fan == "level_3", () => { frameBack.Close(); //发送档位命令 this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "level_3"); }); } #endregion #region ■ 设备状态反馈_______________________ /// <summary> /// 设备状态反馈 /// </summary> /// <param name="i_LocalDevice"></param> public override void DeviceStatuPush(Function i_LocalDevice) { //不是同一个东西 if (this.device.sid != i_LocalDevice.sid) { return; } //刷新当前设备的状态缓存 this.RefreshNowDeviceStatuMemory(i_LocalDevice); //刷新界面状态 this.RefreshFormStatu(); } #endregion #region ■ 刷新界面状态_______________________ /// <summary> /// 刷新界面状态 /// </summary> private void RefreshFormStatu() { //开关 this.btnSwitch.IsSelected = this.airFreshData.Open; //滤网剩余 this.btnFilterScreen.Text = this.dicText["滤网剩余"] + this.airFreshData.Filter_remain + "%"; //室内湿度 if (this.btnHumidity.Text == string.Empty || Convert.ToDecimal(this.btnHumidity.Text) != this.airFreshData.Indoor_humidity) { //变更了才改 this.btnHumidity.Text = this.airFreshData.Indoor_humidity == 0 ? "0.0" : this.airFreshData.Indoor_humidity.ToString(); this.btnHumidity.Width = this.btnHumidity.GetRealWidthByText(); //重新计算坐标,让它们居中 this.btnHumidity.X = (btnHumidity.Parent.Width - btnHumidity.Width - btnHumidityUnit.Width) / 2; this.btnHumidityUnit.X = btnHumidity.Right; } //室内温度 if (this.btnTemperature.Text == string.Empty || Convert.ToDecimal(this.btnTemperature.Text) != this.airFreshData.Indoor_temp) { //变更了才改 this.btnTemperature.Text = this.airFreshData.Indoor_temp == 0 ? "0.0" : this.airFreshData.Indoor_temp.ToString(); this.btnTemperature.Width = this.btnTemperature.GetRealWidthByText(); //重新计算坐标,让它们居中 this.btnTemperature.X = (btnHumidity.Parent.Width - btnTemperature.Width - btnTemperatureUnit.Width) / 2; this.btnTemperatureUnit.X = btnTemperature.Right; } //节能/舒适 if (this.airFreshData.Energy == "true") { this.btnMode1.UnSelectedImagePath = "FunctionIcon/AirFresh/Energy.png"; this.btnMode1.SelectedImagePath = "FunctionIcon/AirFresh/EnergySelect.png"; this.btnMode1View.Text = this.dicText["节能"]; } else { this.btnMode1.UnSelectedImagePath = "FunctionIcon/AirFresh/Comfortable.png"; this.btnMode1.SelectedImagePath = "FunctionIcon/AirFresh/ComfortableSelect.png"; this.btnMode1View.Text = this.dicText["舒适"]; } this.btnMode1.IsSelected = this.airFreshData.Open; this.btnMode1.CanClick = this.airFreshData.Open; //通风/加湿 if (this.airFreshData.Mode == "fan") { this.btnMode2.UnSelectedImagePath = "FunctionIcon/AirFresh/Ventilate.png"; this.btnMode2.SelectedImagePath = "FunctionIcon/AirFresh/VentilateSelect.png"; this.btnMode2View.Text = this.dicText["通风"]; } else { this.btnMode2.UnSelectedImagePath = "FunctionIcon/AirFresh/Humidification.png"; this.btnMode2.SelectedImagePath = "FunctionIcon/AirFresh/HumidificationSelect.png"; this.btnMode2View.Text = this.dicText["加湿"]; } this.btnMode2.IsSelected = this.airFreshData.Open; this.btnMode2.CanClick = this.airFreshData.Open; //风速 if (this.airFreshData.Fan == "level_3") { this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan3.png"; this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan3Select.png"; this.btnFanView.Text = this.dicText["3档"]; } else if(this.airFreshData.Fan == "level_2") { this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan2.png"; this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan2Select.png"; this.btnFanView.Text = this.dicText["2档"]; } else { this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan1.png"; this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan1Select.png"; this.btnFanView.Text = this.dicText["1档"]; } this.btnFan.IsSelected = this.airFreshData.Open; this.btnFan.CanClick = this.airFreshData.Open; } #endregion #region ■ 发送各种命令_______________________ /// <summary> /// 发送其他命令 /// </summary> /// <param name="btnIcon">按钮</param> /// <param name="comadKey">命令主键</param> /// <param name="comadValue">命令</param> private void SendOtherComand(IconViewControl btnIcon, string comadKey, string comadValue) { btnIcon.CanClick = false; HdlThreadLogic.Current.RunThread(() => { //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) var dic = this.GetSendComandSample(); dic[comadKey] = comadValue; Control.Ins.SendWriteCommand(this.device, dic); HdlThreadLogic.Current.RunMain(() => { btnIcon.CanClick = true; }); }); } /// <summary> /// 发送开关命令 /// </summary> private void SendSwitchComand() { this.btnSwitch.CanClick = false; string statu = this.btnSwitch.IsSelected == true ? "off" : "on"; HdlThreadLogic.Current.RunThread(() => { //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) var dic = this.GetSendComandSample(); dic[FunctionAttributeKey.OnOff] = statu; Control.Ins.SendWriteCommand(this.device, dic); HdlThreadLogic.Current.RunMain(() => { this.btnSwitch.CanClick = true; }); }); } /// <summary> /// 获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) /// </summary> /// <returns></returns> private Dictionary<string, string> GetSendComandSample() { var dic = new Dictionary<string, string>(); //开关 dic[FunctionAttributeKey.OnOff] = this.airFreshData.Open == true ? "on" : "off"; //模式 dic[FunctionAttributeKey.Mode] = this.airFreshData.Mode; //节能 dic[FunctionAttributeKey.Energy] = this.airFreshData.Energy; //风速 dic[FunctionAttributeKey.FanSpeed] = this.airFreshData.Fan ; return dic; } #endregion #region ■ 一般方法___________________________ /// <summary> /// 刷新当前设备的状态缓存 /// </summary> private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) { for (int i = 0; i < i_LocalDevice.attributes.Count; i++) { var data = i_LocalDevice.attributes[i]; //开关 if (data.key == FunctionAttributeKey.OnOff) { this.airFreshData.Open = data.state == "on"; } //模式 else if (data.key == FunctionAttributeKey.Mode) { this.airFreshData.Mode = data.state; } //节能 else if (data.key == FunctionAttributeKey.Energy) { this.airFreshData.Energy = data.state; } //风速 else if (data.key == FunctionAttributeKey.FanSpeed) { this.airFreshData.Fan = data.state; } //湿度 else if (data.key == FunctionAttributeKey.Humidity) { if (data.state != string.Empty) { this.airFreshData.Humidity = Convert.ToInt32(data.state); } } //室内温度 else if (data.key == FunctionAttributeKey.IndoorTemp) { if (data.state != string.Empty) { this.airFreshData.Indoor_temp = Math.Round(Convert.ToDecimal(data.state), 1); } } //室内湿度 else if (data.key == FunctionAttributeKey.IndoorHumidity) { if (data.state != string.Empty) { this.airFreshData.Indoor_humidity = Math.Round(Convert.ToDecimal(data.state), 1); } } //过滤网剩余量 else if (data.key == FunctionAttributeKey.FilterRemain) { if (data.state != string.Empty) { this.airFreshData.Filter_remain = Convert.ToInt32(data.state); } } } } #endregion #region ■ 结构体_____________________________ /// <summary> /// 新风的数据 /// </summary> private class AirFreshData { /// <summary> /// 是否打开 /// </summary> public bool Open = false; /// <summary> /// humidification:加湿 fan:送风 /// </summary> public string Mode = string.Empty; /// <summary> /// true:节能 false:舒适 这个有问题的 /// </summary> public string Energy = string.Empty; /// <summary> /// level_1:1档 level_2:2档 level_3:3档 auto:自动(目前这个不用) /// </summary> public string Fan = string.Empty; /// <summary> /// 湿度(%) /// </summary> public int Humidity = 0; /// <summary> /// 室内温度(保留一位小数) /// </summary> public decimal Indoor_temp = 0; /// <summary> /// 室内湿度(保留一位小数) /// </summary> public decimal Indoor_humidity = 0; /// <summary> /// 剩余滤网(%) /// </summary> public int Filter_remain = 0; } #endregion } } HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs
@@ -405,7 +405,7 @@ { lightingView.SetViewStatus(lightTemp.state == "on"); } Console.WriteLine($"时间戳:{device.time_stamp} 时间:{device.GeteTime()} 烘干:{hotDryTemp.state} 风干:{windDryTemp.state} 消毒:{disinfectTemp.state} 灯光状态:{lightTemp.state}"); MainPage.Log($"时间戳:{device.time_stamp} 时间:{device.GeteTime()} 烘干:{hotDryTemp.state} 风干:{windDryTemp.state} 消毒:{disinfectTemp.state} 灯光状态:{lightTemp.state}"); #endregion #region 修改时间 HDL_ON/UI/UI2/FuntionControlView/Energy/EchartsOption_Energy.cs
New file @@ -0,0 +1,150 @@ using System; using System.Collections.Generic; namespace HDL_ON.UI.UI2.EchartsOption_Energy { public class EchartsOption_Energy { ///// <summary> ///// ///// </summary> public EchartTitle title = new EchartTitle(); /// <summary> /// /// </summary> public EchartTooltip tooltip; /// <summary> /// /// </summary> public EchartGrid grid = new EchartGrid(); /// <summary> /// /// </summary> public Echart_xAxis xAxis = new Echart_xAxis(); /// <summary> /// /// </summary> public Echart_yAxis yAxis = new Echart_yAxis(); /// <summary> /// /// </summary> public List<EchartSeriesItem> series =new List<EchartSeriesItem>(); public EchartsOption_Energy() { tooltip = new EchartTooltip { trigger = "axis", }; } } public class EchartTitle { public string text; } /// <summary> /// 线条属性 /// </summary> public class EchartLineStyle { /// <summary> /// 坐标轴刻度线宽 /// type | string /// 可选: /// 'solid' /// 'dashed' /// 'dotted' /// </summary> public string type = "solid"; /// <summary> /// /// </summary> public int width = 1; /// <summary> /// 刻度线的颜色 /// </summary> public string color = "#333"; } public class EchartTooltip { /// <summary> /// /// </summary> public string trigger ="axis"; } public class EchartGrid { /// <summary> /// /// </summary> public string left = "3%"; /// <summary> /// /// </summary> public string right = "4%"; /// <summary> /// /// </summary> public string bottom = "3%"; /// <summary> /// /// </summary> public bool containLabel = true; } /// <summary> /// 坐标轴属性 /// </summary> public class Echart_xAxis { public string type = "category"; public List<string> data = new List<string>(); public int offset = 5; public bool boundaryGap = false; } /// <summary> /// 坐标轴属性 /// </summary> public class Echart_yAxis { public string type = "value"; } public class EchartSeriesItem { /// <summary> /// 客厅 /// </summary> public string name = ""; /// <summary> /// /// </summary> public string type = "line"; /// <summary> /// /// </summary> public bool smooth = true; /// <summary> /// /// </summary> public List<int> data; /// <summary> /// none 去掉拐点 /// </summary> public string symbol = "none"; /// <summary> /// 线条样式 /// </summary> public EchartLineStyle lineStyle; } } HDL_ON/UI/UI2/FuntionControlView/Energy/EnergyMainPage.cs
@@ -1,32 +1,53 @@ using System; using System.Collections.Generic; using HDL_ON.DAL.Server; using HDL_ON.Entity; using HDL_ON.UI.CSS; using HDL_ON.UI.UI2.EchartsOption_Energy; using Shared; namespace HDL_ON.UI { public class EnergyMainPage : FrameLayout { FrameLayout bodyView; List<uint> colorList = new List<uint>(){0xFF80AEFF, 0xFFFFD154, 0xFFFF9D54, 0xFFFE6A6A, 0xFFB183C3, 0xFFADE764, 0xFFD7504B, 0xFFC6E579, 0xFFF4E001, 0xFFF0805A, 0xFF26C0C0}; List<string> colorList2 = new List<string>() { "#80AEFF", "#FFD154", "#FF9D54", "#FE6A6A", "#B183C3", "#ADE764", "#D7504B", "#C6E579", "#F4E001", "#F0805A", "#26C0C0"}; public EnergyMainPage() { bodyView = this; } /// <summary> /// /// </summary> public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.EnergyMonitoring)).LoadTopView(); bodyView.BackgroundColor = CSS_Color.BackgroundColor; var contentView = new VerticalScrolViewLayout() { Y = Application.GetRealHeight(64), Height = Application.GetRealHeight(603), }; bodyView.AddChidren(contentView); #region 顶部view var generalTableView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(80), Y = Application.GetRealHeight(16), Width = Application.GetRealWidth(343), Height = Application.GetRealWidth(148), Radius = (uint)Application.GetRealWidth(5), BackgroundColor = CSS_Color.MainBackgroundColor, }; bodyView.AddChidren(generalTableView); contentView.AddChidren(generalTableView); TextButton btnTotalValue = new TextButton() { @@ -58,18 +79,19 @@ }; generalTableView.AddChidren(btnTotalValueUint); var btnValue = new Button() var btnRealTimeData = new Button() { X = Application.GetRealWidth(18), Y = btnTotalValue.Bottom, Width = Application.GetRealWidth(209), Height = Application.GetRealWidth(28), TextColor = CSS_Color.FirstLevelTitleColor, TextColor = CSS_Color.TextualColor, TextSize = CSS_FontSize.SubheadingFontSize, IsBold = true, TextAlignment = TextAlignment.CenterLeft, TextID = StringId.RealTimePowerConsumption, }; generalTableView.AddChidren(btnValue); generalTableView.AddChidren(btnRealTimeData); btnRealTimeData.Text = Language.StringByID(StringId.RealTimePowerConsumption).Replace("{0}", "0"); var echartsView = new FrameLayout() { @@ -79,7 +101,8 @@ //Y = Application.GetRealWidth(16), }; generalTableView.AddChidren(echartsView); MyEchartsViewOn myEchartsView = new MyEchartsViewOn() { MyEchartsViewOn myEchartsView = new MyEchartsViewOn() { Width = Application.GetRealWidth(118), Height = Application.GetRealWidth(118), }; @@ -97,6 +120,365 @@ myEchartsView.ShowWithOption(echartRootJson); var btnDrodDown = new Button() { Y = Application.GetRealWidth(118), Width = Application.GetRealWidth(343), Height = Application.GetRealWidth(30), UnSelectedImagePath = "FunctionIcon/Energy/EnergyDrodDownIcon.png", }; generalTableView.AddChidren(btnDrodDown); #endregion var energyList = FunctionList.List.GetEnergyList(); var energyListView = new FrameLayout() { Y = generalTableView.Bottom + Application.GetRealWidth(8), Height = Application.GetRealWidth(116 * energyList.Count), }; contentView.AddChidren(energyListView); int index = 0; foreach (var energy in energyList) { EnergyRow(energy, energyListView, index); index++; } } FrameLayout diagramView; List<Function> queryList = new List<Function>(); string curQueryType = "hour"; void d1(FrameLayout contentView) { diagramView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealWidth(420), BackgroundColor = CSS_Color.MainBackgroundColor, Radius = (uint)Application.GetRealWidth(12), BorderColor = 0x00000000, BorderWidth = 0, }; contentView.AddChidren(diagramView); #region 选择数据日期范围 var showDataTypeView = new FrameLayout() { X = Application.GetRealWidth(183), Y = Application.GetRealHeight(12), Width = Application.GetRealWidth(144), Height = Application.GetRealHeight(24), BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png", }; diagramView.AddChidren(showDataTypeView); var btnShowHistroyData_Day = new Button() { Width = Application.GetRealWidth(48), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.PromptingColor2, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, IsSelected = true, TextID = StringId.day, }; showDataTypeView.AddChidren(btnShowHistroyData_Day); var btnShowHistroyData_Week = new Button() { X = Application.GetRealWidth(48), Width = Application.GetRealWidth(48), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.PromptingColor2, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, TextID = StringId.week, }; showDataTypeView.AddChidren(btnShowHistroyData_Week); var btnShowHistroyData_Month = new Button() { X = Application.GetRealWidth(48 * 2), Width = Application.GetRealWidth(48), TextAlignment = TextAlignment.Center, TextColor = CSS_Color.PromptingColor2, SelectedTextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, Text = DateTime.Now.Month.ToString() + Language.StringByID(StringId.month), }; showDataTypeView.AddChidren(btnShowHistroyData_Month); btnShowHistroyData_Day.MouseUpEventHandler = (sender, e) => { showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg1.png"; btnShowHistroyData_Day.IsSelected = true; btnShowHistroyData_Month.IsSelected = false; btnShowHistroyData_Week.IsSelected = false; curQueryType = "hour"; d2(); }; btnShowHistroyData_Month.MouseUpEventHandler = (sender, e) => { showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg3.png"; btnShowHistroyData_Day.IsSelected = false; btnShowHistroyData_Month.IsSelected = true; btnShowHistroyData_Week.IsSelected = false; curQueryType = "week"; d2(); }; btnShowHistroyData_Week.MouseUpEventHandler = (sender, e) => { showDataTypeView.BackgroundImagePath = "FunctionIcon/EnvironmentalScience/SensorHistoryBg2.png"; btnShowHistroyData_Day.IsSelected = false; btnShowHistroyData_Month.IsSelected = false; btnShowHistroyData_Week.IsSelected = true; curQueryType = "month"; d2(); }; #endregion var historyDataView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(52), Width = Application.GetRealWidth(343 - 32), Height = Application.GetRealHeight(270), }; diagramView.AddChidren(historyDataView); var myEchartsView = new MyEchartsViewOn(); historyDataView.AddChidren(myEchartsView); } void d2() { int index = 0; var echartRootJson = new EchartsOption_Energy(); var seriesList = new List<EchartSeriesItem>(); foreach (var function in queryList) { var seriesItem = d3(function, index, echartRootJson.xAxis.data); seriesList.Add(seriesItem); } } /// <summary> /// 查询列表 /// </summary> /// <summary> /// 读取传感器历史数据 /// </summary> EchartSeriesItem d3(Function function, int index, List<string> xAxisData) { EchartSeriesItem sItem = null; List<string> data = new List<string>(); var loadPage = new Loading() { LodingBackgroundColor = 0x88888888, }; diagramView.AddChidren(loadPage); try { Application.RunOnMainThread(() => { loadPage.Start(Language.StringByID(StringId.PleaseWait)); }); var sensorType = function.spk.Split(".")[0]; var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, function.deviceId, sensorType); if (revertObj != null) { if (revertObj.Code == StateCode.SUCCESS) { var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<EnvironmentalSensorHistor>>(revertObj.Data.ToString()); sItem = new EchartSeriesItem { data = new List<int>(), lineStyle = new EchartLineStyle() { color = colorList2[index], #if __IOS__ width = 5, #elif __ANDROID__ width = 2, #endif }, }; try { foreach (var d in revertData) { if (xAxisData.Count == 0) { data.Add(d.fieldName); } sItem.data.Add(Convert.ToInt32(d.fieldValue)); } xAxisData.AddRange(data); } catch (Exception ex) { MainPage.Log($"revertData:{ex.Message}"); } } else { Application.RunOnMainThread(() => { IMessageCommon.Current.ShowErrorInfoAlter("", true, 2, Language.StringByID(StringId.GetSensorHistoryFailed), false); }); } } } catch (Exception ex) { MainPage.Log($"sensor history error : {ex.Message}"); } finally { Application.RunOnMainThread(() => { loadPage.Hide(); }); } return sItem; //var echartRootJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(echartRootJson); //myEchartsView.ShowWithOptionJsonString(echartRootJsonString); } /// <summary> /// /// </summary> public void EnergyRow(Function energy, FrameLayout view, int index) { var btnLine = new Button() { Y = Application.GetRealWidth(116 * index), Height = Application.GetRealWidth(16), }; view.AddChidren(btnLine); var row = new FrameLayout() { Y = btnLine.Bottom, Gravity = Gravity.CenterHorizontal, Width = Application.GetRealWidth(343), Height = Application.GetRealWidth(100), Radius = (uint)Application.GetRealWidth(12), BackgroundColor = CSS_Color.MainBackgroundColor, }; view.AddChidren(row); var btnColorTip = new Button() { X = Application.GetRealWidth(8), Y = Application.GetRealWidth(16), Width = Application.GetRealWidth(12), Height = Application.GetRealWidth(12), BackgroundColor = colorList[index], }; row.AddChidren(btnColorTip); var btnName = new Button() { X = Application.GetRealWidth(8 + 10 + 32), Y = Application.GetRealHeight(10), Width = Application.GetRealWidth(200), Height = Application.GetRealHeight(24), Text = energy.name, TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.TextFontSize, }; row.AddChidren(btnName); var btnFromFloor = new Button() { X = Application.GetRealWidth(8 + 10 + 32), Y = Application.GetRealHeight(10 + 24), Width = Application.GetRealWidth(200), Height = Application.GetRealHeight(18), Text = energy.GetRoomListName(), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.PromptFontSize_FirstLevel, }; row.AddChidren(btnFromFloor); var btnValue = new Button() { X = Application.GetRealWidth(28), Y = Application.GetRealWidth(57), Width = Application.GetRealWidth(226), Height = Application.GetRealWidth(43), TextAlignment = TextAlignment.CenterLeft, TextSize = CSS_FontSize.HeadlineFontSize, TextColor = CSS_Color.FirstLevelTitleColor, Text = "---" }; row.AddChidren(btnValue); var btnSetting = new Button() { X = Application.GetRealWidth(291), Y = Application.GetRealWidth(6), Width = Application.GetMinRealAverage(32), Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "Public/FuncInfoSetIcon.png", }; row.AddChidren(btnSetting); Button btnSeltSensorValue = new Button() { X = Application.GetRealWidth(16), Y = Application.GetRealWidth(47), Width = Application.GetRealWidth(200), Height = Application.GetRealWidth(43), TextAlignment = TextAlignment.CenterLeft, TextColor = CSS_Color.FirstLevelTitleColor, IsBold = true, TextSize = CSS_FontSize.HeadlineFontSize, }; row.AddChidren(btnSeltSensorValue); Button btnShowData; btnShowData = new Button() { X = Application.GetRealWidth(291), Y = Application.GetRealWidth(62), Width = Application.GetMinRealAverage(32), Height = Application.GetMinRealAverage(32), UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", IsSelected = true, }; row.AddChidren(btnShowData); btnSetting.MouseUpEventHandler = (sender, e) => { Action backAction = () => { btnName.Text = energy.name; }; var infoView = new FunctionBaseInfoSetPage(energy, backAction); MainPage.BasePageView.AddChidren(infoView); infoView.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } } } } HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EchartsOption.cs
@@ -1,7 +1,7 @@ using System; using System.Collections.Generic; namespace HDL_ON.Entity namespace HDL_ON.UI.UI2.EnvironmentalScience { #region 折线图 @@ -301,7 +301,7 @@ /// <summary> /// /// </summary> public List<string> data; public List<string> data = new List<string>(); /// <summary> /// 坐标轴偏移 /// </summary> HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs
@@ -4,6 +4,7 @@ using HDL_ON.UI.CSS; using System.Collections.Generic; using HDL_ON.DAL.Server; using HDL_ON.UI.UI2.EnvironmentalScience; namespace HDL_ON.UI { @@ -944,10 +945,7 @@ } void LoadEvent_SwitchOtherRoomSensorData() { } } public class EnvironmentalSensorHistor