Skip to content

Commit

Permalink
v3.10.2 final
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrossley committed Mar 2, 2021
1 parent f492c0d commit f317daa
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 37 deletions.
2 changes: 1 addition & 1 deletion CumulusMX/InternetSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ public string GetInternetAlpacaFormSchema()
public string GetExtraWebFilesData()
{
var json = new StringBuilder(10240);
json.Append("{\"metadata\":[{\"name\":\"local\",\"label\":\"Local Filename\",\"datatype\":\"string\",\"editable\":true},{\"name\":\"remote\",\"label\":\"Remote Filename\",\"datatype\":\"string\",\"editable\":true},{\"name\":\"process\",\"label\":\"Process\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"realtime\",\"label\":\"Realtime\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"ftp\",\"label\":\"FTP\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"utf8\",\"label\":\"UTF-8\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"binary\",\"label\":\"Binary\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"endofday\",\"label\":\"End of day\",\"datatype\":\"boolean\",\"editable\":true}],\"data\":[");
json.Append("{\"metadata\":[{\"name\":\"local\",\"label\":\"Local Filename\",\"datatype\":\"string\",\"editable\":true},{\"name\":\"remote\",\"label\":\"Destination Filename\",\"datatype\":\"string\",\"editable\":true},{\"name\":\"process\",\"label\":\"Process\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"realtime\",\"label\":\"Realtime\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"ftp\",\"label\":\"FTP\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"utf8\",\"label\":\"UTF-8\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"binary\",\"label\":\"Binary\",\"datatype\":\"boolean\",\"editable\":true},{\"name\":\"endofday\",\"label\":\"End of day\",\"datatype\":\"boolean\",\"editable\":true}],\"data\":[");

for (int i = 0; i < Cumulus.numextrafiles; i++)
{
Expand Down
79 changes: 44 additions & 35 deletions CumulusMX/NOAA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ public List<string> CreateYearlyReport(DateTime thedate)
repLine.Append(" 0.0");
else
{
repLine.Append(string.Format(culture, "{0,6F1}", (meantemp - (totalnormtemp / normtempsamples))));
repLine.Append(string.Format(culture, "{0,6:F1}", (meantemp - (totalnormtemp / normtempsamples))));
}
repLine.Append(string.Format(culture, "{0,6:D}{1,6:D}", (int)(totalheating), (int)(totalcooling)));
if (maxtempmonth == 0)
Expand Down Expand Up @@ -1149,53 +1149,62 @@ public List<string> CreateYearlyReport(DateTime thedate)
// Wind section details
for (m = 1; m < 13; m++)
{
repLine.Clear();
repLine.Append(string.Format("{0,3}{1,3:D}", twodigityear, m));

if (MonthList[m].valid)
try
{
// calculate average wind speed
MonthList[m].avgwindspeed = GetAverageWindSpeed(m, year, out domdir);
MonthList[m].winddomdir = domdir;
if (MonthList[m].avgwindspeed < 0)
{
// no valid average
repLine.Append(" ----");
}
else
repLine.Clear();
repLine.Append(string.Format("{0,3}{1,3:D}", twodigityear, m));

if (MonthList[m].valid)
{
// String.Format the average into the display line
repLine.Append(string.Format(culture, "{0,6:F1}", MonthList[m].avgwindspeed));
totalavgwind += MonthList[m].avgwindspeed * MonthList[m].samples;
avgwindcount += MonthList[m].samples;
}
// calculate average wind speed
MonthList[m].avgwindspeed = GetAverageWindSpeed(m, year, out domdir);
MonthList[m].winddomdir = domdir;
if (MonthList[m].avgwindspeed < 0)
{
// no valid average
repLine.Append(" ----");
}
else
{
// String.Format the average into the display line
repLine.Append(string.Format(culture, "{0,6:F1}", MonthList[m].avgwindspeed));
totalavgwind += MonthList[m].avgwindspeed * MonthList[m].samples;
avgwindcount += MonthList[m].samples;
}

// String.Format the high wind speed and dominant direction into the display line
repLine.Append(string.Format(culture, "{0,6:F1}{1,5:D}", MonthList[m].highwindspeed, MonthList[m].highwindday));
repLine.Append(string.Format("{0,6}", CompassPoint(MonthList[m].winddomdir)));
// String.Format the high wind speed and dominant direction into the display line
repLine.Append(string.Format(culture, "{0,6:F1}{1,5:D}", MonthList[m].highwindspeed, MonthList[m].highwindday));
repLine.Append(string.Format("{0,6}", CompassPoint(MonthList[m].winddomdir)));

// check for highest annual wind speed
if (MonthList[m].highwindspeed > highwind)
{
highwind = MonthList[m].highwindspeed;
highwindmonth = m;
}
// check for highest annual wind speed
if (MonthList[m].highwindspeed > highwind)
{
highwind = MonthList[m].highwindspeed;
highwindmonth = m;
}

// increment the total wind vectors for the annual calculation
totalwinddirX += (MonthList[m].avgwindspeed * Math.Sin(Trig.DegToRad(domdir))) * MonthList[m].samples;
totalwinddirY += (MonthList[m].avgwindspeed * Math.Cos(Trig.DegToRad(domdir))) * MonthList[m].samples;
// increment the total wind vectors for the annual calculation
totalwinddirX += (MonthList[m].avgwindspeed * Math.Sin(Trig.DegToRad(domdir))) * MonthList[m].samples;
totalwinddirY += (MonthList[m].avgwindspeed * Math.Cos(Trig.DegToRad(domdir))) * MonthList[m].samples;
}
output.Add(repLine.ToString());
}
catch (Exception e)
{
cumulus.LogMessage($"CreateYearlyReport: Error creating wind section: {e.Message}");
cumulus.LogDebugMessage("CreateYearlyReport: Last line generated was...");
cumulus.LogDebugMessage($"CreateYearlyReport: \"{repLine}\"");
throw;
}
output.Add(repLine.ToString());
}

output.Add("------------------------------");
}
catch (Exception e)
{
cumulus.LogMessage($"CreateYearlyReport: Error creating the report: {e.Message}");
cumulus.LogDebugMessage("CreateYearlyReport: Last two lines generated were...");
cumulus.LogDebugMessage($"CreateYearlyReport: \"{output[output.Count - 2]}\"");
cumulus.LogDebugMessage($"CreateYearlyReport: \"{output[output.Count - 1]}\"");
cumulus.LogDebugMessage("CreateYearlyReport: Output generated so far was...");
cumulus.LogDebugMessage(string.Join("\n",output));
throw;
}

Expand Down
6 changes: 6 additions & 0 deletions CumulusMX/StationSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,12 @@ internal string UpdateStationConfig(IHttpContext context)
// Display Options
try
{
// bug catch incase user has the old JSON config files that do not work.
if (settings.DisplayOptions.windrosepoints == 0)
settings.DisplayOptions.windrosepoints = 8;
else if (settings.DisplayOptions.windrosepoints == 1)
settings.DisplayOptions.windrosepoints = 16;

cumulus.NumWindRosePoints = settings.DisplayOptions.windrosepoints;
cumulus.WindRoseAngle = 360.0 / cumulus.NumWindRosePoints;
cumulus.DisplayOptions.UseApparent = settings.DisplayOptions.useapparent;
Expand Down
15 changes: 14 additions & 1 deletion Updates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@
——————————————
- Fix: Improve the AWEKAS fall back for upload interval to go right back to 5 minutes in two stages
- Fix: Occasional corrupt files output that have processed web tags in them
- Fix: Add additional error logging to NOAA report generation
- Fix: Error creating the NOAA Year report for some people
- Fix: Missing station location on gauges.htm web site page

- New: Default website now removes the "Current Conditions" element if the value is blank
- New: Default web site now auto updates the index.htm and today.htm pages every minute

- Change: The current conditions is now HTML encoded in case it contains illegal characters

- Updated default web site files
\web\websitedataT.json
\webfiles\index.htm
\webfiles\gauges.htm
\webfiles\js\setpagedata.js



3.10.1 - b3116
Expand Down

0 comments on commit f317daa

Please sign in to comment.