| | |
| | | |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |