From 4ce5177289b1d34e467de9d8790836559cc5a09e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 18 十一月 2019 18:06:28 +0800
Subject: [PATCH] 合并了全部的代码
---
ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs | 158 ++++++++++++++++++++--------------------------------
1 files changed, 61 insertions(+), 97 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
index 7c32d18..9200520 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Device/Curtain/AutoOpenDirectionAndLimitSettionForm.cs
@@ -38,6 +38,14 @@
/// 鍒楄〃鎺т欢
/// </summary>
private VerticalListControl listView = null;
+ /// <summary>
+ /// 寮�闄愪綅鐨勮繘搴︽潯
+ /// </summary>
+ private HorizontalSeekBar openSeekBar = null;
+ /// <summary>
+ /// 鍚堥檺浣嶇殑杩涘害鏉�
+ /// </summary>
+ private HorizontalSeekBar closeSeekBar = null;
#endregion
@@ -135,7 +143,7 @@
listText.Add(Language.StringByID(R.MyInternationalizationString.uForwardDirection));//姝e悜
listText.Add(Language.StringByID(R.MyInternationalizationString.uReverseDirection));//鍙嶅悜
- var form = new BottomDialogSelectForm();
+ var form = new BottomItemSelectForm();
form.AddForm(Language.StringByID(R.MyInternationalizationString.uDirectionSelect), listText, nowSelectNo);
form.FinishSelectEvent += async (index) =>
{
@@ -216,17 +224,17 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- var seekBar = new HorizontalSeekBar();
- seekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
- seekBar.Gravity = Gravity.CenterHorizontal;
- seekBar.Width = Application.GetRealWidth(962);
- seekBar.Height = Application.GetRealHeight(84);
- seekBar.Max = 100;
- seekBar.BackgroundColor = 0xfff5f5f5;
- seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
- seekBar.ProgressColor = 0xff288bfd;
- seekBar.Progress = progressValue;
- frameBack.AddChidren(seekBar);
+ this.openSeekBar = new HorizontalSeekBar();
+ openSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
+ openSeekBar.Gravity = Gravity.CenterHorizontal;
+ openSeekBar.Width = Application.GetRealWidth(962);
+ openSeekBar.Height = Application.GetRealHeight(84);
+ openSeekBar.Max = 100;
+ openSeekBar.BackgroundColor = 0xfff5f5f5;
+ openSeekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
+ openSeekBar.ProgressColor = 0xff288bfd;
+ openSeekBar.Progress = progressValue;
+ frameBack.AddChidren(openSeekBar);
var btnTemp1 = new NormalViewControl(200, 50, true);
btnTemp1.X = ControlCommonResourse.XXLeft;
@@ -254,10 +262,16 @@
int waitTime = 4;//500姣涓哄崟浣�
bool startWait = false;
bool checking = false;
- seekBar.ProgressChanged += (sender, value) =>
+ openSeekBar.ProgressChanged += (sender, value) =>
{
//鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
waitTime = 4;
+ //寮�闄愪綅涓嶈兘澶т簬鍚堥檺浣�
+ if (value > closeSeekBar.Progress)
+ {
+ openSeekBar.Progress = closeSeekBar.Progress;
+ return;
+ }
if (checking == false)
{
startWait = true;
@@ -269,7 +283,7 @@
};
HdlThreadLogic.Current.RunThread(async () =>
{
- while (seekBar.Parent != null)
+ while (openSeekBar.Parent != null)
{
if (startWait == false)
{
@@ -285,7 +299,7 @@
startWait = false;
checking = true;
- var value = seekBar.Progress;
+ var value = curtainData.OpenLimitPersent;
if (oldValue == value)
{
//鐩稿悓鏁板��
@@ -311,39 +325,6 @@
}
}
});
-
- //var oldTime = DateTime.Now;
- //var oldValue = 0;
- //seekBar.MouseUpEventHandler += async (sender, e) =>
- //{
- // if ((DateTime.Now - oldTime).TotalSeconds <= 1)
- // {
- // //鏈�灏戦渶瑕�2绉掗棿闅�
- // return;
- // }
- // var value = seekBar.Progress;
- // if (oldValue == value)
- // {
- // //鐩稿悓鏁板��
- // return;
- // }
- // oldValue = value;
- // oldTime = DateTime.Now;
-
- // if (curtainData.DeleteOpenLimit == true)
- // {
- // //閲嶇疆寮�闄愪綅鐐�
- // var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.UpLimit);
- // if (result == false)
- // {
- // return;
- // }
- // curtainData.DeleteOpenLimit = false;
- // }
- // receiveUplimit = "1";
- // //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- // curtainDevice.WcdGoToTiltValue(value);
- //};
}
/// <summary>
@@ -370,17 +351,17 @@
btnProgress1.Text = progressValue + "%";
frameBack.AddChidren(btnProgress1);
//杩涘害鏉�
- var seekBar = new HorizontalSeekBar();
- seekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
- seekBar.Gravity = Gravity.CenterHorizontal;
- seekBar.Width = Application.GetRealWidth(962);
- seekBar.Height = Application.GetRealHeight(84);
- seekBar.Max = 100;
- seekBar.BackgroundColor = 0xfff5f5f5;
- seekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
- seekBar.ProgressColor = 0xff288bfd;
- seekBar.Progress = progressValue;
- frameBack.AddChidren(seekBar);
+ this.closeSeekBar = new HorizontalSeekBar();
+ closeSeekBar.Y = btnProgressView.Bottom + Application.GetRealHeight(46);
+ closeSeekBar.Gravity = Gravity.CenterHorizontal;
+ closeSeekBar.Width = Application.GetRealWidth(962);
+ closeSeekBar.Height = Application.GetRealHeight(84);
+ closeSeekBar.Max = 100;
+ closeSeekBar.BackgroundColor = 0xfff5f5f5;
+ closeSeekBar.ThumbColor = Common.ZigbeeColor.Current.GXCButtonBlueColor;
+ closeSeekBar.ProgressColor = 0xff288bfd;
+ closeSeekBar.Progress = progressValue;
+ frameBack.AddChidren(closeSeekBar);
var btnTemp1 = new NormalViewControl(200, 50, true);
btnTemp1.X = ControlCommonResourse.XXLeft;
@@ -408,10 +389,16 @@
int waitTime = 4;//500姣涓哄崟浣�
bool startWait = false;
bool checking = false;
- seekBar.ProgressChanged += (sender, value) =>
+ closeSeekBar.ProgressChanged += (sender, value) =>
{
//鍊肩户缁敼鍙�,鍒欑瓑寰呮椂闂磋繕鍘�
waitTime = 4;
+ //鍚堥檺浣嶄笉鑳藉皬浜庡悎闄愪綅
+ if (value < openSeekBar.Progress)
+ {
+ closeSeekBar.Progress = openSeekBar.Progress;
+ return;
+ }
if (checking == false)
{
startWait = true;
@@ -423,7 +410,7 @@
};
HdlThreadLogic.Current.RunThread(async () =>
{
- while (seekBar.Parent != null)
+ while (closeSeekBar.Parent != null)
{
if (startWait == false)
{
@@ -439,7 +426,7 @@
startWait = false;
checking = true;
- var value = seekBar.Progress;
+ var value = curtainData.CloseLimitPersent;
if (oldValue == value)
{
//鐩稿悓鏁板��
@@ -465,39 +452,6 @@
}
}
});
-
- //var oldTime = DateTime.Now;
- //var oldValue = 0;
- //seekBar.MouseUpEventHandler += async (sender, e) =>
- //{
- // if ((DateTime.Now - oldTime).TotalSeconds <= 1)
- // {
- // //鏈�灏戦渶瑕�2绉掗棿闅�
- // return;
- // }
- // var value = seekBar.Progress;
- // if (oldValue == value)
- // {
- // //鐩稿悓鏁板��
- // return;
- // }
- // oldValue = value;
- // oldTime = DateTime.Now;
-
- // if (curtainData.DeleteCloseLimit == true)
- // {
- // //閲嶇疆鍚堥檺浣嶇偣
- // var result = await HdlDeviceCurtainLogic.Current.DeleteCurtainLimitPoint(curtainDevice, Rollershade.LimiType.DownLimit);
- // if (result == false)
- // {
- // return;
- // }
- // curtainData.DeleteCloseLimit = false;
- // }
- // receiveDownLimit = "1";
- // //灏嗙獥甯樿皟鏁村埌鎸囧畾鐧惧垎姣�
- // curtainDevice.WcdGoToTiltValue(value);
- //};
}
#endregion
@@ -678,28 +632,38 @@
if (receiveUplimit == "1")
{
receiveUplimit = "0";
+ openSeekBar.Progress = curtainData.OpenLimitPersent;
//纭褰撳墠浣嶇疆{0}涓哄紑闄愪綅?
string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainOpenLimitMsg);
msg = msg.Replace("{0}", curtainData.OpenLimitPersent + "%");
this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
{
//鎵ц纭鍙婅鐩栦笂闄愪綅鐐�
- await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
+ var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.UpLimit,
curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+ if (result == true)
+ {
+ curtainData.DeleteOpenLimit = true;
+ }
});
}
//鍚堥檺浣�
else if (receiveDownLimit == "1")
{
receiveDownLimit = "0";
+ closeSeekBar.Progress = curtainData.CloseLimitPersent;
//纭褰撳墠浣嶇疆{0}涓哄悎闄愪綅?
string msg = Language.StringByID(R.MyInternationalizationString.uCommitCurtainCloseLimitMsg);
msg = msg.Replace("{0}", curtainData.CloseLimitPersent + "%");
this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
{
//鎵ц纭鍙婅鐩栧悎闄愪綅鐐�
- await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
+ var result = await HdlDeviceCurtainLogic.Current.CommitCurtainLimitPoint(curtainDevice, Rollershade.CurtainPrivateInstalledLimi.DownLimit,
curtainData.OpenLimitPersent, curtainData.CloseLimitPersent);
+ if (result == true)
+ {
+ curtainData.DeleteCloseLimit = true;
+ }
});
}
}
--
Gitblit v1.8.0