From 6eb21769c74cfcd10084f73ff3f212355849a3c7 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 17 五月 2021 15:00:13 +0800
Subject: [PATCH] 2021-5-17-2
---
HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs | 89 ++++++++------------------------------------
1 files changed, 16 insertions(+), 73 deletions(-)
diff --git a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
index fca082a..d185e19 100644
--- a/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
+++ b/HDL_ON/UI/UI2/3-Intelligence/Automation/AddTarget.cs
@@ -46,11 +46,12 @@
LogicView.SelectTypeView delayView = new LogicView.SelectTypeView();
delayView.frameLayout.Y = sceneView.frameLayout.Bottom;
delayView.btnText.TextID = StringId.delayLogic;
- delayView.btnIcon.UnSelectedImagePath = "LogicIcon/delayed.png";
+ delayView.btnIcon.UnSelectedImagePath = "LogicIcon/time.png";
//viewLayout.AddChidren(delayView.FLayoutView());
#endregion
#region 鎵�鏈夌偣鍑讳簨浠�
+ //鍔熻兘鐐瑰嚮浜嬩欢
functionView.btnClick.MouseUpEventHandler += (sen, e) =>
{
FunTpye funTpye = new FunTpye();
@@ -59,18 +60,12 @@
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
};
-
+ //鍦烘櫙鐐瑰嚮浜嬩欢
sceneView.btnClick.MouseUpEventHandler += (sen, e) =>
{
-
- FrameLayout fLayout = new FrameLayout
- {
- BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
- };
- this.AddChidren(fLayout);
- SceneMethod(fLayout);
+ SceneMethod();
};
-
+ //寤舵椂鐐瑰嚮浜嬩欢
delayView.btnClick.MouseUpEventHandler += (sen, e) =>
{
@@ -88,82 +83,30 @@
/// <summary>
/// 娣诲姞鍦烘櫙
/// </summary>
- /// <param name="fLayout">寮规涓绘帶浠�</param>
- public void SceneMethod(FrameLayout fLayout)
+ public void SceneMethod()
{
- LogicView.DateView dateView = new LogicView.DateView();
- dateView.btnTitle.TextID = StringId.addSceneLogic;
- dateView.FLayoutView(fLayout, 5);
- dateView.btnCancel.MouseUpEventHandler += (sender2, e2) =>
- {
- fLayout.RemoveFromParent();
- };
- VerticalRefreshLayout verticalRefresh = new VerticalRefreshLayout
- {
- Y = Application.GetRealHeight(56),
- Height = Application.GetRealHeight(50 * 5),
-
- };
- dateView.frameLayout.AddChidren(verticalRefresh);
- //瀹氫箟涓�涓眬閮ㄥ彉閲忚褰曢�変腑鐘舵��
- Button buttonClick = new Button();
- HDL_ON.Entity.Scene sceneSelecetd = null;
var sceneList = LogicMethod.GetSceneList();
- verticalRefresh.BeginHeaderRefreshingAction += () =>
- {
- //鍏抽棴鍒锋柊View锛�
- verticalRefresh.EndHeaderRefreshing();
- };
- for (int i = 0; i < sceneList.Count; i++)
- {
+ List<string> nameList = new List<string>();
+ for (int i = 0; i < sceneList.Count; i++) {
var scene = sceneList[i];
- LogicView.SelectTypeView sceneView = new LogicView.SelectTypeView();
- sceneView.frameLayout.BackgroundColor = CSS.CSS_Color.viewTranslucence;
- sceneView.btnIcon.Visible = false;
- sceneView.btnText.X = Application.GetRealWidth(20);
- sceneView.btnText.Text = scene.name;
- sceneView.btnLine.X = Application.GetRealWidth(20);
- sceneView.btnLine.Width = Application.GetRealWidth(303);
- sceneView.btnNextIcon.X = Application.GetRealWidth(303);
- sceneView.btnNextIcon.Width = Application.GetMinRealAverage(28);
- sceneView.btnNextIcon.Height = Application.GetMinRealAverage(28);
- sceneView.btnNextIcon.UnSelectedImagePath = "LogicIcon/weekoff.png";
- sceneView.btnNextIcon.SelectedImagePath = "LogicIcon/weekon.png";
- verticalRefresh.AddChidren(sceneView.FLayoutView());
- sceneView.btnClick.Tag = scene;//鏍囪绱㈠紩
-
- //鍦烘櫙鐨勭偣鍑讳簨浠�
- sceneView.btnClick.MouseUpEventHandler += (sender, e) =>
- {
- buttonClick.IsSelected = false;
- sceneView.btnNextIcon.IsSelected = true;
- buttonClick = sceneView.btnNextIcon;
- sceneSelecetd =sceneView.btnClick.Tag as HDL_ON.Entity.Scene;
- };
-
+ nameList.Add(scene.name);
}
- //纭鐐瑰嚮浜嬩欢
- dateView.btnConfirm.MouseUpEventHandler += (sender1, e1) =>
+ PublicInterface publicInterface = new PublicInterface();
+ publicInterface.FrameOrVv(this, nameList, StringId.addSceneLogic, (index) =>
{
- if (sceneSelecetd == null)
- {
- //鎻愮ず锛氳繕娌¢�変腑鎵ц鍛ㄦ湡
- return;
- }
+ var sceneSelecetd = sceneList[index];
Output outputDevice = new Output();
outputDevice.target_type = "2";
outputDevice.sid = sceneSelecetd.sid;
- //娌″暐浣滅敤锛屼负浜嗘暟鎹牸寮忕粺涓�,鍙戦�佹椂涓嶅啀鍒ゆ柇
- outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "scene"},{ "value", "0" } } };
+ //娌″暐浣滅敤锛屼负浜嗗彂閫佹暟鎹牸寮忕粺涓�;
+ outputDevice.status = new List<Dictionary<string, string>> { new Dictionary<string, string> { { "key", "scene" }, { "value", "0" } } };
AddOutput(outputDevice);
- fLayout.RemoveFromParent();
LogicMethod.RemoveAllView();
AddLogic addLogic = new AddLogic();
MainPage.BasePageView.AddChidren(addLogic);
addLogic.Show();
MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
- };
-
+ });
}
/// <summary>
@@ -200,7 +143,7 @@
foreach (var dic in dicList)
{
string timeValue = dic["value"];
- int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList0());
+ int hIndex = timePointView.GetValueIndex(timeValue, 0, 1, timePointView.GethIntList());
int mIndex = timePointView.GetValueIndex(timeValue, 1, 0, timePointView.GetmIntList());
//鏇存柊鍒濆鐘舵��
timePointView.mUIPickerView.setCurrentItems(hIndex, mIndex, 0);
--
Gitblit v1.8.0