From 9f326f4000847e6167d8166fa2f6a66f53cb3734 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 09:07:13 +0800
Subject: [PATCH] 新云端Ver1.3

---
 ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs |   46 ++++++++++++++++++++--------------------------
 1 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
index 37e9e40..a83c60a 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Safety/AlarmTargetStatuSelectLightForm.cs
@@ -20,6 +20,10 @@
         /// 鍔ㄤ綔淇℃伅  1 寮�鍏�/ 3浜害璋冭妭
         /// </summary>
         private Dictionary<int, Safeguard.TaskListInfo> dicTaskinfo = new Dictionary<int, Safeguard.TaskListInfo>();
+        /// <summary>
+        /// 杩涘害鏉℃渶澶у��
+        /// </summary>
+        private int MaxValue = 254;
 
         #endregion
 
@@ -81,7 +85,7 @@
             //澶撮儴淇℃伅
             var btnTitle = new NormalViewControl(frameTransparent.Width, Application.GetRealHeight(70), false);
             btnTitle.Y = Application.GetRealHeight(28);
-            btnTitle.Text = Common.LocalDevice.Current.GetDeviceEpointName(device);
+            btnTitle.Text = HdlDeviceCommonLogic.Current.GetDeviceEpointName(device);
             btnTitle.TextColor = UserCenterColor.Current.TextColor4;
             btnTitle.TextSize = 16;
             btnTitle.TextAlignment = TextAlignment.Center;
@@ -109,7 +113,7 @@
             rowRound.AddChidren(btnFinish);
 
             //绾�
-            var btnLine1 = new NormalViewControl(frameTransparent.Width, ControlCommonResourse.BottomLineHeight, false);
+            var btnLine1 = new NormalViewControl(frameTransparent.Width, HdlControlResourse.BottomLineHeight, false);
             btnLine1.Y = Application.GetRealHeight(138);
             btnLine1.BackgroundColor = UserCenterColor.Current.ButtomLine;
             frameTransparent.AddChidren(btnLine1);
@@ -131,33 +135,28 @@
             detailBackFrame.AddChidren(btnPersent);
             if (dicTaskinfo.ContainsKey(3) == true)
             {
-                btnPersent.Text = dicTaskinfo[3].Data1 + "%";
+                btnPersent.Text = ((int)(dicTaskinfo[3].Data1 * 1.0 / MaxValue * 100)) + "%";
             }
 
             //杩涘害鏉�
-            var seekBar = new HorizontalSeekBar();
-            seekBar.Enable = false;
+            var seekBar = new SeekBarControl(919);
             seekBar.Y = Application.GetRealHeight(268);
-            seekBar.Gravity = Gravity.CenterHorizontal;
-            seekBar.Width = Application.GetRealWidth(919);
-            seekBar.Height = Application.GetRealHeight(89);
-            seekBar.Max = 100;
-            seekBar.BackgroundColor = 0xfff5f5f5;
-            seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
-            seekBar.ProgressColor = 0xfffdb500;
+            seekBar.ProgressBarColor = 0xfffdb500;
+            seekBar.MaxValue = this.MaxValue;
+            seekBar.Enable = false;
             if (dicTaskinfo.ContainsKey(3) == true)
             {
                 //3:浜害璋冭妭
                 seekBar.Progress = dicTaskinfo[3].Data1;
             }
             detailBackFrame.AddChidren(seekBar);
-            seekBar.ProgressChanged += (sender, value) =>
+            seekBar.ProgressChangedEvent += (div, value) =>
             {
-                btnPersent.Text = value + "%";
+                btnPersent.Text = ((int)(value * 1.0 / MaxValue * 100)) + "%";
             };
 
             //绾�
-            var btnLine2 = new NormalViewControl(Application.GetRealWidth(919), ControlCommonResourse.BottomLineHeight, false);
+            var btnLine2 = new NormalViewControl(Application.GetRealWidth(919), HdlControlResourse.BottomLineHeight, false);
             btnLine2.Y = Application.GetRealHeight(417);
             btnLine2.Gravity = Gravity.CenterHorizontal;
             btnLine2.BackgroundColor = UserCenterColor.Current.ButtomLine;
@@ -166,8 +165,8 @@
             //寮�
             var rowOpen = new FrameRowControl();
             rowOpen.Y = Application.GetRealHeight(69);
-            rowOpen.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft;
-            rowOpen.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81);
+            rowOpen.LeftOffset = Application.GetRealWidth(81) - HdlControlResourse.XXLeft;
+            rowOpen.RightOffset = HdlControlResourse.XXLeft - Application.GetRealWidth(81);
             detailBackFrame.AddChidren(rowOpen);
             var btnOpen = rowOpen.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSimpleOpen), 400);
             btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
@@ -178,8 +177,8 @@
             //鍏�
             var rowClose = new FrameRowControl();
             rowClose.Y = btnLine2.Bottom + Application.GetRealHeight(12);
-            rowClose.LeftOffset = Application.GetRealWidth(81) - ControlCommonResourse.XXLeft;
-            rowClose.RightOffset = ControlCommonResourse.XXLeft - Application.GetRealWidth(81);
+            rowClose.LeftOffset = Application.GetRealWidth(81) - HdlControlResourse.XXLeft;
+            rowClose.RightOffset = HdlControlResourse.XXLeft - Application.GetRealWidth(81);
             detailBackFrame.AddChidren(rowClose);
             var btnClose = rowClose.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSimpleClose), 400);
             btnClose.TextColor = UserCenterColor.Current.TextGrayColor3;
@@ -196,7 +195,6 @@
                     btnOpenSelect.Visible = false;
                     btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
                     seekBar.Enable = false;
-                    seekBar.ProgressColor = 0xffe8e8e8;
 
                     dicTaskinfo.Remove(1);
                 }
@@ -209,10 +207,9 @@
                     //寮� 鍙敤
                     btnOpen.TextColor = UserCenterColor.Current.TextColor1;
                     seekBar.Enable = true;
-                    seekBar.ProgressColor = 0xfffdb500;
                     if (seekBar.Progress == 0)
                     {
-                        seekBar.Progress = 100;
+                        seekBar.Progress = MaxValue;
                         btnPersent.Text = "100%";
                     }
 
@@ -247,7 +244,6 @@
                     //寮� 涓嶅彲鐢�
                     btnOpen.TextColor = UserCenterColor.Current.TextGrayColor3;
                     seekBar.Enable = false;
-                    seekBar.ProgressColor = 0xffe8e8e8;
 
                     dicTaskinfo[1] = new Safeguard.TaskListInfo();
                     dicTaskinfo[1].TaskType = 1;
@@ -290,13 +286,11 @@
                 dicTaskinfo = null;
 
                 //鑾峰彇鐘舵�佺殑鏄剧ず鏂囨湰
-                string statuText = HdlSafeguardLogic.Current.GetLightAlarmStatuText(listData);
+                string statuText = HdlSafeguardLogic.Current.GetAdjustTargetStatuText(listData);
                 this.FinishSelectEvent?.Invoke(statuText, listData);
 
                 this.CloseForm();
             };
-            //鍔ㄧ敾鏁堟灉
-            frameTransparent.Animate = Animate.DownToUp;
         }
 
         #endregion

--
Gitblit v1.8.0