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.SequenceCall: return new CallSeqPanel(step); // return new ActionPanel(step); //case StepTypeStr.SequenceCall: // return new ActionPanel(step); //case StepTypeStr.Action: // if (step.Adapter == AdapterName.VICall) // return new ViPanel(new ViCallEPO(step)); // else return new ActionPanel(step); default: return new ActionPanel(step); } } } }