Merge pull request #1130 from PepperDash/feature/systemmonitor-programinfo-update

Update systemMonitor class to append Essentials version number
This commit is contained in:
Andrew Welker
2023-10-26 08:53:06 -06:00
committed by GitHub

View File

@@ -563,11 +563,11 @@ namespace PepperDash.Essentials.Core.Monitoring
ProgramUnregisteredFeedback = ProgramUnregisteredFeedback =
new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister); new BoolFeedback(() => Program.RegistrationState == eProgramRegistrationState.Unregister);
ProgramUnregisteredFeedback.FireUpdate(); ProgramUnregisteredFeedback.FireUpdate();
ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile); ProgramNameFeedback = new StringFeedback(() => ProgramInfo.ProgramFile);
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime); ProgramCompileTimeFeedback = new StringFeedback(() => ProgramInfo.CompileTime);
CrestronDataBaseVersionFeedback = new StringFeedback(() => ProgramInfo.CrestronDb);
EnvironmentVersionFeedback = new StringFeedback(() => ProgramInfo.Environment);
AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo)); AggregatedProgramInfoFeedback = new StringFeedback(() => JsonConvert.SerializeObject(ProgramInfo));
GetProgramInfo(); GetProgramInfo();
@@ -620,9 +620,9 @@ namespace PepperDash.Essentials.Core.Monitoring
// Assume no valid program info. Constructing a new object will wipe all properties // Assume no valid program info. Constructing a new object will wipe all properties
ProgramInfo = new ProgramInfo(Program.Number) ProgramInfo = new ProgramInfo(Program.Number)
{ {
OperatingState = Program.OperatingState, OperatingState = Program.OperatingState,
RegistrationState = Program.RegistrationState RegistrationState = Program.RegistrationState
}; };
UpdateFeedbacks(); UpdateFeedbacks();
@@ -639,13 +639,20 @@ namespace PepperDash.Essentials.Core.Monitoring
if (ProgramInfo.ProgramFile.Contains(".dll")) if (ProgramInfo.ProgramFile.Contains(".dll"))
{ {
// SSP Program // SSP Program
ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ": ", "\n"); ProgramInfo.FriendlyName = ParseConsoleData(response, "Friendly Name", ": ", "\n");
ProgramInfo.ApplicationName = ParseConsoleData(response, "Application Name", ": ", "\n"); ProgramInfo.ApplicationName = ParseConsoleData(response, "Application Name", ": ", "\n");
ProgramInfo.ProgramTool = ParseConsoleData(response, "Program Tool", ": ", "\n"); ProgramInfo.ProgramTool = ParseConsoleData(response, "Program Tool", ": ", "\n");
ProgramInfo.MinFirmwareVersion = ParseConsoleData(response, "Min Firmware Version", ": ", ProgramInfo.MinFirmwareVersion = ParseConsoleData(response, "Min Firmware Version", ": ",
"\n"); "\n");
ProgramInfo.PlugInVersion = ParseConsoleData(response, "PlugInVersion", ": ", "\n"); ProgramInfo.PlugInVersion = ParseConsoleData(response, "PlugInVersion", ": ", "\n");
ProgramInfo.ProgramFile += string.Format(" {0}.{1}.{2}",
ProgramInfo.CompilerRevisionInfo.Major,
ProgramInfo.CompilerRevisionInfo.Minor,
ProgramInfo.CompilerRevisionInfo.Build);
ProgramInfo.Environment = ProgramInfo.ProgramTool;
} }
else if (ProgramInfo.ProgramFile.Contains(".smw")) else if (ProgramInfo.ProgramFile.Contains(".smw"))
{ {
@@ -736,6 +743,15 @@ namespace PepperDash.Essentials.Core.Monitoring
[JsonProperty("compilerRevision")] [JsonProperty("compilerRevision")]
public string CompilerRevision { get; set; } public string CompilerRevision { get; set; }
[JsonIgnore]
public Version CompilerRevisionInfo
{
get
{
return new Version(CompilerRevision);
}
}
[JsonProperty("compileTime")] [JsonProperty("compileTime")]
public string CompileTime { get; set; } public string CompileTime { get; set; }
@@ -776,7 +792,7 @@ namespace PepperDash.Essentials.Core.Monitoring
ProgramFile = ""; ProgramFile = "";
FriendlyName = ""; FriendlyName = "";
CompilerRevision = ""; CompilerRevision = "";
CompileTime = ""; CompileTime = "";
Include4Dat = ""; Include4Dat = "";
SystemName = ""; SystemName = "";