From 5eeafe3af80bfd88306bd8ad9e76c8f4b51ca35f Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 14:16:20 +0800
Subject: [PATCH] 增加本地发送的重发机制
---
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 90 ++++++++++++++++++++++++++++++++++-----------
1 files changed, 68 insertions(+), 22 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
index 7d098d7..d87f2d4 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -9,7 +9,7 @@
{
#region 鎺т欢闆嗗悎
- FrameLayout bodyView;
+ static DimmerPage bodyView;
/// <summary>
/// 鎺у埗鐣岄潰鍔犺浇鍖哄煙
/// </summary>
@@ -27,6 +27,18 @@
/// </summary>
Button btnCollection;
/// <summary>
+ /// 璋冨厜鎺т欢
+ /// </summary>
+ WaveSeekBarOn dimmerBar;
+ /// <summary>
+ /// 浜害鏄剧ず鎸夐挳
+ /// </summary>
+ Button btnBrightnessText;
+ /// <summary>
+ /// 娓愬彉鏃堕棿淇敼
+ /// </summary>
+ DiyImageSeekBar barFadeTime;
+ /// <summary>
/// 寮�鍏虫寜閽�
/// </summary>
Button btnSwitch;
@@ -37,11 +49,18 @@
Button btnCollection_Out;
Button btnFunctionName_Out;
Button btnFromFloor_Out;
+ bool onDimmerBar = false;
/// <summary>
/// 鍒锋柊鏄剧ず淇℃伅
/// </summary>
Action actionRefresh;
#endregion
+
+ public override void RemoveFromParent()
+ {
+ base.RemoveFromParent();
+ bodyView = null;
+ }
public DimmerPage(Light func)
{
@@ -102,27 +121,50 @@
Height = Application.GetMinRealAverage(40),
SelectedImagePath = "Collection/CollectionIcon.png",
UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
- IsSelected = light.collection
+ IsSelected = light.collect
};
controlView.AddChidren(btnCollection);
- var diyImageSeekBar = new WaveSeekBar()
+ dimmerBar = new WaveSeekBarOn()
{
Gravity = Gravity.CenterHorizontal,
- Y = Application.GetRealHeight(74+16),
- Width = Application.GetRealWidth(168-40),
- Height = Application.GetRealHeight(288-16-16),
- WaveColor = CSS_Color.AuxiliaryColor1,
- WaveBorderColor = CSS_Color.PromptingColor2,
+ Y = Application.GetRealHeight(74 + 16),
+ Width = Application.GetRealWidth(168 - 40),
+ Height = Application.GetRealHeight(288 - 16 - 16),
+ //WaveBorderColor = CSS_Color.PromptingColor2,
BorderColor = 0x00000000,
- CornerRadius = Application.GetRealWidth(1),
+ CornerRadius = Application.GetRealWidth(40),
BorderWidth = 0,
- WavePadding =Application.GetRealWidth(-5),
- BackgroundColor = CSS_Color.BackgroundColor,
- Radius = (uint)Application.GetRealWidth(40),
-
+ //WavePadding = Application.GetRealWidth(-5),
+ //BackgroundColor = CSS_Color.BackgroundColor,
+ //Radius = (uint)Application.GetRealWidth(40),
+ Progress = light.brightness,
+ //ProgressTextColor =0x00000000,
+ IsProgressTextShow = false,
};
- controlView.AddChidren(diyImageSeekBar);
+ controlView.AddChidren(dimmerBar);
+ if(light.trait_on_off.curValue.ToString() == "on")
+ {
+ dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
+ }
+ else
+ {
+ dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
+ }
+ dimmerBar.Progress = light.brightness;
+ btnBrightnessText = new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y =( (100 - dimmerBar.Progress) * Application.GetRealHeight(288 - 16 - 16) /100)+ Application.GetRealWidth(40),
+ Width = Application.GetRealWidth(56),
+ Height = Application.GetRealWidth(46),
+ UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
+ Text = light.brightness + "%",
+ };
+ controlView.AddChidren(btnBrightnessText);
+
#region 娓愬彉鏃堕棿璋冭妭
var btnGradualChangeText = new Button()
@@ -151,7 +193,7 @@
};
controlView.AddChidren(btnGradualChangeMinValuesText);
- var barGradualChange = new DiyImageSeekBar()
+ barFadeTime = new DiyImageSeekBar()
{
X = btnGradualChangeMinValuesText.Right,
Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
@@ -165,13 +207,14 @@
ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
ProgressBarUnitSring = "s",
MaxValue = 10,
- Progress = 0,
+ Progress = light.fadeTime,
+ SeekBarPadding = Application.GetRealWidth(20),
};
- controlView.AddChidren(barGradualChange);
+ controlView.AddChidren(barFadeTime);
var btnGradualChangeMaxValuesText = new Button()
{
- X = barGradualChange.Right,
+ X = barFadeTime.Right,
Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
Width = Application.GetRealWidth(35),
Height = Application.GetRealHeight(21),
@@ -183,7 +226,6 @@
controlView.AddChidren(btnGradualChangeMaxValuesText);
#endregion
-
btnSwitch = new Button()
{
Gravity = Gravity.CenterHorizontal,
@@ -192,14 +234,18 @@
Height = Application.GetMinRealAverage(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = light.state != 0
+ IsSelected = light.trait_on_off.curValue.ToString() == "on",
};
controlView.AddChidren(btnSwitch);
LoadEventList();
- new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light, actionRefresh);
-
+ new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
+ new System.Threading.Thread(() =>
+ {
+ DriverLayer.Control.Ins.SendReadCommand(light);
+ })
+ { IsBackground = true }.Start();
}
--
Gitblit v1.8.0