From 3fcb73db484d2bed5ee993702913a7eaea68068c Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 18 八月 2023 18:01:23 +0800
Subject: [PATCH] 2.1.2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs | 124 +++++++++++++++++++++++++++++++++++++++-
1 files changed, 119 insertions(+), 5 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
index 3518292..623df1d 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/TargetDeviceFunList.cs
@@ -56,6 +56,88 @@
#region 缂栬緫璁惧鐘舵��
switch (device.spk)
{
+ //缇ゆ帶
+ case SPK.GroupControl:
+ int height = Application.GetRealHeight(50);
+ int attributesNameId=0;
+ int count = 0;
+ foreach (var attr in (device as GroupControl).attributes)
+ {
+ if (attr.key == FunctionAttributeKey.OnOff ||
+ attr.key == FunctionAttributeKey.Brightness ||
+ attr.key == FunctionAttributeKey.CCT ||
+ attr.key == FunctionAttributeKey.RGB ||
+ attr.key == FunctionAttributeKey.Colorful)
+ {
+ LogicView.FunTypeView view = new LogicView.FunTypeView();
+ view.btnState.Name = "缇ゆ帶";
+ view.frameLayout.Y = count * height;
+ fLayout.AddChidren(view.FLayoutView());
+ count++;
+ switch (attr.key)
+ {
+ case FunctionAttributeKey.OnOff:
+ attributesNameId = StringId.switchLogic;
+ ///寮�鍏崇偣鍑讳簨浠�
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ SwitchViewMethod(device, view.btnState, 2);
+ };
+ break;
+ case FunctionAttributeKey.Brightness:
+ attributesNameId = StringId.brightnesLogic;
+ view.btnState.Text = "5%";//浜у搧缁忕悊鏅撹緣瑕佹眰鏀圭殑 2021-11-06
+ ///浜害鐐瑰嚮浜嬩欢
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ BrightnessMethod(device, view.btnState, view.btnText.Text);
+
+ };
+ break;
+ case FunctionAttributeKey.CCT:
+ attributesNameId = StringId.ColorTemperature;
+ ///鑹叉俯鐐瑰嚮浜嬩欢
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ ColorTemperatureMethod(device, view.btnState, view.btnText.Text);
+
+ };
+ break;
+ case FunctionAttributeKey.RGB:
+ attributesNameId = StringId.rgbsepan;
+ view.btnState.Tag = "";
+ view.btnState.Width = Application.GetRealWidth(16);
+ view.btnState.Height = Application.GetRealWidth(16);
+ view.btnState.Radius = (uint)Application.GetRealWidth(8);
+ view.btnState.X = Application.GetRealWidth(375 - 48 - 16);
+ ///RGB鑹茬洏鐐瑰嚮浜嬩欢
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ RgbColorDiskMethod(device, view.btnState, view.btnText.Text);
+ };
+ break;
+ case FunctionAttributeKey.Colorful:
+ attributesNameId = StringId.ColorfulFunction;
+ view.btnState.Name = "colorful";
+ ///寮�鍏崇偣鍑讳簨浠�
+ view.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ SwitchViewMethod(device, view.btnState, 2);
+ };
+ break;
+ }
+ view.btnText.TextID = attributesNameId;
+ if (edit)
+ {
+ //鏄剧ず缂栬緫涔嬪墠鐨勮澶囩姸鎬�
+ GetEditDeviceState(device, index, view.btnState, null, null, null, attr.key);
+ }
+ }
+ }
+
+ //璁惧寤舵椂iewv
+ DelayView(fLayout, height* count);
+ break;
//鎻掑骇(鏈塙SB)
case SPK.PanelSocket:
{
@@ -81,6 +163,21 @@
}
#endregion
}
+ break;
+ case SPK.CommonSeries:
+ #region 鐣岄潰
+ ///寮�鍏�
+ LogicView.FunTypeView SerriesSwitchView = new LogicView.FunTypeView();
+ SerriesSwitchView.btnText.TextID = StringId.switchLogic;
+ fLayout.AddChidren(SerriesSwitchView.FLayoutView());
+
+ #endregion
+ ///寮�鍏崇偣鍑讳簨浠�
+ SerriesSwitchView.btnClick.MouseUpEventHandler += (sender, e) =>
+ {
+ SwitchViewMethod(device, SerriesSwitchView.btnState, 2);
+ };
+
break;
//寮�鍏崇伅鍏�
case SPK.AirSwitch:
@@ -168,8 +265,7 @@
///RGB鑹茬洏
LogicView.FunTypeView rgbView = new LogicView.FunTypeView();
rgbView.frameLayout.Y = brightnessView.frameLayout.Bottom;
- //rgbView.btnText.TextID = StringId.brightnesLogic;
- rgbView.btnText.Text= "RGB鑹茬洏";
+ rgbView.btnText.TextID = StringId.rgbsepan;
rgbView.btnState.Tag = "";
rgbView.btnState.Width = Application.GetRealWidth(16);
rgbView.btnState.Height = Application.GetRealWidth(16);
@@ -806,6 +902,11 @@
}
}
break;
+ case SPK.GroupControl:
+ {
+ outputDevice.target_type = "5";
+ }
+ break;
}
outputDevice.status.AddRange(dicSateteList);
@@ -920,6 +1021,15 @@
}
}
break;
+ case SPK.GroupControl:
+ {
+ if (button.Name == "colorful")
+ {
+ keyVlaue = "colorful";
+ }
+
+ }
+ break;
}
//鏁版嵁灏佽
AddDictionary(keyVlaue, strValue);
@@ -951,6 +1061,7 @@
case SPK.LightRGB:
case SPK.LightRGBW:
case SPK.LightCCT:
+ case SPK.GroupControl:
{
keyVlaue = "brightness";
}
@@ -995,6 +1106,7 @@
switch (device.spk)
{
case SPK.LightCCT:
+ case SPK.GroupControl:
{
keyVlaue = "cct";
}
@@ -1028,6 +1140,7 @@
switch (device.spk)
{
case SPK.LightRGB:
+ case SPK.GroupControl:
{
keyVlaue = "rgb";
}
@@ -1044,7 +1157,7 @@
}
-
+
/// <summary>
@@ -1056,7 +1169,8 @@
/// <param name="button2">鏄剧ずBtn</param>
/// <param name="button3">鏄剧ずBtn</param>
/// <param name="button4">鏄剧ずBtn</param>
- private void GetEditDeviceState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4)
+ /// <param name="attribute">灞炴�ey</param>
+ private void GetEditDeviceState(Entity.Function device, int index, Button button1, Button button2, Button button3, Button button4, string attribute="")
{
Output outputs = Logic.currlogic.output[index];
var dicList = outputs.status;
@@ -1073,7 +1187,7 @@
this.btnDelay.Text = outputs.delay + "s";
this.strdelay = outputs.delay;
}
- InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4);
+ InpOrOutLogicMethod.Current.EditDeviceState(device, dicList, button1, button2, button3, button4, attribute);
}
/// <summary>
/// 娣诲姞閫変腑鏁版嵁
--
Gitblit v1.8.0