From 32ad85a377b00bc54ad7f15a45d7631d3e2b10d5 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期一, 13 六月 2022 17:41:12 +0800
Subject: [PATCH] 2022年06月13日17:39:46
---
HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs | 233 ++++++++++++++++++++++++++++++---------------------------
1 files changed, 122 insertions(+), 111 deletions(-)
diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
index 83c900a..7f04f4e 100644
--- a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
+++ b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
@@ -145,7 +145,7 @@
{
continue;
}
- if (!string.IsNullOrEmpty(roomId) && roomId == "ALLSELECT")
+ if (!string.IsNullOrEmpty(roomId) && roomId != "ALLSELECT")
{
if (!function.roomIds.Contains(roomId))
{
@@ -157,7 +157,7 @@
tempStatus.Add(new SecurityOutputStatus() { key = FunctionAttributeKey.OnOff, value = "on" });
allocatedList.Add(new SecurityOutput
{
- target_type = "0",
+ target_type = "1",
sid = function.sid,
status = tempStatus,
name = function.name,
@@ -172,7 +172,7 @@
{
continue;
}
- if (!string.IsNullOrEmpty(roomId))
+ if (!string.IsNullOrEmpty(roomId) && roomId != "ALLSELECT")
{
if (!scene.roomIds.Contains(roomId))
{
@@ -184,7 +184,7 @@
tempStatus.Add(new SecurityOutputStatus() { key = "value", value = "0" });
allocatedList.Add(new SecurityOutput
{
- target_type = "1",
+ target_type = "2",
sid = scene.sid,
status = tempStatus,
name = scene.name,
@@ -202,121 +202,131 @@
void LoadFunctionListRow()
{
functionListView.RemoveAll();
- foreach (var function in allocatedList)
+ new System.Threading.Thread(() =>
{
- //var output = alarm.output.Find((obj) => obj.sid == function.sid);
- //if (output == null)
- //{
- // output = new SecurityOutput();
- // output.sid = function.sid;
- //}
-
- FrameLayout functionRow = new FrameLayout()
+ System.Threading.Thread.Sleep(50);
+ Application.RunOnMainThread(() =>
{
- Height = Application.GetRealHeight(65),
- BackgroundColor = CSS_Color.MainBackgroundColor,
- };
- functionListView.AddChidren(functionRow);
- var btnFunctionName = new Button()
- {
- X = Application.GetRealWidth(16),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(44),
- Text = function.name,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.FirstLevelTitleColor,
- TextSize = CSS_FontSize.TextFontSize,
- };
- functionRow.AddChidren(btnFunctionName);
-
- var btnFunctionFloorName = new Button()
- {
- X = Application.GetRealWidth(16),
- Y = Application.GetRealHeight(24),
- Width = Application.GetRealWidth(200),
- Height = Application.GetRealHeight(41),
- Text = function.RoomName,
- TextAlignment = TextAlignment.CenterLeft,
- TextColor = CSS_Color.PromptingColor1,
- TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
- };
- functionRow.AddChidren(btnFunctionFloorName);
-
- Button btnState = new Button()
- {
- Width = Application.GetRealWidth(317),
- TextAlignment = TextAlignment.CenterRight,
- TextSize = CSS_FontSize.TextFontSize,
- TextColor = CSS_Color.PromptingColor1,
- Text = function.StateText()
- };
- functionRow.AddChidren(btnState);
-
- Button btnChooseIcon = new Button()
- {
- X = Application.GetRealWidth(333),
- Gravity = Gravity.CenterVertical,
- Width = Application.GetMinRealAverage(32),
- Height = Application.GetMinRealAverage(32),
- UnSelectedImagePath = "Public/ChooseIcon.png",
- SelectedImagePath = "Public/ChooseOnIcon.png",
- };
- functionRow.AddChidren(btnChooseIcon);
-
- btnChooseIcon.MouseUpEventHandler = (sender, e) => {
- btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected;
- var tempLocal = alarm.output.Find((obj) =>
- obj.sid == function.sid
- );
- //if (tempLocal == null && !string.IsNullOrEmpty(output.spk))
- //{
- // ShowStateDialog(output, btnState, btnChooseIcon);
- //}
- if (btnChooseIcon.IsSelected)
+ foreach (var function in allocatedList)
{
- if (tempLocal == null)
- alarm.output.Add(function);
- ShowStateDialog(function, btnState, btnChooseIcon);
- }
- else
- {
- if (tempLocal != null)
+ //var output = alarm.output.Find((obj) => obj.sid == function.sid);
+ //if (output == null)
+ //{
+ // output = new SecurityOutput();
+ // output.sid = function.sid;
+ //}
+
+ FrameLayout functionRow = new FrameLayout()
{
- alarm.output.Remove(function);
+ Height = Application.GetRealHeight(65),
+ BackgroundColor = CSS_Color.MainBackgroundColor,
+ };
+ functionListView.AddChidren(functionRow);
+
+ var btnFunctionName = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(44),
+ Text = function.name,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.FirstLevelTitleColor,
+ TextSize = CSS_FontSize.TextFontSize,
+ };
+ functionRow.AddChidren(btnFunctionName);
+
+ var btnFunctionFloorName = new Button()
+ {
+ X = Application.GetRealWidth(16),
+ Y = Application.GetRealHeight(24),
+ Width = Application.GetRealWidth(200),
+ Height = Application.GetRealHeight(41),
+ Text = function.RoomName,
+ TextAlignment = TextAlignment.CenterLeft,
+ TextColor = CSS_Color.PromptingColor1,
+ TextSize = CSS_FontSize.PromptFontSize_SecondaryLevel,
+ };
+ functionRow.AddChidren(btnFunctionFloorName);
+
+ Button btnState = new Button()
+ {
+ Width = Application.GetRealWidth(317),
+ TextAlignment = TextAlignment.CenterRight,
+ TextSize = CSS_FontSize.TextFontSize,
+ TextColor = CSS_Color.PromptingColor1,
+ Text = function.StateText()
+ };
+ functionRow.AddChidren(btnState);
+
+ Button btnChooseIcon = new Button()
+ {
+ X = Application.GetRealWidth(333),
+ Gravity = Gravity.CenterVertical,
+ Width = Application.GetMinRealAverage(32),
+ Height = Application.GetMinRealAverage(32),
+ UnSelectedImagePath = "Public/ChooseIcon.png",
+ SelectedImagePath = "Public/ChooseOnIcon.png",
+ };
+ functionRow.AddChidren(btnChooseIcon);
+
+ btnChooseIcon.MouseUpEventHandler = (sender, e) =>
+ {
+ btnChooseIcon.IsSelected = !btnChooseIcon.IsSelected;
+ var tempLocal = alarm.output.Find((obj) =>
+ obj.sid == function.sid
+ );
+ //if (tempLocal == null && !string.IsNullOrEmpty(output.spk))
+ //{
+ // ShowStateDialog(output, btnState, btnChooseIcon);
+ //}
+ if (btnChooseIcon.IsSelected)
+ {
+ if (tempLocal == null)
+ alarm.output.Add(function);
+ ShowStateDialog(function, btnState, btnChooseIcon);
+ }
+ else
+ {
+ if (tempLocal != null)
+ {
+ alarm.output.Remove(function);
+ }
+ }
+ };
+ btnState.MouseUpEventHandler = (sender, e) =>
+ {
+ btnChooseIcon.IsSelected = true;
+ var tempLocal = alarm.output.Find((obj) =>
+ obj.sid == function.sid
+ );
+ if (tempLocal == null)
+ alarm.output.Add(function);
+ ShowStateDialog(function, btnState, btnChooseIcon);
+ };
+
+ var localOutput = alarm.output.Find((obj) => obj.sid == function.sid);
+
+ if (localOutput != null)
+ {
+ btnChooseIcon.IsSelected = true;
+ btnState.Text = function.StateText();
}
+
+
+ functionListView.AddChidren(new Button()
+ {
+ Gravity = Gravity.CenterHorizontal,
+ Width = Application.GetRealWidth(343),
+ Height = Application.GetRealWidth(1),
+ BackgroundColor = CSS_Color.DividingLineColor,
+ });
+
+
}
- };
- btnState.MouseUpEventHandler = (sender, e) =>
- {
- btnChooseIcon.IsSelected = true;
- var tempLocal = alarm.output.Find((obj) =>
- obj.sid == function.sid
- );
- if (tempLocal == null)
- alarm.output.Add(function);
- ShowStateDialog(function, btnState, btnChooseIcon);
- };
- var localOutput = alarm.output.Find((obj) => obj.sid == function.sid);
-
- if (localOutput != null)
- {
- btnChooseIcon.IsSelected = true;
- btnState.Text = function.StateText();
- }
-
-
- functionListView.AddChidren(new Button()
- {
- Gravity = Gravity.CenterHorizontal,
- Width = Application.GetRealWidth(343),
- Height = Application.GetRealWidth(1),
- BackgroundColor = CSS_Color.DividingLineColor,
});
-
-
- }
+ }).Start();
}
@@ -471,7 +481,8 @@
var form = new FloorRoomSelectPopupView();
form.ShowDeviceFunctionView(btnFloor, listAllFun, (selectId, listFun) =>
{
- SetData(selectId);
+ var selecteRoom = SpatialInfo.CurrentSpatial.RoomList.Find((obj) => obj.uid == selectId);
+ SetData(selecteRoom.roomId);
//閲嶆柊鍒锋柊璁惧鍒楄〃
this.LoadFunctionListRow();
}, nowSelectId);
--
Gitblit v1.8.0