61 lines
1.3 KiB
C#
61 lines
1.3 KiB
C#
using System;
|
|
|
|
namespace bsmd.AIS2Service
|
|
{
|
|
/// <summary>
|
|
/// NMEA PNMLS sentence
|
|
/// sentence shows signal level for preceding message
|
|
/// </summary>
|
|
class NMEA_PNMLS_Sentence : NMEA
|
|
{
|
|
|
|
#region fields
|
|
|
|
private int signal_level;
|
|
private int detection_threshold;
|
|
private int interval;
|
|
|
|
#endregion
|
|
|
|
#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 abstract method implementation
|
|
|
|
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
|
|
|
|
}
|
|
}
|