From 71f1df7772feec5cf83feefa851608adac18e005 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 06 十一月 2019 17:45:23 +0800
Subject: [PATCH] 2019.11.6
---
ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorLightSettionForm.cs | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 257 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorLightSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorLightSettionForm.cs
new file mode 100755
index 0000000..4b02ffb
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/PirSensor/PirSensorLightSettionForm.cs
@@ -0,0 +1,257 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using ZigBee.Device;
+
+namespace Shared.Phone.UserCenter.DevicePirSensor
+{
+ /// <summary>
+ /// PIR浼犳劅鍣ㄧ殑鐏厜鐗规晥閰嶇疆鐣岄潰鈽�
+ /// </summary>
+ public class PirSensorLightSettionForm : EditorCommonForm
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 鍒楄〃鎺т欢
+ /// </summary>
+ private VerticalScrolViewLayout listView = null;
+ /// <summary>
+ /// 浼犳劅鍣ㄨ澶�
+ /// </summary>
+ private IASZone deviceIASZone = null;
+ /// <summary>
+ /// 鐏厜鐨勯厤缃�
+ /// </summary>
+ private IASZone.ConfigureParamates Lightconfigure = null;
+ /// <summary>
+ /// 銆愯嚜鍔ㄥ叧鐏�戣
+ /// </summary>
+ //private RowSecondRightTextView btnAutoStatu = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
+ /// </summary>
+ /// <param name="i_iasZone">浼犳劅鍣ㄨ澶�</param>
+ public void ShowForm(IASZone i_iasZone)
+ {
+ deviceIASZone = i_iasZone;
+
+ //璁剧疆澶撮儴淇℃伅
+ base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uLightSettion));
+
+ //鍒濆鍖栦腑閮ㄤ俊鎭�
+ //this.InitMiddleFrame();
+ }
+
+ ///// <summary>
+ ///// 鍒濆鍖栦腑閮ㄤ俊鎭�
+ ///// </summary>
+ //private void InitMiddleFrame()
+ //{
+ // //娓呯┖bodyFrame
+ // this.ClearBodyFrame();
+
+ // this.listView = new VerticalScrolViewLayout();
+ // this.listView.Height = bodyFrameLayout.Height;
+ // bodyFrameLayout.AddChidren(this.listView);
+
+ // //娣诲姞銆愯嚜鍔ㄥ叧鐏�戣
+ // this.btnAutoStatu = this.AddAutoCloseLightRow();
+ // //娣诲姞銆愬厜鎰熻皟鑺傘�戣
+ // this.AddAutoAdjustLightRow();
+
+ // //鐢ㄧ嚎绋嬭缃伅鍏夌殑閰嶇疆淇℃伅
+ // this.SetLightSettionData();
+ //}
+
+ #endregion
+
+ //#region 鈻� 鑷姩鍏崇伅___________________________
+
+ ///// <summary>
+ ///// 娣诲姞銆愯嚜鍔ㄥ叧鐏�戣
+ ///// </summary>
+ ///// <returns></returns>
+ //private RowSecondRightTextView AddAutoCloseLightRow()
+ //{
+ // var row = new StatuRowLayout(listView);
+ // //鑷姩鍏崇伅
+ // var btnLight = new RowTopBlackView(false);
+ // btnLight.TextID = R.MyInternationalizationString.uAutoCloseLight;
+ // row.AddChidren(btnLight);
+ // //璁剧疆浜虹寮�鍚庣伅鍏夊叧闂殑鏃堕棿
+ // var btnMsg = new RowBottomGrayView(false);
+ // btnMsg.TextID = R.MyInternationalizationString.uSetLightCloseTimeByPersoinLeave;
+ // row.AddChidren(btnMsg);
+
+ // //鐘舵��
+ // var btnStatu = new RowSecondRightTextView();
+ // btnStatu.TextColor = UserCenterColor.Current.Gray;
+ // row.AddChidren(btnStatu);
+
+ // row.AddRightArrow();
+
+ // row.MouseUpEvent += (sender, e) =>
+ // {
+ // List<string> list = new List<string>();
+ // string second = Language.StringByID(R.MyInternationalizationString.Second);
+ // list.Add("3 " + second);
+ // for (int i = 5; i <= 120; i = i + 5)
+ // {
+ // list.Add(i + " " + second);
+ // }
+ // PickerView.Show(list, this.AutoCloseLightSelectAction);
+ // };
+ // return btnStatu;
+ //}
+
+ ///// <summary>
+ ///// 鑷姩鍏崇伅鐨勯�夋嫨Action浜嬩欢
+ ///// </summary>
+ ///// <param name="value"></param>
+ //private async void AutoCloseLightSelectAction(string value)
+ //{
+ // if (this.Lightconfigure == null)
+ // {
+ // //閲嶆柊鑾峰彇
+ // this.Lightconfigure = await HdlPirSensorLogic.Current.GetPirSensorLightSettion(deviceIASZone);
+ // if (this.Lightconfigure == null)
+ // {
+ // return;
+ // }
+ // }
+ // string second = Language.StringByID(R.MyInternationalizationString.Second);
+ // int spaceTime = Convert.ToInt32(value.Replace(second, string.Empty).Trim());
+ // //淇濆瓨浼犳劅鍣ㄧ殑鐏厜鐨勯厤缃俊鎭�
+ // var result = await this.SaveLightSettionData(spaceTime, this.Lightconfigure.levelSize);
+ //}
+
+ //#endregion
+
+ //#region 鈻� 鍏夋劅璋冭妭___________________________
+
+ ///// <summary>
+ ///// 娣诲姞銆愬厜鎰熻皟鑺傘�戣
+ ///// </summary>
+ ///// <returns></returns>
+ //private void AddAutoAdjustLightRow()
+ //{
+ // var row = new StatuRowLayout(listView);
+ // //鍏夋劅璋冭妭
+ // var btnLight = new RowTopBlackView(false);
+ // btnLight.TextID = R.MyInternationalizationString.uLightPerceptionRegulation;
+ // row.AddChidren(btnLight);
+ // //鏍规嵁鐜鐓у害鑷姩寮�鍚伅鍏�
+ // var btnMsg = new RowBottomGrayView(false);
+ // btnMsg.TextID = R.MyInternationalizationString.uAutoOpenLightByLevel;
+ // row.AddChidren(btnMsg);
+ // //鍚戝彸鍥炬爣
+ // row.AddRightArrow();
+ // row.MouseUpEvent += (sender, e) =>
+ // {
+ // var form = new PirSensorLightPerceptionRegulationForm();
+ // form.AddForm(this.deviceIASZone, Lightconfigure);
+ // };
+ //}
+
+ //#endregion
+
+ //#region 鈻� 鑾峰彇閰嶇疆淇℃伅_______________________
+
+ ///// <summary>
+ ///// 璁剧疆鐏厜鐨勯厤缃俊鎭�
+ ///// </summary>
+ //private async void SetLightSettionData()
+ //{
+ // //寮�鍚繘搴︽潯
+ // this.ShowProgressBar();
+
+ // var result = await HdlPirSensorLogic.Current.GetPirSensorLightSettion(deviceIASZone);
+ // if (result == null)
+ // {
+ // //鍏抽棴杩涘害鏉�
+ // this.CloseProgressBar(ShowReLoadMode.YES);
+ // return;
+ // }
+ // //鍏抽棴杩涘害鏉�
+ // this.CloseProgressBar();
+
+ // Application.RunOnMainThread(() =>
+ // {
+ // if (this.Parent == null)
+ // {
+ // return;
+ // }
+ // this.Lightconfigure = result;
+ // //璁剧疆鐏厜鐨勯厤缃俊鎭�
+ // this.SetLightSettionData(result.transitionTime, result.levelSize);
+ // });
+ //}
+
+ ///// <summary>
+ ///// 璁剧疆鐏厜鐨勯厤缃俊鎭�
+ ///// </summary>
+ ///// <param name="i_spaceTime"></param>
+ ///// <param name="i_levelSize"></param>
+ //private void SetLightSettionData(int i_spaceTime, int i_levelSize)
+ //{
+ // if (this.btnAutoStatu != null)
+ // {
+ // //鑷姩鍏崇伅(XX绉�)
+ // this.btnAutoStatu.Text = i_spaceTime.ToString() + Language.StringByID(R.MyInternationalizationString.Second);
+ // }
+ //}
+
+ //#endregion
+
+ //#region 鈻� 淇濆瓨閰嶇疆___________________________
+
+ ///// <summary>
+ ///// 淇濆瓨浼犳劅鍣ㄧ殑鐏厜鐨勯厤缃俊鎭�
+ ///// </summary>
+ ///// <param name="i_spaceTime"></param>
+ ///// <param name="i_levelSize"></param>
+ ///// <returns></returns>
+ //private async Task<bool> SaveLightSettionData(int i_spaceTime, int i_levelSize)
+ //{
+ // //寮�鍚繘搴︽潯
+ // this.ShowProgressBar();
+
+ // //鍏堣褰曠紦瀛�
+ // int spaceTime = this.Lightconfigure.transitionTime;
+ // int levelSize = this.Lightconfigure.levelSize;
+
+ // //璁剧疆鏂板��
+ // this.Lightconfigure.transitionTime = i_spaceTime;
+ // this.Lightconfigure.levelSize = i_levelSize;
+
+ // var result = await HdlPirSensorLogic.Current.SetPirSensorLightSettion(this.deviceIASZone, this.Lightconfigure);
+ // if (result == true)
+ // {
+ // Application.RunOnMainThread(() =>
+ // {
+ // //璁剧疆鐏厜鐨勯厤缃俊鎭�
+ // this.SetLightSettionData(i_spaceTime, i_levelSize);
+ // });
+ // }
+ // else
+ // {
+ // //杩樺師缂撳瓨
+ // this.Lightconfigure.transitionTime = spaceTime;
+ // this.Lightconfigure.levelSize = levelSize;
+ // }
+ // //鍏抽棴杩涘害鏉�
+ // this.CloseProgressBar();
+
+ // return result;
+ //}
+
+ //#endregion
+ }
+}
--
Gitblit v1.8.0