From aa1eb6c809ef1e0e050bfeac53e9f2ea4f11330c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 18 十二月 2020 21:00:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev-tzy' into NewFilePath
---
HDL_ON/UI/UI2/.DS_Store | 0
HDL_ON/Entity/.DS_Store | 0
HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs | 7
HDL-ON_Android/Assets/Phone/.DS_Store | 0
HDL_ON/Entity/Function/Light.cs | 15
HDL-ON_Android/Assets/Language.ini | 5
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs | 708 +++++++++++++++++++++++++++++++++++++++++
HDL-ON_iOS/Resources/.DS_Store | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/MeetingGuestsIcon.png | 0
HDL_ON/HDL_ON.projitems | 2
HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs | 189 +++++++++++
HDL-ON_iOS/Resources/Language.ini | 5
HDL_ON/Entity/Function/Fan.cs | 5
HDL_ON/UI/UI2/FuntionControlView/.DS_Store | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png | 0
.vs/HDL_APP_Project/xs/sqlite3/storage.ide | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png | 0
HDL_ON/DAL/DriverLayer/Control.cs | 18 +
HDL_ON/DAL/.DS_Store | 0
HDL_ON/Common/.DS_Store | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ReadIcon.png | 0
HDL_ON/UI/.DS_Store | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/.DS_Store | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ReadIcon.png | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/CozyIcon.png | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/MeetingGuestsIcon.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatureBar.png | 0
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/CozyIcon.png | 0
/dev/null | 0
HDL-ON_Android/Assets/.DS_Store | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png | 0
HDL_ON/Entity/Function/Curtain.cs | 5
HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatureBar.png | 0
HDL_ON/.DS_Store | 0
HDL_ON/Common/R.cs | 7
HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png | 0
HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store | 0
37 files changed, 962 insertions(+), 4 deletions(-)
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
index 1580e3b..791400e 100644
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
+++ b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
deleted file mode 100644
index 6f9d457..0000000
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-shm
+++ /dev/null
Binary files differ
diff --git a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal b/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
deleted file mode 100644
index 6229b3d..0000000
--- a/.vs/HDL_APP_Project/xs/sqlite3/storage.ide-wal
+++ /dev/null
Binary files differ
diff --git a/HDL-ON_Android/Assets/.DS_Store b/HDL-ON_Android/Assets/.DS_Store
index a60d18f..6b4055b 100644
--- a/HDL-ON_Android/Assets/.DS_Store
+++ b/HDL-ON_Android/Assets/.DS_Store
Binary files differ
diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
old mode 100644
new mode 100755
index 5e20c6b..70ed926
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -399,6 +399,11 @@
400=娆㈣繋鍥炲
401=浜岀淮鐮佸け鏁堬紝璇烽噸璇�
402=閲嶈瘯
+403=鑹叉俯
+404=蹇嵎璋冭妭
+405=娓╅Θ
+406=浼氬
+407=闃呰
5000=闊充箰
5001=缁勫悎
diff --git a/HDL-ON_Android/Assets/Phone/.DS_Store b/HDL-ON_Android/Assets/Phone/.DS_Store
index 36519d7..ed770ff 100644
--- a/HDL-ON_Android/Assets/Phone/.DS_Store
+++ b/HDL-ON_Android/Assets/Phone/.DS_Store
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/.DS_Store b/HDL-ON_Android/Assets/Phone/FunctionIcon/.DS_Store
new file mode 100644
index 0000000..3a94891
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/.DS_Store
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png
new file mode 100755
index 0000000..be970d9
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png
new file mode 100755
index 0000000..7dc199a
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatureBar.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatureBar.png
new file mode 100755
index 0000000..533e3ed
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ColorTemperatureBar.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/CozyIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/CozyIcon.png
new file mode 100755
index 0000000..0e51cc5
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/CozyIcon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/MeetingGuestsIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/MeetingGuestsIcon.png
new file mode 100755
index 0000000..46f01d5
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/MeetingGuestsIcon.png
Binary files differ
diff --git a/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ReadIcon.png b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ReadIcon.png
new file mode 100755
index 0000000..6e30e11
--- /dev/null
+++ b/HDL-ON_Android/Assets/Phone/FunctionIcon/Light/ReadIcon.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/.DS_Store b/HDL-ON_iOS/Resources/.DS_Store
index 44d747b..28e72c0 100644
--- a/HDL-ON_iOS/Resources/.DS_Store
+++ b/HDL-ON_iOS/Resources/.DS_Store
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
old mode 100644
new mode 100755
index 5956521..3c62817
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -400,6 +400,11 @@
400=娆㈣繋鍥炲
401=浜岀淮鐮佸け鏁堬紝璇烽噸璇�
402=閲嶈瘯
+403=鑹叉俯
+404=蹇嵎璋冭妭
+405=娓╅Θ
+406=浼氬
+407=闃呰
5000=闊充箰
5001=缁勫悎
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store b/HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store
index f872bbb..3d62d57 100644
--- a/HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/.DS_Store
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png
new file mode 100755
index 0000000..be970d9
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuick.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png
new file mode 100755
index 0000000..7dc199a
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatrueQuickBack.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatureBar.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatureBar.png
new file mode 100755
index 0000000..533e3ed
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ColorTemperatureBar.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/CozyIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/CozyIcon.png
new file mode 100755
index 0000000..0e51cc5
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/CozyIcon.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/MeetingGuestsIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/MeetingGuestsIcon.png
new file mode 100755
index 0000000..46f01d5
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/MeetingGuestsIcon.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ReadIcon.png b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ReadIcon.png
new file mode 100755
index 0000000..6e30e11
--- /dev/null
+++ b/HDL-ON_iOS/Resources/Phone/FunctionIcon/Light/ReadIcon.png
Binary files differ
diff --git a/HDL_ON/.DS_Store b/HDL_ON/.DS_Store
index 5979948..5f5ccb0 100755
--- a/HDL_ON/.DS_Store
+++ b/HDL_ON/.DS_Store
Binary files differ
diff --git a/HDL_ON/Common/.DS_Store b/HDL_ON/Common/.DS_Store
new file mode 100644
index 0000000..799442b
--- /dev/null
+++ b/HDL_ON/Common/.DS_Store
Binary files differ
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index 21dda1c..c1448e6 100755
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,10 +4,15 @@
{
public static class StringId
{
- public const int WholeZone = 377;
+ public const int Reading = 407;
+ public const int MeetingGuests = 406;
+ public const int Cozy = 405;
+ public const int QuickAdjustment = 404;
+ public const int ColorTemperature = 403;
public const int Retry = 402;
public const int QRCodeIsInvalid = 401;
public const int WellComBackHome = 400;
+ public const int WholeZone = 377;
public const int CannotEnterSpecialCharacters = 376;
public const int GatewayOfflineCannotCreateScene = 375;
public const int ResidenceDeletedSwitchToAnotherResidence = 374;
diff --git a/HDL_ON/DAL/.DS_Store b/HDL_ON/DAL/.DS_Store
new file mode 100644
index 0000000..6e1acff
--- /dev/null
+++ b/HDL_ON/DAL/.DS_Store
Binary files differ
diff --git a/HDL_ON/DAL/DriverLayer/Control.cs b/HDL_ON/DAL/DriverLayer/Control.cs
index 1703139..d1164c5 100644
--- a/HDL_ON/DAL/DriverLayer/Control.cs
+++ b/HDL_ON/DAL/DriverLayer/Control.cs
@@ -566,7 +566,23 @@
}
break;
case SPK.LightRGBW:
- case SPK.LightCCT:
+ break;
+ case SPK.LightCCT:
+ var lightCCT = FunctionList.List.lights.Find((obj) => obj.sid == updateTemp.sid);
+ if (lightCCT != null)
+ {
+ localObj = lightCCT;
+ foreach (var attr in updateTemp.status)
+ {
+ var localAttr = lightCCT.attributes.Find((obj) => obj.key == attr.key);
+ if (localAttr != null)
+ {
+ localAttr.curValue = attr.value;
+ }
+ }
+ lightCCT.lastState = Language.StringByID(StringId.Brightness) + " : " + lightCCT.brightness + "%";
+ DimmerPage.UpdataStates(lightCCT);
+ }
break;
case SPK.CurtainSwitch:
var curtain = FunctionList.List.curtains.Find((obj) => obj.sid == updateTemp.sid);
diff --git a/HDL_ON/Entity/.DS_Store b/HDL_ON/Entity/.DS_Store
new file mode 100644
index 0000000..b104da3
--- /dev/null
+++ b/HDL_ON/Entity/.DS_Store
Binary files differ
diff --git a/HDL_ON/Entity/Function/Curtain.cs b/HDL_ON/Entity/Function/Curtain.cs
index 51d2a25..ee1da9d 100755
--- a/HDL_ON/Entity/Function/Curtain.cs
+++ b/HDL_ON/Entity/Function/Curtain.cs
@@ -45,6 +45,11 @@
}
if (trait_percent.curValue.ToString() == "{}")
trait_percent.curValue = 0;
+ }
+ string textValue = trait_percent.curValue.ToString();
+ if (textValue == string.Empty)
+ {
+ trait_percent.curValue = 0;
}
return Convert.ToInt32( trait_percent.curValue);
}
diff --git a/HDL_ON/Entity/Function/Fan.cs b/HDL_ON/Entity/Function/Fan.cs
index 030811d..36108ac 100755
--- a/HDL_ON/Entity/Function/Fan.cs
+++ b/HDL_ON/Entity/Function/Fan.cs
@@ -37,6 +37,11 @@
}
if (trait_openLevel.curValue.ToString() == "{}")
trait_openLevel.curValue = 0;
+ }
+ string textValue = trait_openLevel.curValue.ToString();
+ if (textValue == string.Empty)
+ {
+ trait_openLevel.curValue = 0;
}
return Convert.ToInt32(trait_openLevel.curValue);
}
diff --git a/HDL_ON/Entity/Function/Light.cs b/HDL_ON/Entity/Function/Light.cs
index e611406..c3ae4b8 100755
--- a/HDL_ON/Entity/Function/Light.cs
+++ b/HDL_ON/Entity/Function/Light.cs
@@ -48,7 +48,20 @@
if (trait_brightness.curValue.ToString() == "{}")
trait_brightness.curValue = 0;
}
- return Convert.ToInt32(trait_brightness.curValue);
+ try
+ {
+ string textValue = trait_brightness.curValue.ToString();
+ if (textValue == string.Empty)
+ {
+ trait_brightness.curValue = 0;
+ }
+ return Convert.ToInt32(trait_brightness.curValue);
+ }
+ catch
+ {
+ trait_brightness.curValue = 0;
+ return 0;
+ }
}
set
{
diff --git a/HDL_ON/HDL_ON.projitems b/HDL_ON/HDL_ON.projitems
old mode 100755
new mode 100644
index bbc8669..775ff70
--- a/HDL_ON/HDL_ON.projitems
+++ b/HDL_ON/HDL_ON.projitems
@@ -263,6 +263,8 @@
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\SelectPopupDialog.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Common\Utlis\FloorSelectPopupDialog.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UI\UI0-Public\Widget\DiySelectPopupDialog.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPage.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)UI\UI2\FuntionControlView\Light\ColorTureLampPageBLL.cs" />
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)UI\" />
diff --git a/HDL_ON/UI/.DS_Store b/HDL_ON/UI/.DS_Store
index d789a88..5f77575 100755
--- a/HDL_ON/UI/.DS_Store
+++ b/HDL_ON/UI/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
index 21e1102..d4effc2 100755
--- a/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmeblyBLL.cs
@@ -100,8 +100,13 @@
MainPage.BasePageView.AddChidren(a31PlayMusicPage);
a31PlayMusicPage.Show();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
+ break;
+ case FunctionType.ColorTemperature:
+ var TureView = new ColorTureLampPage(function as Light);
+ MainPage.BasePageView.AddChidren(TureView);
+ TureView.LoadPage(btnCollectionIcon, btnName, btnFromFloor);
+ MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
break;
- //case FunctionType
}
};
return eventHandler;
diff --git a/HDL_ON/UI/UI2/.DS_Store b/HDL_ON/UI/UI2/.DS_Store
new file mode 100644
index 0000000..596ed6f
--- /dev/null
+++ b/HDL_ON/UI/UI2/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI2/FuntionControlView/.DS_Store b/HDL_ON/UI/UI2/FuntionControlView/.DS_Store
new file mode 100644
index 0000000..93f01ab
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/.DS_Store
Binary files differ
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
new file mode 100644
index 0000000..63f7030
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPage.cs
@@ -0,0 +1,708 @@
+锘縰sing System;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+
+namespace HDL_ON.UI
+{
+ public partial class ColorTureLampPage : FrameLayout
+ {
+
+ #region 鎺т欢闆嗗悎
+ static ColorTureLampPage bodyView;
+ /// <summary>
+ /// 鎺у埗鐣岄潰鍔犺浇鍖哄煙
+ /// </summary>
+ FrameLayout controlView;
+ /// <summary>
+ /// 鍔熻兘澶囨敞
+ /// </summary>
+ Button btnFunctionName;
+ /// <summary>
+ /// 鍔熻兘鎵�灞炴ゼ灞傘�佹埧闂�
+ /// </summary>
+ Button btnFromFoorAndRoom;
+ /// <summary>
+ /// 鏀惰棌鎸夐挳
+ /// </summary>
+ Button btnCollection;
+ /// <summary>
+ /// 璋冨厜鎺т欢
+ /// </summary>
+ WaveSeekBarOn dimmerBar;
+ /// <summary>
+ /// 浜害鏄剧ず鎸夐挳
+ /// </summary>
+ Button btnBrightnessText;
+ /// <summary>
+ /// 娓愬彉鏃堕棿淇敼
+ /// </summary>
+ DiyImageSeekBar barFadeTime;
+ /// <summary>
+ /// 鑹叉俯鐨勬粦鍔ㄦ帶浠�
+ /// </summary>
+ SeekBarControl barColorTemplatrue;
+ /// <summary>
+ /// 寮�鍏虫寜閽�
+ /// </summary>
+ Button btnSwitch;
+ /// <summary>
+ /// 鑹叉俯蹇嵎鏂瑰紡鎸夐挳
+ /// </summary>
+ Button btnShortcut;
+ #endregion
+
+ #region 鍖哄煙鍙橀噺
+ Light light;
+ 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 ColorTureLampPage(Light func)
+ {
+ bodyView = this;
+ light = func;
+ }
+
+ public void LoadPage(Button btnCollectionIcon, Button btnFunctionNameOut, Button btnFromFloorOut)
+ {
+ btnCollection_Out = btnCollectionIcon;
+ 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);
+
+ controlView = new FrameLayout()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetRealHeight(88),
+ Width = Application.GetRealWidth(327),
+ Height = Application.GetRealHeight(526),
+ BackgroundImagePath = "Public/Fragmentbg.png",
+ };
+ bodyView.AddChidren(controlView);
+
+ btnFunctionName = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(14),
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(37),
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
+ Text = light.name,
+ };
+ controlView.AddChidren(btnFunctionName);
+
+ btnFromFoorAndRoom = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ Y = btnFunctionName.Bottom,
+ Width = Application.GetRealWidth(270),
+ Height = Application.GetRealHeight(21),
+ TextColor = CSS_Color.PromptingColor1,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
+ Text = light.GetRoomListName()
+ };
+ controlView.AddChidren(btnFromFoorAndRoom);
+
+ btnCollection = new Button()
+ {
+ X = Application.GetRealWidth(273),
+ Y = Application.GetRealHeight(14),
+ Width = Application.GetMinRealAverage(40),
+ Height = Application.GetMinRealAverage(40),
+ SelectedImagePath = "Collection/CollectionIcon.png",
+ UnSelectedImagePath = "Collection/CollectionGrayIcon.png",
+ IsSelected = light.collect
+ };
+ //controlView.AddChidren(btnCollection);
+ //2020-12-16 濡傛灉鏄垚鍛橀殣钘忔敹钘忓姛鑳�
+ if (!DB_ResidenceData.Instance.CurrentRegion.IsOthreShare)
+ {
+ controlView.AddChidren(btnCollection);
+ }
+
+ dimmerBar = new WaveSeekBarOn()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Y = Application.GetRealHeight(74 + 16),
+ Width = Application.GetRealWidth(142 - 40),
+ Height = Application.GetRealHeight(222 - 16 - 16),
+ BorderColor = 0x00000000,
+ CornerRadius = Application.GetRealWidth(20),
+ BorderWidth = 0,
+ Progress = light.brightness,
+ IsProgressTextShow = false,
+ };
+ 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(222 - 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 btnTempClolor = new Button();
+ btnTempClolor.X = Application.GetRealWidth(35);
+ btnTempClolor.Y = Application.GetRealHeight(306);
+ btnTempClolor.Width = Application.GetRealWidth(224);
+ btnTempClolor.Height = Application.GetRealHeight(21);
+ btnTempClolor.TextAlignment = TextAlignment.CenterLeft;
+ btnTempClolor.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnTempClolor.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ btnTempClolor.TextID = StringId.ColorTemperature;
+ controlView.AddChidren(btnTempClolor);
+
+ //2700K
+ var btnTempClolorMin = new Button();
+ btnTempClolorMin.Y = btnTempClolor.Bottom + Application.GetRealHeight(9);
+ btnTempClolorMin.Width = Application.GetRealWidth(54);
+ btnTempClolorMin.Height = Application.GetRealHeight(21);
+ btnTempClolorMin.Text = "2700K";
+ btnTempClolorMin.TextAlignment = TextAlignment.CenterRight;
+ btnTempClolorMin.TextColor = CSS_Color.PromptingColor1;
+ btnTempClolorMin.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ controlView.AddChidren(btnTempClolorMin);
+
+ //婊戝姩鏉$殑鑳屾櫙鍥剧墖
+ var btnColorTemplatrueBack = new Button();
+ //闇�瑕佸噺鎺夋粦鍔ㄦ潯鐨勫乏鍙抽棿璺�
+ btnColorTemplatrueBack.Width = Application.GetRealWidth(210 - 20 * 2);
+ btnColorTemplatrueBack.Height = Application.GetRealHeight(8);
+ btnColorTemplatrueBack.Gravity = Gravity.CenterHorizontal;
+ btnColorTemplatrueBack.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatureBar.png";
+ controlView.AddChidren(btnColorTemplatrueBack);
+ //婊戝姩鏉℃帶浠�
+ barColorTemplatrue = new SeekBarControl();
+ barColorTemplatrue.X = btnTempClolorMin.Right;
+ barColorTemplatrue.Y = Application.GetRealHeight(340);
+ barColorTemplatrue.MinValue = 27;
+ barColorTemplatrue.MaxValue = 65;
+ barColorTemplatrue.ProgressBarColor = 0x00000000;//鍏ㄩ儴閫忔槑
+ barColorTemplatrue.ProgressBarUnEnableColor = 0x00000000;
+ barColorTemplatrue.SeekBarBackgroundColor = 0x00000000;
+ controlView.AddChidren(barColorTemplatrue);
+ barColorTemplatrue.Y = btnTempClolorMin.Y - (barColorTemplatrue.Height - btnTempClolorMin.Height) / 2;
+ //鏄剧ず涓婃柟鐨凾xt
+ barColorTemplatrue.ShowCustomTextView(Application.GetRealWidth(50), CSS_FontSize.PromptFontSize_FirstLevel, CSS_Color.FirstLevelTitleColor);
+ //璁剧疆鍒濆鍊�
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+
+ //鍙樻洿鑳屾櫙鍥剧殑Y杞村潗鏍�
+ btnColorTemplatrueBack.Y = barColorTemplatrue.Y + (barColorTemplatrue.Height - btnColorTemplatrueBack.Height) / 2;
+
+ //6500K
+ var btnTempClolorMax = new Button();
+ btnTempClolorMax.Y = btnTempClolorMin.Y;
+ btnTempClolorMax.X = barColorTemplatrue.Right;
+ btnTempClolorMax.Width = Application.GetRealWidth(54);
+ btnTempClolorMax.Height = Application.GetRealHeight(21);
+ btnTempClolorMax.Text = "6500K";
+ btnTempClolorMax.TextAlignment = TextAlignment.CenterLeft;
+ btnTempClolorMax.TextColor = CSS_Color.PromptingColor1;
+ btnTempClolorMax.TextSize = CSS_FontSize.PromptFontSize_FirstLevel;
+ controlView.AddChidren(btnTempClolorMax);
+
+ #endregion
+
+ #region 娓愬彉鏃堕棿璋冭妭
+ 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,
+ };
+ controlView.AddChidren(btnGradualChangeText);
+
+ 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,
+ };
+ controlView.AddChidren(btnGradualChangeMinValuesText);
+
+ 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),
+ };
+ controlView.AddChidren(barFadeTime);
+
+ 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,
+ };
+ controlView.AddChidren(btnGradualChangeMaxValuesText);
+ #endregion
+
+ btnSwitch = new Button()
+ {
+ X = Application.GetRealWidth(184),
+ Y = Application.GetRealHeight(462),
+ Width = Application.GetRealWidth(40),
+ Height = Application.GetRealWidth(40),
+ UnSelectedImagePath = "Public/PowerClose.png",
+ SelectedImagePath = "Public/PowerOpen.png",
+ IsSelected = light.trait_on_off.curValue.ToString() == "on",
+ };
+ controlView.AddChidren(btnSwitch);
+
+ //鑹叉俯鐨勫揩鎹锋柟寮忓浘鏍�
+ btnShortcut = new Button();
+ btnShortcut.X = Application.GetRealWidth(104);
+ btnShortcut.Y = btnSwitch.Y;
+ btnShortcut.Width = Application.GetRealWidth(40);
+ btnShortcut.Height = Application.GetRealWidth(40);
+ btnShortcut.UnSelectedImagePath = "FunctionIcon/Light/ColorTemperatrueQuick.png";
+ controlView.AddChidren(btnShortcut);
+ btnShortcut.MouseUpEventHandler += (sender, e) =>
+ {
+ //鏄剧ず鑹叉俯鐨勫揩鎹锋柟寮忕殑寮圭獥
+ this.ShowColorTemperatrueShortcutView();
+ };
+
+ LoadEventList();
+
+ new TopViewDiv(bodyView, Language.StringByID(StringId.Lights)).LoadTopView_FunctionTop(light, actionRefresh);
+ new System.Threading.Thread(() =>
+ {
+ DriverLayer.Control.Ins.SendReadCommand(light);
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// 鏄剧ず鑹叉俯鐨勫揩鎹锋柟寮忕殑寮圭獥
+ /// </summary>
+ private void ShowColorTemperatrueShortcutView()
+ {
+ //鏁翠釜鐏拌壊鐣岄潰
+ var frameBack = new Dialog();
+ frameBack.Show();
+
+ //鐧借壊鐨勮儗鏅�(鐢ㄥ浘鐗囨暣鐨�)
+ var frameWhite = new FrameLayout();
+ frameWhite.X = Application.GetRealWidth(63);
+ frameWhite.Y = Application.GetRealHeight(350);
+ frameWhite.Width = Application.GetRealWidth(160);
+ frameWhite.Height = Application.GetRealHeight(199);
+ frameWhite.BackgroundImagePath = "FunctionIcon/Light/ColorTemperatrueQuickBack.png";
+ frameBack.AddChidren(frameWhite);
+
+ //蹇嵎璋冭妭
+ var btnAdjust = new Button();
+ btnAdjust.X = Application.GetRealWidth(24);
+ btnAdjust.Y = Application.GetRealHeight(19);
+ btnAdjust.Width = Application.GetRealWidth(80);
+ btnAdjust.Height = Application.GetRealHeight(24);
+ btnAdjust.TextID = StringId.QuickAdjustment;
+ btnAdjust.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnAdjust.TextSize = CSS_FontSize.SubheadingFontSize;
+ frameWhite.AddChidren(btnAdjust);
+ //绾�
+ var btnLine = new Button();
+ btnLine.Y = btnAdjust.Bottom + Application.GetRealHeight(9);
+ btnLine.Height = 1;
+ btnLine.Width = Application.GetRealWidth(112);
+ btnLine.Gravity = Gravity.CenterHorizontal;
+ btnLine.BackgroundColor = CSS_Color.BackgroundColor;
+ frameWhite.AddChidren(btnLine);
+
+ //娓╅Θ鍥炬爣
+ var btnCozyIcon = new Button();
+ btnCozyIcon.X = Application.GetRealWidth(24);
+ btnCozyIcon.Y = btnLine.Bottom + Application.GetRealHeight(10);
+ btnCozyIcon.Width = Application.GetRealWidth(24);
+ btnCozyIcon.Height = Application.GetRealWidth(24);
+ btnCozyIcon.UnSelectedImagePath = "FunctionIcon/Light/CozyIcon.png";
+ frameWhite.AddChidren(btnCozyIcon);
+ btnCozyIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 27;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+ //娓╅Θ 2700k
+ var btnCozy = new Button();
+ btnCozy.X = btnCozyIcon.Right + Application.GetRealWidth(12);
+ btnCozy.Y = btnCozyIcon.Y;
+ btnCozy.Width = Application.GetRealWidth(100);
+ btnCozy.Height = Application.GetRealWidth(24);
+ btnCozy.Text = Language.StringByID(StringId.Cozy) + " 2700K";
+ btnCozy.TextSize = CSS_FontSize.TextFontSize;
+ btnCozy.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnCozy.TextAlignment = TextAlignment.CenterLeft;
+ frameWhite.AddChidren(btnCozy);
+ btnCozy.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 27;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+
+ //浼氬鍥炬爣
+ var btnMeetIcon = new Button();
+ btnMeetIcon.X = Application.GetRealWidth(24);
+ btnMeetIcon.Y = btnCozyIcon.Bottom + Application.GetRealHeight(20);
+ btnMeetIcon.Width = Application.GetRealWidth(24);
+ btnMeetIcon.Height = Application.GetRealWidth(24);
+ btnMeetIcon.UnSelectedImagePath = "FunctionIcon/Light/MeetingGuestsIcon.png";
+ frameWhite.AddChidren(btnMeetIcon);
+ btnMeetIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 30;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+
+ //浼氬 3000k
+ var btnMeet = new Button();
+ btnMeet.X = btnMeetIcon.Right + Application.GetRealWidth(12);
+ btnMeet.Y = btnMeetIcon.Y;
+ btnMeet.Width = Application.GetRealWidth(100);
+ btnMeet.Height = Application.GetRealWidth(24);
+ btnMeet.Text = Language.StringByID(StringId.MeetingGuests) + " 3000K";
+ btnMeet.TextSize = CSS_FontSize.TextFontSize;
+ btnMeet.TextColor = CSS_Color.FirstLevelTitleColor;
+ btnMeet.TextAlignment = TextAlignment.CenterLeft;
+ frameWhite.AddChidren(btnMeet);
+ btnMeet.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 30;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+
+ //闃呰鍥炬爣
+ var btnReadIcon = new Button();
+ btnReadIcon.X = Application.GetRealWidth(24);
+ btnReadIcon.Y = btnMeetIcon.Bottom + Application.GetRealHeight(20);
+ btnReadIcon.Width = Application.GetRealWidth(24);
+ btnReadIcon.Height = Application.GetRealWidth(24);
+ btnReadIcon.UnSelectedImagePath = "FunctionIcon/Light/ReadIcon.png";
+ frameWhite.AddChidren(btnReadIcon);
+ btnReadIcon.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 65;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+ //闃呰 6500k
+ var btnRead = new Button();
+ btnRead.X = btnReadIcon.Right + Application.GetRealWidth(12);
+ btnRead.Y = btnReadIcon.Y;
+ btnRead.Width = Application.GetRealWidth(100);
+ btnRead.Height = Application.GetRealWidth(24);
+ btnRead.Text = Language.StringByID(StringId.Reading) + " 6500K";
+ btnRead.TextSize = CSS_FontSize.TextFontSize;
+ btnRead.TextColor = CSS_Color.MainColor;
+ btnRead.TextAlignment = TextAlignment.CenterLeft;
+ frameWhite.AddChidren(btnRead);
+ btnRead.MouseUpEventHandler += (sender, e) =>
+ {
+ barColorTemplatrue.Progress = 65;
+ barColorTemplatrue.SetCustomText(barColorTemplatrue.Progress * 100 + "K");
+ frameBack.Close();
+ };
+ }
+
+ /// <summary>
+ /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
+ /// </summary>
+ private class SeekBarControl : DiyImageSeekBar
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// 杩涘害鍊兼敼鍙�,濡傛灉瑕佽缃垵濮嬭繘搴﹀��,姝ゅ彉閲忚鍦ㄨ缃垵濮嬭繘搴﹀�间箣鍓嶈繘琛岃缃�(绗竴涓弬鏁�0:婊戝姩鐨勬椂鍊�,1:鎵嬫寚寮硅捣鐨勬椂鍊�)
+ /// </summary>
+ public Action<int, int> ProgressChangedEvent = null;
+ /// <summary>
+ /// 杩涘害鏉″彲鐢ㄦ椂鐨勮儗鏅壊
+ /// </summary>
+ private uint ProgressBarEnableColor = 0;
+ /// <summary>
+ /// 杩涘害鏉′笉鍙敤鏃剁殑鑳屾櫙鑹�(榛樿鐏拌壊)
+ /// </summary>
+ public uint ProgressBarUnEnableColor = 0xffe8e8e8;
+ /// <summary>
+ /// 褰撳墠鍙敤鐘舵��
+ /// </summary>
+ private bool nowEnable = true;
+ /// <summary>
+ /// 鎺т欢鑳藉惁浣跨敤
+ /// </summary>
+ public new bool Enable
+ {
+ set
+ {
+ //鐘舵�佹病鏈夋敼鍙�
+ if (nowEnable == value) { return; }
+ nowEnable = value;
+
+ this.IsClickable = value;
+ if (value == true)
+ {
+ //鍘熸潵鐨勯鑹�
+ base.ProgressBarColor = ProgressBarEnableColor;
+ }
+ else
+ {
+ //鐏拌壊
+ base.ProgressBarColor = ProgressBarUnEnableColor;
+ }
+ }
+ }
+
+ /// <summary>
+ /// 杩涘害鏉¢鑹�
+ /// </summary>
+ public new uint ProgressBarColor
+ {
+ set
+ {
+ ProgressBarEnableColor = value;
+ base.ProgressBarColor = value;
+ }
+ }
+
+ private int m_SeekBarPadding = Application.GetRealWidth(20);
+ /// <summary>
+ /// 杩涘害鏉′笌宸﹀彸涓よ竟鐨勮竟妗嗙殑杈硅窛(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new int SeekBarPadding
+ {
+ set
+ {
+ m_SeekBarPadding = value;
+ base.SeekBarPadding = value;
+ }
+ }
+
+ private int m_MaxValue = 0;
+ /// <summary>
+ /// 杩涘害鏉℃渶澶у��(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new int MaxValue
+ {
+ set
+ {
+ m_MaxValue = value;
+ base.MaxValue = value;
+ }
+ }
+
+ private int m_MinValue = 0;
+ /// <summary>
+ /// 杩涘害鏉℃渶灏忓��(閲嶅啓搴曞眰灞炴��)
+ /// </summary>
+ public new int MinValue
+ {
+ set
+ {
+ m_MinValue = value;
+ base.MinValue = value;
+ }
+ }
+ /// <summary>
+ /// 涓婃柟鏄剧ず鐨勬枃鏈�
+ /// </summary>
+ private Button btnTopView = null;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
+ /// </summary>
+ /// <param name="i_width">瀹藉害,闈炵湡瀹炲��</param>
+ public SeekBarControl(int i_width = 210)
+ {
+ this.Width = Application.GetRealWidth(i_width);
+ this.Height = Application.GetRealHeight(54);
+ //鍦嗙悆鐨勫搴�
+ this.ThumbImageHeight = Application.GetRealHeight(54);
+ this.ThumbImagePath = "Public/ThumbImage.png";
+ //杩涘害鏉$殑瀹藉害
+ this.SeekBarViewHeight = Application.GetRealHeight(8);
+ //涓婃柟鏄惁鏄剧ず鏂囨湰
+ this.IsProgressTextShow = false;
+ this.Gravity = Gravity.CenterHorizontal;
+ //杩涘害鏉¢鑹�
+ this.ProgressBarColor = CSS_Color.MainColor;
+ //宸﹀彸杈硅窛
+ this.SeekBarPadding = Application.GetRealWidth(20);
+
+ //杩涘害鏉″�兼敼鍙樹簨浠�
+ this.OnProgressChangedEvent += this.MyProgressChangedEvent;
+ //鎵嬫寚寮硅捣浜嬩欢
+ this.OnStopTrackingTouchEvent += this.MyStopTrackingTouchEvent;
+ }
+
+ #endregion
+
+ #region 鈻� 浜嬩欢_______________________________
+
+ /// <summary>
+ /// 杩涘害鏉″�兼敼鍙樹簨浠�
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="value"></param>
+ private void MyProgressChangedEvent(object sender, int value)
+ {
+ if (this.ProgressChangedEvent == null)
+ {
+ this.OnProgressChangedEvent -= this.MyProgressChangedEvent;
+ return;
+ }
+
+ this.ProgressChangedEvent(0, value);
+ }
+
+ /// <summary>
+ /// 鎵嬫寚寮硅捣浜嬩欢
+ /// </summary>
+ /// <param name="sender"></param>
+ /// <param name="value"></param>
+ private void MyStopTrackingTouchEvent(object sender, int value)
+ {
+ if (this.ProgressChangedEvent == null)
+ {
+ this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
+ return;
+ }
+ //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
+ this.ProgressChangedEvent(1, value);
+ }
+
+ #endregion
+
+ #region 鈻� 鑷畾涔変笂鏂规樉绀烘枃鏈琠________________
+
+ /// <summary>
+ /// 鍦ㄤ笂鏂规樉绀鸿嚜瀹氫箟鏂囨湰
+ /// </summary>
+ /// <param name="i_width">瀹藉害(鐪熷疄鍊�)</param>
+ /// <param name="textSize">鏂囧瓧澶у皬</param>
+ /// <param name="textColor">鏂囧瓧棰滆壊</param>
+ public void ShowCustomTextView(int i_width, int textSize, uint textColor)
+ {
+ if (this.btnTopView != null) { return; }
+
+ int contrHeight = Application.GetRealHeight(24);
+ this.btnTopView = new Button();
+ btnTopView.Width = i_width;
+ btnTopView.Height = contrHeight;
+ btnTopView.TextColor = textColor;
+ btnTopView.TextSize = textSize;
+ btnTopView.TextAlignment = TextAlignment.Center;
+ btnTopView.Y = this.Y - contrHeight + Application.GetRealHeight(20);
+ //鍒濆鍖栨椂,X杞村彲浠ヤ笉鐢ㄧ悊浼�
+
+ this.Parent.AddChidren(btnTopView);
+ }
+
+ /// <summary>
+ /// 璁剧疆鑷畾涔夋枃鏈俊鎭�
+ /// </summary>
+ /// <param name="i_text"></param>
+ public void SetCustomText(string i_text)
+ {
+ if (this.btnTopView == null) { return; }
+
+ this.btnTopView.Text = i_text;
+ //婊戞潯鏈�宸﹁竟鐨勮窛绂�
+ int XX = this.X + this.m_SeekBarPadding;
+ //褰撳墠婊戞潯鎵�鍦ㄧ殑澶ц嚧鐧惧垎姣�
+ int tempValue = this.Progress - this.m_MinValue;
+ if (tempValue < 0) { tempValue = 0; }
+ decimal persent = (decimal)tempValue / (this.m_MaxValue - this.m_MinValue);
+ //褰撳墠婊戞潯鎵�鍦ㄧ殑澶ц嚧浣嶇疆
+ XX += (int)((this.Width - this.m_SeekBarPadding * 2) * persent);
+ //鍥犱负瑕佸眳涓�,鎵�浠ュ噺鎺夎嚜瀹氫箟鎺т欢鐨勫搴︾殑涓�鑸�
+ XX = XX - this.btnTopView.Width / 2;
+
+ this.btnTopView.X = XX;
+ }
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 鎺т欢鎽ф瘉
+ /// </summary>
+ public override void RemoveFromParent()
+ {
+ this.ProgressChangedEvent = null;
+ base.RemoveFromParent();
+ }
+
+ #endregion
+ }
+ }
+}
diff --git a/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
new file mode 100755
index 0000000..3ac7385
--- /dev/null
+++ b/HDL_ON/UI/UI2/FuntionControlView/Light/ColorTureLampPageBLL.cs
@@ -0,0 +1,189 @@
+锘縰sing System;
+using HDL_ON.DriverLayer;
+using HDL_ON.Entity;
+using HDL_ON.UI.CSS;
+using Shared;
+namespace HDL_ON.UI
+{
+ public partial class ColorTureLampPage
+ {
+ /// <summary>
+ /// 鏇存柊鍔熻兘鐘舵��
+ /// </summary>
+ public static void UpdataStates(Light uFunction)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ try
+ {
+ if (bodyView == null)
+ return;
+ if (uFunction.functionType == bodyView.light.functionType && uFunction.sid == bodyView.light.sid)
+ {
+
+ if (uFunction.trait_on_off.curValue.ToString() == "on")
+ {
+ bodyView.dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
+ if (!bodyView.onDimmerBar)
+ {
+ bodyView.dimmerBar.Progress = uFunction.brightness;
+ }
+ bodyView.btnBrightnessText.Text = uFunction.brightness + "%";
+ bodyView.btnBrightnessText.Y = ((100 - uFunction.brightness) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40);
+ }
+ else
+ {
+ bodyView.dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
+ }
+ bodyView.btnSwitch.IsSelected = uFunction.trait_on_off.curValue.ToString() == "on";
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"{bodyView.GetType().Name } UpdataStates error : {ex.Message}");
+ }
+ });
+ }
+
+ void LoadEventList()
+ {
+ LoadSwitchEvent();
+ LoadCollectionEvent();
+ LoadEvent_DimmerBar();
+ LoadEvet_ChangeFadeTime();
+ LoadEvet_ChangeColorTemplatrue();
+ //鍥為��鍒锋柊淇℃伅浜嬩欢
+ actionRefresh = () => {
+ btnFunctionName.Text = btnFunctionName_Out.Text = light.name;
+ btnFromFloor_Out.Text = btnFromFoorAndRoom.Text = light.GetRoomListName();
+ //light.SaveFunctionData(true);
+ };
+ }
+ /// <summary>
+ /// 淇敼鐏厜娓愬彉鏃堕棿
+ /// </summary>
+ void LoadEvet_ChangeFadeTime()
+ {
+ barFadeTime.OnProgressChangedEvent = (sender, e) =>
+ {
+ light.fadeTime = e;
+ light.SaveFunctionData(true);
+ };
+ }
+
+ /// <summary>
+ /// 淇敼鑹叉俯
+ /// </summary>
+ void LoadEvet_ChangeColorTemplatrue()
+ {
+ barColorTemplatrue.OnProgressChangedEvent += (sender, value) =>
+ {
+ //璁剧疆鑷畾涔夌殑鏂囨湰
+ barColorTemplatrue.SetCustomText(value * 100 + "K");
+ };
+ }
+
+ /// <summary>
+ /// 鏀惰棌鍔熻兘鎸夐挳浜嬩欢
+ /// </summary>
+ void LoadCollectionEvent()
+ {
+ btnCollection.MouseUpEventHandler += (sender, e) => {
+ btnCollection.IsSelected = light.collect = btnCollection_Out.IsSelected = !btnCollection.IsSelected;
+ light.SaveFunctionData(true);
+ };
+ }
+
+ /// <summary>
+ /// 鐏厜璋冨厜浜嬩欢
+ /// </summary>
+ void LoadEvent_DimmerBar()
+ {
+ dimmerBar.OnStartTrackingTouchEvent = (sender, e) => {
+ onDimmerBar = true;
+ };
+ dimmerBar.OnStopTrackingTouchEvent = (sender, e) => {
+ onDimmerBar = false;
+ light.brightness = dimmerBar.Progress;
+ //Control.Send(CommandType_A.write, light);
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
+ Control.Ins.SendWriteCommand(light, d);
+ light.fadeTime = barFadeTime.Progress;
+ };
+ dimmerBar.OnProgressChangedEvent = (sender, e) => {
+ light.fadeTime = 0;
+ if (!btnSwitch.IsSelected)
+ {
+ dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
+ }
+ btnSwitch.IsSelected = e > 0 ? true : false;
+ light.brightness = e;
+ light.trait_on_off.curValue = e > 0 ? "on" : "off";
+
+ if (e == 0 || e == 100)
+ {
+ //Control.Send(CommandType_A.write, this.light);
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
+ Control.Ins.SendWriteCommand(light, d);
+ }
+ else
+ {
+ if (200 < (DateTime.Now - light.refreshTime).TotalMilliseconds)
+ {
+ light.refreshTime = DateTime.Now;
+ new System.Threading.Thread(() =>
+ {
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.Brightness, light.brightness.ToString());
+ Control.Ins.SendWriteCommand(light, d);
+ })
+ { IsBackground = true }.Start();
+ }
+ }
+
+ btnBrightnessText.Y = ((100 - dimmerBar.Progress) * Application.GetRealHeight(222 - 16 - 16) / 100) + Application.GetRealWidth(40);
+ btnBrightnessText.Text = light.brightness + "%";
+ };
+ }
+
+ /// <summary>
+ /// 鍔犺浇寮�鍏充簨浠�
+ /// </summary>
+ void LoadSwitchEvent()
+ {
+ btnSwitch.MouseUpEventHandler += (sender, e) =>
+ {
+ light.fadeTime = barFadeTime.Progress;
+ btnSwitch.IsSelected = !btnSwitch.IsSelected;
+ if (btnSwitch.IsSelected)
+ {
+ dimmerBar.SetProgressBarColors(CSS_Color.AuxiliaryColor1, CSS_Color.AuxiliaryColor1);
+ }
+ else
+ {
+ dimmerBar.SetProgressBarColors(CSS_Color.DividingLineColor, CSS_Color.DividingLineColor);
+ }
+ new System.Threading.Thread(() =>
+ {
+ light.trait_on_off.curValue = btnSwitch.IsSelected ? "on" : "off";
+ System.Collections.Generic.Dictionary<string, string> d = new System.Collections.Generic.Dictionary<string, string>();
+ d.Add(FunctionAttributeKey.OnOff, light.trait_on_off.curValue.ToString());
+ if (btnSwitch.IsSelected)
+ {
+ d.Add(FunctionAttributeKey.Brightness, light.lastBrightness.ToString());
+ }
+ else
+ {
+ light.lastBrightness = light.brightness;
+ }
+ Control.Ins.SendWriteCommand(light, d);
+ })
+ { IsBackground = true }.Start();
+ };
+
+ }
+
+ }
+}
--
Gitblit v1.8.0