59 lines
1.4 KiB
C#
59 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Diagnostics;
|
|
|
|
namespace bsmd.AISService.AIS
|
|
{
|
|
/// <summary>
|
|
/// NMEA PNMLS sentence
|
|
/// sentence shows signal level for preceding message
|
|
/// </summary>
|
|
class NMEA_PNMLS_Sentence : NMEA
|
|
{
|
|
private int signal_level;
|
|
private int detection_threshold;
|
|
private int interval;
|
|
|
|
#region Properties
|
|
|
|
public int Signal_Level
|
|
{
|
|
get { return this.signal_level; }
|
|
}
|
|
|
|
public int Detection_Threshold
|
|
{
|
|
get { return this.detection_threshold; }
|
|
}
|
|
|
|
public int Interval
|
|
{
|
|
get { return this.interval; }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region decode func
|
|
|
|
protected override void Decode()
|
|
{
|
|
try
|
|
{
|
|
this.signal_level = Convert.ToInt32(this.elements[1]);
|
|
this.detection_threshold = Convert.ToInt32(this.elements[2]);
|
|
|
|
string interval_string = this.elements[3].Substring(0, this.elements[3].IndexOf('*'));
|
|
this.interval = Convert.ToInt32(interval_string);
|
|
}
|
|
catch (FormatException)
|
|
{
|
|
_log.Warn("NMEA [PNMLS] input format error");
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|