Skip to content

Commit

Permalink
Add chill hours and fix parse error if 24-hr rain fields are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Crossley committed Dec 13, 2023
1 parent 0917a17 commit e0fcfc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions DayFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,9 @@ private Dayfilerec ParseDayFileRec(string data)
if (st.Count > idx++ && st[51].Length == 5)
rec.HighHumidexTime = GetDateTime(rec.Date, st[51]);

if (st.Count > idx++ && double.TryParse(st[52], out varDbl))
rec.ChillHours = varDbl;

if (st.Count > idx++ && double.TryParse(st[53], out varDbl))
rec.HighRain24h = varDbl;

Expand Down Expand Up @@ -395,6 +398,7 @@ public class Dayfilerec
public DateTime LowFeelsLikeTime;
public double HighHumidex;
public DateTime HighHumidexTime;
public double ChillHours;
public double HighRain24h;
public DateTime HighRain24hTime;

Expand Down Expand Up @@ -429,6 +433,7 @@ public Dayfilerec()
HighUv = Cumulus.DefaultHiVal;
HighFeelsLike = Cumulus.DefaultHiVal;
LowFeelsLike = Cumulus.DefaultLoVal;
ChillHours = Cumulus.DefaultHiVal;
HighHumidex = Cumulus.DefaultHiVal;
HighRain24h = Cumulus.DefaultHiVal;
}
Expand Down

0 comments on commit e0fcfc9

Please sign in to comment.