MetaConfig.cs 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace Edge.Core.Processor.Dispatcher
  7. {
  8. public enum ProcessorTypeEnum { DeviceProcessor, AppProcessor }
  9. public enum ProcessorMetaPartsTypeEnum
  10. {
  11. /// <summary>
  12. /// the most outer processor, like GenericDeviceProcessor<TRaw, TMessage>,
  13. /// HalfDuplexActivePollingDeviceProcessor<TRaw, TMessage>
  14. /// </summary>
  15. DeviceProcessor,
  16. DeviceHandler,
  17. App,
  18. Parser,
  19. MessageCutter,
  20. Communicator,
  21. // most likey the byte[]
  22. RawMessageTypeStr,
  23. MessageTypeStr
  24. }
  25. public class ProcessorMetaConfig
  26. {
  27. public int Id { get; set; }
  28. public string SourceEndpointFullTypeStr { get; set; }
  29. public string Name { get; set; }
  30. public string Description { get; set; }
  31. public ProcessorTypeEnum Type { get; set; }
  32. public IEnumerable<ProcessorMetaPartsConfig> Parts { get; set; }
  33. public bool Activated { get; set; }
  34. //public DateTime TimeStamp { get; set; }
  35. }
  36. public class ProcessorMetaPartsConfig
  37. {
  38. public int Id { get; set; }
  39. //public int ProcessorMetaConfigId { get; set; }
  40. //public ProcessorMetaConfig ProcessorMetaConfig { get; set; }
  41. public ProcessorMetaPartsTypeEnum Type { get; set; }
  42. public string FullTypeString { get; set; }
  43. public string ParametersJsonArrayStr { get; set; }
  44. }
  45. /// <summary>
  46. /// Data structure for how construct a Processor instance.
  47. /// </summary>
  48. public class ProcessorMetaDescriptor
  49. {
  50. public string SourceEndpointFullTypeStr { get; set; }
  51. public string DisplayName { get; set; }
  52. public string Description { get; set; }
  53. public ProcessorTypeEnum Type { get; set; }
  54. public string[] Tags { get; set; }
  55. /// <summary>
  56. /// Gets or sets the MetaPartsGroupDescriptor, a processor is consist of several meta part.
  57. /// </summary>
  58. public IEnumerable<ProcessorMetaPartsGroupDescriptor> MetaPartsGroupDescriptors { get; set; }
  59. //public bool Activated { get; set; }
  60. //public DateTime TimeStamp { get; set; }
  61. }
  62. public class ProcessorMetaPartsGroupDescriptor
  63. {
  64. public ProcessorMetaPartsTypeEnum GroupType { get; set; }
  65. /// <summary>
  66. /// the available MetaParts list, when in real constructing, will only pick one.
  67. /// think about the case of a device support multiple communicator.
  68. /// </summary>
  69. public IEnumerable<ProcessorMetaPartsDescriptor> MetaPartsDescriptors { get; set; }
  70. }
  71. /// <summary>
  72. /// Data structure for how construct a MetaParts.
  73. /// </summary>
  74. public class ProcessorMetaPartsDescriptor
  75. {
  76. public string FullTypeString { get; set; }
  77. public string TypeString { get; set; }
  78. public string DisplayName { get; set; }
  79. public string Description { get; set; }
  80. public IEnumerable<List<string>> ParametersJsonSchemaStrings { get; set; }
  81. }
  82. }