| | |
| | | #endregion |
| | | |
| | | #region ◆ 自动化__________________________ |
| | | |
| | | |
| | | /// <summary> |
| | | /// 自动化 |
| | | /// 自动化功能代码入口 |
| | | /// </summary> |
| | | private async void ShowAutotion() |
| | | private void ShowAutotion() |
| | | {
|
| | |
|
| | | functionSceneAutoBodyView.BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor;
|
| | |
| | | Y = Application.GetRealHeight(30), |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(bjFrameLayout); |
| | | bjFrameLayout.SetCornerWithSameRadius(25, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | bjFrameLayout.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerBottomLeft); |
| | | var sigBtn = new Button |
| | | { |
| | | Width = Application.GetMinRealAverage(84), |
| | |
| | | TextID = MyInternationalizationString.logictemplate, |
| | | Gravity = Gravity.CenterVertical, |
| | | TextColor = ZigbeeColor.Current.LogicBtnSelectedColor, |
| | | TextSize=15, |
| | | TextSize = 15, |
| | | }; |
| | | bjFrameLayout.AddChidren(recommendtextBtn); |
| | | |
| | |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(scenehorizontalScrol); |
| | | |
| | | var logicScrolView = new VerticalScrolViewLayout |
| | | var logicScrolView = new VerticalRefreshLayout//VerticalScrolViewLayout |
| | | { |
| | | Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | |
| | | Y = scenehorizontalScrol.Bottom, |
| | | }; |
| | | functionSceneAutoBodyView.AddChidren(logicScrolView); |
| | | logicScrolView.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerBottomLeft); |
| | | |
| | | logicScrolView.SetCornerWithSameRadius(Application.GetRealHeight(58), HDLUtils.RectCornerTopLeft); |
| | | |
| | | recommendswitchBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | |
| | | logicScrolView.Height = functionSceneAutoBodyView.Height - bjFrameLayout.Height - bjFrameLayout.Y - scenehorizontalScrol.Height - Application.GetRealHeight(30) - Yheight; |
| | | Automationview(logicScrolView); |
| | | }; |
| | | logicScrolView.BeginHeaderRefreshingAction += () => |
| | | { |
| | | //重新刷新logic列表 |
| | | Common.Logic.LogicList.Clear(); |
| | | Read(logicScrolView); |
| | | //关闭刷新View; |
| | | logicScrolView.EndHeaderRefreshing(); |
| | | }; |
| | | |
| | | Read(logicScrolView); |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 读取自动化列表数据; |
| | | /// </summary> |
| | | /// <param name="logicScrolView"></param> |
| | | private async void Read(VerticalRefreshLayout logicScrolView) |
| | | { |
| | | CommonPage.Loading.Start(); |
| | | if (Common.Logic.LogicList.Count == 0) |
| | | { |
| | | var Idlist = await Logic.Send.GetLogicId(0); |
| | | if (Idlist.Count != 0) |
| | | { |
| | | var listlogic = await Logic.Send.ReadList(Idlist.Count,0); |
| | | var listlogic = await Logic.Send.ReadList(Idlist.Count, 0); |
| | | //foreach可能集合已被修改,枚举操作可能不会执行,可能出现崩溃(建议for)。 |
| | | for (int j = 0; j < listlogic.Count; j++) |
| | | { |
| | |
| | | //自动化 |
| | | Automationview(logicScrolView); |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | } |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 自动化列表界面 |
| | | /// 加载自动化列表界面 |
| | | /// </summary> |
| | | /// <param name="refresview">Refresview.</param> |
| | | private async void Automationview(VerticalScrolViewLayout refresview) |
| | | private async void Automationview(VerticalRefreshLayout refresview) |
| | | { |
| | | refresview.RemoveAll(); |
| | | foreach (var logic in Common.Logic.LogicList) |
| | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 显示图标的颜色 |
| | | /// 显示自动化输出功能模块图标的颜色 |
| | | /// </summary> |
| | | /// <param name="logic"></param> |
| | | /// <param name="logicRowlayout"></param> |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 控制状态_________________________ |