Skip to content

Commit

Permalink
B3046
Browse files Browse the repository at this point in the history
- Weather Diary
	- Added Weather Diary page to manegement interface
	- Added diary.db file to daily backup files
	- Removed diary.db from distribution (it is created on first use to avoid overwriting the file on CMX distro updates)

- Web Tags
	- Added <#snowdepth> tag processing

- ET annual rollover fix

- Fix to TLS 1.2 FTPS of the 'periodic' files
  • Loading branch information
mcrossley committed Jan 2, 2019
1 parent e95481f commit 6f07143
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
41 changes: 22 additions & 19 deletions CumulusMX/Cumulus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class Cumulus
{
/////////////////////////////////
public string Version = "3.0.0";
public string Build = "3046test";
public string Build = "3046";
/////////////////////////////////

private static string appGuid = "57190d2e-7e45-4efb-8c09-06a176cef3f3";
Expand Down Expand Up @@ -379,10 +379,10 @@ public struct TExtraFiles

public string Platform;

public string dbfile = "cumulusmx.db";
public string dbfile;
public SQLiteConnection LogDB;

public string diaryfile = "diary.db";
public string diaryfile;
public SQLiteConnection DiaryDB;

public string Datapath;
Expand Down Expand Up @@ -779,8 +779,8 @@ public struct TExtraFiles


/*
CryptoLicense lic = new CryptoLicense();
CryptoLicense lic = new CryptoLicense();
//create code for applicationsecret
byte[] applicationSecret = Convert.FromBase64String("QpJGpsqWfkKu+yM8Ljp6+A==");
Expand Down Expand Up @@ -877,7 +877,7 @@ private void DoLicenseCheck()
}
Console.WriteLine("Licence is valid");
}
}
*/
Expand All @@ -888,13 +888,13 @@ public Cumulus(int HTTPport, int WSport)

/*lic.ValidationKey = "AMAAMACrfxYrYEOGd+D5ypZ32bnLCvviBrTlejReXNRdvgWzSgyvdfkLvNDvDX1WuMh2JIEDAAEAAQ==";
// Load license from the file
lic.StorageMode = LicenseStorageMode.ToFile;
if (lic.Load("licence.lic") == false)
// Load license from the file
lic.StorageMode = LicenseStorageMode.ToFile;
if (lic.Load("licence.lic") == false)
throw new Exception("License could not be loaded");
// Validate the license using .Status property
if (lic.Status != LicenseStatus.Valid)
// Validate the license using .Status property
if (lic.Status != LicenseStatus.Valid)
throw new Exception("license validation failed");
*/

Expand Down Expand Up @@ -1038,6 +1038,9 @@ public Cumulus(int HTTPport, int WSport)
backuppath = "backup" + DirectorySeparator;
ReportPath = "Reports" + DirectorySeparator;

dbfile = Datapath + "cumulusmx.db";
diaryfile = Datapath + "diary.db";

AlltimeFile = Datapath + "alltime.rec";
AlltimeIniFile = Datapath + "alltime.ini";
Alltimelogfile = Datapath + "alltimelog.txt";
Expand Down Expand Up @@ -1105,12 +1108,12 @@ public Cumulus(int HTTPport, int WSport)

// Open database (create file if it doesn't exist)
SQLiteOpenFlags flags = SQLiteOpenFlags.Create | SQLiteOpenFlags.ReadWrite;
LogDB = new SQLiteConnection(Datapath + dbfile, flags);
LogDB = new SQLiteConnection(dbfile, flags);

LogDB.CreateTable<StandardData>();

// Open diary database (create file if it doesn't exist)
DiaryDB = new SQLiteConnection(Datapath + diaryfile, flags);
DiaryDB = new SQLiteConnection(diaryfile, flags);

DiaryDB.CreateTable<DiaryData>();

Expand Down Expand Up @@ -1713,9 +1716,9 @@ private void APRSTimerTick(object sender, ElapsedEventArgs e)

private void WebTimerTick(object sender, ElapsedEventArgs e)
{
if (!WebUpdating)
if (!WebUpdating)
{
WebUpdating = true;
WebUpdating = true;
ftpThread = new Thread(DoHTMLFiles);
ftpThread.IsBackground = true;
ftpThread.Start();
Expand Down Expand Up @@ -4376,7 +4379,7 @@ private void ReadStringsFile()
public bool DavisStation { get; set; }
public string TempTrendFormat { get; set; }
public string AppDir { get; set; }

public int Manufacturer { get; set; }
public int ImetLoggerInterval { get; set; }
public TimeSpan DayLength { get; set; }
Expand Down Expand Up @@ -5318,7 +5321,7 @@ public void Stop()
WriteIniFile();

//httpServer.Stop();

//if (httpServer != null) httpServer.Dispose();

if (station != null)
Expand All @@ -5344,7 +5347,7 @@ public void ExecuteProgram(string externalProgram, string externalParams)
start.FileName = externalProgram;
// Dont show a console window
start.CreateNoWindow = true;
// Run the external process
// Run the external process
Process.Start(start);
}

Expand Down Expand Up @@ -5478,7 +5481,7 @@ private void DoFTPLogin()
conn.DataConnectionEncryption = true;
conn.ValidateCertificate += Client_ValidateCertificate;
// b3045 - switch from System.Net.Ftp.Client to FluentFTP allows us to specifiy protocols
RealtimeFTP.SslProtocols = SslProtocols.Default | SslProtocols.Tls11 | SslProtocols.Tls12;
conn.SslProtocols = SslProtocols.Default | SslProtocols.Tls11 | SslProtocols.Tls12;
}

if (ActiveFTPMode)
Expand Down
4 changes: 2 additions & 2 deletions CumulusMX/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("CumulusMX - test")]
[assembly: AssemblyTitle("CumulusMX")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CumulusMX - test")]
[assembly: AssemblyProduct("CumulusMX")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
13 changes: 9 additions & 4 deletions CumulusMX/WeatherStation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6281,17 +6281,22 @@ public void DoET(double value, DateTime timestamp)
noET = false;
}

if ((value == 0) && (StartofdayET > 0))
//if ((value == 0) && (StartofdayET > 0))
if (value < StartofdayET) // change b3046
{
// ET reset
cumulus.LogMessage("*** ET Reset");
cumulus.LogMessage("*** ET Reset *** AnnualET: " + AnnualETTotal.ToString("#.##") + " StartofdayET: " + StartofdayET.ToString("#.##") + " StationET: " + value.ToString("#.##") + " CurrentET: " + ET.ToString("#.##"));
AnnualETTotal = value; // add b3046
// set the start of day figure so it reflects the ET
// so far today
StartofdayET = AnnualETTotal - ET;
WriteTodayFile(timestamp, false);
cumulus.LogMessage("New ET values. AnnualET: " + AnnualETTotal.ToString("#.##") + " StartofdayET: " + StartofdayET.ToString("#.##") + " StationET: " + value.ToString("#.##") + " CurrentET: " + ET.ToString("#.##"));
}
else
{
AnnualETTotal = value;
}

AnnualETTotal = value;

ET = AnnualETTotal - StartofdayET;

Expand Down
11 changes: 8 additions & 3 deletions Updates.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,17 @@

- Fix for Slovenian locale (and any other with a two character date separator)

3046test
========

3046
====
- Weather Diary
- Added Weather Diary page to manegement interface
- Added diary.db file to daily backup files
- Removed diary.db from distribution (it is created on first use to avoid overwriting the file on CMX distro updates)

- Web Tags
- Added <#snowdepth> tag
- Added <#snowdepth> tag processing

- ET annual rollover fix

- Fix to TLS 1.2 FTPS of the 'periodic' files

0 comments on commit 6f07143

Please sign in to comment.