From e7290281eabcb88d2e430dea9782565474837ce1 Mon Sep 17 00:00:00 2001
From: mac <user@users-MacBook-Pro.local>
Date: 星期五, 20 十月 2023 14:29:54 +0800
Subject: [PATCH] Merge branch 'Dev-Branch' into wjc
---
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..a3bfaf0 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(seekBarVol.Progress.ToString(), UnitSring(seekBarVol.Progress.ToString()));
//绉婚櫎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