alielie
2025-06-12 c1c3772a11b1f3fbad8846cc714120771d85fa53
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
using System.Windows.Controls;
using Plugin.SeqEditor.Constant;
using Plugin.SeqEditor.Entity;
using Plugin.SeqEditor.Entity.EditablePO;
using Plugin.SeqEditor.SettingPanel;
 
namespace Plugin.SeqEditor.Util
{
    public class StepUI2EPO
    {
        public static object Convert2EPO(StepUI step)
        {
            switch (step.Type)
            {
                case StepTypeStr.StringValueTest:
                    return new StringValTestEPO(step);
                default:
                    return null;
            }
        }
 
        public static UserControl Convert2EditPanel(StepUI step)
        {
            if (step == null) return null;
            object epo;
            switch (step.Type)
            {
                case StepTypeStr.StringValueTest:
                    epo = new StringValTestEPO(step);
                    return new StringValTestPanel((StringValTestEPO)epo);
                case StepTypeStr.NI_Wait:
                    epo = new WaitEPO(step);
                    return new WaitPanel((WaitEPO)epo);
                case StepTypeStr.NumericLimitTest:
                    epo = new NumValTestEPO(step);
                    return new NumValTestPanel((NumValTestEPO)epo);
                case StepTypeStr.Action:
                    return new ActionPanel(step);
                default:
                    return null;
            }
        }
    }
}