53 lines
1.3 KiB
C#
53 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using AprsSharp.Parsers.Aprs;
|
|
|
|
namespace skyscraper5.Aprs.AprsSharp
|
|
{
|
|
public class StationCapabilities : InfoField
|
|
{
|
|
public StationCapabilities(string line)
|
|
{
|
|
if (line.StartsWith("<"))
|
|
line = line.Substring(1);
|
|
args = line.Split(',');
|
|
}
|
|
|
|
private string[] args;
|
|
|
|
public bool IsIGate => args[0].Equals("IGATE");
|
|
|
|
public int MessageCount
|
|
{
|
|
get
|
|
{
|
|
string first = args.FirstOrDefault(x => x.StartsWith("MSG_CNT"));
|
|
if (string.IsNullOrEmpty(first))
|
|
return 0;
|
|
string[] strings = first.Split('=');
|
|
return int.Parse(strings[1]);
|
|
}
|
|
}
|
|
|
|
public int LocalStations
|
|
{
|
|
get
|
|
{
|
|
string first = args.FirstOrDefault(x => x.StartsWith("LOC_CNT"));
|
|
if (string.IsNullOrEmpty(first))
|
|
return 0;
|
|
string[] strings = first.Split('=');
|
|
return int.Parse(strings[1]);
|
|
}
|
|
}
|
|
|
|
public override string Encode()
|
|
{
|
|
return String.Join(',', args);
|
|
}
|
|
}
|
|
}
|