Example #1
0
 /// <summary>
 /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>.
 /// </summary>
 /// <param name="messageProcessor">
 /// The message process to which complete AIS messages are to be passed.
 /// </param>
 /// <param name="options">Configures parser behaviour.</param>
 public NmeaLineToAisStreamAdapter(
     INmeaAisMessageStreamProcessor messageProcessor,
     NmeaParserOptions options)
 {
     this.messageProcessor = messageProcessor;
     this.options          = options;
 }
Example #2
0
 /// <summary>
 /// Process the contents of a file one AIS message at a time.
 /// </summary>
 /// <param name="path">Path of the file to process.</param>
 /// <param name="processor">Handler for the AIS messages.</param>
 /// <param name="options">Configures parser behaviour.</param>
 /// <returns>A task that completes when the stream has been processed.</returns>
 /// <remarks>
 /// This reassembles AIS messages that have been split over multiple NMEA lines.
 /// </remarks>
 public static async Task ParseFileAsync(
     string path,
     INmeaAisMessageStreamProcessor processor,
     NmeaParserOptions options)
 {
     using var adapter = new NmeaLineToAisStreamAdapter(processor, options);
     await ParseFileAsync(path, adapter, options).ConfigureAwait(false);
 }
Example #3
0
 /// <summary>
 /// Process the contents of a file one AIS message at a time.
 /// </summary>
 /// <param name="path">Path of the file to process.</param>
 /// <param name="processor">Handler for the AIS messages.</param>
 /// <returns>A task that completes when the stream has been processed.</returns>
 /// <remarks>
 /// This reassembles AIS messages that have been split over multiple NMEA lines.
 /// </remarks>
 public static async Task ParseFileAsync(
     string path,
     INmeaAisMessageStreamProcessor processor)
 {
     using (var adapter = new NmeaLineToAisStreamAdapter(processor))
     {
         await ParseFileAsync(path, adapter).ConfigureAwait(false);
     }
 }
Example #4
0
 /// <summary>
 /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>.
 /// </summary>
 /// <param name="messageProcessor">
 /// The message process to which complete AIS messages are to be passed.
 /// </param>
 public NmeaLineToAisStreamAdapter(INmeaAisMessageStreamProcessor messageProcessor)
     : this(messageProcessor, new NmeaParserOptions())
 {
 }
Example #5
0
 /// <summary>
 /// Process the contents of a file one AIS message at a time.
 /// </summary>
 /// <param name="path">Path of the file to process.</param>
 /// <param name="processor">Handler for the AIS messages.</param>
 /// <returns>A task that completes when the stream has been processed.</returns>
 /// <remarks>
 /// This reassembles AIS messages that have been split over multiple NMEA lines.
 /// </remarks>
 public static Task ParseFileAsync(
     string path,
     INmeaAisMessageStreamProcessor processor)
 {
     return(ParseFileAsync(path, processor, new NmeaParserOptions()));
 }
Example #6
0
 /// <summary>
 /// Creates a <see cref="NmeaLineToAisStreamAdapter"/>.
 /// </summary>
 /// <param name="messageProcessor">
 /// The message process to which complete AIS messages are to be passed.
 /// </param>
 public NmeaLineToAisStreamAdapter(INmeaAisMessageStreamProcessor messageProcessor)
 {
     this.messageProcessor = messageProcessor;
 }