diff --git a/PepperDashEssentials/ControlSystem.cs b/PepperDashEssentials/ControlSystem.cs
index 3dc62c43..3ffacd2f 100644
--- a/PepperDashEssentials/ControlSystem.cs
+++ b/PepperDashEssentials/ControlSystem.cs
@@ -12,10 +12,10 @@ using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Fusion;
using PepperDash.Essentials.Core.Rooms.Config;
+using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.DM;
-using PepperDash.Essentials.Fusion;
-using PepperDash.Essentials.Room.Config;
using Newtonsoft.Json;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
@@ -429,18 +429,15 @@ namespace PepperDash.Essentials
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
{
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
- if (room == null)
+ if (room != null)
{
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);'
- return;
- }
+ if (room is EssentialsHuddleSpaceRoom)
+ {
+ DeviceManager.AddDevice(room);
- var huddleRoom = room as EssentialsHuddleSpaceRoom;
- var vtcRoom = room as EssentialsHuddleVtc1Room;
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
+ DeviceManager.AddDevice(new Core.Fusion.EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
- if (huddleRoom != null)
- {
- DeviceManager.AddDevice(huddleRoom);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
@@ -450,11 +447,8 @@ namespace PepperDash.Essentials
{
DeviceManager.AddDevice(room);
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
- // Mobile Control bridge
- var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(huddleRoom);
- AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
- DeviceManager.AddDevice(bridge);
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
+ DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
@@ -466,15 +460,6 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(room);
}
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
- DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController(vtcRoom, 0xf1));
-
- Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
- // Mobile Control bridge
- var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(room);
- AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
- DeviceManager.AddDevice(bridge);
- continue;
}
else
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
diff --git a/PepperDashEssentials/ControlSystemOld.cs b/PepperDashEssentials/ControlSystemOld.cs
new file mode 100644
index 00000000..9edbbbc3
--- /dev/null
+++ b/PepperDashEssentials/ControlSystemOld.cs
@@ -0,0 +1,574 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Crestron.SimplSharp;
+using Crestron.SimplSharp.CrestronIO;
+using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.CrestronThread;
+using Crestron.SimplSharpPro.Diagnostics;
+using Crestron.SimplSharp.Reflection;
+
+using PepperDash.Core;
+using PepperDash.Essentials.Core;
+using PepperDash.Essentials.Core.Bridges;
+using PepperDash.Essentials.Core.Config;
+using PepperDash.Essentials.Core.Rooms.Config;
+using PepperDash.Essentials.DM;
+using PepperDash.Essentials.Fusion;
+using PepperDash.Essentials.Room.Config;
+
+using Newtonsoft.Json;
+using PepperDash.Essentials.Core.DeviceTypeInterfaces;
+using EssentialsRoomConfigHelper = PepperDash.Essentials.Core.Rooms.Config.EssentialsRoomConfigHelper;
+
+namespace PepperDash.Essentials
+{
+ public class ControlSystem : CrestronControlSystem
+ {
+ HttpLogoServer LogoServer;
+
+ private CTimer _startTimer;
+ private const long StartupTime = 500;
+
+ public ControlSystem()
+ : base()
+ {
+ Thread.MaxNumberOfUserThreads = 400;
+ Global.ControlSystem = this;
+ DeviceManager.Initialize(this);
+ SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
+ }
+
+ ///
+ /// Entry point for the program
+ ///
+ public override void InitializeSystem()
+ {
+ _startTimer = new CTimer(StartSystem,StartupTime);
+ }
+
+ private void StartSystem(object obj)
+ {
+ DeterminePlatform();
+
+ if (Debug.DoNotLoadOnNextBoot)
+ {
+ CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
+ ConsoleAccessLevelEnum.AccessOperator);
+ }
+
+ CrestronConsole.AddNewConsoleCommand(PluginLoader.ReportAssemblyVersions, "reportversions", "Reports the versions of the loaded assemblies", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(PepperDash.Essentials.Core.DeviceFactory.GetDeviceFactoryTypes, "gettypes", "Gets the device types that can be built. Accepts a filter string.", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(BridgeHelper.PrintJoinMap, "getjoinmap", "map(s) for bridge or device on bridge [brKey [devKey]]", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "CONSOLE MESSAGE: {0}", s);
+ }, "appdebugmessage", "Writes message to log", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ foreach (var tl in TieLineCollection.Default)
+ CrestronConsole.ConsoleCommandResponse(" {0}\r", tl);
+ },
+ "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ CrestronConsole.ConsoleCommandResponse
+ ("Current running configuration. This is the merged system and template configuration");
+ CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
+ (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
+ }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
+
+ CrestronConsole.AddNewConsoleCommand(s =>
+ {
+ CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
+ "System URL: {0}\r" +
+ "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
+ }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
+
+
+ CrestronConsole.AddNewConsoleCommand(DeviceManager.GetRoutingPorts,
+ "getroutingports", "Reports all routing ports, if any. Requires a device key", ConsoleAccessLevelEnum.AccessOperator);
+
+ if (!Debug.DoNotLoadOnNextBoot)
+ {
+ GoWithLoad();
+ return;
+ }
+
+ SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
+ }
+
+ ///
+ /// Determines if the program is running on a processor (appliance) or server (VC-4).
+ ///
+ /// Sets Global.FilePathPrefix and Global.ApplicationDirectoryPathPrefix based on platform
+ ///
+ public void DeterminePlatform()
+ {
+ try
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
+
+ string filePathPrefix;
+
+ var dirSeparator = Global.DirectorySeparator;
+
+ string directoryPrefix;
+
+ directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
+
+ var fullVersion = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyInformationalVersionAttribute), false);
+
+ AssemblyInformationalVersionAttribute fullVersionAtt = fullVersion[0] as AssemblyInformationalVersionAttribute;
+
+ Global.SetAssemblyVersion(fullVersionAtt.InformationalVersion);
+
+ if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) // Handles 3-series running Windows CE OS
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", Global.AssemblyVersion);
+
+ // Check if User/ProgramX exists
+ if (Directory.Exists(Global.ApplicationDirectoryPathPrefix + dirSeparator + "User"
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
+ {
+ Debug.Console(0, @"User/program{0} directory found", InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + "User"
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ // Check if Nvram/Programx exists
+ else if (Directory.Exists(directoryPrefix + dirSeparator + "Nvram"
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber)))
+ {
+ Debug.Console(0, @"Nvram/program{0} directory found", InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + "Nvram"
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ // If neither exists, set path to User/ProgramX
+ else
+ {
+ Debug.Console(0, @"No previous directory found. Using User/program{0}", InitialParametersClass.ApplicationNumber);
+ filePathPrefix = directoryPrefix + dirSeparator + "User"
+ + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
+ }
+ }
+ else // Handles Linux OS (Virtual Control)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on Virtual Control Server", Global.AssemblyVersion);
+
+ // Set path to User/
+ filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
+ }
+
+ Global.SetFilePathPrefix(filePathPrefix);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "Unable to Determine Platform due to Exception: {0}", e.Message);
+ }
+ }
+
+ ///
+ /// Begins the process of loading resources including plugins and configuration data
+ ///
+ public void GoWithLoad()
+ {
+ try
+ {
+ Debug.SetDoNotLoadOnNextBoot(false);
+
+ PluginLoader.AddProgramAssemblies();
+
+ new Core.DeviceFactory();
+ new Devices.Common.DeviceFactory();
+ new DM.DeviceFactory();
+ new DeviceFactory();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
+
+ var filesReady = SetupFilesystem();
+ if (filesReady)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Checking for plugins");
+ PluginLoader.LoadPlugins();
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
+ if (!ConfigReader.LoadConfig2())
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Essentials Load complete with errors");
+ return;
+ }
+
+ Load();
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r\n" +
+ "-------------------------------------------------------------");
+ }
+ else
+ {
+ Debug.Console(0,
+ @"----------------------------------------------
+ ------------------------------------------------
+ ------------------------------------------------
+ Essentials file structure setup completed.
+ Please load config, sgd and ir files and
+ restart program.
+ ------------------------------------------------
+ ------------------------------------------------
+ ------------------------------------------------");
+ }
+
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r\n{0}", e);
+ }
+ finally
+ {
+ // Notify the OS that the program intitialization has completed
+ SystemMonitor.ProgramInitialization.ProgramInitializationComplete = true;
+ }
+
+ }
+
+
+
+ ///
+ /// Verifies filesystem is set up. IR, SGD, and programX folders
+ ///
+ bool SetupFilesystem()
+ {
+ Debug.Console(0, "Verifying and/or creating folder structure");
+ var configDir = Global.FilePathPrefix;
+ var configExists = Directory.Exists(configDir);
+ if (!configExists)
+ Directory.Create(configDir);
+
+ var irDir = Global.FilePathPrefix + "ir";
+ if (!Directory.Exists(irDir))
+ Directory.Create(irDir);
+
+ var sgdDir = Global.FilePathPrefix + "sgd";
+ if (!Directory.Exists(sgdDir))
+ Directory.Create(sgdDir);
+
+ var pluginDir = Global.FilePathPrefix + "plugins";
+ if (!Directory.Exists(pluginDir))
+ Directory.Create(pluginDir);
+
+ return configExists;
+ }
+
+ ///
+ ///
+ ///
+ public void TearDown()
+ {
+ Debug.Console(0, "Tearing down existing system");
+ DeviceManager.DeactivateAll();
+
+ TieLineCollection.Default.Clear();
+
+ foreach (var key in DeviceManager.GetDevices())
+ DeviceManager.RemoveDevice(key);
+
+ Debug.Console(0, "Tear down COMPLETE");
+ }
+
+ ///
+ ///
+ ///
+ void Load()
+ {
+ LoadDevices();
+ LoadTieLines();
+ LoadRooms();
+ LoadLogoServer();
+
+ DeviceManager.ActivateAll();
+
+ var mobileControl = GetMobileControlDevice();
+
+ if (mobileControl == null) return;
+
+ mobileControl.LinkSystemMonitorToAppServer();
+
+ }
+
+ ///
+ /// Reads all devices from config and adds them to DeviceManager
+ ///
+ public void LoadDevices()
+ {
+
+ // Build the processor wrapper class
+ DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
+
+ // Add global System Monitor device
+ if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
+ {
+ DeviceManager.AddDevice(
+ new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
+ }
+
+ foreach (var devConf in ConfigReader.ConfigObject.Devices)
+ {
+
+ try
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}', type '{1}'", devConf.Key, devConf.Type);
+ // Skip this to prevent unnecessary warnings
+ if (devConf.Key == "processor")
+ {
+ if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
+ Debug.Console(0,
+ "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
+ devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
+
+ // Check if the processor is a DMPS model
+ if (this.ControllerPrompt.IndexOf("dmps", StringComparison.OrdinalIgnoreCase) > -1)
+ {
+ Debug.Console(2, "Adding DmpsRoutingController for {0} to Device Manager.", this.ControllerPrompt);
+
+ var propertiesConfig = JsonConvert.DeserializeObject(devConf.Properties.ToString());
+
+ if(propertiesConfig == null)
+ propertiesConfig = new DM.Config.DmpsRoutingPropertiesConfig();
+
+ var dmpsRoutingController = DmpsRoutingController.GetDmpsRoutingController("processor-avRouting", this.ControllerPrompt, propertiesConfig);
+
+ DeviceManager.AddDevice(dmpsRoutingController);
+ }
+ else if (this.ControllerPrompt.IndexOf("mpc3", StringComparison.OrdinalIgnoreCase) > -1)
+ {
+ Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
+
+ var butToken = devConf.Properties["buttons"];
+ if (butToken != null)
+ {
+ var buttons = butToken.ToObject>();
+ var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons);
+ DeviceManager.AddDevice(tpController);
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
+ }
+
+ }
+ else
+ {
+ Debug.Console(2, "************Processor is not DMPS type***************");
+ }
+
+
+
+ continue;
+ }
+
+ // Try local factories first
+ IKeyed newDev = null;
+
+ if (newDev == null)
+ newDev = PepperDash.Essentials.Core.DeviceFactory.GetDevice(devConf);
+
+ if (newDev != null)
+ DeviceManager.AddDevice(newDev);
+ else
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key);
+ }
+ catch (Exception e)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
+ }
+ }
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
+
+ }
+
+
+ ///
+ /// Helper method to load tie lines. This should run after devices have loaded
+ ///
+ public void LoadTieLines()
+ {
+ // In the future, we can't necessarily just clear here because devices
+ // might be making their own internal sources/tie lines
+
+ var tlc = TieLineCollection.Default;
+ //tlc.Clear();
+ if (ConfigReader.ConfigObject.TieLines == null)
+ {
+ return;
+ }
+
+ foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
+ {
+ var newTL = tieLineConfig.GetTieLine();
+ if (newTL != null)
+ tlc.Add(newTL);
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
+
+ }
+
+ ///
+ /// Reads all rooms from config and adds them to DeviceManager
+ ///
+ public void LoadRooms()
+ {
+ if (ConfigReader.ConfigObject.Rooms == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Configuration contains no rooms - Is this intentional? This may be a valid configuration.");
+ return;
+ }
+
+ foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
+ {
+ var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
+ if (room == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);'
+ return;
+ }
+
+ var huddleRoom = room as EssentialsHuddleSpaceRoom;
+ var vtcRoom = room as EssentialsHuddleVtc1Room;
+
+ if (huddleRoom != null)
+ {
+ DeviceManager.AddDevice(huddleRoom);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
+
+ CreateMobileControlBridge(room);
+ }
+ else if (room is EssentialsHuddleVtc1Room)
+ {
+ DeviceManager.AddDevice(room);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
+ // Mobile Control bridge
+ var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(huddleRoom);
+ AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
+ DeviceManager.AddDevice(bridge);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
+
+ CreateMobileControlBridge(room);
+ }
+ else
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
+ DeviceManager.AddDevice(room);
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
+ DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController(vtcRoom, 0xf1));
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
+ // Mobile Control bridge
+ var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(room);
+ AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
+ DeviceManager.AddDevice(bridge);
+ continue;
+ }
+ else
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Notice: Cannot create room from config, key '{0}' - Is this intentional? This may be a valid configuration.", roomConfig.Key);
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
+
+ }
+
+ private static void CreateMobileControlBridge(EssentialsRoomBase room)
+ {
+ var mobileControl = GetMobileControlDevice();
+
+ if (mobileControl == null) return;
+
+ mobileControl.CreateMobileControlRoomBridge(room, mobileControl);
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control Bridge Added...");
+ }
+
+ private static IMobileControl GetMobileControlDevice()
+ {
+ var mobileControlList = DeviceManager.AllDevices.OfType().ToList();
+
+ if (mobileControlList.Count > 1)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Warning,
+ "Multiple instances of Mobile Control Server found.");
+
+ return null;
+ }
+
+ if (mobileControlList.Count > 0)
+ {
+ return mobileControlList[0];
+ }
+
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
+ return null;
+ }
+
+ ///
+ /// Fires up a logo server if not already running
+ ///
+ void LoadLogoServer()
+ {
+ if (ConfigReader.ConfigObject.Rooms == null)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured. Bypassing Logo server startup.");
+ return;
+ }
+
+ if (
+ !ConfigReader.ConfigObject.Rooms.Any(
+ CheckRoomConfig))
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "No rooms configured to use system Logo server. Bypassing Logo server startup");
+ return;
+ }
+
+ try
+ {
+ LogoServer = new HttpLogoServer(8080, Global.DirectorySeparator + "html" + Global.DirectorySeparator + "logo");
+ }
+ catch (Exception)
+ {
+ Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program");
+ }
+ }
+
+ private bool CheckRoomConfig(DeviceConfig c)
+ {
+ string logoDark = null;
+ string logoLight = null;
+ string logo = null;
+
+ if (c.Properties["logoDark"] != null)
+ {
+ logoDark = c.Properties["logoDark"].Value("type");
+ }
+
+ if (c.Properties["logoLight"] != null)
+ {
+ logoLight = c.Properties["logoLight"].Value("type");
+ }
+
+ if (c.Properties["logo"] != null)
+ {
+ logo = c.Properties["logo"].Value("type");
+ }
+
+ return ((logoDark != null && logoDark == "system") ||
+ (logoLight != null && logoLight == "system") || (logo != null && logo == "system"));
+ }
+ }
+}
diff --git a/PepperDashEssentials/Devices/Amplifier.cs b/PepperDashEssentials/Devices/Amplifier.cs
index b2725109..dc35de6b 100644
--- a/PepperDashEssentials/Devices/Amplifier.cs
+++ b/PepperDashEssentials/Devices/Amplifier.cs
@@ -11,7 +11,7 @@ using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials
{
- public class Amplifier : EssentialsDevice, IRoutingSinkNoSwitching
+ public class Amplifier : EssentialsDevice, IRoutingSink
{
public event SourceInfoChangeHandler CurrentSourceChange;
diff --git a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
index 722698a7..f0fa9ec4 100644
--- a/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
+++ b/PepperDashEssentials/Fusion/EssentialsHuddleVtc1FusionController.cs
@@ -303,7 +303,7 @@ namespace PepperDash.Essentials.Fusion
return;
}
- var defaultDisplay = essentialsHuddleVtc1Room.DefaultDisplay as DisplayBase;
+ var defaultDisplay = essentialsHuddleVtc1Room.DefaultDisplay as TwoWayDisplayBase;
if (defaultDisplay == null)
{
Debug.Console(1, this, "Cannot link null display to Fusion because default display is null");
@@ -373,7 +373,7 @@ namespace PepperDash.Essentials.Fusion
}
}
- protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, DisplayBase display)
+ protected override void MapDisplayToRoomJoins(int displayIndex, int joinOffset, TwoWayDisplayBase display)
{
var displayName = string.Format("Display {0} - ", displayIndex);
diff --git a/PepperDashEssentials/PepperDashEssentials.csproj b/PepperDashEssentials/PepperDashEssentials.csproj
index 2c71efe6..47b78c79 100644
--- a/PepperDashEssentials/PepperDashEssentials.csproj
+++ b/PepperDashEssentials/PepperDashEssentials.csproj
@@ -129,23 +129,10 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
index 459e709b..12d3822d 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
+++ b/PepperDashEssentials/UIDrivers/EssentialsHuddle/EssentialsHuddlePanelAvFunctionsDriver.cs
@@ -22,6 +22,11 @@ namespace PepperDash.Essentials
PresentationMode, AudioSetup
}
+ ///
+ /// The parent driver for this
+ ///
+ public PanelDriverBase Parent { get; private set; }
+
public uint StartPageVisibleJoin { get; private set; }
@@ -214,14 +219,25 @@ namespace PepperDash.Essentials
switch (_config.HeaderStyle.ToLower())
{
case CrestronTouchpanelPropertiesConfig.Habanero:
- TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
- PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderPageVisible));
+ TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, (() =>
+ {
+ if (CurrentRoom.IsMobileControlEnabled)
+ {
+ Debug.Console(1, "Showing Mobile Control Header Info");
+ PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoMCPageVisible);
+ }
+ else
+ {
+ Debug.Console(1, "Showing Non Mobile Control Header Info");
+ PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.RoomHeaderInfoPageVisible);
+ }
+ }));
break;
case CrestronTouchpanelPropertiesConfig.Verbose:
break;
}
- if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Habanero)
+ if (_config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Habanero)
{
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
{
@@ -237,7 +253,7 @@ namespace PepperDash.Essentials
}
});
}
- else if (Config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Verbose)
+ else if (_config.HeaderStyle.ToLower() == CrestronTouchpanelPropertiesConfig.Verbose)
{
TriList.SetSigFalseAction(UIBoolJoin.HeaderRoomButtonPress, () =>
{
@@ -254,9 +270,9 @@ namespace PepperDash.Essentials
});
}
- TriList.SetBool(UIBoolJoin.DateAndTimeVisible, Config.ShowDate && Config.ShowTime);
- TriList.SetBool(UIBoolJoin.DateOnlyVisible, Config.ShowDate && !Config.ShowTime);
- TriList.SetBool(UIBoolJoin.TimeOnlyVisible, !Config.ShowDate && Config.ShowTime);
+ TriList.SetBool(UIBoolJoin.DateAndTimeVisible, _config.ShowDate && _config.ShowTime);
+ TriList.SetBool(UIBoolJoin.DateOnlyVisible, _config.ShowDate && !_config.ShowTime);
+ TriList.SetBool(UIBoolJoin.TimeOnlyVisible, !_config.ShowDate && _config.ShowTime);
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
TriList.BooleanInput[UIBoolJoin.ActivityFooterVisible].BoolValue = true;
@@ -343,8 +359,8 @@ namespace PepperDash.Essentials
{
TriList.SetBool(UIBoolJoin.LogoDefaultVisible, false);
TriList.SetBool(UIBoolJoin.LogoUrlVisible, true);
- TriList.SetString(UIStringJoin.LogoUrlLightBkgnd, _CurrentRoom.LogoUrlLightBkgnd);
- TriList.SetString(UIStringJoin.LogoUrlDarkBkgnd, _CurrentRoom.LogoUrlDarkBkgnd);
+ TriList.SetString(UIStringJoin.LogoUrlLightBkgnd, _currentRoom.LogoUrlLightBkgnd);
+ TriList.SetString(UIStringJoin.LogoUrlDarkBkgnd, _currentRoom.LogoUrlDarkBkgnd);
}
}
@@ -854,8 +870,8 @@ namespace PepperDash.Essentials
if (_currentRoom == room) return;
// Disconnect current (probably never called)
- if (_CurrentRoom != null)
- _CurrentRoom.ConfigChanged -= room_ConfigChanged;
+ if (_currentRoom != null)
+ _currentRoom.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged -= room_ConfigChanged;
room.ConfigChanged += room_ConfigChanged;
@@ -865,8 +881,8 @@ namespace PepperDash.Essentials
StartPageVisibleJoin = UIBoolJoin.StartMCPageVisible;
UpdateMCJoins(room);
- if (_CurrentRoom != null)
- _CurrentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
+ if (_currentRoom != null)
+ _currentRoom.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged -= MobileControlRoomBridge_UserCodeChanged;
room.MobileControlRoomBridge.UserCodeChanged += MobileControlRoomBridge_UserCodeChanged;
@@ -881,7 +897,7 @@ namespace PepperDash.Essentials
void MobileControlRoomBridge_UserCodeChanged(object sender, EventArgs e)
{
- UpdateMCJoins(_CurrentRoom);
+ UpdateMCJoins(_currentRoom);
}
void UpdateMCJoins(EssentialsHuddleSpaceRoom room)
diff --git a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
index cb52bf7c..1f692746 100644
--- a/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
+++ b/PepperDashEssentials/UIDrivers/EssentialsHuddleVTC/EssentialsHuddleVtc1PanelAvFunctionsDriver.cs
@@ -1,17 +1,18 @@
using System;
-using System.Collections.Generic;
using System.Linq;
+using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro;
+using Crestron.SimplSharpPro.UI;
+
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Devices.Codec;
-using PepperDash.Essentials.Core.Devices.VideoCodec;
+using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.PageManagers;
-using PepperDash.Essentials.Core.Touchpanels.Keyboards;
-using PepperDash.Essentials.UIDrivers;
-using PepperDash.Essentials.UIDrivers.VC;
+using PepperDash.Essentials.Devices.Common.Codec;
+using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials
{
@@ -20,14 +21,11 @@ namespace PepperDash.Essentials
///
public class EssentialsHuddleVtc1PanelAvFunctionsDriver : PanelDriverBase, IAVWithVCDriver
{
- #region UiDisplayMode enum
+ CrestronTouchpanelPropertiesConfig Config;
public enum UiDisplayMode
{
- Presentation,
- AudioSetup,
- Call,
- Start
+ Presentation, AudioSetup, Call, Start
}
public uint StartPageVisibleJoin { get; private set; }
@@ -38,143 +36,6 @@ namespace PepperDash.Essentials
///
public bool ShowVolumeGauge { get; set; }
- ///
- /// Smart Object 15022
- ///
- private readonly SubpageReferenceList _activityFooterSrl;
-
- ///
- /// For hitting feedbacks
- ///
- private readonly BoolInputSig _callButtonSig;
-
- private readonly List _currentDisplayModeSigsInUse = new List();
-
- private readonly BoolInputSig _endMeetingButtonSig;
-
- ///
- /// The list of buttons on the header. Managed with visibility only
- ///
- //SmartObjectHeaderButtonList HeaderButtonsList;
- ///
- /// The AV page mangagers that have been used, to keep them alive for later
- ///
- private readonly Dictionary