| | |
| | | }; |
| | | //获取自动化列表 |
| | | GetLogicList(); |
| | | // for (int i = Logic.LogicList.Count-1; i >= 0; i--)降序排列 |
| | | for (int i = 0; i < Logic.LogicList.Count; i++) |
| | | for (int i = Logic.LogicList.Count-1; i >= 0; i--)//降序排列 |
| | | //for (int i = 0; i < Logic.LogicList.Count; i++) |
| | | { |
| | | var currLogic = Logic.LogicList[i]; |
| | | ///上下间隔12像素 |
| | |
| | | LogicView.SingleLogicView logicView = new LogicView.SingleLogicView(); |
| | | vv.AddChidren(logicView.FLayoutView()); |
| | | logicView.btnLogicName.Text = currLogic.name; |
| | | logicView.btnWeekText.Text = GetWeekText(currLogic); |
| | | logicView.btnWeekText.Text = GetCyclicText(currLogic); |
| | | logicView.btnclick.MouseUpEventHandler += (sen, e) => |
| | | { |
| | | Logic.currlogic = currLogic; |
| | |
| | | try |
| | | { |
| | | //逻辑使能的命令 |
| | | Send.switchLogic(currLogic); |
| | | Send.SwitchLogic(currLogic); |
| | | |
| | | } |
| | | catch { } |
| | |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | GetSelectIcon(logicView.frameLayout, currLogic); |
| | | //if (i==0)降序排列 |
| | | if (Logic.LogicList.Count - 1 == i) |
| | | if (i==0)//降序排列 |
| | | //if (Logic.LogicList.Count - 1 == i) |
| | | { |
| | | ///最后一个距离最底部12,界面显示效果作用; |
| | | vv.AddChidren(new FrameLayout { Height = Application.GetRealHeight(12) }); |
| | |
| | | automationPage.AddChidren(btnTipNot); |
| | | Button btnTipNotText = new Button() |
| | | { |
| | | Y = btnTipNot.Bottom, |
| | | Height = Application.GetRealWidth(100), |
| | | TextID = StringId.ContentIsEmpty, |
| | | Y = btnTipNot.Bottom + Application.GetRealHeight(16), |
| | | Height = Application.GetRealHeight(20), |
| | | TextID = StringId.logicnull, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS.CSS_Color.TextualColor, |
| | | TextSize = CSS.CSS_FontSize.PromptFontSize_FirstLevel, |
| | | TextSize = LogicView.TextSize.text14, |
| | | TextColor = CSS.CSS_Color.textConfirmColor, |
| | | }; |
| | | automationPage.AddChidren(btnTipNotText); |
| | | } |
| | |
| | | ///返回循环描述文本 |
| | | /// </summary> |
| | | /// <param name="logic"></param> |
| | | public static string GetWeekText(Logic logic) |
| | | public static string GetCyclicText(Logic logic) |
| | | { |
| | | |
| | | string weekName = ""; |
| | |
| | | return weekName; |
| | | } |
| | | /// <summary> |
| | | /// 获取星期的字符串 |
| | | /// 返回星期描述文本 |
| | | /// </summary> |
| | | /// <param name="weekList"></param> |
| | | /// <returns></returns> |
| | |
| | | /// <summary> |
| | | /// 获取逻辑列表 |
| | | /// </summary> |
| | | private static void GetLogicList() |
| | | public static void GetLogicList() |
| | | { |
| | | |
| | | if (Logic.LogicList.Count != 0) |
| | | { |
| | | //自动化列表为0才去获取自动化列表; |
| | |
| | | } |
| | | List<string> logicIdList = new List<string>(); |
| | | //获取逻辑ID列表 |
| | | var idStr = Send.getLogicIdList(); |
| | | var idStr = Send.GetLogicIdList(); |
| | | if (idStr.Code == "0" && idStr.Data != null && idStr.Data.ToString() != "") |
| | | { |
| | | var date = Newtonsoft.Json.JsonConvert.SerializeObject(idStr.Data); |
| | |
| | | } |
| | | } |
| | | //获取自动化列表 |
| | | var logicStr = Send.getLogic(logicIdList); |
| | | var logicStr = Send.GetLogic(logicIdList); |
| | | if (logicStr.Code == "0" && logicStr.Data != null && logicStr.Data.ToString() != "") |
| | | { |
| | | //获取逻辑详细返回是一个数组(object类型转换为数组); |
| | |
| | | //2-功能图标 |
| | | for (int i = 0; i < logic.input.Count; i++) |
| | | { |
| | | if (logic.input[i] == null) |
| | | { |
| | | //防止有的空对象; |
| | | //正常情况下不会该现象; |
| | | continue; |
| | | } |
| | | |
| | | var int1 = int.Parse(logic.input[i].condition_type); |
| | | int iconInt = 0; |
| | |
| | | //14-延时图标 |
| | | for (int i = 0; i < logic.output.Count; i++) |
| | | { |
| | | if (logic.output[i] == null) |
| | | { |
| | | //防止有的空对象; |
| | | //正常情况下不会该现象; |
| | | continue; |
| | | } |
| | | var int1 = int.Parse(logic.output[i].target_type); |
| | | int iconInt = 0; |
| | | switch (int1) |