54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace skyscraper5.Skyscraper.Scraper.Storage.InMemory.Model
|
|
{
|
|
internal class InMemoryAprsData
|
|
{
|
|
public InMemoryAprsData(string callsign)
|
|
{
|
|
this.CallSign = callsign;
|
|
this.WeatherTimestamps = new HashSet<DateTime>();
|
|
}
|
|
|
|
public string CallSign { get; private set; }
|
|
public DateTime LastSeen { get; set; }
|
|
public double Longitude { get; set; }
|
|
public double Latitude { get; set; }
|
|
public string? Comment { get; set; }
|
|
public HashSet<DateTime> WeatherTimestamps { get; private set; }
|
|
public int? LocalStations { get; set; }
|
|
public int? MessageCount { get; set; }
|
|
public double? Course { get; set; }
|
|
public double? MagneticVariation { get; set; }
|
|
public double? Speed { get; set; }
|
|
public int TimesMoved { get; set; }
|
|
|
|
protected bool Equals(InMemoryAprsData other)
|
|
{
|
|
return CallSign == other.CallSign;
|
|
}
|
|
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
if (obj.GetType() != this.GetType()) return false;
|
|
return Equals((InMemoryAprsData)obj);
|
|
}
|
|
|
|
public override int GetHashCode()
|
|
{
|
|
return (CallSign != null ? CallSign.GetHashCode() : 0);
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
return $"{nameof(CallSign)}: {CallSign}";
|
|
}
|
|
}
|
|
}
|