Merge branch 'temp-wxr' into WJC
56个文件已添加
47个文件已修改
1 文件已重命名
| | |
| | | 435=Remote control |
| | | 436=Added Devices |
| | | 437=Device List |
| | | 438=humidity:{0}% air:{1} wind:{2} |
| | | |
| | | 1000=Indoor Humidity |
| | | 1001=V-chip |
| | |
| | | 435=遥控器 |
| | | 436=已添加功能 |
| | | 437=设备列表 |
| | | 438=湿度:{0}% 空气:{1} 风速:{2}级 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\4.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\left.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\right.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Electrical\TV\TVAV.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\TvocIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\TempIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\Pm25Icon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\29.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HumidityIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\13.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\TvocBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\20.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\Co2Icon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\LowerLimit.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\18.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\InfoIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\4.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\Co2Bg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\HumidityBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\5.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\UpperLimit.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\TempBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\6.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\3.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\45.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\1.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\Pm25Bg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\EnvirSensor\0.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PirIcon\add.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103101" android:versionName="1.1.202103101" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202103191" android:versionName="1.1.202103191" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="26" /> |
| | | <!-- 定位权限--> |
| | | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> |
| | |
| | | <Folder Include="Resources\Phone\FunctionIcon\Electrical\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\Socket\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\EnvironmentalScience\" /> |
| | | <Folder Include="Resources\Phone\Public\AirIcon\" /> |
| | | <Folder Include="Resources\Phone\PersonalCenter\ResetPassword\" /> |
| | | <Folder Include="Resources\Phone\Intelligence\Gallery\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\DeviceIcon\" /> |
| | |
| | | <Folder Include="Resources\Phone\FunctionIcon\Electrical\WaterValve\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\ArmSensor\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\Electrical\ClothesHanger\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\EnvirSensor\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <InterfaceDefinition Include="LaunchScreen.storyboard" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvironmentalScience\DiagramIconOn.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\MsgIcon\LoadingIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\NoCollectionBg.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\0.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\1.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\13.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\18.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\2.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\20.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\29.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\3.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\4.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\45.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\5.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\6.png" /> |
| | | <BundleResource Include="Resources\Phone\MusicIcon\bluetooth.png" /> |
| | | <BundleResource Include="Resources\Phone\MusicIcon\addMusic1.png" /> |
| | | <BundleResource Include="Resources\Phone\MusicIcon\prve1Selected.png" /> |
| | |
| | | <BundleResource Include="Resources\Phone\PirIcon\succeed.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\hangup.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\danyuanji.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\.DS_Store" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\weiqiangji.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\keshiduijiang.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\phone.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\menjin.png" /> |
| | | <BundleResource Include="Resources\Phone\VideoIcon\answer.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Electrical\TV\TVAV.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\Co2Bg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HumidityBg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\Pm25Bg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TempBg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TvocBg.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\29.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\13.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\20.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\18.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\4.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\5.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\6.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\2.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\3.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\45.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\1.png" /> |
| | | <BundleResource Include="Resources\Phone\Public\AirIcon\0.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\0.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\1.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\2.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\3.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\4.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\5.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\6.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\13.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\18.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\20.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\29.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\45.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\LowerLimit.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\UpperLimit.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\Co2Icon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\HumidityIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\InfoIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\Pm25Icon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TempIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\EnvirSensor\TvocIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PirIcon\add.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <key>LSRequiresIPhoneOS</key> |
| | | <true/> |
| | | <key>MinimumOSVersion</key> |
| | | <string>13.0</string> |
| | | <string>9.0</string> |
| | | <key>UIDeviceFamily</key> |
| | | <array> |
| | | <integer>1</integer> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.1.202103101</string> |
| | | <string>1.1.202103181</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>202103101</string> |
| | | <string>202103181</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | using System; |
| | | using Shared.IOS.JLCountryCode; |
| | | using Foundation; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace JLCountrycode |
| | | { |
| | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(mJLCountryCodeController, true); |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 选择 |
| | | /// </summary> |
| | | /// <param name="titleStr"></param> |
| | | /// <param name="dic"></param> |
| | | /// <param name="action"></param> |
| | | public void ShowSortSelection(string titleStr, Dictionary<string, List<string>> dic, Action<string> action) |
| | | { |
| | | try |
| | | { |
| | | JLSortSelectionViewController vc = new JLSortSelectionViewController(); |
| | | vc.TitleStr = titleStr; |
| | | vc.SortedNameDict = ConvertToNativeDictionary(dic); |
| | | vc.SortSelectionBlock += (countryName) => |
| | | { |
| | | action?.Invoke(countryName); |
| | | }; |
| | | |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Console.WriteLine(ex.ToString()); |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// Dictionary 转 iOS原生 NSMutableDictionary |
| | | /// </summary> |
| | | /// <param name="dict"></param> |
| | | /// <returns></returns> |
| | | NSMutableDictionary ConvertToNativeDictionary(Dictionary<string, List<string>> dict) |
| | | { |
| | | NSMutableDictionary newDictionary = new NSMutableDictionary(); |
| | | try |
| | | { |
| | | //var dictDataList = new NSMutableArray(); |
| | | foreach (string key in dict.Keys) |
| | | { |
| | | var value = dict[key]; |
| | | newDictionary.Add(new NSString(key), NSArray.FromObjects(value.ToArray())); |
| | | } |
| | | } |
| | | catch (Exception Ex) |
| | | { |
| | | Console.WriteLine(Ex.ToString()); |
| | | } |
| | | return newDictionary; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | 435=Remote control |
| | | 436=Added Devices |
| | | 437=Device List |
| | | 438=humidity:{0}% air:{1} wind:{2} |
| | | |
| | | 1000=Indoor Humidity |
| | | 1001=V-chip |
| | |
| | | 435=遥控器 |
| | | 436=已添加功能 |
| | | 437=设备列表 |
| | | 438=湿度:{0}% 空气:{1} 风速:{2}级 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | public const int EnvirSensorValueTip = 438; |
| | | public const int DeviceList = 437; |
| | | public const int AddedDevice = 436; |
| | | public const int RemoteControl = 435; |
| | |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | var sensor = FunctionList.List.GetEnvirSensorsList().Find((obj) => obj.sid == updateTemp.sid); |
| | | if (sensor != null) |
| | | { |
| | | localObj = sensor; |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | var localAttr = sensor.attributes.Find((obj) => obj.key == attr.key); |
| | | if (localAttr != null) |
| | | { |
| | | localAttr.curValue = attr.value; |
| | | } |
| | | } |
| | | EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | var es = FunctionList.List.GetElectricSocketList().Find((obj) => obj.sid == updateTemp.sid); |
| | | if (es != null) |
| | | { |
| | | localObj = es; |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | var localAttr = es.attributes.Find((obj) => obj.key == attr.key); |
| | | if (localAttr != null) |
| | | { |
| | | localAttr.curValue = attr.value; |
| | | } |
| | | } |
| | | SocketPage.UpdataState(es); |
| | | } |
| | | SocketPage.UpdataState(localFunction); |
| | | break; |
| | | case SPK.ElectricTV: |
| | | break; |
| | |
| | | sensor.SetAttrState(FunctionAttributeKey.Value, Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString()); |
| | | break; |
| | | } |
| | | EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor); |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | break; |
| | | } |
| | | EnvironmentalSciencePage.LoadEvent_UpdataStatus(sensor); |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | | } |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.RegionID); |
| | | d.Add("productPlatform", productPlatform); |
| | | d.Add("productBrand", productBrand); |
| | | d.Add("networkConfig", true); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.Api_Post_GetDevcieList, requestJson); |
| | |
| | | { |
| | | |
| | | #region **********全局常量********** |
| | | ///// <summary> |
| | | ///// API_HTTPS |
| | | ///// </summary> |
| | | //public const string API_HTTPS = "https://"; |
| | | /// <summary> |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | #endregion |
| | | |
| | | #region **********网络请求封装********** |
| | | /// <summary> |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com"; |
| | | |
| | | /// <summary> |
| | | /// Get 请求服务器方法 |
| | |
| | | /// <param name="statuCode"></param> |
| | | /// <param name="isTipStyle"></param> |
| | | /// <param name="tipStr">补充的错误提示</param> |
| | | public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "") |
| | | public void ShowErrorInfoAlter(string statuCode, bool isTipStyle = true, int closeTime = 2, string tipStr = "",bool showAllMsg = true) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (mes == null) return; |
| | | if (!string.IsNullOrEmpty(tipStr)) |
| | | { |
| | | mes = tipStr + "\n" + mes; |
| | | if (showAllMsg) |
| | | { |
| | | mes = tipStr + "\n" + mes; |
| | | }else |
| | | { |
| | | mes = tipStr; |
| | | } |
| | | } |
| | | if (isTipStyle) |
| | | { |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | |
| | | |
| | | /// <summary> |
| | | /// 获取模式的icon路径 |
| | | /// <param name="lightingIcon">获取的图标类型,默认是点亮</param> |
| | | /// </summary> |
| | | public string GetModeImage(Function function) |
| | | public string GetModeIconPath(string modeValue, bool lighting = true) |
| | | { |
| | | var imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | var key = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | switch (key) |
| | | //var key = function.GetAttrState(FunctionAttributeKey.Mode); |
| | | if (lighting) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIcon.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIcon.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIcon.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png"; |
| | | break; |
| | | default: |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | switch (modeValue) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIcon.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIcon.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIcon.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIcon.png"; |
| | | break; |
| | | default: |
| | | imagePath = "FunctionIcon/AC/HeatingIcon.png"; |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | switch (modeValue) |
| | | { |
| | | case "day": |
| | | imagePath = "FunctionIcon/AC/HeatingIconGray.png"; |
| | | break; |
| | | case "night": |
| | | imagePath = "FunctionIcon/FloorHeating/NightIconGray.png"; |
| | | break; |
| | | case "away": |
| | | imagePath = "FunctionIcon/FloorHeating/AwayIconGray.png"; |
| | | break; |
| | | case "timer": |
| | | imagePath = "FunctionIcon/AC/AutoIconGray.png"; |
| | | break; |
| | | case "normal": |
| | | imagePath = "FunctionIcon/FloorHeating/OrdinaryIconGray.png"; |
| | | break; |
| | | } |
| | | } |
| | | return imagePath; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 获取模式属性文本 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string GetModeAttrText(string value) |
| | | { |
| | | string text = ""; |
| | | switch (value) |
| | | { |
| | | case "day": |
| | | text = Language.StringByID(StringId.Day); |
| | | break; |
| | | case "night": |
| | | text = Language.StringByID(StringId.Night); |
| | | break; |
| | | case "away": |
| | | text = Language.StringByID(StringId.Away); |
| | | break; |
| | | case "timer": |
| | | text = Language.StringByID(StringId.Auto); |
| | | break; |
| | | case "normal": |
| | | text = Language.StringByID(StringId.Normal); |
| | | break; |
| | | } |
| | | return text; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 版本数据列表 |
| | | /// </summary> |
| | | public List<VersionInfo> versions = new List<VersionInfo>(); |
| | | |
| | | /// <summary> |
| | | /// 上一次打开的亮度 |
| | | /// 灯光私有属性 |
| | |
| | | |
| | | public static class SPK |
| | | { |
| | | |
| | | #region 灯光 |
| | | /// <summary> |
| | | /// (开关灯) |
| | | /// </summary> |
| | |
| | | /// (CCT灯) |
| | | /// </summary> |
| | | public const string LightCCT = "light.cct"; |
| | | |
| | | /// <summary> |
| | | /// 灯光spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> LightSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(LightCCT); |
| | | spkList.Add(LightDimming); |
| | | spkList.Add(LightRGB); |
| | | spkList.Add(LightRGBW); |
| | | spkList.Add(LightSwitch); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 窗帘 |
| | | /// <summary> |
| | | /// (开关窗帘) |
| | | /// </summary> |
| | |
| | | /// (卷帘) |
| | | /// </summary> |
| | | public const string CurtainRoller = "curtain.roller"; |
| | | |
| | | /// <summary> |
| | | /// 窗帘spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> CurtainSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(CurtainRoller); |
| | | spkList.Add(CurtainSwitch); |
| | | spkList.Add(CurtainShades); |
| | | spkList.Add(CurtainTrietex); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 空调 |
| | | /// <summary> |
| | | /// (空调) |
| | | /// </summary> |
| | |
| | | /// (红外空调) |
| | | /// </summary> |
| | | public const string AcIr= "ir.ac"; |
| | | |
| | | /// <summary> |
| | | /// 空调spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> AcSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AcStandard); |
| | | spkList.Add(AcIr); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 地热 |
| | | /// <summary> |
| | | /// (地热) |
| | | /// </summary> |
| | | public const string FloorHeatStandard = "floorHeat.standard"; |
| | | |
| | | /// <summary> |
| | | /// 地热spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> FhSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(FloorHeatStandard); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 新风 |
| | | /// <summary> |
| | | /// (新风) |
| | | /// </summary> |
| | | public const string AirFreshStandard = "airFresh.standard"; |
| | | |
| | | /// <summary> |
| | | /// 新风spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> AirFreshSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(AirFreshStandard); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 音乐 |
| | | /// <summary> |
| | | /// (音乐) |
| | | /// </summary> |
| | | public const string MusicStandard = "music.standard"; |
| | | |
| | | /// <summary> |
| | | /// 音乐spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> MusicSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(MusicStandard); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 传感器 |
| | | #region 安防传感器 |
| | | /// <summary> |
| | | /// (亮度传感器) |
| | | /// </summary> |
| | | public const string SensorLight = "sensor.light"; |
| | | /// <summary> |
| | | /// (红外移动传感器) |
| | | /// </summary> |
| | | public const string SensorPir = "sensor.pir"; |
| | | /// <summary> |
| | | /// (门窗传感器) |
| | | /// </summary> |
| | | public const string SensorDoorWindow = "sensor.doorwindow"; |
| | | /// <summary> |
| | | /// 烟雾传感器 |
| | | /// </summary> |
| | | public const string SensorSmoke = "sensor.smoke"; |
| | | /// <summary> |
| | | /// 水浸传感器 |
| | | /// </summary> |
| | | public const string SensorWater = "sensor.water"; |
| | | /// <summary> |
| | | /// 燃气传感器 |
| | | /// </summary> |
| | | public const string SensorGas = "sensor.gas"; |
| | | /// <summary> |
| | | /// 红外珊栏传感器 |
| | | /// </summary> |
| | | public const string SensorShanLan = "sensor.shanlan"; |
| | | /// <summary> |
| | | /// 红外对射传感器 |
| | | /// </summary> |
| | | public const string SensorDuiShe = "sensor.duishe"; |
| | | /// <summary> |
| | | /// 超声波传感器 |
| | | /// </summary> |
| | | public const string SensoruUtrasonic = "sensor.ultrasonic"; |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string SensorDryContact = "sensor.dryContact"; |
| | | |
| | | /// <summary> |
| | | /// 安防传感器spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> ArmSensorSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorLight); |
| | | spkList.Add(SensorPir); |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | | spkList.Add(SensorWater); |
| | | spkList.Add(SensorGas); |
| | | spkList.Add(SensorShanLan); |
| | | spkList.Add(SensorDuiShe); |
| | | spkList.Add(SensoruUtrasonic); |
| | | spkList.Add(SensorDryContact); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | #region 环境传感器 |
| | | /// <summary> |
| | | /// (温度传感器) |
| | | /// </summary> |
| | |
| | | public const string SensorHumidity = "sensor.humidity"; |
| | | |
| | | /// <summary> |
| | | /// (红外移动传感器) |
| | | /// 环境传感器spk列表 |
| | | /// </summary> |
| | | public const string SensorPir = "sensor.pir"; |
| | | /// <summary> |
| | | /// (门窗传感器) |
| | | /// </summary> |
| | | public const string SensorDoorWindow = "sensor.doorwindow"; |
| | | /// <summary> |
| | | /// 烟雾传感器 |
| | | /// </summary> |
| | | public const string SensorSmoke = "sensor.smoke"; |
| | | /// <summary> |
| | | /// 水浸传感器 |
| | | /// </summary> |
| | | public const string SensorWater = "sensor.water"; |
| | | /// <summary> |
| | | /// 燃气传感器 |
| | | /// </summary> |
| | | public const string SensorGas= "sensor.gas"; |
| | | /// <summary> |
| | | /// 红外珊栏传感器 |
| | | /// </summary> |
| | | public const string SensorShanLan = "sensor.shanlan"; |
| | | /// <summary> |
| | | /// 红外对射传感器 |
| | | /// </summary> |
| | | public const string SensorDuiShe = "sensor.duishe"; |
| | | /// <summary> |
| | | /// 超声波传感器 |
| | | /// </summary> |
| | | public const string SensoruUtrasonic = "sensor.ultrasonic"; |
| | | /// <returns></returns> |
| | | public static List<string> EnvironSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorTemperature); |
| | | spkList.Add(SensorPm25); |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// (干接点) |
| | | /// </summary> |
| | | public const string SensorDryContact = "sensor.dryContact"; |
| | | #region 家电 |
| | | /// <summary> |
| | | /// 家电、插座 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string ElectricFan = "electrical.fan"; |
| | | /// <summary> |
| | | /// 凉霸 |
| | | /// </summary> |
| | | public const string ClothesHanger = "electrical.racks"; |
| | | /// <summary> |
| | | /// 红外遥控器 |
| | | /// </summary> |
| | | public const string IrLearn = "ir.learn"; |
| | | #region 涂鸦 |
| | | /// <summary> |
| | | /// 家电、涂鸦空气净化器 |
| | | /// </summary> |
| | | public const string ElectricTuyaAirCleaner = "electrical.Q1RsefNf91tIXyyQ"; |
| | |
| | | /// 家电、涂鸦水阀 |
| | | /// </summary> |
| | | public const string ElectricTuyaWaterValve = "electrical.koiGhMKwLf2ZP81g"; |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | | /// 凉霸 |
| | | /// 家电spk列表 |
| | | /// </summary> |
| | | public const string ClothesHanger = "electrical.racks"; |
| | | /// <returns></returns> |
| | | public static List<string> ElectricalSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(ElectricSocket); |
| | | spkList.Add(ElectricTV); |
| | | spkList.Add(TvIr); |
| | | spkList.Add(ElectricFan); |
| | | spkList.Add(ClothesHanger); |
| | | spkList.Add(IrLearn); |
| | | spkList.Add(ElectricTuyaAirCleaner); |
| | | spkList.Add(ElectricTuyaFan); |
| | | spkList.Add(ElectricTuyaWeepRobot); |
| | | spkList.Add(ElectricTuyaWaterValve); |
| | | return spkList; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 设备类 |
| | | /// <summary> |
| | | /// 红外宝 |
| | | /// </summary> |
| | | public const string IrModule = "ir.module"; |
| | | |
| | | /// <summary> |
| | | /// 红外遥控器 |
| | | /// 设备类spk列表 |
| | | /// </summary> |
| | | public const string IrLearn = "ir.learn"; |
| | | /// <returns></returns> |
| | | public static List<string> DeviceSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(IrModule); |
| | | return spkList; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 第三方品牌列表 |
| | |
| | | } |
| | | |
| | | |
| | | public class VersionInfo |
| | | { |
| | | public string module = ""; |
| | | public string version = ""; |
| | | } |
| | | } |
| | |
| | | /// <returns></returns> |
| | | public List<Function> GetAcList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.AcStandard || obj.spk == SPK.AcIr); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<Function> GetList() |
| | | { |
| | | List<Function> list = new List<Function>(); |
| | | |
| | | |
| | | return list; |
| | | var spkList = SPK.AcSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public List<Function> GetLightList() |
| | | { |
| | | return Functions.FindAll((obj) => |
| | | obj.spk == SPK.LightSwitch |
| | | || obj.spk == SPK.LightDimming |
| | | || obj.spk == SPK.LightRGB |
| | | || obj.spk == SPK.LightRGBW |
| | | || obj.spk == SPK.LightCCT); |
| | | var spkList = SPK.LightSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | /// <summary> |
| | | /// 窗帘列表 |
| | | /// </summary> |
| | | public List<Function> GetCurtainList() |
| | | { |
| | | return Functions.FindAll((obj) => |
| | | obj.spk == SPK.CurtainRoller |
| | | || obj.spk == SPK.CurtainShades |
| | | || obj.spk == SPK.CurtainSwitch |
| | | || obj.spk == SPK.CurtainTrietex |
| | | ); |
| | | var spkList = SPK.CurtainSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public List<Function> GetFloorHeatingList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.FloorHeatStandard); |
| | | var spkList = SPK.FhSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | #region 家电列表 electricals |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public List<Function> GetElectricals() |
| | | { |
| | | |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricFan || obj.spk == SPK.ElectricTuyaFan |
| | | || obj.spk == SPK.ElectricSocket |
| | | || obj.spk == SPK.IrLearn
|
| | | || obj.spk == SPK.TvIr
|
| | | || obj.spk == SPK.ElectricTV
|
| | | || obj.spk == SPK.ElectricTuyaAirCleaner
|
| | | || obj.spk == SPK.ElectricTuyaWeepRobot |
| | | || obj.spk == SPK.ElectricTuyaWaterValve |
| | | || obj.spk == SPK.ClothesHanger); |
| | | var spkList = SPK.ElectricalSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | /// <summary> |
| | | /// 遥控器列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<Function> GetIrLearinList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.IrLearn); |
| | | } |
| | | /// <summary> |
| | | /// 风扇列表 |
| | | /// </summary> |
| | | public List<Function> GetFanList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricFan || obj.spk == SPK.ElectricTuyaFan); |
| | | } |
| | | /// <summary> |
| | | /// 电视列表 |
| | | /// </summary> |
| | | public List<Function> GetTVList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricTV || obj.spk == SPK.TvIr); |
| | | } |
| | | /// <summary> |
| | | /// 家电插座列表 |
| | | /// </summary> |
| | | public List<Function> GetElectricSocketList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricSocket); |
| | | }
|
| | | /// <summary> |
| | | /// 空气净化器列表 |
| | | /// </summary> |
| | | public List<Function> GetAirCleanerList() |
| | | {
|
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaAirCleaner);
|
| | | }
|
| | | /// <summary> |
| | | /// 扫地机器人列表 |
| | | /// </summary> |
| | | public List<Function> GetWeepRobotList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaWeepRobot);
|
| | | } |
| | | /// <summary> |
| | | /// 水阀列表 |
| | | /// </summary> |
| | | public List<Function> GetWaterValveList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ElectricTuyaWaterValve);
|
| | | } |
| | | /// <summary> |
| | | /// 凉霸列表 |
| | | /// </summary> |
| | | public List<Function> GetClothesHangerList () |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.ClothesHanger);
|
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 红外宝列表 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public List<Function> GetEnvirSensorsList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.SensorPm25 |
| | | || obj.spk == SPK.SensorCO2 |
| | | || obj.spk == SPK.SensorTVOC |
| | | || obj.spk == SPK.SensorTemperature |
| | | || obj.spk == SPK.SensorHumidity
|
| | | );
|
| | | var spkList = SPK.EnvironSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk));
|
| | | } |
| | | /// <summary> |
| | | /// 安防设备列表 |
| | | /// </summary> |
| | | public List<Function> GetArmSensorList() |
| | | { |
| | | return Functions.FindAll((obj) => obj.spk == SPK.SensorSmoke |
| | | || obj.spk == SPK.SensorWater |
| | | || obj.spk == SPK.SensorDoorWindow |
| | | || obj.spk == SPK.SensorPir |
| | | ); |
| | | var spkList = SPK.ArmSensorSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | |
| | | public List<Scene> scenes = new List<Scene>(); |
| | |
| | | public string windDir; |
| | | //"UpdateTime": "0001-01-01T00:00:00", |
| | | public string aqi; |
| | | public string air_Quality; |
| | | public string air_Quality = "--"; |
| | | public string pm10; |
| | | public string pm25 = "--"; |
| | | public string no2; |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\ReplicationView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Electrical\ClothesHangerSetTimePage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\ArmSensorHistroyPaging.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\AC\AcControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Logic\HdlCloudReceiveLogic.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Logic\HdlWifiLogic.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Stan\Controls\CompoundControls\ProgressRowBar.cs" />
|
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddFunction\DeviceListPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\MainView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\HeigthChangeView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AcControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\FhControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\TvControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\MainView.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\FrameLayout50.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\FrameLayout60.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\ShowDialog.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EnvironmentalPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\EchartsOption_Pie.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\SetPir.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | |
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Video\View\" />
|
| | | </ItemGroup>
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.1.0310"; |
| | | public static string VersionString = "1.1.0319"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | } |
| | | else |
| | | { |
| | | etAccount.Text = "15622703419";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //15971583093 gs |
| | | etAccount.Text = "15971583093";//凉霸"18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //15971583093 gs//tzy 274116637@qq.com |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | } |
| | | |
| | | LoadEvent_FunctionCollection(btnCollection, function); |
| | | if (function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || |
| | | if (//SPK.CurtainSpkList().Contains(function.spk)) |
| | | function.spk == SPK.CurtainRoller || function.spk == SPK.CurtainShades || |
| | | function.spk == SPK.CurtainSwitch || function.spk == SPK.CurtainTrietex ) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Curtain/CurtainIcon.png"; |
| | |
| | | LoadEvent_ControlCurtain(function, btnCurtainClose, btnCurtainOpen); |
| | | } |
| | | |
| | | else if (function.spk == SPK.ElectricTV) |
| | | else if (function.spk == SPK.ElectricTV || function.spk == SPK.TvIr) |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/Electrical/TVIcon.png"; |
| | | Button btnPower; |
| | | btnPower = new Button() |
| | | { |
| | | X = Application.GetRealWidth(131), |
| | | Y = Application.GetRealHeight(86), |
| | | Y = Application.GetRealHeight(70), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | |
| | | { |
| | | button.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | new TV().ControlTV(InfraredCode_TV.Power, tV); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", ""); |
| | | Control.Ins.SendWriteCommand(tV, d); |
| | | } |
| | | else |
| | | { |
| | | new TV().ControlTV(InfraredCode_TV.Power, tV); |
| | | } |
| | | }; |
| | | } |
| | | |
| | |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new EnvironmentalSciencePage(); |
| | | var skipView = new EnvironmentalPage();// EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | |
| | | Load3tyBrandDeviceList(); |
| | | |
| | | contentView.BeginHeaderRefreshingAction = () => |
| | | { |
| | | contentView.EndHeaderRefreshing(); |
| | | Load3tyBrandDeviceList(); |
| | | }; |
| | | } |
| | | |
| | | void Load3tyBrandDeviceList() |
| | |
| | | LoadRow(revData); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | //using System; |
| | | //using System.Collections.Generic; |
| | | //using HDL_ON.Entity; |
| | | //using HDL_ON.UI.CSS; |
| | | //using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddThirdPartyBrandListpage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | VerticalRefreshLayout contentView; |
| | | List<IntegratedBrand> brandList; |
| | | public AddThirdPartyBrandListpage(List<IntegratedBrand> list) |
| | | { |
| | | bodyView = this; |
| | | brandList = list; |
| | | } |
| | | //namespace HDL_ON.UI |
| | | //{ |
| | | // public class AddThirdPartyBrandListpage : FrameLayout |
| | | // { |
| | | // FrameLayout bodyView; |
| | | // VerticalRefreshLayout contentView; |
| | | // List<IntegratedBrand> brandList; |
| | | // public AddThirdPartyBrandListpage(List<IntegratedBrand> list) |
| | | // { |
| | | // bodyView = this; |
| | | // brandList = list; |
| | | // } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView(); |
| | | // public void LoadPage() |
| | | // { |
| | | // new TopViewDiv(bodyView, Language.StringByID(StringId.FunctionBrand)).LoadTopView(); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | // bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new VerticalRefreshLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | VerticalScrollBarEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | // contentView = new VerticalRefreshLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(64), |
| | | // Height = Application.GetRealHeight(667 - 64), |
| | | // VerticalScrollBarEnabled = false, |
| | | // }; |
| | | // bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | contentView.BeginHeaderRefreshingAction = () => |
| | | { |
| | | contentView.EndHeaderRefreshing(); |
| | | Load3tyBrandList(); |
| | | }; |
| | | // contentView.BeginHeaderRefreshingAction = () => |
| | | // { |
| | | // contentView.EndHeaderRefreshing(); |
| | | // Load3tyBrandList(); |
| | | // }; |
| | | |
| | | Load3tyBrandList(); |
| | | } |
| | | // Load3tyBrandList(); |
| | | |
| | | void LoadRow(List<IntegratedBrand> brandList) |
| | | { |
| | | contentView.RemoveAll(); |
| | | bool isFrist = true; |
| | | foreach(var brand in brandList) |
| | | { |
| | | FrameLayout row = new FrameLayout() { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(row); |
| | | // contentView.BeginHeaderRefreshingAction = () => |
| | | // { |
| | | // contentView.EndHeaderRefreshing(); |
| | | // Load3tyBrandList(); |
| | | // }; |
| | | // } |
| | | |
| | | if(isFrist) |
| | | { |
| | | isFrist = false; |
| | | } |
| | | else |
| | | { |
| | | Button btnLine = new Button() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | | Width = Application.GetRealWidth(303), |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }; |
| | | row.AddChidren(btnLine); |
| | | } |
| | | // void LoadRow(List<IntegratedBrand> brandList) |
| | | // { |
| | | // contentView.RemoveAll(); |
| | | // bool isFrist = true; |
| | | // foreach(var brand in brandList) |
| | | // { |
| | | // FrameLayout row = new FrameLayout() { |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // }; |
| | | // contentView.AddChidren(row); |
| | | |
| | | ImageView btnIcon = new ImageView() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = CSS_Color.PromptingColor1 |
| | | //ImagePath = "tuya_logo.png" |
| | | }; |
| | | row.AddChidren(btnIcon); |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | row.AddChidren(btnRight); |
| | | // if(isFrist) |
| | | // { |
| | | // isFrist = false; |
| | | // } |
| | | // else |
| | | // { |
| | | // Button btnLine = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(56), |
| | | // Width = Application.GetRealWidth(303), |
| | | // Height = 1, |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | // }; |
| | | // row.AddChidren(btnLine); |
| | | // } |
| | | |
| | | Button btnName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | | Width = Application.GetRealWidth(303), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = brand.brandName, |
| | | }; |
| | | row.AddChidren(btnName); |
| | | //下载第三方品牌icon |
| | | ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); |
| | | // ImageView btnIcon = new ImageView() |
| | | // { |
| | | // X = Application.GetRealWidth(12), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetRealWidth(32), |
| | | // Height = Application.GetRealWidth(32), |
| | | // Radius = (uint)Application.GetRealWidth(4), |
| | | // BackgroundColor = CSS_Color.PromptingColor1 |
| | | // //ImagePath = "tuya_logo.png" |
| | | // }; |
| | | // row.AddChidren(btnIcon); |
| | | // Button btnRight = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(339), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | // }; |
| | | // row.AddChidren(btnRight); |
| | | |
| | | btnName.MouseUpEventHandler = (sender, e) => { |
| | | var page = new AddDevciePage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | // Button btnName = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(56), |
| | | // Width = Application.GetRealWidth(303), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Text = brand.brandName, |
| | | // }; |
| | | // row.AddChidren(btnName); |
| | | // //下载第三方品牌icon |
| | | // ImageUtlis.Current.Load3tyBrandIconImages(brand.brandName, brand.brandIcon, btnIcon); |
| | | |
| | | } |
| | | // btnName.MouseUpEventHandler = (sender, e) => { |
| | | // var page = new AddDevciePage(brand); |
| | | // MainPage.BasePageView.AddChidren(page); |
| | | // page.LoadPage(); |
| | | // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | // }; |
| | | // } |
| | | |
| | | void Load3tyBrandList() |
| | | { |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var pack = pm.Get3tyBrandList(); |
| | | if(pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadRow(revData); |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("1--::"+ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | } |
| | | }) { IsBackground = true }.Start(); |
| | | } |
| | | /// <summary> |
| | | /// 跳转添加设备界面 |
| | | /// </summary> |
| | | /// <param name="bandType">品牌类型</param> |
| | | void SkipPage_AddDevice() |
| | | { |
| | | // } |
| | | |
| | | // void Load3tyBrandList() |
| | | // { |
| | | // var waitPage = new Loading(); |
| | | // waitPage.Start(); |
| | | // new System.Threading.Thread(() => { |
| | | // try |
| | | // { |
| | | // var pm = new DAL.Server.HttpServerRequest(); |
| | | // var pack = pm.Get3tyBrandList(); |
| | | // if(pack.Code == DAL.Server.StateCode.SUCCESS) |
| | | // { |
| | | // var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrand>>(pack.Data.ToString()); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // LoadRow(revData); |
| | | // }); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log("1--::"+ex.Message); |
| | | // } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | // } |
| | | // }) { IsBackground = true }.Start(); |
| | | // } |
| | | // /// <summary> |
| | | // /// 跳转添加设备界面 |
| | | // /// </summary> |
| | | // /// <param name="bandType">品牌类型</param> |
| | | // void SkipPage_AddDevice() |
| | | // { |
| | | |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | // } |
| | | //} |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | VerticalScrolViewLayout contentView; |
| | | VerticalRefreshLayout contentView; |
| | | |
| | | List<IntegratedBrand> brandList; |
| | | |
| | |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | contentView = new VerticalRefreshLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603), |
| | |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | GetBindList(); |
| | | |
| | | contentView.BeginHeaderRefreshingAction = () => |
| | | { |
| | | contentView.EndHeaderRefreshing(); |
| | | GetBindList(); |
| | | }; |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | Action<string,string> action = (s,a) => { |
| | | Action<string, string> action = (s, a) => |
| | | { |
| | | var page = new AddDevciePage(brand); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Devices)).LoadTopView_AddIcon("3ty",action); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Devices)).LoadTopView_AddIcon("3ty", action); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new VerticalRefreshLayout() |
| | |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | |
| | | |
| | | Load3tyBrandDeviceList(); |
| | | |
| | | contentView.BeginHeaderRefreshingAction = () => |
| | | { |
| | | contentView.EndHeaderRefreshing(); |
| | | Load3tyBrandDeviceList(); |
| | | }; |
| | | } |
| | | |
| | | void Load3tyBrandDeviceList() |
| | |
| | | { |
| | | LoadRow(revData.list); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | bool isFrist = true; |
| | | foreach (var device in deviceList) |
| | | { |
| | | //if (!FunctionList.List.DeviceSpk.Contains(device.spk)) |
| | | //{ |
| | | // continue; |
| | | //} |
| | | FrameLayout row = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | Text = string.IsNullOrEmpty(UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName |
| | | Text = UserInfo.Current.userName// string.IsNullOrEmpty(UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName |
| | | }; |
| | | personalInfoView.AddChidren(btnUserName); |
| | | if (!string.IsNullOrEmpty( UserInfo.Current.userName)) |
| | | if (!string.IsNullOrEmpty( UserInfo.Current.userName) && UserInfo.Current.userName == UserInfo.Current.AccountString) |
| | | { |
| | | btnUserName.Text = UserInfo.Current.userName; ; |
| | | btnUserName.Text = Language.StringByID(StringId.UsersWhoNameIsEmpty); |
| | | } |
| | | btnEmail = new Button() |
| | | { |
New file |
| | |
| | | using System; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class FhControlPage : DeviceFunctionCardCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | /// <summary> |
| | | /// 空调温度控制控件 |
| | | /// </summary> |
| | | DiyArcSeekBar arcBar; |
| | | /// <summary> |
| | | /// 减号按钮 |
| | | /// </summary> |
| | | Button btnMinus; |
| | | /// <summary> |
| | | /// 加号按钮 |
| | | /// </summary> |
| | | Button btnPlus; |
| | | /// <summary> |
| | | /// 温度按钮 |
| | | /// </summary> |
| | | Button btnTemp; |
| | | Button btnTempUint; |
| | | /// <summary> |
| | | /// 室内温度按钮 |
| | | /// </summary> |
| | | Button btnIndoorTemp; |
| | | /// <summary> |
| | | /// 模式按钮 |
| | | /// </summary> |
| | | Button btnMode; |
| | | /// <summary> |
| | | /// 开关按钮 |
| | | /// </summary> |
| | | Button btnSwitch; |
| | | |
| | | FloorHeating fhTemp = new FloorHeating(); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | |
| | | /// <summary> |
| | | /// 初始化白色区域的内容 |
| | | /// </summary> |
| | | public override void InitFrameWhiteContent() |
| | | { |
| | | |
| | | base.ShowColltionButton = false; |
| | | base.SetTitleText(Language.StringByID(StringId.Electric)); |
| | | |
| | | //初始化第一个索引页的内容 |
| | | this.InitFrameWhiteContent1(); |
| | | |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(device); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化第一个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | |
| | | arcBar = new DiyArcSeekBar() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | OpenAngle = 160, |
| | | //ThumbImagePath = device.trait_on_off.curValue.ToString() == "on" ? "FunctionIcon/FloorHeating/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png", |
| | | ThumbImageHeight = Application.GetRealWidth(50), |
| | | ProgressBarColor = CSS_Color.AuxiliaryColor1, // 0xFFFC9C04, |
| | | OfflineProgressBarColor = CSS_Color.PromptingColor2, |
| | | MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min, |
| | | MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max, |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)), |
| | | #if __IOS__ |
| | | Y = Application.GetRealHeight(120 + 25), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | | Height = Application.GetRealWidth(260 - 40), |
| | | SeekBarPadding = Application.GetRealWidth(8), |
| | | #else |
| | | Y = Application.GetRealHeight(120 + 40), |
| | | Width = Application.GetRealWidth(260 - 40), |
| | | Height = Application.GetRealWidth(260 - 40), |
| | | SeekBarPadding = Application.GetRealWidth(7), |
| | | #endif |
| | | |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(arcBar); |
| | | |
| | | |
| | | arcBar.ThumbImagePath = device.GetAttrState(FunctionAttributeKey.OnOff) == "on" ? "FunctionIcon/AC/DiyThumbIconOn.png" : "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | arcBar.IsOffline = device.GetAttrState(FunctionAttributeKey.OnOff) == "off"; |
| | | arcBar.MinValue = device.GetAttribute(FunctionAttributeKey.SetTemp).min; |
| | | arcBar.MaxValue = device.GetAttribute(FunctionAttributeKey.SetTemp).max; |
| | | arcBar.Progress = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | |
| | | |
| | | |
| | | btnTemp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(200), |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(60), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = 56, |
| | | IsBold = true, |
| | | Text = device.GetAttrState(FunctionAttributeKey.SetTemp), |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTemp); |
| | | |
| | | btnTempUint = new Button() |
| | | { |
| | | X = btnTemp.Right, |
| | | Y = btnTemp.Y, |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(25), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = fhTemp.GetTempUnitString(device) |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnTempUint); |
| | | |
| | | btnIndoorTemp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnTemp.Bottom + Application.GetRealWidth(10), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealHeight(20), |
| | | Text = Language.StringByID(StringId.IndoorTemp) + "20°C", |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnIndoorTemp); |
| | | |
| | | btnMinus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(21), |
| | | Y = Application.GetRealHeight(263), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/MinusSignIcon.png", |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnMinus); |
| | | |
| | | btnPlus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(275), |
| | | Y = Application.GetRealHeight(263), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PlusSignIcon.png", |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnPlus); |
| | | |
| | | if (device.GetAttribute(FunctionAttributeKey.Mode) != null) |
| | | { |
| | | btnMode = new Button() |
| | | { |
| | | X = Application.GetRealWidth(235), |
| | | Y = Application.GetRealHeight(337), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)) |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnMode); |
| | | |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadDiv_ChangeModeView(); |
| | | }; |
| | | } |
| | | |
| | | btnSwitch = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "Public/PowerClose.png", |
| | | SelectedImagePath = "Public/PowerOpen.png", |
| | | IsSelected = device.trait_on_off.curValue.ToString() == "on" |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnSwitch); |
| | | |
| | | LoadEvent_TempChange(); |
| | | LoadEvent_AcStatesChange(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载修改模式区域 |
| | | /// </summary> |
| | | void LoadDiv_ChangeModeView() |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout dialogView = new FrameLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | }; |
| | | dialog.AddChidren(dialogView); |
| | | |
| | | FrameLayout modeChangeView; |
| | | modeChangeView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(30), |
| | | Y = Application.GetRealHeight(128), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(287), |
| | | BackgroundImagePath = "FunctionIcon/AC/DivBg1.png", |
| | | }; |
| | | dialogView.AddChidren(modeChangeView); |
| | | |
| | | Button btnTitle; |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(8 + 16), |
| | | Y = Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextID = StringId.ChooseMode, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | }; |
| | | modeChangeView.AddChidren(btnTitle); |
| | | |
| | | Button btnLine = new Button() |
| | | { |
| | | X = btnTitle.X, |
| | | Y = btnTitle.Bottom, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | modeChangeView.AddChidren(btnLine); |
| | | |
| | | var modeList = device.GetAttribute(FunctionAttributeKey.Mode).value; |
| | | foreach (var m in modeList) |
| | | { |
| | | Button btnModeIcon = new Button() |
| | | { |
| | | X = btnTitle.X, |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeIcon); |
| | | |
| | | Button btnModeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12) + btnModeIcon.Right, |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 8), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(90), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | IsSelected = device.GetAttrState(FunctionAttributeKey.Mode) == m, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeText); |
| | | |
| | | btnModeIcon.UnSelectedImagePath = fhTemp.GetModeIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = fhTemp.GetModeIconPath(m); |
| | | btnModeText.Text = fhTemp.GetModeAttrText(m); |
| | | |
| | | if (modeList.IndexOf(m) < modeList.Count - 1) |
| | | { |
| | | modeChangeView.AddChidren(new Button() |
| | | { |
| | | X = btnTitle.X, |
| | | Y = btnModeText.Bottom, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(1), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | EventHandler<MouseEventArgs> eventHandler1 = (sender, e) => |
| | | { |
| | | btnModeIcon.IsSelected = btnModeText.IsSelected = true; |
| | | device.SetAttrState(FunctionAttributeKey.Mode, m); |
| | | btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(m); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | btnMode.UnSelectedImagePath = btnModeIcon.UnSelectedImagePath; |
| | | d.Add(FunctionAttributeKey.Mode, m); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | dialog.Close(); |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | arcBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | arcBar.IsClickable = true; |
| | | } |
| | | }; |
| | | btnModeIcon.MouseUpEventHandler = eventHandler1; |
| | | btnModeText.MouseUpEventHandler = eventHandler1; |
| | | dialogView.MouseUpEventHandler = eventHandler; |
| | | |
| | | } |
| | | |
| | | dialogView.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | }; |
| | | dialog.Show(); |
| | | } |
| | | |
| | | #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.RefreshFormStatu(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 发送各种命令_______________________ |
| | | |
| | | /// <summary> |
| | | /// 温度改变模式 |
| | | /// </summary> |
| | | void LoadEvent_TempChange() |
| | | { |
| | | btnMinus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | | } |
| | | var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp <= device.GetAttribute(FunctionAttributeKey.Mode).min) |
| | | { |
| | | return; |
| | | } |
| | | temp--; |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString(); |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | btnPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off" || device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | return; |
| | | } |
| | | var temp = Convert.ToInt32(device.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp >= device.GetAttribute(FunctionAttributeKey.SetTemp).max) |
| | | { |
| | | return; |
| | | } |
| | | temp++; |
| | | arcBar.Progress = temp; |
| | | btnTemp.Text = temp.ToString(); |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, temp.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnStopTrackingTouchEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | btnTemp.Text = arcBar.Progress.ToString(); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.SetTemp, arcBar.Progress.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | arcBar.OnProgressChangedEvent = (sender, e) => |
| | | { |
| | | device.SetAttrState(FunctionAttributeKey.SetTemp, e.ToString()); |
| | | btnTemp.Text = e.ToString(); |
| | | }; |
| | | } |
| | | /// <summary> |
| | | /// 控制模式事件 |
| | | /// </summary> |
| | | void LoadEvent_AcStatesChange() |
| | | { |
| | | btnMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (device.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | return; |
| | | } |
| | | LoadDiv_ChangeModeView(); |
| | | }; |
| | | |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | btnSwitch.IsSelected = true; |
| | | arcBar.IsOffline = false; |
| | | } |
| | | else |
| | | { |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | btnSwitch.IsBold = false; |
| | | arcBar.IsOffline = true; |
| | | } |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 刷新界面状态_______________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新界面状态 |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnTemp.Text = device.GetAttrState(FunctionAttributeKey.SetTemp); |
| | | btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C"; |
| | | btnMode.UnSelectedImagePath = fhTemp.GetModeIconPath(device.GetAttrState(FunctionAttributeKey.Mode)); |
| | | arcBar.Progress = Convert.ToInt32(Convert.ToDouble(device.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | if (device.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | arcBar.IsOffline = false; |
| | | btnSwitch.IsSelected = true; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIconOn.png"; |
| | | if (device.GetAttrState(FunctionAttributeKey.Mode) == "fan") |
| | | { |
| | | arcBar.IsClickable = false; |
| | | } |
| | | else |
| | | { |
| | | arcBar.IsClickable = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | arcBar.IsOffline = true; |
| | | btnSwitch.IsSelected = false; |
| | | arcBar.IsClickable = false; |
| | | arcBar.ThumbImagePath = "FunctionIcon/AC/DiyThumbIcon.png"; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class TvControlPage : DeviceFunctionCardCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | |
| | | Button btnChangeTVAV; |
| | | FrameLayout topMenuView; |
| | | Button btnTopMenuUp; |
| | | Button btnTopMenuLeft; |
| | | Button btnTopMenuRight; |
| | | Button btnTopMenuDown; |
| | | Button btnOk; |
| | | FrameLayout channleView; |
| | | Button btnChlReduce; |
| | | Button btnChlPlus; |
| | | FrameLayout volView; |
| | | Button btnVolReduce; |
| | | Button btnVolPlus; |
| | | Button btnBack; |
| | | Button btnMenu; |
| | | Button btn123; |
| | | Button btnMute; |
| | | Button btnPower; |
| | | |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 初始化白色区域的内容 |
| | | /// </summary> |
| | | public override void InitFrameWhiteContent() |
| | | { |
| | | |
| | | base.ShowColltionButton = false; |
| | | base.SetTitleText(Language.StringByID(StringId.Electric)); |
| | | |
| | | //初始化第一个索引页的内容 |
| | | this.InitFrameWhiteContent1(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化第一个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | FrameLayout controlView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(88), |
| | | Width = Application.GetRealWidth(327), |
| | | Height = Application.GetRealHeight(526), |
| | | BackgroundImagePath = "Public/Fragmentbg.png", |
| | | }; |
| | | this.AddChidren(controlView); |
| | | |
| | | btnChangeTVAV = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(8), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(78), |
| | | Height = Application.GetRealHeight(49), |
| | | Text = "TV/AV", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnChangeTVAV); |
| | | |
| | | #region 轮盘控制区域 |
| | | topMenuView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(88), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(199), |
| | | Height = Application.GetRealWidth(199), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/TVOkIcon.png", |
| | | }; |
| | | controlView.AddChidren(topMenuView); |
| | | |
| | | btnTopMenuUp = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuUp); |
| | | |
| | | btnTopMenuLeft = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuLeft); |
| | | |
| | | btnTopMenuRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuRight); |
| | | |
| | | btnTopMenuDown = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(150), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(80), |
| | | Height = Application.GetRealWidth(50), |
| | | }; |
| | | topMenuView.AddChidren(btnTopMenuDown); |
| | | |
| | | btnOk = new Button() |
| | | { |
| | | Gravity = Gravity.Center, |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(100), |
| | | }; |
| | | topMenuView.AddChidren(btnOk); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #region 频道音量调节 |
| | | channleView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealHeight(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(channleView); |
| | | |
| | | btnChlReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlReduce); |
| | | |
| | | Button btnChlText; |
| | | btnChlText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Chl, |
| | | }; |
| | | channleView.AddChidren(btnChlText); |
| | | |
| | | btnChlPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlPlus); |
| | | |
| | | volView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(257), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealHeight(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(volView); |
| | | |
| | | btnVolReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolReduce); |
| | | |
| | | Button btnVolText; |
| | | btnVolText = new Button() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Height = Application.GetRealWidth(23), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = StringId.Vol, |
| | | }; |
| | | volView.AddChidren(btnVolText); |
| | | |
| | | btnVolPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolPlus); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 底部控制区域 |
| | | btnBack = new Button() |
| | | { |
| | | X = Application.GetRealWidth(30), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVBackIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnBack); |
| | | |
| | | btnMenu = new Button() |
| | | { |
| | | X = Application.GetRealWidth(106), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | |
| | | btn123 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(182), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TV123Icon.png", |
| | | }; |
| | | controlView.AddChidren(btn123); |
| | | |
| | | btnMute = new Button() |
| | | { |
| | | X = Application.GetRealWidth(258), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMuteIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMute); |
| | | |
| | | btnPower = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(462), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVPowerIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnPower); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class TVPage : FrameLayout |
| | |
| | | controlView.AddChidren(btnCollection); |
| | | } |
| | | |
| | | btnChangeTVAV = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(8), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(78), |
| | | Height = Application.GetRealHeight(49), |
| | | Text = "TV/AV", |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel, |
| | | }; |
| | | controlView.AddChidren(btnChangeTVAV); |
| | | |
| | | |
| | | #region 轮盘控制区域 |
| | | topMenuView = new FrameLayout() |
| | |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealHeight(102), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(channleView); |
| | | |
| | | btnChlReduce = new Button() |
| | | btnChlPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlReduce); |
| | | channleView.AddChidren(btnChlPlus); |
| | | |
| | | Button btnChlText; |
| | | btnChlText = new Button() |
| | |
| | | }; |
| | | channleView.AddChidren(btnChlText); |
| | | |
| | | btnChlPlus = new Button() |
| | | btnChlReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(66), |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | channleView.AddChidren(btnChlPlus); |
| | | channleView.AddChidren(btnChlReduce); |
| | | |
| | | volView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(257), |
| | | Y = Application.GetRealHeight(246), |
| | | Width = Application.GetRealWidth(44), |
| | | Height = Application.GetRealHeight(102), |
| | | Height = Application.GetRealWidth(102), |
| | | BackgroundImagePath = "FunctionIcon/Electrical/TV/MenuBgIcon.png", |
| | | }; |
| | | controlView.AddChidren(volView); |
| | | |
| | | btnVolReduce = new Button() |
| | | btnVolPlus = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(10), |
| | |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/PlusIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolReduce); |
| | | volView.AddChidren(btnVolPlus); |
| | | |
| | | Button btnVolText; |
| | | btnVolText = new Button() |
| | |
| | | }; |
| | | volView.AddChidren(btnVolText); |
| | | |
| | | btnVolPlus = new Button() |
| | | btnVolReduce = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(66), |
| | | Y = Application.GetRealWidth(66), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/ReduceIcon.png" |
| | | }; |
| | | volView.AddChidren(btnVolPlus); |
| | | volView.AddChidren(btnVolReduce); |
| | | |
| | | |
| | | |
| | |
| | | #region 底部控制区域 |
| | | btnBack = new Button() |
| | | { |
| | | X = Application.GetRealWidth(30), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | X = Application.GetRealWidth(52), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVBackIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnBack); |
| | | |
| | | btnMenu = new Button() |
| | | btnChangeTVAV = new Button() |
| | | { |
| | | X = Application.GetRealWidth(106), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVAV.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | controlView.AddChidren(btnChangeTVAV); |
| | | |
| | | btn123 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(182), |
| | | Y = Application.GetRealHeight(386), |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TV123Icon.png", |
| | |
| | | |
| | | btnMute = new Button() |
| | | { |
| | | X = Application.GetRealWidth(258), |
| | | Y = Application.GetRealHeight(386), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | X = Application.GetRealWidth(244), |
| | | Y = Application.GetRealHeight(402), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMuteIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMute); |
| | | |
| | | btnMenu = new Button() |
| | | { |
| | | X = Application.GetRealWidth(116), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVMenuIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnMenu); |
| | | |
| | | btnPower = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(462), |
| | | Width = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(40), |
| | | X = Application.GetRealWidth(180), |
| | | Y = Application.GetRealHeight(466), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/Electrical/TV/TVPowerIcon.png", |
| | | }; |
| | | controlView.AddChidren(btnPower); |
| | |
| | | |
| | | for (int i = 0; i < 10; i++) |
| | | { |
| | | |
| | | Button btn = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(98), |
| | |
| | | } |
| | | numberView.AddChidren(btn); |
| | | btn.MouseUpEventHandler = (sender, e) => { |
| | | string index = (sender as Button ).Text; |
| | | btn.IsSelected = false; |
| | | tvTemp.ControlTV(i,function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add($"number_{index}", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(i, function); |
| | | } |
| | | }; |
| | | btn.MouseDownEventHandler = (sender, e) => { |
| | | btn.IsSelected = true; |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.DriverLayer; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | { |
| | | btnChangeTVAV.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.AV_TV,function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("av_tv", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.AV_TV, function); |
| | | } |
| | | }; |
| | | btnChlPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.ChannelUp, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch+", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.ChannelUp, function); |
| | | } |
| | | }; |
| | | btnChlReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.ChannelDown, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ch-", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.ChannelDown, function); |
| | | } |
| | | }; |
| | | btnVolPlus.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.VolUp, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume+", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.VolUp, function); |
| | | } |
| | | }; |
| | | btnVolReduce.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.VolDown, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("volume-", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.VolDown, function); |
| | | } |
| | | }; |
| | | btnBack.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Back, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("return", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Back, function); |
| | | } |
| | | }; |
| | | |
| | | btnMenu.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Menu, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("menu", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Menu, function); |
| | | } |
| | | }; |
| | | btn123.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | }; |
| | | btnMute.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Mute, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("mute", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Mute, function); |
| | | } |
| | | }; |
| | | btnPower.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Power, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("on_off", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Power, function); |
| | | } |
| | | }; |
| | | |
| | | btnTopMenuUp.MouseUpEventHandler = (sender, e) => { |
| | | tvTemp.ControlTV(InfraredCode_TV.Up, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("up", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Up, function); |
| | | } |
| | | }; |
| | | btnTopMenuLeft.MouseUpEventHandler = (sender, e) => { |
| | | tvTemp.ControlTV(InfraredCode_TV.Left, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("left", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Left, function); |
| | | } |
| | | }; |
| | | btnTopMenuRight.MouseUpEventHandler = (sender, e) => { |
| | | tvTemp.ControlTV(InfraredCode_TV.Right, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("right", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Right, function); |
| | | } |
| | | }; |
| | | btnTopMenuDown.MouseUpEventHandler = (sender, e) => { |
| | | tvTemp.ControlTV(InfraredCode_TV.Down, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("down", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Down, function); |
| | | } |
| | | }; |
| | | btnOk.MouseUpEventHandler = (sender, e) => { |
| | | tvTemp.ControlTV(InfraredCode_TV.Confrim, function); |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add("ok", ""); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | } |
| | | else |
| | | { |
| | | tvTemp.ControlTV(InfraredCode_TV.Confrim, function); |
| | | } |
| | | }; |
| | | } |
| | | |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 饼图 |
| | | /// </summary> |
| | | public class EchartsOption_Pie |
| | | { |
| | | public string name = ""; |
| | | |
| | | public string type = "pie"; |
| | | |
| | | public string radius = "55%"; |
| | | |
| | | public List<OpthionData> data = new List<OpthionData>(); |
| | | |
| | | public string itemStyle = ""; |
| | | |
| | | public EchartsOption_Pie() |
| | | { |
| | | } |
| | | } |
| | | |
| | | public class OpthionData |
| | | { |
| | | public int value = 0; |
| | | public string name = ""; |
| | | } |
| | | |
| | | public class ItemStyle |
| | | { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class EnvironmentalPage : FrameLayout |
| | | { |
| | | |
| | | #region 控件集合 |
| | | static EnvironmentalPage bodyView; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnRoom; |
| | | /// <summary> |
| | | /// 房间选择下拉图标 |
| | | /// </summary> |
| | | Button btnFoorDownIcon; |
| | | /// <summary> |
| | | /// 房间选择触发区域 |
| | | /// </summary> |
| | | Button btnRoomClickRow; |
| | | /// <summary> |
| | | /// 传感器列表区域 |
| | | /// </summary> |
| | | FrameLayout sensorListView; |
| | | |
| | | /// <summary> |
| | | /// 天气名称文本 |
| | | /// </summary> |
| | | Button btnWatherText; |
| | | /// <summary> |
| | | /// 湿度数据文本 |
| | | /// </summary> |
| | | Button btnHumidityText; |
| | | /// <summary> |
| | | /// pm25数据文本 |
| | | /// </summary> |
| | | Button btnPm25Values; |
| | | /// <summary> |
| | | /// 风速数据文本 |
| | | /// </summary> |
| | | Button btnFanSpeedValues; |
| | | |
| | | #endregion |
| | | #region 区域变量 |
| | | Room room; |
| | | |
| | | Sensor sensorTemp = new Sensor(); |
| | | #endregion |
| | | |
| | | |
| | | public EnvironmentalPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | /// <param name="btnCollectionIcon">收藏按钮</param> |
| | | /// <param name="btnFunctionName">功能名称信息按钮</param> |
| | | /// <param name="btnFromFloor">功能楼层信息按钮</param> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | #region 顶部天气部分 |
| | | var topWeatherView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(73), |
| | | Width = Application.GetRealWidth(361), |
| | | Height = Application.GetRealWidth(166), |
| | | BackgroundImagePath = "FunctionIcon/EnvirSensor/0.png", |
| | | }; |
| | | bodyView.AddChidren(topWeatherView); |
| | | LoadEvent_ChangeWeatherIcon(topWeatherView); |
| | | |
| | | var btnLocationText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(27), |
| | | Width = Application.GetRealWidth(74), |
| | | Height = Application.GetRealWidth(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = MainPage.cityInfo.location, |
| | | }; |
| | | topWeatherView.AddChidren(btnLocationText); |
| | | |
| | | |
| | | var btnTemp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(21), |
| | | Y = Application.GetRealWidth(53), |
| | | Width = Application.GetRealWidth(78), |
| | | Height = Application.GetRealWidth(68), |
| | | TextSize = 60, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = MainPage.cityInfo.temperature, |
| | | }; |
| | | topWeatherView.AddChidren(btnTemp); |
| | | |
| | | var btnTempUint = new Button() |
| | | { |
| | | X = Application.GetRealWidth(109), |
| | | Y = Application.GetRealWidth(60), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.TextualColor, |
| | | Text = "°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUint); |
| | | |
| | | |
| | | btnWatherText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(109), |
| | | Y = Application.GetRealWidth(82), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealWidth(20), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = MainPage.cityInfo.weather |
| | | }; |
| | | topWeatherView.AddChidren(btnWatherText); |
| | | |
| | | var btnTempUpperLimit = new Button() |
| | | { |
| | | X = Application.GetRealWidth(107), |
| | | Y = Application.GetRealWidth(101), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/EnvirSensor/UpperLimit.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUpperLimit); |
| | | |
| | | var btnTempUpperLimitText = new Button() |
| | | { |
| | | X = btnTempUpperLimit.Right, |
| | | Y = Application.GetRealWidth(101), |
| | | Width = Application.GetRealWidth(42), |
| | | Height = Application.GetRealWidth(20), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "10°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUpperLimitText); |
| | | |
| | | var btnTempLowerLimit = new Button() |
| | | { |
| | | X = Application.GetRealWidth(156), |
| | | Y = Application.GetRealWidth(101), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/EnvirSensor/LowerLimit.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempLowerLimit); |
| | | |
| | | var btnTempLowerLimitText = new Button() |
| | | { |
| | | X = btnTempLowerLimit.Right, |
| | | Y = Application.GetRealWidth(101), |
| | | Width = Application.GetRealWidth(42), |
| | | Height = Application.GetRealWidth(20), |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = "2°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempLowerLimitText); |
| | | |
| | | |
| | | var btnValue = new Button() |
| | | { |
| | | X = Application.GetRealWidth(27), |
| | | Y = Application.GetRealWidth(119), |
| | | Width = Application.GetRealWidth(300), |
| | | Height = Application.GetRealWidth(34), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | TextColor = CSS_Color.TextualColor, |
| | | }; |
| | | topWeatherView.AddChidren(btnValue); |
| | | var valueText = Language.StringByID(StringId.EnvirSensorValueTip); |
| | | btnValue.Text = valueText.Replace("{0}", $"{MainPage.cityInfo.humidity}").Replace("{1}", $"{MainPage.cityInfo.pm25}").Replace("{2}", $"{MainPage.cityInfo.windLevel}"); |
| | | #endregion |
| | | |
| | | #region contentView |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(239), |
| | | Height = Application.GetRealHeight(450), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 房间顶部切换显示区域 |
| | | room = new Room() { roomName = Language.StringByID(StringId.All) }; |
| | | btnFoorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnFoorDownIcon); |
| | | |
| | | btnRoom = new Button() |
| | | { |
| | | X = btnFoorDownIcon.Right, |
| | | Y = Application.GetRealHeight(18), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetMinRealAverage(16), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = room.roomName, |
| | | }; |
| | | contentView.AddChidren(btnRoom); |
| | | |
| | | btnRoomClickRow = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(40), |
| | | }; |
| | | contentView.AddChidren(btnRoomClickRow); |
| | | |
| | | #endregion |
| | | |
| | | sensorListView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(456), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(sensorListView); |
| | | |
| | | LoadSenesorList(); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | //LoadEventList(); |
| | | LoadDialog_ChangeRoom(); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EnvironmentalScience)).LoadTopView(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSenesorList() |
| | | { |
| | | sensorListView.RemoveAll(); |
| | | int index = 0; |
| | | foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSensorDiv(Function sensor, int index) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(7), |
| | | Width = Application.GetRealWidth(182), |
| | | Height = Application.GetRealWidth(124), |
| | | Y = Application.GetRealWidth(124 * (index / 2)), |
| | | Tag = sensorTag |
| | | }; |
| | | |
| | | var imagePath = ""; |
| | | var iconPath = ""; |
| | | switch (sensor.spk) |
| | | { |
| | | case SPK.SensorCO2: |
| | | imagePath = "FunctionIcon/EnvirSensor/Co2Bg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/Co2Icon.png"; |
| | | break; |
| | | case SPK.SensorPm25: |
| | | imagePath = "FunctionIcon/EnvirSensor/Pm25Bg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/Pm25Icon.png"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | imagePath = "FunctionIcon/EnvirSensor/TvocBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/TvocIcon.png"; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | imagePath = "FunctionIcon/EnvirSensor/HumidityBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/HumidityIcon.png"; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | imagePath = "FunctionIcon/EnvirSensor/TempBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/TempIcon.png"; |
| | | break; |
| | | } |
| | | sensorView.BackgroundImagePath = imagePath; |
| | | |
| | | if (index % 2 != 0) |
| | | { |
| | | sensorView.X = Application.GetRealWidth(189); |
| | | } |
| | | sensorListView.AddChidren(sensorView); |
| | | |
| | | var btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(23), |
| | | Y = Application.GetRealHeight(17), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = iconPath |
| | | }; |
| | | sensorView.AddChidren(btnIcon); |
| | | |
| | | btnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | |
| | | var btnInfoIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(139), |
| | | Y = Application.GetRealHeight(21), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/EnvirSensor/InfoIcon.png", |
| | | }; |
| | | sensorView.AddChidren(btnInfoIcon); |
| | | btnInfoIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadInfo(sensor); |
| | | }; |
| | | |
| | | var btnLevel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(25), |
| | | Y = Application.GetRealWidth(59), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor,//levelColorList[sensorTemp.GetCurLevel(sensor) - 1], |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1], |
| | | Tag = "SensorLevel", |
| | | }; |
| | | sensorView.AddChidren(btnLevel); |
| | | btnLevel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | |
| | | |
| | | var btnSensorValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth(25), |
| | | Y = Application.GetRealWidth(83), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(27), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | IsBold = true, |
| | | Text = sensor.GetAttrState(FunctionAttributeKey.Value), |
| | | Tag = "SensorValues" |
| | | }; |
| | | sensorView.AddChidren(btnSensorValues); |
| | | btnSensorValues.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | //btnLevel.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // LoadInfo(sensor); |
| | | //}; |
| | | |
| | | |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(sensor); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器等级相关信息 |
| | | /// </summary> |
| | | void LoadInfo(Function sensor) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout dialogBodyView = new FrameLayout(); |
| | | dialog.AddChidren(dialogBodyView); |
| | | dialogBodyView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | VerticalScrolViewLayout infoView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(667 - 94 - (levelColorList.Count * 44) - 20), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(94 + (levelColorList.Count * 44) + levelColorList.Count), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Animate = Animate.DownToUp, |
| | | ScrollEnabled = false, |
| | | AnimateSpeed = 0.3f, |
| | | }; |
| | | dialogBodyView.AddChidren(infoView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | infoView.AddChidren(btnTitle); |
| | | |
| | | switch (sensor.spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | | btnTitle.Text = "PM2.5(ug/m²)"; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(PPM)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | break; |
| | | } |
| | | |
| | | FrameLayout subTitleView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subTitleView); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.IntervalValue, |
| | | }); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.LevelSensor, |
| | | }); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(223), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.ColorValue, |
| | | }); |
| | | for (int index = 0; index < levelTextList.Count; index++) |
| | | { |
| | | infoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(303), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | FrameLayout subInfoView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subInfoView); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = levelTextList[index] |
| | | }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(285), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealHeight(18), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = levelColorList[index] |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | dialog.Show(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 房间列表点击事件 |
| | | /// </summary> |
| | | void LoadDialog_ChangeRoom() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(45 * 2), |
| | | ScrollEnabled = false |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (SpatialInfo.CurrentSpatial.RoomList.Count < 2) |
| | | { |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 4); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 5); |
| | | contentView.ScrollEnabled = true; |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | |
| | | |
| | | var showListRoom = new List<Room>(); |
| | | showListRoom.Add(new Room() { roomName = Language.StringByID(StringId.All) }); |
| | | showListRoom.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | |
| | | foreach (var roomTemp in showListRoom) |
| | | { |
| | | string roomName = roomTemp.roomName; |
| | | var btnRoomName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | Text = roomName, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | IsSelected = btnRoom.Text == roomName, |
| | | IsMoreLines = true, |
| | | Tag = roomName |
| | | }; |
| | | contentView.AddChidren(btnRoomName); |
| | | |
| | | btnRoomName.MouseUpEventHandler += (senderH, en) => |
| | | { |
| | | dialog.Close(); |
| | | btnRoom.Text = roomName; |
| | | room = roomTemp; |
| | | LoadSenesorList(); |
| | | }; |
| | | } |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | |
| | | btnRoomClickRow.MouseUpEventHandler = eventHandler; |
| | | //btnFoorDownIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | #region event |
| | | |
| | | public static void LoadEvent_UpdataStatus(Function updateTemp) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = updateTemp.sid; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | | if (view.Tag.ToString() != sensorTag) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | { |
| | | if (btn.Tag != null) |
| | | { |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | } |
| | | } |
| | | } |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | void LoadEvent_ChangeWeatherIcon(FrameLayout view) |
| | | { |
| | | |
| | | switch (MainPage.cityInfo.weather) |
| | | { |
| | | case "晴": |
| | | case "Sunny": |
| | | case "晴天": |
| | | case "天晴": |
| | | case "Clear": |
| | | case "大部晴朗": |
| | | case "Mostly Sunny": |
| | | case "晴時多雲": |
| | | case "陽光充沛": |
| | | case "Mostly Clear": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/0.png"; |
| | | break; |
| | | case "多云": |
| | | case "Cloudy": |
| | | case "多雲": |
| | | case "少云": |
| | | case "Partly Cloudy": |
| | | case "少雲": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/1.png"; |
| | | break; |
| | | case "阴": |
| | | case "Overcast": |
| | | case "陰天": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/2.png"; |
| | | break; |
| | | case "阵雨": |
| | | case "Showers": |
| | | case "陣雨": |
| | | case "驟雨": |
| | | case "局部阵雨": |
| | | case "Scattered Showers": |
| | | case "局地陣雨": |
| | | case "局部地區性驟雨": |
| | | case "小阵雨": |
| | | case "Light Showers": |
| | | case "小陣雨": |
| | | case "零散驟雨": |
| | | case "强阵雨": |
| | | case "Heavy Showers": |
| | | case "強陣雨": |
| | | case "間中有驟雨": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/3.png"; |
| | | break; |
| | | case "阵雪": |
| | | case "Snow Showers": |
| | | case "陣雪": |
| | | case "驟雪": |
| | | case "小阵雪": |
| | | case "Light Snow Showers": |
| | | case "小陣雪": |
| | | case "零散驟雪": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/13.png"; |
| | | break; |
| | | case "雾": |
| | | case "Fog": |
| | | case "霧": |
| | | case "薄霧": |
| | | case "冻雾": |
| | | case "Freezing Fog": |
| | | case "凍霧": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/18.png"; |
| | | break; |
| | | case "沙尘暴": |
| | | case "Sandstorm": |
| | | case "沙塵暴": |
| | | case "强沙尘暴": |
| | | case "Heavy Sandstorm": |
| | | case "強沙塵暴": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/20.png"; |
| | | break; |
| | | case "浮尘": |
| | | case "Dust": |
| | | case "浮塵": |
| | | case "尘卷风": |
| | | case "Dust Storm": |
| | | case "塵捲風": |
| | | case "扬沙": |
| | | case "Sand": |
| | | case "揚沙": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/29.png"; |
| | | break; |
| | | case "霾": |
| | | case "Haze": |
| | | case "煙霞": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/45.png"; |
| | | break; |
| | | case "雷阵雨": |
| | | case "Thundershower": |
| | | case "雷陣雨": |
| | | case "雷雨": |
| | | case "雷电": |
| | | case "Lightning": |
| | | case "雷電": |
| | | case "雷暴": |
| | | case "Thunderstorm": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/4.png"; |
| | | break; |
| | | case "雷阵雨伴有冰雹": |
| | | case "Thundershower with Hail": |
| | | case "雷陣雨伴有冰雹": |
| | | case "雷雨伴有冰雹": |
| | | case "冰雹": |
| | | case "Hail": |
| | | case "冰针": |
| | | case "Needle Ice": |
| | | case "冰針": |
| | | case "冰粒": |
| | | case "Icy": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/5.png"; |
| | | break; |
| | | case "雨夹雪": |
| | | case "Sleet": |
| | | case "雨夾雪": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/6.png"; |
| | | break; |
| | | case "小雨": |
| | | case "Light Rain": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/3.png"; |
| | | break; |
| | | case "中雨": |
| | | case "Rain": |
| | | case "小到中雨": |
| | | case "雨": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/3.png"; |
| | | break; |
| | | case "大雨": |
| | | case "Heavy Rain": |
| | | case "中到大雨": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/3.png"; |
| | | break; |
| | | case "暴雨": |
| | | case "Rainstorm": |
| | | case "豪雨": |
| | | case "大暴雨": |
| | | case "Heavy Rainstorm": |
| | | case "大豪雨": |
| | | case "特大暴雨": |
| | | case "Extreme Rainstorm": |
| | | case "超大豪雨": |
| | | case "大到暴雨": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/3.png"; |
| | | break; |
| | | case "小雪": |
| | | case "Light Snow": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/13.png"; |
| | | break; |
| | | case "雪": |
| | | case "中雪": |
| | | case "小到中雪": |
| | | case "Snow": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/13.png"; |
| | | break; |
| | | case "大雪": |
| | | case "Heavy Snow": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/13.png"; |
| | | break; |
| | | case "暴雪": |
| | | case "Blizzard": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/13.png"; |
| | | break; |
| | | case "冻雨": |
| | | case "Freezing Rain": |
| | | case "凍雨": |
| | | view.BackgroundImagePath = "FunctionIcon/EnvirSensor/6.png"; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DriverLayer; |
| | | //using System; |
| | | //using Shared; |
| | | //using HDL_ON.Entity; |
| | | //using HDL_ON.UI.CSS; |
| | | //using System.Collections.Generic; |
| | | //using HDL_ON.DriverLayer; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class EnvironmentalSciencePage : FrameLayout |
| | | { |
| | | //namespace HDL_ON.UI |
| | | //{ |
| | | // public partial class EnvironmentalSciencePage : FrameLayout |
| | | // { |
| | | |
| | | #region 控件集合 |
| | | static EnvironmentalSciencePage bodyView; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnRoom; |
| | | /// <summary> |
| | | /// 房间选择下拉图标 |
| | | /// </summary> |
| | | Button btnFoorDownIcon; |
| | | /// <summary> |
| | | /// 房间选择触发区域 |
| | | /// </summary> |
| | | Button btnRoomClickRow; |
| | | /// <summary> |
| | | /// 传感器列表区域 |
| | | /// </summary> |
| | | FrameLayout sensorListView; |
| | | // #region 控件集合 |
| | | // static EnvironmentalSciencePage bodyView; |
| | | // /// <summary> |
| | | // /// 楼层显示 |
| | | // /// </summary> |
| | | // Button btnRoom; |
| | | // /// <summary> |
| | | // /// 房间选择下拉图标 |
| | | // /// </summary> |
| | | // Button btnFoorDownIcon; |
| | | // /// <summary> |
| | | // /// 房间选择触发区域 |
| | | // /// </summary> |
| | | // Button btnRoomClickRow; |
| | | // /// <summary> |
| | | // /// 传感器列表区域 |
| | | // /// </summary> |
| | | // FrameLayout sensorListView; |
| | | |
| | | /// <summary> |
| | | /// 天气名称文本 |
| | | /// </summary> |
| | | Button btnWatherText; |
| | | /// <summary> |
| | | /// 湿度数据文本 |
| | | /// </summary> |
| | | Button btnHumidityText; |
| | | /// <summary> |
| | | /// pm25数据文本 |
| | | /// </summary> |
| | | Button btnPm25Values; |
| | | /// <summary> |
| | | /// 风速数据文本 |
| | | /// </summary> |
| | | Button btnFanSpeedValues; |
| | | // /// <summary> |
| | | // /// 天气名称文本 |
| | | // /// </summary> |
| | | // Button btnWatherText; |
| | | // /// <summary> |
| | | // /// 湿度数据文本 |
| | | // /// </summary> |
| | | // Button btnHumidityText; |
| | | // /// <summary> |
| | | // /// pm25数据文本 |
| | | // /// </summary> |
| | | // Button btnPm25Values; |
| | | // /// <summary> |
| | | // /// 风速数据文本 |
| | | // /// </summary> |
| | | // Button btnFanSpeedValues; |
| | | |
| | | #endregion |
| | | #region 区域变量 |
| | | Room room; |
| | | // #endregion |
| | | // #region 区域变量 |
| | | // Room room; |
| | | |
| | | Sensor sensorTemp = new Sensor(); |
| | | #endregion |
| | | // Sensor sensorTemp = new Sensor(); |
| | | // #endregion |
| | | |
| | | |
| | | public EnvironmentalSciencePage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | // public EnvironmentalSciencePage() |
| | | // { |
| | | // bodyView = this; |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | /// <param name="btnCollectionIcon">收藏按钮</param> |
| | | /// <param name="btnFunctionName">功能名称信息按钮</param> |
| | | /// <param name="btnFromFloor">功能楼层信息按钮</param> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | // /// <summary> |
| | | // /// 加载界面 |
| | | // /// </summary> |
| | | // /// <param name="btnCollectionIcon">收藏按钮</param> |
| | | // /// <param name="btnFunctionName">功能名称信息按钮</param> |
| | | // /// <param name="btnFromFloor">功能楼层信息按钮</param> |
| | | // public void LoadPage() |
| | | // { |
| | | // bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | #region 顶部天气部分 |
| | | var topWeatherView = new FrameLayout() { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(76), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(151), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | }; |
| | | bodyView.AddChidren(topWeatherView); |
| | | // #region 顶部天气部分 |
| | | // var topWeatherView = new FrameLayout() { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(76), |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(151), |
| | | // BackgroundColor = CSS_Color.MainColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // bodyView.AddChidren(topWeatherView); |
| | | |
| | | var btnTemp = new Button() |
| | | { |
| | | X = Application.GetRealWidth(24), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(60), |
| | | Height = Application.GetRealHeight(48), |
| | | TextSize = 42, |
| | | IsBold = true, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = MainPage.cityInfo.temperature, |
| | | }; |
| | | topWeatherView.AddChidren(btnTemp); |
| | | // var btnTemp = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(24), |
| | | // Y = Application.GetRealHeight(16), |
| | | // Width = Application.GetRealWidth(60), |
| | | // Height = Application.GetRealHeight(48), |
| | | // TextSize = 42, |
| | | // IsBold = true, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = MainPage.cityInfo.temperature, |
| | | // }; |
| | | // topWeatherView.AddChidren(btnTemp); |
| | | |
| | | var btnTempUint = new Button() |
| | | { |
| | | X = Application.GetRealWidth(79), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealHeight(20), |
| | | TextSize = 12, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = "°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUint); |
| | | // var btnTempUint = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(79), |
| | | // Y = Application.GetRealHeight(16), |
| | | // Width = Application.GetRealWidth(20), |
| | | // Height = Application.GetRealHeight(20), |
| | | // TextSize = 12, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = "°C", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnTempUint); |
| | | |
| | | var btnWeatherIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(115), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(20), |
| | | Height = Application.GetRealWidth(20), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/SmogIcon.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnWeatherIcon); |
| | | LoadEvent_ChangeWeatherIcon(btnWeatherIcon); |
| | | // var btnWeatherIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(115), |
| | | // Y = Application.GetRealHeight(16), |
| | | // Width = Application.GetRealWidth(20), |
| | | // Height = Application.GetRealWidth(20), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/SmogIcon.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnWeatherIcon); |
| | | // LoadEvent_ChangeWeatherIcon(btnWeatherIcon); |
| | | |
| | | btnWatherText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(139), |
| | | Y = Application.GetRealHeight(16), |
| | | Width = Application.GetRealWidth(28 * 3), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = MainPage.cityInfo.weather |
| | | }; |
| | | topWeatherView.AddChidren(btnWatherText); |
| | | // btnWatherText = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(139), |
| | | // Y = Application.GetRealHeight(16), |
| | | // Width = Application.GetRealWidth(28 * 3), |
| | | // Height = Application.GetRealHeight(20), |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // Text = MainPage.cityInfo.weather |
| | | // }; |
| | | // topWeatherView.AddChidren(btnWatherText); |
| | | |
| | | var btnTempUpperLimit = new Button() |
| | | { |
| | | X = btnWeatherIcon.X, |
| | | Y = Application.GetRealHeight(46), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/UpArrow.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUpperLimit); |
| | | // var btnTempUpperLimit = new Button() |
| | | // { |
| | | // X = btnWeatherIcon.X, |
| | | // Y = Application.GetRealHeight(46), |
| | | // Width = Application.GetRealWidth(16), |
| | | // Height = Application.GetRealWidth(16), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/UpArrow.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnTempUpperLimit); |
| | | |
| | | var btnTempUpperLimitText = new Button() |
| | | { |
| | | X = btnTempUpperLimit.Right, |
| | | Y = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(42), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = "10°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempUpperLimitText); |
| | | // var btnTempUpperLimitText = new Button() |
| | | // { |
| | | // X = btnTempUpperLimit.Right, |
| | | // Y = Application.GetRealHeight(44), |
| | | // Width = Application.GetRealWidth(42), |
| | | // Height = Application.GetRealHeight(20), |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Text = "10°C", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnTempUpperLimitText); |
| | | |
| | | var btnTempLowerLimit = new Button() |
| | | { |
| | | X = btnTempUpperLimitText.Right, |
| | | Y = Application.GetRealHeight(46), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/UpArrow.png", |
| | | }; |
| | | btnTempLowerLimit.SetRotation(180f); |
| | | topWeatherView.AddChidren(btnTempLowerLimit); |
| | | // var btnTempLowerLimit = new Button() |
| | | // { |
| | | // X = btnTempUpperLimitText.Right, |
| | | // Y = Application.GetRealHeight(46), |
| | | // Width = Application.GetRealWidth(16), |
| | | // Height = Application.GetRealWidth(16), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/UpArrow.png", |
| | | // }; |
| | | // btnTempLowerLimit.SetRotation(180f); |
| | | // topWeatherView.AddChidren(btnTempLowerLimit); |
| | | |
| | | var btnTempLowerLimitText = new Button() |
| | | { |
| | | X = btnTempLowerLimit.Right, |
| | | Y = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(42), |
| | | Height = Application.GetRealHeight(20), |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = "2°C", |
| | | }; |
| | | topWeatherView.AddChidren(btnTempLowerLimitText); |
| | | // var btnTempLowerLimitText = new Button() |
| | | // { |
| | | // X = btnTempLowerLimit.Right, |
| | | // Y = Application.GetRealHeight(44), |
| | | // Width = Application.GetRealWidth(42), |
| | | // Height = Application.GetRealHeight(20), |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Text = "2°C", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnTempLowerLimitText); |
| | | |
| | | var btnLocationText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(233), |
| | | Y = Application.GetRealHeight(18), |
| | | Width = Application.GetRealWidth(74), |
| | | Height = Application.GetRealHeight(17), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = MainPage.cityInfo.location, |
| | | }; |
| | | topWeatherView.AddChidren(btnLocationText); |
| | | // var btnLocationText = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(233), |
| | | // Y = Application.GetRealHeight(18), |
| | | // Width = Application.GetRealWidth(74), |
| | | // Height = Application.GetRealHeight(17), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = MainPage.cityInfo.location, |
| | | // }; |
| | | // topWeatherView.AddChidren(btnLocationText); |
| | | |
| | | var btnLocationIcon = new Button() |
| | | { |
| | | X = btnLocationText.Right, |
| | | Y = Application.GetRealHeight(18), |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(16), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/LocationIcon.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnLocationIcon); |
| | | // var btnLocationIcon = new Button() |
| | | // { |
| | | // X = btnLocationText.Right, |
| | | // Y = Application.GetRealHeight(18), |
| | | // Width = Application.GetRealWidth(16), |
| | | // Height = Application.GetRealHeight(16), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/LocationIcon.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnLocationIcon); |
| | | |
| | | Button btnHumidityIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(26), |
| | | Y = Application.GetRealHeight(90), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/HumidityIcon.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnHumidityIcon); |
| | | // Button btnHumidityIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(26), |
| | | // Y = Application.GetRealHeight(90), |
| | | // Width = Application.GetRealWidth(24), |
| | | // Height = Application.GetRealWidth(24), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/HumidityIcon.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnHumidityIcon); |
| | | |
| | | btnHumidityText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Y = btnHumidityIcon.Bottom, |
| | | Width = Application.GetRealWidth(46), |
| | | Height = Application.GetRealHeight(25), |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = MainPage.cityInfo.humidity + "%", |
| | | }; |
| | | topWeatherView.AddChidren(btnHumidityText); |
| | | // btnHumidityText = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(15), |
| | | // Y = btnHumidityIcon.Bottom, |
| | | // Width = Application.GetRealWidth(46), |
| | | // Height = Application.GetRealHeight(25), |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = MainPage.cityInfo.humidity + "%", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnHumidityText); |
| | | |
| | | Button btnPm25Icon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(104), |
| | | Y = Application.GetRealHeight(90), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/Pm25Icon.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnPm25Icon); |
| | | // Button btnPm25Icon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(104), |
| | | // Y = Application.GetRealHeight(90), |
| | | // Width = Application.GetRealWidth(24), |
| | | // Height = Application.GetRealWidth(24), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/Pm25Icon.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnPm25Icon); |
| | | |
| | | btnPm25Values = new Button() |
| | | { |
| | | X = Application.GetRealWidth(90), |
| | | Y = btnHumidityIcon.Bottom, |
| | | Width = Application.GetRealWidth(52), |
| | | Height = Application.GetRealHeight(25), |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = MainPage.cityInfo.pm25, |
| | | }; |
| | | topWeatherView.AddChidren(btnPm25Values); |
| | | // btnPm25Values = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(90), |
| | | // Y = btnHumidityIcon.Bottom, |
| | | // Width = Application.GetRealWidth(52), |
| | | // Height = Application.GetRealHeight(25), |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = MainPage.cityInfo.pm25, |
| | | // }; |
| | | // topWeatherView.AddChidren(btnPm25Values); |
| | | |
| | | Button btnFanSpeedIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(182), |
| | | Y = Application.GetRealHeight(90), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/WeatherFanSpeedIcon.png", |
| | | }; |
| | | topWeatherView.AddChidren(btnFanSpeedIcon); |
| | | // Button btnFanSpeedIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(182), |
| | | // Y = Application.GetRealHeight(90), |
| | | // Width = Application.GetRealWidth(24), |
| | | // Height = Application.GetRealWidth(24), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/WeatherFanSpeedIcon.png", |
| | | // }; |
| | | // topWeatherView.AddChidren(btnFanSpeedIcon); |
| | | |
| | | btnFanSpeedValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth(162), |
| | | Y = btnFanSpeedIcon.Bottom, |
| | | Width = Application.GetRealWidth(63), |
| | | Height = Application.GetRealHeight(25), |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = MainPage.cityInfo.windLevel, |
| | | }; |
| | | topWeatherView.AddChidren(btnFanSpeedValues); |
| | | #endregion |
| | | // btnFanSpeedValues = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(162), |
| | | // Y = btnFanSpeedIcon.Bottom, |
| | | // Width = Application.GetRealWidth(63), |
| | | // Height = Application.GetRealHeight(25), |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // Text = MainPage.cityInfo.windLevel, |
| | | // }; |
| | | // topWeatherView.AddChidren(btnFanSpeedValues); |
| | | // #endregion |
| | | |
| | | #region contentView |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(239), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(418), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | // #region contentView |
| | | // FrameLayout contentView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(239), |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(418), |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // BorderColor = 0x00000000, |
| | | // BorderWidth = 0, |
| | | // BackgroundColor = CSS_Color.BackgroundColor, |
| | | // }; |
| | | // bodyView.AddChidren(contentView); |
| | | |
| | | #region 房间顶部切换显示区域 |
| | | room = new Room() { roomName = Language.StringByID(StringId.All)}; |
| | | btnFoorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | contentView.AddChidren(btnFoorDownIcon); |
| | | // #region 房间顶部切换显示区域 |
| | | // room = new Room() { roomName = Language.StringByID(StringId.All)}; |
| | | // btnFoorDownIcon = new Button() |
| | | // { |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // X = Application.GetRealWidth(16), |
| | | // Y = Application.GetRealHeight(18), |
| | | // UnSelectedImagePath = "Public/DownIcon.png", |
| | | // }; |
| | | // contentView.AddChidren(btnFoorDownIcon); |
| | | |
| | | btnRoom = new Button() |
| | | { |
| | | X = btnFoorDownIcon.Right, |
| | | Y = Application.GetRealHeight(18), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetMinRealAverage(16), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = room.roomName, |
| | | }; |
| | | contentView.AddChidren(btnRoom); |
| | | // btnRoom = new Button() |
| | | // { |
| | | // X = btnFoorDownIcon.Right, |
| | | // Y = Application.GetRealHeight(18), |
| | | // Width = Application.GetRealWidth(200), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // Text = room.roomName, |
| | | // }; |
| | | // contentView.AddChidren(btnRoom); |
| | | |
| | | btnRoomClickRow = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(40), |
| | | }; |
| | | contentView.AddChidren(btnRoomClickRow); |
| | | // btnRoomClickRow = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(40), |
| | | // }; |
| | | // contentView.AddChidren(btnRoomClickRow); |
| | | |
| | | #endregion |
| | | // #endregion |
| | | |
| | | sensorListView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(50), |
| | | Width = Application.GetRealWidth(308), |
| | | Height = Application.GetRealHeight(456), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(sensorListView); |
| | | // sensorListView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(50), |
| | | // Width = Application.GetRealWidth(308), |
| | | // Height = Application.GetRealHeight(456), |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // BorderColor = 0x00000000, |
| | | // BorderWidth = 0, |
| | | // }; |
| | | // contentView.AddChidren(sensorListView); |
| | | |
| | | LoadSenesorList(); |
| | | // LoadSenesorList(); |
| | | |
| | | LoadEventList(); |
| | | // LoadEventList(); |
| | | |
| | | |
| | | #endregion |
| | | // #endregion |
| | | |
| | | //LoadEventList(); |
| | | LoadDialog_ChangeRoom(); |
| | | // //LoadEventList(); |
| | | // LoadDialog_ChangeRoom(); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EnvironmentalScience)).LoadTopView(); |
| | | // new TopViewDiv(bodyView, Language.StringByID(StringId.EnvironmentalScience)).LoadTopView(); |
| | | |
| | | } |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSenesorList() |
| | | { |
| | | sensorListView.RemoveAll(); |
| | | int index = 0; |
| | | foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | } |
| | | // /// <summary> |
| | | // /// 加载传感器列表 |
| | | // /// </summary> |
| | | // void LoadSenesorList() |
| | | // { |
| | | // sensorListView.RemoveAll(); |
| | | // int index = 0; |
| | | // foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | // { |
| | | // LoadSensorDiv(sensor, index); |
| | | // index++; |
| | | // } |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSensorDiv(Function sensor,int index) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | // /// <summary> |
| | | // /// 加载传感器列表 |
| | | // /// </summary> |
| | | // void LoadSensorDiv(Function sensor,int index) |
| | | // { |
| | | // var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | // var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.sid; |
| | | FrameLayout sensorView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(148), |
| | | Height = Application.GetRealWidth(80), |
| | | Radius = (uint)Application.GetRealWidth(8), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Y = Application.GetRealWidth(92 * (index / 2)), |
| | | Tag = sensorTag |
| | | }; |
| | | if (index % 2 != 0) |
| | | { |
| | | sensorView.X = Application.GetRealWidth(160); |
| | | } |
| | | sensorListView.AddChidren(sensorView); |
| | | // if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | // { |
| | | // var sensorTag = sensor.sid; |
| | | // FrameLayout sensorView = new FrameLayout() |
| | | // { |
| | | // Width = Application.GetRealWidth(148), |
| | | // Height = Application.GetRealWidth(80), |
| | | // Radius = (uint)Application.GetRealWidth(8), |
| | | // BorderColor = 0x00000000, |
| | | // BorderWidth = 0, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Y = Application.GetRealWidth(92 * (index / 2)), |
| | | // Tag = sensorTag |
| | | // }; |
| | | // if (index % 2 != 0) |
| | | // { |
| | | // sensorView.X = Application.GetRealWidth(160); |
| | | // } |
| | | // sensorListView.AddChidren(sensorView); |
| | | |
| | | var arcBar = new DiyArcSeekBar() |
| | | { |
| | | X = Application.GetRealWidth(7), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(48), |
| | | Height = Application.GetRealWidth(48), |
| | | OpenAngle = 10, |
| | | ProgressBarColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1], |
| | | MinValue = 0, |
| | | MaxValue = 96, |
| | | Progress = (96 / sensorTemp.GetLevelColorList(sensor.spk).Count * sensorTemp.GetCurLevel(sensor)), |
| | | IsClickable = false, |
| | | ArcColor = CSS_Color.BackgroundColor, |
| | | ArcWidth = Application.GetRealWidth(4), |
| | | IsThumbImgBtnShow = false, |
| | | SeekBarPadding = Application.GetRealWidth(2), |
| | | }; |
| | | sensorView.AddChidren(arcBar); |
| | | // var arcBar = new DiyArcSeekBar() |
| | | // { |
| | | // X = Application.GetRealWidth(7), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetRealWidth(48), |
| | | // Height = Application.GetRealWidth(48), |
| | | // OpenAngle = 10, |
| | | // ProgressBarColor = sensorTemp.GetLevelColorList(sensor.spk)[sensorTemp.GetCurLevel(sensor) - 1], |
| | | // MinValue = 0, |
| | | // MaxValue = 96, |
| | | // Progress = (96 / sensorTemp.GetLevelColorList(sensor.spk).Count * sensorTemp.GetCurLevel(sensor)), |
| | | // IsClickable = false, |
| | | // ArcColor = CSS_Color.BackgroundColor, |
| | | // ArcWidth = Application.GetRealWidth(4), |
| | | // IsThumbImgBtnShow = false, |
| | | // SeekBarPadding = Application.GetRealWidth(2), |
| | | // }; |
| | | // sensorView.AddChidren(arcBar); |
| | | |
| | | var btnSensorTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(7), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(48), |
| | | Height = Application.GetRealWidth(48), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextID = sensorTemp.GetFunctionTypeNameId(sensor.spk), |
| | | Tag = "SensorTitle" |
| | | }; |
| | | sensorView.AddChidren(btnSensorTitle); |
| | | btnSensorTitle.MouseUpEventHandler = (sender, e) => { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | // var btnSensorTitle = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(7), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetRealWidth(48), |
| | | // Height = Application.GetRealWidth(48), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextID = sensorTemp.GetFunctionTypeNameId(sensor.spk), |
| | | // Tag = "SensorTitle" |
| | | // }; |
| | | // sensorView.AddChidren(btnSensorTitle); |
| | | // btnSensorTitle.MouseUpEventHandler = (sender, e) => { |
| | | // #region |
| | | // var esp = new EnvironmentalSensorPage(sensor); |
| | | // MainPage.BasePageView.AddChidren(esp); |
| | | // esp.LoadPage(); |
| | | // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | // #endregion |
| | | // }; |
| | | |
| | | var btnInfoIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(120), |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/TipInfoIcon.png", |
| | | }; |
| | | sensorView.AddChidren(btnInfoIcon); |
| | | btnInfoIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadInfo(sensor); |
| | | }; |
| | | // var btnInfoIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(120), |
| | | // Width = Application.GetRealWidth(28), |
| | | // Height = Application.GetRealWidth(28), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/TipInfoIcon.png", |
| | | // }; |
| | | // sensorView.AddChidren(btnInfoIcon); |
| | | // btnInfoIcon.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // LoadInfo(sensor); |
| | | // }; |
| | | |
| | | var btnSensorValues = new Button() |
| | | { |
| | | X = Application.GetRealWidth(72), |
| | | Y = Application.GetRealWidth(17), |
| | | Width = Application.GetRealWidth(70), |
| | | Height = Application.GetRealWidth(30), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | IsBold = true, |
| | | Text = sensor.GetAttrState(FunctionAttributeKey.Value), |
| | | Tag = "SensorValues" |
| | | }; |
| | | sensorView.AddChidren(btnSensorValues); |
| | | // var btnSensorValues = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(72), |
| | | // Y = Application.GetRealWidth(17), |
| | | // Width = Application.GetRealWidth(70), |
| | | // Height = Application.GetRealWidth(30), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.EmphasisFontSize_Secondary, |
| | | // IsBold = true, |
| | | // Text = sensor.GetAttrState(FunctionAttributeKey.Value), |
| | | // Tag = "SensorValues" |
| | | // }; |
| | | // sensorView.AddChidren(btnSensorValues); |
| | | |
| | | var btnLevel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(70), |
| | | Y = btnSensorValues.Bottom, |
| | | Width = Application.GetRealWidth(50), |
| | | Height = Application.GetRealWidth(18), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = levelColorList[sensorTemp.GetCurLevel( sensor) - 1], |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1], |
| | | Tag = "SensorLevel" |
| | | }; |
| | | sensorView.AddChidren(btnLevel); |
| | | // var btnLevel = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(70), |
| | | // Y = btnSensorValues.Bottom, |
| | | // Width = Application.GetRealWidth(50), |
| | | // Height = Application.GetRealWidth(18), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = levelColorList[sensorTemp.GetCurLevel( sensor) - 1], |
| | | // TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | // TextID = levelTextList[sensorTemp.GetCurLevel(sensor) - 1], |
| | | // Tag = "SensorLevel" |
| | | // }; |
| | | // sensorView.AddChidren(btnLevel); |
| | | |
| | | Control.Ins.SendReadCommand(sensor); |
| | | } |
| | | } |
| | | // Control.Ins.SendReadCommand(sensor); |
| | | // } |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器等级相关信息 |
| | | /// </summary> |
| | | void LoadInfo(Function sensor) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | Dialog dialog = new Dialog(); |
| | | // /// <summary> |
| | | // /// 加载传感器等级相关信息 |
| | | // /// </summary> |
| | | // void LoadInfo(Function sensor) |
| | | // { |
| | | // var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | // var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout dialogBodyView = new FrameLayout(); |
| | | dialog.AddChidren(dialogBodyView); |
| | | dialogBodyView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | VerticalScrolViewLayout infoView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(667 - 94 - (levelColorList.Count * 44) - 20), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(94 + (levelColorList.Count * 44) + levelColorList.Count), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Animate = Animate.DownToUp, |
| | | ScrollEnabled = false, |
| | | AnimateSpeed = 0.3f, |
| | | }; |
| | | dialogBodyView.AddChidren(infoView); |
| | | // FrameLayout dialogBodyView = new FrameLayout(); |
| | | // dialog.AddChidren(dialogBodyView); |
| | | // dialogBodyView.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // }; |
| | | // VerticalScrolViewLayout infoView = new VerticalScrolViewLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(667 - 94 - (levelColorList.Count * 44) - 20), |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(94 + (levelColorList.Count * 44) + levelColorList.Count), |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Animate = Animate.DownToUp, |
| | | // ScrollEnabled = false, |
| | | // AnimateSpeed = 0.3f, |
| | | // }; |
| | | // dialogBodyView.AddChidren(infoView); |
| | | |
| | | Button btnTitle = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | IsBold = true, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | infoView.AddChidren(btnTitle); |
| | | // Button btnTitle = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // IsBold = true, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // }; |
| | | // infoView.AddChidren(btnTitle); |
| | | |
| | | switch (sensor.spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | | btnTitle.Text = "PM2.5(ug/m²)"; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(PPM)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | break; |
| | | } |
| | | // switch (sensor.spk) |
| | | // { |
| | | // case SPK.SensorPm25: |
| | | // btnTitle.Text = "PM2.5(ug/m²)"; |
| | | // break; |
| | | // case SPK.SensorTemperature: |
| | | // btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | // break; |
| | | // case SPK.SensorTVOC: |
| | | // btnTitle.Text = "TVOC(PPM)"; |
| | | // break; |
| | | // case SPK.SensorCO2: |
| | | // btnTitle.Text = "CO2(PPM)"; |
| | | // break; |
| | | // case SPK.SensorHumidity: |
| | | // btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | // break; |
| | | // } |
| | | |
| | | FrameLayout subTitleView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subTitleView); |
| | | // FrameLayout subTitleView = new FrameLayout() |
| | | // { |
| | | // Height = Application.GetRealHeight(44), |
| | | // }; |
| | | // infoView.AddChidren(subTitleView); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.IntervalValue, |
| | | }); |
| | | // subTitleView.AddChidren(new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(20), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // IsBold = true, |
| | | // TextID = StringId.IntervalValue, |
| | | // }); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.LevelSensor, |
| | | }); |
| | | // subTitleView.AddChidren(new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // IsBold = true, |
| | | // TextID = StringId.LevelSensor, |
| | | // }); |
| | | |
| | | subTitleView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(223), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = StringId.ColorValue, |
| | | }); |
| | | for (int index = 0; index < levelTextList.Count; index++) |
| | | { |
| | | infoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(303), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | // subTitleView.AddChidren(new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(223), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // IsBold = true, |
| | | // TextID = StringId.ColorValue, |
| | | // }); |
| | | // for (int index = 0; index < levelTextList.Count; index++) |
| | | // { |
| | | // infoView.AddChidren(new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(303), |
| | | // Height = Application.GetRealWidth(1), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | // }); |
| | | |
| | | FrameLayout subInfoView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | infoView.AddChidren(subInfoView); |
| | | // FrameLayout subInfoView = new FrameLayout() |
| | | // { |
| | | // Height = Application.GetRealHeight(44), |
| | | // }; |
| | | // infoView.AddChidren(subInfoView); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(20), |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | }); |
| | | // subInfoView.AddChidren(new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(20), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // IsBold = true, |
| | | // Text = sensorTemp.GetIntervalValue(sensor.spk)[index] |
| | | // }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(100), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | IsBold = true, |
| | | TextID = levelTextList[index] |
| | | }); |
| | | // subInfoView.AddChidren(new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // IsBold = true, |
| | | // TextID = levelTextList[index] |
| | | // }); |
| | | |
| | | subInfoView.AddChidren(new Button() |
| | | { |
| | | X = Application.GetRealWidth(285), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetRealWidth(38), |
| | | Height = Application.GetRealHeight(18), |
| | | Radius = (uint)Application.GetRealWidth(4), |
| | | BackgroundColor = levelColorList[index] |
| | | }); |
| | | } |
| | | // subInfoView.AddChidren(new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(285), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetRealWidth(38), |
| | | // Height = Application.GetRealHeight(18), |
| | | // Radius = (uint)Application.GetRealWidth(4), |
| | | // BackgroundColor = levelColorList[index] |
| | | // }); |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | dialog.Show(); |
| | | } |
| | | // dialog.Show(); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 房间列表点击事件 |
| | | /// </summary> |
| | | void LoadDialog_ChangeRoom() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | var dialog = new Dialog(); |
| | | var dialogBody = new FrameLayout(); |
| | | dialog.AddChidren(dialogBody); |
| | | dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | dialog.Close(); |
| | | }; |
| | | // /// <summary> |
| | | // /// 房间列表点击事件 |
| | | // /// </summary> |
| | | // void LoadDialog_ChangeRoom() |
| | | // { |
| | | // EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | // var dialog = new Dialog(); |
| | | // var dialogBody = new FrameLayout(); |
| | | // dialog.AddChidren(dialogBody); |
| | | // dialogBody.MouseUpEventHandler += (sender1, e1) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | var dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(110), |
| | | BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | // var dispalyView = new FrameLayout() |
| | | // { |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(266), |
| | | // Width = Application.GetRealWidth(160), |
| | | // Height = Application.GetRealHeight(110), |
| | | // BackgroundImagePath = "PersonalCenter/HomeList1bg.png", |
| | | // }; |
| | | // dialogBody.AddChidren(dispalyView); |
| | | |
| | | var contentView = new VerticalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(8), |
| | | Y = Application.GetRealHeight(15), |
| | | Width = Application.GetRealWidth(150), |
| | | Height = Application.GetRealHeight(45 * 2), |
| | | ScrollEnabled = false |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | // var contentView = new VerticalScrolViewLayout() |
| | | // { |
| | | // X = Application.GetRealWidth(8), |
| | | // Y = Application.GetRealHeight(15), |
| | | // Width = Application.GetRealWidth(150), |
| | | // Height = Application.GetRealHeight(45 * 2), |
| | | // ScrollEnabled = false |
| | | // }; |
| | | // dispalyView.AddChidren(contentView); |
| | | |
| | | if (SpatialInfo.CurrentSpatial.RoomList.Count < 2) |
| | | { |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(155), |
| | | BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | // if (SpatialInfo.CurrentSpatial.RoomList.Count < 2) |
| | | // { |
| | | // } |
| | | // else if (SpatialInfo.CurrentSpatial.RoomList.Count < 3) |
| | | // { |
| | | // dispalyView = new FrameLayout() |
| | | // { |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(266), |
| | | // Width = Application.GetRealWidth(160), |
| | | // Height = Application.GetRealHeight(155), |
| | | // BackgroundImagePath = "PersonalCenter/HomeList2bg.png", |
| | | // }; |
| | | // dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(200), |
| | | BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | // contentView.Height = Application.GetRealHeight(45 * 3); |
| | | // dispalyView.AddChidren(contentView); |
| | | // } |
| | | // else if (SpatialInfo.CurrentSpatial.RoomList.Count < 4) |
| | | // { |
| | | // dispalyView = new FrameLayout() |
| | | // { |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(266), |
| | | // Width = Application.GetRealWidth(160), |
| | | // Height = Application.GetRealHeight(200), |
| | | // BackgroundImagePath = "PersonalCenter/HomeList3bg.png", |
| | | // }; |
| | | // dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 4); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(266), |
| | | Width = Application.GetRealWidth(160), |
| | | Height = Application.GetRealHeight(245), |
| | | BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | }; |
| | | dialogBody.AddChidren(dispalyView); |
| | | // contentView.Height = Application.GetRealHeight(45 * 4); |
| | | // dispalyView.AddChidren(contentView); |
| | | // } |
| | | // else |
| | | // { |
| | | // dispalyView = new FrameLayout() |
| | | // { |
| | | // X = Application.GetRealWidth(10), |
| | | // Y = Application.GetRealHeight(266), |
| | | // Width = Application.GetRealWidth(160), |
| | | // Height = Application.GetRealHeight(245), |
| | | // BackgroundImagePath = "PersonalCenter/HomeList4bg.png", |
| | | // }; |
| | | // dialogBody.AddChidren(dispalyView); |
| | | |
| | | contentView.Height = Application.GetRealHeight(45 * 5); |
| | | contentView.ScrollEnabled = true; |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | // contentView.Height = Application.GetRealHeight(45 * 5); |
| | | // contentView.ScrollEnabled = true; |
| | | // dispalyView.AddChidren(contentView); |
| | | // } |
| | | |
| | | |
| | | var showListRoom = new List<Room>(); |
| | | showListRoom.Add(new Room() { roomName = Language.StringByID(StringId.All) }); |
| | | showListRoom.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | // var showListRoom = new List<Room>(); |
| | | // showListRoom.Add(new Room() { roomName = Language.StringByID(StringId.All) }); |
| | | // showListRoom.AddRange(SpatialInfo.CurrentSpatial.RoomList); |
| | | |
| | | foreach (var roomTemp in showListRoom) |
| | | { |
| | | string roomName = roomTemp.roomName; |
| | | var btnRoomName = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(112), |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | SelectedTextColor = CSS.CSS_Color.MainColor, |
| | | Text = roomName, |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | IsSelected = btnRoom.Text == roomName, |
| | | IsMoreLines = true, |
| | | Tag = roomName |
| | | }; |
| | | contentView.AddChidren(btnRoomName); |
| | | // foreach (var roomTemp in showListRoom) |
| | | // { |
| | | // string roomName = roomTemp.roomName; |
| | | // var btnRoomName = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(112), |
| | | // Height = Application.GetRealHeight(44), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | // SelectedTextColor = CSS.CSS_Color.MainColor, |
| | | // Text = roomName, |
| | | // TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | // IsSelected = btnRoom.Text == roomName, |
| | | // IsMoreLines = true, |
| | | // Tag = roomName |
| | | // }; |
| | | // contentView.AddChidren(btnRoomName); |
| | | |
| | | btnRoomName.MouseUpEventHandler += (senderH, en) => |
| | | { |
| | | dialog.Close(); |
| | | btnRoom.Text = roomName; |
| | | room = roomTemp; |
| | | LoadSenesorList(); |
| | | }; |
| | | } |
| | | // btnRoomName.MouseUpEventHandler += (senderH, en) => |
| | | // { |
| | | // dialog.Close(); |
| | | // btnRoom.Text = roomName; |
| | | // room = roomTemp; |
| | | // LoadSenesorList(); |
| | | // }; |
| | | // } |
| | | |
| | | dialog.Show(); |
| | | }; |
| | | // dialog.Show(); |
| | | // }; |
| | | |
| | | btnRoomClickRow.MouseUpEventHandler = eventHandler; |
| | | //btnFoorDownIcon.MouseUpEventHandler = eventHandler; |
| | | } |
| | | // btnRoomClickRow.MouseUpEventHandler = eventHandler; |
| | | // //btnFoorDownIcon.MouseUpEventHandler = eventHandler; |
| | | // } |
| | | |
| | | |
| | | } |
| | | } |
| | | // } |
| | | //} |
| | |
| | | using System; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public partial class EnvironmentalSciencePage |
| | | { |
| | | //using System; |
| | | //using HDL_ON.Entity; |
| | | //using Shared; |
| | | //namespace HDL_ON.UI |
| | | //{ |
| | | // public partial class EnvironmentalSciencePage |
| | | // { |
| | | |
| | | void LoadEventList() |
| | | { |
| | | // void LoadEventList() |
| | | // { |
| | | |
| | | } |
| | | // } |
| | | |
| | | public static void LoadEvent_UpdataStatus(Function updateTemp) |
| | | { |
| | | Application.RunOnMainThread(() =>{ |
| | | if (bodyView != null) |
| | | { |
| | | for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | { |
| | | var sensorTag = updateTemp.sid; |
| | | var view = bodyView.sensorListView.GetChildren(i); |
| | | if (view.GetType() == typeof(FrameLayout)) |
| | | { |
| | | if(view.Tag.ToString() != sensorTag) |
| | | { |
| | | continue; |
| | | } |
| | | for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | { |
| | | var btn = (view as FrameLayout).GetChildren(j); |
| | | if (btn.GetType() == typeof(Button)) |
| | | { |
| | | if (btn.Tag!=null) |
| | | { |
| | | var tag = btn.Tag.ToString(); |
| | | if (tag == "SensorValues") |
| | | { |
| | | (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | } |
| | | else if (tag == "SensorLevel") |
| | | { |
| | | (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | } |
| | | } |
| | | } |
| | | else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | { |
| | | (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | // public static void LoadEvent_UpdataStatus(Function updateTemp) |
| | | // { |
| | | // Application.RunOnMainThread(() =>{ |
| | | // if (bodyView != null) |
| | | // { |
| | | // for (int i = 0; i < bodyView.sensorListView.ChildrenCount; i++) |
| | | // { |
| | | // var sensorTag = updateTemp.sid; |
| | | // var view = bodyView.sensorListView.GetChildren(i); |
| | | // if (view.GetType() == typeof(FrameLayout)) |
| | | // { |
| | | // if(view.Tag.ToString() != sensorTag) |
| | | // { |
| | | // continue; |
| | | // } |
| | | // for (int j = 0; j < (view as FrameLayout).ChildrenCount; j++) |
| | | // { |
| | | // var btn = (view as FrameLayout).GetChildren(j); |
| | | // if (btn.GetType() == typeof(Button)) |
| | | // { |
| | | // if (btn.Tag!=null) |
| | | // { |
| | | // var tag = btn.Tag.ToString(); |
| | | // if (tag == "SensorValues") |
| | | // { |
| | | // (btn as Button).Text = updateTemp.GetAttrState(FunctionAttributeKey.Value); |
| | | // } |
| | | // else if (tag == "SensorLevel") |
| | | // { |
| | | // (btn as Button).TextID = bodyView.sensorTemp.GetLevelTextList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | // (btn as Button).TextColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | // } |
| | | // } |
| | | // } |
| | | // else if (btn.GetType() == typeof(ArcSeekBar)) |
| | | // { |
| | | // (btn as ArcSeekBar).ProgressBarColor = bodyView.sensorTemp.GetLevelColorList(updateTemp.spk)[bodyView.sensorTemp.GetCurLevel(updateTemp) - 1]; |
| | | |
| | | (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | // (btn as ArcSeekBar).Progress = (96 / bodyView.sensorTemp.GetLevelColorList(updateTemp.spk).Count) * bodyView.sensorTemp.GetCurLevel(updateTemp); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | void LoadEvent_ChangeWeatherIcon(Button btnWeatherIcon) |
| | | { |
| | | // void LoadEvent_ChangeWeatherIcon(Button btnWeatherIcon) |
| | | // { |
| | | |
| | | switch (MainPage.cityInfo.weather) |
| | | { |
| | | case "晴": |
| | | case "Sunny": |
| | | case "晴天": |
| | | case "天晴": |
| | | case "Clear": |
| | | case "大部晴朗": |
| | | case "Mostly Sunny": |
| | | case "晴時多雲": |
| | | case "陽光充沛": |
| | | case "Mostly Clear": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/0.png"; |
| | | break; |
| | | case "多云": |
| | | case "Cloudy": |
| | | case "多雲": |
| | | case "少云": |
| | | case "Partly Cloudy": |
| | | case "少雲": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/1.png"; |
| | | break; |
| | | case "阴": |
| | | case "Overcast": |
| | | case "陰天": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/2.png"; |
| | | break; |
| | | case "阵雨": |
| | | case "Showers": |
| | | case "陣雨": |
| | | case "驟雨": |
| | | case "局部阵雨": |
| | | case "Scattered Showers": |
| | | case "局地陣雨": |
| | | case "局部地區性驟雨": |
| | | case "小阵雨": |
| | | case "Light Showers": |
| | | case "小陣雨": |
| | | case "零散驟雨": |
| | | case "强阵雨": |
| | | case "Heavy Showers": |
| | | case "強陣雨": |
| | | case "間中有驟雨": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | break; |
| | | case "阵雪": |
| | | case "Snow Showers": |
| | | case "陣雪": |
| | | case "驟雪": |
| | | case "小阵雪": |
| | | case "Light Snow Showers": |
| | | case "小陣雪": |
| | | case "零散驟雪": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | break; |
| | | case "雾": |
| | | case "Fog": |
| | | case "霧": |
| | | case "薄霧": |
| | | case "冻雾": |
| | | case "Freezing Fog": |
| | | case "凍霧": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/18.png"; |
| | | break; |
| | | case "沙尘暴": |
| | | case "Sandstorm": |
| | | case "沙塵暴": |
| | | case "强沙尘暴": |
| | | case "Heavy Sandstorm": |
| | | case "強沙塵暴": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/20.png"; |
| | | break; |
| | | case "浮尘": |
| | | case "Dust": |
| | | case "浮塵": |
| | | case "尘卷风": |
| | | case "Dust Storm": |
| | | case "塵捲風": |
| | | case "扬沙": |
| | | case "Sand": |
| | | case "揚沙": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/29.png"; |
| | | break; |
| | | case "霾": |
| | | case "Haze": |
| | | case "煙霞": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/45.png"; |
| | | break; |
| | | case "雷阵雨": |
| | | case "Thundershower": |
| | | case "雷陣雨": |
| | | case "雷雨": |
| | | case "雷电": |
| | | case "Lightning": |
| | | case "雷電": |
| | | case "雷暴": |
| | | case "Thunderstorm": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/4.png"; |
| | | break; |
| | | case "雷阵雨伴有冰雹": |
| | | case "Thundershower with Hail": |
| | | case "雷陣雨伴有冰雹": |
| | | case "雷雨伴有冰雹": |
| | | case "冰雹": |
| | | case "Hail": |
| | | case "冰针": |
| | | case "Needle Ice": |
| | | case "冰針": |
| | | case "冰粒": |
| | | case "Icy": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/5.png"; |
| | | break; |
| | | case "雨夹雪": |
| | | case "Sleet": |
| | | case "雨夾雪": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png"; |
| | | break; |
| | | case "小雨": |
| | | case "Light Rain": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | break; |
| | | case "中雨": |
| | | case "Rain": |
| | | case "小到中雨": |
| | | case "雨": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | break; |
| | | case "大雨": |
| | | case "Heavy Rain": |
| | | case "中到大雨": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | break; |
| | | case "暴雨": |
| | | case "Rainstorm": |
| | | case "豪雨": |
| | | case "大暴雨": |
| | | case "Heavy Rainstorm": |
| | | case "大豪雨": |
| | | case "特大暴雨": |
| | | case "Extreme Rainstorm": |
| | | case "超大豪雨": |
| | | case "大到暴雨": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | break; |
| | | case "小雪": |
| | | case "Light Snow": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | break; |
| | | case "雪": |
| | | case "中雪": |
| | | case "小到中雪": |
| | | case "Snow": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | break; |
| | | case "大雪": |
| | | case "Heavy Snow": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | break; |
| | | case "暴雪": |
| | | case "Blizzard": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | break; |
| | | case "冻雨": |
| | | case "Freezing Rain": |
| | | case "凍雨": |
| | | btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png"; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | // switch (MainPage.cityInfo.weather) |
| | | // { |
| | | // case "晴": |
| | | // case "Sunny": |
| | | // case "晴天": |
| | | // case "天晴": |
| | | // case "Clear": |
| | | // case "大部晴朗": |
| | | // case "Mostly Sunny": |
| | | // case "晴時多雲": |
| | | // case "陽光充沛": |
| | | // case "Mostly Clear": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/0.png"; |
| | | // break; |
| | | // case "多云": |
| | | // case "Cloudy": |
| | | // case "多雲": |
| | | // case "少云": |
| | | // case "Partly Cloudy": |
| | | // case "少雲": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/1.png"; |
| | | // break; |
| | | // case "阴": |
| | | // case "Overcast": |
| | | // case "陰天": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/2.png"; |
| | | // break; |
| | | // case "阵雨": |
| | | // case "Showers": |
| | | // case "陣雨": |
| | | // case "驟雨": |
| | | // case "局部阵雨": |
| | | // case "Scattered Showers": |
| | | // case "局地陣雨": |
| | | // case "局部地區性驟雨": |
| | | // case "小阵雨": |
| | | // case "Light Showers": |
| | | // case "小陣雨": |
| | | // case "零散驟雨": |
| | | // case "强阵雨": |
| | | // case "Heavy Showers": |
| | | // case "強陣雨": |
| | | // case "間中有驟雨": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | // break; |
| | | // case "阵雪": |
| | | // case "Snow Showers": |
| | | // case "陣雪": |
| | | // case "驟雪": |
| | | // case "小阵雪": |
| | | // case "Light Snow Showers": |
| | | // case "小陣雪": |
| | | // case "零散驟雪": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | // break; |
| | | // case "雾": |
| | | // case "Fog": |
| | | // case "霧": |
| | | // case "薄霧": |
| | | // case "冻雾": |
| | | // case "Freezing Fog": |
| | | // case "凍霧": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/18.png"; |
| | | // break; |
| | | // case "沙尘暴": |
| | | // case "Sandstorm": |
| | | // case "沙塵暴": |
| | | // case "强沙尘暴": |
| | | // case "Heavy Sandstorm": |
| | | // case "強沙塵暴": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/20.png"; |
| | | // break; |
| | | // case "浮尘": |
| | | // case "Dust": |
| | | // case "浮塵": |
| | | // case "尘卷风": |
| | | // case "Dust Storm": |
| | | // case "塵捲風": |
| | | // case "扬沙": |
| | | // case "Sand": |
| | | // case "揚沙": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/29.png"; |
| | | // break; |
| | | // case "霾": |
| | | // case "Haze": |
| | | // case "煙霞": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/45.png"; |
| | | // break; |
| | | // case "雷阵雨": |
| | | // case "Thundershower": |
| | | // case "雷陣雨": |
| | | // case "雷雨": |
| | | // case "雷电": |
| | | // case "Lightning": |
| | | // case "雷電": |
| | | // case "雷暴": |
| | | // case "Thunderstorm": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/4.png"; |
| | | // break; |
| | | // case "雷阵雨伴有冰雹": |
| | | // case "Thundershower with Hail": |
| | | // case "雷陣雨伴有冰雹": |
| | | // case "雷雨伴有冰雹": |
| | | // case "冰雹": |
| | | // case "Hail": |
| | | // case "冰针": |
| | | // case "Needle Ice": |
| | | // case "冰針": |
| | | // case "冰粒": |
| | | // case "Icy": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/5.png"; |
| | | // break; |
| | | // case "雨夹雪": |
| | | // case "Sleet": |
| | | // case "雨夾雪": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png"; |
| | | // break; |
| | | // case "小雨": |
| | | // case "Light Rain": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | // break; |
| | | // case "中雨": |
| | | // case "Rain": |
| | | // case "小到中雨": |
| | | // case "雨": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | // break; |
| | | // case "大雨": |
| | | // case "Heavy Rain": |
| | | // case "中到大雨": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | // break; |
| | | // case "暴雨": |
| | | // case "Rainstorm": |
| | | // case "豪雨": |
| | | // case "大暴雨": |
| | | // case "Heavy Rainstorm": |
| | | // case "大豪雨": |
| | | // case "特大暴雨": |
| | | // case "Extreme Rainstorm": |
| | | // case "超大豪雨": |
| | | // case "大到暴雨": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/3.png"; |
| | | // break; |
| | | // case "小雪": |
| | | // case "Light Snow": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | // break; |
| | | // case "雪": |
| | | // case "中雪": |
| | | // case "小到中雪": |
| | | // case "Snow": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | // break; |
| | | // case "大雪": |
| | | // case "Heavy Snow": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | // break; |
| | | // case "暴雪": |
| | | // case "Blizzard": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/13.png"; |
| | | // break; |
| | | // case "冻雨": |
| | | // case "Freezing Rain": |
| | | // case "凍雨": |
| | | // btnWeatherIcon.UnSelectedImagePath = "Public/AirIcon/6.png"; |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | //} |
| | |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(420), |
| | | Height = Application.GetRealWidth(420), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | |
| | | HorizontalScrolViewLayout tipValuesView = new HorizontalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(348), |
| | | Y = Application.GetRealWidth(348), |
| | | Width = Application.GetRealWidth(303), |
| | | Height = Application.GetRealHeight(30), |
| | | }; |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.GetSensorHistoryFailed), true); |
| | | IMessageCommon.Current.ShowErrorInfoAlter("", true, 2, Language.StringByID(StringId.GetSensorHistoryFailed),false); |
| | | //new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.GetSensorHistoryFailed), true); |
| | | }); |
| | | } |
| | | } |
| | |
| | | Y = Application.GetRealHeight(337), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | UnSelectedImagePath = fhTemp.GetModeImage(function) |
| | | UnSelectedImagePath = fhTemp.GetModeIconPath(function.GetAttrState(FunctionAttributeKey.Mode)) |
| | | }; |
| | | controlView.AddChidren(btnMode); |
| | | |
| | |
| | | } |
| | | bodyView.btnTemp.Text = updateTemp.GetAttrState(FunctionAttributeKey.SetTemp); |
| | | bodyView.btnIndoorTemp.Text = Language.StringByID(StringId.IndoorTemp) + Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.IndoorTemp))) + "°C"; |
| | | bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeImage(updateTemp); |
| | | bodyView.btnMode.UnSelectedImagePath = bodyView.fhTemp.GetModeIconPath(updateTemp.GetAttrState(FunctionAttributeKey.Mode)); |
| | | bodyView.arcBar.Progress = Convert.ToInt32(Convert.ToDouble(updateTemp.GetAttrState(FunctionAttributeKey.SetTemp))); |
| | | if (updateTemp.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | |
| | | <dict> |
| | | <key>SchemeUserState</key> |
| | | <dict> |
| | | <key>Blufi.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |
| | | <integer>0</integer> |
| | | </dict> |
| | | <key>HdlBluWi.xcscheme_^#shared#^_</key> |
| | | <dict> |
| | | <key>orderHint</key> |