陈嘉乐
2020-11-23 db68ee28e538f1de22db27216f194d131240f901
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using Shared;
using System.Collections.Generic;
namespace HDL_ON.UI.UI2.Intelligence.Automation
{
    public class InpOrOutLogicMethod
    {
        /// <summary>
        /// 输入条件处理方法
        /// </summary>
        /// <param name="thisView">当前界面</param>
        /// <param name="viewLayout">上下滑动控件</param>
        public static void InputCondition(FrameLayout thisView,VerticalScrolViewLayout viewLayout)
        {
            for (int i = 0; i < Logic.currlogic.input.Count; i++)
            {
                Input inputCondition = Logic.currlogic.input[i];
                ///各种条件的View
                LogicView.AddOutputInputView inputView = new LogicView.AddOutputInputView();
                viewLayout.AddChidren(inputView.FLayoutView());
                ///记录条件类型
                inputView.btnClick.Name = inputCondition.condition_type;
                ///记录条件索引
                inputView.btnClick.Tag = i;
                ///条件状态数组
                List<Dictionary<string, string>> dicList = inputCondition.condition as List<Dictionary<string, string>>;
                //显示条件各种类型状态
                switch (inputCondition.condition_type)
                {
                    case "1":
                        {
                            inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
                            foreach (var dic in dicList)
                            {
                                string value = dic["value"];
                                inputView.btnText.Text = Language.StringByID(StringId.hour) + ": " + value;
                                inputView.btnClick.AddTag("timepoint", value);
                            }
 
                        }
                        break;
                    case "2":
                        {
                            inputView.btnIcon.UnSelectedImagePath = "LogicIcon/timecondition.png";
                            foreach (var dic in dicList)
                            {
                                string value = dic["value"];
                                inputView.btnText.Text = Language.StringByID(StringId.timeHorizon) + ": " + value;
                                inputView.btnClick.AddTag("timeHorizon", value);
                            }
 
                        }
                        break;
 
                }
                //再次编辑条件状态点击事件
                inputView.btnClick.MouseUpEventHandler += (sen, e) =>
                {
                    Button button = (Button)sen;
                    switch (button.Name)
                    {
                        case "1":
                            {
                                FrameLayout fLayout = new FrameLayout
                                {
                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
                                };
                                thisView.AddChidren(fLayout);
                                TimeTpye timeTpye = new TimeTpye();
                                timeTpye.TimePoint(fLayout, true, int.Parse(inputView.btnClick.Tag.ToString()));
                            }
                            break;
                        case "2":
                            {
                                FrameLayout fLayout = new FrameLayout
                                {
                                    BackgroundColor = CSS.CSS_Color.viewTrans60lucence,
                                };
                                thisView.AddChidren(fLayout);
                                TimeTpye timeTpye = new TimeTpye();
                                timeTpye.TimeHorizon(fLayout, true, int.Parse(inputView.btnClick.Tag.ToString()));
                            }
                            break;
                    }
                };
            }
 
        }
        /// <summary>
        /// 输出条件处理方法
        /// </summary>
        /// <param name="thisView">当前界面</param>
        /// <param name="viewLayout">上下滑动控件</param>
        public static void OutputTarget(FrameLayout thisView, VerticalScrolViewLayout viewLayout)
        {
 
 
        }
 
    }
}