BasePluginModel.cs 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using TeamAAS.FlowEditor.Execution;
  5. using TeamAAS;
  6. namespace TeamAAS.FlowEditor.Plugins
  7. {
  8. /// <summary>
  9. /// 插件模型基类 - 每个插件的配置属性模型继承此类
  10. /// 参照 VisionKit 的 BaseModel
  11. /// 使用 [DisplayName]/[Category]/[Description] 特性供 PropertyGrid 自动生成编辑界面
  12. /// </summary>
  13. [System.Serializable]
  14. public abstract class BasePluginModel
  15. {
  16. [Browsable(false)]
  17. public string ToolName { get; internal set; }
  18. [Browsable(false)]
  19. public string NodeId { get; internal set; }
  20. [Browsable(false)]
  21. public string PluginId { get; internal set; }
  22. [Browsable(false)]
  23. public string FlowName { get; internal set; }
  24. [Browsable(false)]
  25. public string FlowId { get; internal set; }
  26. [Browsable(false)]
  27. public string NodeName { get; internal set; }
  28. // 新建插件默认取系统设置里的"默认存储/显示详细度"(设置未加载时回退粗略)
  29. private TeamAAS.Logging.LogVerbosity _storeVerbosity = TeamAAS.Logging.PluginLogger.Current.DefaultStoreVerbosity;
  30. private TeamAAS.Logging.LogVerbosity _displayVerbosity = TeamAAS.Logging.PluginLogger.Current.DefaultDisplayVerbosity;
  31. /// <summary>日志存储详细度:粗略=只写 L1/L2 公共日志;详细=额外把 L3/L4 写到 流程/任务 独立路径。</summary>
  32. [Browsable(false)]
  33. public TeamAAS.Logging.LogVerbosity StoreVerbosity
  34. {
  35. get => _storeVerbosity;
  36. set => _storeVerbosity = value;
  37. }
  38. /// <summary>日志显示详细度:粗略=实时日志只显 L1/L2;详细=额外显 L3/L4(与是否落盘无关)。</summary>
  39. [Browsable(false)]
  40. public TeamAAS.Logging.LogVerbosity DisplayVerbosity
  41. {
  42. get => _displayVerbosity;
  43. set => _displayVerbosity = value;
  44. }
  45. }
  46. }