mirror of
https://github.com/MistWeatherMedia/i2ME.git
synced 2026-11-28 22:30:55 -08:00
update AirportDelays
This commit is contained in:
1 parent
f63133c2f3
commit
02e50e52c6
4 files changed
+69
-17
No files matched your search
@@ -511,7 +511,7 @@ public class Config
|
||||
[XmlElement] public bool DHRecord { get; set; } = false;
|
||||
[XmlElement] public bool HolidayMapping { get; set; } = true;
|
||||
[XmlElement] public bool TIRecord { get; set; } = true;
|
||||
[XmlElement] public bool AirportDelays { get; set; } = false;
|
||||
[XmlElement] public bool AirportDelays { get; set; } = true;
|
||||
[XmlElement] public bool DerivedHTRecord { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@@ -157,13 +157,11 @@ public class AirportDelays : I2Record
|
||||
string recordPath = Path.Combine(AppContext.BaseDirectory, "temp", "AirportDelays.xml");
|
||||
string recordScript = "<Data type=\"AirportDelays\" >";
|
||||
DateTime expiration = DateTime.UtcNow;
|
||||
expiration.AddHours(2);
|
||||
foreach (AirportEvent AE in result.ParsedData)
|
||||
{
|
||||
Schema.twc.AirportDelays product = new()
|
||||
AirportResult apresult = new()
|
||||
{
|
||||
ProcessTimeGmtAttr = (int)((DateTimeOffset)expiration).ToUnixTimeSeconds(),
|
||||
KeyAttr = AE.airportId,
|
||||
locationKey = AE.airportId,
|
||||
Key = AE.airportId,
|
||||
ICAOCode = $"K{AE.airportId}",
|
||||
IATACode = AE.airportId,
|
||||
@@ -183,7 +181,20 @@ public class AirportDelays : I2Record
|
||||
PercentCancelled = 100,
|
||||
Total = 1000
|
||||
},
|
||||
ProcessTimeGmt = (int)((DateTimeOffset)expiration).ToUnixTimeSeconds(),
|
||||
ProcessTimeGmt = (int)((DateTimeOffset)DateTime.UtcNow).ToUnixTimeSeconds(),
|
||||
ExpireTimeGmt = (int)((DateTimeOffset)expiration).ToUnixTimeSeconds()
|
||||
};
|
||||
AirportDelaysMetadata metadata = new()
|
||||
{
|
||||
airport_code = AE.airportId,
|
||||
expire_time_gmt = (int)((DateTimeOffset)expiration).ToUnixTimeSeconds()
|
||||
};
|
||||
Schema.twc.AirportDelays product = new()
|
||||
{
|
||||
ProcessTimeGmtAttr = (int)((DateTimeOffset)expiration).ToUnixTimeSeconds(),
|
||||
KeyAttr = AE.airportId,
|
||||
locationKey = AE.airportId,
|
||||
airport_result = apresult,
|
||||
clientKey = AE.airportId
|
||||
};
|
||||
ADIdx += $"{AE.airportId},";
|
||||
|
||||
@@ -6,7 +6,7 @@ public class ArrivalDelay
|
||||
{
|
||||
public string? impactingCondition { get; set; }
|
||||
|
||||
public string? averageDelay { get; set; }
|
||||
public float averageDelay { get; set; }
|
||||
}
|
||||
|
||||
public class GroundStop
|
||||
@@ -18,7 +18,7 @@ public class GroundDelay
|
||||
{
|
||||
public string? impactingCondition { get; set; }
|
||||
|
||||
public string? avgDelay { get; set; }
|
||||
public float avgDelay { get; set; }
|
||||
}
|
||||
|
||||
public class FreeForm
|
||||
|
||||
@@ -67,17 +67,14 @@ public class Delays
|
||||
public ReasonsAll? ReasonsAll { get; set; }
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName="AirportDelays")]
|
||||
public class AirportDelays
|
||||
[XmlRoot(ElementName="airport_result")]
|
||||
public class AirportResult
|
||||
{
|
||||
[XmlAttribute(AttributeName = "process_time_gmt")]
|
||||
public int ProcessTimeGmtAttr {get; set;}
|
||||
[XmlElement(ElementName = "class")]
|
||||
public string Class = "airport_delays";
|
||||
|
||||
[XmlAttribute(AttributeName = "locationKey")]
|
||||
public string? locationKey {get; set;}
|
||||
|
||||
[XmlAttribute(AttributeName = "key")]
|
||||
public string? KeyAttr {get; set;}
|
||||
[XmlElement(ElementName = "source")]
|
||||
public string Source = "flightaware.com";
|
||||
|
||||
[XmlElement(ElementName="key")]
|
||||
public string? Key { get; set; }
|
||||
@@ -109,6 +106,50 @@ public class AirportDelays
|
||||
[XmlElement(ElementName="process_time_gmt")]
|
||||
public int ProcessTimeGmt { get; set; }
|
||||
|
||||
[XmlElement(ElementName="expire_time_gmt")]
|
||||
public int ExpireTimeGmt { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class AirportDelaysMetadata
|
||||
{
|
||||
[XmlElement(ElementName="language")]
|
||||
public string language = "en-US";
|
||||
|
||||
[XmlElement(ElementName="transaction_id")]
|
||||
public string transaction_id = "i2ME";
|
||||
|
||||
[XmlElement(ElementName="version")]
|
||||
public string version = "1";
|
||||
|
||||
[XmlElement(ElementName="airport_code")]
|
||||
public string airport_code {get; set;}
|
||||
|
||||
[XmlElement(ElementName="expire_time_gmt")]
|
||||
public int expire_time_gmt {get; set;}
|
||||
|
||||
[XmlElement(ElementName="status_code")]
|
||||
public int status_code = 200;
|
||||
}
|
||||
|
||||
[XmlRoot(ElementName="AirportDelays")]
|
||||
public class AirportDelays
|
||||
{
|
||||
[XmlAttribute(AttributeName = "process_time_gmt")]
|
||||
public int ProcessTimeGmtAttr {get; set;}
|
||||
|
||||
[XmlAttribute(AttributeName = "locationKey")]
|
||||
public string? locationKey {get; set;}
|
||||
|
||||
[XmlAttribute(AttributeName = "key")]
|
||||
public string? KeyAttr {get; set;}
|
||||
|
||||
[XmlElement(ElementName="airport_result")]
|
||||
public AirportResult? airport_result { get; set; }
|
||||
|
||||
[XmlElement(ElementName="metadata")]
|
||||
public AirportDelaysMetadata? metadata { get; set; }
|
||||
|
||||
[XmlElement(ElementName="clientKey")]
|
||||
public string? clientKey { get; set; }
|
||||
}
|
||||
Reference in new issue
Block a user