IProcessor.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using CSVReader;
  4. namespace Processor
  5. {
  6. public interface IProcessor
  7. {
  8. /// <summary>
  9. /// Starts streaming on the CSV file or Networkstream.
  10. /// </summary>
  11. /// <returns>
  12. /// Returns a bool that indicates wether starting the stream was successful.
  13. /// </returns>
  14. /// <param name="foreward">Initial direction of the stream.</param>
  15. bool StartStreaming(int samplerate = 4, bool foreward = true);
  16. /// <summary>
  17. /// Jump to a timestamp of the underlying stream.
  18. /// </summary>
  19. /// <returns>
  20. /// Returns a bool that indicates wether the jump was successful.
  21. /// </returns>
  22. /// <param name="timestamp">The time to jump too.</param>
  23. bool JumpToTimestamp(double timestamp, out double actualTimestamp);
  24. /// <summary>
  25. /// Reads or returns the next set of values.
  26. /// </summary>
  27. /// <remarks>
  28. /// The values returned are all values buffered since the last read.
  29. /// </remarks>
  30. /// <returns>
  31. /// Returns a list with the objects.
  32. /// </returns>
  33. List<InputObject> ReadNextValues();
  34. /// <summary>
  35. /// Get the newest Timestamp.
  36. /// </summary>
  37. /// <returns>
  38. /// Returns the newest timestamp of the File.
  39. /// </returns>
  40. double GetNewestTimeStamp();
  41. /// <summary>
  42. /// Get the oldest Timestamp.
  43. /// </summary>
  44. /// <returns>
  45. /// Returns the oldest timestamp of the File.
  46. /// </returns>
  47. double GetOldestTimeStamp();
  48. ///<summary>
  49. ///Get the first timestamp in the timechunk
  50. ///</summary>
  51. ///<returns>
  52. ///Returns the first Timestamp in the timechunk.
  53. ///NaN if starttimestamp is not set.
  54. ///</returns>
  55. double GetChunkStarttimestamp();
  56. ///<summary>
  57. ///Get the last timestamp in the timechunk
  58. ///</summary>
  59. ///<returns>
  60. ///Returns the last timestamp in the timechunk.
  61. ///NaN if endtimestamp is not set.
  62. ///</returns>
  63. double GetChunkEndtimestamp();
  64. ///<summary>
  65. ///Set the first timestamp in the timechunk
  66. ///</summary>
  67. void SetChunkStarttimestamp(double time);
  68. ///<summary>
  69. ///Set the last timestamp in the timechunk
  70. ///</summary>
  71. void SetChunkEndtimestamp(double time);
  72. /// <summary>
  73. /// Reverses the reading direction on the file.
  74. /// </summary>
  75. /// <remarks>
  76. /// This call also clears the current buffer of any content.
  77. /// </remarks>
  78. void ReverseTime();
  79. /// <summary>
  80. /// Changes the samplerate of the Processor.
  81. /// </summary>
  82. void ChangeSamplerate(int newSamplerate);
  83. /// <summary>
  84. /// Stops the Streaming thread.
  85. /// </summary>
  86. /// <remarks>
  87. /// This call resets the Processor. It has to be restarted with <see cref="StartStreaming(double ,bool)"/>
  88. /// </remarks>
  89. void StopStreaming();
  90. }
  91. }