wxr
2023-06-06 592974441a4df95fffd9167c90192da1a390b1c2
HDL_ON/UI/UI2/FuntionControlView/Electrical/SocketPage_InstantaneousValue.cs
@@ -97,45 +97,47 @@
        public static void UpdataView(Function updata)
        {
            if(bodyView!=null)
            if (bodyView != null)
            {
                for (int i = 0; i < bodyView.instantaneousValueView.ChildrenCount; i++)
                Application.RunOnMainThread(() =>
                {
                    var view = bodyView.instantaneousValueView.GetChildren(i);
                    if(null != view.Tag )
                    for (int i = 0; i < bodyView.instantaneousValueView.ChildrenCount; i++)
                    {
                        if (view.GetType() == typeof(InstantaneousValueView))
                        var view = bodyView.instantaneousValueView.GetChildren(i);
                        if (null != view.Tag)
                        {
                           var view2 = view as InstantaneousValueView;
                            switch (view.Tag.ToString())
                            if (view.GetType() == typeof(InstantaneousValueView))
                            {
                                case "active_power":
                                    var attr = updata.GetAttribute("active_power");
                                    if (attr != null)
                                    {
                                        view2.btnValue.Text = attr.curValue.ToString();
                                    }
                                    break;
                                case "voltage":
                                    var attr1 = updata.GetAttribute("voltage");
                                    if (attr1 != null)
                                    {
                                        view2.btnValue.Text = attr1.curValue.ToString();
                                    }
                                    break;
                                case "current":
                                    var attr2 = updata.GetAttribute("current");
                                    if (attr2 != null)
                                    {
                                        view2.btnValue.Text = attr2.curValue.ToString();
                                    }
                                    break;
                                var view2 = view as InstantaneousValueView;
                                switch (view.Tag.ToString())
                                {
                                    case "active_power":
                                        var attr = updata.GetAttribute("active_power");
                                        if (attr != null)
                                        {
                                            view2.btnValue.Text = attr.curValue.ToString();
                                        }
                                        break;
                                    case "voltage":
                                        var attr1 = updata.GetAttribute("voltage");
                                        if (attr1 != null)
                                        {
                                            view2.btnValue.Text = attr1.curValue.ToString();
                                        }
                                        break;
                                    case "current":
                                        var attr2 = updata.GetAttribute("current");
                                        if (attr2 != null)
                                        {
                                            view2.btnValue.Text = attr2.curValue.ToString();
                                        }
                                        break;
                                }
                            }
                        }
                    }
                }
                });
            }
        }
    }