IEPDService.cs 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. using EPInterface.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ServiceModel;
  5. using EPInterface.Datas;
  6. namespace EPInterface
  7. {
  8. [ServiceContract]
  9. [ServiceKnownType(typeof(EPDState))]
  10. [ServiceKnownType(typeof(CRawDataItem))]
  11. [ServiceKnownType(typeof(List<long>))]
  12. public interface IEPDService
  13. {
  14. /// <summary>
  15. /// 设置当前model
  16. /// </summary>
  17. /// <param name="model"></param>
  18. [OperationContract]
  19. void SetModel(int channel, string name, string model);
  20. [OperationContract]
  21. int Heartbeat(int counter);
  22. [OperationContract]
  23. void Online();
  24. [OperationContract]
  25. void Offline();
  26. [OperationContract]
  27. bool IsOnline();
  28. [OperationContract]
  29. void SetOption(string name, string value);
  30. [OperationContract]
  31. string GetOption(string name);
  32. /// <summary>
  33. ///RecipeStart
  34. /// </summary>
  35. /// <param name="recipe"></param>
  36. [OperationContract]
  37. void RecipeStart(int channel, string name);
  38. /// <summary>
  39. ///RecipeStart
  40. /// </summary>
  41. /// <param name="model"></param>
  42. [OperationContract]
  43. void RecipeStop(int channel);
  44. /// <summary>
  45. /// Online 模式,开始计算
  46. /// </summary>
  47. /// <param name="model"></param>
  48. [OperationContract]
  49. void Start(int channel, int idx, string name, string model);
  50. [OperationContract]
  51. void StartByConfig(int channel, int idx, string name, EPDConfig config);
  52. /// <summary>
  53. /// online 模式,停止计算
  54. /// </summary>
  55. [OperationContract]
  56. void Stop(int channel);
  57. /// <summary>
  58. /// online模式,暂停
  59. /// </summary>
  60. [OperationContract]
  61. void Pause(int channel);
  62. [OperationContract]
  63. /// <summary>
  64. /// online模式,恢复计算
  65. /// </summary>
  66. void Resume(int channel);
  67. /// <summary>
  68. /// 获取硬件通道数
  69. /// </summary>
  70. [OperationContract]
  71. int QueryChannels();
  72. [OperationContract]
  73. List<string> QueryChannelNames();
  74. [OperationContract]
  75. string QueryChannelName(int channel);
  76. [OperationContract]
  77. ///
  78. /// 获取当前model <name,xml>
  79. ///
  80. Tuple<string,string> QueryModel(int channel);
  81. /// <summary>
  82. /// 获取 波长信息,频谱图 X 坐标
  83. /// </summary>
  84. /// <param name="wave"></param>
  85. [OperationContract]
  86. double[] QueryWave(int channel);
  87. /// <summary>
  88. /// 获取当前帧数据
  89. /// </summary>
  90. /// <param name="data"></param>
  91. /// <returns>False,为无数据。
  92. /// </returns>
  93. [OperationContract]
  94. CRawDataItem QueryData(int channel);
  95. [OperationContract]
  96. ///
  97. /// 获取当前State
  98. ///
  99. EPDState QueryState(int channel);
  100. [OperationContract]
  101. bool QueryRecordState(int channel);
  102. [OperationContract]
  103. long QueryRecipeTime(int channel);
  104. [OperationContract]
  105. List<long> QueryStepTime(int channel);
  106. [OperationContract]
  107. List<string> QueryConfigList();
  108. [OperationContract]
  109. string QueryConfig(string name);
  110. }
  111. public interface IRecipeService
  112. {
  113. [OperationContract]
  114. List<string> QueryRecipes();
  115. [OperationContract]
  116. string Load(string name);
  117. [OperationContract]
  118. void Save(string name, string recipe);
  119. [OperationContract]
  120. void Delete(string name);
  121. }
  122. }