| | |
| | | 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 { } |
| | |
| | | ///返回循环描述文本 |
| | | /// </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> |
| | | 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) |