From 4f0ab0ad21ce450b7856d50f98322a7899361386 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 22 九月 2020 10:30:01 +0800
Subject: [PATCH] 不要下载这个备份
---
ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs | 95 +++++++++++++++++++++++++++++++++++++----------
1 files changed, 74 insertions(+), 21 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs
index 8fb999c..21fd604 100755
--- a/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs
+++ b/ZigbeeApp/Shared/Phone/MainPage/ControlForm/DeviceCurtainDetailCardForm.cs
@@ -83,6 +83,22 @@
btnOpen.Y = Application.GetRealHeight(994) - btnOpen.YOffset;
btnOpen.ButtonClickEvent += (sender, e) =>
{
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ ((Rollershade)device).WcdCurrentPositionLiftPercentage = 100;
+ if (this.WcdType == 0)
+ {
+ SeekBarSiphonateCurtain.Progress = 100;
+ }
+ else
+ {
+ SeekBarOpenCurtain.Progress = 100;
+ }
+ //璁剧疆鐘舵�佹枃瀛�
+ this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
+ return;
+ }
//鍙戦�佺獥甯樺懡浠�
this.SetCurtainCommand(0);
};
@@ -98,6 +114,11 @@
btnStop.Y = btnOpen.Y;
btnStop.ButtonClickEvent += (sender, e) =>
{
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ return;
+ }
//鍙戦�佺獥甯樺懡浠�
this.SetCurtainCommand(2);
};
@@ -111,6 +132,22 @@
btnClose.Y = btnOpen.Y;
btnClose.ButtonClickEvent += (sender, e) =>
{
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鍒欐鍔熻兘鏃犳晥
+ if (Common.Config.Instance.Home.IsVirtually == true)
+ {
+ ((Rollershade)device).WcdCurrentPositionLiftPercentage = 0;
+ if (this.WcdType == 0)
+ {
+ SeekBarSiphonateCurtain.Progress = 0;
+ }
+ else
+ {
+ SeekBarOpenCurtain.Progress = 0;
+ }
+ //璁剧疆鐘舵�佹枃瀛�
+ this.SetStatuText(HdlDeviceOtherLogic.Current.GetDeviceStatu(this.device));
+ return;
+ }
//鍙戦�佺獥甯樺懡浠�
this.SetCurtainCommand(1);
};
@@ -143,8 +180,8 @@
//鍗峰笜鎺т欢
this.SeekBarSiphonateCurtain = new CurtainRollSeekBar();
SeekBarSiphonateCurtain.Y = Application.GetRealHeight(300);
- SeekBarSiphonateCurtain.Width = Application.GetMinRealAverage(438);
- SeekBarSiphonateCurtain.Height = Application.GetMinRealAverage(576);
+ SeekBarSiphonateCurtain.Width = this.GetPictrueRealSize(438);
+ SeekBarSiphonateCurtain.Height = this.GetPictrueRealSize(576);
SeekBarSiphonateCurtain.Gravity = Gravity.CenterHorizontal;
SeekBarSiphonateCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
frameWhiteBack.AddChidren(SeekBarSiphonateCurtain);
@@ -193,7 +230,16 @@
//鍙樻洿杩涘害鐧惧垎姣旂殑鏄剧ず
btnProgress.Y = progressY + SeekBarSiphonateCurtain.NowProgressY;
btnProgress.Text = value + "%";
- nowProgressValue = value;
+
+ if (Common.Config.Instance.Home.IsVirtually == false)
+ {
+ nowProgressValue = value;
+ }
+ else
+ {
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴鏀圭紦瀛�
+ (device as Rollershade).WcdCurrentPositionLiftPercentage = value;
+ }
};
if (this.hadInitControl == true)
@@ -233,8 +279,8 @@
//寮�鍚堝笜鎺т欢
this.SeekBarOpenCurtain = new CurtainSeekBar();
SeekBarOpenCurtain.Y = Application.GetRealHeight(334);
- SeekBarOpenCurtain.Width = Application.GetMinRealAverage(570);
- SeekBarOpenCurtain.Height = Application.GetMinRealAverage(513);
+ SeekBarOpenCurtain.Width = this.GetPictrueRealSize(570);
+ SeekBarOpenCurtain.Height = this.GetPictrueRealSize(513);
SeekBarOpenCurtain.Gravity = Gravity.CenterHorizontal;
SeekBarOpenCurtain.IsProgressTextShow = false;
SeekBarOpenCurtain.Progress = (device as Rollershade).WcdCurrentPositionLiftPercentage;
@@ -280,7 +326,16 @@
{
btnProgress.X = progressX + SeekBarOpenCurtain.NowProgressX - Application.GetMinReal(5);
btnProgress.Text = value + "%";
- nowProgressValue = value;
+
+ if (Common.Config.Instance.Home.IsVirtually == false)
+ {
+ nowProgressValue = value;
+ }
+ else
+ {
+ //濡傛灉浣忓畢涓鸿櫄鎷熶綇瀹�,鐩存帴淇敼缂撳瓨
+ (device as Rollershade).WcdCurrentPositionLiftPercentage = value;
+ }
};
//寮�涓�涓嚎绋�,鐩戣鏄惁婊戝姩鐨勬粦鍔ㄦ潯,姣忕妫�娴嬩竴娆�
@@ -311,19 +366,20 @@
/// <param name="comand"></param>
private void SetCurtainCommand(int comand)
{
+ //2020.07.20鍙樻洿:鏀惧紑闄愬埗,涓嶅啀绛夊緟缃戝叧鍥炲,涔熻兘鐐瑰嚮鎸夐挳
//鍦ㄦ病鏈夋帴鏀跺埌鍙嶉涔嬪墠,涓嶈兘鍐嶇偣鍑�
- this.btnClose.CanClick = false;
- this.btnOpen.CanClick = false;
- this.btnStop.CanClick = false;
+ //this.btnClose.CanClick = false;
+ //this.btnOpen.CanClick = false;
+ //this.btnStop.CanClick = false;
//妫�娴嬫槸鍚﹁幏鍙栫綉鍏冲弽棣堢殑缁撴灉,濡傛灉缃戝叧娌℃湁鍥炲,鍒欎細寮瑰嚭娑堟伅
- this.StartCheckResponeResult(new List<ButtonBase>(), (result) =>
- {
- //鏃堕棿缁撴潫,鍙互鍐嶆鐐瑰嚮
- this.btnClose.CanClick = true;
- this.btnOpen.CanClick = true;
- this.btnStop.CanClick = true;
- });
+ //this.StartCheckResponeResult(new List<ButtonBase>(), (result) =>
+ //{
+ // //鏃堕棿缁撴潫,鍙互鍐嶆鐐瑰嚮
+ // this.btnClose.CanClick = true;
+ // this.btnOpen.CanClick = true;
+ // this.btnStop.CanClick = true;
+ //});
//鍙戦�佸懡浠�
((Rollershade)device).CurtainUpDownStopControl(comand);
}
@@ -340,11 +396,7 @@
/// <returns></returns>
public override bool CheckResponeResultStatu(ReceiveComandDiv comandDiv, CommonDevice report)
{
- if (comandDiv == ReceiveComandDiv.A鑺傜偣鎺у埗鍙嶉)
- {
- return true;
- }
- else if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
+ if (comandDiv == ReceiveComandDiv.A璁惧灞炴�т笂鎶�)
{
HdlThreadLogic.Current.RunMain(() =>
{
@@ -363,6 +415,7 @@
}
}
});
+ return true;
}
return false;
}
--
Gitblit v1.8.0