From e1a8f2f7e4d850beedeb1469610b878c1427e976 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 15 十二月 2021 09:01:53 +0800
Subject: [PATCH] 更新
---
HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs | 175 ++++++++++++++++++++++++++++++---------------------------
1 files changed, 92 insertions(+), 83 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
index 1a9040b..52f25af 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/DimmerPage.cs
@@ -45,7 +45,8 @@
#endregion
#region 鍖哄煙鍙橀噺
- Light light;
+ Light lightTemp = new Light();
+ Function function;
Button btnCollection_Out;
Button btnFunctionName_Out;
Button btnFromFloor_Out;
@@ -62,10 +63,10 @@
bodyView = null;
}
- public DimmerPage(Light func)
+ public DimmerPage(Function func)
{
bodyView = this;
- light = func;
+ function = func;
}
public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
@@ -74,8 +75,8 @@
btnFunctionName_Out = btnFunctionNameOut;
btnFromFloor_Out = btnFromFloorOut;
bodyView.BackgroundColor = CSS_Color.BackgroundColor;
- //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(light,null);
- //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), light);
+ //new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView(function,null);
+ //new PublicAssmebly().LoadTopView(bodyView, Language.StringByID(StringId.Lights), function);
controlView = new FrameLayout()
{
@@ -96,7 +97,7 @@
TextColor = CSS_Color.FirstLevelTitleColor,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
- Text = light.name,
+ Text = function.name,
};
controlView.AddChidren(btnFunctionName);
@@ -109,7 +110,7 @@
TextColor = CSS_Color.PromptingColor1,
TextAlignment = TextAlignment.CenterLeft,
TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Text = light.GetRoomListName()
+ Text = function.GetRoomListName()
};
controlView.AddChidren(btnFromFoorAndRoom);
@@ -121,14 +122,14 @@
Height = Application.GetMinRealAverage(40),
SelectedImagePath = "Collection/CollectionIcon.png",
UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
- IsSelected = light.collect
+ IsSelected = function.collect
};
- //controlView.AddChidren(btnCollection);
+ controlView.AddChidren(btnCollection);
//2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
- if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
- {
- controlView.AddChidren(btnCollection);
- }
+ //if (!DB_ResidenceData.Instance.CurrentRegion.isOtherShare)
+ //{
+ // controlView.AddChidren(btnCollection);
+ //}
dimmerBar = new WaveSeekBarOn()
{
@@ -139,11 +140,11 @@
BorderColor = 0x00000000,
CornerRadius = Application.GetRealWidth(30),
BorderWidth = 0,
- Progress = light.brightness,
+ Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)),
IsProgressTextShow = false,
};
controlView.AddChidren(dimmerBar);
- if(light.trait_on_off.curValue.ToString() == "on")
+ if(function.trait_on_off.curValue.ToString() == "on")
{
dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
}
@@ -151,7 +152,7 @@
{
dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
}
- dimmerBar.Progress = light.brightness;
+ dimmerBar.Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness));
btnBrightnessText = new Button()
{
Gravity = Gravity.CenterHorizontal,
@@ -161,78 +162,86 @@
UnSelectedImagePath = "FunctionIcon/Light/BrightnessBg.png",
TextColor = CSS_Color.FirstLevelTitleColor,
TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
- Text = light.brightness + "%",
+ Text = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.Brightness)) + "%",
};
controlView.AddChidren(btnBrightnessText);
- #region 娓愬彉鏃堕棿璋冭妭
- var btnGradualChangeText = new Button()
+ if (function.GetAttribute(FunctionAttributeKey.FadeTime) != null)
{
- X = Application.GetRealWidth(35),
- Y = Application.GetRealHeight(385),
- Width = Application.GetRealWidth(224),
- Height = Application.GetRealHeight(21),
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- TextID = StringId.SpeedOfChange,
- Visible = light.HadFadeTime,
- Enable = light.HadFadeTime,
- };
- controlView.AddChidren(btnGradualChangeText);
+ #region 娓愬彉鏃堕棿璋冭妭
- var btnGradualChangeMinValuesText = new Button()
- {
- X = Application.GetRealWidth(35),
- Y = btnGradualChangeText.Bottom+ Application.GetRealHeight(8),
- Width = Application.GetRealWidth(22),
- Height = Application.GetRealHeight(21),
- Text = "0s",
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.PromptingColor1,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Visible = light.HadFadeTime,
- Enable = light.HadFadeTime,
- };
- controlView.AddChidren(btnGradualChangeMinValuesText);
+ var btnGradualChangeText = new Button()
+ {
+ X = Application.GetRealWidth(35),
+ Y = Application.GetRealHeight(385),
+ Width = Application.GetRealWidth(224),
+ Height = Application.GetRealHeight(21),
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ TextID = StringId.SpeedOfChange,
+ Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ };
+ controlView.AddChidren(btnGradualChangeText);
- barFadeTime = new DiyImageSeekBar()
- {
- X = btnGradualChangeMinValuesText.Right,
- Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
- Width = Application.GetRealWidth(210),
- Height = Application.GetRealHeight(54),
- SeekBarViewHeight = Application.GetRealHeight(8),
- ThumbImagePath = "Public/ThumbImage.png",
- ThumbImageHeight = Application.GetRealHeight(54),
- ProgressBarColor = CSS_Color.MainColor,
- ProgressTextColor = CSS_Color.FirstLevelTitleColor,
- ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- ProgressBarUnitSring = "s",
- MaxValue = 10,
- Progress = light.fadeTime,
- SeekBarPadding = Application.GetRealWidth(20),
- Visible = light.HadFadeTime,
- Enable = light.HadFadeTime,
- };
- controlView.AddChidren(barFadeTime);
+ var btnGradualChangeMinValuesText = new Button()
+ {
+ X = Application.GetRealWidth(35),
+ Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(22),
+ Height = Application.GetRealHeight(21),
+ Text = "0s",
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.PromptingColor1,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ };
+ controlView.AddChidren(btnGradualChangeMinValuesText);
- var btnGradualChangeMaxValuesText = new Button()
- {
- X = barFadeTime.Right,
- Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
- Width = Application.GetRealWidth(35),
- Height = Application.GetRealHeight(21),
- Text = "10s",
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.PromptingColor1,
- TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
- Visible = light.HadFadeTime,
- Enable = light.HadFadeTime,
- };
- controlView.AddChidren(btnGradualChangeMaxValuesText);
- #endregion
+ barFadeTime = new DiyImageSeekBar()
+ {
+ X = btnGradualChangeMinValuesText.Right,
+ Y = Application.GetRealHeight(412 - 21) + Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(210),
+ Height = Application.GetRealHeight(54),
+ SeekBarViewHeight = Application.GetRealHeight(8),
+ ThumbImagePath = "Public/ThumbImage.png",
+ ThumbImageHeight = Application.GetRealHeight(54),
+ ProgressBarColor = CSS_Color.MainColor,
+ ProgressTextColor = CSS_Color.FirstLevelTitleColor,
+ ProgressTextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ ProgressBarUnitSring = "s",
+ MaxValue = 10,
+ Progress = Convert.ToInt32(function.GetAttrState(FunctionAttributeKey.FadeTime)),
+ SeekBarPadding = Application.GetRealWidth(20),
+ Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ };
+ controlView.AddChidren(barFadeTime);
+ barFadeTime.OnStopTrackingTouchEvent = (sender, e) =>
+ {
+ function.SetAttrState(FunctionAttributeKey.FadeTime, e.ToString());
+ function.UpdataFuncitonInfo();
+ };
+ var btnGradualChangeMaxValuesText = new Button()
+ {
+ X = barFadeTime.Right,
+ Y = btnGradualChangeText.Bottom + Application.GetRealHeight(8),
+ Width = Application.GetRealWidth(35),
+ Height = Application.GetRealHeight(21),
+ Text = "10s",
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.PromptingColor1,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Visible = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ Enable = function.GetAttribute(FunctionAttributeKey.FadeTime) != null,
+ };
+ controlView.AddChidren(btnGradualChangeMaxValuesText);
+ #endregion
+ }
btnSwitch = new Button()
{
Gravity = Gravity.CenterHorizontal,
@@ -241,16 +250,16 @@
Height = Application.GetMinRealAverage(40),
UnSelectedImagePath = "Public/PowerClose.png",
SelectedImagePath = "Public/PowerOpen.png",
- IsSelected = light.trait_on_off.curValue.ToString() == "on",
+ IsSelected = function.trait_on_off.curValue.ToString() == "on",
};
controlView.AddChidren(btnSwitch);
LoadEventList();
- new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
+ new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(function, actionRefresh);
new System.Threading.Thread(() =>
{
- DriverLayer.Control.Ins.SendReadCommand(light);
+ DriverLayer.Control.Ins.SendReadCommand(function);
})
{ IsBackground = true }.Start();
}
--
Gitblit v1.8.0