2021-08-20 09:06:44
人脸通行管理界面
安防界面
青萍传感器
| | |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget." /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/MainPage.cs"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.220222E9-B9CA-4834-9318-2BC22465F050" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs"> |
| | | <Files> |
| | | <File FileName="HDL-ON_iOS/Resources/Language.ini" Line="2050" Column="6" /> |
| | | <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="33" Column="23" /> |
| | | <File FileName="HDL_ON/Entity/Enumerative/Command.cs" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Packet.cs" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPageBLL.cs" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/RegisterPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/RegisterPageBLL.cs" /> |
| | | <File FileName="HDL_ON/Common/Utlis.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Electrical/TuyaAirCleanerPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/1ContorlPage/AirFreshControlPage.cs" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs" Line="492" Column="50" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="302" Column="78" /> |
| | | <File FileName="HDL_ON/Common/R.cs" Line="1618" Column="39" /> |
| | | <File FileName="HDL_ON/UI/UI1-Login/LoginPage.cs" Line="1236" Column="74" /> |
| | | <File FileName="HDL-ON_Android/Assets/Language.ini" Line="2138" Column="1" /> |
| | | <File FileName="HDL-ON_iOS/Info.plist" /> |
| | | <File FileName="HDL_ON/UI/MainPage.cs" Line="28" Column="55" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/Light/RelayPageBLL.cs" Line="66" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" Line="217" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/4-PersonalCenter/FaceManagement/FacePassagePage.cs" Line="114" Column="55" /> |
| | | <File FileName="HDL_ON/Common/R.cs" Line="10" Column="47" /> |
| | | <File FileName="HDL-ON_iOS/Resources/Language.ini" Line="479" Column="30" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | | <State name="__root__"> |
| | | <Node name="HDL_APP_Project" expanded="True"> |
| | | <Node name="HDL-ON_iOS" expanded="True" /> |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Server" expanded="True" /> |
| | | </Node> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI1-Login" expanded="True" /> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="2-Classification" expanded="True" /> |
| | | <Node name="3-Intelligence" expanded="True" /> |
| | | <Node name="4-PersonalCenter" expanded="True"> |
| | | <Node name="AddFunction" expanded="True" /> |
| | | <Node name="FaceManagement" expanded="True"> |
| | | <Node name="FacePassagePage.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="PirDevice" expanded="True" /> |
| | | <Node name="RoomListManage" expanded="True" /> |
| | | </Node> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True" /> |
| | | <Node name="Light" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Assets" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Light" expanded="True" /> |
| | | </Node> |
| | | <Node name="PersonalCenter" expanded="True"> |
| | | <Node name="FacePassage" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Resources" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="FunctionIcon" expanded="True"> |
| | | <Node name="Light" expanded="True"> |
| | | <Node name="LightScene" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="PersonalCenter" expanded="True" /> |
| | | <Node name="Public" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | | </Pad> |
| | |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/Common/ApiUtlis.cs" relfile="HDL_ON/Common/ApiUtlis.cs" line="390" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Mqtt/MqttClient.cs" relfile="HDL_ON/DAL/Mqtt/MqttClient.cs" line="422" 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="747" 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/EnvironmentalScience/EnvironmentalPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/EnvironmentalScience/EnvironmentalPage.cs" line="348" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddFunction/AddDevciePage.cs" line="54" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
| | |
| | | 479=Speed |
| | | 480=Environmental sensor |
| | | 481=Can start using environmental sensor |
| | | |
| | | 482=Gas sensor |
| | | 483=Please enter the MAC code of the device |
| | | 484=Open |
| | | 485=Check/Modify |
| | | 486=Defense function / Alarm status |
| | | 487=Alarm target after triggering |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 479=风速 |
| | | 480=环境传感器 |
| | | 481=可以开始使用环境传感器了 |
| | | 482=燃气传感器 |
| | | 483=请输入设备的MAC码 |
| | | 484=开启 |
| | | 485=查看/修改 |
| | | 486=布防功能/报警状态 |
| | | 487=触发后告警目标 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\irfan.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\AddDevice\EnvironmentalSensorbg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorenvironment.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\AirFresh\AirFreshBgIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorenvironment2.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\sensorenvironment3.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\AddDevice\EnvirSensorQingpingCGS1bg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\AddDevice\EnvirSensorQingpingLitebg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmCenter\AddTargetIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\ArmCenter\RightIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\PersonalCenter\FacePassage\FaceIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\LightScene\CheckIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\LightScene\CheckOnIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Light\LightScene\SetLightSceneIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\BindScene.png" /> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Folder Include="Assets\Phone\FunctionIcon\IrFan\" /> |
| | | <Folder Include="Assets\Phone\PersonalCenter\FacePassage\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Light\LightScene\" /> |
| | | </ItemGroup> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107211" android:versionName="1.2.202107211" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108171" android:versionName="1.2.202108171" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | | <!--网络访问--> |
| | |
| | | <Folder Include="Resources\Phone\FunctionIcon\Energy\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\IrFan\" /> |
| | | <Folder Include="Assets.xcassets\device_bg.imageset\" /> |
| | | <Folder Include="Resources\Phone\FunctionIcon\Light\LightScene\" /> |
| | | <Folder Include="Resources\Phone\PersonalCenter\FacePassage\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <InterfaceDefinition Include="LaunchScreen.storyboard" /> |
| | |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irfan_white.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorenvironment.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\AddDevice\EnvironmentalSensorbg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\AirFresh\AirFreshBgIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\AddDevice\EnvirSensorQingpingCGS1bg.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\AddDevice\EnvirSensorQingpingLitebg.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorenvironment2.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\sensorenvironment3.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\LightScene\CheckIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\LightScene\CheckOnIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Light\LightScene\SetLightSceneIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\AddTargetIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\ArmCenter\RightIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\PersonalCenter\FacePassage\FaceIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202108041</string> |
| | | <string>1.2.202108171</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.08041</string> |
| | | <string>1.2.08171</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | 414=Controller on |
| | | 415=Someone |
| | | 416=Log |
| | | 417=Water Leakage |
| | | 417=Water leakage |
| | | 418=In Alarm |
| | | 419=Normal |
| | | 420=Hot dry |
| | |
| | | 479=Speed |
| | | 480=Environmental sensor |
| | | 481=Can start using environmental sensor |
| | | 482=Gas sensor |
| | | 483=Please enter the MAC code of the device |
| | | 484=Open |
| | | 485=Check/Modify |
| | | 486=Defense function / Alarm status |
| | | 487=Alarm target after triggering |
| | | 488=Face passage |
| | | 489=Apply face ID to: |
| | | 490=Community access control |
| | | 491=About face ID and privacy |
| | | 492=Erase data |
| | | 493=Reset face ID |
| | | 494=Set face ID |
| | | 495=Face passage settings |
| | | |
| | | |
| | | |
| | |
| | | 479=风速 |
| | | 480=环境传感器 |
| | | 481=可以开始使用环境传感器了 |
| | | |
| | | 482=燃气传感器 |
| | | 483=请输入设备的MAC码 |
| | | 484=开启 |
| | | 485=查看/修改 |
| | | 486=布防功能/报警状态 |
| | | 487=触发后告警目标 |
| | | 488=人脸通行 |
| | | 489=将面容ID应用于: |
| | | 490=社区门禁通行 |
| | | 491=关于面容ID与隐私 |
| | | 492=抹掉数据 |
| | | 493=重置面容 |
| | | 494=设置面容 |
| | | 495=人脸通行设置 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | { |
| | | public static class StringId |
| | | { |
| | | public const int FacePassageSetting = 495; |
| | | /// <summary> |
| | | /// 设置面容 |
| | | /// </summary> |
| | | public const int SetFace = 494; |
| | | /// <summary> |
| | | /// 重置面容 |
| | | /// </summary> |
| | | public const int ResetFace = 493; |
| | | /// <summary> |
| | | /// 抹除数据 |
| | | /// </summary> |
| | | public const int EraseData = 492; |
| | | /// <summary> |
| | | /// 关于面容ID与隐私 |
| | | /// </summary> |
| | | public const int AboutFaceIdAndPrivacy = 491; |
| | | /// <summary> |
| | | /// 社区门禁通行 |
| | | /// </summary> |
| | | public const int CommunityAccessControl = 490; |
| | | /// <summary> |
| | | /// 将面容ID应用于: |
| | | /// </summary> |
| | | public const int ApplyFaceIdTo = 489; |
| | | /// <summary> |
| | | /// 人脸通行 |
| | | /// </summary> |
| | | public const int FacePassage = 488; |
| | | /// <summary> |
| | | /// 触发后告警目标 |
| | | /// </summary> |
| | | public const int AlarmTargetAfterTriggering = 487; |
| | | /// <summary> |
| | | /// 布防功能/报警状态 |
| | | /// </summary> |
| | | public const int DefenseFunctionArmState = 486; |
| | | /// <summary> |
| | | /// 查看/修改 |
| | | /// </summary> |
| | | public const int CheckModify = 485; |
| | | /// <summary> |
| | | /// 开启 |
| | | /// </summary> |
| | | public const int OpenArm = 484; |
| | | /// <summary> |
| | | /// 请输入wifi-mac码 |
| | | /// </summary> |
| | | public const int PlsEntryMacCode = 483; |
| | | /// <summary> |
| | | /// 燃气传感器 |
| | | /// </summary> |
| | | public const int SensorGas = 482; |
| | | /// <summary> |
| | | /// 可以开始使用环境传感器了 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public const string SearchLoaclGatewayReply = "/user/all/custom/gateway/search_reply"; |
| | | /// <summary> |
| | | /// 网关广播数据 |
| | | /// </summary> |
| | | public const string GatewayBroadcast = "/user/all/custom/gateway/broadcast"; |
| | | /// <summary> |
| | | /// 调试软件上传oid列表 |
| | | /// </summary> |
| | | public const string AddDeviceOids = "/user/onpro/custom/device/add"; |
| | |
| | | public class Control |
| | | { |
| | | |
| | | |
| | | static Control _control; |
| | | public static Control Ins |
| | | { |
| | |
| | | } |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 安防控制 |
| | | /// </summary> |
| | | public void ControlArm() |
| | | { |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //var pack = httpServer.GetSecurityAlarmLogList |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 发送命令 |
| | |
| | | //} |
| | | receiveObj.BodyDataString = res[1]; |
| | | |
| | | if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply) |
| | | if (receiveObj.Topic == CommunicationTopic.SearchLoaclGatewayReply || receiveObj.Topic == CommunicationTopic.GatewayBroadcast) |
| | | { |
| | | |
| | | var bodyJObj = Newtonsoft.Json.JsonConvert.DeserializeObject<ResponsePack>(res[1]); |
| | | if (bodyJObj == null) |
| | | { |
| | |
| | | EnvironmentalPage.LoadEvent_UpdataStatus(localFunction); |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | if (localFunction.GetAttributes().Contains(FunctionAttributeKey.Temperature)) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | |
| | | /// <summary> |
| | | /// 发送数据,不需要等待回复 |
| | | /// </summary> |
| | | public void ControlBytesSend(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, int sendCount = 3) |
| | | public void ControlBytesSend(Command command, byte subnetID, byte deviceID, byte[] gatewayBytes, int sendCount = 3,bool reSend = false) |
| | | { |
| | | #if DEBUG |
| | | string ddd = ""; |
| | |
| | | SubnetID = subnetID, |
| | | DeviceID = deviceID, |
| | | AddData = gatewayBytes, |
| | | }, sendCount, false); |
| | | }, 3, true); |
| | | //}, sendCount, reSend); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <param name="commandString"></param> |
| | | /// <returns></returns> |
| | | public void WriteBusData(Function function, Dictionary<string, string> commandDictionary) |
| | | public void WriteBusData(Function function, Dictionary<string, string> commandDictionary,bool reSend = false) |
| | | { |
| | | try |
| | | { |
| | |
| | | .WithCleanSession() |
| | | .WithProtocolVersion(MQTTnet.Formatter.MqttProtocolVersion.V311) |
| | | .WithCommunicationTimeout(new TimeSpan(0, 0, 10)) |
| | | //.WithCommunicationTimeout (new TimeSpan (0, 0, 5)) |
| | | //.WithCommunicationTimeout (new TimeSpan (0, 1, 0)) |
| | | .Build(); |
| | | |
| | | await DisConnectRemoteMqttClient("StartRemoteMqtt"); |
| | |
| | | /// </summary> |
| | | public const string API_POST_FL_HangUp = "/home-wisdom/app/fl/vi/hang-up"; |
| | | /// <summary> |
| | | /// 获取通话记录 |
| | | /// </summary> |
| | | //public const string API_POST_FL_GetCallList = "/home-wisdom/app/fl/vi/list"; |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | /// <summary> |
| | | /// 删除通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_DeleteCallInfo = "/home-wisdom/app/fl/vi/delete"; |
| | |
| | | /// 更改通话状态 |
| | | /// </summary> |
| | | public const string API_POST_VideoDevice_UpdateCallStatus = "/home-wisdom/platform/imou/updateCallStatus"; |
| | | /// <summary> |
| | | /// 获取通话记录 |
| | | /// </summary> |
| | | public const string API_POST_FL_GetCallList = "/home-wisdom/platform/imou/listCallRecords"; |
| | | #endregion |
| | | |
| | | |
| | |
| | | /// <summary> |
| | | /// 普通场景 |
| | | /// </summary> |
| | | OrdinaryScenes = 1, |
| | | OrdinaryScenes = 0, |
| | | /// <summary> |
| | | /// 电影changing |
| | | /// 电影场景 |
| | | /// </summary> |
| | | MovieScene = 2, |
| | | MovieScene = 1, |
| | | /// <summary> |
| | | /// 灯光场景 |
| | | /// </summary> |
| | | LightScene = 2, |
| | | } |
| | | /// <summary> |
| | | /// 功能类型 |
| | |
| | | spkList.Add(SensorDoorWindow); |
| | | spkList.Add(SensorSmoke); |
| | | spkList.Add(SensorWater); |
| | | //spkList.Add(SensorGas); |
| | | spkList.Add(SensorGas); |
| | | //spkList.Add(SensorShanLan); |
| | | //spkList.Add(SensorDuiShe); |
| | | //spkList.Add(SensoruUtrasonic); |
| | |
| | | /// 该spk功能是环境传感器功能的集成 |
| | | /// </summary> |
| | | public const string SensorEnvironment = "sensor.environment"; |
| | | /// <summary> |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment2 = "sensor.environment2"; |
| | | /// <summary> |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment3 = "sensor.environment3"; |
| | | |
| | | /// <summary> |
| | | /// 环境传感器spk列表 |
| | |
| | | spkList.Add(SensorTVOC); |
| | | spkList.Add(SensorHumidity); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | return spkList; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 环境传感器设备列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> EvironmentSensorList() |
| | | { |
| | | var spkList = new List<string>(); |
| | | spkList.Add(SensorEnvironment); |
| | | spkList.Add(SensorEnvironment2); |
| | | spkList.Add(SensorEnvironment3); |
| | | return spkList; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion |
| | | |
| | |
| | | public string group = "1"; |
| | | /// <summary> |
| | | /// 场景类型 |
| | | /// 0:普通 |
| | | /// 1:电影 |
| | | /// 2:调光 |
| | | /// </summary> |
| | | public SceneType sceneType = SceneType.OrdinaryScenes; |
| | | /// <summary> |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | |
| | | /// <summary> |
| | | /// 安防输入 |
| | | /// </summary> |
| | | public class SecurityInput |
| | | public class SecurityInput |
| | | { |
| | | /// <summary> |
| | | /// 输入条件(功能)的sid |
| | |
| | | /// 安防输入条件 |
| | | /// </summary> |
| | | public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | | /// <summary> |
| | | /// 对应的功能对象 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Function GetFunction() |
| | | { |
| | | if (_function == null) |
| | | { |
| | | _function = FunctionList.List.Functions.Find((obj) => obj.sid == sid); |
| | | } |
| | | return _function; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 状态文本 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string StateText () |
| | | { |
| | | string text = ""; |
| | | switch(GetFunction().spk) |
| | | { |
| | | case SPK.SensorGas: |
| | | case SPK.SensorSmoke: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | { |
| | | text += Language.StringByID(StringId.InAlarm) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorPir: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | { |
| | | text += Language.StringByID(StringId.youren) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | { |
| | | text += Language.StringByID(StringId.wuren) + " "; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorWater: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | { |
| | | text += Language.StringByID(StringId.WaterLeakage) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | foreach (var con in condition) |
| | | { |
| | | if (con.value == "true") |
| | | { |
| | | text += Language.StringByID(StringId.Open) + " "; |
| | | } |
| | | else if (con.value == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Close) + " "; |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | |
| | | return text; |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | /// <summary> |
| | | /// 控制目标类型 |
| | | /// 设备:0,场景1,自动化2 |
| | | /// 0:设备 |
| | | /// 1:场景 |
| | | /// 2:自动化 |
| | | /// </summary> |
| | | public string target_type; |
| | | public string target_type ="0"; |
| | | /// <summary> |
| | | /// 输出目标的sid |
| | | /// </summary> |
| | |
| | | /// 安防输出状态 |
| | | /// </summary> |
| | | public List<SecurityOutputStatus> status = new List<SecurityOutputStatus>(); |
| | | |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | Function _function = null; |
| | | /// <summary> |
| | | /// 对应的功能对象 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public Function GetFunction() |
| | | { |
| | | if (_function == null) |
| | | { |
| | | _function = FunctionList.List.Functions.Find((obj) => obj.sid == sid); |
| | | } |
| | | return _function; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 状态文本 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public string StateText() |
| | | { |
| | | string text = ""; |
| | | if (target_type == "0") |
| | | { |
| | | switch (GetFunction().spk) |
| | | { |
| | | case SPK.LightDimming: |
| | | case SPK.LightCCT: |
| | | case SPK.LightRGB: |
| | | case SPK.LightSwitch: |
| | | foreach (var state in status) |
| | | { |
| | | if (state.key == FunctionAttributeKey.Brightness) |
| | | { |
| | | if (state.value == "0") |
| | | { |
| | | text = Language.StringByID(StringId.Close); |
| | | } |
| | | else |
| | | { |
| | | text = Language.StringByID(StringId.Open); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | }else if(target_type == "1") |
| | | { |
| | | |
| | | } |
| | | |
| | | return text; |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 安防输出状态 |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\Buttons.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorEnvironment\SensorEnvironmentManagerPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorEnvironment\AddSensorEnvironmentPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\1ContorlPage\AirFreshRelayControlPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmSensor\SensorGasPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorEnvironment\AddQingpingSensorEnvirTipPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\LightScene\AddLightScene.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\FacePassagePage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorMegahealth\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\MiniRemoteControl\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\AddDevice\SenesorEnvironment\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\LightScene\" />
|
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\FaceManagement\" />
|
| | | </ItemGroup>
|
| | | </Project> |
| | |
| | | /// <summary> |
| | | /// 版本号 |
| | | /// </summary> |
| | | public static string VersionString = "1.2.0721"; |
| | | public static string VersionString = "1.2.0817"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | { |
| | | if (view != null) |
| | | { |
| | | if(view.Tag.ToString() != "unlockpage") |
| | | if(view.Tag!=null ) |
| | | { |
| | | if (view.Tag.ToString() != "unlockpage") |
| | | { |
| | | view.RemoveFromParent(); |
| | | }else |
| | | { |
| | | result = 2; |
| | | } |
| | | }else |
| | | { |
| | | view.RemoveFromParent(); |
| | | } |
| | |
| | | smPage.ShowColltionButton = false; |
| | | smPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.SensorGas: |
| | | var gasPage = new SensorGasPage(); |
| | | gasPage.ShowColltionButton = false; |
| | | gasPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.ClothesHanger: |
| | | var clothesHangerpage = new ClothesHangerPage(); |
| | | clothesHangerpage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | |
| | | var airFresh1 = new AirFreshControlPage(); |
| | | airFresh1.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | case SPK.AirFreshStandard: |
| | | var airFresh2 = new AirFreshRelayControlPage(); |
| | | airFresh2.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | break; |
| | | } |
| | | }; |
| | | return eventHandler; |
| | |
| | | //etAccount.Text = "18022428438";//wjc |
| | | //etAccount.Text = "13602944661";//kx |
| | | //etAccount.Text = "13226233133";//豆豆 |
| | | //etAccount.Text = "18316672920";//lcg "18316672920";//hzx;// "13415629083"//cf;; |
| | | //etAccount.Text = "18316672920";//lcg "18316672920";//hzx;// ""//cf;; |
| | | //etAccount.Text = "18316120654";//tujie |
| | | // "15622703419"lwn;// "18824864143";//"464027401@qq.com"; //"2791308028@qq.com";//13697499568 |
| | | etAccount.Text = "15626203746"; |
| | |
| | | //etAccount.Text = "464027401@qq.com";// |
| | | //etAccount.Text = "15217626103";// |
| | | //etAccount.Text = "13682244600";//波哥 |
| | | //etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | //etAccount.Text = "2949126848@qq.com";//陈琳 |
| | | //etAccount.Text = "13168123446"; |
| | | //etAccount.Text = "13415629083"; |
| | | //etAccount.Text = "13676202754";//巴林服务器 |
| | | //etAccount.Text = "13602944661";//kx |
| | | etAccount.Text = "551775569@qq.com";//wcf |
| | | //etAccount.Text = "551775569@qq.com";//wcf |
| | | //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | //etAccount.Text = "15217626103";//昆明金茂项目 |
| | | etAccount.Text = "15217626103";//昆明金茂项目 |
| | | //etAccount.Text = "18598273624"; |
| | | } |
| | | b = !b; |
| | | etPassword.Text = "123456"; |
| | | if(etAccount.Text == "15626203746") |
| | | { |
| | | etPassword.Text = "12345678"; |
| | | etPassword.Text = "123456"; |
| | | } |
| | | //etPassword.Text = "Hdl85521566"; |
| | | btnLogin.IsSelected = true; |
| | | }; |
| | | #endif |
| | |
| | | frameRow.AddChidren(agreeView); |
| | | if(Language.CurrentLanguage == "Chinese") |
| | | { |
| | | agreeView.X = Application.GetRealWidth(82); |
| | | agreeView.X = Application.GetRealWidth(52); |
| | | } |
| | | //同意图标按钮 |
| | | var agreeBtn = new Button() |
| | |
| | | #region 环境数据 |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | var enviList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | var enviList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => SPK.EvironmentSensorList().Contains(obj.spk)); |
| | | foreach (var enviTemp in enviList) |
| | | { |
| | | var humiAttr = enviTemp.attributes.Find((obj) => obj.key == "humidity"); |
| | |
| | | |
| | | |
| | | #if DEBUG |
| | | //FunctionList.List.Functions.Add(new Function() |
| | | //{ |
| | | // spk = SPK.AirFreshStandard, |
| | | // name = "测试新风", |
| | | // attributes = new List<FunctionAttributes>() |
| | | // { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | | // new FunctionAttributes(){ key = "fan",curValue= "on",state = "on" ,value = new List<string>(){ "high","low" } }, |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() { |
| | | // spk = SPK.SensorGas, |
| | | // name = "燃气传感器", |
| | | // attributes = new List<FunctionAttributes> () |
| | | // { |
| | | // new FunctionAttributes(){ key = "enable",curValue= "true",state = "true" ,value = new List<string>(){ "true", "false" } }, |
| | | // new FunctionAttributes(){ key = "status",curValue= "normal",state = "normal" ,value = new List<string>(){ "alarm", "normal" } }, |
| | | |
| | | // }, |
| | | //}); |
| | | |
| | | //FunctionList.List.Functions.Add(new Function() { spk = SPK.PjtIr, name = "测试投影仪", |
| | | // attributes = new List<FunctionAttributes>() { |
| | | // new FunctionAttributes(){ key = "on_off",curValue= "on",state = "on" }, |
| | |
| | | if (bodyView != null) |
| | | { |
| | | var humiSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorHumidity); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => SPK.EvironmentSensorList().Contains(obj.spk )); |
| | | foreach (var enviTemp in enviSensorList) |
| | | { |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "humidity"); |
| | |
| | | if (bodyView != null) |
| | | { |
| | | var tempSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorTemperature); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => obj.spk == SPK.SensorEnvironment); |
| | | var enviSensorList = FunctionList.List.GetEnvirSensorsList().FindAll((obj) => SPK.EvironmentSensorList().Contains(obj.spk)); |
| | | foreach (var enviTemp in enviSensorList) |
| | | { |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); |
| | |
| | | { |
| | | GetEditState(device, index, view.btnState, null, null, null); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | //干接点 |
New file |
| | |
| | | using System; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddQingpingSensorEnvirTipPage : EditorCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | |
| | | /// <summary> |
| | | /// 添加设备完成之后的回调事件 |
| | | /// </summary> |
| | | public Action<Function> AddDeviceEvent = null; |
| | | |
| | | IntegratedBrandDevice integratedDevice = null; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | /// <summary> |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建) |
| | | /// </summary> |
| | | public void ShowForm(IntegratedBrandDevice device) |
| | | { |
| | | integratedDevice = device; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | //设置头部信息 |
| | | base.SetTitleText(Language.StringByID(StringId.Add) + device.productName); |
| | | } |
| | | else |
| | | { |
| | | base.SetTitleText(Language.StringByID(StringId.Add) + " " + device.productName); |
| | | } |
| | | //这个界面的背景需要白色 |
| | | bodyFrameLayout.BackgroundColor = UI.CSS.CSS_Color.MainBackgroundColor; |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化中部信息 |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | { |
| | | //图片 |
| | | var btnPic = new PicViewControl(132, 132); |
| | | btnPic.Y = Application.GetRealHeight(69); |
| | | btnPic.Gravity = Gravity.CenterHorizontal; |
| | | if(integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingLitebg.png"; |
| | | }else if (integratedDevice.spk == SPK.SensorEnvironment2) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingCGS1bg.png"; |
| | | } |
| | | bodyFrameLayout.AddChidren(btnPic); |
| | | |
| | | //请输入设备机上的sn码 |
| | | var textView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(309 - 64), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(144), |
| | | }; |
| | | bodyFrameLayout.AddChidren(textView); |
| | | |
| | | Button btnTipTitle = new Button() |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | Text = "请下载“青萍+”APP为设备配置网络", |
| | | IsBold = true, |
| | | IsMoreLines = true, |
| | | Height = Application.GetRealHeight(30), |
| | | }; |
| | | textView.AddChidren(btnTipTitle); |
| | | if(Language.CurrentLanguage != "Chinese") |
| | | { |
| | | btnTipTitle.Text = "Please download the 'Qingping +' app to configure the network for the device"; |
| | | } |
| | | Button btnTipMsg = new Button() |
| | | { |
| | | Y = btnTipTitle.Bottom, |
| | | TextAlignment = TextAlignment.TopCenter, |
| | | TextColor = CSS.CSS_Color.PromptingColor1, |
| | | TextSize = CSS.CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = @"网络配置完成后,点击该设备查看数据页面,{0}点击右上角设置功能{0}找到“WIFI - MAC”并复制改MAC码", |
| | | IsMoreLines = true, |
| | | Height = Application.GetRealHeight(80), |
| | | }; |
| | | textView.AddChidren(btnTipMsg); |
| | | if (Language.CurrentLanguage != "Chinese") |
| | | { |
| | | btnTipMsg.Text = @"After the network configuration is completed, click the device to view the data page,{0}Click the setting function in the upper right corner{0}Find ‘wifi-mac' and copy the modified MAC code"; |
| | | } |
| | | btnTipMsg.Text = btnTipMsg.Text.Replace("{0}", "\r\n"); |
| | | //下一步 |
| | | var btnNext = this.AddBottomClickButton(Language.StringByID(StringId.Next)); |
| | | btnNext.ButtonClickEvent += (sender, e) => |
| | | { |
| | | var form2 = new AddSensorEnvironmentPage(); |
| | | form2.AddForm(integratedDevice); |
| | | form2.AddDeviceEvent = AddDeviceEvent; |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 关闭界面___________________________ |
| | | |
| | | /// <summary> |
| | | /// 关闭界面 |
| | | /// </summary> |
| | | public override void CloseFormBefore() |
| | | { |
| | | this.AddDeviceEvent = null; |
| | | base.CloseFormBefore(); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 添加毫米波步骤1界面 |
| | | /// 添加环境传感器步骤1界面 |
| | | /// </summary> |
| | | public class AddSensorEnvironmentPage : EditorCommonForm |
| | | { |
| | |
| | | /// </summary> |
| | | public Action<Function> AddDeviceEvent = null; |
| | | |
| | | IntegratedBrandDevice integratedDevice = null; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | |
| | | /// </summary> |
| | | public void ShowForm(IntegratedBrandDevice device) |
| | | { |
| | | integratedDevice = device; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | //设置头部信息 |
| | |
| | | var btnPic = new PicViewControl(132, 132); |
| | | btnPic.Y = Application.GetRealHeight(69); |
| | | btnPic.Gravity = Gravity.CenterHorizontal; |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png"; |
| | | if (integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingLitebg.png"; |
| | | } |
| | | else if (integratedDevice.spk == SPK.SensorEnvironment2) |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvirSensorQingpingCGS1bg.png"; |
| | | } |
| | | else |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png"; |
| | | } |
| | | bodyFrameLayout.AddChidren(btnPic); |
| | | |
| | | //请输入设备机上的sn码 |
| | |
| | | }; |
| | | textView.AddChidren(editText); |
| | | |
| | | Button btnScan = new Button() |
| | | if (integratedDevice.spk == SPK.SensorEnvironment2 || integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(275), |
| | | UnSelectedImagePath = "Public/Scan.png" |
| | | }; |
| | | textView.AddChidren(btnScan); |
| | | btnScan.MouseUpEventHandler = (sender, e) => |
| | | editText.PlaceholderText = Language.StringByID(StringId.PlsEntryMacCode); |
| | | } |
| | | if (integratedDevice.spk == SPK.SensorEnvironment) |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | Button btnScan = new Button() |
| | | { |
| | | editText.Text = scanString; |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | Gravity = Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(275), |
| | | UnSelectedImagePath = "Public/Scan.png" |
| | | }; |
| | | textView.AddChidren(btnScan); |
| | | btnScan.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Scan.OpenScan((scanString) => |
| | | { |
| | | editText.Text = scanString; |
| | | }); |
| | | }; |
| | | } |
| | | //下一步 |
| | | var btnNext = this.AddBottomClickButton(Language.StringByID(StringId.Next)); |
| | | btnNext.ButtonClickEvent += (sender, e) => |
| | |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | var pack = pm.IndependentRegister3TyDevcie(SPK.SensorEnvironment, snCode, Language.StringByID(StringId.SensorEnvironment)); |
| | | var pack = pm.IndependentRegister3TyDevcie(integratedDevice.spk, snCode, Language.StringByID(StringId.SensorEnvironment)); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | //var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<IntegratedBrandDevice>>(pack.Data.ToString()); |
| | |
| | | |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | btnTip.Text = "该设备已添加到安防传感器类别,可到对应功能板块查看"; |
| | | btnTip.Text = "该设备已添加到传感器类别,可到对应功能板块查看"; |
| | | } |
| | | else |
| | | { |
| | | btnTip.Text = "The device has been added to the security sensor category, which can be viewed in the corresponding function block."; |
| | | btnTip.Text = "The device has been added to the sensor category, which can be viewed in the corresponding function block."; |
| | | } |
| | | |
| | | var btnDel = new Button() |
| | |
| | | this.RemoveFromParent(); |
| | | }; |
| | | break; |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | var form3 = new AddQingpingSensorEnvirTipPage(); |
| | | form3.AddForm(device); |
| | | form3.AddDeviceEvent = (functionObj) => { |
| | | refreshView.BeginHeaderRefreshing(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | break; |
| | | } |
| | | }; |
| | | } |
| | |
| | | }; |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | var smPage1 = new SensorEnvironmentManagerPage(); |
| | | smPage1.AddForm(device); |
| | | smPage1.DelDeviceEvent = () => |
New file |
| | |
| | | using System; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class FacePassagePage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 面容id |
| | | /// </summary> |
| | | string faceid = ""; |
| | | |
| | | public FacePassagePage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.FacePassage)).LoadTopView(); |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | |
| | | var contentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667-64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | var topView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(189), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(topView); |
| | | |
| | | var btnFaceIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(20), |
| | | Width = Application.GetRealWidth(102), |
| | | Height = Application.GetRealWidth(102), |
| | | UnSelectedImagePath = "PersonalCenter/FacePassage/FaceIcon.png", |
| | | }; |
| | | topView.AddChidren(btnFaceIcon); |
| | | |
| | | var btnText1 = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealWidth(54), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.ApplyFaceIdTo, |
| | | IsBold = true, |
| | | }; |
| | | topView.AddChidren(btnText1); |
| | | |
| | | topView.AddChidren(new Button() { Height = 1,BackgroundColor = CSS_Color.DividingLineColor,Y = Application.GetRealHeight(188) ,X = Application.GetRealWidth(16),Width = Application.GetRealWidth(359)}); |
| | | |
| | | #region 社区门禁通行 |
| | | var communityRow = new FrameLayout() |
| | | { |
| | | Y = topView.Bottom, |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(communityRow); |
| | | |
| | | var btnCommunityTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(300), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.CommunityAccessControl, |
| | | }; |
| | | communityRow.AddChidren(btnCommunityTitle); |
| | | |
| | | |
| | | var btnCommunityAccessControlIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(314), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(48), |
| | | Height = Application.GetMinRealAverage(36), |
| | | UnSelectedImagePath = "Public/Switch.png", |
| | | SelectedImagePath = "Public/SwitchOn.png", |
| | | }; |
| | | communityRow.AddChidren(btnCommunityAccessControlIcon); |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | var btnTip = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(270), |
| | | Height = Application.GetRealHeight(48), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.AboutFaceIdAndPrivacy |
| | | }; |
| | | contentView.AddChidren(btnTip); |
| | | |
| | | |
| | | var btnSetFaceId = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(539), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.SetFace, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnSetFaceId); |
| | | |
| | | if (string.IsNullOrEmpty(faceid)) |
| | | { |
| | | } |
| | | else |
| | | { |
| | | btnSetFaceId.TextID = StringId.ResetFace; |
| | | |
| | | var btnEraseData = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(481), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextID = StringId.EraseData, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnEraseData); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | using System; |
| | | using System; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | Button btnAddResidenceScan; |
| | | #endregion |
| | | |
| | | |
| | | #region 个人选项-人脸通讯管理 |
| | | /// <summary> |
| | | /// 个人选项-人脸通行管理行 |
| | | /// </summary> |
| | | FrameLayout faceManagementView; |
| | | /// <summary> |
| | | /// 人脸通行管理文本 |
| | | /// </summary> |
| | | Button btnFaceManagementText; |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | |
| | | /// </summary> |
| | | optionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(51 * 6), |
| | | Height = Application.GetRealHeight(51 * (6+1)), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | | }; |
| | |
| | | }); |
| | | }; |
| | | |
| | | optionListView.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | |
| | | |
| | | #region 个人选项-人脸通行管理 |
| | | faceManagementView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | }; |
| | | optionListView.AddChidren(faceManagementView); |
| | | |
| | | var btnFaceManagementRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementRight); |
| | | |
| | | btnFaceManagementText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.FacePassageSetting, |
| | | }; |
| | | faceManagementView.AddChidren(btnFaceManagementText); |
| | | |
| | | btnFaceManagementText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var page = new FacePassagePage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 解锁设置区域 |
| | |
| | | //确认过户{0}的管理员账号给账号{1} |
| | | string msg = Language.StringByID(StringId.TransferreConfirmMsg2).Replace("{0}", Entity.DB_ResidenceData.Instance.CurrentRegion.homeName); |
| | | msg = msg.Replace("{1}", btnName.Text); |
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, Language.StringByID(StringId.TransferreConfirmMsg2), () => |
| | | HdlMessageLogic.Current.ShowMassage(ShowMsgType.Confirm, msg, () => |
| | | { |
| | | var form = new TransferingResidenceForm(); |
| | | form.AddForm(this.accountInfo); |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AirFreshRelayControlPage : DeviceFunctionCardCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | /// <summary> |
| | | /// 风速图标控件 |
| | | /// </summary> |
| | | private IconViewControl btnFan = null; |
| | | /// <summary> |
| | | /// 风速文本控件 |
| | | /// </summary> |
| | | private NormalViewControl btnFanView = null; |
| | | /// <summary> |
| | | /// 开关图标 |
| | | /// </summary> |
| | | private IconViewControl btnSwitch = null; |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | |
| | | /// <summary> |
| | | /// 初始化白色区域的内容 |
| | | /// </summary> |
| | | public override void InitFrameWhiteContent() |
| | | { |
| | | base.SetTitleText(Language.StringByID(StringId.AirFresh)); |
| | | |
| | | //刷新当前设备的状态缓存 |
| | | this.RefreshNowDeviceStatuMemory(this.device); |
| | | //初始化第一个索引页的内容 |
| | | this.InitFrameWhiteContent1(); |
| | | |
| | | Control.Ins.SendReadCommand(device); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化第一个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | //一个背景图片 |
| | | var framePic = new FrameLayout(); |
| | | framePic.Y = Application.GetRealHeight(87); |
| | | framePic.Width = this.GetPictrueRealSize(247); |
| | | framePic.Height = this.GetPictrueRealSize(247); |
| | | framePic.Gravity = Gravity.CenterHorizontal; |
| | | framePic.BackgroundImagePath = "FunctionIcon/AirFresh/AirFreshBgIcon.png"; |
| | | this.FrameWhiteCentet1.AddChidren(framePic); |
| | | |
| | | //风速图标 |
| | | this.btnFan = new IconViewControl(28); |
| | | btnFan.Gravity = Gravity.CenterHorizontal; |
| | | btnFan.Y = Application.GetRealHeight(367); |
| | | this.FrameWhiteCentet1.AddChidren(btnFan); |
| | | List<string> fanSpeedList = new List<string>(); |
| | | fanSpeedList = device.GetAttribute(FunctionAttributeKey.FanSpeed).value; |
| | | btnFan.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | 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(); |
| | | }; |
| | | //风速文本 |
| | | this.btnFanView = new NormalViewControl(this.FrameWhiteCentet1.Width / 3, Application.GetRealHeight(18), false); |
| | | btnFanView.Gravity = Gravity.CenterHorizontal; |
| | | btnFanView.Y = btnFan.Bottom + Application.GetRealHeight(6); |
| | | btnFanView.TextAlignment = TextAlignment.Center; |
| | | btnFanView.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; |
| | | btnFanView.TextColor = CSS_Color.TextualColor; |
| | | this.FrameWhiteCentet1.AddChidren(btnFanView); |
| | | |
| | | //开关图标 |
| | | this.btnSwitch = new IconViewControl(32); |
| | | btnSwitch.Gravity = Gravity.CenterHorizontal; |
| | | btnSwitch.Y = Application.GetRealHeight(468); |
| | | btnSwitch.UnSelectedImagePath = "Public/PowerClose.png"; |
| | | btnSwitch.SelectedImagePath = "Public/PowerOpen.png"; |
| | | FrameWhiteCentet1.AddChidren(btnSwitch); |
| | | btnSwitch.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnSwitch.IsSelected = !btnSwitch.IsSelected; |
| | | device.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off"; |
| | | new System.Threading.Thread(() => |
| | | { |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.OnOff, device.trait_on_off.curValue.ToString()); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | |
| | | if (fanSpeedList.Count > 0) |
| | | { |
| | | this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan1.png"; |
| | | this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan1Select.png"; |
| | | this.btnFanView.Text = Language.StringByID(StringId.LowWindSpeed); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 显示风速选择界面___________________ |
| | | |
| | | /// <summary> |
| | | /// 显示风速选择界面 |
| | | /// </summary> |
| | | private void ShowFanSelectView() |
| | | { |
| | | //整个灰色界面 |
| | | var frameBack = new Dialog(); |
| | | |
| | | var dialogBody = new NormalFrameLayout(); |
| | | frameBack.AddChidren(dialogBody); |
| | | dialogBody.ButtonClickEvent = (sender, e) => |
| | | { |
| | | frameBack.Close(); |
| | | }; |
| | | frameBack.Show(); |
| | | |
| | | //菜单控件(风速) |
| | | var menuContr = new DialogTitleMenuControl(3, Language.StringByID(StringId.FanSpeed)); |
| | | menuContr.X = Application.GetRealWidth(209); |
| | | menuContr.Y = Application.GetRealHeight(231); |
| | | menuContr.Width = Application.GetRealWidth(160); |
| | | menuContr.Height = Application.GetRealHeight(199); |
| | | dialogBody.AddChidren(menuContr); |
| | | |
| | | //1档 |
| | | var iconPath = this.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"); |
| | | }); |
| | | |
| | | //2档 |
| | | 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"); |
| | | }); |
| | | |
| | | //3档 |
| | | 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 |
| | | |
| | | #region ■ 设备状态反馈_______________________ |
| | | |
| | | /// <summary> |
| | | /// 设备状态反馈 |
| | | /// </summary> |
| | | /// <param name="i_LocalDevice"></param> |
| | | public override void DeviceStatuPush(Function i_LocalDevice) |
| | | { |
| | | //不是同一个东西 |
| | | if (this.device.sid != i_LocalDevice.sid) { return; } |
| | | |
| | | //刷新当前设备的状态缓存 |
| | | this.RefreshNowDeviceStatuMemory(i_LocalDevice); |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 刷新界面状态_______________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新界面状态 |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | //开关 |
| | | this.btnSwitch.IsSelected = this.device.GetAttrState(FunctionAttributeKey.OnOff) == "on"; |
| | | |
| | | this.RefreshFanSpeed(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新风速状态 |
| | | /// </summary> |
| | | private void RefreshFanSpeed() |
| | | { |
| | | //风速 |
| | | if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "low") |
| | | { |
| | | this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan1.png"; |
| | | this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan1Select.png"; |
| | | this.btnFanView.Text = Language.StringByID(StringId.LowWindSpeed); |
| | | } |
| | | else if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "medium") |
| | | { |
| | | this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan2.png"; |
| | | this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan2Select.png"; |
| | | this.btnFanView.Text = Language.StringByID(StringId.MiddleWindSpeed); |
| | | } |
| | | else if (this.device.GetAttrState(FunctionAttributeKey.FanSpeed) == "high") |
| | | { |
| | | this.btnFan.UnSelectedImagePath = "FunctionIcon/AirFresh/Fan3.png"; |
| | | this.btnFan.SelectedImagePath = "FunctionIcon/AirFresh/Fan3Select.png"; |
| | | this.btnFanView.Text = Language.StringByID(StringId.HighWindSpeed); |
| | | } |
| | | this.btnFan.CanClick = this.btnFan.IsSelected = this.device.GetAttrState(FunctionAttributeKey.OnOff) == "on"; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 发送各种命令_______________________ |
| | | |
| | | /// <summary> |
| | | /// 发送其他命令 |
| | | /// </summary> |
| | | /// <param name="btnIcon">按钮</param> |
| | | /// <param name="comadKey">命令主键</param> |
| | | /// <param name="comadValue">命令</param> |
| | | private void SendOtherComand(IconViewControl btnIcon, string comadKey, string comadValue) |
| | | { |
| | | btnIcon.CanClick = false; |
| | | |
| | | HdlThreadLogic.Current.RunThread(() => |
| | | { |
| | | //获取发送命令的样板(bus协议是需要一次性把全部命令一起发送的) |
| | | var dic = this.GetSendComandSample(); |
| | | dic[comadKey] = comadValue; |
| | | Control.Ins.SendWriteCommand(this.device, dic); |
| | | HdlThreadLogic.Current.RunMain(() => |
| | | { |
| | | btnIcon.CanClick = true; |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取发送命令的样板(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 |
| | | |
| | | #region ■ 一般方法___________________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新当前设备的状态缓存 |
| | | /// </summary> |
| | | private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) |
| | | { |
| | | for (int i = 0; i < i_LocalDevice.attributes.Count; i++) |
| | | { |
| | | var data = i_LocalDevice.attributes[i]; |
| | | //开关 |
| | | if (data.key == FunctionAttributeKey.OnOff) { this.device.SetAttrState(FunctionAttributeKey.OnOff, data.state); } |
| | | //风速 |
| | | else if (data.key == FunctionAttributeKey.FanSpeed) { this.device.SetAttrState(FunctionAttributeKey.FanSpeed, data.state); } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | } |
| | |
| | | |
| | | }; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | |
| | | //{ |
| | | // Width = Application.GetRealWidth(23), |
| | | //}); |
| | | |
| | | var adv = new ArmDiyView(); |
| | | var view = adv.DiyArmView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | var view = new ArmDiyView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | Language.StringByID(StringId.HouseDefense)); |
| | | customDeploymentView.AddChidren(view); |
| | | EventHandler<MouseEventArgs> event1 = (sender, e) => |
| | | { |
| | | ShowArmDialog(new SecurityAlarm()); |
| | | }; |
| | | view.SetClickEvent(event1); |
| | | |
| | | |
| | | if(FunctionList.List.securities.Count>3) |
| | | { |
| | |
| | | |
| | | |
| | | //灾害报警 |
| | | var disasterAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour)); |
| | | var disasterAlarmView = new FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour)); |
| | | fixedDeploymentTypeView.AddChidren(disasterAlarmView); |
| | | |
| | | fixedDeploymentTypeView.AddChidren(new Button() |
| | |
| | | }); |
| | | |
| | | //防盗报警 |
| | | var burglarAlarmView = adv.FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute)); |
| | | var burglarAlarmView = new FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute)); |
| | | fixedDeploymentTypeView.AddChidren(burglarAlarmView); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | private void ShowArmDialog(SecurityAlarm alarm) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout contentView = new FrameLayout(); |
| | | dialog.AddChidren(contentView); |
| | | contentView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | VerticalScrolViewLayout optinView = new VerticalScrolViewLayout() { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(515), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(88), |
| | | Radius = (uint)Application.GetRealHeight(13), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(optinView); |
| | | |
| | | Button btnOpen = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.OpenArm |
| | | }; |
| | | optinView.AddChidren(btnOpen); |
| | | |
| | | optinView.AddChidren(new Button() { |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor |
| | | }); |
| | | |
| | | Button btnCheckModify = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.CheckModify, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optinView.AddChidren(btnCheckModify); |
| | | |
| | | |
| | | Button btnCancel = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = optinView.Bottom + Application.GetRealHeight(8), |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(44), |
| | | Radius = (uint)Application.GetRealHeight(13), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | TextID = StringId.Cancel, |
| | | TextColor = CSS_Color.WarningColor, |
| | | IsBold = true, |
| | | }; |
| | | contentView.AddChidren(btnCancel); |
| | | |
| | | dialog.Show(); |
| | | |
| | | |
| | | btnCheckModify.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | var armSetPage = new ArmDeploymentSettingPage(alarm); |
| | | MainPage.BasePageView.AddChidren(armSetPage); |
| | | armSetPage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 安防自定义控件 |
| | | /// </summary> |
| | | public class ArmDiyView |
| | | public class ArmDiyView : FrameLayout |
| | | { |
| | | |
| | | Button btnIcon; |
| | | Button btnText; |
| | | /// <summary> |
| | | /// |
| | | /// 自定义布防界面 |
| | | /// </summary> |
| | | /// <param name="UnSelectedIconPath">图片路径</param> |
| | | /// <param name="SelectedIconPath">图片路径</param> |
| | | /// <param name="Text">显示文本</param> |
| | | public FrameLayout DiyArmView(string UnSelectedIconPath, string SelectedIconPath, string Text) |
| | | public ArmDiyView(string UnSelectedIconPath, string SelectedIconPath, string Text) |
| | | { |
| | | var view = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(82), |
| | | Height = Application.GetRealWidth(80), |
| | | }; |
| | | this.Width = Application.GetRealWidth(82); |
| | | this.Height = Application.GetRealWidth(80); |
| | | |
| | | Button btnIcon = new Button() |
| | | btnIcon = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(40), |
| | |
| | | UnSelectedImagePath = UnSelectedIconPath, |
| | | SelectedImagePath = SelectedIconPath, |
| | | }; |
| | | view.AddChidren(btnIcon); |
| | | this.AddChidren(btnIcon); |
| | | |
| | | Button btnText = new Button() |
| | | btnText = new Button() |
| | | { |
| | | Y = Application.GetRealWidth(40), |
| | | Height = Application.GetRealWidth(41), |
| | |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | view.AddChidren(btnText); |
| | | |
| | | |
| | | return view; |
| | | this.AddChidren(btnText); |
| | | } |
| | | |
| | | public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | this.MouseUpEventHandler = eventHandler; |
| | | btnIcon.MouseUpEventHandler = eventHandler; |
| | | btnText.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public class FixedArmView : FrameLayout |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// 固定布防控件 |
| | | /// </summary> |
| | | /// <param name="iconPath"></param> |
| | | /// <param name="title"></param> |
| | | /// <param name="titleTip"></param> |
| | | public FrameLayout FixedArmView(string iconPath,string title,string titleTip) |
| | | public FixedArmView(string iconPath, string title, string titleTip) |
| | | { |
| | | var view = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(144), |
| | | Height = Application.GetRealHeight(66), |
| | | Radius = (uint)Application.GetRealWidth(6), |
| | | BorderColor = CSS_Color.MainColor, |
| | | BorderWidth = 1, |
| | | }; |
| | | this.Width = Application.GetRealWidth(144); |
| | | this.Height = Application.GetRealHeight(66); |
| | | this.Radius = (uint)Application.GetRealWidth(6); |
| | | this.BorderColor = CSS_Color.MainColor; |
| | | this.BorderWidth = 1; |
| | | |
| | | var btnIcon = new Button() |
| | | { |
| | |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = iconPath,// "FunctionIcon/ArmCenter/DisasterAlarmIcon.png", |
| | | }; |
| | | view.AddChidren(btnIcon); |
| | | this.AddChidren(btnIcon); |
| | | |
| | | var btnTitle = new Button() |
| | | { |
| | |
| | | Text = title, |
| | | IsBold = true, |
| | | }; |
| | | view.AddChidren(btnTitle); |
| | | this.AddChidren(btnTitle); |
| | | |
| | | var btnTitleTip = new Button() |
| | | { |
| | |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = titleTip, |
| | | }; |
| | | view.AddChidren(btnTitleTip); |
| | | this.AddChidren(btnTitleTip); |
| | | |
| | | return view; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeploymentInformation, |
| | | IsBold = true, |
| | | }; |
| | | deploymentTitleRow.AddChidren(btnDeploymentTitle); |
| | | |
| | |
| | | TextID = StringId.Name, |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentNameTitle); |
| | | btnDeploymentNameTitle.Text += ":"; |
| | | |
| | | var btnDeploymentName = new Button() |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region 触发延时 |
| | | var delayedRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(delayedRow); |
| | | //var delayedRow = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //}; |
| | | //contentView.AddChidren(delayedRow); |
| | | |
| | | var btnDelayedTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Name, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | //var btnDelayedTitle = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | | // Width = Application.GetRealWidth(72), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Name, |
| | | //}; |
| | | //delayedRow.AddChidren(btnDelayedTitle); |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(230), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.name |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedText); |
| | | //var btnDelayedText = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(88), |
| | | // Width = Application.GetRealWidth(230), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Text = securityAlarm.name |
| | | //}; |
| | | //delayedRow.AddChidren(btnDelayedText); |
| | | |
| | | var btnDelayedRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(343), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedRight); |
| | | //var btnDelayedRight = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(343), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/RightIcon.png", |
| | | //}; |
| | | //delayedRow.AddChidren(btnDelayedRight); |
| | | |
| | | //delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | LoadEvent_EditSecurityAlarmName(btnDelayedTitle); |
| | | ////delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | //LoadEvent_EditSecurityAlarmName(btnDelayedTitle); |
| | | #endregion |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | #region 布防功能 |
| | | #region 布防功能\报警状态 |
| | | var deploymentFunctionRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeploymentInformation, |
| | | TextID = StringId.DefenseFunctionArmState, |
| | | IsBold = true, |
| | | }; |
| | | deploymentFunctionRow.AddChidren(btnFunctionTitle); |
| | | |
| | | var btnAddTarget = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337), |
| | | Y = Application.GetRealHeight(6), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/AddTargetIcon.png", |
| | | }; |
| | | deploymentFunctionRow.AddChidren(btnAddTarget); |
| | | |
| | | deploymentFunctionRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | var inputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(inputTargetView); |
| | | foreach (var target in securityAlarm.input) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName())); |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | |
| | | #region 告警目标 |
| | | var outputRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(outputRow); |
| | | |
| | | var btnOutputRowTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.AlarmTargetAfterTriggering, |
| | | IsBold = true, |
| | | }; |
| | | outputRow.AddChidren(btnOutputRowTitle); |
| | | |
| | | var btnAddOutTarget = new Button() |
| | | { |
| | | X = Application.GetRealWidth(337), |
| | | Y = Application.GetRealHeight(6), |
| | | Width = Application.GetRealWidth(32), |
| | | Height = Application.GetRealWidth(32), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/AddTargetIcon.png", |
| | | }; |
| | | outputRow.AddChidren(btnAddOutTarget); |
| | | outputRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | var outputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(outputTargetView); |
| | | foreach(var outTarget in securityAlarm.output) |
| | | { |
| | | inputTargetView.AddChidren(new OutputRow(outTarget.GetFunction().name, outTarget.GetFunction().GetRoomListName(),"")); |
| | | } |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 输入条件行控件 |
| | | /// </summary> |
| | | public class InputRow : RowLayout |
| | | { |
| | | Button btnTitle; |
| | | |
| | | Button btnSubTitle; |
| | | |
| | | public InputRow(string title,string subtitle) |
| | | { |
| | | this.LineColor = 0x00000000; |
| | | this.Height = Application.GetRealHeight(65); |
| | | this.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = title, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | this.AddChidren(btnTitle); |
| | | |
| | | btnSubTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = subtitle, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | this.AddChidren(btnSubTitle); |
| | | |
| | | } |
| | | |
| | | public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | this.MouseUpEventHandler = eventHandler; |
| | | btnTitle.MouseUpEventHandler = eventHandler; |
| | | btnSubTitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 输出条件控件 |
| | | /// </summary> |
| | | public class OutputRow : RowLayout |
| | | { |
| | | Button btnTitle; |
| | | |
| | | Button btnSubTitle; |
| | | |
| | | Button btnState; |
| | | |
| | | Button btnRightIcon; |
| | | |
| | | public OutputRow(string title, string subtitle,string state) |
| | | { |
| | | this.LineColor = 0x00000000; |
| | | this.Height = Application.GetRealHeight(65); |
| | | this.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = title, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | this.AddChidren(btnTitle); |
| | | |
| | | btnSubTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Height = Application.GetRealHeight(44), |
| | | Width = Application.GetRealWidth(320), |
| | | Text = subtitle, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | }; |
| | | this.AddChidren(btnSubTitle); |
| | | |
| | | btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(323), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = state |
| | | }; |
| | | this.AddChidren(btnState); |
| | | |
| | | btnRightIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(16), |
| | | Height = Application.GetRealWidth(16), |
| | | UnSelectedImagePath = "FunctionIcon/ArmCenter/RightIcon.png", |
| | | }; |
| | | this.AddChidren(btnRightIcon); |
| | | } |
| | | |
| | | public void SetClickEvent(EventHandler<MouseEventArgs> eventHandler) |
| | | { |
| | | btnState.MouseUpEventHandler = eventHandler; |
| | | btnTitle.MouseUpEventHandler = eventHandler; |
| | | btnSubTitle.MouseUpEventHandler = eventHandler; |
| | | } |
| | | } |
| | | } |
| | |
| | | var pack = pm.GetArmSensorHistory(device.deviceId, "20", "1"); |
| | | var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<Cloud_ArmSensorHistory>(pack.Data.ToString()); |
| | | List<string> years = new List<string>(); |
| | | if (revData == null) |
| | | return; |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var startTime = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1)); // 当地时区 |
| | |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | using System.Collections.Generic; |
| | | using System; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
New file |
| | |
| | | using Shared; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.Entity; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class SensorGasPage : DeviceFunctionCardCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | |
| | | /// <summary> |
| | | /// 图标 |
| | | /// </summary> |
| | | private IconViewControl btnIcon = null; |
| | | /// <summary> |
| | | /// 文本控件 |
| | | /// </summary> |
| | | private NormalViewControl btnSuctionView = null; |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | |
| | | /// <summary> |
| | | /// 初始化白色区域的内容 |
| | | /// </summary> |
| | | public override void InitFrameWhiteContent() |
| | | { |
| | | base.SetTitleText(Language.StringByID(StringId.SensorGas)); |
| | | |
| | | //添加第二索引页 |
| | | this.AddSecondPage(); |
| | | //初始化第一个索引页的内容 |
| | | this.InitFrameWhiteContent1(); |
| | | //初始化第二个索引页的内容 |
| | | this.InitFrameWhiteContent2(); |
| | | |
| | | //刷新当前设备的状态缓存 |
| | | this.RefreshNowDeviceStatuMemory(this.device); |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | //读取状态 |
| | | new System.Threading.Thread(() => |
| | | { |
| | | if (device.spk == SPK.SenesorMegahealth) |
| | | { |
| | | DriverLayer.Control.Ins.SendReadCommand(device, true); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化第一个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent1() |
| | | { |
| | | btnIcon = new IconViewControl(198) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealWidth(146), |
| | | UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png", |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnIcon); |
| | | |
| | | btnSuctionView = new NormalViewControl(300, 84, true) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = btnIcon.Bottom, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.TextualColor, |
| | | SelectedTextColor = CSS_Color.MainColor, |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnSuctionView); |
| | | RefreshFormStatu(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化第二个索引页的内容 |
| | | /// </summary> |
| | | private void InitFrameWhiteContent2() |
| | | { |
| | | var paging = new ArmSensorHistroyPaging(device); |
| | | paging.InitFrame(FrameWhiteCentet2); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 设备状态反馈_______________________ |
| | | |
| | | /// <summary> |
| | | /// 设备状态反馈 |
| | | /// </summary> |
| | | /// <param name="i_LocalDevice"></param> |
| | | public override void DeviceStatuPush(Function i_LocalDevice) |
| | | { |
| | | //不是同一个东西 |
| | | if (this.device.sid != i_LocalDevice.sid) { return; } |
| | | |
| | | //刷新当前设备的状态缓存 |
| | | this.RefreshNowDeviceStatuMemory(i_LocalDevice); |
| | | //刷新界面状态 |
| | | this.RefreshFormStatu(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 发送各种命令_______________________ |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 刷新界面状态_______________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新界面状态 |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | foreach(var temp in device.attributes) { |
| | | if (temp != null) |
| | | { |
| | | if (temp.state == "alarm") |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/ArmSensorSmokeStateBgIconOn.png"; |
| | | btnSuctionView.TextID = StringId.InAlarm; |
| | | btnSuctionView.IsSelected = true; |
| | | } |
| | | else if (temp.state == "normal") |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/UnderProtectionBgIcon.png"; |
| | | btnSuctionView.TextID = StringId.SensorNormalState; |
| | | btnSuctionView.IsSelected = false; |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 一般方法___________________________ |
| | | |
| | | /// <summary> |
| | | /// 刷新当前设备的状态缓存 |
| | | /// </summary> |
| | | private void RefreshNowDeviceStatuMemory(Function i_LocalDevice) |
| | | { |
| | | //foreach (var data in i_LocalDevice.status) |
| | | //{ |
| | | // if (data.key == FunctionAttributeKey.Status) |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // if (data.value.ToLower() == "open") |
| | | // { |
| | | // this.btnIcon.IsSelected = true; |
| | | // this.btnSuctionView.IsSelected = true; |
| | | // this.btnSuctionView.TextID = StringId.Open; |
| | | // } |
| | | // else |
| | | // { |
| | | // this.btnIcon.IsSelected = false; |
| | | // this.btnSuctionView.IsSelected = false; |
| | | // this.btnSuctionView.TextID = StringId.Close; |
| | | // } |
| | | // }); |
| | | // } |
| | | //} |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | } |
| | |
| | | int index = 0; |
| | | foreach (var sensor in FunctionList.List.GetEnvirSensorsList()) |
| | | { |
| | | if(sensor.spk == SPK.SensorEnvironment) |
| | | if(SPK.EvironmentSensorList().Contains(sensor.spk)) |
| | | { |
| | | foreach (var seTemp in sensor.attributes) |
| | | { |
| | |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | newTemp.SetAttrState("spk", "tvoc"); |
| | | break; |
| | | default: |
| | | continue; |
| | | break; |
| | | } |
| | | |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | if (updateTemp.spk == SPK.SensorEnvironment) |
| | | if (SPK.EvironmentSensorList().Contains(updateTemp.spk )) |
| | | { |
| | | foreach (var seTemp in updateTemp.attributes) |
| | | { |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddLightScene : FrameLayout |
| | | { |
| | | #region 控件列表 |
| | | /// <summary> |
| | | /// 当前窗体 |
| | | /// </summary> |
| | | static FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 楼层选择下拉图标 |
| | | /// </summary> |
| | | Button btnFloorDownIcon; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnFloor; |
| | | /// <summary> |
| | | /// 功能列表集合显示区域 |
| | | /// </summary> |
| | | static VerticalScrolViewLayout functionListView; |
| | | #endregion |
| | | |
| | | List<Function> functionList; |
| | | |
| | | public AddLightScene() |
| | | { |
| | | bodyView = this; |
| | | functionList = new List<Function>(); |
| | | } |
| | | |
| | | public void LoadPage(int titleId) |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | | |
| | | /// <summary> |
| | | /// 房间内容显示区域 |
| | | /// </summary> |
| | | var roomFloorChangeView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(52), |
| | | }; |
| | | bodyView.AddChidren(roomFloorChangeView); |
| | | #region 房间顶部切换显示区域 |
| | | btnFloorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | roomFloorChangeView.AddChidren(btnFloorDownIcon); |
| | | |
| | | btnFloor = new Button() |
| | | { |
| | | X = btnFloorDownIcon.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 = DB_ResidenceData.Instance.CurFloor.roomName, |
| | | }; |
| | | roomFloorChangeView.AddChidren(btnFloor); |
| | | #endregion |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64 + 52), |
| | | Height = Application.GetRealHeight(603 - 12 - 52), |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | functionList.AddRange(FunctionList.List.GetLightList()); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | bodyView.btnWhiteRound.Visible = false; |
| | | } |
| | | bodyView.btnCurColor.BackgroundColor = (uint)(0xFF000000 + bodyView.lightTemp.GetRGBcolor(updateTemp)); |
| | | bodyView.lastColor = bodyView.lightTemp.GetRGBbytes(updateTemp); |
| | | if (bodyView.lightTemp.GetRGBcolor(updateTemp) == 16777215 && bodyView.btnCurColor.BorderColor != 0x00000000) |
| | | { |
| | | bodyView.btnCurColor.BorderColor = CSS.CSS_Color.PromptingColor2; |
| | |
| | | |
| | | for (int i = 0; i < 3; i++) |
| | | { |
| | | if (lightTemp.GetRGBbytes(function)[i] != lastColor[i]) |
| | | if (lightTemp.GetRGBbytes(function)[i].ToString() != lastColor[i].ToString()) |
| | | { |
| | | function.SetAttrState(FunctionAttributeKey.RGB, lastColor); |
| | | lightTemp.SetRGBcolor(lastColor, function); |