| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- using PropertyGridLib.Attributes;
- using PropertyGridLib.Controls;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using TeamAAS.FlowEditor.Models;
- using TeamAAS.FlowEditor.Plugins;
- using TeamAAS.FlowEngine.FormulaData;
- namespace Plugins.Standard.Models
- {
- [Serializable]
- public class GroupPluginModel : BasePluginModel
- {
-
- [Category("I.参数")]
- [DisplayName("1.输入参数")]
- [Description("输入参数设置 —— 映射主流程前序节点的运行结果到组合模块内部,内部节点用 &{输入.变量名} 引用")]
- public List<InputModels> ModuleInputs { get; set; } = new List<InputModels>();
- [Category("I.参数")]
- [DisplayName("2.输出参数")]
- [Description("输出参数设置")]
- public List<OutPutModels> ModuleOutputs { get; set; } = new List<OutPutModels>();
- private int _loopCount = 1;
- [Category("II.循环设置")]
- [DisplayName("1.循环次数")]
- [Description("循环次数。-1=无限循环, 0=跳过不执行, 其他=按次数执行")]
- public int LoopCount
- {
- get => _loopCount;
- set => _loopCount = value;
- }
- [Browsable(false)]
- public FlowGraph SubGraph { get; set; }
- [Browsable(false)]
- public bool IsBreakRequested { get; set; } = false;
- public void EnsureSubGraph()
- {
- if (SubGraph == null)
- {
- SubGraph = new FlowGraph { GraphName = ToolName ?? "组合模块", GraphId = NodeId };
- }
- }
- }
- [Serializable]
- public class InputModels
- {
- public InputModels()
- {
- SourceValue = new FormulaBound<object>();
- }
- [Category("输入参数")]
- [DisplayName("变量名")]
- [Description("自定义变量名,内部节点通过 &{输入.变量名} 引用")]
- public string InputName { get; set; } = "Var1";
- [Category("输入参数")]
- [DisplayName("来源值")]
- [Description("从主流程前序节点的输出结果中选择(运行时自动读取最新值)")]
- [FormulaEditor(typeof(InputSourceDataProvider))]
- public FormulaBound<object> SourceValue { get; set; }
- public override string ToString() => InputName;
- }
- [Serializable]
- public class OutPutModels
- {
- public OutPutModels()
- {
- OutVale = new FormulaBound<object>();
- }
- private string _OutName = string.Empty;
- [Category("输出参数")]
- [DisplayName("参数名")]
- [Description("设置输出参数的名称")]
- public string OutName
- {
- get => _OutName;
- set => _OutName = value;
- }
- [Category("输出参数")]
- [DisplayName("参数值")]
- [Description("设置输出参数的值")]
- [FormulaEditor(typeof(PluginDataProvider))]
- public FormulaBound<object> OutVale
- {
- get;
- set;
- } = new FormulaBound<object>();
- private bool _IsEndResult = true;
- [Category("参数拓展")]
- [DisplayName("是否是末参")]
- [Description("如果为false OutVale会累计输出结果 并返回的是 List<T>数组")]
- public bool IsEndResult
- {
- get => _IsEndResult;
- set => _IsEndResult = value;
- }
- private int _MaxResultNumber = 50;
- [Category("参数拓展")]
- [DisplayName("最大结果数量")]
- [Description("如果返回的是列表结果 列表的最大数量限制是")]
- public int MaxResultNumber
- {
- get => _MaxResultNumber;
- set => _MaxResultNumber = value;
- }
- [NonSerialized]
- private List<object> _ResultList = new List<object>();
- /// <summary>
- /// 缓存
- /// </summary>
- [Browsable(false)]
- internal List<object> ResultList
- {
- get => _ResultList;
- set => _ResultList = value;
- }
- /// <summary>
- /// 缓存类型
- /// </summary>
- [Browsable(false)]
- [NonSerialized]
- internal Type ResultType = typeof(object);
- public override string ToString()
- {
- return OutName.ToString();
- }
- }
- }
|