From 5868b389a3544cf14ff65e87b554c07349badd28 Mon Sep 17 00:00:00 2001 From: mac <user@users-MacBook-Pro.local> Date: 星期一, 16 十月 2023 15:30:46 +0800 Subject: [PATCH] 2023年10月16日15:30:28 --- HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs | 269 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 258 insertions(+), 11 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs index 25caea1..e5bb27a 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Aks/AksCommonMethod.cs @@ -12,6 +12,15 @@ /// </summary> public class AksCommonMethod { + /// <summary> + /// 閫変腑棰滆壊 + /// </summary> + public const uint seleBackgroundColor = 0xFFF2F3F7; + /// <summary> + /// 涓嶆敮鎸佹寜閿鑹� + /// </summary> + public const uint unBackgroundColor = 0xFFA3AAB7; + private static AksCommonMethod commonMethod = null; /// <summary> /// 鑾峰彇瀵硅薄 @@ -30,6 +39,133 @@ } } + /// <summary> + /// 娓呯┖鎵�鏈夌紦瀛樻暟鎹� + /// </summary> + public void ClearData() + { + movieLibraryInfoEntities.Clear(); + CollectList.Clear(); + } + /// <summary> + /// 褰辩墖璇︽儏鍒楄〃 + /// </summary> + public Dictionary<string, MovieLibraryInfoEntity> movieLibraryInfoEntities = new Dictionary<string, MovieLibraryInfoEntity>(); + /// <summary> + /// 鏀惰棌褰辩墖璇︽儏鍒楄〃 + /// </summary> + public List<MovieLibrary> CollectList = new List<MovieLibrary>(); + /// <summary> + /// 娣诲姞褰辩墖璇︽儏缂撳瓨 + /// </summary> + /// <param name="movieLibraryInfo"></param> + public void AddMovieLibraryInfo(MovieLibraryInfoEntity movieLibraryInfo) + { + if (movieLibraryInfo == null) + { + return; + } + if (string.IsNullOrEmpty(movieLibraryInfo.rcId) && string.IsNullOrEmpty(movieLibraryInfo.movieId)) + { + return; + } + string key = movieLibraryInfo.rcId + "_" + movieLibraryInfo.movieId; + + if (movieLibraryInfoEntities.ContainsKey(key)) + { + movieLibraryInfoEntities.Remove(key); + } + movieLibraryInfoEntities.Add(key, movieLibraryInfo); + } + /// <summary> + /// 鍒犻櫎褰辩墖璇︽儏缂撳瓨 + /// </summary> + /// <param name="key"></param> + public bool DelMovieLibraryInfo(string key) + { + if (movieLibraryInfoEntities.ContainsKey(key)) + { + return movieLibraryInfoEntities.Remove(key); + } + return true; + } + /// <summary> + /// 浠庣紦瀛樿幏鍙栧奖鐗囪鎯� + /// </summary> + /// <param name="key">瑙勫垯:rcId_movieId(閬ユ帶鍣╥d_褰辩墖id)</param> + /// <returns>涓嶅瓨鍦ㄨ繑鍥瀗ull</returns> + public MovieLibraryInfoEntity GetMovieLibraryInfo(string key) + { + if (string.IsNullOrEmpty(key)) + { + return null; + } + foreach (var dic in movieLibraryInfoEntities) + { + if (dic.Key == key) + { + return dic.Value; + } + } + return null; + } + /// <summary> + /// 娣诲姞鏀惰棌褰辩墖 + /// </summary> + /// <param name="movieLibraryInfo"></param> + public void AddCollectMovie(MovieLibrary movieLibrary) + { + if (movieLibrary == null) + { + return; + } + if (string.IsNullOrEmpty(movieLibrary.movieId)) + { + return; + } + if (CollectList.Count == 0) + { + CollectList.Add(movieLibrary); + return; + } + for (int i = 0; i < CollectList.Count; i++) + { + if (CollectList[i].movieId == movieLibrary.movieId) + { + CollectList.RemoveAt(i); + CollectList.Insert(i, movieLibrary); + } + + } + } + /// <summary> + /// 鍒犻櫎娣诲姞鏀惰棌褰辩墖 + /// </summary> + /// <param name="key"></param> + public bool DelCollectMovie(MovieLibrary movieLibrary) + { + if (movieLibrary == null) + { + return false; + } + if (string.IsNullOrEmpty(movieLibrary.movieId)) + { + return false; + } + + for (int i = 0; i < CollectList.Count; i++) + { + if (CollectList[i].movieId == movieLibrary.movieId) + { + CollectList.RemoveAt(i); + break; + } + + } + return true; + } + + /// <summary> @@ -51,7 +187,7 @@ /// 鑾峰彇銆愰煶涔愩�戦仴鎺у櫒鎸夐敭鍒楄〃 /// </summary> /// <returns></returns> - public List<KeypadEntity> GetMusicKeypadList() + public List<KeypadEntity> GetMusicKeypadList(RemoteControlEntity remoteControlEntity) { List<KeypadEntity> keypads = new List<KeypadEntity>(); string aksIcon = "AksIcon/"; @@ -72,18 +208,19 @@ keypads.Add(new KeypadEntity { keypad = "play", name = "鎾斁", localIconAddress = $"{aksIcon}bofang.png" }); keypads.Add(new KeypadEntity { keypad = "in_out_warehouse", name = "杩涘嚭浠�", localIconAddress = $"{aksIcon}jinchucang.png" }); keypads.Add(new KeypadEntity { keypad = "subtitle", name = "瀛楀箷", localIconAddress = $"{aksIcon}zimu.png" }); - keypads.Add(new KeypadEntity { keypad = "key_up", name = "涓�", localIconAddress = $"{aksIcon}shang.png" }); - keypads.Add(new KeypadEntity { keypad = "key_down", name = "涓�", localIconAddress = $"{aksIcon}xia.png" }); - keypads.Add(new KeypadEntity { keypad = "key_left", name = "宸�", localIconAddress = $"{aksIcon}zuo.png" }); - keypads.Add(new KeypadEntity { keypad = "key_right", name = "鍙�", localIconAddress = $"{aksIcon}you.png" }); - keypads.Add(new KeypadEntity { keypad = "key_ok", name = "纭", localIconAddress = $"{aksIcon}ok.png" }); + //keypads.Add(new KeypadEntity { keypad = "key_up", name = "涓�", localIconAddress = $"{aksIcon}shang.png" }); + //keypads.Add(new KeypadEntity { keypad = "key_down", name = "涓�", localIconAddress = $"{aksIcon}xia.png" }); + //keypads.Add(new KeypadEntity { keypad = "key_left", name = "宸�", localIconAddress = $"{aksIcon}zuo.png" }); + //keypads.Add(new KeypadEntity { keypad = "key_right", name = "鍙�", localIconAddress = $"{aksIcon}you.png" }); + //keypads.Add(new KeypadEntity { keypad = "key_ok", name = "纭", localIconAddress = $"{aksIcon}ok.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); return keypads; } /// <summary> /// 鑾峰彇銆愬姛鏀俱�戦仴鎺у櫒鎸夐敭鍒楄〃 /// </summary> /// <returns></returns> - public List<KeypadEntity> GetGFKeypadList() + public List<KeypadEntity> GetGFKeypadList(RemoteControlEntity remoteControlEntity) { List<KeypadEntity> keypads = new List<KeypadEntity>(); string aksIcon = "AksIcon/"; @@ -91,7 +228,7 @@ keypads.Add(new KeypadEntity { keypad = "off", name = "鍏�", localIconAddress = $"{aksIcon}guan.png" }); keypads.Add(new KeypadEntity { keypad = "volume_up", name = "闊抽噺+", localIconAddress = $"{aksIcon}yinliangjia.png" }); keypads.Add(new KeypadEntity { keypad = "volume_down", name = "闊抽噺-", localIconAddress = $"{aksIcon}yinliangjian.png" }); - keypads.Add(new KeypadEntity { keypad = "HDMI_", name = "HDMI 1", localIconAddress = $"{aksIcon}hdmi.png" }); + keypads.Add(new KeypadEntity { keypad = "HDMI_1", name = "HDMI 1", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_2", name = "HDMI 2", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_3", name = "HDMI 3", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_4", name = "HDMI 4", localIconAddress = $"{aksIcon}hdmi.png" }); @@ -99,6 +236,7 @@ keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" }); keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" }); keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); return keypads; } @@ -106,7 +244,7 @@ /// 鑾峰彇銆愭姇褰变华銆戦仴鎺у櫒鎸夐敭鍒楄〃 /// </summary> /// <returns></returns> - public List<KeypadEntity> GetTYYKeypadList() + public List<KeypadEntity> GetTYYKeypadList(RemoteControlEntity remoteControlEntity) { List<KeypadEntity> keypads = new List<KeypadEntity>(); string aksIcon = "AksIcon/"; @@ -115,7 +253,7 @@ keypads.Add(new KeypadEntity { keypad = "signal_source", name = "淇″彿婧�", localIconAddress = $"{aksIcon}xinhaoyuan.png" }); keypads.Add(new KeypadEntity { keypad = "curtain_up", name = "骞曞竷鍗�", localIconAddress = $"{aksIcon}mubusheng.png" }); keypads.Add(new KeypadEntity { keypad = "curtain_down", name = "骞曞竷闄�", localIconAddress = $"{aksIcon}mubujiang.png" }); - keypads.Add(new KeypadEntity { keypad = "HDMI_", name = "HDMI 1", localIconAddress = $"{aksIcon}hdmi.png" }); + keypads.Add(new KeypadEntity { keypad = "HDMI_1", name = "HDMI 1", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_2", name = "HDMI 2", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_3", name = "HDMI 3", localIconAddress = $"{aksIcon}hdmi.png" }); keypads.Add(new KeypadEntity { keypad = "HDMI_4", name = "HDMI 4", localIconAddress = $"{aksIcon}hdmi.png" }); @@ -127,7 +265,64 @@ keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" }); keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" }); keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); return keypads; + } + + + /// <summary> + /// 鑾峰彇銆愮數瑙嗐�戦仴鎺у櫒鎸夐敭鍒楄〃 + /// </summary> + /// <returns></returns> + public List<KeypadEntity> GetTvKeypadList(RemoteControlEntity remoteControlEntity) + { + List<KeypadEntity> keypads = new List<KeypadEntity>(); + string aksIcon = "AksIcon/"; + keypads.Add(new KeypadEntity { keypad = "on", name = "寮�", localIconAddress = $"{aksIcon}kai.png" }); + keypads.Add(new KeypadEntity { keypad = "off", name = "鍏�", localIconAddress = $"{aksIcon}guan.png" }); + keypads.Add(new KeypadEntity { keypad = "signal_source", name = "淇″彿婧�", localIconAddress = $"{aksIcon}xinhaoyuan.png" }); + keypads.Add(new KeypadEntity { keypad = "mute", name = "闈欓煶", localIconAddress = $"{aksIcon}jingyin.png" }); + keypads.Add(new KeypadEntity { keypad = "volume_up", name = "闊抽噺+", localIconAddress = $"{aksIcon}yinliangjia.png" }); + keypads.Add(new KeypadEntity { keypad = "volume_down", name = "闊抽噺-", localIconAddress = $"{aksIcon}yinliangjian.png" }); + keypads.Add(new KeypadEntity { keypad = "menu", name = "鑿滃崟", localIconAddress = $"{aksIcon}caidan.png" }); + keypads.Add(new KeypadEntity { keypad = "return", name = "杩斿洖", localIconAddress = $"{aksIcon}fanhui.png" }); + keypads.Add(new KeypadEntity { keypad = "look_back", name = "鍥炵湅", localIconAddress = $"{aksIcon}huikan.png" }); + keypads.Add(new KeypadEntity { keypad = "cancel", name = "鍙栨秷", localIconAddress = $"{aksIcon}quxiao.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_1", name = "鑷畾涔夋寜閿�1", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); + return keypads; + + } + + + /// <summary> + /// 鑾峰彇銆愭満椤剁洅銆戦仴鎺у櫒鎸夐敭鍒楄〃 + /// </summary> + /// <returns></returns> + public List<KeypadEntity> GetJdhKeypadList(RemoteControlEntity remoteControlEntity) + { + List<KeypadEntity> keypads = new List<KeypadEntity>(); + string aksIcon = "AksIcon/"; + keypads.Add(new KeypadEntity { keypad = "on", name = "寮�", localIconAddress = $"{aksIcon}kai.png" }); + keypads.Add(new KeypadEntity { keypad = "off", name = "鍏�", localIconAddress = $"{aksIcon}guan.png" }); + keypads.Add(new KeypadEntity { keypad = "menu", name = "鑿滃崟", localIconAddress = $"{aksIcon}caidan.png" }); + keypads.Add(new KeypadEntity { keypad = "mute", name = "闈欓煶", localIconAddress = $"{aksIcon}jingyin.png" }); + keypads.Add(new KeypadEntity { keypad = "volume_up", name = "闊抽噺+", localIconAddress = $"{aksIcon}yinliangjia.png" }); + keypads.Add(new KeypadEntity { keypad = "volume_down", name = "闊抽噺-", localIconAddress = $"{aksIcon}yinliangjian.png" }); + keypads.Add(new KeypadEntity { keypad = "look_back", name = "鍥炵湅", localIconAddress = $"{aksIcon}huikan.png" }); + keypads.Add(new KeypadEntity { keypad = "cancel", name = "鍙栨秷", localIconAddress = $"{aksIcon}quxiao.png" }); + keypads.Add(new KeypadEntity { keypad = "amplifier_volume_up", name = "鍔熸斁闊抽噺 +", localIconAddress = $"{aksIcon}gfyingliangjia.png" }); + keypads.Add(new KeypadEntity { keypad = "amplifier_volume_down", name = "鍔熸斁闊抽噺 -", localIconAddress = $"{aksIcon}gf_ingliangjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_1", name = "鑷畾涔夋寜閿�1", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_2", name = "鑷畾涔夋寜閿�2", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_3", name = "鑷畾涔夋寜閿�3", localIconAddress = $"{aksIcon}zdyanjian.png" }); + keypads.Add(new KeypadEntity { keypad = "custom_4", name = "鑷畾涔夋寜閿�4", localIconAddress = $"{aksIcon}zdyanjian.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); + return keypads; + } @@ -135,7 +330,7 @@ /// 鑾峰彇銆愭暟瀛椼�戞寜閿垪琛� /// </summary> /// <returns></returns> - public List<KeypadEntity> GetNumberKeypadList() + public List<KeypadEntity> GetNumberKeypadList(RemoteControlEntity remoteControlEntity) { List<KeypadEntity> keypads = new List<KeypadEntity>(); keypads.Add(new KeypadEntity { keypad = "number_1", name = "1" }); @@ -152,7 +347,59 @@ keypads.Add(new KeypadEntity { keypad = "number_continuous", name = "-/--" }); keypads.Add(new KeypadEntity { keypad = "none", name = "" });//杩欎釜鏄负浜嗗崰浣嶇疆 keypads.Add(new KeypadEntity { keypad = "number_0", name = "0" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); return keypads; } + + /// <summary> + /// 鑾峰彇銆愯彍鍗曘�戞寜閿垪琛� + /// </summary> + /// <returns></returns> + public List<KeypadEntity> GetMenuKeypadList(RemoteControlEntity remoteControlEntity) + { + List<KeypadEntity> keypads = new List<KeypadEntity>(); + string aksIcon = "AksIcon/"; + keypads.Add(new KeypadEntity { keypad = "key_up", name = "涓�", localIconAddress = $"{aksIcon}shang.png" }); + keypads.Add(new KeypadEntity { keypad = "key_down", name = "涓�", localIconAddress = $"{aksIcon}xia.png" }); + keypads.Add(new KeypadEntity { keypad = "key_left", name = "宸�", localIconAddress = $"{aksIcon}zuo.png" }); + keypads.Add(new KeypadEntity { keypad = "key_right", name = "鍙�", localIconAddress = $"{aksIcon}you.png" }); + keypads.Add(new KeypadEntity { keypad = "key_ok", name = "纭", localIconAddress = $"{aksIcon}ok.png" }); + this.CheckKeyIsClick(remoteControlEntity, keypads); + return keypads; + } + + /// <summary> + /// 妫�鏌ユ槸鍚︽敮鎸佹寜閿偣鍑� + /// </summary> + /// <param name="remoteControlEntity">閬ユ帶鍣ㄨ澶�</param> + /// <param name="keypads">鑷畾涔夋寜閿垪琛�</param> + private void CheckKeyIsClick(RemoteControlEntity remoteControlEntity, List<KeypadEntity> keypads) + { + if (remoteControlEntity == null) + { + return; + } + + for (int i = 0; i < keypads.Count; i++) + { + var keypad = keypads[i]; + if (keypad.keypad == "none") + { + //鐗规畩鐨� + continue; + } + var findkeypad = remoteControlEntity.keypads.Find((o) => o.keypad == keypad.keypad); + if (findkeypad == null) + { + keypad.isClicked = false; + } + else + { + keypad.isClicked = true; + } + } + + } + } } -- Gitblit v1.8.0