add some debug statements and fix presets file loading

This commit is contained in:
Andrew Welker
2020-12-09 16:18:21 -07:00
parent 3e56859943
commit f8ae6264f7
3 changed files with 6 additions and 2 deletions

View File

@@ -17,7 +17,7 @@ namespace PepperDash.Essentials.Room.Config
[JsonProperty("techPin")] [JsonProperty("techPin")]
public string TechPin; public string TechPin;
[JsonProperty("presetFileName")] [JsonProperty("presetsFileName")]
public string PresetsFileName; public string PresetsFileName;
[JsonProperty("scheduledEvents")] [JsonProperty("scheduledEvents")]

View File

@@ -34,7 +34,7 @@ namespace PepperDash.Essentials
_tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName); _tunerPresets = new DevicePresetsModel(String.Format("{0}-presets", config.Key), _config.PresetsFileName);
_tunerPresets.LoadChannels(); _tunerPresets.SetFileName(_config.PresetsFileName);
_tunerPresets.PresetChanged += TunerPresetsOnPresetChanged; _tunerPresets.PresetChanged += TunerPresetsOnPresetChanged;

View File

@@ -106,6 +106,8 @@ namespace PepperDash.Essentials.Core.Presets
public void SetFileName(string path) public void SetFileName(string path)
{ {
_filePath = ListPathPrefix + path; _filePath = ListPathPrefix + path;
Debug.Console(2, this, "Setting presets file path to {0}", _filePath);
LoadChannels(); LoadChannels();
} }
@@ -114,6 +116,8 @@ namespace PepperDash.Essentials.Core.Presets
try try
{ {
_fileOps.Enter(); _fileOps.Enter();
Debug.Console(2, this, "Loading presets from {0}", _filePath);
PresetsAreLoaded = false; PresetsAreLoaded = false;
try try
{ {