Merge branch 'wjc' into dev-cqy(1.5.9)
| | |
| | | 7155=Distress/Normal |
| | | 7156=Distress |
| | | 7157=whether to unlock |
| | | 7158=is |
| | | 7158=Is |
| | | 7159=Fall in the alarm |
| | | 7160=Someone called the police |
| | | 7161=Warning tone |
| | |
| | | 7163=Video call |
| | | 7164=Manipulator |
| | | 7165=Area intrusion alarm |
| | | 7166=camera |
| | | 7167=main switch |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | |
| | | 8501=Video door lock |
| | |
| | | <Reference Include="videophone"> |
| | | <HintPath>..\DLL\FL\Android\videophone.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="Square.OkHttp3"> |
| | | <HintPath>..\DLL\EZvizMonitor\Square.OkHttp3.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="Square.OkIO"> |
| | | <HintPath>..\DLL\EZvizMonitor\Square.OkIO.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="ys"> |
| | | <HintPath>..\DLL\EZvizMonitor\ys.dll</HintPath> |
| | | </Reference> |
| | | <Reference Include="UMSdkDroid"> |
| | | <HintPath>..\DLL\UMeng\UMSdkDroid.dll</HintPath> |
| | | </Reference> |
| | |
| | | <AndroidAsset Include="Assets\h5\static\img\equal-plant-ic.7ef6befa.png" /> |
| | | <AndroidAsset Include="Assets\h5\static\img\coal-save-ic.6c5fd125.png" /> |
| | | <AndroidAsset Include="Assets\h5\static\font\SourceHanSansCN-Normal.otf" /> |
| | | <AndroidAsset Include="Assets\Phone\MusicIcon\currentPlayList.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\OneOpenLock.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\RTV.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UnLocked.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\UnLocking.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\VideoDoorlockClose.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\VideoDoorLockOpen.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\History.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\Cell.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\FunctionBg\VideoDoorLockFunctionBg.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\Icon\securitydoorezviz.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidResource Include="Resources\values\colors.xml" /> |
| | |
| | | <PackageReference Include="Xamarin.Android.Support.Constraint.Layout.Solver"> |
| | | <Version>1.1.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter"> |
| | | <Version>4.2.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Crashes"> |
| | | <Version>4.2.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter.Analytics"> |
| | | <Version>4.2.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Microsoft.AppCenter"> |
| | | <Version>4.2.0</Version> |
| | | </PackageReference> |
| | | <PackageReference Include="Square.OkHttp3"> |
| | | <Version>3.14.4</Version> |
| | | </PackageReference> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\NormallyOpenIcon3.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\History.png" /> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\HistoryList.png" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <AndroidAsset Include="Assets\Phone\FunctionIcon\DoorLock\DoorLock.png" /> |
| | |
| | | <Folder Include="Assets\Phone\FunctionIcon\Inverter\" /> |
| | | <Folder Include="Assets\Phone\FunctionIcon\Electrical\MechanicalArm\" /> |
| | | </ItemGroup> |
| | | <ItemGroup> |
| | | <ProjectReference Include="..\..\ys\ys.csproj"> |
| | | <Project>{DF065E3F-C3A1-4908-9582-000974B7C290}</Project> |
| | | <Name>ys</Name> |
| | | </ProjectReference> |
| | | </ItemGroup> |
| | | <Import Project="..\HDL_ON\HDL_ON.projitems" Label="Shared" Condition="Exists('..\HDL_ON\HDL_ON.projitems')" /> |
| | | <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> |
| | | <!-- To modify your build process, add your task inside one of the targets below and uncomment it. |
| | |
| | | { |
| | | //2020-12-23 解决点击通知栏打开不了APP问题 |
| | | //base.OnNotifyMessageOpened(context, notificationMessage); |
| | | |
| | | OpenNotification(context, notificationMessage); |
| | | } |
| | | |
| | |
| | | public override void OnNotifyMessageArrived(Context context, NotificationMessage notificationMessage) |
| | | { |
| | | base.OnNotifyMessageArrived(context, notificationMessage); |
| | | |
| | | |
| | | var pushMes = new JPushMessageInfo() |
| | | { |
| | | Title = notificationMessage.NotificationTitle, |
| | |
| | | |
| | | <!-- 填充颜色 --> |
| | | <solid |
| | | android:color="@color/white" /> |
| | | android:color="#FFFFFF"/> |
| | | |
| | | <!-- 边框颜色--> |
| | | <stroke |
| | |
| | | |
| | | <!-- 填充颜色 --> |
| | | <solid |
| | | android:color="@color/white" /> |
| | | android:color="#FFFFFF"/> |
| | | |
| | | </shape> |
| | |
| | | 7155=Distress/Normal |
| | | 7156=Distress |
| | | 7157=whether to unlock |
| | | 7158=is |
| | | 7158=Is |
| | | 7159=Fall in the alarm |
| | | 7160=Someone called the police |
| | | 7161=Warning tone |
| | |
| | | 7163=Video call |
| | | 7164=Manipulator |
| | | 7165=Area intrusion alarm |
| | | 7166=camera |
| | | 7167=main switch |
| | | 7166=Camera |
| | | 7167=Main switch |
| | | 7168=PM10 |
| | | |
| | | 8501=Video door lock |
| | |
| | | EndProject
|
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UMSdk", "UMSdk\UMSdk.csproj", "{5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}"
|
| | | EndProject
|
| | | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ys", "..\ys\ys.csproj", "{DF065E3F-C3A1-4908-9582-000974B7C290}"
|
| | | EndProject
|
| | | Global
|
| | | GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
| | | HDL_ON\HDL_ON.projitems*{09712674-2a38-407b-b1e2-560b2c352f9a}*SharedItemsImports = 4
|
| | |
| | | {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhone.Build.0 = Release|Any CPU
|
| | | {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {5CD1B2DE-1ABD-4B46-8C97-CCB6EA90346A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.ActiveCfg = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhone.Build.0 = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|Any CPU.Build.0 = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.ActiveCfg = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhone.Build.0 = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
|
| | | {DF065E3F-C3A1-4908-9582-000974B7C290}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
|
| | | EndGlobalSection
|
| | | GlobalSection(SolutionProperties) = preSolution
|
| | | HideSolutionNode = FALSE
|
| | |
| | | foreach (var newFunction in deviceList.list) |
| | | { |
| | | newFunction.AssembleStatus(); |
| | | newFunction.SaveFunctionFile(); |
| | | newFunction.SaveFunctionFile(); |
| | | FunctionList.List.IniFunctionList(newFunction.savePath,true); |
| | | MainPage.Log($"============设备============{iiii++}"); |
| | | } |
| | |
| | | /// HDL可视对讲 |
| | | /// </summary> |
| | | HDL_INTERPHONE, |
| | | /// <summary> |
| | | /// 门铃推送(萤石视频门锁) |
| | | /// </summary> |
| | | DOOR_BELL, |
| | | } |
| | | |
| | |
| | | } |
| | | else if (jpushMessageInfo.messageType.Contains(PushMessageType.HDL_INTERPHONE.ToString())) |
| | | { |
| | | |
| | | if (string.IsNullOrEmpty(jpushMessageInfo.expantContent)) return; |
| | | |
| | | |
| | | //字段兼容问题,只能直接取值了 |
| | | var json = Newtonsoft.Json.Linq.JObject.Parse(jpushMessageInfo.expantContent); |
| | | try |
| | |
| | | return; |
| | | } |
| | | ///视频门锁 |
| | | HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId,expantContent.spk); |
| | | HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.SkipRTVActivity(expantContent.devSerial, expantContent.deviceId,expantContent.spk,true); |
| | | } |
| | | catch { } |
| | | } |
| | |
| | | |
| | | |
| | | //防止多次弹窗处理 |
| | | if (alarmPushConfirmDialog == null) |
| | | if (alarmPushConfirmDialog == null) |
| | | { |
| | | alarmPushConfirmDialog = new ConfirmDialog(isAlarm); |
| | | alarmPushConfirmDialog.ShowDialog(Language.StringByID(StringId.Tip), jpushMessageInfo.Content, goAction, cancelAction, StringId.Cancel, StringId.LookOver); |
| | |
| | | /// <summary> |
| | | /// 循序循环 |
| | | /// </summary> |
| | | public const int orderMode =5048; |
| | | public const int orderMode = 5048; |
| | | /// <summary> |
| | | /// 单曲播放 |
| | | /// </summary> |
| | | public const int single =5049; |
| | | public const int single = 5049; |
| | | |
| | | |
| | | |
| | |
| | | /// <summary> |
| | | /// 判断是否本地加密并且加密key不为空 |
| | | /// </summary> |
| | | public bool IsLocalEncryptAndGetAesKey { |
| | | get { |
| | | public bool IsLocalEncryptAndGetAesKey |
| | | { |
| | | get |
| | | { |
| | | return IsLocalEncrypt && (!string.IsNullOrEmpty(DB_ResidenceData.Instance.CurrentRegion.localSecret)); |
| | | } |
| | | } |
| | |
| | | if (_GatewayOnline_Cloud != value) |
| | | { |
| | | _GatewayOnline_Cloud = value; |
| | | if(GatewayOnline_Local) |
| | | if (GatewayOnline_Local) |
| | | { |
| | | return; |
| | | } |
| | |
| | | public void SearchLoaclGateway() |
| | | { |
| | | //2021-01-15 : 住宅没有绑定网关的时候不用搜索,并且不能链接mqtt |
| | | if(DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId)) |
| | | if (DB_ResidenceData.Instance.HomeGateway == null || string.IsNullOrEmpty(DB_ResidenceData.Instance.HomeGateway.gatewayId)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | /// </summary> |
| | | public void LoginGateway() |
| | | { |
| | | if(loginGatewayThread== null) |
| | | if (loginGatewayThread == null) |
| | | { |
| | | loginGatewayThread = new System.Threading.Thread(() => { |
| | | loginGatewayThread = new System.Threading.Thread(() => |
| | | { |
| | | while (!Ins.myTcpClient.isConnected) |
| | | { |
| | | if (Ins.GatewayOnline_Local && myTcpClient.isConnected) |
| | |
| | | try |
| | | { |
| | | loginGatewayThread?.Abort(); |
| | | }catch (Exception ex) |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MainPage.Log($"重启登录网关线程异常:{ex.Message}"); |
| | | } |
| | |
| | | LoginGateway(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | public void ControlScene(Scene scene) |
| | | { |
| | | //体验模式 |
| | | if(MainPage.NoLoginMode) |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | foreach(var sceneFunction in scene.functions) |
| | | foreach (var sceneFunction in scene.functions) |
| | | { |
| | | var revString = ""; |
| | | var upDataObj = new AlinkFunctionStatusObj(); |
| | |
| | | /// <param name="function"></param> |
| | | /// <param name="useRemote">是否直接使用远程发送</param> |
| | | /// <returns></returns> |
| | | public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false,int resend = 3) |
| | | public bool SendWriteCommand(Function function, Dictionary<string, string> commandDictionary, bool useRemote = false, int resend = 3) |
| | | { |
| | | function.controlCounter++; |
| | | function.refreshTime = DateTime.Now; |
| | |
| | | var functionControlDataObj = function.GetGatewayAlinkControlData(commandDictionary); |
| | | var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); |
| | | var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlFunctionTopic, functionControlDataJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id,resend); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, resend); |
| | | MainPage.Log($"本地通讯 发送HDL-Link数据:{functionControlDataJson}"); |
| | | } |
| | | } |
| | |
| | | commandDictionary.Add(FunctionAttributeKey.OnOff, commandDictionary[FunctionAttributeKey.Brightness] == "0" ? "off" : "on"); |
| | | } |
| | | } |
| | | if(function.spk == SPK.LightCCT) |
| | | if (function.spk == SPK.LightCCT) |
| | | { |
| | | if (!commandDictionary.ContainsKey(FunctionAttributeKey.CCT)) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 全开全关功能 |
| | | /// </summary> |
| | | public void SwtichFunctions(bool open,List<Function> functions) |
| | | public void SwtichFunctions(bool open, List<Function> functions) |
| | | { |
| | | //dome模式控制 |
| | | if(MainPage.NoLoginMode) |
| | | if (MainPage.NoLoginMode) |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | |
| | | { |
| | | Dictionary<string, string> d1 = new Dictionary<string, string>(); |
| | | d1.Add(FunctionAttributeKey.OnOff, open ? "on" : "off"); |
| | | if (function.spk == SPK.PanelSocket) |
| | | if (function.spk == SPK.PanelSocket) |
| | | { |
| | | if (function.attributes.Find((obj) => obj.key == "on_off_usb") != null) |
| | | { |
| | |
| | | { |
| | | var pm = new DAL.Server.HttpServerRequest(); |
| | | var pack = pm.GetDeviceInfoList(functionIds); |
| | | if(pack!= null&& pack.Data!=null) |
| | | if (pack != null && pack.Data != null) |
| | | { |
| | | //待测试2021-03-04 |
| | | var ddd = Newtonsoft.Json.JsonConvert.DeserializeObject<List<AlinkStatusData>>(pack.Data.ToString()); |
| | | if(ddd!= null) |
| | | if (ddd != null) |
| | | { |
| | | foreach(var function in ddd) |
| | | foreach (var function in ddd) |
| | | { |
| | | var temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.deviceId == function.deviceId); |
| | | if(temp!= null) |
| | | if (temp != null) |
| | | { |
| | | if (SPK.Get3tySpk(SPK.BrandType.Tuya).Contains(temp.spk)) |
| | | { |
| | |
| | | /// 发送读取命令 |
| | | /// 自动判断是否为A协议设备 |
| | | /// </summary> |
| | | public void SendReadCommand(Function function ,bool forceRemote = false) |
| | | public void SendReadCommand(Function function, bool forceRemote = false) |
| | | { |
| | | function.refreshTime = DateTime.Now; |
| | | if (forceRemote) |
| | |
| | | { |
| | | busClient.ReadBusData(function); |
| | | } |
| | | |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | /// <summary> |
| | | /// 安防控制 |
| | | /// </summary> |
| | | public void ControlSecurity(SecurityAlarm securityAlarm,string state) |
| | | public void ControlSecurity(SecurityAlarm securityAlarm, string state) |
| | | { |
| | | if (!Ins.GatewayOnline_Local)//网关本地不在线 |
| | | { |
| | |
| | | }; |
| | | var aLinkJson = Newtonsoft.Json.JsonConvert.SerializeObject(aLinkData); |
| | | var sendBytes = Ins.ConvertSendBodyData(CommunicationTopic.ct.ControlScene, aLinkJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id,0); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, aLinkData.id, 0); |
| | | } |
| | | } |
| | | |
| | |
| | | /// 转换接收到的数据 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public void ConvertReceiveData(byte[] receiveBytes,string ip) |
| | | public void ConvertReceiveData(byte[] receiveBytes, string ip) |
| | | { |
| | | var reString = Encoding.UTF8.GetString(receiveBytes); |
| | | AnalysisReceiveData(reString, receiveBytes,ip); |
| | | AnalysisReceiveData(reString, receiveBytes, ip); |
| | | } |
| | | /// <summary> |
| | | /// 转换接收到的数据 |
| | |
| | | /// <param name="receiveString">转String后的数据</param> |
| | | /// <param name="originalReceiveBytes"原始Bytes数据</param> |
| | | /// <returns></returns> |
| | | public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes , string sIp = null) |
| | | public LocalCommunicationData AnalysisReceiveData(string receiveString, byte[] originalReceiveBytes, string sIp = null) |
| | | { |
| | | LocalCommunicationData receiveObj = new LocalCommunicationData(); |
| | | |
| | |
| | | MainPage.Log($"安防局域网异常:{ex.Message}"); |
| | | } |
| | | } |
| | | else if (receiveObj.Topic == $"/user/{GatewayId}/custom/gateway/login_reply") { |
| | | else if (receiveObj.Topic == $"/user/{GatewayId}/custom/gateway/login_reply") |
| | | { |
| | | var temp = Newtonsoft.Json.JsonConvert.DeserializeObject<JObject>(receiveObj.BodyDataString); |
| | | if (temp.GetValue("objects").ToString().Contains("success")) |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if(processedDataList.Count> 50) |
| | | if (processedDataList.Count > 50) |
| | | { |
| | | processedDataList.RemoveAt(0); |
| | | } |
| | |
| | | /// A协议数据 |
| | | /// </summary> |
| | | /// <param name="updateBytes"></param> |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes,bool isCloudData = false) |
| | | public void UpdataFunctionStatus(string revString, byte[] usefulBytes, bool isCloudData = false) |
| | | { |
| | | ////test 云端连接成功时,不适用本地数据更新 |
| | | //if (Ins.GatewayOnline_Cloud && !isCloudData) |
| | |
| | | |
| | | if (Ins.GatewayOnline_Local && isCloudData)//本地链接,除了涂鸦设备数据之外的云端数据不处理 |
| | | { |
| | | if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains( localFunction.spk)) |
| | | if (!SPK.Get3tySpk(SPK.BrandType.All3tyBrand).Contains(localFunction.spk) && !SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | //MainPage.Log($"A协议更新状态:本地链接,除了涂鸦设备数据之外的云端数据不处理........"); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | //{ |
| | | // if (updateTemp.status.Count < 3) |
| | | // { |
| | | // ///是音乐功能的 |
| | | // ///上报属性少3条不做处理 |
| | | // return; |
| | | // } |
| | | //} |
| | | MainPage.Log($"音乐收到数据:{revString}"); |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | MainPage.Log($"音乐收到数据:{revString}"); |
| | | |
| | | } |
| | | foreach (var attr in updateTemp.status) |
| | | { |
| | | localFunction.time_stamp = temp.time_stamp; |
| | | localFunction.SetAttrState(attr.key, attr.value); |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | if (SPK.MusicSpkList().Contains(localFunction.spk)) |
| | | { |
| | | Console.WriteLine("音乐播放器添加缓存数据=======" + revString); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | break; |
| | | case SPK.AirSwitch: |
| | | AirSwitchPage.UpdataState(localFunction); |
| | | if(localFunction.GetAttribute(FunctionAttributeKey.Power)!=null)//如果是带电量的空开也要更新能源界面 |
| | | if (localFunction.GetAttribute(FunctionAttributeKey.Power) != null)//如果是带电量的空开也要更新能源界面 |
| | | { |
| | | EnergyMainPage.UpdataStatus(localFunction); |
| | | } |
| | |
| | | CurtainModulePage.UpdataState(localFunction); |
| | | break; |
| | | case SPK.CurtainDream: |
| | | if(localFunction.GetAttrState(FunctionAttributeKey.Percent) == "0") |
| | | if (localFunction.GetAttrState(FunctionAttributeKey.Percent) == "0") |
| | | { |
| | | localFunction.SetAttrState(FunctionAttributeKey.OnOff, "off"); |
| | | } |
| | |
| | | case SPK.SensorTemperature: |
| | | case SPK.SensorHumidity: |
| | | case SPK.SensorHcho: |
| | | if(localFunction.spk == SPK.SensorTemperature) |
| | | if (localFunction.spk == SPK.SensorTemperature) |
| | | { |
| | | HomePage.LoadEvent_RefreshEnvirIndoorTemp(); |
| | | } |
| | |
| | | case SPK.AvMusic: |
| | | case SPK.MusicStandard: |
| | | //UI.Music.MusicMain.mMusicMain.RefreshView(updateTemp); |
| | | Console.WriteLine("音乐播放器显示状态======="+ revString); |
| | | Console.WriteLine("音乐播放器显示状态=======" + revString); |
| | | //wjc |
| | | break; |
| | | case SPK.Inverter: |
| | |
| | | /// <summary> |
| | | /// //一键(远程)开锁 |
| | | /// </summary> |
| | | public void OneKeyUnlocking(Function doorlock,string extStr) |
| | | public void OneKeyUnlocking(Function doorlock, string extStr) |
| | | { |
| | | if (Ins.GatewayOnline_Local) |
| | | { |
| | | Dictionary<string, string> dic = new Dictionary<string, string>(); |
| | | var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID,extStr); |
| | | var functionControlDataObj = doorlock.GetGatewayAlinkDoorlockData(UserInfo.Current.ID, extStr); |
| | | var functionControlDataJson = Newtonsoft.Json.JsonConvert.SerializeObject(functionControlDataObj); |
| | | var sendBytes = Ins.ConvertSendBodyData($"/base/{Control.Ins.GatewayId}/thing/service/doorRemoteOpen/down", functionControlDataJson); |
| | | new Control_Udp().SendLocalHdlLinkData(sendBytes, functionControlDataObj.id, 0); |
| | |
| | | /// </summary> |
| | | /// <param name="functionId"></param> |
| | | /// <param name="pwd"></param> |
| | | public void ConfirmUnlocking(string functionId,string pwd) |
| | | public void ConfirmUnlocking(string functionId, string pwd) |
| | | { |
| | | Loading loading = new Loading(); |
| | | MainPage.BaseView.AddChidren(loading); |
| | |
| | | //{ |
| | | // return false; |
| | | //} |
| | | if (pack.Code != StateCode.SUCCESS) { |
| | | Application.RunOnMainThread(() => { |
| | | if (pack.Code != StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), pack.message); |
| | | UserInfo.Current.doorPasswordString = "";// |
| | | UserInfo.Current.LastTimeOpenDoor = DateTime.MinValue; |
| | |
| | | } |
| | | if (pack.Code != StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if(string.IsNullOrEmpty(pack.message)) |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (string.IsNullOrEmpty(pack.message)) |
| | | { |
| | | new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), |
| | | Language.StringByID(StringId.OperationFailed)); |
| | |
| | | /// 固定域名,正式环境 |
| | | /// 公共域名就近解析 |
| | | /// </summary> |
| | | //public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | public const string GlobalRequestHttpsHost = "https://nearest.hdlcontrol.com"; |
| | | //public const string GlobalRequestHttpsHost = "https://test-gz.hdlcontrol.com";//mmmm |
| | | /// <summary> |
| | | /// RegionMark |
| | | /// </summary> |
| | |
| | | #else |
| | | using Foundation; |
| | | using UIKit; |
| | | using Shared.IOS.HDLLinphoneSDK; |
| | | //using Shared.IOS.HDLLinphoneSDK; |
| | | #endif |
| | | |
| | | namespace Shared |
| | |
| | | { |
| | | [Weak] HDLLinphone hdlLinphone; |
| | | |
| | | public OnHDLLinphoneCallDelegate(HDLLinphone mHDLLinphone) |
| | | { |
| | | this.hdlLinphone = mHDLLinphone; |
| | | } |
| | | // public OnHDLLinphoneCallDelegate(HDLLinphone mHDLLinphone) |
| | | // { |
| | | // this.hdlLinphone = mHDLLinphone; |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 接听 |
| | | /// </summary> |
| | | public override void OnAnswerAction() |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); |
| | | } |
| | | // /// <summary> |
| | | // /// 接听 |
| | | // /// </summary> |
| | | // public override void OnAnswerAction() |
| | | // { |
| | | // hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 挂断 |
| | | /// </summary> |
| | | /// <param name="callDuration"></param> |
| | | public override void OnHangUpAction(int callDuration) |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); |
| | | } |
| | | // /// <summary> |
| | | // /// 挂断 |
| | | // /// </summary> |
| | | // /// <param name="callDuration"></param> |
| | | // public override void OnHangUpAction(int callDuration) |
| | | // { |
| | | // hdlLinphone.HDLUpdateCallStatus(CallStatusType.RECEIVED, InterphoneType.HDL, callDuration); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 拒接 |
| | | /// </summary> |
| | | public override void OnRejectCallAction() |
| | | { |
| | | hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); |
| | | } |
| | | // /// <summary> |
| | | // /// 拒接 |
| | | // /// </summary> |
| | | // public override void OnRejectCallAction() |
| | | // { |
| | | // hdlLinphone.HDLUpdateCallStatus(CallStatusType.REJECT, InterphoneType.HDL); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 截图成功 |
| | |
| | | ////hdlLinphone.ScreenshotSuccessfulAction(dataBytes); |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 开锁成功 |
| | | /// </summary> |
| | | public override void OnUnlockAction() |
| | | { |
| | | hdlLinphone.HDLUnlockAction(); |
| | | } |
| | | // /// <summary> |
| | | // /// 开锁成功 |
| | | // /// </summary> |
| | | // public override void OnUnlockAction() |
| | | // { |
| | | // hdlLinphone.HDLUnlockAction(); |
| | | // } |
| | | |
| | | /// <summary> |
| | | /// 来电中... |
| | |
| | | |
| | | |
| | | |
| | | } |
| | | //} |
| | | |
| | | #endregion |
| | | #endif |
| | |
| | | ShowFunction.Sensor,ShowFunction.VideoIntercom, |
| | | ShowFunction.SecurityCenter,ShowFunction.Acst, |
| | | ShowFunction.MechanicalArm , |
| | | ShowFunction.SecurityMonitoring,}; |
| | | ShowFunction.SecurityMonitoring, |
| | | ShowFunction.VideoDoorLock, |
| | | }; |
| | | } |
| | | return dddd; |
| | | } |
| | |
| | | /// ip摄像头 |
| | | /// </summary> |
| | | IpCam = 0x25, |
| | | /// <summary> |
| | | /// 萤石视频门锁 |
| | | /// </summary> |
| | | VideoDoorLock = 0x26, |
| | | |
| | | |
| | | } |
| | |
| | | list.Add(DoorLock); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 萤石视频门锁 |
| | | /// </summary> |
| | | public const string VideoDoorLock="security.door.ezviz"; |
| | | /// <summary> |
| | | /// 萤石视频门锁spk列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static List<string> GetVideoDoorLockSPKList() |
| | | { |
| | | var list = new List<string>(); |
| | | list.Add(VideoDoorLock); |
| | | return list; |
| | | } |
| | | |
| | | #region 灯光 |
| | | /// <summary> |
| | |
| | | var spkList = SPK.GetDoorLockSPKList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | /// <summary> |
| | | /// 获取萤石视频门锁 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public List<Function> GetVideoDoorLockList() |
| | | { |
| | | var spkList = SPK.GetVideoDoorLockSPKList(); |
| | | return Functions.FindAll((obj) => spkList.Contains(obj.spk)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新风列表 |
| | |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using Shared; |
| | | using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | |
| | | /// <summary> |
| | | /// 功能控制界面跳转事件 |
| | | /// </summary> |
| | | public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor |
| | | public EventHandler<MouseEventArgs> LoadEvent_SkipFunctionControlPage(Function function, Button btnCollectionIcon, Button btnName, Button btnFromFloor, Comerom comerom,Action action |
| | | ) |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | |
| | | } |
| | | #endif |
| | | break; |
| | | case SPK.VideoDoorLock: { |
| | | //萤石视频门锁 |
| | | var form = new VideoDoorLockPage(function, btnName, btnFromFloor,comerom,action); |
| | | MainPage.BasePageView.AddChidren(form); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | form.Show(); |
| | | } |
| | | break; |
| | | } |
| | | }; |
| | | return eventHandler; |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 抄SDK的,我也不知道这个是什么 |
| | | /// </summary> |
| | |
| | | { |
| | | int index = 0; |
| | | var list = FunctionList.List.GetDeviceFunctionList(); |
| | | |
| | | foreach (var function in list) |
| | | { |
| | | //音乐模块有主从关系,需要特殊处理 |
| | |
| | | btnIcon.UnSelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | } |
| | | |
| | | else if (function.spk == SPK.VideoDoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath =UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect); |
| | | //btnIcon.SelectedImagePath = $"FunctionIcon/Icon/HomeIcon/{function.IconName}_blue.png"; |
| | | } |
| | | else |
| | | { |
| | | Button btnSwitch; |
| | |
| | | }; |
| | | |
| | | |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone); |
| | | var skipControlPageEvent = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollection, btnName, btnZone, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.collect,()=> { |
| | | this.LoadDeviceFunctionControlZone();//删除设备后重新刷新UI |
| | | }); |
| | | view.MouseUpEventHandler = skipControlPageEvent; |
| | | btnName.MouseUpEventHandler = skipControlPageEvent; |
| | | btnIcon.MouseUpEventHandler = skipControlPageEvent; |
| | |
| | | |
| | | LoadEvent_ControlScene(btnCoverd, btnName, btnZone, btnShowDelay, scene); |
| | | |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => { |
| | | Action backAction = () => { |
| | | btnSettingIcon.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | Action backAction = () => |
| | | { |
| | | //LoadSceneFunctionControlZone(); |
| | | }; |
| | | Action refreshAction = () => { |
| | | Action refreshAction = () => |
| | | { |
| | | btnName.Text = scene.name; |
| | | btnZone.Text = scene.GetRoomListName(); |
| | | //view.BackgroundImagePath = (scene as Scene).ImagePath; |
| | |
| | | }; |
| | | var aep = new SceneEditPage(scene, backAction); |
| | | MainPage.BasePageView.AddChidren(aep); |
| | | aep.LoadPage( refreshAction); |
| | | aep.LoadPage(refreshAction); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | //场景正在倒计时执行中 |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | |
| | | //Utlis.WriteLine("GetPushMessageAction M收到推送"); |
| | | GetPushMessageList(showMesType); |
| | | } |
| | |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock; |
| | | using Newtonsoft.Json; |
| | | using Newtonsoft.Json.Linq; |
| | | using Shared; |
| | |
| | | }; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 加载功能列表界面 |
| | | /// </summary> |
| | | void LoadFunctionPageView() |
| | | void LoadFunctionPageView () |
| | | { |
| | | #region |
| | | functionsPageView = new VerticalScrolViewLayout() |
| | | { |
| | | BackgroundColor = CSS_Color.BackgroundColor, |
| | | Height = Application.GetRealHeight(667 - 64 - 49 + 20), |
| | | }; |
| | | contentPageView.AddChidren(functionsPageView); |
| | | this.RefreshFunctionView(); |
| | | |
| | | FrameLayout functionContentView; |
| | | } |
| | | FrameLayout functionContentView; |
| | | /// <summary> |
| | | /// 显示功能列表界面 |
| | | /// </summary> |
| | | void RefreshFunctionView() |
| | | { |
| | | #region |
| | | //functionsPageView = new VerticalScrolViewLayout() |
| | | //{ |
| | | // BackgroundColor = CSS_Color.BackgroundColor, |
| | | // Height = Application.GetRealHeight(667 - 64 - 49 + 20), |
| | | //}; |
| | | //contentPageView.AddChidren(functionsPageView); |
| | | |
| | | //FrameLayout functionContentView; |
| | | functionContentView = new FrameLayout() |
| | | { |
| | | Y = Application.GetRealHeight(16), |
| | |
| | | functionCount = FunctionList.List.GetAcstParentList().Count; |
| | | functionOnCount = FunctionList.List.GetAcstParentList().FindAll((obj) => obj.trait_on_off.curValue.ToString() == "on").Count; |
| | | break; |
| | | case ShowFunction.VideoDoorLock: |
| | | functionCount = FunctionList.List.GetVideoDoorLockList().Count; |
| | | #if DEBUG |
| | | //functionCount = 1; |
| | | #endif |
| | | functionOnCount = 1; |
| | | break; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | IsMoreLines = true, |
| | | }; |
| | | functionView.AddChidren(btnName); |
| | | functionView.AddChidren(btnName); |
| | | |
| | | if (item != ShowFunction.Environmental && item != ShowFunction.Sensor && item != ShowFunction.VideoIntercom |
| | | && item != ShowFunction.SecurityMonitoring && item != ShowFunction.FreshAir && item != ShowFunction.Music |
| | |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | break; |
| | | |
| | | case ShowFunction.VideoDoorLock: |
| | | //萤石视频门锁 |
| | | btnName.TextID = StringId.yingshishipinmensuo; |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var list =CommonMethod.Current.GetVideoDoorLockList(); |
| | | var form = new VideoDoorLockListPage(()=> { |
| | | functionContentView?.RemoveFromParent(); |
| | | this.RefreshFunctionView(); |
| | | }); |
| | | form.AddForm(list); |
| | | }; |
| | | break; |
| | | |
| | | } |
| | | //界面跳转--音乐跳转自己的界面--环境跳转自己的界面 |
| | | if (item != ShowFunction.Music && item != ShowFunction.Environmental && item != ShowFunction.SecurityMonitoring && item != ShowFunction.DoorLock |
| | | && ShowFunction.EnergyMonitoring != item && ShowFunction.VideoIntercom != item && ShowFunction.SecurityCenter != item |
| | | //界面跳转--音乐跳转自己的界面--环境跳转自己的界面--(萤石视频门锁)跳转自己的界面 |
| | | if (item != ShowFunction.VideoDoorLock |
| | | && item != ShowFunction.Music |
| | | && item != ShowFunction.Environmental |
| | | && item != ShowFunction.SecurityMonitoring |
| | | && item != ShowFunction.DoorLock |
| | | && ShowFunction.EnergyMonitoring != item |
| | | && ShowFunction.VideoIntercom != item && |
| | | ShowFunction.SecurityCenter != item |
| | | && ShowFunction.Acst != item) |
| | | { |
| | | btnFunctionViewBg.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | | var skipView = new FunctionPage(); |
| | | MainPage.BasePageView.AddChidren(skipView); |
| | | skipView.LoadPage(functionPageTitleId); |
| | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | |
| | | void refreshInverterInfo(Button btnPowerTenerationToday, Button btnWorkingMode, Button btnCurrentPowerGeneration) |
| | | { |
| | | new System.Threading.Thread(() => |
| | |
| | | /// 是否在调光 |
| | | /// </summary> |
| | | bool onDimmerBar; |
| | | /// <summary> |
| | | /// 删除设备后回调给界面刷新 |
| | | /// </summary> |
| | | Action action; |
| | | |
| | | #endregion |
| | | public FunctionControlZone(Function func) |
| | | public FunctionControlZone(Function func,Action action) |
| | | { |
| | | bodyDiv = this; |
| | | bodyDiv.Tag = func.sid; |
| | | function = func; |
| | | this.action = action; |
| | | } |
| | | |
| | | public override void RemoveFromParent() |
| | |
| | | { |
| | | btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | | else if (function.spk == SPK.VideoDoorLock) |
| | | { |
| | | btnIcon.UnSelectedImagePath = UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.GetVideoDoorLockIcon(UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.function); |
| | | } |
| | | else if (function.spk == SPK.HvacCac) |
| | | { |
| | | var btnHumidityIcon = new Button() |
| | |
| | | /// </summary> |
| | | void LoadEvent_DivSkipEvent() |
| | | { |
| | | var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor); |
| | | var eventHandler = new PublicAssmebly().LoadEvent_SkipFunctionControlPage(function, btnCollectionIcon, btnName, btnFromFloor, UI2.FuntionControlView.VideoDoorLock.CommonMethod.Comerom.room,this.action); |
| | | this.MouseUpEventHandler = eventHandler; |
| | | btnName.MouseUpEventHandler = eventHandler; |
| | | btnFromFloor.MouseUpEventHandler = eventHandler; |
| | |
| | | } |
| | | if (function.spk == SPK.LightRGBW || function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else if (function.spk == SPK.IpCam_Imou) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function,null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | deleteAction = delAction; |
| | | this.modifyImageAction = modifyImageAction; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重载界面 |
| | | /// </summary> |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | |
| | | new TopViewDiv(bodyView,room.roomName).LoadTopView_RoomTop(ReloadRoomName, skipEditPageAction); |
| | | new TopViewDiv(bodyView, room.roomName).LoadTopView_RoomTop(ReloadRoomName, skipEditPageAction); |
| | | |
| | | functionListView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Height = Application.GetRealHeight(603-12), |
| | | Height = Application.GetRealHeight(603 - 12), |
| | | }; |
| | | bodyView.AddChidren(functionListView); |
| | | |
| | | foreach (var function in room.GetRoomFunctions(false)) |
| | | var list = room.GetRoomFunctions(false); |
| | | |
| | | foreach (var function in list) |
| | | { |
| | | if (MainPage.RoomNotSupportFunctionList.Contains( function.spk)) |
| | | if (MainPage.RoomNotSupportFunctionList.Contains(function.spk)) |
| | | { |
| | | continue; |
| | | } |
| | |
| | | |
| | | if (function.spk == SPK.LightRGB || function.spk == SPK.LightDimming) |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function, null) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | } |
| | | else |
| | | { |
| | | var functionDiv = new FunctionControlZone(function) |
| | | var functionDiv = new FunctionControlZone(function, () => |
| | | { |
| | | this.ReLoadPage(); |
| | | }) |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Width = Application.GetRealWidth(343), |
| | |
| | | BorderColor = 0x00FFFFFF, |
| | | BorderWidth = 1, |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | Tag = "Scene-" + scene.sid |
| | | Tag = "Scene-" + scene.sid |
| | | }; |
| | | functionListView.AddChidren(sceneRow); |
| | | LoadSceneRow(sceneRow, scene); |
| | |
| | | /// </summary> |
| | | public void LoadSceneRow(FrameLayout bodyDiv, Scene scene) |
| | | { |
| | | var btnIcon = new Button() |
| | | var btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(10), |
| | | Y = Application.GetRealHeight(15), |
| | |
| | | btnName.X = Application.GetRealWidth(52 + 16); |
| | | } |
| | | //加载场景控制事件 |
| | | LoadEvent_ControlScene(btnName,btnFromFloor,bodyDiv,scene ); |
| | | LoadEvent_ControlScene(btnName, btnFromFloor, bodyDiv, scene); |
| | | |
| | | LoadEvent_FunctionCollection(btnCollectionIcon,scene); |
| | | LoadEvent_FunctionCollection(btnCollectionIcon, scene); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 加载功能收藏按钮事件 |
| | | /// </summary> |
| | | void LoadEvent_FunctionCollection(Button btnCollectionIcon,Scene scene) |
| | | void LoadEvent_FunctionCollection(Button btnCollectionIcon, Scene scene) |
| | | { |
| | | btnCollectionIcon.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | /// <summary> |
| | | /// 加载场景控制事件 |
| | | /// </summary> |
| | | void LoadEvent_ControlScene(Button btnName,Button btnFromFloor,FrameLayout bodyDiv, Scene scene) |
| | | void LoadEvent_ControlScene(Button btnName, Button btnFromFloor, FrameLayout bodyDiv, Scene scene) |
| | | { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => { |
| | | EventHandler<MouseEventArgs> upEvent = (sender, e) => |
| | | { |
| | | DriverLayer.Control.Ins.ControlScene(scene); |
| | | string msg = scene.name + Language.StringByID(StringId.AlreadyOpened); |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false); |
| | |
| | | bodyDiv.MouseUpEventHandler = upEvent; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | view1.btnClick.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | this.identifier = "open_door";//开锁事件 |
| | | //this.VideoDoorLockAction(this, device, view1.btnState); |
| | | this.VideoDoorLockAction(this, device, view1.btnState); |
| | | }; |
| | | if (edit) |
| | | { |
| | |
| | | { |
| | | try |
| | | { |
| | | var faceIDList = Send.Current.GetListHomeFace(device.deviceId,true); |
| | | var faceIDList = Send.Current.GetListHomeFace(device.deviceId, true); |
| | | List<string> faceNameList = new List<string>(); |
| | | for (int i = 0; i < faceIDList.Count; i++) |
| | | { |
| | |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 萤石视频门锁专用 |
| | | /// </summary> |
| | | /// <param name="frame">当前界面</param> |
| | | /// <param name="device">当前设备</param> |
| | | /// <param name="btnState">旧状态</param> |
| | | public void VideoDoorLockAction(FrameLayout frame, Entity.Function device, Button btnState) |
| | | { |
| | | selectedState = device.spk + "_"; |
| | | Loading loading = new Loading(); |
| | | frame.AddChidren(loading); |
| | | loading.Start(); |
| | | System.Threading.Tasks.Task.Run(() => |
| | | { |
| | | try |
| | | { |
| | | var userList =FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.GetVideoDoorLockUserListInfo(device); |
| | | List<string> userNameList = new List<string>(); |
| | | for (int i = 0; i < userList.Count; i++) |
| | | { |
| | | var user = userList[i]; |
| | | userNameList.Add(user.extUserName); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | PublicInterface publicInterface = new PublicInterface();//用户界面 |
| | | publicInterface.FrameOrVv(this, userNameList, new List<string> { btnState.Text }, device.name, (index) => |
| | | { |
| | | var userId = userNameList[index]; |
| | | //界面显示选中值 |
| | | btnState.Text = userId; |
| | | //数据封装 |
| | | AddDictionary("open_user", userId, "string"); |
| | | |
| | | }, false); |
| | | |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | }); |
| | | } |
| | | |
| | | }); |
| | | |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.VideoDoorLock: |
| | | { |
| | | string value = this.GetValue(dicList); |
| | | inputView.btnState.Text = value; |
| | | } |
| | | break; |
| | | case SPK.doorgate: |
| | | { |
| | | if (inputCondition.identifier == "door_call_cloud_event") |
| | |
| | | } |
| | | } |
| | | break; |
| | | case SPK.VideoDoorLock: |
| | | { |
| | | foreach (var dic in dicList) |
| | | { |
| | | string value = dic["value"]; |
| | | button1.Text = value; |
| | | } |
| | | } |
| | | break; |
| | | case SPK.MusicStandard: |
| | | case SPK.AvMusic: |
| | | { |
| | |
| | | var list2 = this.GetVideoDeviceList(); |
| | | list.AddRange(list1); |
| | | list.AddRange(list2); |
| | | //GetTestDevice(ref list, true); |
| | | GetTestDevice(ref list, true); |
| | | return list; |
| | | } |
| | | /// <summary> |
| | |
| | | { |
| | | return "LogicIcon/sensor.png"; |
| | | } |
| | | else if (SPK.DoorLock == device.spk) |
| | | else if (SPK.DoorLock == device.spk |
| | | || SPK.VideoDoorLock == device.spk) |
| | | { |
| | | return "FunctionIcon/DoorLock/DoorLock.png"; |
| | | } |
| | |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.Electric)); |
| | | } |
| | | ///门锁类 |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock); |
| | | var doorlock = deviceList.Find((device) => device.spk == SPK.DoorLock |
| | | || device.spk == SPK.VideoDoorLock); |
| | | if (doorlock != null) |
| | | { |
| | | deviceStrTypeList.Add(Language.StringByID(StringId.DoorLock)); |
| | |
| | | else if (deviceType == Language.StringByID(StringId.DoorLock)) |
| | | { |
| | | functionTypeList.Add(SPK.DoorLock); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | } |
| | | ///音乐类 |
| | | else if (deviceType == Language.StringByID(StringId.Music)) |
| | |
| | | functionTypeList.Add(SPK.MechanicalArm); |
| | | functionTypeList.Add(SPK.IpCam_Imou); |
| | | functionTypeList.Add(SPK.SensorPm10); |
| | | functionTypeList.Add(SPK.VideoDoorLock); |
| | | |
| | | } |
| | | |
| | |
| | | deviceTypeList.Add(SPK.doorgate); |
| | | deviceTypeList.Add(SPK.IpCam_Imou); |
| | | deviceTypeList.Add(SPK.SensorPm10); |
| | | deviceTypeList.Add(SPK.VideoDoorLock); |
| | | |
| | | } |
| | | break; |
| | |
| | | //new Entity.Function { sid = "1234567890", name = "超声波传感器", spk = Entity.SPK.SensorUtrasonic }, |
| | | // new Entity.Function { sid = "1234567891", name = "温度传感器", spk = Entity.SPK.SensorTemperature }, |
| | | // new Entity.Function { sid = "1234567892", name = "湿度传感器", spk = Entity.SPK.SensorHumidity }, |
| | | new Entity.Function { sid = "12345678933456", name = "调光灯", spk = Entity.SPK.LightDimming }, |
| | | new Entity.Function { sid = "1234567895444", name = "面板", spk = Entity.SPK.PanelSocket }, |
| | | new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.SensorPm10 }, |
| | | new Entity.Function { sid = "12345678933456", name = "门锁", spk = Entity.SPK.DoorLock }, |
| | | new Entity.Function { sid = "1234567895444", name = "视频门锁", spk = Entity.SPK.VideoDoorLock }, |
| | | //new Entity.Function { sid = "12345678968888", name = "pm10", spk = Entity.SPK.SensorPm10 }, |
| | | // new Entity.Function { sid = "1234567897", name = "毫米波传感器1", spk = Entity.SPK.SenesorMegahealth2 }, |
| | | // new Entity.Function { sid = "1234567899", name = "门磁传感器", spk = Entity.SPK.SensorDoorWindow }, |
| | | // new Entity.Function { sid = "12345678991234", name = "HDL机械手", spk = Entity.SPK.MechanicalArm }, |
| | |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取住宅已录入人脸信息 |
| | | /// </summary> |
| | | /// <param name="deviceId">可视对讲设备id</param> |
| | | /// <returns></returns> |
| | | public List<Face> GetHomeFaceList(string deviceId, bool isTip) |
| | | { |
| | | var jObject = new JObject(); |
| | | jObject.Add("homeId", LogicMethod.Current.HomeId); |
| | | jObject.Add("deviceId", deviceId); |
| | | var responsePackNew = RequestServerhomeId(jObject, NewAPI.Api_Post_GetListHomeFace, "获取住宅已录入人脸信息"); |
| | | //如果是token过期则刷新token |
| | | if (responsePackNew.Code == StateCode.TOKEN_EXPIRED) |
| | | { |
| | | RefreshToken(); |
| | | GetListHomeFace(deviceId, isTip); |
| | | } |
| | | if (Check(responsePackNew, isTip) == false) |
| | | { |
| | | return new List<Face>(); |
| | | } |
| | | var list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Face>>(responsePackNew.Data.ToString()); |
| | | if (list == null) |
| | | { |
| | | list = new List<Face>(); |
| | | } |
| | | faceList.Clear(); |
| | | faceList.AddRange(list); |
| | | return list; |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | ///请求服务器(与住宅有关:例如;homeId) |
| | | /// </summary> |
| | |
| | | dialog.Close(); |
| | | LoadEvent_ChangeCurHome(home); |
| | | LoadContentView(); |
| | | HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.ChangeCurrHome(home); |
| | | }; |
| | | } |
| | | dialog.Show(); |
| | |
| | | dialog.Close(); |
| | | LoadEvent_ChangeCurHome(home); |
| | | LoadContentView(); |
| | | HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.ChangeCurrHome(home); |
| | | }; |
| | | } |
| | | |
| | |
| | | /// 位置信息跳转编辑按钮 |
| | | /// </summary> |
| | | Button btnLocationInfoRight; |
| | | /// <summary> |
| | | /// 删除设备 |
| | | /// </summary> |
| | | Button delTextBtn; |
| | | /// <summary> |
| | | /// 下一级图标 |
| | | /// </summary> |
| | | Button delRightBtn; |
| | | /// <summary> |
| | | /// 删除设备行FrameLayout |
| | | /// </summary> |
| | | FrameLayout delView; |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// 后退时,刷新之前界面的显示信息 |
| | | /// </summary> |
| | | Action actionRefresh; |
| | | |
| | | /// <summary> |
| | | /// 解绑设备回调 |
| | | /// </summary> |
| | | public Action actionDel; |
| | | #endregion |
| | | |
| | | public FunctionBaseInfoSetPage(Function func, Action action) |
| | |
| | | #endregion |
| | | } |
| | | #region 共享 |
| | | |
| | | //var sharedView = new FrameLayout() |
| | | //{ |
| | | // Height = Application.GetRealHeight(55), |
| | | // BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | //}; |
| | | //contentView.AddChidren(sharedView); |
| | | |
| | | //var btnSharedText = new Button() |
| | | //{ |
| | | // X = Application.GetRealWidth(16), |
| | |
| | | // }); |
| | | #endregion |
| | | |
| | | #region 删除设备行 |
| | | |
| | | delView = new FrameLayout() |
| | | { |
| | | Height = Application.GetRealHeight(55), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | | if (this.function.spk == SPK.VideoDoorLock) |
| | | { |
| | | contentView.AddChidren(delView); |
| | | } |
| | | var lineBtn = new Button() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | | BackgroundColor = CSS_Color.DividingLineColor, |
| | | Width = Application.GetRealWidth(343), |
| | | Height = Application.GetRealHeight(1) |
| | | }; |
| | | delView.AddChidren(lineBtn); |
| | | delTextBtn = new Button() |
| | | { |
| | | X = Application.GetRealWidth(16), |
| | | Width = Application.GetRealWidth(160), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = CSS_Color.FirstLevelTitleColor, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextID = StringId.DeleteDevice, |
| | | }; |
| | | delView.AddChidren(delTextBtn); |
| | | |
| | | delRightBtn= new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | | Width = Application.GetMinRealAverage(16), |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/RightIcon.png", |
| | | }; |
| | | delView.AddChidren(delRightBtn); |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | #if stage2 |
| | | #region 添加到桌面 |
| | | var addToDesktopView = new FrameLayout() |
| | |
| | | { |
| | | LoadEvent_ChangeFunctionName (); |
| | | SkipChooseRoomPage(); |
| | | DelDeviceEvent(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 解绑设备的事件 |
| | | /// </summary> |
| | | void DelDeviceEvent() |
| | | { |
| | | |
| | | EventHandler<MouseEventArgs> ClickEvent = (sener, e) => |
| | | { |
| | | new HDL_ON.UI.Music.View.TipView().TipBox(-1, StringId.AreYouSureToDeleteThisDevice, () => |
| | | { |
| | | UI2.FuntionControlView.VideoDoorLock.VideDoorLockSend.Current.DelDevice(this.function, (isBool) => |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (!isBool) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Text = Language.StringByID(StringId.delFail), |
| | | Direction = AMPopTipDirection.None, |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | //删除本地文件 |
| | | UI2.FuntionControlView.VideoDoorLock.CommonMethod.Current.DeleteFunction(this.function); |
| | | this.RemoveFromParent(); |
| | | this.actionDel?.Invoke(); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | }); |
| | | }; |
| | | this.delView.MouseUpEventHandler += ClickEvent; |
| | | this.delTextBtn.MouseUpEventHandler += ClickEvent; |
| | | this.delRightBtn.MouseUpEventHandler += ClickEvent; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | UI2.FuntionControlView.Music.View.MyListView myListView = new UI2.FuntionControlView.Music.View.MyListView(); |
| | | myListView.frameLayout(this, A31MusicModel.Current); |
| | | myListView.dialogFra.AddChidren(loading);//dialogFra刷新图标父控件 |
| | | loading.Start(); |
| | | ///下拉刷新 |
| | | myListView.verticalScrolViewLayout.BeginHeaderRefreshingAction += () => |
| | | { |
| | | myListView.verticalScrolViewLayout.EndHeaderRefreshing(); //结束刷新 |
| | | loading.Start(); |
| | | System.Threading.Tasks.Task.Run((() => |
| | | { |
| | | try |
| | |
| | | |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | myListView.verticalScrolViewLayout.RemoveAll(); |
| | | var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name); |
| | | var source = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source); |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | loading.Hide(); |
| | | //myListView.verticalScrolViewLayout.EndHeaderRefreshing(); |
| | | //myListView.verticalScrolViewLayout.RemoveAll(); |
| | | //var listName = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.playlist_name); |
| | | //var source = A31MusicModel.Current.functionMusic.GetAttrState(KeyProperty.source); |
| | |
| | | }); |
| | | } |
| | | })); |
| | | //结束刷新 |
| | | |
| | | }; |
| | | ///移除界面 |
| | |
| | | myListView.popFra.RemoveFromParent(); |
| | | }; |
| | | myListView.backIextBtn.MouseUpEventHandler += removeFromParentView; |
| | | myListView.popFra.MouseUpEventHandler += removeFromParentView; |
| | | //myListView.popFra.MouseUpEventHandler += removeFromParentView; |
| | | #endregion |
| | | //var listName = A31MusicModel.Current.functionMusic.GetAttribute("playlist_name").ToString(); |
| | | //var musicList = A31MusicModel.Current.GetSongList(listName); |
| | |
| | | } |
| | | else |
| | | { |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, source, frameLayout); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | loading.Hide(); |
| | | A31SongPlay.SongListView(verticalScrolViewLayout, musicList, listName, source, frameLayout); |
| | | }); |
| | | } |
| | | } |
| | | /// <summary> |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", functionIds); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_RefreshDeviceStatus, "刷新设备状态"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | d.Add("homeId", DB_ResidenceData.Instance.CurrentRegion.id); |
| | | d.Add("deviceIds", new List<string> { music.deviceId }); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_PlayerList, "获取音乐列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return; |
| | | } |
| | |
| | | } |
| | | d.Add("deviceInfos", new List<Dictionary<string, object>> { deviceIds }); |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupList, "获取列表名列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return new List<GroupList>(); |
| | | } |
| | |
| | | d.Add("sidGroups", new List<Dictionary<string, object>> { d1 }); |
| | | |
| | | var responsePackNew = RequestServerhomeId(d, NewAPI.Api_Post_GroupPlayerList, "通过列表名获取歌曲列表"); |
| | | if (!this.dataChecking(responsePackNew)) |
| | | if (!this.DataChecking(responsePackNew)) |
| | | { |
| | | return new List<PalyerSongListInfo>(); |
| | | } |
| | |
| | | /// </summary> |
| | | /// <param name="responsePackNew">回复数据对象</param> |
| | | /// <returns></returns> |
| | | private bool dataChecking(ResponsePackNew responsePackNew) |
| | | private bool DataChecking(ResponsePackNew responsePackNew) |
| | | { |
| | | if (responsePackNew.Code != "0" || responsePackNew.Data == null || responsePackNew.Data.ToString() == "") |
| | | if (responsePackNew.Data == null||responsePackNew.Code != "0" || responsePackNew.Data.ToString() == "") |
| | | { |
| | | |
| | | return false; |
| | | } |
| | | return true; |
| | |
| | | Y = Application.GetRealHeight(355), |
| | | Width = Application.GetRealWidth(28), |
| | | Height = Application.GetRealWidth(28), |
| | | UnSelectedImagePath = "MusicIcon/playList.png", |
| | | UnSelectedImagePath = "MusicIcon/currentPlayList.png", |
| | | }; |
| | | /// <summary> |
| | | /// 音量图标 |
| | |
| | | using System; |
| | | namespace HDL_ON.UI.Music |
| | | { |
| | | public static class TextSize |
| | | public class TextSize |
| | | { |
| | | public static int TopLine = 1; |
| | | public static int MiddleLine =1; |
| | | public static int DownLine = 1; |
| | | public const int TopLine = 1; |
| | | public const int MiddleLine = 1; |
| | | public const int DownLine = 1; |
| | | |
| | | |
| | | |
| | | public static int Text24 = 24; |
| | | public static int Text20 = 20; |
| | | public static int Text18 = 18; |
| | | public static int Text16 = 16; |
| | | public static int Text14 = 14; |
| | | public static int Text12 = 12; |
| | | public static int Text10 = 10; |
| | | public const int Text24 = 24; |
| | | public const int Text20 = 20; |
| | | public const int Text18 = 18; |
| | | public const int Text16 = 16; |
| | | public const int Text14 = 14; |
| | | public const int Text12 = 12; |
| | | public const int Text10 = 10; |
| | | |
| | | } |
| | | public static class MusicColor |
| | | public class MusicColor |
| | | { |
| | | /// <summary> |
| | | /// 顶部背景颜色 |
| | | /// </summary> |
| | | public static uint TopViewColor = 0xFFF7F7F7; |
| | | public const uint TopViewColor = 0xFFF7F7F7; |
| | | /// <summary> |
| | | /// 界面背景颜色 |
| | | /// </summary> |
| | | public static uint ViewColor = 0xFFF2F3F7; |
| | | public const uint ViewColor = 0xFFF2F3F7; |
| | | /// <summary> |
| | | /// 白色背景颜色 |
| | | /// </summary> |
| | | public static uint WhiteColor = 0xFFFFFFFF; |
| | | public const uint WhiteColor = 0xFFFFFFFF; |
| | | /// <summary> |
| | | /// 红色背景颜色 |
| | | /// </summary> |
| | | public static uint RedColor = 0xFFFF4747; |
| | | |
| | | /// <summary> |
| | | /// 线条颜色 |
| | | /// </summary> |
| | | public static uint LineColor =0xFFECEDEE; |
| | | /// <summary> |
| | | /// 弹窗背景颜色 |
| | | /// </summary> |
| | | public static uint PopupBackgroundColor = 0x90000000; |
| | | public const uint RedColor = 0xFFFF4747; |
| | | |
| | | /// <summary> |
| | | /// 线条颜色 |
| | | /// </summary> |
| | | public static uint MusicEditColor = 0xFFFC9C04; |
| | | public const uint LineColor = 0xFFECEDEE; |
| | | /// <summary> |
| | | /// 弹窗背景颜色 |
| | | /// </summary> |
| | | public static uint MusicDelColor = 0xFFFF7474; |
| | | public const uint PopupBackgroundColor = 0x90000000; |
| | | |
| | | public static uint Text18Color = 0xFF1B2D4D; |
| | | public static uint MusicTxet14SelectedColor = 0xFF4484F4; |
| | | public static uint MusicTxet14Color = 0xFF1B2D4D; |
| | | public static uint MusicTxet12SelectedColor = 0xFF4484F4; |
| | | |
| | | public static uint MusicNoTxetColor = 0xFFC0C7D4; |
| | | public static uint TextColor = 0xFF1B2D4D; |
| | | public static uint SelectedColor = 0xFF4484F4; |
| | | /// <summary> |
| | | /// 线条颜色 |
| | | /// </summary> |
| | | public const uint MusicEditColor = 0xFFFC9C04; |
| | | /// <summary> |
| | | /// 弹窗背景颜色 |
| | | /// </summary> |
| | | public const uint MusicDelColor = 0xFFFF7474; |
| | | |
| | | public static uint TextTimeColor = 0xFF798394; |
| | | public const uint Text18Color = 0xFF1B2D4D; |
| | | public const uint MusicTxet14SelectedColor = 0xFF4484F4; |
| | | public const uint MusicTxet14Color = 0xFF1B2D4D; |
| | | public const uint MusicTxet12SelectedColor = 0xFF4484F4; |
| | | |
| | | public static uint TextCancelColor = 0xFF798394; |
| | | public const uint MusicNoTxetColor = 0xFFC0C7D4; |
| | | public const uint TextColor = 0xFF1B2D4D; |
| | | public const uint SelectedColor = 0xFF4484F4; |
| | | |
| | | public const uint TextTimeColor = 0xFF798394; |
| | | |
| | | public const uint TextCancelColor = 0xFF798394; |
| | | |
| | | } |
| | | |
| | | public static class H_W { |
| | | public class H_W |
| | | { |
| | | /// <summary> |
| | | /// app高度 |
| | | /// </summary> |
| | | public static int H = 667; |
| | | public const int H = 667; |
| | | /// <summary> |
| | | /// app宽度 |
| | | /// </summary> |
| | | public static int W = 375; |
| | | public const int W = 375; |
| | | /// <summary> |
| | | /// 顶部高度 |
| | | /// </summary> |
| | | public static int T_Height = 64; |
| | | public const int T_Height = 64; |
| | | |
| | | /// <summary> |
| | | /// 线高度 |
| | | /// </summary> |
| | | public static int Line = 1; |
| | | public const int Line = 1; |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | public class ShowDialog |
| | | { |
| | | |
| | | private static ShowDialog showDialog; |
| | | |
| | | public static ShowDialog Currnet |
| | | { |
| | | get |
| | | { |
| | | if (showDialog == null) |
| | | { |
| | | |
| | | showDialog = new ShowDialog(); |
| | | } |
| | | |
| | | return showDialog; |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | public Dialog dialog; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="title">标题</param> |
| | | /// <param name="action1">回调函数</param> |
| | | /// <param name="action2">回调函数</param> |
| | | public void ClickBox(string title, Action<Dialog> action1, Action<Dialog> action2) |
| | | /// <param name="jieTingAction">回调函数</param> |
| | | /// <param name="guanBiAction">回调函数</param> |
| | | public void ClickBox(string title, Action<Dialog> jieTingAction, Action<Dialog> guanBiAction) |
| | | { |
| | | Dialog dialog = new Dialog() |
| | | if (dialog != null) |
| | | { |
| | | //防止二重界面 |
| | | dialog.Close(); |
| | | } |
| | | dialog = new Dialog() |
| | | { |
| | | BackgroundColor = MusicColor.PopupBackgroundColor, |
| | | }; |
| | | |
| | | FrameLayout whiteView = new FrameLayout() |
| | | { |
| | | X = Application.GetRealWidth(56), |
| | |
| | | TextColor = MusicColor.TextColor, |
| | | TextSize = TextSize.Text16, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | Text = "来自“围墙机”呼叫", |
| | | Text = title, |
| | | |
| | | }; |
| | | whiteView.AddChidren(btnTitle); |
| | | |
| | | |
| | | Button guaduanIconBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(75), |
| | |
| | | |
| | | guaduanIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | action1(dialog); |
| | | guanBiAction(dialog); |
| | | }; |
| | | jietingIconBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | action2(dialog); |
| | | jieTingAction(dialog); |
| | | }; |
| | | |
| | | } |
| | |
| | | using HDL_ON.Entity; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | #if __IOS__ |
| | | #else |
| | | using Com.Videogo.Hdl; |
| | | #endif |
| | | |
| | | namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock |
| | | { |
| | |
| | | /// 读取云端的上设备列表(android源生添加设备到云端成功后) |
| | | /// <paramref name="devSerial"/>设备序列号</param> |
| | | /// </summary> |
| | | public void SkipAddDeviceActivity(string devSerial) |
| | | public void SkipAddDeviceActivity(string spk) |
| | | { |
| | | #if __IOS__ |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | EZSDK.IOS.EZSDK.SharedInstance().AddEzvizMonitorWithDeviceType(devSerial); |
| | | |
| | | }); |
| | | #else |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | if (!isBools) { |
| | | this.MainThread(()=> { |
| | | if (!isBools) |
| | | { |
| | | this.MainThread(() => |
| | | { |
| | | this.ShowTip("先获取萤石云子账号token失败。"); |
| | | |
| | | }); |
| | | } |
| | | HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity); |
| | | #if __IOS__ |
| | | |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpToEZScanActivity(Application.Activity,spk); |
| | | HDLEzvizSdk.SetAddCallback(new AndroidIHdlInterface((isBool, adnroidActionDevSerial) => |
| | | { |
| | | if (isBool) |
| | |
| | | } |
| | | |
| | | })); |
| | | #endif |
| | | }); |
| | | |
| | | |
| | | |
| | | #endif |
| | | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 打开实时视频画面 |
| | | /// </summary> |
| | | /// <param name="deviceSerial">设备序列号</param> |
| | | /// <param name="deviceId">设备id(云端上deviceId)</param> |
| | | /// <param name="spk">设备spk(云雀上定义好的)</param> |
| | | public void SkipRTVActivity(string deviceSerial, string deviceId, string spk) |
| | | /// <param name="isDialog">是否需要弹框</param> |
| | | public void SkipRTVActivity(string deviceSerial, string deviceId, string spk, bool isDialog) |
| | | { |
| | | #if __IOS__ |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | EZSDK.IOS.EZSDK.SharedInstance().PlayWithDeviceSerial(deviceSerial, deviceId, spk); |
| | | }); |
| | | |
| | | |
| | | #else |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | if (!isBools) |
| | | { |
| | | this.MainThread(() => { |
| | | this.ShowTip("先获取萤石云子账号token失败。"); |
| | | |
| | | }); |
| | | } |
| | | Video.View.ShowDialog.Currnet.ClickBox(Language.StringByID(StringId.laizimenlinghujiao), (dialog) => |
| | | { |
| | | dialog.Close(); |
| | | HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk); |
| | | }, (dialog) => |
| | | { |
| | | dialog.Close(); |
| | | }); |
| | | |
| | | }); |
| | | |
| | | |
| | | #endif |
| | | } |
| | | /// <summary> |
| | | /// 浏览历史记录 |
| | | /// </summary> |
| | | public void SkipRecordActivity(string deviceId) |
| | | { |
| | | this.InitializationAndroidData((s)=> { |
| | | |
| | | |
| | | //HDLEzvizSdk.Instance.JumpLockHistoryActivity(Application.Activity, deviceId); |
| | | |
| | | }); |
| | | //未实现 |
| | | //this.InitializationAndroidData(); |
| | | // |
| | | } |
| | | /// <summary> |
| | | /// 临时密码开门 |
| | | /// <paramref name="deviceId"/> |
| | | /// </summary> |
| | | public void SkipPSWActivity(string deviceId) |
| | | { |
| | | #if __IOS__ |
| | | |
| | | #else |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | if (!isBools) |
| | |
| | | |
| | | }); |
| | | } |
| | | HDLEzvizSdk.Instance.JumpTempPasswordActivity(Application.Activity, deviceId); |
| | | |
| | | if (isDialog) |
| | | { |
| | | Video.View.ShowDialog.Currnet.ClickBox(Language.StringByID(StringId.laizimenlinghujiao), (dialog) => |
| | | { |
| | | dialog.Close(); |
| | | #if __IOS__ |
| | | |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk); |
| | | #endif |
| | | }, (dialog) => |
| | | { |
| | | dialog.Close(); |
| | | }); |
| | | } |
| | | else |
| | | { |
| | | #if __IOS__ |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpToEZRealPlayActivity(Application.Activity,deviceId,deviceSerial,spk); |
| | | #endif |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 浏览历史记录 |
| | | /// </summary> |
| | | public void SkipRecordActivity(string deviceId) |
| | | { |
| | | this.InitializationAndroidData((s) => |
| | | { |
| | | |
| | | #if __IOS__ |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpLockHistoryActivity(Application.Activity, deviceId); |
| | | #endif |
| | | |
| | | }); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 临时密码开门 |
| | | /// <paramref name="deviceId"/> |
| | | /// </summary> |
| | | public void SkipPSWActivity(string deviceId) |
| | | { |
| | | this.InitializationAndroidData((isBools) => |
| | | { |
| | | if (!isBools) |
| | | { |
| | | this.MainThread(() => |
| | | { |
| | | this.ShowTip("先获取萤石云子账号token失败。"); |
| | | |
| | | }); |
| | | } |
| | | #if __IOS__ |
| | | #else |
| | | HDLEzvizSdk.Instance.JumpTempPasswordActivity(Application.Activity, deviceId); |
| | | #endif |
| | | |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public void InitializationAndroidData(Action<bool> action) |
| | | { |
| | | |
| | | |
| | | |
| | | |
| | | bool isBool = true; |
| | | this.SunThread(() => |
| | | { |
| | |
| | | EZSDK.IOS.EZSDK.SharedInstance().SetRequestHttpsHostAndPlatform(OnAppConfig.Instance.RequestHttpsHost, 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | //2.设置萤石子账号的AccessToken到SDK |
| | | 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 |
| | | HDLEzvizSdk.Instance.Init(Application.Activity.Application, ezChildAccessToken, UserInfo.Current.LoginTokenString, UserInfo.Current.RefreshToken, OnAppConfig.Instance.RequestHttpsHost, "1aa98a90489b4838b966b57018b4b04b", 1, DB_ResidenceData.Instance.CurrentRegion.id); |
| | | |
| | |
| | | if (DB_ResidenceData.Instance.CurrentRegion.id == home.id || string.IsNullOrEmpty(home.id)) return; |
| | | |
| | | } |
| | | #endregion |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 萤石视频门锁的图标 |
| | |
| | | } |
| | | |
| | | } |
| | | #region --------- 功能文件保存,删除 -------- |
| | | #region --------- 功能文件保存,删除 -------- |
| | | /// <summary> |
| | | /// 保存本地文件 |
| | | /// </summary> |
| | |
| | | FunctionList.List.DeleteFunction(function); |
| | | MainPage.Log($"文件删除->{function.name}-->{function.spk}"); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | /// <summary> |
| | | /// 获取Loading对象 |
| | | /// </summary> |
| | |
| | | /// <returns></returns> |
| | | public List<Function> GetVideoDoorLockList() |
| | | { |
| | | //var list = FunctionList.List.GetVideoDoorLockList(); |
| | | var list = FunctionList.List.GetVideoDoorLockList(); |
| | | #if DEBUG |
| | | //list.Add(new Function { name = "视频门锁一", sid = "23456789", spk = SPK.VideoDoorLock }); |
| | | //list.Add(new Function { name = "视频门锁二", sid = "2345678922", spk = SPK.VideoDoorLock }); |
| | | #endif |
| | | return new List<Function>(); |
| | | return list; |
| | | } |
| | | #region ---------自定义线程(子线程,主线程)-------- |
| | | #region ---------自定义线程(子线程,主线程)-------- |
| | | /// <summary> |
| | | /// 子线程 |
| | | /// </summary> |
| | |
| | | }); |
| | | |
| | | } |
| | | #endregion |
| | | #region --------- 提示框,确认框 -------- |
| | | #endregion |
| | | #region --------- 提示框,确认框 -------- |
| | | /// <summary> |
| | | /// 对话框(只要程序报错的时候才用到) |
| | | /// </summary> |
| | |
| | | new PublicAssmebly().TipMsgAutoClose(msg, false, time * 1000); |
| | | }); |
| | | } |
| | | #endregion |
| | | #endregion |
| | | /// <summary> |
| | | /// 弹框类型 |
| | | /// </summary> |
| | |
| | | room,//房间 |
| | | push,//推送 |
| | | } |
| | | |
| | | #if __IOS__ |
| | | ///// <summary> |
| | | ///// 专门定义给Ios回调用着,没有特殊含义 |
| | | ///// </summary> |
| | | //public class IosIHdlInterface : Shared.IOS.HDLLinphoneSDK.HDLLinphoneCallDelegate |
| | | //{ |
| | | |
| | | // Action<bool, string> mAction; |
| | | // public IosIHdlInterface(Action<bool, string> action) |
| | | // { |
| | | // mAction = action; |
| | | // } |
| | | // /// <summary> |
| | | // /// |
| | | // /// </summary> |
| | | // /// <param name="p0">true是入网成功(源生回调返回)</param> |
| | | // /// <param name="p1">设备的序列化(源生回调返回)</param> |
| | | // public void AddCallback(bool p0, string p1) |
| | | // { |
| | | // mAction?.Invoke(p0, p1); |
| | | // } |
| | | |
| | | |
| | | //} |
| | | #else |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 专门定义给安卓回调用着,没有特殊含义 |
| | | /// </summary> |
| | | public class AndroidIHdlInterface : Java.Lang.Object, IHdlInterface |
| | | { |
| | |
| | | |
| | | |
| | | } |
| | | |
| | | #endif |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | this.CalculatedPosition();//重新计算宽度 |
| | | |
| | | }); |
| | | //infoView.actionDel += () => |
| | | // { |
| | | // //解绑设备后 |
| | | // this.RemoveFromParent(); |
| | | // this.action?.Invoke(); |
| | | infoView.actionDel += () => |
| | | { |
| | | //解绑设备后 |
| | | this.RemoveFromParent(); |
| | | this.action?.Invoke(); |
| | | |
| | | // }; |
| | | }; |
| | | MainPage.BasePageView.AddChidren(infoView); |
| | | infoView.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | //实时视频 |
| | | this.rtvFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | | { |
| | | CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk); |
| | | CommonMethod.Current.SkipRTVActivity(this.device.sid, this.device.deviceId, this.device.spk,false); |
| | | }); |
| | | //临时密码 |
| | | this.pswFL.SetClickListener((fl, btnStateImage, btnStateText) => |
| | |
| | | { |
| | | btnNavigationSelectionIcon.SetRotation(0f); |
| | | ContextView.RemoveAll(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | var classificaitionView = new ClassificationPage(); |
| | | ContextView.AddChidren(classificaitionView); |
| | | classificaitionView.LoadPage(); |
| | | |
| | | }); |
| | | }) |
| | | { IsBackground = true, Priority = System.Threading.ThreadPriority.Lowest }.Start(); |