mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-01-11 19:44:55 +00:00
feat(IcdEnvironment):Updated environment to sperate Crestron platform for environment for SW on VC4
This commit is contained in:
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Changed
|
||||
- IcdEnvironment - Added CrestronDevicePlatform, removed from CrestronRuntimeEnvironment, to support SimplWindows on VC-4
|
||||
|
||||
## [16.0.5] 2022-07-11
|
||||
### Changed
|
||||
|
||||
@@ -194,14 +194,16 @@ namespace ICD.Common.Utils
|
||||
{
|
||||
// Cache the runtime environment
|
||||
s_Framework = eFramework.Crestron;
|
||||
|
||||
if (CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SIMPL)
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Simpl;
|
||||
else if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Appliance;
|
||||
else
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Server;
|
||||
|
||||
s_CrestronRuntimeEnvironment = CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SIMPL
|
||||
? eCrestronRuntimeEnvironment.SimplPlus
|
||||
: eCrestronRuntimeEnvironment.SimplSharpPro;
|
||||
|
||||
s_CrestronDevicePlatform = CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance
|
||||
? eCrestronDevicePlatform.Appliance
|
||||
: eCrestronDevicePlatform.Server;
|
||||
|
||||
// todo: Make this check more robust
|
||||
s_CrestronSeries = Type.GetType("Mono.Runtime") != null ? eCrestronSeries.FourSeries : eCrestronSeries.ThreeSeries;
|
||||
|
||||
CrestronEnvironment.ProgramStatusEventHandler += CrestronEnvironmentOnProgramStatusEventHandler;
|
||||
|
||||
@@ -107,20 +107,10 @@ namespace ICD.Common.Utils
|
||||
|
||||
static IcdEnvironment()
|
||||
{
|
||||
#if NETFRAMEWORK
|
||||
s_Framework = eFramework.Framework;
|
||||
s_CrestronSeries = eCrestronSeries.FourSeries;
|
||||
if (CrestronEnvironment.RuntimeEnvironment == eRuntimeEnvironment.SIMPL)
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Simpl;
|
||||
else if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Appliance;
|
||||
else
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Server;
|
||||
#else
|
||||
s_Framework = eFramework.Standard;
|
||||
s_CrestronSeries = eCrestronSeries.Na;
|
||||
s_CrestronRuntimeEnvironment = eCrestronRuntimeEnvironment.Na;
|
||||
#endif
|
||||
s_CrestronDevicePlatform = eCrestronDevicePlatform.Na;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -32,9 +32,15 @@ namespace ICD.Common.Utils
|
||||
public enum eCrestronRuntimeEnvironment
|
||||
{
|
||||
Na, //Non-Crestron
|
||||
Simpl, // Running in Simpl, Non-Pro
|
||||
Appliance, // S#Pro running on a Crestron hardware appliance
|
||||
Server // S#Pro running on a server (VC-4)
|
||||
SimplPlus, // Running in Simpl+, Non-Pro
|
||||
SimplSharpPro // Running in Simpl#Pro
|
||||
}
|
||||
|
||||
public enum eCrestronDevicePlatform
|
||||
{
|
||||
Na, // Non-Crestron
|
||||
Appliance, // Running on Crestron hardware appliance
|
||||
Server // Running on VC-4 Server
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -120,14 +126,24 @@ namespace ICD.Common.Utils
|
||||
private static readonly eFramework s_Framework;
|
||||
private static readonly eCrestronSeries s_CrestronSeries;
|
||||
private static readonly eCrestronRuntimeEnvironment s_CrestronRuntimeEnvironment;
|
||||
private static readonly eCrestronDevicePlatform s_CrestronDevicePlatform;
|
||||
|
||||
private static readonly SafeCriticalSection s_ProgramInitializationSection = new SafeCriticalSection();
|
||||
private static bool s_ProgramInitializationComplete;
|
||||
|
||||
public static eFramework Framework {get { return s_Framework; }}
|
||||
public static eCrestronSeries CrestronSeries {get { return s_CrestronSeries; }}
|
||||
|
||||
/// <summary>
|
||||
/// Crestron environment being run in, SimplPlus or SimplSharpPro
|
||||
/// </summary>
|
||||
public static eCrestronRuntimeEnvironment CrestronRuntimeEnvironment {get { return s_CrestronRuntimeEnvironment; }}
|
||||
|
||||
/// <summary>
|
||||
/// Crestron platform being run on, Appliance (crestron hardware) or Server (VC-4)
|
||||
/// </summary>
|
||||
public static eCrestronDevicePlatform CrestronDevicePlatform { get { return s_CrestronDevicePlatform; } }
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if the program has been flagged as completely initialized.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user