wxr
2022-07-08 f16e7e4df7e7813e4a3052dae752aae3e6937b30
HDL_ON/UI/UI2/FuntionControlView/ArmSensor/SenesorMegahealthPage.cs
@@ -2,6 +2,7 @@
using HDL_ON.Stan;
using HDL_ON.UI.CSS;
using HDL_ON.Entity;
using System;
namespace HDL_ON.UI
{
@@ -74,6 +75,43 @@
                SelectedTextColor = CSS_Color.MainColor,
            };
            FrameWhiteCentet1.AddChidren(btnSuctionView);
            //加载瞬时值
            var btnInstantaneousValue = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = Application.GetRealHeight(391),
                Width = Application.GetMinRealAverage(32),
                Height = Application.GetMinRealAverage(32),
                UnSelectedImagePath = "FunctionIcon/EnvironmentalScience/DiagramIconOn.png",
            };
            FrameWhiteCentet1.AddChidren(btnInstantaneousValue);
            var btnInstantaneousValueText = new Button()
            {
                Gravity = Gravity.CenterHorizontal,
                Y = btnInstantaneousValue.Bottom,
                Width = Application.GetRealWidth(96),
                Height = Application.GetRealHeight(29),
                TextAlignment = TextAlignment.Center,
                TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
                TextColor = CSS_Color.TextualColor,
                TextID = StringId.AlarmDataStatistics,
                IsMoreLines = true
            };
            FrameWhiteCentet1.AddChidren(btnInstantaneousValueText);
            EventHandler<MouseEventArgs> eventHandler = (sender, e) => {
                //var page = new SocketPage_InstantaneousValue(function);
                //MainPage.BasePageView.AddChidren(page);
                //page.LoadPage();
                //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
            btnInstantaneousValue.MouseUpEventHandler = eventHandler;
            btnInstantaneousValueText.MouseUpEventHandler = eventHandler;
        }
        /// <summary>
@@ -119,6 +157,7 @@
        {
            Application.RunOnMainThread(() => {
                var temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.ActionStatus);
                if (temp != null)
                {
                    if (temp.state == "fall")   //跌倒
@@ -140,6 +179,38 @@
                        btnSuctionView.IsSelected = true;
                    }
                }
                else
                {
                    temp = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.PeopleStatus);
                    if (temp != null)
                    {
                        if (temp.state == "true")
                        {
                            btnIcon.IsSelected = true;
                            btnSuctionView.TextID = StringId.Someone;
                            btnSuctionView.IsSelected = true;
                        }
                        else
                        {
                            btnIcon.IsSelected = false;
                            btnSuctionView.TextID = StringId.SensorNormalState;
                            btnSuctionView.IsSelected = false;
                        }
                        //增加实验室模式反馈
                        var tempStatus = device.attributes.Find((sta) => sta.key == FunctionAttributeKey.TargetStatus);
                        if(tempStatus != null)
                        {
                            if(tempStatus.state == "4")
                            {
                                btnIcon.UnSelectedImagePath = "FunctionIcon/ArmSensor/SomeoneFellBgIcon.png";
                                btnSuctionView.TextID = StringId.SomeoneFell;
                                btnSuctionView.IsSelected = true;
                            }
                        }
                    }
                }
            });
        }