Skip to content

Commit

Permalink
Merge pull request #162 from mcrossley/master
Browse files Browse the repository at this point in the history
v3.22.2
  • Loading branch information
mcrossley authored Oct 16, 2022
2 parents 96eed42 + 1f03b8e commit cc8173d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
6 changes: 3 additions & 3 deletions CumulusMX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Cumulus MX")]
[assembly: AssemblyDescription("Version 3.22.1 - Build 3212")]
[assembly: AssemblyDescription("Version 3.22.2 - Build 3213")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Cumulus MX")]
Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.22.1.3212")]
[assembly: AssemblyFileVersion("3.22.1.3212")]
[assembly: AssemblyVersion("3.22.2.3213")]
[assembly: AssemblyFileVersion("3.22.2.3213")]
18 changes: 7 additions & 11 deletions CumulusMX/WeatherStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
using ServiceStack.Text;
using System.Web;
using System.Threading.Tasks;
using static System.Collections.Specialized.BitVector32;
using ServiceStack;
using System.Reactive;

namespace CumulusMX
{
Expand Down Expand Up @@ -6273,9 +6270,8 @@ public void RemoveOld10MinWindData(DateTime ts)

public void DoTrendValues(DateTime ts, bool rollover = false)
{
double trendval, retVal;
double trendval;
List<RecentData> retVals;
List<Double> retDbl;
var recTs = ts;

// if this is the special case of rollover processing, we want the High today record to on the previous day at 23:59 or 08:59
Expand Down Expand Up @@ -6406,15 +6402,15 @@ public void DoTrendValues(DateTime ts, bool rollover = false)

try
{
retDbl = RecentDataDb.Query<Double>("select raincounter from RecentData where Timestamp >= ? order by Timestamp limit 1", ts.AddMinutes(-5.5));
retVals = RecentDataDb.Query<RecentData>("select raincounter from RecentData where Timestamp >= ? order by Timestamp limit 1", ts.AddMinutes(-5.5));

if (retDbl.Count != 1 || Raincounter < retDbl[0])
if (retVals.Count != 1 || Raincounter < retVals[0].raincounter)
{
RainRate = 0;
}
else
{
var raindiff = Math.Round(Raincounter - retDbl[0], cumulus.RainDPlaces);
var raindiff = Math.Round(Raincounter - retVals[0].raincounter, cumulus.RainDPlaces);
//cumulus.LogMessage("raindiff = " + raindiff);

var timediffhours = 1.0 / 12.0;
Expand Down Expand Up @@ -6481,15 +6477,15 @@ public void DoTrendValues(DateTime ts, bool rollover = false)
// calculate and display rainfall in last 24 hour
try
{
retDbl = RecentDataDb.Query<Double>("select raincounter from RecentData where Timestamp >= ? order by Timestamp limit 1", ts.AddDays(-1));
retVals = RecentDataDb.Query<RecentData>("select raincounter from RecentData where Timestamp >= ? order by Timestamp limit 1", ts.AddDays(-1));

if (retDbl.Count != 1 || Raincounter < retDbl[0])
if (retVals.Count != 1 || Raincounter < retVals[0].raincounter)
{
RainLast24Hour = 0;
}
else
{
trendval = Math.Round(Raincounter - retDbl[0], cumulus.RainDPlaces);
trendval = Math.Round(Raincounter - retVals[0].raincounter, cumulus.RainDPlaces);

if (trendval < 0)
{
Expand Down
6 changes: 6 additions & 0 deletions Updates.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
3.22.2 - b3213
——————————————
Fixed
- Broken 24hr rain and rain rate in v3.22.1


3.22.1 - b3212
——————————————
Fixed
Expand Down

0 comments on commit cc8173d

Please sign in to comment.