Skip to content

Commit

Permalink
b3066
Browse files Browse the repository at this point in the history
  • Loading branch information
mcrossley committed Mar 5, 2020
1 parent 1111364 commit 9c28c30
Show file tree
Hide file tree
Showing 6 changed files with 287 additions and 111 deletions.
15 changes: 14 additions & 1 deletion CumulusMX/AlarmSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,11 @@ public string GetAlarmSettings()

contactLostEnabled = cumulus.SensorAlarmEnabled,
contactLostSoundEnabled = cumulus.SensorAlarmSound,
contactLostSound = cumulus.SensorAlarmSoundFile
contactLostSound = cumulus.SensorAlarmSoundFile,

dataStoppedEnabled = cumulus.DataStoppedAlarmEnabled,
dataStoppedSoundEnabled = cumulus.DataStoppedAlarmSound,
dataStoppedSound = cumulus.DataStoppedAlarmSoundFile
};

var retObject = new JsonAlarmSettings()
Expand Down Expand Up @@ -164,6 +168,10 @@ public string UpdateAlarmSettings(IHttpContext context)
cumulus.SensorAlarmSound = settings.contactLostSoundEnabled;
cumulus.SensorAlarmSoundFile = settings.contactLostSound;

cumulus.DataStoppedAlarmEnabled = settings.dataStoppedEnabled;
cumulus.DataStoppedAlarmSound = settings.dataStoppedSoundEnabled;
cumulus.DataStoppedAlarmSoundFile = settings.dataStoppedSound;

// Save the settings
cumulus.WriteIniFile();

Expand Down Expand Up @@ -234,6 +242,11 @@ public class JsonAlarmSettingsData
public bool contactLostEnabled;
public bool contactLostSoundEnabled;
public string contactLostSound;

public bool dataStoppedEnabled;
public bool dataStoppedSoundEnabled;
public string dataStoppedSound;

}

public class JsonAlarmUnits
Expand Down
23 changes: 20 additions & 3 deletions CumulusMX/Cumulus.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ namespace CumulusMX
public class Cumulus
{
/////////////////////////////////
public string Version = "3.4.1";
public string Build = "3065";
public string Version = "3.4.2";
public string Build = "3066";
/////////////////////////////////

private const string appGuid = "57190d2e-7e45-4efb-8c09-06a176cef3f3";
Expand Down Expand Up @@ -3437,6 +3437,11 @@ private void ReadIniFile()
SensorAlarmSoundFile = ini.GetValue("Alarms", "SensorAlarmSoundFile", DefaultSoundFile);
if (SensorAlarmSoundFile.Contains(DefaultSoundFileOld)) SensorAlarmSoundFile = DefaultSoundFile;

DataStoppedAlarmEnabled = ini.GetValue("Alarms", "DataStoppedAlarmSet", false);
DataStoppedAlarmSound = ini.GetValue("Alarms", "DataStoppedAlarmSound", false);
DataStoppedAlarmSoundFile = ini.GetValue("Alarms", "DataStoppedlarmSoundFile", DefaultSoundFile);
if (DataStoppedAlarmSoundFile.Contains(DefaultSoundFileOld)) SensorAlarmSoundFile = DefaultSoundFile;

PressOffset = ini.GetValue("Offsets", "PressOffset", 0.0);
TempOffset = ini.GetValue("Offsets", "TempOffset", 0.0);
HumOffset = ini.GetValue("Offsets", "HumOffset", 0);
Expand Down Expand Up @@ -3938,6 +3943,10 @@ internal void WriteIniFile()
ini.SetValue("Alarms", "SensorAlarmSound", SensorAlarmSound);
ini.SetValue("Alarms", "SensorAlarmSoundFile", SensorAlarmSoundFile);

ini.SetValue("Alarms", "DataStoppedAlarmSet", DataStoppedAlarmEnabled);
ini.SetValue("Alarms", "DataStoppedAlarmSound", DataStoppedAlarmSound);
ini.SetValue("Alarms", "DataStoppedAlarmSoundFile", DataStoppedAlarmSoundFile);

ini.SetValue("Offsets", "PressOffset", PressOffset);
ini.SetValue("Offsets", "TempOffset", TempOffset);
ini.SetValue("Offsets", "HumOffset", HumOffset);
Expand Down Expand Up @@ -4350,6 +4359,14 @@ private void ReadStringsFile()
}
}

public string DataStoppedAlarmSoundFile { get; set; }

public bool DataStoppedAlarmSound { get; set; }

public bool DataStoppedAlarmEnabled { get; set; }

//public bool DataStoppedAlarmState { get; set; }

public string SensorAlarmSoundFile { get; set; }

public bool SensorAlarmSound { get; set; }
Expand Down Expand Up @@ -6582,7 +6599,7 @@ public void StartTimers()
// start the general one-minute timer
LogMessage("Starting 1-minute timer");
station.StartMinuteTimer();
LogMessage("Data logging intverval = " + DataLogInterval);
LogMessage("Data logging interval = " + DataLogInterval);

if (RealtimeFTPEnabled)
{
Expand Down
Loading

0 comments on commit 9c28c30

Please sign in to comment.