feat(essentials): Reworks logic in InitializeSystem() to be a bit cleaner using a CEvent and the existing AllDeviceActivated event

This commit is contained in:
Neil Dorin
2021-09-24 17:25:14 -06:00
parent c521a1d551
commit 1e9139f38e
3 changed files with 24 additions and 8 deletions

View File

@@ -28,11 +28,9 @@ namespace PepperDash.Essentials.Core
public static List<IKeyed> AllDevices { get { return new List<IKeyed>(Devices.Values); } }
public static bool AddDeviceEnabled;
public static bool AllDevicesActivatedFb;
public static void Initialize(CrestronControlSystem cs)
{
AllDevicesActivatedFb = false;
AddDeviceEnabled = true;
CrestronConsole.AddNewConsoleCommand(ListDeviceCommStatuses, "devcommstatus", "Lists the communication status of all devices",
ConsoleAccessLevelEnum.AccessOperator);
@@ -124,7 +122,6 @@ namespace PepperDash.Essentials.Core
private static void OnAllDevicesActivated()
{
AllDevicesActivatedFb = true;
var handler = AllDevicesActivated;
if (handler != null)
{

View File

@@ -32,6 +32,16 @@ namespace PepperDash.Essentials.Core
// TODO: consider making this configurable later
public static IFormatProvider Culture = CultureInfo.CreateSpecificCulture("en-US");
/// <summary>
/// True when the processor type is a DMPS variant
/// </summary>
public static bool ControlSystemIsDmpsType
{
get
{
return ControlSystem.ControllerPrompt.ToLower().IndexOf("dmps") > -1;
}
}
/// <summary>
/// The file path prefix to the folder containing configuration files