Merge remote-tracking branch 'origin/newBranch1' into WJC
| | |
| | | <Properties StartupConfiguration="{09712674-2A38-407B-B1E2-560B2C352F9A}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneSimulatorTarget.FE1D0763-7181-4B0C-AB18-E30AA773A6FA" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs"> |
| | | <Properties StartupConfiguration="{D998E133-F0DD-4760-BE3C-461632F54DA4}|Default"> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__iOS PreferredExecutionTarget="MonoDevelop.IPhone.IPhoneDeviceTarget.6242be7109c740c6cb8999a8904b6e0ea8d45192" /> |
| | | <MonoDevelop.Ide.Workbench ActiveDocument="HDL_ON/DAL/Server/HttpUtil.cs"> |
| | | <Files> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/ConditionDeviceFunList.cs" Line="556" Column="43" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/PublicInterface.cs" Line="17" Column="21" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddLogic.cs" Line="1" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Automation/AddInputType.cs" Line="83" Column="43" /> |
| | | <File FileName="HDL_ON/Entity/Function/Scene.cs" Line="83" Column="23" /> |
| | | <File FileName="HDL_ON/UI/UI2/3-Intelligence/Scene/SceneEditPage.cs" Line="376" Column="33" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePage.cs" Line="392" Column="53" /> |
| | | <File FileName="HDL_ON/UI/UI2/1-HomePage/HomePageBLL.cs" Line="28" Column="22" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/UdpSocket.cs" Line="123" Column="1" /> |
| | | <File FileName="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/ArmCenterPage.cs" Line="199" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control.cs" Line="789" Column="18" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpServerRequest.cs" Line="2295" Column="32" /> |
| | | <File FileName="HDL_ON/DAL/Server/NewAPI.cs" Line="483" Column="23" /> |
| | | <File FileName="HDL_ON/Entity/FunctionList.cs" Line="179" Column="48" /> |
| | | <File FileName="HDL_ON/Common/ApiUtlis.cs" Line="394" Column="1" /> |
| | | <File FileName="HDL_ON/Entity/Function/SecurityAlarm.cs" Line="72" Column="1" /> |
| | | <File FileName="HDL_ON/DAL/DriverLayer/Control_Udp.cs" Line="79" Column="28" /> |
| | | <File FileName="HDL_ON/DAL/Server/HttpUtil.cs" Line="22" Column="87" /> |
| | | </Files> |
| | | <Pads> |
| | | <Pad Id="ProjectPad"> |
| | |
| | | <Node name="HDL_ON" expanded="True"> |
| | | <Node name="Common" expanded="True" /> |
| | | <Node name="DAL" expanded="True"> |
| | | <Node name="Server" expanded="True" /> |
| | | <Node name="DriverLayer" expanded="True" /> |
| | | <Node name="Server" expanded="True"> |
| | | <Node name="HttpUtil.cs" selected="True" /> |
| | | </Node> |
| | | </Node> |
| | | <Node name="Entity" expanded="True" /> |
| | | <Node name="Entity" expanded="True"> |
| | | <Node name="Function" expanded="True" /> |
| | | </Node> |
| | | <Node name="UI" expanded="True"> |
| | | <Node name="UI2" expanded="True"> |
| | | <Node name="3-Intelligence" expanded="True"> |
| | | <Node name="Automation" expanded="True"> |
| | | <Node name="AddInputType.cs" selected="True" /> |
| | | </Node> |
| | | <Node name="1-HomePage" expanded="True" /> |
| | | <Node name="FuntionControlView" expanded="True"> |
| | | <Node name="ArmCenter" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | <Node name="HDL-ON_Android" expanded="True"> |
| | | <Node name="Assets" expanded="True" /> |
| | | <Node name="HDL-ON_iOS" expanded="True"> |
| | | <Node name="Resources" expanded="True"> |
| | | <Node name="Phone" expanded="True"> |
| | | <Node name="Collection" expanded="True" /> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </Node> |
| | | </State> |
| | |
| | | <String>Shared.Droid.TouchID/Shared.Droid.TouchID.csproj</String> |
| | | <String>Shared.IOS/Shared.IOS.csproj</String> |
| | | </DisabledProjects> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" /> |
| | | <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|iPhone" /> |
| | | <MonoDevelop.Ide.ItemProperties.HDL-ON__Android PreferredExecutionTarget="Android.SelectDevice" /> |
| | | <Debugger.DebugSourceFolders> |
| | | <String>/Users/jlchen/Desktop/wjc</String> |
| | | </Debugger.DebugSourceFolders> |
| | | <MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <BreakpointStore> |
| | | <Breakpoint file="/Users/jlchen/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PirDevice/Method.cs" line="34" column="1" /> |
| | | <Breakpoint file="/Users/jlchen/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/AddDevice/SenesorMegahealth/AddSenesorMegahealthDirection1Page.cs" line="118" column="1" /> |
| | | <Breakpoint file="/Users/jlchen/Desktop/wjc/HDL_APP_Project/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" relfile="HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs" line="546" column="1" /> |
| | | <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="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" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/Server/HttpServerRequest.cs" relfile="HDL_ON/DAL/Server/HttpServerRequest.cs" line="2318" 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/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" relfile="HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddAlarmDeploymentPage.cs" line="424" column="1" /> |
| | | <Breakpoint file="/Users/kaede/Desktop/HDL_APP_Project/HDL_ON/DAL/DriverLayer/Control.cs" relfile="HDL_ON/DAL/DriverLayer/Control.cs" line="785" column="1" /> |
| | | </BreakpointStore> |
| | | </MonoDevelop.Ide.DebuggingService.Breakpoints> |
| | | <MultiItemStartupConfigurations /> |
old mode 100644
new mode 100755
Binary files differ
old mode 100644
new mode 100755
Binary files differ
| | |
| | | //网络变化处理 |
| | | HDLCommon.Current.UpdateInternetStatus((int)internetStatus, MainPage.IsEnterBackground); |
| | | }; |
| | | //开启定位服务 |
| | | Shared.Application.StartGPSLocationService(); |
| | | }; |
| | | BaseActivity.RefreshUIAction += (activity) => |
| | | { |
| | |
| | | 324=Scene delay |
| | | 325=Delay setting |
| | | 326=Delay |
| | | 327=Catch Scene |
| | | 327=Capture the scene |
| | | 328=Film scene |
| | | 329=General |
| | | 330=Automatic mode |
| | |
| | | 453=Alarm mute |
| | | 454=Deployment information |
| | | 455=The name can not be blank. |
| | | |
| | | 456=Canvas |
| | | 457=Energy consumption |
| | | 458=Date |
| | |
| | | 477=Swing |
| | | 478=Pattern |
| | | 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 |
| | |
| | | 1050=Add Device |
| | | 1051=Mini Intelligent Remote Control |
| | | 1052=Add Infrared Remote Control |
| | | 1053=Press the infrared remote control button{0}for 10 seconds and the indicator light{0}flashes blue quickly |
| | | 1053=Press the infrared remote control button{0}for 3 seconds and the indicator light{0}flashes blue quickly |
| | | 1054=Please make sure your Bluetooth{0}is on and searchable |
| | | 1055=Next Step |
| | | 1056=Device searching... |
| | |
| | | 9010=New password |
| | | 9011=Enter new password again |
| | | 9012=Agree |
| | | 9013=User agreement |
| | | 9014=Privacy agreement |
| | | 9013=Service Agreement |
| | | 9014=User information protection regulations |
| | | 9015=and |
| | | 9016=Please read and agree on User Agreement and Privacy Agreement. |
| | | 9016=Please read and agree on User Service Agreement and User information protection regulations. |
| | | 9017=Are you sure to log out? |
| | | 9018=Please select country/region. |
| | | 9019=Update now |
| | |
| | | 324=场景延时 |
| | | 325=延时设置 |
| | | 326=延时 |
| | | 327=捕获场景 |
| | | 327=捕捉场景 |
| | | 328=电影场景 |
| | | 329=普通 |
| | | 330=自动模式 |
| | |
| | | 477=摆动 |
| | | 478=模式 |
| | | 479=风速 |
| | | 480=环境传感器 |
| | | 481=可以开始使用环境传感器了 |
| | | 482=燃气传感器 |
| | | 483=请输入设备的MAC码 |
| | | 484=开启 |
| | | 485=查看/修改 |
| | | 486=布防功能/报警状态 |
| | | 487=触发后告警目标 |
| | | |
| | | |
| | | 1000=室内湿度 |
| | |
| | | 1050=添加设备 |
| | | 1051=mini智能遥控器 |
| | | 1052=添加红外遥控 |
| | | 1053=长按红外遥控器按钮10秒,指示灯蓝色快闪 |
| | | 1053=长按红外遥控器按钮3秒,指示灯蓝色快闪 |
| | | 1054=请确保您的蓝牙已开启并处于可以被搜索状态 |
| | | 1055=下一步 |
| | | 1056=设备搜索中... |
| | |
| | | 6016=离线 |
| | | 6017=版本号 |
| | | 6018=请输入遥控器名称 |
| | | 6019=提示:遥控器创建后可在功能-电器分类{\r\n}查找使用 |
| | | 6019=提示:遥控器创建后可在功能-电器分类,查找使用 |
| | | 6020=推荐按键 |
| | | 6021=请输入按键名称 |
| | | 6022=下一步 |
| | |
| | | 6093=设备不在线 |
| | | 6094=网关设备不存在 |
| | | 6095=添加按钮超出30个 |
| | | |
| | | |
| | | |
| | | 7000=新建自动化 |
| | |
| | | 7142=严重 |
| | | 7143=偏高 |
| | | 7144=优秀 |
| | | |
| | | |
| | | 9000=请使用新的手机账号登录APP |
| | | 9001=请使用新的邮箱账号登录APP |
| | |
| | | 9010=新密码 |
| | | 9011=再次输入新密码 |
| | | 9012=同意 |
| | | 9013=用户协议 |
| | | 9014=隐私政策 |
| | | 9013=服务协议 |
| | | 9014=用户信息保护规定 |
| | | 9015=和 |
| | | 9016=请先阅读并同意《用户协议》和《隐私政策》 |
| | | 9016=请先阅读并同意《服务协议》和《用户信息保护规定》 |
| | | 9017=确认退出登录? |
| | | 9018=请选择国家/区域 |
| | | 9019=立即更新 |
| | |
| | | <Reference Include="videophone"> |
| | | <HintPath>..\DLL\FL\Android\videophone.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="LC_SDK"> |
| | | <HintPath>..\DLL\LC\Android\LC_SDK.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="Square.OkHttp3"> |
| | | <HintPath>..\DLL\EZvizMonitor\Square.OkHttp3.dll</HintPath> |
| | | </Reference> |
| | |
| | | </Reference> |
| | | <Reference Include="ys"> |
| | | <HintPath>..\DLL\EZvizMonitor\ys.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="LC_SDK"> |
| | | <HintPath>..\DLL\LC\Android\LC_SDK.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irfan_blue.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\HomeIcon\irfan_white.png" /> |
| | | <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" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <AndroidAsset Include="Assets\Phone\Collection\DisarmStatusIcon.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" /> |
| | |
| | | screenshotLayout.SetOnClickListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | |
| | | private void Unlock() |
| | | { |
| | | // |
| | | CurtActivity.Unlock(); |
| | | UpdataUnlockState(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | if (v.Equals(unlockLayout)) |
| | | { |
| | | //开锁 |
| | | Unlock(); |
| | | } |
| | | else if (v.Equals(screenshotLayout)) |
| | | { |
| | | //有视频过来可调用此接口进行拍照 |
| | | // 内部储存/DCIM/Camera/.....jpg |
| | | screenImage.Selected = true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/HDL"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | CurtActivity.SnapShot(path); |
| | | } |
| | | } |
| | | |
| | |
| | | CurtActivity.Play(); |
| | | |
| | | CurtActivity.CloseAudio(); |
| | | |
| | | |
| | | return mView; |
| | | } |
| | | |
| | |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | private void Unlock() |
| | | { |
| | | // |
| | | CurtActivity.Unlock(); |
| | | UpdataUnlockState(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | else if (v.Equals(screenshotImg)) |
| | | { |
| | | //有视频过来可调用此接口进行拍照 |
| | | screenshotImg.Selected = true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); |
| | | string time = format.Format(new Date(SystemClock.CurrentThreadTimeMillis())); |
| | | string ss = Android.OS.Environment.ExternalStorageDirectory.Path + "/DCIM/Camera"; |
| | | string path = ss + "/" + time + ".jpg"; |
| | | CurtActivity.SnapShot(path); |
| | | } |
| | | else if (v.Equals(unlockImg)) |
| | | { |
| | | PostUnlock(); |
| | | CurtActivity.Unlock(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// post 截图 |
| | | /// </summary> |
| | | /// <param name="path">截图保留的路径</param> |
| | | private void PostScreenshot(string path) |
| | | { |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | string[] str = path.Split("/"); |
| | | string img_name = str.GetValue(str.Length - 1).ToString().Replace(".jpg", ""); |
| | | byte[] images = FileUtlis.Files.ReadFileForPath(path); |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("callId", VideoActivity.CallId); |
| | | d.Add("images", images); |
| | | d.Add("imagesName", img_name); |
| | | string jsonString = HttpUtil.GetSignRequestJson(d); |
| | | |
| | | string url = "/home-wisdom/app/fl/vi/screenshot"; |
| | | ResponsePackNew response = HttpUtil.RequestHttpsPost(url, jsonString); |
| | | Log.Info("LcVideo", "Post Screenshot Response code=" + response.Code); |
| | | } |
| | | catch { } |
| | | |
| | | }).Start(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | using Com.Lechange.Opensdk.Media; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON_Android.LeChengView.Form; |
| | | using Java.IO; |
| | | using Java.Lang; |
| | | |
| | | namespace HDL_ON_Android |
| | |
| | | public string PlayToken = "";//播放playToken |
| | | public string CallId = "";//呼叫Id |
| | | private int Type = 0;//0监控,1对讲 |
| | | private string DeviceName = "";// 备注 |
| | | |
| | | /// <summary> |
| | | /// 0:国内,1海外 |
| | | /// </summary> |
| | |
| | | Type = Intent.GetIntExtra("Type", 0);//0监控,1对讲//1 |
| | | Location = Intent.GetIntExtra("Location", 0);//1 |
| | | CallId = Intent.GetStringExtra("callId");//1384766990812426242 |
| | | DeviceName = Intent.GetStringExtra("DeviceName"); |
| | | |
| | | InitLCSDK(); |
| | | |
| | |
| | | ivBack = (ImageView)FindViewById(Resource.Id.videoBackImg); |
| | | tvName = (TextView)FindViewById(Resource.Id.nameText); |
| | | |
| | | tvName.SetText("DeviceName", null); |
| | | tvName.SetText(DeviceName, null); |
| | | ivBack.SetOnClickListener(this); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 开锁 |
| | | /// </summary> |
| | | public void Unlock() |
| | | { |
| | | // |
| | | Dictionary<string, object> dic = new Dictionary<string, object>(); |
| | | dic.Add("deviceId", this.DeviceId); |
| | | dic.Add("callId", this.CallId); |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(dic); |
| | | var revertObj = HttpUtil.RequestHttpsPostFroHome("/home-wisdom/platform/imou/openDoorbell", requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.unlock_success), ToastLength.Short).Show(); |
| | | } |
| | | else |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.unlock_fail), ToastLength.Short).Show(); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 截图 |
| | | /// </summary> |
| | | /// <param name="path"></param> |
| | | public void SnapShot(string path) |
| | | { |
| | | try |
| | | { |
| | | int code = mPlayWindow.SnapShot(path); |
| | | if (code == 0) |
| | | { |
| | | //Android.Provider.MediaStore.Images.Media.InsertImage(this.getContentResolver(), path, "ss", "ss"); |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_success), ToastLength.Short).Show(); |
| | | } |
| | | else |
| | | { |
| | | Toast.MakeText(this, Resources.GetString(Resource.String.screenshot_fail), ToastLength.Short).Show(); |
| | | } |
| | | } |
| | | catch (System.Exception e) |
| | | { |
| | | string error = e.Message; |
| | | } |
| | | |
| | | //运行到这,photoFile已经存在,这里需要获得这个文件的uri |
| | | //* 分两种情况,android7.0以上和以下 |
| | | // 先存入临时目录,然后再移动到相册目录中 |
| | | //File photoFile = new File(path); |
| | | //Android.Net.Uri photoUri; |
| | | |
| | | //if (Build.VERSION.SdkInt >= 24) |
| | | //if (Build.VERSION.PreviewSdkInt >= 24) |
| | | //{ |
| | | |
| | | // /** |
| | | // * FileProvider.getUriForFile(),这个方法中需要填写三个参数, |
| | | // * 第一个Context, |
| | | // * 第二个S |
| | | // * tring 任意 |
| | | // * 第三个File |
| | | // */ |
| | | // photoUri = FileProvider.GetUriForFile(this, "HDL Video SnapShot", photoFile); |
| | | |
| | | //} |
| | | //else |
| | | //{ |
| | | // photoUri = Android.Net.Uri.FromFile(photoFile); |
| | | //} |
| | | |
| | | } |
| | | |
| | | private ContentResolver getContentResolver() |
| | | { |
| | | throw new NotImplementedException(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置顶部状态栏背景透明 |
| | | /// </summary> |
| | | private void SetStatusBarColor() |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202107081" android:versionName="1.2.202107081" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" /> |
| | | <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202108201" android:versionName="1.2.202108201" package="com.hdl.onpro"> |
| | | <uses-sdk android:minSdkVersion="26" android:targetSdkVersion="29" /> |
| | | <!-- 乐橙可视对讲需要的权限 --> |
| | | <!--<uses-permission android:name="android.permission.INTERNET" />--> |
| | | <!--网络访问--> |
| | | <!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />--> |
| | | <!--允许程序写入外部存储,如SD卡上写文件,抓图、录制等--> |
| | | <!--<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />--> |
| | | <!--程序可以读取设备外部存储空间(内置SDcard和外置SDCard)的文件,我的文件等--> |
| | | <uses-permission android:name="android.permission.USE_CREDENTIALS" /> |
| | | <!--允许程序请求验证从AccountManager???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_WIFI_MULTICAST_STATE" />--> |
| | | <!--允许改变WiFi多播状态???--> |
| | | <!--<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />--> |
| | | <!--允许程序显示系统窗口,应该已经不适用了???--> |
| | | <!--<uses-permission android:name="android.permission.RECORD_AUDIO" />--> |
| | | <!--允许程序录制声音通过手机或耳机的麦克,对讲、自定义报警音等--> |
| | | <!--<uses-permission android:name="android.permission.CAMERA" />--> |
| | | <!--允许程序访问摄像头进行拍照,二维码扫描补光、拍照上传图片等--> |
| | | <uses-permission android:name="android.permission.FLASHLIGHT" /> |
| | | <!--允许访问闪光灯,二维码扫描补光--> |
| | | <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> |
| | | <!--允许程序修改声音设置信息,声波配对,自动调大音量。需求变更之后应该不需要了???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />--> |
| | | <!--允许程序获取当前WiFi接入的状态以及WLAN热点的信息,设备添加何种配网流程使用--> |
| | | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> |
| | | <!--允许程序改变WiFi状态,配网等--> |
| | | <!--<uses-feature android:name="android.hardware.camera" />--> |
| | | <!--<uses-feature android:name="android.hardware.camera.autofocus" />--> |
| | | <!-- 硬件加速对X5视频播放非常重要,建议开启 --> |
| | | <uses-permission android:name="android.permission.READ_SETTINGS" /> |
| | | <!--允许程序读取系统设置,声波配对获取当前系统音量等--> |
| | | <!-- Optional for location --> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取粗略的位置,登陆、设备添加等--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />--> |
| | | <!--允许一个程序访问CellID或 WiFi热点来获取精确的位置,登陆、设备添加等???--> |
| | | <uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> |
| | | <!--允许应用程序访问额外的位置提供命令,登陆、设备添加等???--> |
| | | <!--<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />--> |
| | | <!--允许程序改变网络状态,如是否联网,配网???--> |
| | | <!--<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />--> |
| | | <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" /> |
| | | <!--允许应用程序请求安装包。针对API大于22必须持有该许可使用ACTION_INSTALL_PACKAGE应用。应该没在用???--> |
| | | <uses-permission android:name="android.permission.VIBRATE" /> |
| | | <!-- 可视对讲权限--> |
| | | <uses-permission android:name="android.permission.CAMERA" /> |
| | | <uses-feature android:name="android.hardware.camera" /> |
| | |
| | | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> |
| | | <uses-permission android:name="android.permission.READ_LOGS" /> |
| | | <!-- 极光推送结束 --> |
| | | <application android:debuggable="false" android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <application android:allowBackup="true" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="ON+"> |
| | | <provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false"> |
| | | <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> |
| | | </provider> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <resources> |
| | | <string name="app_name">HDL_ON_Pro</string> |
| | | <string name="app_name">ON_Plus</string> |
| | | <string name="action_settings">设置</string> |
| | | <string name="video_screenshot">截图</string> |
| | | <string name="video_unlock">开锁</string> |
| | |
| | | <string name="screenshot_success">截图成功</string> |
| | | <string name="talk_open_success">对讲开始</string> |
| | | <string name="talk_open_failed">对讲打开失败</string> |
| | | <string name="unlock_fail">开锁失败</string> |
| | | <string name="screenshot_fail">截图失败</string> |
| | | </resources> |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <resources> |
| | | <string name="action_settings">Setting</string> |
| | | <string name="action_settings">Setting</string> |
| | | <string name="video_screenshot">Screenshot</string> |
| | | <string name="video_unlock">Unlock</string> |
| | | <string name="video_answer">Answer</string> |
| | |
| | | <string name="on_the_phone">On the phone</string> |
| | | <string name="unlock_success">Unlock successfully</string> |
| | | <string name="screenshot_success">Screenshot successfully</string> |
| | | <string name="talk_open_success">Intercom Begin</string> |
| | | <string name="talk_open_failed">Intercom failed to open</string> |
| | | |
| | | <string name="talk_open_success">Intercom Begin</string> |
| | | <string name="talk_open_failed">Intercom failed to open</string> |
| | | <string name="unlock_fail">Fail to unlock</string> |
| | | <string name="screenshot_fail">Fail to screenshot</string> |
| | | </resources> |
New file |
| | |
| | | { |
| | | "images": [ |
| | | { |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "scale": "1x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "filename": "device_bg.png", |
| | | "scale": "2x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "scale": "3x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "scale": "1x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "subtype": "retina4", |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{130,145}", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{146,165}", |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "scale": "2x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "scale": "3x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "subtype": "retina4", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{130,145}", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{146,165}", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "dark" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "universal" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "subtype": "retina4", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "iphone" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "ipad" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{130,145}", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "screenWidth": "{146,165}", |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "watch" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "1x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "mac" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "2x", |
| | | "idiom": "car" |
| | | }, |
| | | { |
| | | "appearances": [ |
| | | { |
| | | "appearance": "luminosity", |
| | | "value": "light" |
| | | } |
| | | ], |
| | | "scale": "3x", |
| | | "idiom": "car" |
| | | } |
| | | ], |
| | | "info": { |
| | | "version": 1, |
| | | "author": "xcode" |
| | | } |
| | | } |
| | |
| | | <MtouchExtraArgs>-gcc_flags="-dead_strip -ObjC"</MtouchExtraArgs> |
| | | <MtouchEnableSGenConc>false</MtouchEnableSGenConc> |
| | | <CodesignProvision>On+Dev-20210616-1</CodesignProvision> |
| | | <CodesignEntitlements>Entitlements.plist</CodesignEntitlements> |
| | | </PropertyGroup> |
| | | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' "> |
| | | <DebugType>none</DebugType> |
| | |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <PackageReference Include="Newtonsoft.Json"> |
| | | <Version>12.0.3</Version> |
| | | <Version>13.0.1</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="MQTTnet"> |
| | | <Version>3.0.13</Version> |
| | | <Version>3.0.16</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Analytics"> |
| | | <Version>4.1.0</Version> |
| | | <Version>4.3.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Crashes"> |
| | | <Version>4.1.0</Version> |
| | | <Version>4.3.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="ZXing.Net.Mobile"> |
| | | <Version>2.4.1</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="RestSharp"> |
| | | <Version>106.11.7</Version> |
| | | <Version>106.12.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.iOS.Bugly"> |
| | | <Version>1.0.4</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Xamarin.Essentials"> |
| | | <Version>1.6.0</Version> |
| | | <Version>1.7.0</Version> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <ImageAsset Include="Assets.xcassets\wifi_bg.imageset\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\wifi_bg.imageset\wifi_bg%402x.png" /> |
| | | <ImageAsset Include="Assets.xcassets\wifi_bg.imageset\wifi_bg.png" /> |
| | | <ImageAsset Include="Assets.xcassets\device_bg.imageset\Contents.json" /> |
| | | <ImageAsset Include="Assets.xcassets\device_bg.imageset\device_bg.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <Folder Include="Resources\" /> |
| | |
| | | <Folder Include="Resources\Phone\FunctionIcon\EnvirSensor\" /> |
| | | <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\irfan.png" /> |
| | | <BundleResource Include="Resources\Phone\FunctionIcon\Icon\HomeIcon\irfan_blue.png" /> |
| | | <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" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DefenseStatusIcon.png" /> |
| | | <BundleResource Include="Resources\Phone\Collection\DisarmStatusIcon.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ITunesArtwork Include="iTunesArtwork" /> |
| | |
| | | <key>UIStatusBarStyle</key> |
| | | <string>UIStatusBarStyleLightContent</string> |
| | | <key>CFBundleShortVersionString</key> |
| | | <string>1.2.202107081</string> |
| | | <string>1.2.202108171</string> |
| | | <key>CFBundleVersion</key> |
| | | <string>1.2.07081</string> |
| | | <string>1.2.08171</string> |
| | | <key>NSLocationWhenInUseUsageDescription</key> |
| | | <string>Use geographic location to provide services such as weather</string> |
| | | <key>NSAppleMusicUsageDescription</key> |
| | |
| | | <document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17506" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="1Qq-y9-5Vr"> |
| | | <device id="retina4_7" orientation="portrait" appearance="light"/> |
| | | <dependencies> |
| | | <deployment identifier="iOS"/> |
| | | <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17505"/> |
| | | <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
| | | </dependencies> |
| | |
| | | <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" usesAttributedText="YES" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Q0X-wy-A5B"> |
| | | <rect key="frame" x="47.5" y="362" width="311.5" height="40"/> |
| | | <attributedString key="attributedText"> |
| | | <fragment content="返回demo,等待与设备连接,成功后自动进入下一步操作。"> |
| | | <fragment content="返回"> |
| | | <attributes> |
| | | <font key="NSFont" size="14" name=".PingFangSC-Regular"/> |
| | | <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" minimumLineHeight="20" tighteningFactorForTruncation="0.0"/> |
| | | </attributes> |
| | | </fragment> |
| | | <fragment content="APP"> |
| | | <attributes> |
| | | <font key="NSFont" metaFont="system" size="14"/> |
| | | <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" minimumLineHeight="20" tighteningFactorForTruncation="0.0"/> |
| | | </attributes> |
| | | </fragment> |
| | | <fragment content=",等待与设备连接,成功后自动进入下一步操作。"> |
| | | <attributes> |
| | | <font key="NSFont" size="14" name=".PingFangSC-Regular"/> |
| | | <paragraphStyle key="NSParagraphStyle" alignment="left" lineBreakMode="wordWrapping" baseWritingDirection="natural" minimumLineHeight="20" tighteningFactorForTruncation="0.0"/> |
| | | </attributes> |
| | | </fragment> |
| | |
| | | </scenes> |
| | | <inferredMetricsTieBreakers> |
| | | <segue reference="9TP-S2-hhI"/> |
| | | <segue reference="MFl-yy-ZsP"/> |
| | | <segue reference="9Lc-Kx-oZS"/> |
| | | <segue reference="ikM-Zn-H8f"/> |
| | | </inferredMetricsTieBreakers> |
| | | <resources> |
| | |
| | | 414=Controller on |
| | | 415=Someone |
| | | 416=Log |
| | | 417=Water Leakage |
| | | 417=Water leakage |
| | | 418=In Alarm |
| | | 419=Normal |
| | | 420=Hot dry |
| | |
| | | 477=Swing |
| | | 478=Pattern |
| | | 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 |
| | | 496=There is no associated task deployment status |
| | | 497=Custom |
| | | 498=Trigger delay |
| | | 499=Add defense function |
| | | 500=Add alarm target |
| | | |
| | | |
| | | 1000=Room Humidity |
| | |
| | | 1050=Add Device |
| | | 1051=Mini Intelligent Remote Control |
| | | 1052=Add Infrared Remote Control |
| | | 1053=Press the infrared remote control button{0}for 10 seconds and the indicator light{0}flashes blue quickly |
| | | 1053=Press the infrared remote control button{0}for 3 seconds and the indicator light{0}flashes blue quickly |
| | | 1054=Please make sure your Bluetooth{0}is on and searchable |
| | | 1055=Next Step |
| | | 1056=Device searching... |
| | |
| | | 9010=New password |
| | | 9011=Enter new password again |
| | | 9012=Agree |
| | | 9013=User agreement |
| | | 9014=Privacy agreement |
| | | 9013=Service Agreement |
| | | 9014=User information protection regulations |
| | | 9015=and |
| | | 9016=Please read and agree on User Agreement and Privacy Agreement. |
| | | 9016=Please read and agree on User Service Agreement and User information protection regulations. |
| | | 9017=Are you sure to log out? |
| | | 9018=Please select country/region. |
| | | 9019=Update now |
| | |
| | | 477=摆动 |
| | | 478=模式 |
| | | 479=风速 |
| | | |
| | | 480=环境传感器 |
| | | 481=可以开始使用环境传感器了 |
| | | 482=燃气传感器 |
| | | 483=请输入设备的MAC码 |
| | | 484=开启 |
| | | 485=查看/修改 |
| | | 486=布防功能/报警状态 |
| | | 487=触发后告警目标 |
| | | 488=人脸通行 |
| | | 489=将面容ID应用于: |
| | | 490=社区门禁通行 |
| | | 491=关于面容ID与隐私 |
| | | 492=抹掉数据 |
| | | 493=重置面容 |
| | | 494=设置面容 |
| | | 495=人脸通行设置 |
| | | 496=还没有关联任何布防状态 |
| | | 497=自定义 |
| | | 498=触发延时 |
| | | 499=添加布防功能 |
| | | 500=添加告警目标 |
| | | |
| | | 1000=室内湿度 |
| | | 1001=童锁 |
| | |
| | | 1050=添加设备 |
| | | 1051=mini智能遥控器 |
| | | 1052=添加红外遥控 |
| | | 1053=长按红外遥控器按钮10秒,指示灯蓝色快闪 |
| | | 1053=长按红外遥控器按钮3秒,指示灯蓝色快闪 |
| | | 1054=请确保您的蓝牙已开启并处于可以被搜索状态 |
| | | 1055=下一步 |
| | | 1056=设备搜索中... |
| | |
| | | 9010=新密码 |
| | | 9011=再次输入新密码 |
| | | 9012=同意 |
| | | 9013=用户协议 |
| | | 9014=隐私政策 |
| | | 9013=服务协议 |
| | | 9014=用户信息保护规定 |
| | | 9015=和 |
| | | 9016=请先阅读并同意《用户协议》和《隐私政策》 |
| | | 9016=请先阅读并同意《服务协议》和《用户信息保护规定》 |
| | | 9017=确认退出登录? |
| | | 9018=请选择国家/区域 |
| | | 9019=立即更新 |
| | |
| | | |
| | | foreach (var video in FunctionList.List.videoIntercom) |
| | | { |
| | | if (video.interphoneType == "IMOUVISIAL") |
| | | if (video.interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken = video.subAccountToken; |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | //======================安防==================== |
| | | GetSecurityList(); |
| | | |
| | | } |
| | | catch (Exception ex) |
| | |
| | | var pack = Ins.HttpRequest.GetSecurityList(); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var packList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | var packList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | var sidList = new List<string>(); |
| | | foreach (var function in packList) |
| | | { |
| | | sidList.Add(function.sid); |
| | | } |
| | | var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>()); |
| | | var infoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString()); |
| | | foreach (var function in infoList) |
| | | { |
| | | function.SaveFile(); |
| | |
| | | if (jpushMessageInfo.messageType.Contains(PushMessageType.Alarm.ToString())) |
| | | { |
| | | //报警推送弹窗提示 |
| | | ShowAlarmPushMessage(jpushMessageInfo,true); |
| | | ShowAlarmPushMessage(jpushMessageInfo, true); |
| | | } |
| | | else if (jpushMessageInfo.messageType.Contains(PushMessageType.FLCall.ToString())) |
| | | { |
| | |
| | | eSVideoInfo.ESVideoUUID = eSVideoInfo.uuid; |
| | | } |
| | | |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, "FLVI"); |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, InterphoneType.FLVI.ToString()); |
| | | |
| | | } |
| | | else if (jpushMessageInfo.messageType.Contains(PushMessageType.HDL_INTERPHONE.ToString())) |
| | |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; |
| | | |
| | | //字段兼容问题,只能直接取值了 |
| | | var json= Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent); |
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent); |
| | | //1.视对讲厂家类型 |
| | | string interphoneTypeEnum = json["interphoneTypeEnum"].ToString(); |
| | | if (string.IsNullOrEmpty(interphoneTypeEnum)) return; |
| | | // |
| | | ESVideoInfo eSVideoInfo = new ESVideoInfo();// GetESOnVideoJson(jpushMessageInfo.expantContent); |
| | | eSVideoInfo.callId = json["callId"].ToString(); |
| | | //eSVideoInfo.Lc_AccessToken = UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();// |
| | | eSVideoInfo.Lc_AccessToken = json["subAccountToken"].ToString();//2021-05-13 目前云端还没拿到Lc_AccessToken,目前没办法正常使用 |
| | | eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); |
| | | eSVideoInfo.Lc_Location = OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1; |
| | | eSVideoInfo.Lc_PlayToken = json["token"].ToString(); |
| | | eSVideoInfo.Lc_Psk = json["cname"].ToString(); |
| | | //2.根据可视对讲厂家类型,处理不同的数据 |
| | | if (interphoneTypeEnum == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | //大华乐橙 |
| | | eSVideoInfo.callId = json["callId"].ToString(); |
| | | //eSVideoInfo.Lc_AccessToken = UI.UI2.PersonalCenter.PirDevice.PirSend.LcSubAccessToken;//json["subAccountToken"].ToString();// |
| | | eSVideoInfo.Lc_AccessToken = json["subAccountToken"].ToString();//2021-05-13 目前云端还没拿到Lc_AccessToken,目前没办法正常使用 |
| | | eSVideoInfo.Lc_DeviceId = json["deviceId"].ToString(); |
| | | eSVideoInfo.Lc_Location = OnAppConfig.Instance.RequestHttpsHost.Contains("China") ? 0 : 1; |
| | | eSVideoInfo.Lc_PlayToken = json["token"].ToString(); |
| | | eSVideoInfo.Lc_Psk = json["cname"].ToString(); |
| | | } |
| | | else if (interphoneTypeEnum == InterphoneType.EZVIZ.ToString()) |
| | | { |
| | | //萤石猫眼 |
| | | eSVideoInfo.Lc_AccessToken = json["subToken"].ToString();//"子账号token |
| | | eSVideoInfo.DeviceSerial = json["devSerial"].ToString();//设备序列号 |
| | | eSVideoInfo.HomeId = jpushMessageInfo.HomeId; |
| | | } |
| | | |
| | | //3.打开呼叫页面 |
| | | if (eSVideoInfo == null) return; |
| | | |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, "IMOUVISIAL"); |
| | | ESOnVideo.Current.ShowESvideoVideoIntercom(eSVideoInfo, interphoneTypeEnum); |
| | | |
| | | } |
| | | else if(jpushMessageInfo.messageType.Contains(PushMessageType.Prompt.ToString())) |
| | | else if (jpushMessageInfo.messageType.Contains(PushMessageType.Prompt.ToString())) |
| | | { |
| | | ShowAlarmPushMessage(jpushMessageInfo, false); |
| | | } |
| | | } |
| | | } |
| | | catch(Exception EX) |
| | | catch (Exception EX) |
| | | { |
| | | Utlis.WriteLine("catch: " + EX.ToString()); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 解析丰林可视对讲推送数据 |
| | | /// </summary> |
| | | /// <param name="jsonStr"></param> |
| | | /// <returns></returns> |
| | | ESVideoInfo GetESOnVideoJson(string jsonStr) |
| | | //{"code":0,"data":{"list":[{"createTime":"1625798305115","modifyTime":"1625798305115","region":"100000000000000001","id":"1413326644794294273","alarmId":"20210709103818-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103818-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:38:17","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{"createTime":"1625798057197","modifyTime":"1625798057197","region":"100000000000000001","id":"1413325604946640898","alarmId":"20210709103413-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103413-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:34:12","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797973320","modifyTime":"1625797973320","region":"100000000000000001","id":"1413325253141004289","alarmId":"20210709103236-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709103236-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:32:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797782136","modifyTime":"1625797782136","region":"100000000000000001","id":"1413324451261382658","alarmId":"20210709102937-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102937-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:29:37","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797668771","modifyTime":"1625797668771","region":"100000000000000001","id":"1413323975769915394","alarmId":"20210709102743-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102743-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:27:42","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797539846","modifyTime":"1625797539846","region":"100000000000000001","id":"1413323435023466498","alarmId":"20210709102534-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102534-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:34","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625797530627","modifyTime":"1625797530627","region":"100000000000000001","id":"1413323396351983618","alarmId":"20210709102525-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709102525-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:25:25","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625796028089","modifyTime":"1625796028089","region":"100000000000000001","id":"1413317094255034369","alarmId":"20210709100024-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709100024-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T10:00:23","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795974558","modifyTime":"1625795974558","region":"100000000000000001","id":"1413316869729746946","alarmId":"20210709095931-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095931-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:31","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"},{ "createTime":"1625795966933","modifyTime":"1625795966933","region":"100000000000000001","id":"1413316837748178946","alarmId":"20210709095923-F41014762-1-10000","channelNo":1,"deviceSerial":"F41014762","alarmName":"人体感应事件","alarmPicUrl":"https://i.ys7.com/streamer/alarm/url/get?fileId=20210709095923-F41014762-1-10000-2-1&deviceSerialNo=F41014762&cn=1&isEncrypted=0&isCloudStored=0&ct=1&lc=7&bn=1_hikalarm&isDevVideo=0","alarmTime":"2021-07-09T09:59:22","homeId":"1396717478877241345","alarmType":"pir","isChecked":0,"isEncrypt":0,"deleted":0,"tenantId":"20"}],"totalCount":"13","totalPage":"2","pageNo":"1","pageSize":"10"},"timestamp":"1625807415164","isSuccess":true} |
| | | //{"platform":"1","timestamp":"1625805660249","appKey":"HDL-HOME-APP-TEST","sign":"02e433c40485b30451ebdc5ca3cd959c","deviceSerial":"F41014762","homeId":"1396717478877241345"} |
| | | /// <summary> |
| | | /// 解析丰林可视对讲推送数据 |
| | | /// </summary> |
| | | /// <param name="jsonStr"></param> |
| | | /// <returns></returns> |
| | | ESVideoInfo GetESOnVideoJson(string jsonStr) |
| | | { |
| | | try |
| | | { |
| | |
| | | /// </summary> |
| | | /// <param name="jpushMessageInfo"></param> |
| | | /// <param name="isAlarm">是否是报警信息,(加载的弹窗颜色不一样)</param> |
| | | public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo,bool isAlarm) |
| | | public void ShowAlarmPushMessage(JPushMessageInfo jpushMessageInfo, bool isAlarm) |
| | | { |
| | | //没登录不处理 |
| | | if (UserInfo.Current == null || !UserInfo.Current.IsLogin || MainPage.BasePageView == null) |
| | |
| | | var result = new HttpServerRequest().EZGetChildToken(); |
| | | if (result.Code == StateCode.SUCCESS) |
| | | { |
| | | var ezChildAccessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<EZChildAccessToken>(result.Data.ToString()); |
| | | var ezChildAccessToken = result.Data.ToString(); |
| | | |
| | | //var ezChildAccessToken = Newtonsoft.Json.JsonConvert.DeserializeObject<EZChildAccessToken>(result.Data.ToString()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!string.IsNullOrEmpty(ezChildAccessToken.accessToken)) |
| | | if (!string.IsNullOrEmpty(ezChildAccessToken)) |
| | | { |
| | | #if __IOS__ |
| | | //iOS |
| | | //初始化萤石云SDK,中文国内key、英文海外key 开发者账号使用应用包名申请的APPKEY,不同包名应用需配置不同的APPKEY |
| | | EZSDK.IOS.EZSDK.InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b"); |
| | | EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b"); |
| | | //1.设置所需河东的AccessToken和RefreshToken、域名地址 |
| | | EZSDK.IOS.EZSDK.SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken); |
| | | EZSDK.IOS.EZSDK.SetRequestHttpsHost(OnAppConfig.Instance.RequestHttpsHost); |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken); |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | //2.设置萤石子账号的AccessToken到SDK |
| | | EZSDK.IOS.EZSDK.SetEZAccessToken(ezChildAccessToken.accessToken); |
| | | //3.打开摄像头设备列表页面 |
| | | EZSDK.IOS.EZSDK.Go2EZvizMonitor(); |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(ezChildAccessToken); |
| | | ////3.打开摄像头设备列表页面 |
| | | EZSDK.IOS.EZSDK.SharedInstance().Go2EZvizMonitor(); |
| | | |
| | | //EZSDK.IOS.EZDeviceInfo info = new EZSDK.IOS.EZDeviceInfo(); |
| | | //info.de |
| | | //EZSDK.IOS.EZSDK.Play(info); |
| | | #else |
| | | //Android |
| | | //1.设置所需河东的token、域名地址 |
| | |
| | | { |
| | | if (b) |
| | | { |
| | | Android.Content.Intent intent = new Android.Content.Intent(); |
| | | var bundle = new Android.OS.Bundle(); |
| | | //传递name参数为tinyphp |
| | | bundle.PutString("Token", ezChildAccessToken.accessToken); |
| | | bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); |
| | | bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | ((BaseActivity)Shared.Application.Activity).SetPermission(result => |
| | | { |
| | | if(result) |
| | | { |
| | | Android.Content.Intent intent = new Android.Content.Intent(); |
| | | var bundle = new Android.OS.Bundle(); |
| | | //传递name参数为tinyphp |
| | | bundle.PutString("EzChildAccessToken", ezChildAccessToken); |
| | | bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); |
| | | bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); |
| | | bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); |
| | | bundle.PutInt("Platform", 1); |
| | | bundle.PutString("HomeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | }, "android.permission.RECORD_AUDIO"); |
| | | |
| | | } |
| | | }); |
| | | #endif |
| | |
| | | public static class StringId |
| | | { |
| | | /// <summary> |
| | | /// 添加告警目标 |
| | | /// </summary> |
| | | public const int AddAlarmTarget = 500; |
| | | /// <summary> |
| | | /// 添加布防功能 |
| | | /// </summary> |
| | | public const int AddDefenseFunction = 499; |
| | | /// <summary> |
| | | /// 触发延时 |
| | | /// </summary> |
| | | public const int TriggerDelay = 498; |
| | | /// <summary> |
| | | /// 自定义 |
| | | /// </summary> |
| | | public const int Custom = 497; |
| | | /// <summary> |
| | | /// 还没有关联任务布防状态 |
| | | /// </summary> |
| | | public const int ThereIsNoAssociatedTaskDeploymentStatus = 496; |
| | | /// <summary> |
| | | /// 人脸通行设置 |
| | | /// </summary> |
| | | 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> |
| | | public const int CanStartUsingEnvironmentalSensor = 481; |
| | | /// <summary> |
| | | /// 环境传感器 |
| | | /// </summary> |
| | | public const int SensorEnvironment = 480; |
| | | /// <summary> |
| | | /// 风量 |
| | | /// </summary> |
| | | public const int AirVolume = 479; |
| | |
| | | {
|
| | | //全部
|
| | | btnFloorName.Text = Language.StringByID(StringId.All);
|
| | | btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | //btnFloorName.Width = btnFloorName.GetTextWidth();
|
| | | }
|
| | | //房间
|
| | | else if (selectType == 3)
|
| | |
| | | /// </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"; |
| | |
| | | return $"/user/{Control.Ins.GatewayId}/custom/scene/execute"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防控制 |
| | | /// </summary> |
| | | public string ControlSeurity |
| | | { |
| | | get |
| | | { |
| | | return $"/user/{Control.Ins.GatewayId}/custom/security/status/set"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | 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> |
| | | /// 发送命令 |
| | |
| | | commandDictionary[FunctionAttributeKey.Brightness] = "0"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //Bug修复:一端口远程控制调光设备的调光属性时,无法控制到0,反复横跳。 |
| | | //因为On + 远程控制发送给云端使用的是link协议数据,杨涛中转给高胜处理时候逻辑上有冲突,导致无法单独控制亮度值,需要同时发送开关值与亮度值。 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if(commandDictionary.Count == 1 && commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on"); |
| | | } |
| | | } |
| | | |
| | |
| | | //远程通讯 |
| | | else |
| | | { |
| | | //Bug修复:一端口远程控制调光设备的调光属性时,无法控制到0,反复横跳。 |
| | | //因为On + 远程控制发送给云端使用的是link协议数据,杨涛中转给高胜处理时候逻辑上有冲突,导致无法单独控制亮度值,需要同时发送开关值与亮度值。 |
| | | if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | { |
| | | if (commandDictionary.Count == 1) |
| | | { |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.Brightness)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on"); |
| | | } |
| | | } |
| | | if(function.spk == SPK.LightCCT) |
| | | { |
| | | if (!commandDictionary.ContainsKey(FunctionAttributeKey.CCT)) |
| | | { |
| | | commandDictionary.Add(FunctionAttributeKey.CCT, function.GetAttrState(FunctionAttributeKey.CCT)); |
| | | } |
| | | } |
| | | } |
| | | DAL.Server.HttpServerRequest httpServer = new DAL.Server.HttpServerRequest(); |
| | | //ALink控制、Bus控制使用同一个接口控制,由云端负责解析 |
| | | var apiControlData = function.GetApiControlData(commandDictionary); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防控制 |
| | | /// </summary> |
| | | public void ControlSecurity(SecurityAlarm securityAlarm,string state) |
| | | { |
| | | if (!Ins.GatewayOnline_Local)//网关本地不在线 |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var result = pm.SetSecurityStatus(new List<SecurityState>() { new SecurityState() { |
| | | gatewayId = DB_ResidenceData.Instance.HomeGateway.gatewayId, |
| | | sid = securityAlarm.sid, status = state, userSecurityId = securityAlarm.userSecurityId |
| | | } }); |
| | | } |
| | | else |
| | | { |
| | | Dictionary<string, string> keys = new Dictionary<string, string>(); |
| | | keys.Add("sid", securityAlarm.sid); |
| | | keys.Add("status", state); |
| | | var aLinkData = new AlinkReadFunctionStatusObj() |
| | | { |
| | | id = Ins.msg_id.ToString(), |
| | | objects = new List<Dictionary<string, string>>() |
| | | { |
| | | keys |
| | | }, |
| | | time_stamp = Utlis.GetTimestamp() |
| | | }; |
| | | var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData); |
| | | var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlSeurity, aLinkJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// a协议控制场景 |
| | | /// </summary> |
| | | /// <param name="scene"></param> |
| | |
| | | //} |
| | | 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) |
| | | { |
| | |
| | | { |
| | | //TODO 暂时不传正确的数据上去,如果后面要优化前面这些代码 |
| | | UpdataFunctionStatus(receiveObj.BodyDataString, null); |
| | | } |
| | | else if (receiveObj.Topic == CommunicationTopic.ct.ControlSeurity +"_reply") |
| | | { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<AlinkFunctionStatusObj>(receiveObj.BodyDataString); |
| | | if (temp != null) |
| | | { |
| | | Control_Udp.ReceiveRepeatManager(temp.id, null); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | 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 |
| | | { |
| | |
| | | switch (function.spk) |
| | | { |
| | | case SPK.LightCCT: |
| | | byte b0 = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0 |
| | | if(commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | byte b0 = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b0 = 0; |
| | | } |
| | | else |
| | | { |
| | | b0 = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness));// == 0 ? (byte)100 : Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | b0 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | var bytes0 = new byte[] { function.bus.LoopId, |
| | | b0, |
| | |
| | | ControlBytesSend(Command.SetLogicLoopColor, subnetId, deviceId, bytes0, 1); |
| | | break; |
| | | case SPK.LightRGB: |
| | | byte b = 100;//开关操作依据on_off字段,实际开关值依据brightness,当on_off为打开,brightness不能为0 |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | byte b = 100; |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | byte lightBri1 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (lightBri1 == 0) |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b = 100; |
| | | b = 0; |
| | | } |
| | | else |
| | | { |
| | | b = lightBri1; |
| | | b = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | var tempLight = new Light(); |
| | | var bytes = new byte[] { function.bus.LoopId, |
| | |
| | | break; |
| | | case SPK.LightDimming: |
| | | byte b1 = 100; |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | if (commandDictionary.ContainsKey(FunctionAttributeKey.OnOff)) |
| | | { |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | byte lightBri = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | if (lightBri == 0) |
| | | if (function.trait_on_off.curValue.ToString() == "off") |
| | | { |
| | | b1 = 100; |
| | | b1 = 0; |
| | | } |
| | | else |
| | | { |
| | | b1 = lightBri; |
| | | b1 = function.lastBrightness == 0 ? (byte)100 : Convert.ToByte(function.lastBrightness); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | b1 = Convert.ToByte(function.GetAttrState(FunctionAttributeKey.Brightness)); |
| | | } |
| | | ControlBytesSend(Command.SetSingleLight, subnetId, deviceId, new byte[] { |
| | | function.bus.LoopId, |
| | | b1, |
| | |
| | | light.trait_on_off.curValue = receiveBytes[light.bus.LoopId] == 0 ? "off" : "on"; |
| | | if (light.trait_on_off.curValue.ToString() == "on") |
| | | { |
| | | light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[2].ToString()); |
| | | light.SetAttrState(FunctionAttributeKey.Brightness, receiveBytes[i+1].ToString()); |
| | | light.lastState = Language.StringByID(StringId.Brightness) + " : " + receiveBytes[2] + "%"; |
| | | } |
| | | HomePage.UpdataFunctionStates(light); |
| | |
| | | .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"); |
| | |
| | | #region ■ 萤石云SDK相关接口_________________________ |
| | | /// <summary> |
| | | /// 河东获取萤石云子账号token的接口 |
| | | /// 2021-07-07 新方案接口调整对接 |
| | | /// </summary> |
| | | public ResponsePackNew EZGetChildToken() |
| | | { |
| | | Dictionary<string, object> d = new Dictionary<string, object>(); |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("platform", "1"); |
| | | var requestJson = HttpUtil.GetSignRequestJson(d); |
| | | return HttpUtil.RequestHttpsPostFroHome(NewAPI.API_POST_EZ_GetChildToken, requestJson); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 河东获取萤石云子账号token的接口 |
| | | /// </summary> |
| | | public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/childToken"; |
| | | public const string API_POST_EZ_GetChildToken = "/home-wisdom/platform/yingshi/child/token"; |
| | | |
| | | |
| | | #endregion |
| | |
| | | /// </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 |
| | | |
| | | |
| | |
| | | using System.Threading; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.UI.UI2.PersonalCenter.PirDevice; |
| | | using HDL_ON.Entity; |
| | | |
| | | #if __IOS__ |
| | | using Shared.IOS.ESVideoOnSDK; |
| | |
| | | int.TryParse(mESVideoInfo.roomno, out roomID); |
| | | |
| | | #if __IOS__ |
| | | if (interphoneType == "IMOUVISIAL") |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | //乐橙可视对讲 |
| | | //1.初始化LCOpenSDK_Api |
| | |
| | | } |
| | | #else |
| | | Intent intent = null; |
| | | if (interphoneType == "IMOUVISIAL") |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); |
| | | } |
| | |
| | | int roomID = 0; |
| | | int.TryParse(mESVideoInfo.roomno, out roomID); |
| | | #if __IOS__ |
| | | if (interphoneType == "IMOUVISIAL") |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | //乐橙可视对讲 |
| | | //1.初始化LCOpenSDK_Api |
| | |
| | | vc.MLCCallDelegate = mOnLCCallDelegate; |
| | | //vc.MLCCallDelegate = new OnLCCallDelegate(this); |
| | | Shared.Application.currentVC.NavigationController.PushViewController(vc, true); |
| | | } |
| | | else if (interphoneType == InterphoneType.EZVIZ.ToString()) |
| | | { |
| | | //萤石猫眼呼叫 |
| | | //初始化萤石云SDK,中文国内key、英文海外key 开发者账号使用应用包名申请的APPKEY,不同包名应用需配置不同的APPKEY |
| | | EZSDK.IOS.EZSDK.SharedInstance().InitLibWithAppKey("1aa98a90489b4838b966b57018b4b04b", "1aa98a90489b4838b966b57018b4b04b"); |
| | | //1.设置所需河东的AccessToken和RefreshToken、域名地址 |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetHDlAccessToken(UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken); |
| | | |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, mESVideoInfo.HomeId); |
| | | //2.设置萤石子账号的AccessToken到SDK |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetEZAccessToken(mESVideoInfo.Lc_AccessToken); |
| | | //3.打开视频播放页面 |
| | | EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(mESVideoInfo.DeviceSerial); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | #region |
| | | |
| | | Intent intent = null; |
| | | if (interphoneType == "IMOUVISIAL") |
| | | if (interphoneType == InterphoneType.IMOUVISIAL.ToString()) |
| | | { |
| | | intent = new Intent(Shared.Application.Activity, typeof(HDL_ON_Android.LeChengVideoActivity)); |
| | | } |
| | | else if (interphoneType == InterphoneType.EZVIZ.ToString()) |
| | | { |
| | | ((BaseActivity)Shared.Application.Activity).SetCamera(b => |
| | | { |
| | | if (b) |
| | | { |
| | | intent = new Android.Content.Intent(); |
| | | var bundle = new Android.OS.Bundle(); |
| | | //传递name参数为tinyphp |
| | | bundle.PutString("EzChildAccessToken", mESVideoInfo.Lc_AccessToken); |
| | | bundle.PutString("HdlToken", UserInfo.Current.LoginTokenString); |
| | | bundle.PutString("Url", OnAppConfig.Instance.RequestHttpsHost); |
| | | bundle.PutString("EzvizAppKey", "1aa98a90489b4838b966b57018b4b04b"); |
| | | bundle.PutInt("Platform", 1); |
| | | bundle.PutString("HomeId", mESVideoInfo.HomeId); |
| | | bundle.PutString("DeviceSerial", mESVideoInfo.DeviceSerial); |
| | | intent.PutExtras(bundle); |
| | | intent.SetComponent(new Android.Content.ComponentName(Shared.Application.Activity, "com.videogo.MainActivity")); |
| | | Shared.Application.Activity.StartActivity(intent); |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | #endif |
| | | |
| | | /// <summary> |
| | | /// 测试方法 |
| | | /// </summary> |
| | | /// <param name="isMonitor"></param> |
| | | public void Test(bool isMonitor = true) |
| | | { |
| | | ESVideoInfo eSVideoInfo = new ESVideoInfo() |
| | | { |
| | | DeviceName = "室外机88", |
| | | ESVideoUUID = "JJY000019VPLLF", |
| | | ///// <summary> |
| | | ///// 测试方法 |
| | | ///// </summary> |
| | | ///// <param name="isMonitor"></param> |
| | | //public void Test(bool isMonitor = true) |
| | | //{ |
| | | // ESVideoInfo eSVideoInfo = new ESVideoInfo() |
| | | // { |
| | | // DeviceName = "室外机88", |
| | | // ESVideoUUID = "JJY000019VPLLF", |
| | | |
| | | }; |
| | | if (isMonitor) |
| | | { |
| | | ShowESVideoMonitor(eSVideoInfo, ""); |
| | | } |
| | | else |
| | | { |
| | | eSVideoInfo.callId = "88888"; |
| | | ShowESvideoVideoIntercom(eSVideoInfo, ""); |
| | | } |
| | | // }; |
| | | // if (isMonitor) |
| | | // { |
| | | // ShowESVideoMonitor(eSVideoInfo, ""); |
| | | // } |
| | | // else |
| | | // { |
| | | // eSVideoInfo.callId = "88888"; |
| | | // ShowESvideoVideoIntercom(eSVideoInfo, ""); |
| | | // } |
| | | |
| | | } |
| | | //} |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | |
| | | //========================大华========================== |
| | | |
| | | /// <summary> |
| | | /// 账号accessToken |
| | | /// 萤石子账号Token也共用这个字段 |
| | | /// </summary> |
| | | public string Lc_AccessToken = string.Empty; |
| | | |
| | |
| | | /// 账号标记:0国内,1国外;国内国外访问都地址不一样 |
| | | /// </summary> |
| | | public int Lc_Location = 0; |
| | | |
| | | //========================萤石云猫眼========================== |
| | | /// <summary> |
| | | /// 住宅Id |
| | | /// </summary> |
| | | public string HomeId = string.Empty; |
| | | /// <summary> |
| | | /// 设备序列号 |
| | | /// </summary> |
| | | public string DeviceSerial = string.Empty; |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | /// 大华可视对讲平台 |
| | | /// </summary> |
| | | IMOUVISIAL, |
| | | /// <summary> |
| | | /// 萤石猫眼呼叫 |
| | | /// </summary> |
| | | EZVIZ, |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | public string MasterToken; |
| | | |
| | | //RegionInfoRes _residecenInfo; |
| | | RegionInfoRes _residecenInfo = new RegionInfoRes(); |
| | | /// <summary> |
| | | /// 住宅基础信息 |
| | |
| | | public HomeGatewayInfo HomeGateway; |
| | | |
| | | /// <summary> |
| | | /// 0:bus网关 |
| | | /// 1:A协议网关 |
| | | /// 0:一端口 |
| | | /// 1:Link协议网关 |
| | | /// </summary> |
| | | public int GatewayType |
| | | { |
| | |
| | | //#endif |
| | | if (HomeGateway == null) |
| | | return -1; |
| | | if (HomeGateway.gatewayType == "AGATEWAY") |
| | | if (HomeGateway.gatewayType != "BUSUDPGATEWAY") |
| | | { |
| | | return 1; |
| | | } |
| | |
| | | /// <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); |
| | |
| | | /// </summary> |
| | | public const string SensorEnvironment = "sensor.environment"; |
| | | /// <summary> |
| | | /// 青萍传感器2(co2,pm25,温湿度,电量,tvoc) |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment2 = "sensor.environment2"; |
| | | /// <summary> |
| | | /// 青萍传感器3(co2,pm25,温湿度) |
| | | /// 青萍环境传感器 |
| | | /// </summary> |
| | | public const string SensorEnvironment3 = "sensor.environment3"; |
| | | |
| | |
| | | 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> |
| | | /// 收藏标记 |
| | | /// </summary> |
| | | public bool collect = false; |
| | | /// <summary> |
| | | /// 是否允许删除 |
| | | /// </summary> |
| | | public bool can_delete = true; |
| | | |
| | | /// <summary> |
| | | /// 创建该场景的用户ID |
| | |
| | | /// <summary> |
| | | /// 属性值单位 |
| | | /// </summary> |
| | | public string GetUintString() |
| | | public string GetUintString(string inputKey = "") |
| | | { |
| | | var us = ""; |
| | | switch (key) |
| | | var swithchString = key; |
| | | if(!string.IsNullOrEmpty(inputKey)) |
| | | { |
| | | swithchString = inputKey; |
| | | } |
| | | switch (swithchString) |
| | | { |
| | | case FunctionAttributeKey.SetTemp: |
| | | case FunctionAttributeKey.RoomTemp: |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Common; |
| | | using HDL_ON.DAL.Server; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.Entity |
| | | { |
| | | /// <summary> |
| | | /// 安防中心 |
| | | /// </summary> |
| | | public class SecurityCenter |
| | | { |
| | | static SecurityCenter _center; |
| | | |
| | | public static SecurityCenter Security |
| | | { |
| | | get |
| | | { |
| | | if(_center == null) |
| | | { |
| | | _center = new SecurityCenter(); |
| | | } |
| | | return _center; |
| | | } |
| | | } |
| | | |
| | | SecurityAlarm _securityAlarm; |
| | | /// <summary> |
| | | /// 当前布防模式 |
| | | /// </summary> |
| | | public SecurityAlarm CurrentDefenseMode |
| | | { |
| | | get |
| | | { |
| | | return _securityAlarm; |
| | | } |
| | | set |
| | | { |
| | | _securityAlarm = value; |
| | | UI.HomePage.LoadEvent_RefreshSecurityStatus(); |
| | | } |
| | | } |
| | | |
| | | HttpServerRequest httpServerRequest = new HttpServerRequest(); |
| | | |
| | | |
| | | |
| | | List<SecurityAlarm> _securityAlarmList; |
| | | /// <summary> |
| | | /// 防区列表 |
| | | /// </summary> |
| | | public List<SecurityAlarm> securityAlarmList |
| | | { |
| | | get |
| | | { |
| | | if(_securityAlarmList == null) |
| | | { |
| | | _securityAlarmList = GetSecurityAlarmList(); |
| | | } |
| | | return _securityAlarmList; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 读取云端安防列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<SecurityAlarm> GetSecurityAlarmList() |
| | | { |
| | | var pack = httpServerRequest.GetSecurityList(); |
| | | if(pack.Code == StateCode.SUCCESS) |
| | | { |
| | | var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SecurityAlarm>>(pack.Data.ToString()); |
| | | if(revData!= null) |
| | | { |
| | | _securityAlarmList = revData; |
| | | return revData; |
| | | } |
| | | } |
| | | return new List<SecurityAlarm>(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 状态 enable布防、disable撒防 |
| | | /// </summary> |
| | | public string status |
| | | { |
| | | get |
| | | { |
| | | string result = "disable"; |
| | | foreach(var s in securityAlarmList) |
| | | { |
| | | if(s.status == "enable") |
| | | { |
| | | result = "enable"; |
| | | break; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public class SecurityAlarm |
| | | { |
| | | /// <summary> |
| | | /// 安防云端id |
| | | /// </summary> |
| | | public string userSecurityId; |
| | | /// <summary> |
| | | /// 安防sid |
| | | /// </summary> |
| | |
| | | /// <summary> |
| | | /// 状态 enable布防、disable撒防 |
| | | /// </summary> |
| | | public string status; |
| | | public string status = "disable"; |
| | | /// <summary> |
| | | /// 类型 |
| | | /// "all"--全宅布防, |
| | |
| | | /// "all_day":24小时, |
| | | /// "mute":静音 |
| | | /// </summary> |
| | | public string type; |
| | | public string type = "normal"; |
| | | /// <summary> |
| | | /// 更新时间 |
| | | /// </summary> |
| | |
| | | var ssd = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); |
| | | FileUtlis.Files.WriteFileByBytes(savePath, ssd); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存安防信息 |
| | | /// </summary> |
| | | public string SaveInfo() |
| | | { |
| | | HttpServerRequest hsr = new HttpServerRequest(); |
| | | if (string.IsNullOrEmpty(sid)) |
| | | { |
| | | NewSid(); |
| | | var pack = hsr.AddSecurity(new List<SecurityAlarm>() { this }); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | SaveFile(); |
| | | }else |
| | | { |
| | | sid = ""; |
| | | } |
| | | return pack.Code; |
| | | } |
| | | else |
| | | { |
| | | var pack = hsr.EditSecurity(new List<SecurityAlarm>() { this }); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | SaveFile(); |
| | | } |
| | | return pack.Code; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 生成sid方法 |
| | | /// </summary> |
| | | public void NewSid() |
| | | { |
| | | try |
| | | { |
| | | string sOidBeginsWith = "000101";//厂商 + 通讯方式 |
| | | DateTime dt = DateTime.Now; |
| | | DateTime startTime = TimeZoneInfo.ConvertTimeToUtc(new DateTime(2020, 1, 1)); |
| | | long m = (long)((dt - startTime).TotalMilliseconds / 10); |
| | | string sTimeSpan = "00000000"; |
| | | |
| | | byte[] arry = new byte[4]; |
| | | arry[0] = (byte)(m & 0xFF); |
| | | arry[1] = (byte)((m & 0xFF00) >> 8); |
| | | arry[2] = (byte)((m & 0xFF0000) >> 16); |
| | | arry[3] = (byte)((m >> 24) & 0xFF); |
| | | sTimeSpan = arry[0].ToString("X2") + arry[1].ToString("X2") + arry[2].ToString("X2") + arry[3].ToString("X2"); |
| | | |
| | | |
| | | if (sTimeSpan.Length >= 8) |
| | | { |
| | | sTimeSpan = sTimeSpan.Substring(0, 8); |
| | | } |
| | | else |
| | | { |
| | | sTimeSpan = Guid.NewGuid().ToString().Substring(0, 8); |
| | | //sTimeSpan = "00000000"; |
| | | } |
| | | |
| | | sid = sOidBeginsWith + sTimeSpan; |
| | | |
| | | sid += "16"; |
| | | sid += "1601"; |
| | | int maxId = 1; |
| | | |
| | | |
| | | for (int i = 0; i < SecurityCenter.Security.securityAlarmList.Count; i++) |
| | | { |
| | | string s = SecurityCenter.Security.securityAlarmList[i].sid.Substring(20, 4); |
| | | int iThisSceneId = Convert.ToInt16(s, 16); |
| | | if (iThisSceneId > maxId) |
| | | maxId = iThisSceneId; |
| | | } |
| | | |
| | | sid += (maxId + 1).ToString("X4"); |
| | | sid += "0000"; |
| | | } |
| | | catch |
| | | { |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public string bypass; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 安防输入 |
| | | /// </summary> |
| | | public class SecurityInput |
| | | public class SecurityInput |
| | | { |
| | | /// <summary> |
| | | /// 输入条件(功能)的sid |
| | |
| | | /// 安防输入条件 |
| | | /// </summary> |
| | | public List<SecurityInputCondition> condition = new List<SecurityInputCondition>(); |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | |
| | | [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> |
| | | /// <param name="inputValue"></param> |
| | | /// <returns></returns> |
| | | public string GetStateText(string inputValue) |
| | | { |
| | | string text = ""; |
| | | |
| | | if (GetFunction() == null) |
| | | return text; |
| | | switch (GetFunction().spk) |
| | | { |
| | | case SPK.SensorGas: |
| | | case SPK.SensorSmoke: |
| | | if (inputValue == "true") |
| | | { |
| | | text += Language.StringByID(StringId.InAlarm) + " "; |
| | | } |
| | | else if (inputValue == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | | break; |
| | | case SPK.SensorPir: |
| | | if (inputValue == "true") |
| | | { |
| | | text += Language.StringByID(StringId.youren) + " "; |
| | | } |
| | | else if (inputValue == "false") |
| | | { |
| | | text += Language.StringByID(StringId.wuren) + " "; |
| | | } |
| | | break; |
| | | case SPK.SensorWater: |
| | | if (inputValue == "true") |
| | | { |
| | | text += Language.StringByID(StringId.WaterLeakage) + " "; |
| | | } |
| | | else if (inputValue == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Normal) + " "; |
| | | } |
| | | break; |
| | | case SPK.SensorDoorWindow: |
| | | if (inputValue == "true") |
| | | { |
| | | text += Language.StringByID(StringId.Open) + " "; |
| | | } |
| | | else if (inputValue == "false") |
| | | { |
| | | text += Language.StringByID(StringId.Close) + " "; |
| | | } |
| | | break; |
| | | } |
| | | |
| | | return text; |
| | | } |
| | | |
| | | /// <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>(); |
| | | |
| | | /// <summary> |
| | | /// 加入输入条件 |
| | | /// 本地判断使用 |
| | | /// </summary> |
| | | [Newtonsoft.Json.JsonIgnore] |
| | | public bool addCondition = false; |
| | | |
| | | [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> |
| | | /// 安防输出状态 |
| | |
| | | /// <summary> |
| | | /// 安防列表 |
| | | /// </summary> |
| | | public List<SecurityAlarm> securities = new List<SecurityAlarm>(); |
| | | public List<SecurityAlarm> securities |
| | | { |
| | | get |
| | | { |
| | | return SecurityCenter.Security.securityAlarmList; |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载功能列表 |
| | |
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\FrameLayout50.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\PirDevice\View\SaveView.cs" />
|
| | | <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" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddAlarmDeploymentPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddInputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputPage.cs" />
|
| | | <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\ArmCenter\AddOutputSettingPage.cs" />
|
| | | </ItemGroup>
|
| | | <ItemGroup>
|
| | | <Folder Include="$(MSBuildThisFileDirectory)Entity\Device\" />
|
| | |
| | | <Folder Include="$(MSBuildThisFileDirectory)UI\UI2\4-PersonalCenter\SmartSpeaker\" />
|
| | | <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.0708"; |
| | | public static string VersionString = "1.2.0820"; |
| | | ///// <summary> |
| | | ///// 客户端类型 |
| | | ///// </summary> |
| | |
| | | public static List<string> RoomNotSupportFunctionList = new List<string> |
| | | { |
| | | SPK.EnergyStandard, |
| | | SPK.MusicStandard, |
| | | }; |
| | | |
| | | |
| | |
| | | { |
| | | 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 = "tf@smarttech.com.ua";//国外账号,有住宅,登录无法显示 |
| | | //etAccount.Text = "13375012446";//测试服务器 |
| | | etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "13450425803"; |
| | | //etAccount.Text = "1033326940@qq.com"; |
| | | //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 = "551775569@qq.com"; |
| | | etAccount.Text = "2949126848@qq.com";//陈琳cct测试 |
| | | //etAccount.Text = "13168123446"; |
| | | etAccount.Text = "13168123446";//昆明金茂项目,新风问题 |
| | | //etAccount.Text = "2949126848@qq.com";//陈琳 |
| | | //etAccount.Text = "13415629083"; |
| | | //etAccount.Text = "13676202754";//巴林服务器 |
| | | //etAccount.Text = "13602944661";//kx |
| | | //etAccount.Text = "551775569@qq.com";//wcf |
| | | //etAccount.Text = "18666455392";//13375012446//13602944661//tzy 18778381374 |
| | | //etAccount.Text = "15971583093";// gs//tzy 274116637@qq.com//Sumant.Bhatia@havells.com 国外服务器测试 |
| | | etAccount.Text = "15971583093";//高胜 调光0 100 反复横跳 |
| | | //etAccount.Text = "15971583093";//高胜 |
| | | 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 |
| | |
| | | Text = "Demo模式" |
| | | }; |
| | | bodyView.AddChidren(btnDomeLogin); |
| | | |
| | | if(Language.CurrentLanguage!= "Chinese") |
| | | { |
| | | btnDomeLogin.Text = "Experience model"; |
| | | } |
| | | |
| | | btnDomeLogin.MouseUpEventHandler = (sender, e) => { |
| | | |
| | | MainPage.NoLoginMode = true; |
| | | #if DEBUG |
| | | FileUtlis.Files.DeleteAllFile(); |
| | | #endif |
| | | |
| | | //DB_ResidenceData.Instance.HomeGateway.gatewayType = "AGATEWAY"; |
| | | //楼层房间列表 |
| | | var floor1 = new SpatialInfo("FLOOR") { roomName = "F1", parentId = DB_ResidenceData.Instance.CurrentRegion.id }; |
| | | floor1.SaveRoomFile(); |
| | |
| | | sid = "light4", |
| | | deviceId = "light4", |
| | | name = Language.CurrentLanguage == "Chinese" ? "大灯" : "light 1", |
| | | spk = SPK.LightSwitch, |
| | | spk = SPK.LightDimming, |
| | | roomIds = new List<string>() { "1405771024583090178" }, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | 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="0",state = "0" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | 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="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | { |
| | | new FunctionAttributes() { key = "on_off",value =new List<string>(){ "on","off" }, curValue="on",state = "on" }, |
| | | new FunctionAttributes() { key = "mode",value =new List<string>(){ "day", "night", "away", "normal", "timer" }, curValue="day",state = "day" }, |
| | | new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26" }, |
| | | new FunctionAttributes() { key = "set_temp",value =new List<string>(){ "" }, curValue="26",state = "26" ,max = 35,min = 5 }, |
| | | new FunctionAttributes() { key = "room_temp",value =new List<string>(){ "" }, curValue="26",state = "26" }, |
| | | }, |
| | | }; |
| | |
| | | sid = "light6", |
| | | deviceId = "light6", |
| | | name = Language.CurrentLanguage == "Chinese" ? "餐厅灯1" : "Dining room light 1", |
| | | spk = SPK.LightSwitch, |
| | | spk = SPK.LightDimming, |
| | | roomIds = new List<string>() { room3.roomId }, |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | 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="0",state = "0" }, |
| | | new FunctionAttributes() { key = "brightness",value =new List<string>(){ "0","100" }, curValue="100",state = "100" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | 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="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | attributes = new List<FunctionAttributes>() |
| | | { |
| | | 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="0",state = "0" }, |
| | | new FunctionAttributes() { key = "fade_time",value =new List<string>(){ "0","100" }, curValue="0",state = "0" }, |
| | | }, |
| | | }; |
| | |
| | | #endregion |
| | | |
| | | var fileList = Common.FileUtlis.Files.ReadFiles(); |
| | | |
| | | foreach(var file in fileList) |
| | | { |
| | | FunctionList.List.IniFunctionList(file,true); |
| | | } |
| | | Room.CurrentSpatial.InitRoomListFunctions(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | frameRow.AddChidren(agreeView); |
| | | if(Language.CurrentLanguage == "Chinese") |
| | | { |
| | | agreeView.X = Application.GetRealWidth(82); |
| | | agreeView.X = Application.GetRealWidth(52); |
| | | } |
| | | //同意图标按钮 |
| | | var agreeBtn = new Button() |
| | |
| | | /// </summary> |
| | | Button btnLinkStateTip; |
| | | /// <summary> |
| | | /// 安防状态图标 |
| | | /// </summary> |
| | | Button btnSecurityStatus; |
| | | |
| | | |
| | | /// <summary> |
| | | ///住宅名称显示 |
| | | /// </summary> |
| | | Button btnResidenceName; |
| | |
| | | #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) => SPK.EvironmentSensorList().Contains(obj.spk)); |
| | | foreach (var enviTemp in enviList) |
| | | { |
| | | var humiAttr = enviTemp.attributes.Find((obj) => obj.key == "humidity"); |
| | | if (humiAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = humiAttr.state, curValue = humiAttr.curValue } }, |
| | | }; |
| | | humiSensorList.Add(newTemp); |
| | | } |
| | | var tempAttr = enviTemp.attributes.Find((obj) => obj.key == "temperature"); |
| | | if (tempAttr != null) |
| | | { |
| | | var newTemp = new Function() |
| | | { |
| | | name = enviTemp.name, |
| | | sid = enviTemp.sid, |
| | | deviceId = enviTemp.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = tempAttr.state, curValue = tempAttr.curValue } }, |
| | | }; |
| | | tempSensorList.Add(newTemp); |
| | | } |
| | | } |
| | | |
| | | var btnEnvirValuesTitle = new Button() { |
| | | X = Application.GetRealWidth(12), |
| | |
| | | { |
| | | btnIndoorTempValues.Text = "/--°"; |
| | | double tempTotalValues = 0; |
| | | double tempTotalCount = 0; |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | | double tempValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue); |
| | | tempTotalValues += tempValue; |
| | | if (tempValue > 0) |
| | | { |
| | | tempTotalValues += tempValue; |
| | | tempTotalCount++; |
| | | } |
| | | } |
| | | if (tempTotalValues > 0) |
| | | { |
| | | btnIndoorTempValues.Text = "/" + tempTotalValues + "°"; |
| | | btnIndoorTempValues.Text = "/" + (tempTotalValues/ tempTotalCount).ToString("0.0") + "°"; |
| | | } |
| | | } |
| | | btnIndoorTempValues.Width = btnIndoorTempValues.GetTextWidth(); |
| | |
| | | { |
| | | btnIndoorHumiValues.Text = "/--%"; |
| | | double humiTotalValues = 0; |
| | | double humiTotalCount = 0; |
| | | foreach (var humi in humiSensorList) |
| | | { |
| | | double humiValue = 0; |
| | | double.TryParse(humi.GetAttrState(FunctionAttributeKey.Value), out humiValue); |
| | | humiTotalValues += humiValue; |
| | | if (humiValue > 0) |
| | | { |
| | | humiTotalValues += humiValue; |
| | | humiTotalCount++; |
| | | } |
| | | } |
| | | if (humiTotalValues > 0) |
| | | { |
| | | btnIndoorHumiValues.Text = "/" + humiTotalValues + "%"; |
| | | btnIndoorHumiValues.Text = "/" + (humiTotalValues / humiTotalCount).ToString("0") + "%"; |
| | | } |
| | | } |
| | | btnIndoorHumiValues.Width = btnIndoorHumiValues.GetTextWidth(); |
| | |
| | | btnPm25Values.Width = btnPm25Values.GetTextWidth(); |
| | | environmentalView.AddChidren(btnPm25Values); |
| | | #endregion |
| | | |
| | | btnSecurityStatus = new Button() |
| | | { |
| | | X = Application.GetRealWidth(329), |
| | | Y = Application.GetRealHeight(34), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | SelectedImagePath = "Collection/DefenseStatusIcon.png", |
| | | UnSelectedImagePath = "Collection/DisarmStatusIcon.png" |
| | | }; |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | topView.AddChidren(btnSecurityStatus); |
| | | btnSecurityStatus.IsSelected = SecurityCenter.Security.CurrentDefenseMode != null; |
| | | btnSecurityStatus.MouseUpEventHandler = (sender, e) => { |
| | | var page = new ArmCenterPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | } |
| | | |
| | | |
| | | #region msg |
| | | FrameLayout msgView; |
| | |
| | | |
| | | |
| | | #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" }, |
| | |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshAir() |
| | | { |
| | | if (bodyView != null) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | bodyView.btnTempValues.Text = MainPage.cityInfo.temperature == null ? "--" : MainPage.cityInfo.temperature + "°"; |
| | | bodyView.btnHumidityValues.Text = MainPage.cityInfo.humidity == null ? "--" : MainPage.cityInfo.humidity + "%"; |
| | | bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25; |
| | | } |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.btnTempValues.Text = MainPage.cityInfo.temperature == null ? "--" : MainPage.cityInfo.temperature + "°"; |
| | | bodyView.btnHumidityValues.Text = MainPage.cityInfo.humidity == null ? "--" : MainPage.cityInfo.humidity + "%"; |
| | | bodyView.btnPm25Values.Text = MainPage.cityInfo.pm25 == null ? "--" : MainPage.cityInfo.pm25; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新安防状态 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshSecurityStatus() |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.btnSecurityStatus.IsSelected = SecurityCenter.Security.CurrentDefenseMode != null; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | 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"); |
| | |
| | | } |
| | | } |
| | | double humiTotalValues = 0; |
| | | int humiTotalCount = 0; |
| | | foreach (var temp in humiSensorList) |
| | | { |
| | | double humiValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out humiValue); |
| | | humiTotalValues += humiValue; |
| | | if(humiValue > 0) |
| | | { |
| | | humiTotalValues += humiValue; |
| | | humiTotalCount++; |
| | | } |
| | | } |
| | | if (humiTotalValues > 0) |
| | | { |
| | | bodyView.btnIndoorHumiValues.Text = "/" + humiTotalValues + "%"; |
| | | bodyView.btnIndoorHumiValues.Text = "/" + (humiTotalValues /humiTotalCount).ToString("0")+ "%"; |
| | | } |
| | | bodyView.btnIndoorHumiValues.Width = bodyView.btnIndoorHumiValues.GetTextWidth(); |
| | | } |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新室内传感器数据-晚点 |
| | | /// 更新室内传感器数据 |
| | | /// </summary> |
| | | public static void LoadEvent_RefreshEnvirIndoorTemp() |
| | | { |
| | |
| | | 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"); |
| | |
| | | } |
| | | } |
| | | double tempTotalValues = 0; |
| | | int tempTotalCount = 0; |
| | | foreach (var temp in tempSensorList) |
| | | { |
| | | double tempValue = 0; |
| | | double.TryParse(temp.GetAttrState(FunctionAttributeKey.Value), out tempValue); |
| | | tempTotalValues += tempValue; |
| | | if (tempValue > 0) |
| | | { |
| | | tempTotalValues += tempValue; |
| | | tempTotalCount++; |
| | | } |
| | | } |
| | | if (tempTotalValues > 0) |
| | | { |
| | | bodyView.btnIndoorTempValues.Text = "/" + tempTotalValues + "°"; |
| | | bodyView.btnIndoorTempValues.Text = "/" + (tempTotalValues /tempTotalCount).ToString("0.0")+ "°"; |
| | | } |
| | | bodyView.btnIndoorTempValues.Width = bodyView.btnIndoorTempValues.GetTextWidth(); |
| | | } |
| | |
| | | } |
| | | }); |
| | | runCount++; |
| | | System.Threading.Thread.Sleep(8); |
| | | System.Threading.Thread.Sleep(12); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | Height = Application.GetRealWidth(192 + 20),//2020-12-01 房间图片比例改回16:9 |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.roomId, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | |
| | |
| | | Height = Application.GetRealWidth(70 + 20), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | Tag = room.roomId, |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | roomListView.AddChidren(roomView); |
| | | LoadSmallPirtureRoomRow(roomView, room); |
| | |
| | | roomView.RemoveAll(); |
| | | roomFloorChangeView.BackgroundColor = roomListView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | roomView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | //roomView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | |
| | | |
| | | var viewbg = new ImageView() |
| | | var viewbg = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(70), |
| | |
| | | |
| | | var btnAllClose = new Button() |
| | | { |
| | | X = Application.GetRealWidth(288), |
| | | Y = Application.GetRealWidth(10), |
| | | Width = Application.GetMinRealAverage(58), |
| | | Height = Application.GetMinRealAverage(58), |
| | | X = Application.GetRealWidth(278), |
| | | Y = Application.GetRealWidth(15), |
| | | Width = Application.GetMinRealAverage(50), |
| | | Height = Application.GetMinRealAverage(50), |
| | | UnSelectedImagePath = "Classification/Room/AllCloseIcon2.png", |
| | | Tag = "AllClose", |
| | | Visible = false |
| | |
| | | functionOnCount = FunctionList.List.GetAirFreshList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case ShowFunction.Music: |
| | | //functionCount = Music.A31MusicModel.A31MusicModelList.Count; |
| | | //functionOnCount = Music.A31MusicModel.A31MusicModelList.FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | //if(functionCount == 0) |
| | | //{ |
| | | // functionCount = FunctionList.List.GetMusicList().Count; |
| | | //} |
| | | functionCount = FunctionList.List.GetMusicList().Count; |
| | | #if DEBUG |
| | | functionCount = 1; |
| | | #endif |
| | | break; |
| | | case ShowFunction.Panel: |
| | | break; |
| | |
| | | break; |
| | | case ShowFunction.SecurityCenter: |
| | | functionCount = FunctionList.List.securities.Count; |
| | | #if DEBUG |
| | | functionCount = 1; |
| | | #endif |
| | | if (DB_ResidenceData.Instance.GatewayType == 1) |
| | | { |
| | | functionCount = 1; |
| | | } |
| | | break; |
| | | |
| | | } |
| | |
| | | new LogicView.TipPopView().TipBox(StringId.tip, StringId.targetNull); |
| | | return; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | Loading loading = new Loading(); |
| | | this.AddChidren(loading); |
| | | HDL_ON.DAL.Server.ResponsePackNew responsePackNew = null; |
| | |
| | | loading.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | |
| | | try |
| | | { |
| | | //发送新加逻辑命令; |
| | | responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | if (!MainPage.NoLoginMode) |
| | | { |
| | | //发送新加逻辑命令; |
| | | responsePackNew = Send.AddLogic(Logic.currlogic); |
| | | } |
| | | |
| | | } |
| | | catch { } |
| | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | if(MainPage.NoLoginMode) |
| | | { |
| | | Logic.LogicList.Add(Logic.currlogic); |
| | | LogicMethod.CurrLogicMethod.RemoveAllView(); |
| | | MainView.MainShow(); |
| | | return; |
| | | } |
| | | |
| | | if (responsePackNew != null && responsePackNew.Code == "0" && responsePackNew.Data.ToString() != "") |
| | | { |
| | | |
| | | |
| | | //获取逻辑详细返回是一个数组(object类型转换为数组); |
| | | var jArray = Newtonsoft.Json.Linq.JArray.Parse(responsePackNew.Data.ToString()); |
| | | for (int a = 0; a < jArray.Count; a++) |
| | |
| | | { |
| | | GetEditState(device, index, view.btnState, null, null, null); |
| | | } |
| | | |
| | | } |
| | | break; |
| | | //干接点 |
| | |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //IsBold = true |
| | | }; |
| | | bodyView.AddChidren(btnComplete); |
| | | |
| | | if (scene.can_delete) |
| | | { |
| | | bodyView.AddChidren(btnComplete); |
| | | } |
| | | LoadEventList(); |
| | | |
| | | var waitPage = new Loading(); |
| | |
| | | /// <summary> |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | /// <param name="showUnallocated">是否是显示未分配</param> |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | { |
| | | functionListView.RemoveAll(); |
| | |
| | | bodyView.AddChidren(btnOnTitle); |
| | | |
| | | #if DEBUG |
| | | btnOnIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ESOnVideo.Current.Test(); |
| | | }; |
| | | //btnOnIcon.MouseUpEventHandler += (sender, e) => |
| | | //{ |
| | | // ESOnVideo.Current.Test(); |
| | | //}; |
| | | |
| | | btnOnTitle.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | ESOnVideo.Current.Test(false); |
| | | }; |
| | | //btnOnTitle.MouseUpEventHandler += (sender, e) => |
| | | //{ |
| | | // ESOnVideo.Current.Test(false); |
| | | //}; |
| | | |
| | | #endif |
| | | |
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 |
| | | } |
| | | } |
New file |
| | |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using Shared; |
| | | using System; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 添加环境传感器步骤1界面 |
| | | /// </summary> |
| | | public class AddSensorEnvironmentPage : 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"; |
| | | } |
| | | else |
| | | { |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/EnvironmentalSensorbg.png"; |
| | | } |
| | | bodyFrameLayout.AddChidren(btnPic); |
| | | |
| | | //请输入设备机上的sn码 |
| | | var textView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(309 - 64), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(44), |
| | | }; |
| | | bodyFrameLayout.AddChidren(textView); |
| | | textView.AddChidren(new Button() { Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS.CSS_Color.DividingLineColor }); |
| | | |
| | | EditText editText = new EditText() |
| | | { |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntrySNCode), |
| | | PlaceholderTextColor = CSS.CSS_Color.PromptingColor1, |
| | | TextSize = CSS.CSS_FontSize.TextFontSize, |
| | | }; |
| | | textView.AddChidren(editText); |
| | | |
| | | if (integratedDevice.spk == SPK.SensorEnvironment2 || integratedDevice.spk == SPK.SensorEnvironment3) |
| | | { |
| | | editText.PlaceholderText = Language.StringByID(StringId.PlsEntryMacCode); |
| | | } |
| | | if (integratedDevice.spk == SPK.SensorEnvironment) |
| | | { |
| | | Button btnScan = new Button() |
| | | { |
| | | 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) => |
| | | { |
| | | var snCode = editText.Text.Trim(); |
| | | if (string.IsNullOrEmpty(snCode)) |
| | | { |
| | | editText.PlaceholderTextColor = CSS.CSS_Color.WarningColor; |
| | | } |
| | | else |
| | | { |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var pm = new HttpServerRequest(); |
| | | 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()); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | waitPage.Hide(); |
| | | var tipDialog = new OperationResultDisPalyPage(); |
| | | tipDialog.LoadPage(true, Language.StringByID(StringId.AddSuccess), "", Language.StringByID(StringId.CanStartUsingEnvironmentalSensor), Language.StringByID(StringId.Next)); |
| | | tipDialog.Show(); |
| | | AddDeviceEvent?.Invoke(new Function()); |
| | | this.CloseForm(); |
| | | }); |
| | | } |
| | | else if (pack.Code == "10801" || pack.Code == "9") |
| | | { |
| | | var mes = ""; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | mes = "该设备已经被添加。"; |
| | | } |
| | | else |
| | | { |
| | | mes = "This device has been added."; |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = mes, |
| | | CloseTime = 2, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log("2--::" + ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { waitPage.Hide(); }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | }; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 关闭界面___________________________ |
| | | |
| | | /// <summary> |
| | | /// 关闭界面 |
| | | /// </summary> |
| | | public override void CloseFormBefore() |
| | | { |
| | | this.AddDeviceEvent = null; |
| | | base.CloseFormBefore(); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
New file |
| | |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.Stan; |
| | | using HDL_ON.UI.UI2.PersonalCenter.PirDevice; |
| | | using Shared; |
| | | using System; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 添加毫米波步骤1界面 |
| | | /// </summary> |
| | | public class SensorEnvironmentManagerPage : EditorCommonForm |
| | | { |
| | | #region ■ 变量声明___________________________ |
| | | |
| | | /// <summary> |
| | | /// 添加设备完成之后的回调事件 |
| | | /// </summary> |
| | | public Action DelDeviceEvent = null; |
| | | |
| | | Function function = null; |
| | | #endregion |
| | | |
| | | #region ■ 初始化_____________________________ |
| | | /// <summary> |
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建) |
| | | /// </summary> |
| | | public void ShowForm(Function device) |
| | | { |
| | | function = device; |
| | | //设置头部信息 |
| | | base.SetTitleText(Language.StringByID(StringId.Add) + device.name); |
| | | //这个界面的背景需要白色 |
| | | bodyFrameLayout.BackgroundColor = CSS.CSS_Color.BackgroundColor; |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化中部信息 |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | { |
| | | //图片 |
| | | var btnPic = new PicViewControl(132, 132); |
| | | btnPic.Y = Application.GetRealHeight(69); |
| | | btnPic.Gravity = Gravity.CenterHorizontal; |
| | | btnPic.UnSelectedImagePath = "PersonalCenter/AddDevice/SenesorMegahealthBg.png"; |
| | | bodyFrameLayout.AddChidren(btnPic); |
| | | |
| | | var btnTip = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(309 - 44), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(319), |
| | | Height = Application.GetRealHeight(84), |
| | | IsMoreLines = true, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | bodyFrameLayout.AddChidren(btnTip); |
| | | |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | btnTip.Text = "该设备已添加到传感器类别,可到对应功能板块查看"; |
| | | } |
| | | else |
| | | { |
| | | btnTip.Text = "The device has been added to the sensor category, which can be viewed in the corresponding function block."; |
| | | } |
| | | |
| | | var btnDel = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(617 - 64), |
| | | Height = Application.GetRealHeight(50), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.WarningColor, |
| | | TextSize = CSS.CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeleteDevice, |
| | | BackgroundColor = CSS.CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyFrameLayout.AddChidren(btnDel); |
| | | |
| | | btnDel.MouseUpEventHandler = (sender, e) => { |
| | | var pack = PirSend.DeleteDevice(function.deviceId); |
| | | if (pack.Code == StateCode.SUCCESS) |
| | | { |
| | | DelDeviceEvent?.Invoke(); |
| | | this.CloseForm(); |
| | | var mes = ""; |
| | | if (Language.CurrentLanguage == "Chinese") |
| | | { |
| | | mes = "设备删除成功。"; |
| | | } |
| | | else |
| | | { |
| | | mes = "Device deleted successfully."; |
| | | } |
| | | var tip = new Tip() |
| | | { |
| | | Text = mes, |
| | | CloseTime = 2, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(pack.Code); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 关闭界面___________________________ |
| | | |
| | | /// <summary> |
| | | /// 关闭界面 |
| | | /// </summary> |
| | | public override void CloseFormBefore() |
| | | { |
| | | this.DelDeviceEvent = null; |
| | | base.CloseFormBefore(); |
| | | } |
| | | |
| | | #endregion |
| | | } |
| | | } |
| | |
| | | using HDL_ON.Stan; |
| | | using Shared; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | using HDL_ON.UI.UI2.PersonalCenter.PirDevice; |
| | | using Shared; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Text; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | this.RemoveFromParent(); |
| | | }; |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | var form2 = new AddSensorEnvironmentPage(); |
| | | form2.AddForm(device); |
| | | form2.AddDeviceEvent = (functionObj) => { |
| | | refreshView.BeginHeaderRefreshing(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | break; |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | var form3 = new AddQingpingSensorEnvirTipPage(); |
| | | form3.AddForm(device); |
| | | form3.AddDeviceEvent = (functionObj) => { |
| | | refreshView.BeginHeaderRefreshing(); |
| | | this.RemoveFromParent(); |
| | | }; |
| | | break; |
| | | } |
| | | }; |
| | | } |
| | |
| | | contentView.BeginHeaderRefreshing(); |
| | | }; |
| | | break; |
| | | case SPK.SensorEnvironment: |
| | | case SPK.SensorEnvironment2: |
| | | case SPK.SensorEnvironment3: |
| | | var smPage1 = new SensorEnvironmentManagerPage(); |
| | | smPage1.AddForm(device); |
| | | smPage1.DelDeviceEvent = () => |
| | | { |
| | | contentView.BeginHeaderRefreshing(); |
| | | }; |
| | | break; |
| | | } |
| | | }; |
| | | } |
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); |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | Button btnExit = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(258) + personalInfoView.Bottom, |
| | | Y = Application.GetRealHeight(288) + personalInfoView.Bottom, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Height = Application.GetRealHeight(60), |
| | | Width = Application.GetRealWidth(330), |
| | |
| | | { |
| | | btnSupportText.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | //throw new Exception("异常测试"); |
| | | |
| | | var getsupportPage = new FAQHelpPage(); |
| | | MainPage.BasePageView.AddChidren(getsupportPage); |
| | | getsupportPage.LoadPage(); |
| | |
| | | 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); |
| | |
| | | Button btnModeIcon = new Button() |
| | | { |
| | | X = btnTitle.X, |
| | | Y = Application.GetRealHeight(41 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(30), |
| | | Height = Application.GetRealWidth(30), |
| | | Y = Application.GetRealHeight(44 * (modeList.IndexOf(m) + 1) + 10 + 8), |
| | | Width = Application.GetRealWidth(24), |
| | | Height = Application.GetRealWidth(24), |
| | | IsSelected = device.GetAttrState(FunctionAttributeKey.Swing) == m, |
| | | }; |
| | | modeChangeView.AddChidren(btnModeIcon); |
| | |
| | | }; |
| | | modeChangeView.AddChidren(btnModeText); |
| | | |
| | | btnModeIcon.UnSelectedImagePath = acFunction.GetSwingIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = acFunction.GetSwingIconPath(m); |
| | | btnModeText.Text = acFunction.GetSwingAttrText(m); |
| | | |
| | | if (modeList.IndexOf(m) < modeList.Count - 1) |
| | | { |
| | | modeChangeView.AddChidren(new Button() |
| | |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }); |
| | | } |
| | | |
| | | btnModeIcon.UnSelectedImagePath = acFunction.GetSwingIconPath(m, false); |
| | | btnModeIcon.SelectedImagePath = acFunction.GetSwingIconPath(m); |
| | | btnModeText.Text = acFunction.GetSwingAttrText(m); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | |
| | | |
| | | //添加数据对象 |
| | | AttributesStatus buttonObj = new AttributesStatus(); |
| | | |
| | | //防止key不唯一 |
| | | var attrCount = control.attributes.Count; |
| | | var keyString = "key" + attrCount; |
| | | while (true) |
| | | { |
| | | if (control.attributes.Find((obj) => obj.key == keyString) == null) |
| | | { |
| | | break; |
| | | } |
| | | keyString = "key" + (++attrCount); |
| | | } |
| | | buttonObj.key = "key" + control.attributes.Count.ToString(); |
| | | buttonObj.value = texts; |
| | | |
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 file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddAlarmDeploymentPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 主题界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout contentView; |
| | | /// <summary> |
| | | /// 输入条件列表区域界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout inputTargetView; |
| | | /// <summary> |
| | | /// 告警目标列表区域界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout outputTargetView; |
| | | |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | Action refreshAction; |
| | | |
| | | public AddAlarmDeploymentPage(SecurityAlarm alarm, Action action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = alarm; |
| | | refreshAction = action; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView(); |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(527), |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | | #region 布防信息 |
| | | var deploymentTitleRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentTitleRow); |
| | | |
| | | var btnDeploymentTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeploymentInformation, |
| | | IsBold = true, |
| | | }; |
| | | deploymentTitleRow.AddChidren(btnDeploymentTitle); |
| | | |
| | | deploymentTitleRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | #region 布防名称 |
| | | var deploymentNameRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(50), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentNameRow); |
| | | |
| | | var btnDeploymentNameTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(72), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Name, |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentNameTitle); |
| | | btnDeploymentNameTitle.Text += ":"; |
| | | |
| | | var btnDeploymentName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(88), |
| | | Width = Application.GetRealWidth(230), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.TextualColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = securityAlarm.name |
| | | }; |
| | | deploymentNameRow.AddChidren(btnDeploymentName); |
| | | deploymentNameRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | LoadEvent_EditSecurityAlarmName(btnDeploymentName); |
| | | #endregion |
| | | |
| | | /* |
| | | #region 触发延时 |
| | | 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.TriggerDelay, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | |
| | | 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); |
| | | |
| | | //delayedRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(49), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | #endregion |
| | | */ |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | |
| | | #region 底部区域 |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | X = Application.GetRealWidth(78), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (securityAlarm.input.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择布防目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择告警目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | |
| | | return; |
| | | } |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | SecurityCenter.Security.GetSecurityAlarmList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(code); |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化部分功能区域 |
| | | /// </summary> |
| | | private void iniDefenseView() |
| | | { |
| | | |
| | | #region 布防功能 |
| | | var deploymentFunctionRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | contentView.AddChidren(deploymentFunctionRow); |
| | | |
| | | var btnFunctionTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | TextColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | 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); |
| | | ///添加输入目标 |
| | | btnAddTarget.MouseUpEventHandler = (sender, e) => { |
| | | Action<SecurityAlarm> action = (outTemp) => { |
| | | securityAlarm = outTemp; |
| | | iniInputTargetView(); |
| | | }; |
| | | var page = new AddInputPage(securityAlarm, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | deploymentFunctionRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | inputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(inputTargetView); |
| | | |
| | | iniInputTargetView(); |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化输入条件区域界面 |
| | | /// </summary> |
| | | /// <param name=""></param> |
| | | private void iniInputTargetView() |
| | | { |
| | | inputTargetView.RemoveAll(); |
| | | if (securityAlarm.input.Count > 0) |
| | | { |
| | | foreach (var target in securityAlarm.input) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(),target.StateText())); |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | //if (outputTargetView != null) |
| | | //{ |
| | | // contentView.AddChidren(outputTargetView); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | inputTargetView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.ThereIsNoAssociatedTaskDeploymentStatus, |
| | | IsMoreLines = true, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }); |
| | | |
| | | inputTargetView.Height = Application.GetRealHeight(68); |
| | | //if(outputTargetView!= null) |
| | | //{ |
| | | // contentView.AddChidren(outputTargetView); |
| | | //} |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化告警目标区域 |
| | | /// </summary> |
| | | private void iniAlarmView() |
| | | { |
| | | #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); |
| | | |
| | | btnAddOutTarget.MouseUpEventHandler = (sender, e) => { |
| | | Action<SecurityAlarm> action = (outTemp) => { |
| | | securityAlarm = outTemp; |
| | | iniAlarmListView(); |
| | | }; |
| | | var page = new AddOutputPage(securityAlarm, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | outputRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | outputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(outputTargetView); |
| | | |
| | | iniAlarmListView(); |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化告警列表区域 |
| | | /// </summary> |
| | | private void iniAlarmListView() |
| | | { |
| | | outputTargetView.RemoveAll(); |
| | | if (securityAlarm.output.Count > 0) |
| | | { |
| | | foreach (var outTarget in securityAlarm.output) |
| | | { |
| | | outputTargetView.AddChidren(new OutputRow(outTarget.GetFunction().name, outTarget.GetFunction().GetRoomListName(), "打开")); |
| | | } |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | } |
| | | else |
| | | { |
| | | outputTargetView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.ThereIsNoAssociatedTaskDeploymentStatus, |
| | | IsMoreLines = true, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改安防名称 |
| | | /// </summary> |
| | | void LoadEvent_EditSecurityAlarmName(Button btnDeploymentName) |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | Action<string> callBack = (str) => |
| | | { |
| | | //名称不能为空 |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.NameCannotBeEmpty), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | |
| | | |
| | | btnDeploymentName.Text = securityAlarm.name = str; |
| | | |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.Name, securityAlarm.name, callBack, StringId.NameCannotBeEmpty, 0, new List<string>()); |
| | | }; |
| | | btnDeploymentName.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加安防 |
| | | /// </summary> |
| | | void LoadEvent_AddDefense() |
| | | { |
| | | var responsePack = new HttpServerRequest().AddSecurity(new List<SecurityAlarm>() { securityAlarm}); |
| | | if (responsePack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 输入条件行控件 |
| | | /// </summary> |
| | | public class InputRow : RowLayout |
| | | { |
| | | Button btnTitle; |
| | | |
| | | Button btnSubTitle; |
| | | |
| | | public InputRow(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); |
| | | |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(369), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | Text = state |
| | | }; |
| | | this.AddChidren(btnState); |
| | | |
| | | |
| | | } |
| | | |
| | | 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.CenterVertical, |
| | | 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; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddInputPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | VerticalScrolViewLayout functionListView; |
| | | |
| | | Action<SecurityAlarm> refreshAction; |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | List<SecurityInput> inputList = new List<SecurityInput>(); |
| | | |
| | | public AddInputPage(SecurityAlarm alarm,Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = alarm; |
| | | refreshAction = action; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AddDefenseFunction)).LoadTopView(); |
| | | |
| | | #region 显示的功能类型切换区域 |
| | | var showdFunctionTypeRow = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(53), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(showdFunctionTypeRow); |
| | | |
| | | |
| | | var btnFloorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloorDownIcon); |
| | | |
| | | var 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, |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloor); |
| | | btnFloor.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | string nowSelectId = null; |
| | | var listAllFun = FunctionList.List.GetArmSensorList(); |
| | | |
| | | //显示下拉界面 |
| | | var form = new FloorRoomSelectPopupView(); |
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => |
| | | { |
| | | nowSelectId = selectId; |
| | | //重新刷新设备列表 |
| | | this.LoadFunctionListRow(listFun); |
| | | }, nowSelectId); |
| | | }; |
| | | |
| | | |
| | | #endregion |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = showdFunctionTypeRow.Bottom, |
| | | Height = Application.GetRealHeight(530), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | |
| | | LoadFunctionListRow(FunctionList.List.GetArmSensorList()); |
| | | |
| | | |
| | | |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | X = Application.GetRealWidth(78), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | securityAlarm.input = new List<SecurityInput>(); |
| | | foreach (var input in inputList) |
| | | { |
| | | if (input.addCondition) |
| | | { |
| | | securityAlarm.input.Add(input); |
| | | } |
| | | } |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(securityAlarm); |
| | | }; |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | // <summary> |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | { |
| | | functionListView.RemoveAll(); |
| | | if (functions == null) |
| | | { |
| | | //初始值 |
| | | functions = FunctionList.List.GetArmSensorList(); |
| | | } |
| | | foreach (var function in functions) |
| | | { |
| | | var input = securityAlarm.input.Find((obj) => obj.sid == function.sid); |
| | | if (input == null) |
| | | { |
| | | input = new SecurityInput(); |
| | | input.sid = function.sid; |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = true; |
| | | } |
| | | inputList.Add(input); |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | functionListView.AddChidren(functionRow); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(44), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(41), |
| | | Text = function.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionFloorName); |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(317), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(333), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | if(btnChooseIcon.IsSelected) |
| | | { |
| | | input.addCondition = true; |
| | | if (input.condition.Count==0) |
| | | { |
| | | ShowStateDialog(input, btnState,btnChooseIcon); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | input.addCondition = false; |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ShowStateDialog(input, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | |
| | | if (input.addCondition) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = input.StateText(); |
| | | } |
| | | |
| | | |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | private void ShowStateDialog(SecurityInput input,Button btnState,Button btnChoose = null) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout contentView = new FrameLayout(); |
| | | dialog.AddChidren(contentView); |
| | | contentView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | if (input.condition.Count == 0) |
| | | { |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = false; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | 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, |
| | | Text = input.GetStateText("true") |
| | | }; |
| | | optinView.AddChidren(btnOpen); |
| | | |
| | | optinView.AddChidren(new Button() |
| | | { |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor |
| | | }); |
| | | |
| | | Button btnClose = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | Text = input.GetStateText("false"), |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optinView.AddChidren(btnClose); |
| | | |
| | | |
| | | 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(); |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | btnState.Text = btnOpen.Text; |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = "status", |
| | | value = "true", |
| | | } |
| | | }; |
| | | input.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnState.Text = btnClose.Text; |
| | | input.condition = new List<SecurityInputCondition>() |
| | | { |
| | | new SecurityInputCondition() |
| | | { |
| | | key = "status", |
| | | value = "false", |
| | | } |
| | | }; |
| | | input.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | if (input.condition.Count == 0) |
| | | { |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using System.Text.RegularExpressions; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | public class AddOutputPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | |
| | | FrameLayout showdFunctionTypeRow; |
| | | |
| | | /// <summary> |
| | | /// 楼层选择下拉图标 |
| | | /// </summary> |
| | | Button btnFloorDownIcon; |
| | | /// <summary> |
| | | /// 楼层显示 |
| | | /// </summary> |
| | | Button btnFloor; |
| | | |
| | | /// <summary> |
| | | /// 筛选文本显示 |
| | | /// </summary> |
| | | Button btnScreenText; |
| | | |
| | | VerticalScrolViewLayout functionListView; |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | Action<SecurityAlarm> refreshAction; |
| | | List<SecurityOutput> outputList = new List<SecurityOutput>(); |
| | | |
| | | List<Function> allocatedList = new List<Function>(); |
| | | |
| | | public AddOutputPage(SecurityAlarm function, Action<SecurityAlarm> action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = function; |
| | | refreshAction = action; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载界面 |
| | | /// </summary> |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.AddFunction)).LoadTopView(); |
| | | |
| | | #region 显示的功能类型切换区域 |
| | | showdFunctionTypeRow = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(62), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(showdFunctionTypeRow); |
| | | |
| | | |
| | | btnFloorDownIcon = new Button() |
| | | { |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(18), |
| | | UnSelectedImagePath = "Public/DownIcon.png", |
| | | }; |
| | | showdFunctionTypeRow.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, |
| | | }; |
| | | showdFunctionTypeRow.AddChidren(btnFloor); |
| | | |
| | | #endregion |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = showdFunctionTypeRow.Bottom, |
| | | Height = Application.GetRealHeight(530 -100), |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | foreach (var function in FunctionList.List.Functions) |
| | | { |
| | | if (!MainPage.SceneSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | | if (function == null) |
| | | { |
| | | continue; |
| | | } |
| | | function.roomIds.Remove(null); |
| | | allocatedList.Add(function); |
| | | } |
| | | |
| | | LoadFunctionListRow(null); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | X = Application.GetRealWidth(78), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | securityAlarm.output = new List<SecurityOutput>(); |
| | | foreach (var output in outputList) |
| | | { |
| | | if (output.addCondition) |
| | | { |
| | | securityAlarm.output.Add(output); |
| | | } |
| | | } |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(securityAlarm); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | // <summary> |
| | | /// 显示功能Row |
| | | /// </summary> |
| | | void LoadFunctionListRow(List<Function> functions) |
| | | { |
| | | functionListView.RemoveAll(); |
| | | if (functions == null) |
| | | { |
| | | functions = allocatedList; |
| | | } |
| | | foreach (var function in functions) |
| | | { |
| | | var output = securityAlarm.output.Find((obj) => obj.sid == function.sid); |
| | | if (output == null) |
| | | { |
| | | output = new SecurityOutput(); |
| | | output.sid = function.sid; |
| | | } |
| | | else |
| | | { |
| | | output.addCondition = true; |
| | | } |
| | | outputList.Add(output); |
| | | |
| | | FrameLayout functionRow = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | functionListView.AddChidren(functionRow); |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(44), |
| | | Text = function.name, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionName); |
| | | |
| | | var btnFunctionFloorName = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Y = Application.GetRealHeight(24), |
| | | Width = Application.GetRealWidth(200), |
| | | Height = Application.GetRealHeight(41), |
| | | Text = function.GetRoomListName(), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel, |
| | | }; |
| | | functionRow.AddChidren(btnFunctionFloorName); |
| | | |
| | | Button btnState = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(317), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | }; |
| | | functionRow.AddChidren(btnState); |
| | | |
| | | |
| | | Button btnChooseIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(333), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | }; |
| | | functionRow.AddChidren(btnChooseIcon); |
| | | |
| | | btnChooseIcon.MouseUpEventHandler = (sender, e) => { |
| | | btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected; |
| | | if (btnChooseIcon.IsSelected) |
| | | { |
| | | output.addCondition = true; |
| | | if (output.status.Count == 0) |
| | | { |
| | | ShowStateDialog(output, btnState,btnChooseIcon); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | output.addCondition = false; |
| | | } |
| | | }; |
| | | btnState.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | ShowStateDialog(output, btnState, btnChooseIcon); |
| | | }; |
| | | |
| | | |
| | | if (output.addCondition) |
| | | { |
| | | btnChooseIcon.IsSelected = true; |
| | | btnState.Text = output.StateText(); |
| | | } |
| | | |
| | | |
| | | functionListView.AddChidren(new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(1), |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | }); |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private void ShowStateDialog(SecurityOutput output, Button btnState, Button btnChoose = null) |
| | | { |
| | | Dialog dialog = new Dialog(); |
| | | |
| | | FrameLayout contentView = new FrameLayout(); |
| | | dialog.AddChidren(contentView); |
| | | contentView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | if (output.status.Count == 0) |
| | | { |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = false; |
| | | } |
| | | } |
| | | }; |
| | | |
| | | 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.On |
| | | }; |
| | | optinView.AddChidren(btnOpen); |
| | | |
| | | optinView.AddChidren(new Button() |
| | | { |
| | | Height = 1, |
| | | BackgroundColor = CSS_Color.DividingLineColor |
| | | }); |
| | | |
| | | Button btnClose = new Button() |
| | | { |
| | | Height = Application.GetRealHeight(44), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.OFF, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | }; |
| | | optinView.AddChidren(btnClose); |
| | | |
| | | |
| | | 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(); |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | btnState.Text = btnOpen.Text; |
| | | output.status = new List<SecurityOutputStatus>() |
| | | { |
| | | new SecurityOutputStatus() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "on", |
| | | } |
| | | }; |
| | | output.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnClose.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | btnState.Text = btnClose.Text; |
| | | output.status = new List<SecurityOutputStatus>() |
| | | { |
| | | new SecurityOutputStatus() |
| | | { |
| | | key = FunctionAttributeKey.OnOff, |
| | | value = "off", |
| | | } |
| | | }; |
| | | output.addCondition = true; |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = true; |
| | | } |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | dialog.Close(); |
| | | if (output.status.Count == 0) |
| | | { |
| | | if (btnChoose != null) |
| | | { |
| | | btnChoose.IsSelected = false; |
| | | } |
| | | } |
| | | |
| | | }; |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 住宅列表点击事件 |
| | | /// </summary> |
| | | void LoadDialog_ChangeFloor() |
| | | { |
| | | string nowSelectId = null; |
| | | btnFloor.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var listAllFun = new List<Function>(); |
| | | listAllFun.AddRange(allocatedList); |
| | | |
| | | //显示下拉界面 |
| | | var form = new FloorRoomSelectPopupView(); |
| | | form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) => |
| | | { |
| | | nowSelectId = selectId; |
| | | //重新刷新设备列表 |
| | | this.LoadFunctionListRow(listFun); |
| | | }, nowSelectId); |
| | | }; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
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 AddOutputSettingPage : FrameLayout |
| | | // { |
| | | // FrameLayout bodyView; |
| | | // VerticalScrolViewLayout contentView; |
| | | // Button btnOnText; |
| | | // Button btnBrightnessText; |
| | | |
| | | // SecurityAlarm securityAlarm; |
| | | // Function alarmFunction; |
| | | // Action refreshAction; |
| | | |
| | | |
| | | // List<SecurityOutput> outputList = new List<SecurityOutput>(); |
| | | |
| | | |
| | | // public AddOutputSettingPage(SecurityAlarm alarm,Function function, Action action) |
| | | // { |
| | | // bodyView = this; |
| | | // securityAlarm = alarm; |
| | | // refreshAction = action; |
| | | // alarmFunction = function; |
| | | // } |
| | | |
| | | // public void LoadPage() |
| | | // { |
| | | // bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | // new TopViewDiv(bodyView, Language.StringByID(StringId.AddAlarmTarget)).LoadTopView(); |
| | | |
| | | // contentView = new VerticalScrolViewLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(64), |
| | | // Height = Application.GetRealHeight(520), |
| | | // ScrollEnabled = false, |
| | | // }; |
| | | // bodyView.AddChidren(contentView); |
| | | |
| | | // var output = securityAlarm.output.Find((obj) => obj.sid == alarmFunction.sid); |
| | | // if (output == null) |
| | | // { |
| | | // output = new SecurityOutput(); |
| | | // output.sid = alarmFunction.sid; |
| | | // } |
| | | // else |
| | | // { |
| | | // output.addCondition = true; |
| | | // } |
| | | // inputList.Add(output); |
| | | |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.OnOff)); |
| | | |
| | | // foreach (var attr in alarmFunction.attributes) |
| | | // { |
| | | |
| | | |
| | | |
| | | // switch (attr.key) |
| | | // { |
| | | // case FunctionAttributeKey.SetTemp: |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.SetTemp)); |
| | | // break; |
| | | // case FunctionAttributeKey.Mode: |
| | | |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.Mode)); |
| | | // break; |
| | | // case FunctionAttributeKey.FanSpeed: |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed)); |
| | | // break; |
| | | // case FunctionAttributeKey.Percent: |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.Percent)); |
| | | // break; |
| | | // case FunctionAttributeKey.Brightness: |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.Brightness)); |
| | | // break; |
| | | // case FunctionAttributeKey.FadeTime: |
| | | // LoadFunctionRow(alarmFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.FadeTime)); |
| | | // break; |
| | | // } |
| | | // } |
| | | |
| | | // var bottomView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(591), |
| | | // Height = Application.GetRealHeight(106), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(16), |
| | | // }; |
| | | // bodyView.AddChidren(bottomView); |
| | | |
| | | // var btnConfrim = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(12), |
| | | // Width = Application.GetRealWidth(220), |
| | | // Height = Application.GetRealWidth(44), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.MainBackgroundColor, |
| | | // BackgroundColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // IsBold = true, |
| | | // Radius = (uint)Application.GetRealWidth(22), |
| | | // TextID = StringId.Complete |
| | | // }; |
| | | // bottomView.AddChidren(btnConfrim); |
| | | |
| | | // btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // }; |
| | | // } |
| | | |
| | | |
| | | // /// <summary> |
| | | // /// 加载功能Row |
| | | // /// </summary> |
| | | // void LoadFunctionRow(FunctionAttributes sceneStatus) |
| | | // { |
| | | // if (sceneStatus == null) |
| | | // return; |
| | | // #region Row code |
| | | // var row = new FrameLayout() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // }; |
| | | // contentView.AddChidren(row); |
| | | |
| | | |
| | | // if (sceneStatus.key != FunctionAttributeKey.OnOff) |
| | | // { |
| | | // row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | // } |
| | | // else |
| | | // { |
| | | // if (sceneStatus.state == "stop") |
| | | // { |
| | | // sceneStatus.state = "on"; |
| | | // } |
| | | // } |
| | | // Button btnRight = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(339), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(16), |
| | | // Height = Application.GetMinRealAverage(16), |
| | | // UnSelectedImagePath = "Public/Right.png", |
| | | // }; |
| | | // row.AddChidren(btnRight); |
| | | |
| | | |
| | | // var showCode = ""; |
| | | |
| | | // var btnFunctionText = new Button() |
| | | // { |
| | | // Width = Application.GetRealWidth(330), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // Text = sceneFunctionStatus.GetValueText(showCode) + sceneFunctionStatus.GetUintString() |
| | | // }; |
| | | // row.AddChidren(btnFunctionText); |
| | | |
| | | |
| | | |
| | | // if (sceneStatus.key == FunctionAttributeKey.OnOff) |
| | | // { |
| | | // btnOnText = btnFunctionText; |
| | | // } |
| | | // else if (sceneStatus.key == FunctionAttributeKey.Brightness || sceneStatus.key == FunctionAttributeKey.Percent) |
| | | // { |
| | | // btnBrightnessText = btnFunctionText; |
| | | // } |
| | | |
| | | // var btnFunctionName = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(16), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // Text = sceneStatus.GetNameText() |
| | | // }; |
| | | // row.AddChidren(btnFunctionName); |
| | | // btnFunctionName.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // switch (sceneStatus.key) |
| | | // { |
| | | // case FunctionAttributeKey.OnOff: |
| | | // LoadEditDialog_OnOff(sceneStatus, btnFunctionText); |
| | | // break; |
| | | // case FunctionAttributeKey.Brightness: |
| | | // LoadEditDialog_Percent(sceneStatus, btnFunctionText); |
| | | // break; |
| | | // case FunctionAttributeKey.Mode: |
| | | // var statusList = new List<string>(); |
| | | // var tr = alarmFunction.localFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.Mode); |
| | | // foreach (var t in tr.value) |
| | | // { |
| | | // statusList.Add(t); |
| | | // } |
| | | // LoadEditDialog_FunctionPar(sceneStatus, btnFunctionText, statusList); |
| | | // break; |
| | | // case FunctionAttributeKey.FanSpeed: |
| | | // var fanStatusList = new List<string>(); |
| | | // var tr1 = alarmFunction.localFunction.attributes.Find((obj) => obj.key == FunctionAttributeKey.FanSpeed); |
| | | // foreach (var t in tr1.value) |
| | | // { |
| | | // fanStatusList.Add(t); |
| | | // } |
| | | // LoadEditDialog_FunctionPar(sceneStatus, btnFunctionText, fanStatusList); |
| | | // break; |
| | | // case FunctionAttributeKey.SetTemp: |
| | | // LoadEditDialog_Temp(sceneStatus, btnFunctionText); |
| | | // break; |
| | | // case FunctionAttributeKey.FadeTime: |
| | | |
| | | // break; |
| | | // case "cct": |
| | | // break; |
| | | // case FunctionAttributeKey.Percent: |
| | | // LoadEditDialog_Percent(sceneStatus, btnFunctionText); |
| | | // break; |
| | | // } |
| | | // }; |
| | | |
| | | // #endregion |
| | | // } |
| | | |
| | | |
| | | |
| | | // #region 属性选择弹窗 |
| | | // /// <summary> |
| | | // /// 加载开关选择弹窗 |
| | | // /// </summary> |
| | | // /// <param name="function"></param> |
| | | // /// <param name="btn"></param> |
| | | // void LoadEditDialog_OnOff(SceneFunctionStatus trait, Button btn) |
| | | // { |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // dialog.AddChidren(pView); |
| | | |
| | | // var optionBaseView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(500), |
| | | // Height = Application.GetRealHeight(160), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // }; |
| | | // pView.AddChidren(optionBaseView); |
| | | |
| | | // var optionView = new VerticalScrolViewLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(100), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // ScrollEnabled = false, |
| | | // }; |
| | | // optionBaseView.AddChidren(optionView); |
| | | |
| | | // var btnOn = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.On, |
| | | // IsSelected = trait.value.ToString() == "on" |
| | | // }; |
| | | // optionView.AddChidren(btnOn); |
| | | |
| | | // optionView.AddChidren(new Button() { Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // var btnOff = new Button() |
| | | // { |
| | | // Height = Application.GetRealHeight(50), |
| | | // TextAlignment = TextAlignment.Center, |
| | | // TextColor = CSS_Color.TextualColor, |
| | | // SelectedTextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // TextID = StringId.OFF, |
| | | // IsSelected = trait.value.ToString() == "off" |
| | | // }; |
| | | // optionView.AddChidren(btnOff); |
| | | |
| | | // var btnCancel = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = Application.GetRealHeight(8) + optionView.Bottom, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // TextID = StringId.Cancel, |
| | | // TextColor = CSS_Color.WarningColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // optionBaseView.AddChidren(btnCancel); |
| | | |
| | | // dialog.Show(); |
| | | |
| | | // pView.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | // btnOn.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // trait.value = "on"; |
| | | // alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on"; |
| | | // btn.Text = trait.GetValueText() + trait.GetUintString(); |
| | | |
| | | // var temp = alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | // if (temp == null) |
| | | // { |
| | | // temp = alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | // } |
| | | // if (temp != null) |
| | | // { |
| | | // if (temp.value == "0") |
| | | // { |
| | | // temp.value = "100"; |
| | | // } |
| | | // btnBrightnessText.Text = temp.GetValueText() + "%"; |
| | | // } |
| | | // }; |
| | | // btnOff.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // trait.value = "off"; |
| | | // alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off"; |
| | | // btn.Text = trait.GetValueText() + trait.GetUintString(); |
| | | |
| | | // var temp = alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | // if (temp == null) |
| | | // { |
| | | // temp = alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Percent); |
| | | // } |
| | | // if (temp != null) |
| | | // { |
| | | // if (temp.value != "0") |
| | | // { |
| | | // temp.value = "0"; |
| | | // } |
| | | // btnBrightnessText.Text = temp.GetValueText() + "%"; |
| | | // } |
| | | // }; |
| | | |
| | | // } |
| | | |
| | | // /// <summary> |
| | | // /// 加载温度选择弹窗 |
| | | // /// </summary> |
| | | // /// <param name="function"></param> |
| | | // /// <param name="btn"></param> |
| | | // void LoadEditDialog_Temp(SceneFunctionStatus trait, Button btn) |
| | | // { |
| | | // double temp = 16; |
| | | // double.TryParse(trait.value, out temp); |
| | | // trait.value = temp.ToString(); |
| | | |
| | | // List<string> pickerItems = new List<string>(); |
| | | // if (trait == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // dialog.AddChidren(pView); |
| | | |
| | | // var optionBaseView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(456 - 60), |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(260), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // pView.AddChidren(optionBaseView); |
| | | |
| | | // var topView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(40), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // optionBaseView.AddChidren(topView); |
| | | // topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // var btnCancel = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(21), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Cancel, |
| | | // }; |
| | | // topView.AddChidren(btnCancel); |
| | | |
| | | // var btnConfrim = new Button() |
| | | // { |
| | | // Width = Application.GetRealWidth(320), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Confirm, |
| | | // }; |
| | | // topView.AddChidren(btnConfrim); |
| | | |
| | | // UIPickerView uIPickerView = new UIPickerView() |
| | | // { |
| | | // Y = Application.GetRealHeight(40), |
| | | // Height = Application.GetRealHeight(210), |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // for (int i = 16; i <= 32; i += 1) |
| | | // { |
| | | // pickerItems.Add(i.ToString() + trait.GetUintString()); |
| | | // } |
| | | // uIPickerView.setNPicker(pickerItems, null, null); |
| | | // optionBaseView.AddChidren(uIPickerView); |
| | | // uIPickerView.setCurrentItems(pickerItems.IndexOf(trait.value.ToString()), 4, 5); |
| | | |
| | | // string selectItem = pickerItems[0]; |
| | | // if (pickerItems.Contains(trait.value + trait.GetUintString())) |
| | | // { |
| | | // selectItem = trait.value.ToString() + trait.GetUintString(); |
| | | // } |
| | | |
| | | // dialog.Show(); |
| | | |
| | | // pView.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | // uIPickerView.OnSelectChangeEvent = (int1, int2, int3) => { |
| | | // selectItem = pickerItems[int1]; |
| | | // }; |
| | | // btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // btn.Text = selectItem; |
| | | // //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.value.ToString() ; |
| | | // trait.value = selectItem.Replace(trait.GetUintString(), ""); |
| | | // }; |
| | | |
| | | // } |
| | | |
| | | // /// <summary> |
| | | // /// 加载亮度选择弹窗 |
| | | // /// </summary> |
| | | // /// <param name="function"></param> |
| | | // /// <param name="btn"></param> |
| | | // void LoadEditDialog_Percent(SceneFunctionStatus trait, Button btn) |
| | | // { |
| | | // if (trait == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // dialog.AddChidren(pView); |
| | | |
| | | // var optionBaseView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(467), |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(180), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // pView.AddChidren(optionBaseView); |
| | | |
| | | // var topView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(40), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // optionBaseView.AddChidren(topView); |
| | | // topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // var btnTitle = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Width = Application.GetRealWidth(100), |
| | | // Text = trait.GetNameText(), |
| | | // IsBold = true, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // topView.AddChidren(btnTitle); |
| | | |
| | | // var btnCancel = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(21), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Cancel, |
| | | // }; |
| | | // topView.AddChidren(btnCancel); |
| | | |
| | | // var btnConfrim = new Button() |
| | | // { |
| | | // Width = Application.GetRealWidth(320), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Confirm, |
| | | // }; |
| | | // topView.AddChidren(btnConfrim); |
| | | |
| | | // Button btnMinusSignIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(26), |
| | | // Y = Application.GetRealHeight(118), |
| | | // Width = Application.GetMinRealAverage(24), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // UnSelectedImagePath = "Public/MinusSignIcon.png", |
| | | // }; |
| | | // optionBaseView.AddChidren(btnMinusSignIcon); |
| | | |
| | | // DiyImageSeekBar controlBar = new DiyImageSeekBar() |
| | | // { |
| | | // X = btnMinusSignIcon.Right + Application.GetRealWidth(12), |
| | | // Y = Application.GetRealHeight(100),//414,设计数据 |
| | | // Width = Application.GetRealWidth(220), |
| | | // Height = Application.GetRealHeight(54), |
| | | // SeekBarViewHeight = Application.GetRealHeight(8), |
| | | // ThumbImagePath = "Public/ThumbImage.png", |
| | | // ThumbImageHeight = Application.GetRealHeight(54), |
| | | // ProgressBarColor = CSS_Color.MainColor, |
| | | // ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | // ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // MaxValue = 100, |
| | | // Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")), |
| | | // SeekBarPadding = Application.GetRealWidth(20), |
| | | // }; |
| | | // optionBaseView.AddChidren(controlBar); |
| | | |
| | | // Button btnPlusSgnIcon = new Button() |
| | | // { |
| | | // X = controlBar.Right + Application.GetRealWidth(12), |
| | | // Y = Application.GetRealHeight(118), |
| | | // Width = Application.GetMinRealAverage(24), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // UnSelectedImagePath = "Public/PlusSignIcon.png", |
| | | // }; |
| | | // optionBaseView.AddChidren(btnPlusSgnIcon); |
| | | |
| | | // btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // controlBar.Progress--; |
| | | // }; |
| | | // btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // controlBar.Progress++; |
| | | // }; |
| | | |
| | | // dialog.Show(); |
| | | // pView.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // }; |
| | | // btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // trait.value = controlBar.Progress.ToString(); |
| | | // btn.Text = trait.value + trait.GetUintString(); |
| | | |
| | | // var temp = alarmFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff); |
| | | // if (temp != null) |
| | | // { |
| | | // if (controlBar.Progress > 0) |
| | | // { |
| | | // temp.value = "on"; |
| | | // } |
| | | // else |
| | | // { |
| | | // temp.value = "off"; |
| | | // } |
| | | // btnOnText.Text = temp.GetValueText(); |
| | | // } |
| | | // }; |
| | | // } |
| | | |
| | | |
| | | // /// <summary> |
| | | // /// 加载变化速度选择弹窗 |
| | | // /// </summary> |
| | | // /// <param name="function"></param> |
| | | // /// <param name="btn"></param> |
| | | // void LoadEditDialog_FadeTime(SceneFunctionStatus trait, Button btn) |
| | | // { |
| | | // if (trait == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // dialog.AddChidren(pView); |
| | | |
| | | // var optionBaseView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(467), |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(180), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // pView.AddChidren(optionBaseView); |
| | | |
| | | // var topView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(40), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // optionBaseView.AddChidren(topView); |
| | | // topView.AddChidren(new Button() { Y = Application.GetRealHeight(39), Height = Application.GetRealHeight(1), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | // var btnTitle = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Width = Application.GetRealWidth(100), |
| | | // Text = trait.GetNameText(), |
| | | // IsBold = true, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // topView.AddChidren(btnTitle); |
| | | |
| | | // var btnCancel = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(21), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Cancel, |
| | | // }; |
| | | // topView.AddChidren(btnCancel); |
| | | |
| | | // var btnConfrim = new Button() |
| | | // { |
| | | // Width = Application.GetRealWidth(320), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Confirm, |
| | | // }; |
| | | // topView.AddChidren(btnConfrim); |
| | | |
| | | // Button btnMinusSignIcon = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(26), |
| | | // Y = Application.GetRealHeight(118), |
| | | // Width = Application.GetMinRealAverage(24), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // Text = "0s", |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // }; |
| | | // optionBaseView.AddChidren(btnMinusSignIcon); |
| | | |
| | | // DiyImageSeekBar controlBar = new DiyImageSeekBar() |
| | | // { |
| | | // X = btnMinusSignIcon.Right + Application.GetRealWidth(12), |
| | | // Y = Application.GetRealHeight(100),//414,设计数据 |
| | | // Width = Application.GetRealWidth(220), |
| | | // Height = Application.GetRealHeight(54), |
| | | // SeekBarViewHeight = Application.GetRealHeight(8), |
| | | // ThumbImagePath = "Public/ThumbImage.png", |
| | | // ThumbImageHeight = Application.GetRealHeight(54), |
| | | // ProgressBarColor = CSS_Color.MainColor, |
| | | // ProgressTextColor = CSS_Color.FirstLevelTitleColor, |
| | | // ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // MaxValue = 100, |
| | | // Progress = trait.value.ToString().Replace("{}", "") == "" ? 0 : Convert.ToInt32(trait.value.Replace("{}", "")), |
| | | // SeekBarPadding = Application.GetRealWidth(20), |
| | | // }; |
| | | // optionBaseView.AddChidren(controlBar); |
| | | |
| | | // Button btnPlusSgnIcon = new Button() |
| | | // { |
| | | // X = controlBar.Right + Application.GetRealWidth(12), |
| | | // Y = Application.GetRealHeight(118), |
| | | // Width = Application.GetMinRealAverage(24), |
| | | // Height = Application.GetMinRealAverage(24), |
| | | // Text = "10s", |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | // }; |
| | | // optionBaseView.AddChidren(btnPlusSgnIcon); |
| | | |
| | | // btnMinusSignIcon.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // controlBar.Progress--; |
| | | // }; |
| | | // btnPlusSgnIcon.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // controlBar.Progress++; |
| | | // }; |
| | | |
| | | // dialog.Show(); |
| | | // pView.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // }; |
| | | // btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | // { |
| | | // dialog.Close(); |
| | | // trait.value = controlBar.Progress.ToString(); |
| | | // btn.Text = trait.value + trait.GetUintString(); |
| | | // }; |
| | | // } |
| | | |
| | | |
| | | // /// <summary> |
| | | // /// 加载功能属性数据选择弹窗 |
| | | // /// </summary> |
| | | // void LoadEditDialog_FunctionPar(SceneFunctionStatus trait, Button btn, List<string> statusList) |
| | | // { |
| | | // Button lastButton = new Button(); |
| | | // var lastData = ""; |
| | | // var lastText = ""; |
| | | // Dialog dialog = new Dialog(); |
| | | |
| | | // if (DB_ResidenceData.Instance.GatewayType == 0) |
| | | // { |
| | | // if (SPK.AcSpkList().Contains(alarmFunction.localFunction.spk)) |
| | | // { |
| | | // //0 制冷1制热,2通风,3自动,4除湿 |
| | | // for (int i = 0; i < statusList.Count; i++) |
| | | // { |
| | | // if (statusList[i] == "0") |
| | | // { |
| | | // statusList[i] = "cool"; |
| | | // } |
| | | // else if (statusList[i] == "1") |
| | | // { |
| | | // statusList[i] = "heat"; |
| | | // } |
| | | // else if (statusList[i] == "2") |
| | | // { |
| | | // statusList[i] = "fan"; |
| | | // } |
| | | // else if (statusList[i] == "3") |
| | | // { |
| | | // statusList[i] = "auto"; |
| | | // } |
| | | // else if (statusList[i] == "4") |
| | | // { |
| | | // statusList[i] = "dry"; |
| | | // } |
| | | // } |
| | | // } |
| | | // else if (SPK.FhSpkList().Contains(alarmFunction.localFunction.spk)) |
| | | // { |
| | | // //1:普通,2:白天,3:夜晚,4:离开,5:时间 |
| | | // for (int i = 0; i < statusList.Count; i++) |
| | | // { |
| | | // if (statusList[i] == "5") |
| | | // { |
| | | // statusList[i] = "timer"; |
| | | // } |
| | | // else if (statusList[i] == "1") |
| | | // { |
| | | // statusList[i] = "normal"; |
| | | // } |
| | | // else if (statusList[i] == "2") |
| | | // { |
| | | // statusList[i] = "day"; |
| | | // } |
| | | // else if (statusList[i] == "3") |
| | | // { |
| | | // statusList[i] = "night"; |
| | | // } |
| | | // else if (statusList[i] == "4") |
| | | // { |
| | | // statusList[i] = "away"; |
| | | // } |
| | | // } |
| | | |
| | | // } |
| | | // } |
| | | |
| | | // var pView = new FrameLayout() |
| | | // { |
| | | // BackgroundColor = CSS_Color.DialogTransparentColor1, |
| | | // }; |
| | | // dialog.AddChidren(pView); |
| | | |
| | | // var optionBaseView = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(579 - 50 * statusList.Count), |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(50 * statusList.Count + 50), |
| | | // AnimateSpeed = 0.3f, |
| | | // Animate = Animate.DownToUp, |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // pView.AddChidren(optionBaseView); |
| | | |
| | | // var topView = new FrameLayout() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Width = Application.GetRealWidth(343), |
| | | // Height = Application.GetRealHeight(50), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | // Radius = (uint)Application.GetRealWidth(12), |
| | | // }; |
| | | // optionBaseView.AddChidren(topView); |
| | | |
| | | // var btnTitle = new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // TextAlignment = TextAlignment.Center, |
| | | // Width = Application.GetRealWidth(100), |
| | | // Text = trait.GetNameText(), |
| | | // IsBold = true, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.SubheadingFontSize, |
| | | // }; |
| | | // topView.AddChidren(btnTitle); |
| | | |
| | | // var btnCancel = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(21), |
| | | // Width = Application.GetRealWidth(100), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.PromptingColor1, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Cancel, |
| | | // }; |
| | | // topView.AddChidren(btnCancel); |
| | | |
| | | // var btnConfrim = new Button() |
| | | // { |
| | | // Width = Application.GetRealWidth(320), |
| | | // TextAlignment = TextAlignment.CenterRight, |
| | | // TextColor = CSS_Color.MainColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // TextID = StringId.Complete, |
| | | // }; |
| | | // topView.AddChidren(btnConfrim); |
| | | // int hei = 1; |
| | | // foreach (var m in statusList) |
| | | // { |
| | | // var row = new FrameLayout() |
| | | // { |
| | | // Y = Application.GetRealHeight(50 * hei), |
| | | // Height = Application.GetRealHeight(50), |
| | | // }; |
| | | // optionBaseView.AddChidren(row); |
| | | // if (statusList.Count > hei) |
| | | // { |
| | | // optionBaseView.AddChidren(new Button() |
| | | // { |
| | | // Gravity = Gravity.CenterHorizontal, |
| | | // Y = row.Bottom, |
| | | // Width = Application.GetRealWidth(343), |
| | | // BackgroundColor = CSS_Color.DividingLineColor, |
| | | // Height = 1, |
| | | // }); |
| | | // } |
| | | // hei++; |
| | | |
| | | // var btnChoose = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(303), |
| | | // Gravity = Gravity.CenterVertical, |
| | | // Width = Application.GetMinRealAverage(28), |
| | | // Height = Application.GetMinRealAverage(28), |
| | | // UnSelectedImagePath = "Public/ChooseIcon.png", |
| | | // SelectedImagePath = "Public/ChooseOnIcon.png", |
| | | |
| | | // }; |
| | | // row.AddChidren(btnChoose); |
| | | // if (trait.value == m) |
| | | // { |
| | | // lastButton = btnChoose; |
| | | // btnChoose.IsSelected = true; |
| | | // } |
| | | // var btnPropertyTitle = new Button() |
| | | // { |
| | | // X = Application.GetRealWidth(16), |
| | | // TextAlignment = TextAlignment.CenterLeft, |
| | | // TextColor = CSS_Color.FirstLevelTitleColor, |
| | | // TextSize = CSS_FontSize.TextFontSize, |
| | | // Tag = m, |
| | | // Text = trait.GetValueText(m) |
| | | // }; |
| | | // row.AddChidren(btnPropertyTitle); |
| | | |
| | | // btnPropertyTitle.MouseUpEventHandler = (sender, e) => { |
| | | // btnChoose.IsSelected = true; |
| | | // if (lastButton != null) |
| | | // { |
| | | // lastButton.IsSelected = false; |
| | | // } |
| | | // lastButton = btnChoose; |
| | | // lastData = btnPropertyTitle.Tag.ToString(); |
| | | // lastText = btnPropertyTitle.Text; |
| | | // }; |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | // dialog.Show(); |
| | | |
| | | // pView.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | |
| | | // btnCancel.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // }; |
| | | // btnConfrim.MouseUpEventHandler = (sender, e) => { |
| | | // dialog.Close(); |
| | | // trait.value = lastData; |
| | | // //sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = trait.curValue.ToString() ; |
| | | // btn.Text = lastText; |
| | | // }; |
| | | |
| | | // } |
| | | |
| | | // #endregion |
| | | |
| | | // } |
| | | //} |
| | |
| | | using System; |
| | | using HDL_ON.DriverLayer; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using Shared; |
| | |
| | | /// 主窗体 |
| | | /// </summary> |
| | | FrameLayout bodyView; |
| | | /// <summary> |
| | | /// 自定义布防区域 |
| | | /// </summary> |
| | | HorizontalScrolViewLayout customDeploymentView; |
| | | |
| | | public ArmCenterPage() |
| | | { |
| | | bodyView = this; |
| | |
| | | |
| | | }; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.Setting)).LoadTopView_ArmCenter(skipAction); |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | |
| | | Height = Application.GetRealWidth(16), |
| | | }); |
| | | |
| | | |
| | | #region 撤防区域 |
| | | var disarmView = new FrameLayout() |
| | | { |
| | | Height = 0, |
| | | }; |
| | | contentView.AddChidren(disarmView); |
| | | |
| | | var btnDisarm = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(120), |
| | | Height = Application.GetRealHeight(44), |
| | | BackgroundColor = CSS_Color.WarningColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = "撤防" |
| | | }; |
| | | disarmView.AddChidren(btnDisarm); |
| | | btnDisarm.MouseUpEventHandler = (sender, e) => { |
| | | if (SecurityCenter.Security.CurrentDefenseMode != null) |
| | | { |
| | | Control.Ins.ControlSecurity(SecurityCenter.Security.CurrentDefenseMode, "disable"); |
| | | } |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | #region 自定义布防 |
| | | //自定义布防标题 |
| | | Button btnCustomDeploymentTitle = new Button() |
| | |
| | | }; |
| | | contentView.AddChidren(btnCustomDeploymentTitle); |
| | | |
| | | HorizontalScrolViewLayout customDeploymentView = new HorizontalScrolViewLayout() |
| | | customDeploymentView = new HorizontalScrolViewLayout() |
| | | { |
| | | X = Application.GetRealWidth(23), |
| | | Height = Application.GetRealWidth(80), |
| | |
| | | }; |
| | | contentView.AddChidren(customDeploymentView); |
| | | |
| | | //customDeploymentView.AddChidren(new Button() |
| | | //{ |
| | | // Width = Application.GetRealWidth(23), |
| | | //}); |
| | | iniCustomDeploymentView(); |
| | | |
| | | var adv = new ArmDiyView(); |
| | | var view = adv.DiyArmView("FunctionIcon/ArmCenter/AtHomeDefenseIcon.png", "FunctionIcon/ArmCenter/AtHomeDefenseIconOn.png", |
| | | Language.StringByID(StringId.HouseDefense)); |
| | | customDeploymentView.AddChidren(view); |
| | | |
| | | if(FunctionList.List.securities.Count>3) |
| | | { |
| | | customDeploymentView.ScrollEnabled = true; |
| | | } |
| | | |
| | | foreach (var mode in FunctionList.List.securities) |
| | | { |
| | | } |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | |
| | | Height = Application.GetRealHeight(20), |
| | | }); |
| | | |
| | | #region 固定布防区域 |
| | | /* |
| | | var fixedDeploymentView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(133), |
| | |
| | | }; |
| | | fixedDeploymentView.AddChidren(btnFixedDeploymentTip); |
| | | |
| | | //固定布防区域 |
| | | var fixedDeploymentTypeView = new HorizontalScrolViewLayout() |
| | | { |
| | | Y = btnFixedDeploymentTip.Bottom + Application.GetRealHeight(15), |
| | |
| | | Width = Application.GetRealWidth(24), |
| | | }); |
| | | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //灾害报警 |
| | | 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); |
| | | */ |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化自定义布防区域 |
| | | /// </summary> |
| | | private void iniCustomDeploymentView() |
| | | { |
| | | customDeploymentView.RemoveAll(); |
| | | |
| | | foreach (var mode in FunctionList.List.securities) |
| | | { |
| | | var armDiyView = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", |
| | | mode.name); |
| | | customDeploymentView.AddChidren(armDiyView); |
| | | EventHandler<MouseEventArgs> event2 = (sender, e) => |
| | | { |
| | | ShowArmDialog(mode); |
| | | }; |
| | | armDiyView.SetClickEvent(event2); |
| | | } |
| | | |
| | | if (FunctionList.List.securities.Count < 4) |
| | | { |
| | | var view = new ArmDiyView("FunctionIcon/ArmCenter/AddDefenseIcon.png", "FunctionIcon/ArmCenter/AddDefenseIcon.png", |
| | | Language.StringByID(StringId.Custom)); |
| | | customDeploymentView.AddChidren(view); |
| | | EventHandler<MouseEventArgs> event1 = (sender, e) => |
| | | { |
| | | Action refreshAction = () => |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | |
| | | var addDefensePage = new AddAlarmDeploymentPage(new SecurityAlarm(), refreshAction); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | view.SetClickEvent(event1); |
| | | } |
| | | |
| | | } |
| | | |
| | | 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(); |
| | | |
| | | btnOpen.MouseUpEventHandler = (sender, e) => { |
| | | Control.Ins.ControlSecurity(alarm, "enable"); |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | |
| | | btnCheckModify.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | Action refreshAction = () => |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | var armSetPage = new ArmDeploymentSettingPage(alarm,refreshAction); |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public class ArmDeploymentSettingPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | | SecurityAlarm securityAlarm; |
| | | /// <summary> |
| | | /// 主题界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout contentView; |
| | | /// <summary> |
| | | /// 输入条件列表区域界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout inputTargetView; |
| | | /// <summary> |
| | | /// 告警目标列表区域界面 |
| | | /// </summary> |
| | | VerticalScrolViewLayout outputTargetView; |
| | | |
| | | public ArmDeploymentSettingPage(SecurityAlarm alarm ) |
| | | |
| | | SecurityAlarm securityAlarm; |
| | | Action refreshAction; |
| | | |
| | | public ArmDeploymentSettingPage(SecurityAlarm alarm, Action action) |
| | | { |
| | | bodyView = this; |
| | | securityAlarm = alarm; |
| | | refreshAction = action; |
| | | } |
| | | |
| | | public void LoadPage() |
| | |
| | | |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(527), |
| | | }; |
| | | 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() |
| | | { |
| | |
| | | LoadEvent_EditSecurityAlarmName(btnDeploymentName); |
| | | #endregion |
| | | |
| | | /* |
| | | #region 触发延时 |
| | | var delayedRow = new FrameLayout() |
| | | { |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextID = StringId.Name, |
| | | TextID = StringId.TriggerDelay, |
| | | }; |
| | | delayedRow.AddChidren(btnDelayedTitle); |
| | | btnDelayedTitle.Text += ":"; |
| | | |
| | | var btnDelayedText = new Button() |
| | | { |
| | |
| | | delayedRow.AddChidren(btnDelayedRight); |
| | | |
| | | //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 }); |
| | | |
| | | //布防功能 |
| | | iniDefenseView(); |
| | | //告警目标 |
| | | iniAlarmView(); |
| | | |
| | | #region 底部区域 |
| | | var bottomView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(591), |
| | | Height = Application.GetRealHeight(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | }; |
| | | this.AddChidren(bottomView); |
| | | |
| | | var btnConfrim = new Button() |
| | | { |
| | | X = Application.GetRealWidth(78), |
| | | Y = Application.GetRealHeight(12), |
| | | Width = Application.GetRealWidth(220), |
| | | Height = Application.GetRealWidth(44), |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.Confirm, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | bottomView.AddChidren(btnConfrim); |
| | | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | if (securityAlarm.input.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择布防目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | return; |
| | | } |
| | | if (securityAlarm.output.Count == 0) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | | Text = "请选择告警目标", |
| | | CloseTime = 3, |
| | | Direction = AMPopTipDirection.None |
| | | }; |
| | | tip.Show(MainPage.BaseView); |
| | | |
| | | return; |
| | | } |
| | | |
| | | var waitPage = new Loading(); |
| | | waitPage.Start(); |
| | | new System.Threading.Thread(() => |
| | | { |
| | | try |
| | | { |
| | | var code = securityAlarm.SaveInfo(); |
| | | if (code == StateCode.SUCCESS) |
| | | { |
| | | SecurityCenter.Security.GetSecurityAlarmList(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | this.RemoveFromParent(); |
| | | refreshAction?.Invoke(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(code); |
| | | }); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | waitPage.Hide(); |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化部分功能区域 |
| | | /// </summary> |
| | | private void iniDefenseView() |
| | | { |
| | | |
| | | #region 布防功能 |
| | | var deploymentFunctionRow = new FrameLayout() |
| | |
| | | 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); |
| | | ///添加输入目标 |
| | | btnAddTarget.MouseUpEventHandler = (sender, e) => { |
| | | Action<SecurityAlarm> action = (outTemp) => { |
| | | securityAlarm = outTemp; |
| | | iniInputTargetView(); |
| | | }; |
| | | var page = new AddInputPage(securityAlarm, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | deploymentFunctionRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | inputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(inputTargetView); |
| | | |
| | | iniInputTargetView(); |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化输入条件区域界面 |
| | | /// </summary> |
| | | /// <param name=""></param> |
| | | private void iniInputTargetView() |
| | | { |
| | | inputTargetView.RemoveAll(); |
| | | if (securityAlarm.input.Count > 0) |
| | | { |
| | | foreach (var target in securityAlarm.input) |
| | | { |
| | | inputTargetView.AddChidren(new InputRow(target.GetFunction().name, target.GetFunction().GetRoomListName(), target.StateText())); |
| | | } |
| | | inputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.input.Count); |
| | | //if (outputTargetView != null) |
| | | //{ |
| | | // contentView.AddChidren(outputTargetView); |
| | | //} |
| | | } |
| | | else |
| | | { |
| | | inputTargetView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.ThereIsNoAssociatedTaskDeploymentStatus, |
| | | IsMoreLines = true, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }); |
| | | |
| | | inputTargetView.Height = Application.GetRealHeight(68); |
| | | //if(outputTargetView!= null) |
| | | //{ |
| | | // contentView.AddChidren(outputTargetView); |
| | | //} |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化告警目标区域 |
| | | /// </summary> |
| | | private void iniAlarmView() |
| | | { |
| | | #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); |
| | | |
| | | btnAddOutTarget.MouseUpEventHandler = (sender, e) => { |
| | | Action<SecurityAlarm> action = (outTemp) => { |
| | | securityAlarm = outTemp; |
| | | iniAlarmListView(); |
| | | }; |
| | | var page = new AddOutputPage(securityAlarm, action); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | |
| | | outputRow.AddChidren(new Button() { Gravity = Gravity.CenterHorizontal, Y = Application.GetRealHeight(43), Height = 1, BackgroundColor = CSS_Color.DividingLineColor }); |
| | | |
| | | |
| | | outputTargetView = new VerticalScrolViewLayout() |
| | | { |
| | | ScrollEnabled = false, |
| | | }; |
| | | contentView.AddChidren(outputTargetView); |
| | | |
| | | iniAlarmListView(); |
| | | |
| | | #endregion |
| | | contentView.AddChidren(new Button() { Height = Application.GetRealHeight(8), BackgroundColor = CSS_Color.BackgroundColor }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化告警列表区域 |
| | | /// </summary> |
| | | private void iniAlarmListView() |
| | | { |
| | | outputTargetView.RemoveAll(); |
| | | if (securityAlarm.output.Count > 0) |
| | | { |
| | | foreach (var outTarget in securityAlarm.output) |
| | | { |
| | | outputTargetView.AddChidren(new OutputRow(outTarget.GetFunction().name, outTarget.GetFunction().GetRoomListName(), "打开")); |
| | | } |
| | | outputTargetView.Height = Application.GetRealHeight(65 * securityAlarm.output.Count); |
| | | } |
| | | else |
| | | { |
| | | outputTargetView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(65), |
| | | TextAlignment = TextAlignment.Center, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextID = StringId.ThereIsNoAssociatedTaskDeploymentStatus, |
| | | IsMoreLines = true, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改安防名称 |
| | |
| | | { |
| | | Action<string> callBack = (str) => |
| | | { |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | new System.Threading.Thread(() => |
| | | //名称不能为空 |
| | | if (string.IsNullOrEmpty(str)) |
| | | { |
| | | try |
| | | new Tip() |
| | | { |
| | | securityAlarm.name = str; |
| | | var responsePack = new HttpServerRequest().EditSecurity(new List<SecurityAlarm>() { securityAlarm}); |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.NameCannotBeEmpty), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | |
| | | if (responsePack.Code == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnDeploymentName.Text = str; |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"update user name error : {ex.Message}"); |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | |
| | | btnDeploymentName.Text = securityAlarm.name = str; |
| | | |
| | | //var waitPage = new Loading(); |
| | | //bodyView.AddChidren(waitPage); |
| | | //waitPage.Start(Language.StringByID(StringId.PleaseWait)); |
| | | //new System.Threading.Thread(() => |
| | | //{ |
| | | // try |
| | | // { |
| | | // securityAlarm.name = str; |
| | | // var responsePack = new HttpServerRequest().EditSecurity(new List<SecurityAlarm>() { securityAlarm}); |
| | | // if (responsePack.Code == StateCode.SUCCESS) |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // btnDeploymentName.Text = str; |
| | | // }); |
| | | // } |
| | | // else |
| | | // { |
| | | // IMessageCommon.Current.ShowErrorInfoAlter(responsePack.Code); |
| | | // } |
| | | // } |
| | | // catch (Exception ex) |
| | | // { |
| | | // MainPage.Log($"update user name error : {ex.Message}"); |
| | | // } |
| | | // finally |
| | | // { |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // if (waitPage != null) |
| | | // { |
| | | // waitPage.RemoveFromParent(); |
| | | // waitPage = null; |
| | | // } |
| | | // }); |
| | | // } |
| | | //}) |
| | | //{ IsBackground = true }.Start(); |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.Name, securityAlarm.name, callBack, StringId.NameCannotBeEmpty, 0, new List<string>()); |
| | | }; |
| | | btnDeploymentName.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 |
| | | } |
| | | |
| | | } |
| | |
| | | /// </summary> |
| | | FrameLayout sensorListView; |
| | | |
| | | VerticalScrolViewLayout sensorListContentView; |
| | | |
| | | /// <summary> |
| | | /// 天气名称文本 |
| | | /// </summary> |
| | |
| | | contentView.AddChidren(btnRoomClickRow); |
| | | |
| | | #endregion |
| | | |
| | | sensorListView = new FrameLayout() |
| | | sensorListContentView = new VerticalScrolViewLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Y = Application.GetRealHeight(50), |
| | | Height = Application.GetRealHeight(456), |
| | | Height = Application.GetRealHeight(400), |
| | | Radius = (uint)Application.GetRealWidth(12), |
| | | BorderColor = 0x00000000, |
| | | BorderWidth = 0, |
| | | }; |
| | | contentView.AddChidren(sensorListView); |
| | | contentView.AddChidren(sensorListContentView); |
| | | sensorListView = new FrameLayout(); |
| | | sensorListContentView.AddChidren(sensorListView); |
| | | |
| | | LoadSenesorList(); |
| | | |
| | |
| | | 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) |
| | | { |
| | |
| | | name = sensor.name, |
| | | sid = sensor.sid, |
| | | deviceId = sensor.deviceId, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } }, |
| | | roomIds = sensor.roomIds, |
| | | attributes = new List<FunctionAttributes> { new FunctionAttributes { key = "value", state = seTemp.state, curValue = seTemp.curValue } |
| | | ,new FunctionAttributes { key = "spk"} } |
| | | }; |
| | | switch (seTemp.key) |
| | | { |
| | | case "co2": |
| | | newTemp.spk = SPK.SensorCO2; |
| | | newTemp.SetAttrState("spk", "co2"); |
| | | break; |
| | | case "pm25": |
| | | newTemp.spk = SPK.SensorPm25; |
| | | newTemp.SetAttrState("spk", "pm25"); |
| | | break; |
| | | case "humidity": |
| | | newTemp.spk = SPK.SensorHumidity; |
| | | newTemp.SetAttrState("spk", "humidity"); |
| | | break; |
| | | case "temperature": |
| | | newTemp.spk = SPK.SensorTemperature; |
| | | newTemp.SetAttrState("spk", "temperature"); |
| | | break; |
| | | case "tvoc": |
| | | newTemp.spk = SPK.SensorTVOC; |
| | | newTemp.SetAttrState("spk", "tvoc"); |
| | | break; |
| | | default: |
| | | continue; |
| | | break; |
| | | } |
| | | LoadSensorDiv(newTemp, index); |
| | | index++; |
| | | |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | LoadSensorDiv(newTemp, index); |
| | | index++; |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | #if DEBUG |
| | | continue; |
| | | #endif |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | LoadSensorDiv(sensor, index); |
| | | index++; |
| | | } |
| | | } |
| | | |
| | | new System.Threading.Thread(() => |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | sensorListView.Height = Application.GetRealWidth(124 * (index + 1) / 2); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载传感器列表 |
| | | /// </summary> |
| | | void LoadSensorDiv(Function sensor, int index) |
| | | void LoadSensorDiv(Function sensor,int index) |
| | | { |
| | | var levelColorList = sensorTemp.GetLevelColorList(sensor.spk); |
| | | var levelTextList = sensorTemp.GetLevelTextList(sensor.spk); |
| | | if (room.roomId == "" || sensor.roomIds.Contains(room.roomId)) |
| | | { |
| | | var sensorTag = sensor.spk + sensor.sid + sensor.deviceId; |
| | | FrameLayout sensorView = new FrameLayout() |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | if (updateTemp.spk == SPK.SensorEnvironment) |
| | | if (SPK.EvironmentSensorList().Contains(updateTemp.spk )) |
| | | { |
| | | foreach (var seTemp in updateTemp.attributes) |
| | | { |
| | |
| | | }; |
| | | selfInfoView.AddChidren(btnSeltSensorValue); |
| | | |
| | | Button btnShowData; |
| | | btnShowData = new Button() |
| | | { |
| | | X = Application.GetRealWidth(291), |
| | | Y = Application.GetRealWidth(62), |
| | | Width = Application.GetMinRealAverage(32), |
| | | Height = Application.GetMinRealAverage(32), |
| | | UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", |
| | | SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", |
| | | IsSelected = true, |
| | | }; |
| | | selfInfoView.AddChidren(btnShowData); |
| | | //Button btnShowData; |
| | | //btnShowData = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(291), |
| | | // Y = Application.GetRealWidth(62), |
| | | // Width = Application.GetMinRealAverage(32), |
| | | // Height = Application.GetMinRealAverage(32), |
| | | // UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIcon.png", |
| | | // SelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png", |
| | | // IsSelected = true, |
| | | //}; |
| | | //selfInfoView.AddChidren(btnShowData); |
| | | //btnShowData.MouseUpEventHandler = (sender, e) => { |
| | | // btnShowData.IsSelected = !btnShowData.IsSelected; |
| | | // if(btnShowData.IsSelected) |
| | |
| | | |
| | | bool initTitleButton = true; |
| | | |
| | | foreach (var tempSensor in FunctionList.List.GetEnvirSensorsList()) |
| | | var tempList = FunctionList.List.GetEnvirSensorsList(); |
| | | |
| | | foreach (var tempSensor in tempList) |
| | | { |
| | | if (tempSensor.sid == function.sid) |
| | | { |
| | |
| | | #region 其它传感器信息栏 |
| | | FrameLayout otherInfoView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterVertical, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealWidth(100), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | btnSeltSensorName.Text = tempSensor.name; |
| | | MainPage.Log("45678i"); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnSeltSensorName.Text = tempSensor.name; |
| | | }); |
| | | }; |
| | | var infoView = new FunctionBaseInfoSetPage(tempSensor, backAction); |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | |
| | | btnShowData1.IsSelected = !btnShowData1.IsSelected; |
| | | if (btnShowData1.IsSelected) |
| | | { |
| | | if (!showFunctions.Contains(function)) |
| | | if (!showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Add(function); |
| | | showFunctions.Add(tempSensor); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (showFunctions.Contains(function)) |
| | | if (showFunctions.Contains(tempSensor)) |
| | | { |
| | | showFunctions.Remove(function); |
| | | showFunctions.Remove(tempSensor); |
| | | } |
| | | } |
| | | LoadMothed_GetSensorHistoryData(); |
| | | }; |
| | | #endregion |
| | | |
| | | contentView.AddChidren(new Button() |
| | | { |
| | | Height = Application.GetRealHeight(12), |
| | | }); |
| | | |
| | | } |
| | | #endregion |
| | |
| | | |
| | | string yDataString = ""; |
| | | |
| | | foreach (var sr in FunctionList.List.GetEnvirSensorsList()) |
| | | foreach (var sr in showFunctions) |
| | | { |
| | | if (sr.spk != function.spk) |
| | | { |
| | |
| | | } |
| | | |
| | | var sensorType = sr.spk.Split(".")[1]; |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId,"value"); |
| | | var queryType = sr.GetAttrState("spk")==null? "value": sr.GetAttrState("spk"); |
| | | |
| | | var revertObj = new HttpServerRequest().GetSensorHistory(curQueryType, sr.deviceId, queryType); |
| | | if (revertObj != null) |
| | | { |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | } |
| | | |
| | | var temp = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp < Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min)) |
| | | if (temp <= Convert.ToInt32(function.GetAttribute(FunctionAttributeKey.SetTemp).min)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | var temp =(int) Convert.ToDouble(function.GetAttrState(FunctionAttributeKey.SetTemp)); |
| | | if (temp > Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) |
| | | if (temp >= Convert.ToDouble(function.GetAttribute(FunctionAttributeKey.SetTemp).max)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | function.name = name; |
| | | btnFunctionName.Text = name; |
| | | function.UpdataFuncitonInfo(); |
| | | actionRefresh?.Invoke(); |
| | | } |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, function.name, callBackAction,StringId.DeviceNameCannotBeEmpty,0,new System.Collections.Generic.List<string>()); |
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); |
| | |
| | | System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.RGB, lightTemp.GetRGBcolorString(function)); |
| | | Control.Ins.SendWriteCommand(function, d); |
| | | lastColor = new byte[] { 255, 255, 255 }; |
| | | }; |
| | | } |
| | | |
| | |
| | | var dateTime = TimeZoneInfo.ConvertTimeFromUtc(utcTime, TimeZoneInfo.Local); |
| | | return dateTime.ToString("MM-dd HH:mm"); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取呼叫状态文本 |
| | | /// </summary> |
| | |
| | | //2020-12-07 增加版本检测更新方法 |
| | | HDLCommon.Current.CheckIfNeedForceUpdate(); |
| | | |
| | | #if __Android__ |
| | | //开启定位服务 |
| | | Shared.Application.StartGPSLocationService(); |
| | | #endif |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | }; |
| | | navigationView.AddChidren(NavigationSubView); |
| | | |
| | | #region 收藏区域 |
| | | #region 收藏区域 |
| | | collectionView = new FrameLayout() { |
| | | Width = Application.GetRealWidth(94), |
| | | }; |
| | |
| | | IsSelected = true, |
| | | }; |
| | | collectionView.AddChidren(btnCollectionText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 分类区域 |
| | | #region 分类区域 |
| | | classificationView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | classificationView.AddChidren(btnClassificationText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 智能区域 |
| | | #region 智能区域 |
| | | intellectualizationView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | intellectualizationView.AddChidren(btnIntellectualizationText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | #region 个人中心 |
| | | #region 个人中心 |
| | | personalCenterView = new FrameLayout() |
| | | { |
| | | Width = Application.GetRealWidth(94), |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | }; |
| | | personalCenterView.AddChidren(btnPersonalCenterText); |
| | | #endregion |
| | | #endregion |
| | | |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | | btnPersonalCenterText.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | //移动距离 |
| | | var distance = navigationSelectionView.X - collectionView.X + Application.GetRealWidth(94*3); |
| | | int total = 10; |
| | |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | }); |
| | | }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Highest}.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var homePage = new HomePage(); |
| | | ContextView.AddChidren(homePage); |
| | |
| | | btnClassificationText.IsSelected = false; |
| | | btnIntellectualizationText.IsSelected = false; |
| | | btnPersonalCenterText.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - classificationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnPersonalCenterIcon.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - intellectualizationView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | ContextView.RemoveAll(); |
| | | var intelligenceView = new IntelligencePage(); |
| | | ContextView.AddChidren(intelligenceView); |
| | |
| | | btnCollectionIcon.IsSelected = false; |
| | | btnClassificationIcon.IsSelected = false; |
| | | btnIntellectualizationIcon.IsSelected = false; |
| | | #region 移动动画 |
| | | #region 移动动画 |
| | | var distance = navigationSelectionView.X - personalCenterView.X + Application.GetRealWidth(94 * 3); |
| | | int total = 10; |
| | | int sleepTime = 300; |
| | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); |
| | | #endregion |
| | | #endregion |
| | | |
| | | ContextView.RemoveAll(); |
| | | var personalCenterPage = new UI.PersonalCenterPage(); |