MetaConfig.cs 3.0 KB

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