From 5985ef28a5722360fa00f88f23544ed585fd05ef Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期四, 05 五月 2022 22:34:50 +0800
Subject: [PATCH] 备份

---
 HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs |  229 ++++++++++++++++++++++++++++++---------------------------
 1 files changed, 120 insertions(+), 109 deletions(-)

diff --git a/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs b/HDL_ON/UI/UI2/FuntionControlView/ArmCenter/AddOutputPage.cs
index e1dd248..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))
                     {
@@ -172,7 +172,7 @@
                 {
                     continue;
                 }
-                if (!string.IsNullOrEmpty(roomId))
+                if (!string.IsNullOrEmpty(roomId) && roomId != "ALLSELECT")
                 {
                     if (!scene.roomIds.Contains(roomId))
                     {
@@ -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