From 56dfdc1bf7e7f2bb2456f29c3686dfa935a89e80 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 30 六月 2022 13:59:45 +0800
Subject: [PATCH] 2022年06月30日13:59:08

---
 HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs |   74 +++++++++++++++++++++++++++++++++++--
 1 files changed, 70 insertions(+), 4 deletions(-)

diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
index 2bcf99d..ade04dc 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/LogicView/brightnessView.cs
@@ -130,7 +130,7 @@
         /// <param name="titleName">鏍囬鍚嶇О</param>
         /// <param name="stateValue">涔嬪墠鐘舵�佸��</param>
         /// <param name="action">杩斿洖鍥炶皟</param>
-        public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string> action)
+        public void FLayoutView(FrameLayout frame, string titleName,string stateValue, Action<string,string> action)
         {
             FrameLayout fLayout = new FrameLayout
             {
@@ -147,14 +147,33 @@
             frameLayout.AddChidren(btn_add);
             frameLayout.AddChidren(btn_add_click);
             btnTitle.Text = titleName;
+            //杩涙潵鐨勭姸鎬�
+            if (stateValue.Contains("%"))
+            {
+                //鐧惧垎姣�
+            }
+            else if (stateValue.Contains("掳"))
+            {
+                //瑙掑害
+                //瑙掑害鍙栧�艰寖鍥�
+                seekBarVol.MinValue = 0;
+                seekBarVol.MaxValue = 180;
+                seekBarVol.ProgressBarUnitSring = "掳";
+            }
+            else
+            {
+                //闊抽噺娌℃湁鍗曚綅
+                seekBarVol.MinValue = 0;
+                seekBarVol.MaxValue = 100;
+                seekBarVol.ProgressBarUnitSring = "";
+            }
             //绗竴涓彉鍖栬褰曢�変腑鍊�
             int brightnesValue = 0;
             if (stateValue != "")
             {
                 try
                 {
-                    //杩涙潵鐨勭姸鎬�
-                    brightnesValue = int.Parse(stateValue.Replace("%", ""));
+                    brightnesValue = int.Parse(UnitDisposeSring(stateValue));
                     seekBarVol.Progress = brightnesValue;
                 }
                 catch { }
@@ -198,16 +217,63 @@
                 //{
                 //    return;
                 //}
-                action(brightnesValue.ToString());
+                action(brightnesValue.ToString(), UnitSring(stateValue));
                 //绉婚櫎fLayout鐣岄潰
                 fLayout.RemoveFromParent();
             };
 
 
         }
+        /// <summary>
+        //杩涘害鍊兼樉绀哄崟浣�
+        /// </summary>
+        /// <param name="str"></param>
+        /// <returns></returns>
+        public string UnitSring(string str)
+        {
 
+            //杩涙潵鐨勭姸鎬�
+            if (str.Contains("%"))
+            {
+                //鐧惧垎姣�
+                return "%";
+            }
+            else if (str.Contains("掳"))
+            {
+                //瑙掑害
+                return "掳";
 
+            }
+            else {
+                //娌℃湁鍗曚綅
+                return "";
+            }
+        }
+        /// <summary>
+        ///鍘诲崟浣�
+        /// </summary>
+        /// <param name="str"></param>
+        /// <returns></returns>
+        public string UnitDisposeSring(string str)
+        {
 
+            //杩涙潵鐨勭姸鎬�
+            if (str.Contains("%"))
+            {
+                //鐧惧垎姣�
+                return str.Replace("%", "");
+            }
+            else if (str.Contains("掳"))
+            {
+                //瑙掑害
+                return str.Replace("掳", "");
+            }
+            else
+            {
+                //娌℃湁鍗曚綅
+                return str;
+            }
+        }
 
         ///// <summary>
         ///// View鐨勬柟娉�

--
Gitblit v1.8.0