From 8407d6631ac8f5b65c4a14fa27babaa48026d4ca Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 30 三月 2023 16:13:40 +0800 Subject: [PATCH] Merge branch 'wjc' into Dev-Branch --- HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 222 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs new file mode 100644 index 0000000..11c271d --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/VideoDoorLock/VideoDoorLockListPage.cs @@ -0,0 +1,222 @@ +锘縰sing Shared; +using HDL_ON.Stan; +using System; +using System.Collections.Generic; +using System.Text; +using HDL_ON.UI.CSS; +using HDL_ON.Entity; + +namespace HDL_ON.UI.UI2.FuntionControlView.VideoDoorLock +{ + /// <summary> + /// 瑙嗛闂ㄩ攣鍒楄〃鐣岄潰 + /// </summary> + public class VideoDoorLockListPage : EditorCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 闂ㄩ攣璁惧鍒楄〃 + /// </summary> + private List<Function> listDevice = new List<Function>(); + /// <summary> + /// 鐢垫睜鎺т欢鍒楄〃(key:璁惧鐨剆id) + /// </summary> + private Dictionary<string, BatteryPersentControl> dicBatteryContr = new Dictionary<string, BatteryPersentControl>(); + /// <summary> + /// 鍒楄〃鎺т欢 + /// </summary> + private VerticalListControl listView = null; + /// <summary> + /// 鍒犻櫎璁惧鍚庨渶瑕佹洿鏂扮晫闈㈢殑鍥炶皟 + /// </summary> + public Action action; + + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + public VideoDoorLockListPage(Action action) { + this.action = action; + } + + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_listDevice">闂ㄩ攣璁惧鍒楄〃</param> + public void ShowForm(List<Function> i_listDevice) + { + this.listDevice.AddRange(i_listDevice); + //鏅鸿兘闂ㄩ攣 + base.SetTitleText(Language.StringByID(StringId.shipinmensuo)); + + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + private void InitMiddleFrame() + { + //娓呯┖bodyFrame + this.ClearBodyFrame(); + + string nowSelectId = string.Empty; + //妤煎眰涓嬫媺鍥炬爣 + var btnFloor = new NormalViewControl(500, Application.GetRealHeight(16), false); + var btnFloorIcon = new IconViewControl(16); + btnFloorIcon.X = HdlControlResourse.XXLeft; + btnFloorIcon.Y = Application.GetRealHeight(18); + btnFloorIcon.UnSelectedImagePath = "Public/DownIcon.png"; + bodyFrameLayout.AddChidren(btnFloorIcon); + btnFloorIcon.ButtonClickEvent += (sender, e) => + { + //鏄剧ず涓嬫媺鍒楄〃 + var form = new FloorRoomSelectPopupView(); + form.ShowDeviceFunctionView(btnFloor, this.listDevice, (selectId, listFunc) => + { + btnFloor.Width = btnFloor.GetRealWidthByText();//閲嶇疆鏂囨湰瀹藉害 + nowSelectId = selectId; + //閲嶆柊鍒濆鍖栭棬閿佸垪琛ㄦ帶浠� + this.InitDoorListControl(listFunc); + + }, nowSelectId); + }; + //妤煎眰 + btnFloor.X = btnFloorIcon.Right + Application.GetRealWidth(2); + btnFloor.TextColor = CSS_Color.FirstLevelTitleColor; + btnFloor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel; + btnFloor.Text = DB_ResidenceData.Instance.CurFloor.roomName; + //btnFloor.Width = btnFloor.GetRealWidthByText(); + bodyFrameLayout.AddChidren(btnFloor); + //璁╁畠鐩稿鍥炬爣灞呬腑 + btnFloor.Y = btnFloorIcon.Y + (btnFloorIcon.Height - btnFloor.Height) / 2; + btnFloor.ButtonClickEvent += (sender, e) => + { + btnFloorIcon.ButtonClickEvent(null, null); + }; + + //鍒楄〃鎺т欢 + this.listView = new VerticalListControl(); + listView.Y = Application.GetRealHeight(53); + listView.Height = bodyFrameLayout.Height - Application.GetRealHeight(53); + bodyFrameLayout.AddChidren(listView); + + //鍒濆鍖栭棬閿佸垪琛ㄦ帶浠� + this.InitDoorListControl(this.listDevice); + } + + #endregion + + #region 鈻� 娣诲姞闂ㄩ攣鎺т欢_______________________ + + /// <summary> + /// 鍒濆鍖栭棬閿佸垪琛ㄦ帶浠� + /// </summary> + private void InitDoorListControl(List<Function> i_listDevice) + { + this.listView.RemoveAll(); + this.dicBatteryContr = new Dictionary<string, BatteryPersentControl>(); + + //鐢熸垚闂ㄩ攣鎺т欢 + foreach (var device in i_listDevice) + { + this.AddDoorControl(device); + } + } + + /// <summary> + /// 娣诲姞闂ㄩ攣鎺т欢 + /// </summary> + /// <param name="i_device">闂ㄩ攣瀵硅薄</param> + private void AddDoorControl(Function i_device) + { + //鐧借壊鑳屾櫙瀹瑰櫒 + var frameBack = new FrameLayoutStatuControl(); + frameBack.Width = Application.GetRealWidth(343); + frameBack.Height = Application.GetRealHeight(96); + frameBack.Radius = (uint)Application.GetRealWidth(12); + frameBack.Gravity = Gravity.CenterHorizontal; + frameBack.BackgroundColor = CSS_Color.MainBackgroundColor; + this.listView.AddChidren(frameBack); + //闂ㄩ攣鍥炬爣 + var btnIcon = new IconViewControl(32); + btnIcon.X = Application.GetRealWidth(10); + btnIcon.Y = Application.GetRealHeight(15); + btnIcon.UnSelectedImagePath = "FunctionIcon/DoorLock/DoorLock.png"; + frameBack.AddChidren(btnIcon, ChidrenBindMode.BindEvent); + //璁惧鍚嶅瓧 + var btnName = new Button(); + btnName.X = btnIcon.Right + Application.GetRealWidth(12); + btnName.Y = Application.GetRealHeight(12); + btnName.Width = Application.GetRealWidth(150); + btnName.Height = Application.GetRealHeight(20); + btnName.TextColor = CSS_Color.FirstLevelTitleColor; + btnName.TextAlignment = TextAlignment.CenterLeft; + btnName.Text = i_device.name; + frameBack.AddChidren(btnName, ChidrenBindMode.BindEvent); + //鎴块棿 + var btnRoom = new Button(); + btnRoom.X = btnName.X; + btnRoom.Y = btnName.Bottom + Application.GetRealHeight(4); + btnRoom.Width = Application.GetRealWidth(150); + btnRoom.Height = Application.GetRealHeight(15); + btnRoom.TextColor = CSS_Color.PromptingColor1; + btnRoom.TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel; + btnRoom.TextAlignment = TextAlignment.CenterLeft; + btnRoom.Text = i_device.GetRoomListName(); + frameBack.AddChidren(btnRoom, ChidrenBindMode.BindEvent); + //鐢垫睜鍥炬爣 + var btnBattery = new BatteryPersentControl(); + btnBattery.Y = Application.GetRealHeight(62); + //frameBack.AddChidren(btnBattery, ChidrenBindMode.BindEvent); + btnBattery.InitControl(); + btnBattery.SetValue(80); + btnBattery.X = frameBack.Width - btnBattery.Width - Application.GetRealWidth(12); + this.dicBatteryContr[i_device.sid] = btnBattery; + frameBack.ButtonClickEvent += (sender, e) => + { + + var form = new VideoDoorLockPage(i_device, btnName, btnRoom, CommonMethod.Comerom.function,()=> { + this.CloseForm(); + this.action?.Invoke(); + }); + MainPage.BasePageView.AddChidren(form); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; + form.Show(); + + }; + + //搴曢儴鍐嶅姞涓棿璺� + var frameSpace = new FrameLayout(); + frameSpace.Height = Application.GetRealHeight(12); + this.listView.AddChidren(frameSpace); + } + + #endregion + + + #region 鈻� 璁惧鐘舵�佹帹閫乢______________________ + + /// <summary> + /// 璁惧鐘舵�佹帹閫� + /// </summary> + /// <param name="i_LocalDevice"></param> + public override void DeviceStatuPush(Function i_LocalDevice) + { + //涓嶆槸鐩爣璁惧 + if (this.dicBatteryContr.ContainsKey(i_LocalDevice.sid) == false) + { + return; + } + + } + + #endregion + + + } +} -- Gitblit v1.8.0