From 691dbe24f5724f153e07947c7b75bdfea5f0b6d5 Mon Sep 17 00:00:00 2001 From: wxr <wxr@hdlchina.com.cn> Date: 星期二, 24 九月 2024 16:15:15 +0800 Subject: [PATCH] 离线控制模式 --- HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 82 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 74 insertions(+), 8 deletions(-) diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs index 0a872aa..e83f2fd 100644 --- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs +++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs @@ -3,6 +3,7 @@ using HDL_ON.DAL.Server; using HDL_ON.Entity; using Shared; +using static HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock.CommonMethod; namespace HDL_ON.UI { @@ -12,7 +13,7 @@ /// <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) => @@ -21,10 +22,30 @@ //璺宠浆鍒板姛鑳戒俊鎭缃〉闈� switch (function.spk) { + case SPK.ElectricEnergy: + var skipView = new EnergyMainPage(); + MainPage.BasePageView.AddChidren(skipView); + skipView.LoadPage(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + break; + case SPK.GroupControl: + //var dialog = new GroupControlPage(FunctionList.List.groupControls.Find((obj) => obj.sid == function.sid)); + //dialog.ShowDialog(); + var groupControlPage = new GroupControlPage_V2(FunctionList.List.groupControls.Find((obj) => obj.sid == function.sid)); + MainPage.BasePageView.AddChidren(groupControlPage); + groupControlPage.LoadPage(btnCollectionIcon, btnName, btnFromFloor); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + break; case SPK.AirSwitch: var airSwitchPage = new AirSwitchPage(function); MainPage.BasePageView.AddChidren(airSwitchPage); airSwitchPage.LoadPage(btnCollectionIcon, btnName, btnFromFloor); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + break; + case SPK.AirSwitchP3: + var airSwitchP3Page = new AirSwitchP3Page(function); + MainPage.BasePageView.AddChidren(airSwitchP3Page); + airSwitchP3Page.LoadPage(btnCollectionIcon, btnName, btnFromFloor); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.LightSwitch: @@ -82,7 +103,7 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.FloorHeatStandard: - case SPK.HvacFloorHeat: + case SPK.HvacFloorHeat:case SPK.HvacFloorHeatPanel: var fhView = new FloorHeatingPage(function); MainPage.BasePageView.AddChidren(fhView); fhView.LoadPage(btnCollectionIcon, btnName, btnFromFloor); @@ -148,11 +169,11 @@ break; case SPK.MusicStandard: case SPK.AvMusic: - //Music.A31MusicModel.Current= new Music.A31MusicModel { functionMusic = function };//褰撳墠鎾斁鍣� - //var a31PlayMusicPage = new Music.A31PlayMusicPage(); - //MainPage.BasePageView.AddChidren(a31PlayMusicPage); - //a31PlayMusicPage.Show(); - //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + Music.A31MusicModel.Current = new Music.A31MusicModel { functionMusic = function, LastDateTime = DateTime.Now };//褰撳墠鎾斁鍣� + var a31PlayMusicPage = new Music.A31PlayMusicPage(); + MainPage.BasePageView.AddChidren(a31PlayMusicPage); + a31PlayMusicPage.Show(); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.LightCCT: var TureView = new ColorTureLampPage(function); @@ -161,6 +182,7 @@ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; break; case SPK.SensorPir: + case SPK.SensorPirHold: var pirPage = new SensorPirPage(); pirPage.ShowColltionButton = false; pirPage.AddForm(function, btnCollectionIcon, btnName, btnFromFloor); @@ -234,6 +256,18 @@ break; case SPK.IpCam_Imou: #if __IOS__ + if (Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken == null){//鏈垵濮嬪寲鎽勫儚澶� + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().InitSDKWithAppKey("HDL-HOME-APP-TEST", "WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss", OnAppConfig.Instance.RequestHttpsHost); + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().AccessToken = UserInfo.Current.LoginTokenString; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshToken = UserInfo.Current.RefreshToken; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().HomeId = DB_ResidenceData.Instance.CurrentRegion.id; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList(); + } + //璺宠浆澶у崕鎽勫儚澶� + Shared.Application.currentVC.NavigationController.NavigationBar.BarTintColor = UIKit.UIColor.LightGray; + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().RefreshDeviceList(); + Shared.IOS.HDLCNVRSDK.HDLLCNVRSDK.SharedInstance().ToMonitorViewWithDeviceId(function.extDevId, function.name, Shared.Application.currentVC); + //Shared.Application.currentVC.NavigationController.NavigationBar.Hidden = false; #else FunctionList.List.GetIpCamImouList(); if (string.IsNullOrEmpty(Com.Utils.HdlToLcUtils.Instance.SubAccessToken)) @@ -256,9 +290,11 @@ new PublicAssmebly().TipMsg(Language.StringByID(StringId.Tip), Language.StringByID(StringId.huoqushujushibao)); }); } - Application.RunOnMainThread(() =>{ + Application.RunOnMainThread(() => + { try { + Com.Utils.HdlToLcUtils.Instance.SubAccessToken = pack.Data.ToString(); Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); } @@ -298,6 +334,7 @@ { try { + Com.Utils.HdlToLcUtils.Instance.Play(function.extDevId, function.name); } catch (Exception ex) @@ -307,6 +344,35 @@ } #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; + case SPK.AvZkAiks: + { + //褰遍煶涓帶 + var form = new UI2.FuntionControlView.Aks.AksPage(function, btnName, btnFromFloor, comerom, action); + MainPage.BasePageView.AddChidren(form); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + form.Show(); + + } + break; + case SPK.ElectricalTvHisense: + { + //娴蜂俊鐢佃 + var form = new UI2.FuntionControlView.HisenseTV.HisenseTvPage(function, btnName, btnFromFloor, btnCollectionIcon, comerom, action); + MainPage.BasePageView.AddChidren(form); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + form.Show(); + + } + break; } }; return eventHandler; -- Gitblit v1.8.0