| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.00008030-00014C392121802E" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" Line="45" Column="45" /> |
| | | </Files> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="FaceManagement" expanded="True"> |
| | | <Node name="FacePassagePage.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | <Node name="HDL-ON_iOS" selected="True" /> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <String>Shared.IOS.TBL/Shared.IOS.TBL.csproj</String> |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | <String>../Linphone/HDLLinphoneSDK_IOS/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK/Shared.IOS.HDLLinphoneSDK.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android AndroidDesignerPreferredDevice="Nexus 4" PreferredExecutionTarget="Android.Android_Accelerated_Oreo" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Release|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore /> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Electrical/IrFanPage.cs" line="42" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="431" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalSensorPage.cs" line="758" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/Transfer/TransferUserConfirmPage.cs" line="106" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/Light/RGBPageBLL.cs" line="168" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="481" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" line="541" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="314" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="492" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/FunctionList.cs" relfile="HDL_ON/Entity/FunctionList.cs" line="491" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" relfile="HDL_ON/UI/UI2/3-Intelligence/Scene/SetSceneFunctionInfoPage.cs" line="153" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Entity/Function/Scene.cs" relfile="HDL_ON/Entity/Function/Scene.cs" line="338" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2144" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | | </Properties> |
| | |
| | | 501=Security alarm: {0} is triggered. |
| | | 502=Clear the security alarm? |
| | | 503=Exceeding standard |
| | | 504=Secondary standard |
| | | 505=Class I standard |
| | | 504=Good |
| | | 505=Excellent |
| | | 506=Face input succeeded |
| | | 507=Face input failed |
| | | 508=Formaldehyde |
| | | 509=Please enter security name. |
| | | 510=Please select the deployment target. |
| | | |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 7101=*Please set the value in this range (1 ~ 100). |
| | | 7102=No set value. |
| | | 7103=Excellent: 0 ~ 35ug/m3 |
| | | 7104=Good: 35 ~ 75ug/m3 |
| | | 7105=Light pollution: 75 ~ 115ug/m3 |
| | | 7106=Moderate pollution: 115 ~ 150ug/m3 |
| | | 7104=Good: 36 ~ 75ug/m3 |
| | | 7105=Light pollution: 76 ~ 115ug/m3 |
| | | 7106=Moderate pollution: 116 ~ 150ug/m3 |
| | | 7107=Heavy pollution: > 150ug/m3 |
| | | 7108=Leak/No Leak |
| | | 7109=Leak |
| | |
| | | 7141=Exceeding |
| | | 7142=Serious |
| | | 7143=High |
| | | 7144=excellence |
| | | 7144=Excellence |
| | | 7145=Security |
| | | 7146=Add security |
| | | 7147=Arm |
| | | 7148=Disarm |
| | | 7149=Manually |
| | | 7150=Smart |
| | | 7151=Good |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | 503=超标 |
| | | 504=二级 |
| | | 505=一级 |
| | | 504=良好 |
| | | 505=优秀 |
| | | 506=人脸录入成功 |
| | | 507=人脸录入失败 |
| | | 508=甲醛 |
| | | 509=请输入安防名称。 |
| | | 510=请选择布防目标。 |
| | | |
| | | |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 7101=*请在这个范围(1~100)设置值。 |
| | | 7102=还没有设置值。 |
| | | 7103=优:0~35ug/m³ |
| | | 7104=良:35~75ug/m³ |
| | | 7105=轻度污染:75~115ug/m³ |
| | | 7106=中度污染:115~150ug/m³ |
| | | 7104=良:36~75ug/m³ |
| | | 7105=轻度污染:76~115ug/m³ |
| | | 7106=中度污染:116~150ug/m³ |
| | | 7107=重度污染:>150ug/m³ |
| | | 7108=泄漏/无泄漏 |
| | | 7109=泄漏 |
| | |
| | | 7148=撤防 |
| | | 7149=手动 |
| | | 7150=智能 |
| | | 7151=良好 |
| | | |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108273" android:versionName="1.2.202108273" package="com.hdl.onpro"> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202109021" android:versionName="1.2.202109021" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202108271</string> |
| | | <string>1.2.202100921</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.08271</string> |
| | | <string>1.2.09021</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 501=Security alarm: {0} is triggered. |
| | | 502=Clear the security alarm? |
| | | 503=Exceeding standard |
| | | 504=Secondary standard |
| | | 505=Class I standard |
| | | 504=Good |
| | | 505=Excellent |
| | | 506=Face input succeeded |
| | | 507=Face input failed |
| | | 508=Formaldehyde |
| | | 509=Please enter security name. |
| | | 510=Please select the deployment target. |
| | | |
| | | |
| | | 1000=Room Humidity |
| | | 1001=V-chip |
| | |
| | | 7101=*Please set the value in this range (1 ~ 100). |
| | | 7102=No set value. |
| | | 7103=Excellent: 0 ~ 35ug/m3 |
| | | 7104=Good: 35 ~ 75ug/m3 |
| | | 7105=Light pollution: 75 ~ 115ug/m3 |
| | | 7106=Moderate pollution: 115 ~ 150ug/m3 |
| | | 7104=Good: 36 ~ 75ug/m3 |
| | | 7105=Light pollution: 76 ~ 115ug/m3 |
| | | 7106=Moderate pollution: 116 ~ 150ug/m3 |
| | | 7107=Heavy pollution: > 150ug/m3 |
| | | 7108=Leak/No Leak |
| | | 7109=Leak |
| | |
| | | 7141=Exceeding |
| | | 7142=Serious |
| | | 7143=High |
| | | 7144=excellence |
| | | 7144=Excellence |
| | | 7145=Security |
| | | 7146=Add security |
| | | 7147=Arm |
| | | 7148=Disarm |
| | | 7149=Manually |
| | | 7150=Smart |
| | | 7151=Good |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 501=安防报警:{0}被触发。 |
| | | 502=是否解除安防警报? |
| | | 503=超标 |
| | | 504=二级 |
| | | 505=一级 |
| | | 504=良好 |
| | | 505=优秀 |
| | | 506=人脸录入成功 |
| | | 507=人脸录入失败 |
| | | 508=甲醛 |
| | | 509=请输入安防名称。 |
| | | 510=请选择布防目标。 |
| | | |
| | | |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 7101=*请在这个范围(1~100)设置值。 |
| | | 7102=还没有设置值。 |
| | | 7103=优:0~35ug/m³ |
| | | 7104=良:35~75ug/m³ |
| | | 7105=轻度污染:75~115ug/m³ |
| | | 7106=中度污染:115~150ug/m³ |
| | | 7104=良:36~75ug/m³ |
| | | 7105=轻度污染:76~115ug/m³ |
| | | 7106=中度污染:116~150ug/m³ |
| | | 7107=重度污染:>150ug/m³ |
| | | 7108=泄漏/无泄漏 |
| | | 7109=泄漏 |
| | |
| | | 7148=撤防 |
| | | 7149=手动 |
| | | 7150=智能 |
| | | 7151=良好 |
| | | |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public const int PleaseSelectTheDeploymentTarget = 510; |
| | | /// <summary> |
| | | /// 请输入安防名称 |
| | | /// </summary> |
| | | public const int PleaseEnterSecurityName = 509; |
| | | /// <summary> |
| | | /// 甲醛 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const int pmyou = 7103; |
| | | /// <summary> |
| | | /// 良:35~75ug/m³ |
| | | /// 良:36~75ug/m³ |
| | | /// </summary> |
| | | public const int pmliang = 7104; |
| | | /// <summary> |
| | | /// 轻度污染:75~115ug/m³ |
| | | /// 轻度污染:76~115ug/m³ |
| | | /// </summary> |
| | | public const int pmqingdu= 7105; |
| | | /// <summary> |
| | | /// 中度污染:115~150ug/m³ |
| | | /// 中度污染:116~150ug/m³ |
| | | /// </summary> |
| | | public const int pmzhongdu = 7106; |
| | | /// <summary> |
| | |
| | | /// smart:智能 |
| | | /// </summary> |
| | | public const int zhineng = 7150; |
| | | /// <summary> |
| | | /// 良好 |
| | | /// </summary> |
| | | public const int lianghao = 7151; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | Ins.GatewayId = device.device_mac; |
| | | } |
| | | reportIp = "239.0.168.188";// device.ip_address;//主播地址也能控制设备 |
| | | reportIp = device.ip_address;//主播地址也能控制设备//"239.0.168.188";// |
| | | } |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ReadStatus + "_reply" || |
| | |
| | | } |
| | | break; |
| | | case SPK.FloorHeatStandard: |
| | | localFunction.lastState = ""; |
| | | switch (localFunction.GetAttrState(FunctionAttributeKey.Mode)) |
| | | { |
| | | case "normal": |
| | |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | |
| | | HomePage.LoadEvent_RefreshEnvirIndoorHumi(); |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.ElectricSocket: |
| | | SocketPage.UpdataState(localFunction); |
| | |
| | | case SPK.ClothesHanger: |
| | | case SPK.AcIr: |
| | | case SPK.SenesorMegahealth: |
| | | case SPK.AirFreshStandard: |
| | | //设备状态推送 |
| | | //状态更新 |
| | | Stan.HdlDeviceStatuPushLogic.Current.UpdateDeviceStatu(updateTemp.sid, updateTemp.status); |
| | |
| | | case SPK.SensorTemperature: |
| | | byte[] tempBytes = new byte[] { receiveBytes[24], receiveBytes[25], receiveBytes[26], receiveBytes[27] }; |
| | | sensor.SetAttrState(FunctionAttributeKey.Value,Math.Round(BitConverter.ToSingle(tempBytes, 0), 1).ToString()); |
| | | sensor.SetAttrState(sensor.spk,Math.Round(BitConverter.ToSingle(tempBytes, 0), 1).ToString()); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 10).ToString()); |
| | | sensor.SetAttrState(sensor.spk, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 10).ToString()); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 100).ToString()); |
| | | sensor.SetAttrState(sensor.spk, (Convert.ToDouble(receiveBytes[24] * 256 + receiveBytes[25]) / 100).ToString()); |
| | | break; |
| | | case SPK.SensorPm25: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value,Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString()); |
| | | sensor.SetAttrState(sensor.spk,Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString()); |
| | | break; |
| | | case SPK.SensorCO2: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value, Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString()); |
| | | sensor.SetAttrState(sensor.spk, Convert.ToInt32(receiveBytes[24] * 256 + receiveBytes[25]).ToString()); |
| | | break; |
| | | } |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | case 1: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value,( (receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8]).ToString()); |
| | | sensor.SetAttrState(sensor.spk,( (receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8]).ToString()); |
| | | break; |
| | | case 2: |
| | | sensor.SetAttrState(FunctionAttributeKey.Value,( -1 * ((receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8])).ToString()); |
| | | sensor.SetAttrState(sensor.spk,( -1 * ((receiveBytes[5] * 256 * 256 * 256) + (receiveBytes[6] * 256 * 256) + (receiveBytes[7] * 256) + receiveBytes[8])).ToString()); |
| | | break; |
| | | case 3: |
| | | byte[] tempBytes = new byte[] { receiveBytes[5], receiveBytes[6], receiveBytes[7], receiveBytes[8] }; |
| | | sensor.SetAttrState(FunctionAttributeKey.Value,( Math.Round(BitConverter.ToSingle(tempBytes, 0), 1)).ToString()); |
| | | sensor.SetAttrState(sensor.spk,( Math.Round(BitConverter.ToSingle(tempBytes, 0), 1)).ToString()); |
| | | break; |
| | | } |
| | | switch (receiveBytes[4]) |
| | |
| | | { |
| | | var value = Convert.ToInt32(sensor.GetAttrState(FunctionAttributeKey.Value)); |
| | | sensor.SetAttrState(FunctionAttributeKey.Value, (value /= 100000).ToString()); |
| | | sensor.SetAttrState(sensor.spk, (value /= 100000).ToString()); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | A_EnvironmentalDataCenter.LoadEvent_UpdataStatus(sensor); |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(sensor); |
| | | } |
| | | } |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | |
| | | public const string Api_Post_GetSipInfo = ""; |
| | | /// <summary> |
| | | /// 人脸录入 |
| | | /// </summary> |
| | |
| | | public const string SensorHcho = "sensor.hcho"; |
| | | |
| | | /// <summary> |
| | | /// 环境传感器设备spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> EnvironDeviceSpkList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorTemperature); |
| | | spkList.Add(SensorPm25); |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | spkList.Add(SensorHcho); |
| | | return spkList; |
| | | } |
| | | /// <summary> |
| | | /// 环境传感器spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | |
| | | spkList.Add(SensorCO2); |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | spkList.Add(SensorHcho); |
| | | return spkList; |
| | | } |
| | |
| | | case FunctionAttributeKey.RoomTemp: |
| | | case FunctionAttributeKey.Brightness: |
| | | case FunctionAttributeKey.Percent: |
| | | int outT = 0; |
| | | int.TryParse(catchString,out outT); |
| | | if (outT < 0) |
| | | catchString = "0"; |
| | | if (catchString == "") |
| | | { |
| | | catchString = "0"; |
| | |
| | | _intervalValue.Add("33°C ~"); |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | _intervalValue.Add("0 ~ 0.6"); |
| | | _intervalValue.Add("0.61 ~ 2"); |
| | | _intervalValue.Add("2.01 ~ 5"); |
| | | _intervalValue.Add("5 ~"); |
| | | _intervalValue.Add("0 ~ 600"); |
| | | _intervalValue.Add("601 ~ 2000"); |
| | | _intervalValue.Add("2001 ~ 5000"); |
| | | _intervalValue.Add("5001 ~"); |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | _intervalValue.Add("70 ~"); |
| | |
| | | level = 2; |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values > 5000) |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | |
| | | level = 7; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | if (values < 0.6) |
| | | if (values < 600) |
| | | level = 1; |
| | | else if (values < 2) |
| | | else if (values < 2000) |
| | | level = 2; |
| | | else if (values < 5) |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values > 5) |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | |
| | | } |
| | | return level; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 当前等级 |
| | | /// </summary> |
| | | public int GetCurLevel(string spk,double values) |
| | | { |
| | | int level = 1; |
| | | switch (spk) |
| | | { |
| | | case SPK.SensorPm25: |
| | | if (values < 35) |
| | | level = 1; |
| | | else if (values < 75) |
| | | level = 2; |
| | | else if (values < 115) |
| | | level = 3; |
| | | else if (values > 115) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | if (values < 1000) |
| | | level = 1; |
| | | else if (values < 2000) |
| | | level = 2; |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorTemperature: |
| | | if (values < 18) |
| | | level = 1; |
| | | else if (values < 20) |
| | | level = 2; |
| | | else if (values < 25) |
| | | level = 3; |
| | | else if (values < 27) |
| | | level = 4; |
| | | else if (values < 30) |
| | | level = 5; |
| | | else if (values < 33) |
| | | level = 6; |
| | | else if (values > 33) |
| | | level = 7; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | if (values < 600) |
| | | level = 1; |
| | | else if (values < 2000) |
| | | level = 2; |
| | | else if (values < 5000) |
| | | level = 3; |
| | | else if (values >= 5000) |
| | | level = 4; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | if (values > 70) |
| | | level = 1; |
| | | else if (values > 40) |
| | | level = 2; |
| | | else if (values < 40) |
| | | level = 3; |
| | | break; |
| | | case SPK.SensorHcho: |
| | | if (values <= 0.08) |
| | | level = 1; |
| | | else if (values <= 0.1) |
| | | level = 2; |
| | | else |
| | | level = 3; |
| | | break; |
| | | } |
| | | return level; |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public List<Function> GetEnvirSensorsList() |
| | | { |
| | | var spkList = SPK.EnvironSpkList(); |
| | | var spkList = SPK.EnvironDeviceSpkList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | /// <summary> |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\CustomerObj.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\3-Intelligence\Automation\Security.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)DAL\ThirdPartySdk\HDLLinphone.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\EnvironmentalScience\A_EnvironmentalDataCenter.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0827"; |
| | | public static string VersionString = "1.2.0901"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | SPK.CurtainRoller,SPK.CurtainSwitch,SPK.CurtainTrietex, |
| | | SPK.AcIr,SPK.AcStandard, |
| | | SPK.FloorHeatStandard, |
| | | |
| | | SPK.AirFreshStandard, |
| | | SPK.AirSwitch, |
| | | }; |
| | | /// <summary> |
| | | /// 房间功能列表不加载的功能列表 |
| | |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | | //etAccount.Text = "18598273624"; |
| | | etAccount.Text = "fslcjm5@163.com"; |
| | | etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "tf@smarttech.com.ua"; |
| | | //etAccount.Text = "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" }, |
| | | new FunctionAttributes() { key = "rgb",value =new List<string>(){ "0","100" }, curValue="0,0,0",state = "0,0,0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | //new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | new FunctionAttributes() { key = "delay",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | if (temp.status == "enable") |
| | | { |
| | | btnSecurityStatus.IsSelected = true; |
| | | if (temp.alarm) |
| | | { |
| | | btnSecurityStatus.SelectedImagePath = "Collection/DefenseAlarmIcon.png"; |
| | | } |
| | | else |
| | | { |
| | | btnSecurityStatus.SelectedImagePath = "Collection/DefenseStatusIcon.png"; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | |
| | | #if DEBUG |
| | | |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.AirSwitch, |
| | | // name = "智能空开", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // }, |
| | | //}); |
| | | FunctionList.List.Functions.Add(new Function() |
| | | { |
| | | spk = SPK.AirSwitch, |
| | | name = "智能空开", |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | }, |
| | | }); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | |
| | | { |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | bodyView.btnSecurityStatus.IsSelected = false; |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | |
| | | btnName.TextID = StringId.EnvironmentalData; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var skipView = new EnvironmentalPage();// EnvironmentalSciencePage(); |
| | | //var skipView = new EnvironmentalPage();// EnvironmentalSciencePage(); |
| | | var skipView = new A_EnvironmentalDataCenter();// EnvironmentalSciencePage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | case SPK.ElectricTuyaWaterValve: |
| | | case SPK.ElectricTuyaWeepRobot: |
| | | case SPK.ClothesHanger: |
| | | case SPK.AirSwitch: |
| | | vv = ShowFunction.Electric; |
| | | break; |
| | | case SPK.AirFreshJinmao: |
| | |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | { |
| | | |
| | | LogicView.FunTypeView view = new LogicView.FunTypeView(); |
| | |
| | | }; |
| | | } |
| | | break; |
| | | //甲醛 |
| | | case SPK.SensorHcho: |
| | | { |
| | | ///hcho |
| | | LogicView.FunTypeView hchoView = new LogicView.FunTypeView(); |
| | | hchoView.btnText.TextID = StringId.Formaldehyde; |
| | | fLayout.AddChidren(hchoView.FLayoutView()); |
| | | ///hcho点击事件 |
| | | hchoView.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | PmCo2TvocAction(this, device, "hcho", StringId.Formaldehyde, index, edit); |
| | | |
| | | }; |
| | | } |
| | | break; |
| | | } |
| | | #region 保存 |
| | | ///保存View |
| | |
| | | /// <param name="index"></param> |
| | | /// <param name="edit"></param> |
| | | /// <param name="stateValue">编辑之前的状态值,默认为""</param> |
| | | public void PmCo2TvocAction(FrameLayout frame, Entity.Function device,string key,int title, int index, bool edit, string stateValue = "") |
| | | public void PmCo2TvocAction(FrameLayout frame, Entity.Function device, string key, int title, int index, bool edit, string stateValue = "") |
| | | { |
| | | if (edit) |
| | | { |
| | |
| | | dicSateteList = inputs.condition; |
| | | } |
| | | } |
| | | PublicInterface view = new PublicInterface(); |
| | | var listStr = view.GetViewList(key); |
| | | PublicInterface view = new PublicInterface(); |
| | | var listStr = view.GetViewList(key); |
| | | view.SingleSelectionShow(frame, listStr, Language.StringByID(title), view.GetString(key, stateValue) |
| | | , (text) => |
| | | { |
| | | |
| | | var value = view.GetValue(key, text); |
| | | selectedState = device.spk + "_"+ key; |
| | | AddDictionary(key, value, "integer","in"); |
| | | Save(device,index, edit); |
| | | selectedState = device.spk + "_" + key; |
| | | switch (device.spk) |
| | | { |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | case SPK.SensorCO2: |
| | | case SPK.SensorPm25: |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorHcho: |
| | | { |
| | | ///公司传感器key的健值是“value”; |
| | | key = "value"; |
| | | } |
| | | break; |
| | | } |
| | | AddDictionary(key, value, "integer", "in"); |
| | | Save(device, index, edit); |
| | | }); |
| | | } |
| | | /// <summary> |
| | |
| | | case SPK.AcStandard: |
| | | //地热 |
| | | case SPK.FloorHeatStandard: |
| | | //新风 |
| | | case SPK.AirFreshStandard: |
| | | {//开关灯 |
| | | foreach (var dic in dicList) |
| | | { |
| | |
| | | case SPK.SensorTemperature: |
| | | { |
| | | |
| | | string str =new InpOrOutLogicMethod { }.GetText(dicList); |
| | | string str =new InpOrOutLogicMethod { }.GetText(dicList, "temperature"); |
| | | inputView.btnState.Text = str; |
| | | } |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | { |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList); |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList, "humidity"); |
| | | inputView.btnState.Text = str; |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorCO2: |
| | | { |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList); |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList, "co2"); |
| | | inputView.btnState.Text = str; |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorPm25: |
| | | { |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList); |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList, "pm25"); |
| | | inputView.btnState.Text = str; |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | { |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList); |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList, "tvoc"); |
| | | inputView.btnState.Text = str; |
| | | |
| | | } |
| | | break; |
| | | case SPK.SensorHcho: |
| | | { |
| | | string str = new InpOrOutLogicMethod { }.GetText(dicList, "hcho"); |
| | | inputView.btnState.Text = str; |
| | | |
| | | } |
| | |
| | | if (device.spk == SPK.SensorEnvironment |
| | | || device.spk == SPK.SensorEnvironment2 |
| | | || device.spk == SPK.SensorEnvironment3 |
| | | || device.spk == SPK.SensorTemperature |
| | | || device.spk == SPK.SensorHumidity |
| | | || device.spk == SPK.SensorCO2 |
| | | || device.spk == SPK.SensorPm25 |
| | | || device.spk == SPK.SensorTVOC |
| | | ) |
| | | { |
| | | //这个设备比较特殊 |
| | |
| | | case "pm25": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); |
| | | |
| | | } |
| | | break; |
| | | case "tvoc": |
| | |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | | } |
| | | else if (device.spk == SPK.SensorTemperature) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "temperature", indexVulae); |
| | | |
| | | } |
| | | else if ( device.spk == SPK.SensorHumidity) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "humidity", indexVulae); |
| | | |
| | | } |
| | | else if (device.spk == SPK.SensorCO2) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "co2", indexVulae); |
| | | |
| | | } |
| | | else if (device.spk == SPK.SensorPm25) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "pm25", indexVulae); |
| | | |
| | | } |
| | | else if (device.spk == SPK.SensorTVOC) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "tvoc", indexVulae); |
| | | |
| | | } |
| | | else if (device.spk == SPK.SensorHcho) |
| | | { |
| | | |
| | | new InpOrOutLogicMethod().SensorView(thisView, device, "hcho", indexVulae); |
| | | |
| | | } |
| | | else |
| | |
| | | /// </summary> |
| | | /// <param name="dicList">状态数据列表</param> |
| | | /// <returns></returns> |
| | | private string GetText(List<Dictionary<string, string>> dicList) |
| | | private string GetText(List<Dictionary<string, string>> dicList,string key) |
| | | { |
| | | string strtext = ""; |
| | | foreach (var dic in dicList) |
| | | { |
| | | string key = dic["key"]; |
| | | string value = dic["value"]; |
| | | string comparator = dic["comparator"]; |
| | | switch (key) |
| | |
| | | strtext = Language.StringByID(StringId.tvoc) + new PublicInterface { }.GetString("tvoc", value); |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | strtext = Language.StringByID(StringId.Formaldehyde) + new PublicInterface { }.GetString("hcho", value); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | return strtext; |
| | | } |
| | | private void SensorView(FrameLayout thisView, Function device,string key, int indexVulae) { |
| | | //这个设备比较特殊 |
| | | ConditionDeviceFunList conditionDeviceFunList = new ConditionDeviceFunList(); |
| | | ///当前的索引值数据对象 |
| | | Input inputedit = Logic.currlogic.input[indexVulae]; |
| | | ///状态值 |
| | | string stateValue = ""; |
| | | foreach (var dic in inputedit.condition) |
| | | { |
| | | string comparator = dic["comparator"]; |
| | | stateValue = dic["value"]; |
| | | switch (key) |
| | | { |
| | | |
| | | case "temperature": |
| | | { |
| | | int titleInt = 0; |
| | | if (comparator == ">") |
| | | { |
| | | titleInt = StringId.wendugaoyu; |
| | | } |
| | | else if (comparator == "<") |
| | | { |
| | | titleInt = StringId.wendudiyu; |
| | | } |
| | | conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "humidity": |
| | | { |
| | | int titleInt = 0; |
| | | if (comparator == ">") |
| | | { |
| | | titleInt = StringId.shidugaoyu; |
| | | } |
| | | else if (comparator == "<") |
| | | { |
| | | titleInt = StringId.shidudiyu; |
| | | } |
| | | conditionDeviceFunList.InputBoxAction(device, titleInt, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "co2": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "co2", StringId.co2, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "pm25": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "pm25", StringId.pm25, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "tvoc", StringId.tvoc, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | conditionDeviceFunList.PmCo2TvocAction(thisView, device, "hcho", StringId.Formaldehyde, indexVulae, true, stateValue); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | case SPK.SensorCO2: |
| | | case SPK.SensorPm25: |
| | | case SPK.SensorTVOC: |
| | | case SPK.SensorHcho: |
| | | { |
| | | strPath = "LogicIcon/sensor.png"; |
| | | } |
| | |
| | | || device.spk == SPK.SensorCO2 |
| | | || device.spk == SPK.SensorPm25 |
| | | || device.spk == SPK.SensorTVOC |
| | | || device.spk == SPK.SensorHcho |
| | | ); |
| | | if (sensor != null) |
| | | { |
| | |
| | | functionTypeList.Add(SPK.SensorCO2); |
| | | functionTypeList.Add(SPK.SensorPm25); |
| | | functionTypeList.Add(SPK.SensorTVOC); |
| | | functionTypeList.Add(SPK.SensorHcho); |
| | | |
| | | |
| | | } |
| | |
| | | deviceTypeList.Add(SPK.CurtainRoller); |
| | | deviceTypeList.Add(SPK.CurtainTrietex); |
| | | deviceTypeList.Add(SPK.AcStandard); |
| | | deviceTypeList.Add(SPK.AirFreshStandard); |
| | | deviceTypeList.Add(SPK.FloorHeatStandard); |
| | | deviceTypeList.Add(SPK.SensorSmoke); |
| | | deviceTypeList.Add(SPK.SensorWater); |
| | |
| | | deviceTypeList.Add(SPK.SensorCO2); |
| | | deviceTypeList.Add(SPK.SensorPm25); |
| | | deviceTypeList.Add(SPK.SensorTVOC); |
| | | deviceTypeList.Add(SPK.SensorHcho); |
| | | |
| | | } |
| | | break; |
| | |
| | | case "tvoc": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(StringId.zhengchang)+ ":0~399mg/m3", |
| | | Language.StringByID(StringId.chaobiao)+ ":400~699mg/m3", |
| | | Language.StringByID(StringId.yanzhong)+":>700mg/m3", |
| | | Language.StringByID(StringId.zhengchang)+ ":0~399PPB", |
| | | Language.StringByID(StringId.chaobiao)+ ":400~699PPB", |
| | | Language.StringByID(StringId.yanzhong)+":>700PPB", |
| | | }; |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | list = new List<string> { |
| | | Language.StringByID(StringId.youxiu)+ ":(0~0.08mg/m3)", |
| | | Language.StringByID(StringId.lianghao)+":(0.09~0.1mg/m3)", |
| | | Language.StringByID(StringId.chaobiao)+ ":>(0.1mg/m3)", |
| | | }; |
| | | } |
| | | break; |
| | |
| | | public string GetString(string type, string strValue) |
| | | { |
| | | string text = ""; |
| | | int intValue = 0; |
| | | if (strValue != "") |
| | | { |
| | | intValue = int.Parse(strValue); |
| | | } |
| | | |
| | | switch (type) |
| | | { |
| | | case "pm25": |
| | | { |
| | | |
| | | if (intValue >= 0 && intValue <= 35) |
| | | { |
| | | text = Language.StringByID(StringId.pmyou); |
| | | switch (strValue) { |
| | | case "(0,35]": { |
| | | text = Language.StringByID(StringId.pmyou); |
| | | } |
| | | break; |
| | | case "(35,75]": { |
| | | text = Language.StringByID(StringId.pmliang); |
| | | } break; |
| | | case "(75,115]": { |
| | | text = Language.StringByID(StringId.pmqingdu); |
| | | } break; |
| | | case "(115,150]": { |
| | | text = Language.StringByID(StringId.pmzhongdu); |
| | | } break; |
| | | case "(151,100000]": { |
| | | text = Language.StringByID(StringId.pmzhongduwuran); |
| | | } break; |
| | | } |
| | | else if (intValue >35 && intValue <= 75) |
| | | { |
| | | text = Language.StringByID(StringId.pmliang); |
| | | } |
| | | else if (intValue > 75 && intValue <= 115) |
| | | { |
| | | text = Language.StringByID(StringId.pmqingdu); |
| | | } |
| | | else if (intValue >115 && intValue <= 150) |
| | | { |
| | | text = Language.StringByID(StringId.pmzhongdu); |
| | | } |
| | | else if (intValue > 150) |
| | | { |
| | | text = Language.StringByID(StringId.pmzhongduwuran); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | case "co2": |
| | | { |
| | | |
| | | if (intValue >= 0 && intValue <= 1000) |
| | | switch (strValue) |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang)+ ":0~1000PPM"; |
| | | } |
| | | else if (intValue > 1000 && intValue <= 2000) |
| | | { |
| | | text = Language.StringByID(StringId.piangao) + ":1001~2000PPM"; |
| | | } |
| | | else if (intValue > 2000) |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao) + ":>2000PPM"; |
| | | case "(0,1000]": |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang) + ":0~1000PPM"; |
| | | } |
| | | break; |
| | | case "(1000,2000]": |
| | | { |
| | | text = Language.StringByID(StringId.piangao) + ":1001~2000PPM"; |
| | | } |
| | | break; |
| | | case "(2000,200000]": |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao) + ":>2000PPM"; |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | switch (strValue) |
| | | { |
| | | case "(0,399]": |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang) + ":0~399PPB"; |
| | | } |
| | | break; |
| | | case "(399,699]": |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao) + ":400~699PPB"; |
| | | } |
| | | break; |
| | | case "(699,70000]": |
| | | { |
| | | text = Language.StringByID(StringId.yanzhong) + ":>700PPB"; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | if (intValue >=1 && intValue <= 3) |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | switch (strValue) |
| | | { |
| | | text = Language.StringByID(StringId.zhengchang) + ":0~399mg/m3"; |
| | | case "(0,0.08]": |
| | | { |
| | | text = Language.StringByID(StringId.youxiu) + ":(0~0.08mg/m3)"; |
| | | } |
| | | break; |
| | | case "(0.08,0.1]": |
| | | { |
| | | text = Language.StringByID(StringId.lianghao) + ":(0.09~0.1mg/m3)"; |
| | | } |
| | | break; |
| | | case "(0.1,10000]": |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao) + ":>(0.1mg/m3)"; |
| | | } |
| | | break; |
| | | } |
| | | else if (intValue >=4 && intValue<=6) |
| | | { |
| | | text = Language.StringByID(StringId.chaobiao) + ":400~699mg/m3"; |
| | | } |
| | | else if (intValue >= 7 && intValue <= 9) |
| | | { |
| | | text = Language.StringByID(StringId.yanzhong) + ":>700mg/m3"; |
| | | } |
| | | |
| | | } |
| | | break; |
| | | } |
| | |
| | | { |
| | | if (text == Language.StringByID(StringId.pmyou)) |
| | | { |
| | | value = "10"; |
| | | value = "(0,35]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmliang)) |
| | | { |
| | | value = "50"; |
| | | value = "(35,75]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmqingdu)) |
| | | { |
| | | value = "90"; |
| | | value = "(75,115]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmzhongdu)) |
| | | { |
| | | value = "130"; |
| | | value = "(115,150]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.pmzhongduwuran)) |
| | | { |
| | | value = "170"; |
| | | value = "(150,100000]"; |
| | | } |
| | | } |
| | | break; |
| | |
| | | { |
| | | if (text == Language.StringByID(StringId.zhengchang) + ":0~1000PPM") |
| | | { |
| | | value = "400"; |
| | | value = "(0,1000]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.piangao) + ":1001~2000PPM") |
| | | { |
| | | value = "1850"; |
| | | value = "(1000,2000]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.chaobiao) + ":>2000PPM") |
| | | { |
| | | value = "2200"; |
| | | value = "(2000,200000]"; |
| | | } |
| | | } |
| | | break; |
| | | case "tvoc": |
| | | { |
| | | if (text == Language.StringByID(StringId.zhengchang) + ":0~399mg/m3") |
| | | if (text == Language.StringByID(StringId.zhengchang) + ":0~399PPB") |
| | | { |
| | | value = "2"; |
| | | value = "(0,399]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.chaobiao) + ":400~699mg/m3") |
| | | else if (text == Language.StringByID(StringId.chaobiao) + ":400~699PPB") |
| | | { |
| | | value = "5"; |
| | | value = "(399,699]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.yanzhong) + ":>700mg/m3") |
| | | else if (text == Language.StringByID(StringId.yanzhong) + ":>700PPB") |
| | | { |
| | | value = "8"; |
| | | value = "(699,70000]"; |
| | | } |
| | | } |
| | | break; |
| | | case "hcho": |
| | | { |
| | | if (text == Language.StringByID(StringId.youxiu) + ":(0~0.08mg/m3)") |
| | | { |
| | | value = "(0,0.08]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.lianghao) + ":(0.09~0.1mg/m3)") |
| | | { |
| | | value = "(0.08,0.1]"; |
| | | } |
| | | else if (text == Language.StringByID(StringId.chaobiao) + ":>(0.1mg/m3)") |
| | | { |
| | | value = "(0.1,10000]"; |
| | | } |
| | | } |
| | | break; |
| | |
| | | |
| | | logicjArray.Add(logicIfon); |
| | | var jObject = new JObject { { "homeId", LogicMethod.CurrLogicMethod.HomeId }, { "logics", logicjArray } }; |
| | | |
| | | string str = jObject.ToString(); |
| | | responsePackNew = RequestServerhomeId(jObject, NewAPI.API_POST_Logic_Update,5); |
| | | //如果是token过期则刷新token |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | |
| | | } |
| | | case SPK.AcStandard: |
| | | case SPK.FloorHeatStandard: |
| | | case SPK.AirFreshStandard: |
| | | { |
| | | //做了一个特殊处理; |
| | | bool _bool = false; |
| | |
| | | } |
| | | } |
| | | break; |
| | | |
| | | } |
| | | outputDevice.status = dicSateteList; |
| | | |
| | |
| | | sceneFunctionView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(53), |
| | | Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 30), |
| | | Height = Application.GetRealHeight(667 - 64 - 49 - 52 + 0), |
| | | }; |
| | | scenePageView.AddChidren(sceneFunctionView); |
| | | LoadSceneFunctionControlZone(null); |
| | |
| | | } |
| | | else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent) |
| | | { |
| | | int outT = 0; |
| | | int.TryParse(sceneStatus.value, out outT); |
| | | if (outT < 0) |
| | | sceneStatus.value = "0"; |
| | | btnBrightnessText = btnFunctionText; |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public string address; |
| | | /// <summary> |
| | | /// 人脸状态 |
| | | /// 人脸录入状态 |
| | | /// 1:录入状态 |
| | | /// 2:下发成功 |
| | | /// 3:下发失败 |
| | | /// </summary> |
| | | public int faceStatus = 0; |
| | | /// <summary> |
| | | /// 人脸状态 |
| | | /// 人脸开启状态 |
| | | /// 1:开启状态 |
| | | /// 2:关闭状态 |
| | | /// 3:清除人脸数据 |
| | |
| | | /// 获取支持小区域 |
| | | /// </summary> |
| | | VerticalScrolViewLayout supportView; |
| | | /// <summary> |
| | | /// 获取支持文本 |
| | | /// </summary> |
| | | Button btnSupportText; |
| | | ///// <summary> |
| | | ///// 获取支持文本 |
| | | ///// </summary> |
| | | //Button btnSupportText; |
| | | |
| | | /// <summary> |
| | | /// 关于On文本 |
| | |
| | | if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare) |
| | | { |
| | | //supportView 加高 显示3行 3*44 |
| | | supportView.Height = Application.GetRealWidth(3*44); |
| | | supportView.Height = Application.GetRealWidth(2*44); |
| | | |
| | | FrameLayout smartSpeakerView = new FrameLayout() |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region 获取支持 |
| | | FrameLayout supView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealWidth(44), |
| | | }; |
| | | supportView.AddChidren(supView); |
| | | //FrameLayout supView = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealWidth(44), |
| | | //}; |
| | | //supportView.AddChidren(supView); |
| | | |
| | | Button btnSupportIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(12), |
| | | Y = Application.GetRealWidth(10), |
| | | Width = Application.GetMinRealAverage(24), |
| | | Height = Application.GetMinRealAverage(24), |
| | | UnSelectedImagePath = "PersonalCenter/SupportIcon.png", |
| | | }; |
| | | supView.AddChidren(btnSupportIcon); |
| | | //Button btnSupportIcon = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(12), |
| | | // Y = Application.GetRealWidth(10), |
| | | // Width = Application.GetMinRealAverage(24), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // UnSelectedImagePath = "PersonalCenter/SupportIcon.png", |
| | | //}; |
| | | //supView.AddChidren(btnSupportIcon); |
| | | |
| | | btnSupportText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(48), |
| | | Width = Application.GetRealWidth(270), |
| | | Height = Application.GetRealWidth(44), |
| | | TextID = StringId.GetSupport, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.TextFontSize |
| | | }; |
| | | supView.AddChidren(btnSupportText); |
| | | //btnSupportText = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(48), |
| | | // Width = Application.GetRealWidth(270), |
| | | // Height = Application.GetRealWidth(44), |
| | | // TextID = StringId.GetSupport, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextSize = CSS_FontSize.TextFontSize |
| | | //}; |
| | | //supView.AddChidren(btnSupportText); |
| | | |
| | | Button btnSupportRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(315), |
| | | Y = Application.GetRealWidth(14), |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | supView.AddChidren(btnSupportRight); |
| | | //Button btnSupportRight = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(315), |
| | | // Y = Application.GetRealWidth(14), |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | //}; |
| | | //supView.AddChidren(btnSupportRight); |
| | | |
| | | var btnSupportViewLine = new Button() |
| | | { |
| | | X = Application.GetRealWidth(48), |
| | | Y = Application.GetRealWidth(43), |
| | | Height = Application.GetRealHeight(1), |
| | | Width = Application.GetRealWidth(279), |
| | | BackgroundColor = CSS_Color.DividingLineColor |
| | | }; |
| | | supView.AddChidren(btnSupportViewLine); |
| | | //var btnSupportViewLine = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(48), |
| | | // Y = Application.GetRealWidth(43), |
| | | // Height = Application.GetRealHeight(1), |
| | | // Width = Application.GetRealWidth(279), |
| | | // BackgroundColor = CSS_Color.DividingLineColor |
| | | //}; |
| | | //supView.AddChidren(btnSupportViewLine); |
| | | #endregion |
| | | |
| | | #region 关于ON+ |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防部分事件 |
| | | /// 更新安防控件状态 |
| | | /// </summary> |
| | | void LoadEvent_SecurityEvent() |
| | | void LoadEvent_UpdataSenurityStatus() |
| | | { |
| | | if (btnResidenceArmIcon != null) |
| | | { |
| | | btnResidenceArmIcon.IsSelected = false; |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | foreach (var temp in FunctionList.List.securities) |
| | | { |
| | | if (temp.status == "enable") |
| | | { |
| | | if (temp.alarm) |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceInAlarmIcon.png"; |
| | | } |
| | | else |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png"; |
| | | } |
| | | btnResidenceArmIcon.IsSelected = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | btnResidenceArmIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | if (btnResidenceArmText != null) |
| | | lock (FunctionList.List.securities) |
| | | { |
| | | btnResidenceArmText.TextID = StringId.Undefense; |
| | | foreach (var temp in FunctionList.List.securities) |
| | |
| | | if (temp.status == "enable") |
| | | { |
| | | btnResidenceArmText.TextID = StringId.Defense; |
| | | if (temp.alarm) |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceInAlarmIcon.png"; |
| | | } |
| | | else |
| | | { |
| | | btnResidenceArmIcon.SelectedImagePath = "PersonalCenter/ResidenceDefenseIcon.png"; |
| | | } |
| | | btnResidenceArmIcon.IsSelected = true; |
| | | break; |
| | | } |
| | | } |
| | | btnResidenceArmText.MouseUpEventHandler = (sender, e) => |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 安防部分事件 |
| | | /// </summary> |
| | | void LoadEvent_SecurityEvent() |
| | | { |
| | | if (btnResidenceArmIcon != null&& btnResidenceArmText != null) |
| | | { |
| | | Action action = () =>{ |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | LoadEvent_UpdataSenurityStatus(); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | btnResidenceArmIcon.IsSelected = false; |
| | | LoadEvent_UpdataSenurityStatus(); |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var page = new ArmCenterPage(); |
| | | var page = new ArmCenterPage(action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnResidenceArmIcon.MouseUpEventHandler = eventHandler; |
| | | btnResidenceArmText.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | void LoadEvent_SkipGetSupportPage() |
| | | { |
| | | btnSupportText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var getsupportPage = new FAQHelpPage(); |
| | | MainPage.BasePageView.AddChidren(getsupportPage); |
| | | getsupportPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | //btnSupportText.MouseUpEventHandler = (sender, e) => |
| | | //{ |
| | | // var getsupportPage = new FAQHelpPage(); |
| | | // MainPage.BasePageView.AddChidren(getsupportPage); |
| | | // getsupportPage.LoadPage(); |
| | | // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | //}; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | }; |
| | | 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; |
| | |
| | | fanSpeedList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value; |
| | | btnFan.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ShowFanSelectView(); |
| | | //return; |
| | | //if ( !btnSwitch.IsSelected){return;} |
| | | //var curFanSpeedIndex = fanSpeedList.IndexOf(device.GetAttrState(FunctionAttributeKey.FanSpeed)); |
| | | //var sendFanSpeedIndex = curFanSpeedIndex == fanSpeedList.Count - 1 ? 0 : 1+curFanSpeedIndex; |
| | | |
| | | //device.SetAttrState(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | // d.Add(FunctionAttributeKey.FanSpeed, fanSpeedList[sendFanSpeedIndex]); |
| | | // Control.Ins.SendWriteCommand(device, d); |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | //RefreshFanSpeed(); |
| | | if (btnSwitch.IsSelected) |
| | | { |
| | | ShowFanSelectView(); |
| | | } |
| | | }; |
| | | //风速文本 |
| | | this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); |
| | |
| | | }); |
| | | } |
| | | |
| | | //if (fanAttr.value.Contains("low")) |
| | | //{ |
| | | // //1档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low" ? "FunctionIcon/AirFresh/Fan1Select.png" : "FunctionIcon/AirFresh/Fan1.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanOneGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "low"); |
| | | // }); |
| | | //} |
| | | |
| | | //if (fanAttr.value.Contains("medium")) |
| | | //{ |
| | | // //2档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium" ? "FunctionIcon/AirFresh/Fan2Select.png" : "FunctionIcon/AirFresh/Fan2.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanTwoGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "medium"); |
| | | // }); |
| | | //} |
| | | |
| | | //if (fanAttr.value.Contains("high")) |
| | | //{ |
| | | // //3档 |
| | | // var iconPath = this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high" ? "FunctionIcon/AirFresh/Fan3Select.png" : "FunctionIcon/AirFresh/Fan3.png"; |
| | | // menuContr.AddRowMenu(Language.StringByID(StringId.FanThreeGear), iconPath, this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high", () => |
| | | // { |
| | | // frameBack.Close(); |
| | | // //发送档位命令 |
| | | // this.SendOtherComand(this.btnFan, FunctionAttributeKey.FanSpeed, "high"); |
| | | // }); |
| | | //} |
| | | } |
| | | |
| | | #endregion |
| | |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | var dic = this.GetSendComandSample(); |
| | | dic[comadKey] = comadValue; |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | dic.Add(comadKey, comadValue); |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | btnIcon.CanClick = true; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | private Dictionary<string, string> GetSendComandSample() |
| | | { |
| | | var dic = new Dictionary<string, string>(); |
| | | //开关 |
| | | dic[FunctionAttributeKey.OnOff] = this.device.GetAttrState(FunctionAttributeKey.OnOff); |
| | | //风速 |
| | | dic[FunctionAttributeKey.FanSpeed] = this.device.GetAttrState(FunctionAttributeKey.FanSpeed); |
| | | |
| | | return dic; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请输入安防名称", |
| | | Text = Language.StringByID(StringId.PleaseEnterSecurityName),// = "请输入安防名称", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择布防目标", |
| | | Text = Language.StringByID(StringId.PleaseSelectTheDeploymentTarget),// "请选择布防目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | |
| | | /// </summary> |
| | | List<ArmDiyView> armDiyViewList = new List<ArmDiyView>(); |
| | | |
| | | |
| | | Action refreshAction = null; |
| | | |
| | | public ArmCenterPage(Action action) |
| | | { |
| | | refreshAction = action; |
| | | bodyView = this; |
| | | } |
| | | public ArmCenterPage() |
| | | { |
| | | bodyView = this; |
| | |
| | | InDefenseMode.alarm = false; |
| | | Control.Ins.ControlSecurity(InDefenseMode, "enable"); |
| | | }; |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DeleteSceneTip, action); |
| | | new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.ClearTheSecurityAlarmTip, action); |
| | | |
| | | } |
| | | }; |
| | |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = "撤防", |
| | | TextID = StringId.chefang,// = "撤防", |
| | | Radius = (uint)Application.GetRealWidth(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | disarmView.AddChidren(btnDisarm); |
| | | |
| | | btnDisarm.MouseUpEventHandler = (sender, e) => { |
| | | //foreach (var temp in FunctionList.List.securities) |
| | | //{ |
| | | // if (temp.status == "enable") |
| | | // { |
| | | // Control.Ins.ControlSecurity(temp, "disable"); |
| | | // break; |
| | | // } |
| | | //} |
| | | if(InDefenseMode!= null) |
| | | { |
| | | Control.Ins.ControlSecurity(InDefenseMode, "disable"); |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.refreshAction?.Invoke(); |
| | | |
| | | //布防 |
| | | if (updataTemp.status == "enable") |
| | | { |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "off", |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainStopIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainStopOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "stop", |
| | | }; |
| | | controlView.AddChidren(btnCurtainStop); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | IsSelected = function.trait_on_off.curValue.ToString() == "on", |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainCloseIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainCloseOnIcon.png", |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0" |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainOpenIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainOpenOnIcon.png", |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0" |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainDownIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainDownIconOn.png", |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) == "0", |
| | | }; |
| | | controlView.AddChidren(btnCurtainClose); |
| | | |
| | |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/Curtain/CurtainUpIcon.png", |
| | | SelectedImagePath = "FunctionIcon/Curtain/CurtainUpIconOn.png", |
| | | IsSelected = function.GetAttrState(FunctionAttributeKey.Percent) != "0", |
| | | }; |
| | | controlView.AddChidren(btnCurtainOpen); |
| | | |
| | |
| | | }; |
| | | controlView.AddChidren(btnSwitch); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh,false); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Electric)).LoadTopView_FunctionTop(function, actionRefresh); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(function); |
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 A_EnvironmentalDataCenter : FrameLayout |
| | | { |
| | | |
| | | #region 控件集合 |
| | | static A_EnvironmentalDataCenter bodyView; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnRoom; |
| | | /// <summary> |
| | | /// 房间选择下拉图标 |
| | | /// </summary> |
| | | Button btnFoorDownIcon; |
| | | /// <summary> |
| | | /// 房间选择触发区域 |
| | | /// </summary> |
| | | Button btnRoomClickRow; |
| | | /// <summary> |
| | | /// 传感器列表区域 |
| | | /// </summary> |
| | | FrameLayout sensorListView; |
| | | |
| | | VerticalScrolViewLayout sensorListContentView; |
| | | |
| | | /// <summary> |
| | | /// 天气名称文本 |
| | | /// </summary> |
| | | Button btnWatherText; |
| | | /// <summary> |
| | | /// 湿度数据文本 |
| | | /// </summary> |
| | | Button btnHumidityText; |
| | | /// <summary> |
| | | /// pm25数据文本 |
| | | /// </summary> |
| | | Button btnPm25Values; |
| | | /// <summary> |
| | | /// 风速数据文本 |
| | | /// </summary> |
| | | Button btnFanSpeedValues; |
| | | |
| | | |
| | | |
| | | List<SensorView> sensorViewList = new List<SensorView>(); |
| | | #endregion |
| | | #region 区域变量 |
| | | Room room; |
| | | |
| | | Sensor sensorTemp = new Sensor(); |
| | | /// <summary> |
| | | /// 传感器分类列表 |
| | | /// </summary> |
| | | Dictionary<string, List<Function>> sensorList = new Dictionary<string, List<Function>>(); |
| | | #endregion |
| | | |
| | | |
| | | public A_EnvironmentalDataCenter() |
| | | { |
| | | 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 = $"{MainPage.cityInfo.highestTemperature}°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 = $"{MainPage.cityInfo.lowestTemperature}°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 |
| | | sensorListContentView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(400), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(sensorListContentView); |
| | | sensorListView = new FrameLayout(); |
| | | sensorListContentView.AddChidren(sensorListView); |
| | | |
| | | LoadSenesorList(); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | //LoadEventList(); |
| | | LoadDialog_ChangeRoom(); |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.EnvironmentalScience)).LoadTopView(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSenesorList() |
| | | { |
| | | sensorListView.RemoveAll(); |
| | | sensorViewList.Clear(); |
| | | |
| | | sensorList = new Dictionary<string, List<Function>>(); |
| | | int index = 0; |
| | | foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | { |
| | | foreach (var sensorAttr in sensor.attributes) |
| | | { |
| | | if (SPK.EnvironSpkList().Contains(sensorAttr.key) || sensorAttr.key == "value") |
| | | { |
| | | var flag = sensorAttr.key; |
| | | if (flag == "value") |
| | | { |
| | | flag = sensor.spk.Replace("sensor.", ""); |
| | | } |
| | | var newTemp = new Function() |
| | | { |
| | | name = sensor.name, |
| | | sid = sensor.sid, |
| | | deviceId = sensor.deviceId, |
| | | roomIds = sensor.roomIds, |
| | | spk = "sensor."+ flag, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = sensorAttr.state, curValue = sensorAttr.curValue } |
| | | , new FunctionAttributes {key = "spk",state = sensorAttr.key,curValue = sensorAttr.key } } |
| | | }; |
| | | //分类加入集合 |
| | | if (sensorList.ContainsKey(flag)) |
| | | { |
| | | sensorList[flag].Add(newTemp); |
| | | } |
| | | else |
| | | { |
| | | sensorList.Add(flag, new List<Function>() { newTemp }); |
| | | } |
| | | } |
| | | } |
| | | |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Control.Ins.SendReadCommand(sensor); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | |
| | | foreach(var sensorAssemble in sensorList) |
| | | { |
| | | var showList = sensorAssemble.Value; |
| | | if(room.roomId != "") |
| | | { |
| | | showList = sensorAssemble.Value.FindAll((obj) => obj.roomIds.Contains(room.roomId)); |
| | | } |
| | | if (showList != null && showList.Count > 0) |
| | | { |
| | | var sensorView = new SensorView(showList,index); |
| | | sensorListView.AddChidren(sensorView); |
| | | sensorViewList.Add(sensorView); |
| | | sensorView.LoadView(); |
| | | |
| | | index++; |
| | | } |
| | | } |
| | | sensorListView.Height = Application.GetRealWidth(124 * (index + 1) / 2); |
| | | } |
| | | |
| | | |
| | | /// <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(() => |
| | | { |
| | | try |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | foreach (var sensorAttr in updateTemp.attributes) |
| | | { |
| | | if (SPK.EnvironSpkList().Contains(sensorAttr.key) || sensorAttr.key == "value") |
| | | { |
| | | var flag = sensorAttr.key; |
| | | if (flag == "value") |
| | | { |
| | | flag = updateTemp.spk.Replace("sensor.", ""); |
| | | } |
| | | |
| | | foreach (var view in bodyView.sensorViewList) |
| | | { |
| | | if (view.Tag.ToString() == flag) |
| | | { |
| | | view.UpdataStatus(flag,updateTemp.sid, sensorAttr.state); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"更新环境传感器界面异常:{ex.Message}"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | 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 |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | public class SensorView :FrameLayout |
| | | { |
| | | Button btnSensorValues; |
| | | Button btnLevel; |
| | | |
| | | List<Function> sensorList = new List<Function>(); |
| | | string imagePath = ""; |
| | | string iconPath = ""; |
| | | string sensorSPK = ""; |
| | | Sensor sensorTemp = new Sensor(); |
| | | double assembleValues = 0.0; |
| | | |
| | | public SensorView(List<Function> showList, int index)//,,string spk,double value) |
| | | { |
| | | sensorList = showList; |
| | | sensorSPK = showList[0].spk; |
| | | foreach (var s in showList) |
| | | { |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value")); |
| | | } |
| | | |
| | | |
| | | this.X = Application.GetRealWidth(7); |
| | | this.Width = Application.GetRealWidth(182); |
| | | this.Height = Application.GetRealWidth(124); |
| | | this.Y = Application.GetRealWidth(124 * (index / 2)); |
| | | this.Tag = sensorSPK; |
| | | |
| | | if (index % 2 != 0) |
| | | { |
| | | this.X = Application.GetRealWidth(189); |
| | | } |
| | | |
| | | |
| | | switch (sensorSPK) |
| | | { |
| | | 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; |
| | | case SPK.SensorHcho: |
| | | imagePath = "FunctionIcon/EnvirSensor/HchoBg.png"; |
| | | iconPath = "FunctionIcon/EnvirSensor/HchoIcon.png"; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | public void LoadView() |
| | | { |
| | | Function sensor = sensorList[0]; |
| | | this.BackgroundImagePath = imagePath; |
| | | |
| | | var btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(23), |
| | | Y = Application.GetRealHeight(17), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = iconPath |
| | | }; |
| | | this.AddChidren(btnIcon); |
| | | |
| | | btnIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor,sensorList); |
| | | 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", |
| | | }; |
| | | this.AddChidren(btnInfoIcon); |
| | | btnInfoIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | LoadInfo(sensorSPK); |
| | | }; |
| | | |
| | | var curLevel = sensorTemp.GetCurLevel(sensorSPK, assembleValues); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensorSPK); |
| | | btnLevel = new Button() |
| | | { |
| | | X = Application.GetRealWidth(25), |
| | | Y = Application.GetRealWidth(59), |
| | | Width = Application.GetRealWidth(100), |
| | | Height = Application.GetRealWidth(32), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = sensorTemp.GetLevelColorList(sensorSPK)[curLevel - 1], |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = levelTextList[curLevel - 1], |
| | | Tag = "SensorLevel", |
| | | }; |
| | | this.AddChidren(btnLevel); |
| | | |
| | | btnLevel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor,sensorList); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | |
| | | |
| | | 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 = assembleValues.ToString(), |
| | | Tag = "SensorValues" |
| | | }; |
| | | this.AddChidren(btnSensorValues); |
| | | btnSensorValues.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | #region |
| | | var esp = new EnvironmentalSensorPage(sensor,sensorList); |
| | | MainPage.BasePageView.AddChidren(esp); |
| | | esp.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | #endregion |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载传感器等级相关信息 |
| | | /// </summary> |
| | | void LoadInfo(string sensorSPK) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensorSPK); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensorSPK); |
| | | 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 (sensorSPK) |
| | | { |
| | | 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(PPB)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | | break; |
| | | case SPK.SensorHumidity: |
| | | btnTitle.Text = Language.StringByID(StringId.Humidity) + "(%)"; |
| | | break; |
| | | case SPK.SensorHcho: |
| | | btnTitle.Text = Language.StringByID(StringId.Formaldehyde) + "(mg/m3)"; |
| | | 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(sensorSPK)[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(); |
| | | } |
| | | |
| | | |
| | | |
| | | public void calculateAverage() |
| | | { |
| | | assembleValues = 0; |
| | | foreach (var s in sensorList) |
| | | { |
| | | assembleValues += Convert.ToDouble(s.GetAttrState("value")); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新状态 |
| | | /// </summary> |
| | | /// <param name="updateTemp"></param> |
| | | public void UpdataStatus(string spk ,string sid,string value) |
| | | { |
| | | try |
| | | { |
| | | if (spk == sensorSPK) |
| | | { |
| | | var temp = sensorList.Find((obj) => obj.sid == sid); |
| | | if(temp!= null) |
| | | { |
| | | temp.SetAttrState("value", value); |
| | | } |
| | | calculateAverage(); |
| | | |
| | | |
| | | btnSensorValues.Text = assembleValues.ToString(); |
| | | |
| | | var curLevel = sensorTemp.GetCurLevel(sensorSPK, assembleValues); |
| | | |
| | | btnLevel.TextID = sensorTemp.GetLevelTextList(sensorSPK)[curLevel- 1]; |
| | | btnLevel.TextColor = sensorTemp.GetLevelColorList(sensorSPK)[curLevel - 1]; |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"更新环境传感器界面异常:{ex.Message}"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | btnTitle.Text = Language.StringByID(StringId.Temp) + "(°C)"; |
| | | break; |
| | | case SPK.SensorTVOC: |
| | | btnTitle.Text = "TVOC(mg/m3)"; |
| | | btnTitle.Text = "TVOC(PPB)"; |
| | | break; |
| | | case SPK.SensorCO2: |
| | | btnTitle.Text = "CO2(PPM)"; |
| | |
| | | |
| | | Function function; |
| | | List<Function> showFunctions; |
| | | List<Function> sensorList; |
| | | /// <summary> |
| | | /// 当前查询类型 |
| | | /// </summary> |
| | |
| | | { |
| | | bodyView = this; |
| | | function = ss; |
| | | showFunctions = new List<Function>(); |
| | | showFunctions.Add(ss); |
| | | sensorList = FunctionList.List.GetEnvirSensorsList(); |
| | | } |
| | | |
| | | |
| | | public EnvironmentalSensorPage(Function ss,List<Function> functions) |
| | | { |
| | | bodyView = this; |
| | | function = ss; |
| | | sensorList = functions; |
| | | showFunctions = new List<Function>(); |
| | | showFunctions.Add(ss); |
| | | } |
| | |
| | | |
| | | bool initTitleButton = true; |
| | | |
| | | var tempList = FunctionList.List.GetEnvirSensorsList(); |
| | | |
| | | foreach (var tempSensor in tempList) |
| | | foreach (var tempSensor in sensorList) |
| | | { |
| | | if (tempSensor.sid == function.sid) |
| | | { |
| | |
| | | } |
| | | |
| | | var sensorType = sr.spk.Split(".")[1]; |
| | | var queryType = sr.GetAttrState("spk")==null? "value": sr.GetAttrState("spk"); |
| | | var queryType = sr.GetAttrState("spk").ToString(); |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, queryType); |
| | | if (revertObj != null) |
| | |
| | | view.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | btnLocationInfoRight.MouseUpEventHandler = eventHandler; |
| | | if (btnLocationInfoRight != null) |
| | | { |
| | | btnLocationInfoRight.MouseUpEventHandler = eventHandler; |
| | | } |
| | | btnLocationValues.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | |
| | | controlView.AddChidren(btnMaxValuesText); |
| | | #endregion |
| | | |
| | | #region 渐变时间调节 |
| | | var btnGradualChangeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(375), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.SpeedOfChange, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeText); |
| | | #region 渐变时间调节 |
| | | var btnGradualChangeText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = Application.GetRealHeight(375), |
| | | Width = Application.GetRealWidth(224), |
| | | Height = Application.GetRealHeight(21), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextID = StringId.SpeedOfChange, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeText); |
| | | |
| | | var btnGradualChangeMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnGradualChangeText.Bottom+ Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(22), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMinValuesText); |
| | | var btnGradualChangeMinValuesText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(35), |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(22), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "0s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMinValuesText); |
| | | |
| | | barFadeTime = new DiyImageSeekBar() |
| | | { |
| | | X = btnGradualChangeMinValuesText.Right, |
| | | Y = Application.GetRealHeight(412 - 21), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | //SeekBarBackgroundColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarUnitSring = "s", |
| | | MaxValue = 10, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | barFadeTime = new DiyImageSeekBar() |
| | | { |
| | | X = btnGradualChangeMinValuesText.Right, |
| | | Y = Application.GetRealHeight(412 - 21), |
| | | Width = Application.GetRealWidth(210), |
| | | Height = Application.GetRealHeight(54), |
| | | SeekBarViewHeight = Application.GetRealHeight(8), |
| | | ThumbImagePath = "Public/ThumbImage.png", |
| | | ThumbImageHeight = Application.GetRealHeight(54), |
| | | ProgressBarColor = CSS_Color.MainColor, |
| | | //SeekBarBackgroundColor = CSS_Color.MainColor, |
| | | ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | ProgressBarUnitSring = "s", |
| | | MaxValue = 10, |
| | | Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)), |
| | | SeekBarPadding = Application.GetRealWidth(20), |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(barFadeTime); |
| | | |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | | X = barFadeTime.Right, |
| | | Y = btnGradualChangeText.Bottom+ Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(35), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "10s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | #endregion |
| | | var btnGradualChangeMaxValuesText = new Button() |
| | | { |
| | | X = barFadeTime.Right, |
| | | Y = btnGradualChangeText.Bottom + Application.GetRealHeight(10), |
| | | Width = Application.GetRealWidth(35), |
| | | Height = Application.GetRealHeight(21), |
| | | Text = "10s", |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null, |
| | | }; |
| | | controlView.AddChidren(btnGradualChangeMaxValuesText); |
| | | #endregion |
| | | |
| | | btnRestoredPoint = new Button() |
| | | { |
| | |
| | | function.SetAttrState(FunctionAttributeKey.Brightness, dimmerBar.Progress); |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Brightness, dimmerBar.Progress.ToString()); |
| | | |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | function.SetAttrState(FunctionAttributeKey.FadeTime, barFadeTime.Progress); |
| | | }; |
| | | dimmerBar.OnProgressChangedEvent = (sender, e) => { |
| | | //function.fadeTime = 0; |