Merged in bugfix/ecs-756 (pull request #1)

Bugfix/ecs 756
This commit is contained in:
Neil Dorin
2018-07-25 16:54:14 +00:00
committed by HeathV
11 changed files with 1544 additions and 1344 deletions

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "essentials-framework"] [submodule "essentials-framework"]
path = essentials-framework path = essentials-framework
url = https://hvolmer@bitbucket.org/Pepperdash_Products/essentials-framework.git url = https://bitbucket.org/Pepperdash_Products/essentials-framework.git

View File

@@ -1,359 +1,369 @@
using System; using System;
using System.Linq; using System.Linq;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.CrestronThread; using Crestron.SimplSharpPro.CrestronThread;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.DM; using PepperDash.Essentials.DM;
using PepperDash.Essentials.Fusion; using PepperDash.Essentials.Fusion;
using PepperDash.Essentials.Room.Cotija; using PepperDash.Essentials.Room.Cotija;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public class ControlSystem : CrestronControlSystem public class ControlSystem : CrestronControlSystem
{ {
HttpLogoServer LogoServer; HttpLogoServer LogoServer;
public ControlSystem() public ControlSystem()
: base() : base()
{ {
Thread.MaxNumberOfUserThreads = 400; Thread.MaxNumberOfUserThreads = 400;
Global.ControlSystem = this; Global.ControlSystem = this;
DeviceManager.Initialize(this); DeviceManager.Initialize(this);
} }
/// <summary> /// <summary>
/// Git 'er goin' /// Git 'er goin'
/// </summary> /// </summary>
public override void InitializeSystem() public override void InitializeSystem()
{ {
DeterminePlatform(); DeterminePlatform();
//CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file", //CrestronConsole.AddNewConsoleCommand(s => GoWithLoad(), "go", "Loads configuration file",
// ConsoleAccessLevelEnum.AccessOperator); // ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
foreach (var tl in TieLineCollection.Default) foreach (var tl in TieLineCollection.Default)
CrestronConsole.ConsoleCommandResponse(" {0}\r", tl); CrestronConsole.ConsoleCommandResponse(" {0}\r", tl);
}, },
"listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator); "listtielines", "Prints out all tie lines", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
CrestronConsole.ConsoleCommandResponse CrestronConsole.ConsoleCommandResponse
("Current running configuration. This is the merged system and template configuration"); ("Current running configuration. This is the merged system and template configuration");
CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject CrestronConsole.ConsoleCommandResponse(Newtonsoft.Json.JsonConvert.SerializeObject
(ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented)); (ConfigReader.ConfigObject, Newtonsoft.Json.Formatting.Indented));
}, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator); }, "showconfig", "Shows the current running merged config", ConsoleAccessLevelEnum.AccessOperator);
CrestronConsole.AddNewConsoleCommand(s => CrestronConsole.AddNewConsoleCommand(s =>
{ {
CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" + CrestronConsole.ConsoleCommandResponse("This system can be found at the following URLs:\r" +
"System URL: {0}\r" + "System URL: {0}\r" +
"Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl); "Template URL: {1}", ConfigReader.ConfigObject.SystemUrl, ConfigReader.ConfigObject.TemplateUrl);
}, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator); }, "portalinfo", "Shows portal URLS from configuration", ConsoleAccessLevelEnum.AccessOperator);
GoWithLoad(); GoWithLoad();
} }
/// <summary> /// <summary>
/// Determines if the program is running on a processor (appliance) or server (XiO Edge). /// Determines if the program is running on a processor (appliance) or server (XiO Edge).
/// ///
/// Sets Global.FilePathPrefix based on platform /// Sets Global.FilePathPrefix based on platform
/// </summary> /// </summary>
public void DeterminePlatform() public void DeterminePlatform()
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform...."); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Determining Platform....");
string filePathPrefix; string filePathPrefix;
var dirSeparator = Global.DirectorySeparator; var dirSeparator = Global.DirectorySeparator;
var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version; var version = Crestron.SimplSharp.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build); var versionString = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
string directoryPrefix; string directoryPrefix;
//directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory(); directoryPrefix = Crestron.SimplSharp.CrestronIO.Directory.GetApplicationRootDirectory();
#warning ^ For use with beta Include4.dat for XiO Edge
directoryPrefix = ""; //directoryPrefix = "";
if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server) if (CrestronEnvironment.DevicePlatform != eDevicePlatform.Server)
{ {
filePathPrefix = directoryPrefix + dirSeparator + "NVRAM" filePathPrefix = directoryPrefix + dirSeparator + "NVRAM"
+ dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator; + dirSeparator + string.Format("program{0}", InitialParametersClass.ApplicationNumber) + dirSeparator;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on 3-series Appliance", versionString);
} }
else else
{ {
filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator; filePathPrefix = directoryPrefix + dirSeparator + "User" + dirSeparator;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on XiO Edge Server", versionString); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials v{0} on XiO Edge Server", versionString);
} }
Global.SetFilePathPrefix(filePathPrefix); Global.SetFilePathPrefix(filePathPrefix);
} }
/// <summary> /// <summary>
/// Do it, yo /// Do it, yo
/// </summary> /// </summary>
public void GoWithLoad() public void GoWithLoad()
{ {
try try
{ {
CrestronConsole.AddNewConsoleCommand(EnablePortalSync, "portalsync", "Loads Portal Sync", CrestronConsole.AddNewConsoleCommand(EnablePortalSync, "portalsync", "Loads Portal Sync",
ConsoleAccessLevelEnum.AccessOperator); ConsoleAccessLevelEnum.AccessOperator);
//PortalSync = new PepperDashPortalSyncClient(); //PortalSync = new PepperDashPortalSyncClient();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration"); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Starting Essentials load from configuration");
var filesReady = SetupFilesystem(); var filesReady = SetupFilesystem();
if (filesReady) if (filesReady)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config..."); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Folder structure verified. Loading config...");
if (!ConfigReader.LoadConfig2()) if (!ConfigReader.LoadConfig2())
return; return;
Load(); Load();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r" + Debug.Console(0, Debug.ErrorLogLevel.Notice, "Essentials load complete\r" +
"-------------------------------------------------------------"); "-------------------------------------------------------------");
} }
else else
{ {
Debug.Console(0, Debug.Console(0,
"------------------------------------------------\r" + "------------------------------------------------\r" +
"------------------------------------------------\r" + "------------------------------------------------\r" +
"------------------------------------------------\r" + "------------------------------------------------\r" +
"Essentials file structure setup completed.\r" + "Essentials file structure setup completed.\r" +
"Please load config, sgd and ir files and\r" + "Please load config, sgd and ir files and\r" +
"restart program.\r" + "restart program.\r" +
"------------------------------------------------\r" + "------------------------------------------------\r" +
"------------------------------------------------\r" + "------------------------------------------------\r" +
"------------------------------------------------"); "------------------------------------------------");
} }
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r{0}", e); Debug.Console(0, "FATAL INITIALIZE ERROR. System is in an inconsistent state:\r{0}", e);
} }
} }
/// <summary> /// <summary>
/// Verifies filesystem is set up. IR, SGD, and program1 folders /// Verifies filesystem is set up. IR, SGD, and program1 folders
/// </summary> /// </summary>
bool SetupFilesystem() bool SetupFilesystem()
{ {
Debug.Console(0, "Verifying and/or creating folder structure"); Debug.Console(0, "Verifying and/or creating folder structure");
var configDir = Global.FilePathPrefix; var configDir = Global.FilePathPrefix;
var configExists = Directory.Exists(configDir); var configExists = Directory.Exists(configDir);
if (!configExists) if (!configExists)
Directory.Create(configDir); Directory.Create(configDir);
var irDir = Global.FilePathPrefix + "ir"; var irDir = Global.FilePathPrefix + "ir";
if (!Directory.Exists(irDir)) if (!Directory.Exists(irDir))
Directory.Create(irDir); Directory.Create(irDir);
var sgdDir = Global.FilePathPrefix + "sgd"; var sgdDir = Global.FilePathPrefix + "sgd";
if (!Directory.Exists(sgdDir)) if (!Directory.Exists(sgdDir))
Directory.Create(sgdDir); Directory.Create(sgdDir);
return configExists; return configExists;
} }
public void EnablePortalSync(string s) public void EnablePortalSync(string s)
{ {
if (s.ToLower() == "enable") if (s.ToLower() == "enable")
{ {
CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled"); CrestronConsole.ConsoleCommandResponse("Portal Sync features enabled");
} }
} }
public void TearDown() public void TearDown()
{ {
Debug.Console(0, "Tearing down existing system"); Debug.Console(0, "Tearing down existing system");
DeviceManager.DeactivateAll(); DeviceManager.DeactivateAll();
TieLineCollection.Default.Clear(); TieLineCollection.Default.Clear();
foreach (var key in DeviceManager.GetDevices()) foreach (var key in DeviceManager.GetDevices())
DeviceManager.RemoveDevice(key); DeviceManager.RemoveDevice(key);
Debug.Console(0, "Tear down COMPLETE"); Debug.Console(0, "Tear down COMPLETE");
} }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
void Load() void Load()
{ {
LoadDevices(); LoadDevices();
LoadTieLines(); LoadTieLines();
LoadRooms(); LoadRooms();
LoadLogoServer(); LoadLogoServer();
DeviceManager.ActivateAll(); DeviceManager.ActivateAll();
} }
/// <summary> /// <summary>
/// Reads all devices from config and adds them to DeviceManager /// Reads all devices from config and adds them to DeviceManager
/// </summary> /// </summary>
public void LoadDevices() public void LoadDevices()
{ {
foreach (var devConf in ConfigReader.ConfigObject.Devices) // Build the processor wrapper class
{ DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
try foreach (var devConf in ConfigReader.ConfigObject.Devices)
{ {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
// Skip this to prevent unnecessary warnings try
if (devConf.Key == "processor") {
continue; Debug.Console(0, Debug.ErrorLogLevel.Notice, "Creating device '{0}'", devConf.Key);
// Skip this to prevent unnecessary warnings
// Try local factory first if (devConf.Key == "processor")
var newDev = DeviceFactory.GetDevice(devConf); {
if (devConf.Type.ToLower() != Global.ControlSystem.ControllerPrompt.ToLower())
// Then associated library factories Debug.Console(0,
if (newDev == null) "WARNING: Config file defines processor type as '{0}' but actual processor is '{1}'! Some ports may not be available",
newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf); devConf.Type.ToUpper(), Global.ControlSystem.ControllerPrompt.ToUpper());
if (newDev == null)
newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf); continue;
if (newDev == null) }
newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
// Try local factory first
if (newDev != null) var newDev = DeviceFactory.GetDevice(devConf);
DeviceManager.AddDevice(newDev);
else // Then associated library factories
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Cannot load unknown device type '{0}', key '{1}'.", devConf.Type, devConf.Key); if (newDev == null)
} newDev = PepperDash.Essentials.Devices.Common.DeviceFactory.GetDevice(devConf);
catch (Exception e) if (newDev == null)
{ newDev = PepperDash.Essentials.DM.DeviceFactory.GetDevice(devConf);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e); if (newDev == null)
} newDev = PepperDash.Essentials.Devices.Displays.DisplayDeviceFactory.GetDevice(devConf);
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded."); 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);
/// <summary> }
/// Helper method to load tie lines. This should run after devices have loaded catch (Exception e)
/// </summary> {
public void LoadTieLines() Debug.Console(0, Debug.ErrorLogLevel.Notice, "ERROR: Creating device {0}. Skipping device. \r{1}", devConf.Key, e);
{ }
// In the future, we can't necessarily just clear here because devices }
// might be making their own internal sources/tie lines Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Devices Loaded.");
var tlc = TieLineCollection.Default; }
//tlc.Clear();
if (ConfigReader.ConfigObject.TieLines == null) /// <summary>
{ /// Helper method to load tie lines. This should run after devices have loaded
return; /// </summary>
} public void LoadTieLines()
{
foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines) // In the future, we can't necessarily just clear here because devices
{ // might be making their own internal sources/tie lines
var newTL = tieLineConfig.GetTieLine();
if (newTL != null) var tlc = TieLineCollection.Default;
tlc.Add(newTL); //tlc.Clear();
} if (ConfigReader.ConfigObject.TieLines == null)
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded."); return;
}
}
foreach (var tieLineConfig in ConfigReader.ConfigObject.TieLines)
/// <summary> {
/// Reads all rooms from config and adds them to DeviceManager var newTL = tieLineConfig.GetTieLine();
/// </summary> if (newTL != null)
public void LoadRooms() tlc.Add(newTL);
{ }
if (ConfigReader.ConfigObject.Rooms == null)
{ Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Tie Lines Loaded.");
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
return; }
}
/// <summary>
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms) /// Reads all rooms from config and adds them to DeviceManager
{ /// </summary>
var room = roomConfig.GetRoomObject(); public void LoadRooms()
if (room != null) {
{ if (ConfigReader.ConfigObject.Rooms == null)
if (room is EssentialsHuddleSpaceRoom) {
{ Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
DeviceManager.AddDevice(room); return;
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1)); foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
{
var room = roomConfig.GetRoomObject();
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge..."); if (room != null)
// Cotija bridge {
var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom); if (room is EssentialsHuddleSpaceRoom)
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present {
DeviceManager.AddDevice(bridge); DeviceManager.AddDevice(room);
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Cotija Bridge Added..."); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
} DeviceManager.AddDevice(new EssentialsHuddleSpaceFusionSystemControllerBase((EssentialsHuddleSpaceRoom)room, 0xf1));
else if (room is EssentialsHuddleVtc1Room)
{
DeviceManager.AddDevice(room); Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Cotija Bridge...");
// Cotija bridge
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion"); var bridge = new CotijaEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1)); AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
} DeviceManager.AddDevice(bridge);
else
{ Debug.Console(0, Debug.ErrorLogLevel.Notice, "Cotija Bridge Added...");
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsHuddleSpaceRoom, attempting to add to DeviceManager w/o Fusion"); }
DeviceManager.AddDevice(room); else if (room is EssentialsHuddleVtc1Room)
} {
DeviceManager.AddDevice(room);
}
else Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key); DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController((EssentialsHuddleVtc1Room)room, 0xf1));
} }
else
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded."); {
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsHuddleSpaceRoom, attempting to add to DeviceManager w/o Fusion");
} DeviceManager.AddDevice(room);
}
/// <summary>
/// Helps add the post activation steps that link bridges to main controller }
/// </summary> else
/// <param name="bridge"></param> Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
void AddBridgePostActivationHelper(CotijaBridgeBase bridge) }
{
bridge.AddPostActivationAction(() => Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
{
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as CotijaSystemController; }
if (parent == null)
{ /// <summary>
Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present"); /// Helps add the post activation steps that link bridges to main controller
} /// </summary>
Debug.Console(0, bridge, "Linking to parent controller"); /// <param name="bridge"></param>
bridge.AddParent(parent); void AddBridgePostActivationHelper(CotijaBridgeBase bridge)
parent.AddBridge(bridge); {
}); bridge.AddPostActivationAction(() =>
} {
var parent = DeviceManager.AllDevices.FirstOrDefault(d => d.Key == "appServer") as CotijaSystemController;
/// <summary> if (parent == null)
/// Fires up a logo server if not already running {
/// </summary> Debug.Console(0, bridge, "ERROR: Cannot connect bridge. System controller not present");
void LoadLogoServer() }
{ Debug.Console(0, bridge, "Linking to parent controller");
try bridge.AddParent(parent);
{ parent.AddBridge(bridge);
LogoServer = new HttpLogoServer(8080, Global.FilePathPrefix + "html" + Global.DirectorySeparator + "logo"); });
} }
catch (Exception)
{ /// <summary>
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: Logo server cannot be started. Likely already running in another program"); /// Fires up a logo server if not already running
} /// </summary>
} void LoadLogoServer()
} {
} 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");
}
}
}
}

View File

@@ -44,10 +44,10 @@ namespace PepperDash.Essentials
// AV Driver // AV Driver
Debug.Console(0, panelController, "Adding huddle space AV driver"); Debug.Console(0, panelController, "Adding huddle space AV driver");
var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props); var avDriver = new EssentialsHuddlePanelAvFunctionsDriver(mainDriver, props);
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
avDriver.DefaultRoomKey = props.DefaultRoomKey; avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver; mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleSpaceRoom;
// Environment Driver // Environment Driver
if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0) if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0)
{ {
@@ -113,9 +113,9 @@ namespace PepperDash.Essentials
var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver, var codecDriver = new PepperDash.Essentials.UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
(room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver); (room as EssentialsHuddleVtc1Room).VideoCodec, mainDriver.HeaderDriver);
avDriver.SetVideoCodecDriver(codecDriver); avDriver.SetVideoCodecDriver(codecDriver);
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
avDriver.DefaultRoomKey = props.DefaultRoomKey; avDriver.DefaultRoomKey = props.DefaultRoomKey;
mainDriver.AvDriver = avDriver; mainDriver.AvDriver = avDriver;
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
// Environment Driver // Environment Driver
if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0) if (avDriver.CurrentRoom.Config.Environment != null && avDriver.CurrentRoom.Config.Environment.DeviceKeys.Count > 0)

View File

@@ -1,227 +1,227 @@
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion> <ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid> <ProjectGuid>{1BED5BA9-88C4-4365-9362-6F4B128071D3}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PepperDash.Essentials</RootNamespace> <RootNamespace>PepperDash.Essentials</RootNamespace>
<AssemblyName>PepperDashEssentials</AssemblyName> <AssemblyName>PepperDashEssentials</AssemblyName>
<ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> <ProjectTypeGuids>{0B4745B0-194B-4BB6-8E21-E9057CA92230};{4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<PlatformFamilyName>WindowsCE</PlatformFamilyName> <PlatformFamilyName>WindowsCE</PlatformFamilyName>
<PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID> <PlatformID>E2BECB1F-8C8C-41ba-B736-9BE7D946A398</PlatformID>
<OSVersion>5.0</OSVersion> <OSVersion>5.0</OSVersion>
<DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix> <DeployDirSuffix>SmartDeviceProject1</DeployDirSuffix>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<NativePlatformName>Windows CE</NativePlatformName> <NativePlatformName>Windows CE</NativePlatformName>
<FormFactorID> <FormFactorID>
</FormFactorID> </FormFactorID>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions> <AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE;</DefineConstants> <DefineConstants>DEBUG;TRACE;</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig> <NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions> <AllowedReferenceRelatedFileExtensions>.allowedReferenceRelatedFileExtensions</AllowedReferenceRelatedFileExtensions>
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\</OutputPath> <OutputPath>bin\</OutputPath>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<NoStdLib>true</NoStdLib> <NoStdLib>true</NoStdLib>
<NoConfig>true</NoConfig> <NoConfig>true</NoConfig>
<GenerateSerializationAssemblies>off</GenerateSerializationAssemblies> <GenerateSerializationAssemblies>off</GenerateSerializationAssemblies>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.3.27452, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Core, Version=1.0.3.27452, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\essentials-framework\references\PepperDash_Core.dll</HintPath> <HintPath>..\essentials-framework\references\PepperDash_Core.dll</HintPath>
</Reference> </Reference>
<Reference Include="PepperDash_Essentials_DM, Version=1.0.0.19343, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Essentials_DM, Version=1.0.0.19343, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\essentials-framework\Essentials DM\Essentials_DM\bin\PepperDash_Essentials_DM.dll</HintPath> <HintPath>..\essentials-framework\Essentials DM\Essentials_DM\bin\PepperDash_Essentials_DM.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpPro, Version=1.5.2.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpPro, Version=1.5.2.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Audio\EssentialsVolumeLevelConfig.cs" /> <Compile Include="Audio\EssentialsVolumeLevelConfig.cs" />
<Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" /> <Compile Include="Configuration ORIGINAL\Builders\TPConfig.cs" />
<Compile Include="Configuration ORIGINAL\Configuration.cs" /> <Compile Include="Configuration ORIGINAL\Configuration.cs" />
<Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" /> <Compile Include="Configuration ORIGINAL\ConfigurationHelpers.cs" />
<Compile Include="Configuration ORIGINAL\ConfigTieLine.cs" /> <Compile Include="Configuration ORIGINAL\ConfigTieLine.cs" />
<Compile Include="Configuration ORIGINAL\Factories\CommFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\CommFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\RemoteFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\RemoteFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\DeviceMonitorFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\DeviceMonitorFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\DmFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\DmFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\TouchpanelFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\TouchpanelFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\PcFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\PcFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\REMOVE DiscPlayerFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\REMOVE DiscPlayerFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\MAYBE SetTopBoxFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\MAYBE SetTopBoxFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\DisplayFactory.cs" /> <Compile Include="Configuration ORIGINAL\Factories\DisplayFactory.cs" />
<Compile Include="Configuration ORIGINAL\Factories\FactoryHelper.cs" /> <Compile Include="Configuration ORIGINAL\Factories\FactoryHelper.cs" />
<Compile Include="Config\ConfigReader.cs" /> <Compile Include="Config\ConfigReader.cs" />
<Compile Include="Config\EssentialsConfig.cs" /> <Compile Include="Config\EssentialsConfig.cs" />
<Compile Include="Factory\DeviceFactory.cs" /> <Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Devices\Amplifier.cs" /> <Compile Include="Devices\Amplifier.cs" />
<Compile Include="Devices\DiscPlayer\OppoExtendedBdp.cs" /> <Compile Include="Devices\DiscPlayer\OppoExtendedBdp.cs" />
<Compile Include="Devices\NUMERIC AppleTV.cs" /> <Compile Include="Devices\NUMERIC AppleTV.cs" />
<Compile Include="ControlSystem.cs" /> <Compile Include="ControlSystem.cs" />
<Compile Include="Factory\UiDeviceFactory.cs" /> <Compile Include="Factory\UiDeviceFactory.cs" />
<Compile Include="OTHER\Fusion\EssentialsHuddleVtc1FusionController.cs" /> <Compile Include="OTHER\Fusion\EssentialsHuddleVtc1FusionController.cs" />
<Compile Include="OTHER\Fusion\FusionEventHandlers.cs" /> <Compile Include="OTHER\Fusion\FusionEventHandlers.cs" />
<Compile Include="OTHER\Fusion\FusionProcessorQueries.cs" /> <Compile Include="OTHER\Fusion\FusionProcessorQueries.cs" />
<Compile Include="OTHER\Fusion\FusionRviDataClasses.cs" /> <Compile Include="OTHER\Fusion\FusionRviDataClasses.cs" />
<Compile Include="REMOVE EssentialsApp.cs" /> <Compile Include="REMOVE EssentialsApp.cs" />
<Compile Include="OTHER\Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.cs" /> <Compile Include="OTHER\Fusion\EssentialsHuddleSpaceFusionSystemControllerBase.cs" />
<Compile Include="HttpApiHandler.cs" /> <Compile Include="HttpApiHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room\Config\DDVC01RoomPropertiesConfig.cs" /> <Compile Include="Room\Config\DDVC01RoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" /> <Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" /> <Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
<Compile Include="Room\Cotija\CotijaConfig.cs" /> <Compile Include="Room\Cotija\CotijaConfig.cs" />
<Compile Include="Room\Cotija\CotijaDdvc01DeviceBridge.cs" /> <Compile Include="Room\Cotija\CotijaDdvc01DeviceBridge.cs" />
<Compile Include="Room\Cotija\Interfaces.cs" /> <Compile Include="Room\Cotija\Interfaces.cs" />
<Compile Include="Room\Cotija\RoomBridges\CotijaBridgeBase.cs" /> <Compile Include="Room\Cotija\RoomBridges\CotijaBridgeBase.cs" />
<Compile Include="Room\Cotija\RoomBridges\CotijaDdvc01RoomBridge.cs" /> <Compile Include="Room\Cotija\RoomBridges\CotijaDdvc01RoomBridge.cs" />
<Compile Include="Room\Cotija\RoomBridges\CotijaEssentialsHuddleSpaceRoomBridge.cs" /> <Compile Include="Room\Cotija\RoomBridges\CotijaEssentialsHuddleSpaceRoomBridge.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IChannelExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IChannelExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IColorExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IColorExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IDPadExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IDPadExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IDvrExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IDvrExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\INumericExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\INumericExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" />
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" /> <Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" /> <Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" /> <Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
<Compile Include="Room\Types\EssentialsRoomBase.cs" /> <Compile Include="Room\Types\EssentialsRoomBase.cs" />
<Compile Include="Room\Config\EssentialsRoomConfig.cs" /> <Compile Include="Room\Config\EssentialsRoomConfig.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\DevicePageControllerBase.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\DevicePageControllerBase.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLaptop.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLaptop.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeDvd.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeDvd.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeSetTopBoxGeneric.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\PageControllerLargeSetTopBoxGeneric.cs" />
<Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" /> <Compile Include="FOR REFERENCE UI\PageControllers\LargeTouchpanelControllerBase.cs" />
<Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" /> <Compile Include="FOR REFERENCE UI\Panels\SmartGraphicsTouchpanelControllerBase.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsEnvironmentDriver.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsLightingDriver.cs" />
<Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" /> <Compile Include="UIDrivers\Environment Drivers\EssentialsShadeDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsHeaderDriver.cs" />
<Compile Include="UIDrivers\SigInterlock.cs" /> <Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" /> <Compile Include="UIDrivers\SigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddlePresentationUiDriver.cs" />
<Compile Include="UI\HttpLogoServer.cs" /> <Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddleTechPageDriver.cs" />
<Compile Include="UI\SmartObjectHeaderButtonList.cs" /> <Compile Include="UI\HttpLogoServer.cs" />
<Compile Include="UI\SubpageReferenceListCallStagingItem.cs" /> <Compile Include="UI\SmartObjectHeaderButtonList.cs" />
<Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" /> <Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" /> <Compile Include="UIDrivers\VC\EssentialsVideoCodecUiDriver.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddleVtc1PanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\EssentialsHuddleVtc1PanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" /> <Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" />
<Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" /> <Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" />
<Compile Include="UI\JoinConstants\UIStringlJoin.cs" /> <Compile Include="UI\JoinConstants\UIStringlJoin.cs" />
<Compile Include="UI\JoinConstants\UIUshortJoin.cs" /> <Compile Include="UI\JoinConstants\UIUshortJoin.cs" />
<Compile Include="UIDrivers\DualDisplayRouting.cs" /> <Compile Include="UIDrivers\DualDisplayRouting.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsPresentationPanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsPresentationPanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\Page Drivers\SingleSubpageModalDriver.cs" /> <Compile Include="UIDrivers\Page Drivers\SingleSubpageModalDriver.cs" />
<Compile Include="UIDrivers\Essentials\EssentialsPanelMainInterfaceDriver.cs" /> <Compile Include="UIDrivers\Essentials\EssentialsPanelMainInterfaceDriver.cs" />
<Compile Include="UIDrivers\enums and base.cs" /> <Compile Include="UIDrivers\enums and base.cs" />
<Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddlePanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddle\EssentialsHuddlePanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\Page Drivers\SingleSubpageModalAndBackDriver.cs" /> <Compile Include="UIDrivers\Page Drivers\SingleSubpageModalAndBackDriver.cs" />
<Compile Include="UIDrivers\SmartObjectRoomsList.cs" /> <Compile Include="UIDrivers\SmartObjectRoomsList.cs" />
<Compile Include="UI\JoinConstants\UIBoolJoin.cs" /> <Compile Include="UI\JoinConstants\UIBoolJoin.cs" />
<Compile Include="Room\Cotija\CotijaSystemController.cs" /> <Compile Include="Room\Cotija\CotijaSystemController.cs" />
<Compile Include="UI\DualDisplaySourceSRLController.cs" /> <Compile Include="UI\DualDisplaySourceSRLController.cs" />
<Compile Include="UI\SubpageReferenceListActivityItem.cs" /> <Compile Include="UI\SubpageReferenceListActivityItem.cs" />
<Compile Include="UI\CrestronTouchpanelPropertiesConfig.cs" /> <Compile Include="UI\CrestronTouchpanelPropertiesConfig.cs" />
<Compile Include="FOR REFERENCE UI\Panels\REMOVE UiCue.cs" /> <Compile Include="FOR REFERENCE UI\Panels\REMOVE UiCue.cs" />
<Compile Include="FOR REFERENCE UI\SRL\SourceListSubpageReferenceList.cs" /> <Compile Include="FOR REFERENCE UI\SRL\SourceListSubpageReferenceList.cs" />
<Compile Include="Room\Types\EssentialsHuddleSpaceRoom.cs" /> <Compile Include="Room\Types\EssentialsHuddleSpaceRoom.cs" />
<Compile Include="UI\EssentialsTouchpanelController.cs" /> <Compile Include="UI\EssentialsTouchpanelController.cs" />
<Compile Include="UI\SubpageReferenceListSourceItem.cs" /> <Compile Include="UI\SubpageReferenceListSourceItem.cs" />
<None Include="app.config" /> <None Include="app.config" />
<None Include="Properties\ControlSystem.cfg" /> <None Include="Properties\ControlSystem.cfg" />
<EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd" /> <EmbeddedResource Include="SGD\PepperDash Essentials iPad.sgd" />
<EmbeddedResource Include="SGD\PepperDash Essentials TSW-560.sgd" /> <EmbeddedResource Include="SGD\PepperDash Essentials TSW-560.sgd" />
<EmbeddedResource Include="SGD\PepperDash Essentials TSW-760.sgd" /> <EmbeddedResource Include="SGD\PepperDash Essentials TSW-760.sgd" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj"> <ProjectReference Include="..\essentials-framework\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project> <Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
<Name>PepperDash_Essentials_Core</Name> <Name>PepperDash_Essentials_Core</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj"> <ProjectReference Include="..\essentials-framework\Essentials Devices Common\Essentials Devices Common\Essentials Devices Common.csproj">
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project> <Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
<Name>Essentials Devices Common</Name> <Name>Essentials Devices Common</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<PropertyGroup> <PropertyGroup>
<PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent> <PostBuildEvent>rem S# Pro preparation will execute after these operations</PostBuildEvent>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@@ -4,5 +4,5 @@
[assembly: AssemblyCompany("PepperDash Technology Corp")] [assembly: AssemblyCompany("PepperDash Technology Corp")]
[assembly: AssemblyProduct("PepperDashEssentials")] [assembly: AssemblyProduct("PepperDashEssentials")]
[assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")] [assembly: AssemblyCopyright("Copyright © PepperDash Technology Corp 2017")]
[assembly: AssemblyVersion("1.2.0.*")] [assembly: AssemblyVersion("1.2.4.*")]

View File

@@ -1,108 +1,118 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharp.Net.Http; using Crestron.SimplSharp.Net.Http;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core;
namespace PepperDash.Essentials
{ namespace PepperDash.Essentials
public class HttpLogoServer {
{ public class HttpLogoServer
/// <summary> {
/// /// <summary>
/// </summary> ///
HttpServer Server; /// </summary>
HttpServer Server;
/// <summary>
/// /// <summary>
/// </summary> ///
string FileDirectory; /// </summary>
string FileDirectory;
/// <summary>
/// /// <summary>
/// </summary> ///
public static Dictionary<string, string> ExtensionContentTypes; /// </summary>
public static Dictionary<string, string> ExtensionContentTypes;
/// <summary>
/// /// <summary>
/// </summary> ///
/// <param name="port"></param> /// </summary>
/// <param name="directory"></param> /// <param name="port"></param>
public HttpLogoServer(int port, string directory) /// <param name="directory"></param>
{ public HttpLogoServer(int port, string directory)
ExtensionContentTypes = new Dictionary<string, string> {
{ ExtensionContentTypes = new Dictionary<string, string>
//{ ".css", "text/css" }, {
//{ ".htm", "text/html" }, //{ ".css", "text/css" },
//{ ".html", "text/html" }, //{ ".htm", "text/html" },
{ ".jpg", "image/jpeg" }, //{ ".html", "text/html" },
{ ".jpeg", "image/jpeg" }, { ".jpg", "image/jpeg" },
//{ ".js", "application/javascript" }, { ".jpeg", "image/jpeg" },
//{ ".json", "application/json" }, //{ ".js", "application/javascript" },
//{ ".map", "application/x-navimap" }, //{ ".json", "application/json" },
{ ".pdf", "application.pdf" }, //{ ".map", "application/x-navimap" },
{ ".png", "image/png" }, { ".pdf", "application.pdf" },
//{ ".txt", "text/plain" }, { ".png", "image/png" },
}; //{ ".txt", "text/plain" },
};
Server = new HttpServer();
Server.Port = port; Server = new HttpServer();
FileDirectory = directory; Server.Port = port;
Server.OnHttpRequest += new OnHttpRequestHandler(Server_OnHttpRequest); FileDirectory = directory;
Server.Open(); Server.OnHttpRequest += new OnHttpRequestHandler(Server_OnHttpRequest);
Server.Open();
CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
} CrestronEnvironment.ProgramStatusEventHandler += new ProgramStatusEventHandler(CrestronEnvironment_ProgramStatusEventHandler);
}
/// <summary>
/// /// <summary>
/// </summary> ///
void Server_OnHttpRequest(object sender, OnHttpRequestArgs args) /// </summary>
{ void Server_OnHttpRequest(object sender, OnHttpRequestArgs args)
var path = args.Request.Path; {
if (File.Exists(FileDirectory + @"\" + path)) var path = args.Request.Path;
{ Debug.Console(2, "HTTP Request with path: '{0}'", args.Request.Path);
string filePath = path.Replace('/', '\\');
string localPath = string.Format(@"{0}{1}", FileDirectory, filePath); if (File.Exists(FileDirectory + path))
if (File.Exists(localPath)) {
{ string filePath = path.Replace('/', '\\');
args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension); string localPath = string.Format(@"{0}{1}", FileDirectory, filePath);
args.Response.ContentStream = new FileStream(localPath, FileMode.Open, FileAccess.Read);
} Debug.Console(2, "HTTP Logo Server attempting to find file: '{0}'", localPath);
else if (File.Exists(localPath))
{ {
args.Response.ContentString = string.Format("Not found: '{0}'", filePath); args.Response.Header.ContentType = GetContentType(new FileInfo(localPath).Extension);
args.Response.Code = 404; args.Response.ContentStream = new FileStream(localPath, FileMode.Open, FileAccess.Read);
} }
} else
} {
Debug.Console(2, "HTTP Logo Server Cannot find file '{0}'", localPath);
/// <summary> args.Response.ContentString = string.Format("Not found: '{0}'", filePath);
/// args.Response.Code = 404;
/// </summary> }
void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType) }
{ else
if (programEventType == eProgramStatusEventType.Stopping) {
Server.Close(); Debug.Console(2, "HTTP Logo Server: '{0}' does not exist", FileDirectory + path);
} }
}
/// <summary>
/// /// <summary>
/// </summary> ///
/// <param name="extension"></param> /// </summary>
/// <returns></returns> void CrestronEnvironment_ProgramStatusEventHandler(eProgramStatusEventType programEventType)
public static string GetContentType(string extension) {
{ if (programEventType == eProgramStatusEventType.Stopping)
string type; Server.Close();
if (ExtensionContentTypes.ContainsKey(extension)) }
type = ExtensionContentTypes[extension];
else /// <summary>
type = "text/plain"; ///
return type; /// </summary>
} /// <param name="extension"></param>
} /// <returns></returns>
public static string GetContentType(string extension)
{
string type;
if (ExtensionContentTypes.ContainsKey(extension))
type = ExtensionContentTypes[extension];
else
type = "text/plain";
return type;
}
}
} }

View File

@@ -485,7 +485,31 @@ namespace PepperDash.Essentials
/// <summary> /// <summary>
/// 3955 /// 3955
/// </summary> /// </summary>
public const uint HeaderIcon5Press = 3955; public const uint HeaderIcon5Press = 3955;
/// 3960
/// </summary>
public const uint HeaderPopupCaretsSubpageVisibile = 3960;
/// <summary>
/// 3961
/// </summary>
public const uint HeaderCaret1Visible = 3961;
/// <summary>
/// 3962
/// </summary>
public const uint HeaderCaret2Visible = 3962;
/// <summary>
/// 3963
/// </summary>
public const uint HeaderCaret3Visible = 3963;
/// <summary>
/// 3964
/// </summary>
public const uint HeaderCaret4Visible = 3964;
/// <summary>
/// 3965
/// </summary>
public const uint HeaderCaret5Visible = 3965;
/// <summary> /// <summary>
/// 3999 /// 3999

View File

@@ -1,251 +1,256 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Shades; using PepperDash.Essentials.Core.Shades;
using PepperDash.Essentials.Core.Lighting; using PepperDash.Essentials.Core.Lighting;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public class EssentialsEnvironmentDriver : PanelDriverBase public class EssentialsEnvironmentDriver : PanelDriverBase
{ {
/// <summary> /// <summary>
/// Do I need this here? /// Do I need this here?
/// </summary> /// </summary>
CrestronTouchpanelPropertiesConfig Config; CrestronTouchpanelPropertiesConfig Config;
/// <summary> /// <summary>
/// The list of devices this driver is responsible for controlling /// The list of devices this driver is responsible for controlling
/// </summary> /// </summary>
public List<IKeyed> Devices { get; private set; } public List<IKeyed> Devices { get; private set; }
/// <summary> /// <summary>
/// The parent driver for this /// The parent driver for this
/// </summary> /// </summary>
EssentialsPanelMainInterfaceDriver Parent; EssentialsPanelMainInterfaceDriver Parent;
/// <summary> /// <summary>
/// The list of sub drivers for the devices /// The list of sub drivers for the devices
/// </summary> /// </summary>
public List<PanelDriverBase> DeviceSubDrivers { get; private set; } public List<PanelDriverBase> DeviceSubDrivers { get; private set; }
public uint BackgroundSubpageJoin { get; private set; } public uint BackgroundSubpageJoin { get; private set; }
public EssentialsEnvironmentDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config) public EssentialsEnvironmentDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
: base(parent.TriList) : base(parent.TriList)
{ {
Config = config; Config = config;
Parent = parent; Parent = parent;
Devices = new List<IKeyed>(); Devices = new List<IKeyed>();
DeviceSubDrivers = new List<PanelDriverBase>(); DeviceSubDrivers = new List<PanelDriverBase>();
Parent.AvDriver.PopupInterlock.IsShownFeedback.OutputChange += IsShownFeedback_OutputChange; Parent.AvDriver.PopupInterlock.StatusChanged += new EventHandler<StatusChangedEventArgs>(PopupInterlock_CurrentJoinChanged);
// Calculate the join offests for each device page and assign join actions for each button // Calculate the join offests for each device page and assign join actions for each button
} }
void IsShownFeedback_OutputChange(object sender, EventArgs e) void PopupInterlock_CurrentJoinChanged(object sender, StatusChangedEventArgs e)
{ {
// Hide this driver and all sub drivers if popup interlock is not shown // Hide this driver and all sub drivers if popup interlock is not shown
if (Parent.AvDriver.PopupInterlock.IsShownFeedback.BoolValue == false) if (!e.IsShown || e.NewJoin != BackgroundSubpageJoin)
{ {
foreach (var driver in DeviceSubDrivers) foreach (var driver in DeviceSubDrivers)
{ {
driver.Hide(); driver.Hide();
} }
base.Hide(); base.Hide();
} }
} }
/// <summary> void IsShownFeedback_OutputChange(object sender, EventArgs e)
/// Shows this driver and all sub drivers {
/// </summary>
public override void Show() }
{
Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(BackgroundSubpageJoin); /// <summary>
/// Shows this driver and all sub drivers
foreach (var driver in DeviceSubDrivers) /// </summary>
{ public override void Show()
driver.Show(); {
} Parent.AvDriver.PopupInterlock.ShowInterlocked(BackgroundSubpageJoin);
base.Show(); foreach (var driver in DeviceSubDrivers)
} {
driver.Show();
/// <summary> }
/// Hides this driver and all sub drivers
/// </summary> base.Show();
public override void Hide() }
{
Parent.AvDriver.PopupInterlock.HideAndClear(); /// <summary>
/// Hides this driver and all sub drivers
foreach (var driver in DeviceSubDrivers) /// </summary>
{ public override void Hide()
driver.Hide(); {
} Parent.AvDriver.PopupInterlock.HideAndClear();
base.Hide(); foreach (var driver in DeviceSubDrivers)
} {
driver.Hide();
public override void Toggle() }
{
if (IsVisible) base.Hide();
Hide(); }
else
Show(); public override void Toggle()
} {
if (IsVisible)
Hide();
/// <summary> else
/// Reads the device keys from the config and gets the devices by key Show();
/// </summary> }
public void GetDevicesFromConfig(Room.Config.EssentialsEnvironmentPropertiesConfig EnvironmentPropertiesConfig)
{
if (EnvironmentPropertiesConfig != null) /// <summary>
{ /// Reads the device keys from the config and gets the devices by key
Devices.Clear(); /// </summary>
DeviceSubDrivers.Clear(); public void GetDevicesFromConfig(Room.Config.EssentialsEnvironmentPropertiesConfig EnvironmentPropertiesConfig)
{
uint column = 1; if (EnvironmentPropertiesConfig != null)
{
foreach (var dKey in EnvironmentPropertiesConfig.DeviceKeys) Devices.Clear();
{ DeviceSubDrivers.Clear();
var device = DeviceManager.GetDeviceForKey(dKey);
uint column = 1;
if (device != null)
{ foreach (var dKey in EnvironmentPropertiesConfig.DeviceKeys)
// Build the driver {
var devicePanelDriver = GetPanelDriverForDevice(device, column); var device = DeviceManager.GetDeviceForKey(dKey);
// Add new PanelDriverBase SubDriver if (device != null)
if (devicePanelDriver != null) {
{ // Build the driver
Devices.Add(device); var devicePanelDriver = GetPanelDriverForDevice(device, column);
DeviceSubDrivers.Add(devicePanelDriver);
// Add new PanelDriverBase SubDriver
Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key); if (devicePanelDriver != null)
{
column++; Devices.Add(device);
DeviceSubDrivers.Add(devicePanelDriver);
// Quit if device count is exceeded Debug.Console(1, "Adding '{0}' to Environment Devices", device.Key);
if (column > 4)
break; column++;
}
else
Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key); // Quit if device count is exceeded
if (column > 4)
} break;
}
} else
Debug.Console(1, "Unable to build environment driver for device: '{0}'", device.Key);
SetupEnvironmentUiJoins();
} }
else
{ }
Debug.Console(1, "Unable to get devices from config. No EnvironmentPropertiesConfig object in room config");
} SetupEnvironmentUiJoins();
} }
else
/// <summary> {
/// Returns the appropriate panel driver for the device Debug.Console(1, "Unable to get devices from config. No EnvironmentPropertiesConfig object in room config");
/// </summary> }
/// <param name="device"></param> }
/// <param name="column"></param>
/// <returns></returns> /// <summary>
PanelDriverBase GetPanelDriverForDevice(IKeyed device, uint column) /// Returns the appropriate panel driver for the device
{ /// </summary>
PanelDriverBase panelDriver = null; /// <param name="device"></param>
/// <param name="column"></param>
uint buttonPressJoinBase = 0; /// <returns></returns>
uint buttonVisibleJoinBase = 0; PanelDriverBase GetPanelDriverForDevice(IKeyed device, uint column)
uint stringJoinBase = 0; {
uint shadeTypeVisibleBase = 0; PanelDriverBase panelDriver = null;
uint lightingTypeVisibleBase = 0;
uint buttonPressJoinBase = 0;
switch (column) uint buttonVisibleJoinBase = 0;
{ uint stringJoinBase = 0;
case 1: uint shadeTypeVisibleBase = 0;
{ uint lightingTypeVisibleBase = 0;
buttonPressJoinBase = UIBoolJoin.EnvironmentColumnOneButtonPressBase;
buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnOneButtonVisibleBase; switch (column)
stringJoinBase = UIStringJoin.EnvironmentColumnOneLabelBase; {
shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneShadingTypeVisibleBase; case 1:
lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneLightingTypeVisibleBase; {
break; buttonPressJoinBase = UIBoolJoin.EnvironmentColumnOneButtonPressBase;
} buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnOneButtonVisibleBase;
case 2: stringJoinBase = UIStringJoin.EnvironmentColumnOneLabelBase;
{ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneShadingTypeVisibleBase;
buttonPressJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonPressBase; lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnOneLightingTypeVisibleBase;
buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonVisibleBase; break;
stringJoinBase = UIStringJoin.EnvironmentColumnTwoLabelBase; }
shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoShadingTypeVisibleBase; case 2:
lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoLightingTypeVisibleBase; {
break; buttonPressJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonPressBase;
} buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnTwoButtonVisibleBase;
case 3: stringJoinBase = UIStringJoin.EnvironmentColumnTwoLabelBase;
{ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoShadingTypeVisibleBase;
buttonPressJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonPressBase; lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnTwoLightingTypeVisibleBase;
buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonVisibleBase; break;
stringJoinBase = UIStringJoin.EnvironmentColumnThreeLabelBase; }
shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeShadingTypeVisibleBase; case 3:
lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeLightingTypeVisibleBase; {
break; buttonPressJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonPressBase;
} buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnThreeButtonVisibleBase;
case 4: stringJoinBase = UIStringJoin.EnvironmentColumnThreeLabelBase;
{ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeShadingTypeVisibleBase;
buttonPressJoinBase = UIBoolJoin.EnvironmentColumnFourButtonPressBase; lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnThreeLightingTypeVisibleBase;
buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnFourButtonVisibleBase; break;
stringJoinBase = UIStringJoin.EnvironmentColumnFourLabelBase; }
shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourShadingTypeVisibleBase; case 4:
lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourLightingTypeVisibleBase; {
break; buttonPressJoinBase = UIBoolJoin.EnvironmentColumnFourButtonPressBase;
} buttonVisibleJoinBase = UIBoolJoin.EnvironmentColumnFourButtonVisibleBase;
default: stringJoinBase = UIStringJoin.EnvironmentColumnFourLabelBase;
{ shadeTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourShadingTypeVisibleBase;
Debug.Console(1, "Environment Driver: Invalid column number specified"); lightingTypeVisibleBase = UIBoolJoin.EnvironmentColumnFourLightingTypeVisibleBase;
break; break;
} }
} default:
{
// Determine if device is a shade or lighting type and construct the appropriate driver Debug.Console(1, "Environment Driver: Invalid column number specified");
if (device is ShadeBase) break;
{ }
panelDriver = new EssentialsShadeDriver(this, device.Key, buttonPressJoinBase, stringJoinBase, shadeTypeVisibleBase); }
}
else if (device is LightingBase) // Determine if device is a shade or lighting type and construct the appropriate driver
{ if (device is ShadeBase)
panelDriver = new EssentialsLightingDriver(this, device.Key, buttonPressJoinBase, buttonVisibleJoinBase, stringJoinBase, lightingTypeVisibleBase); {
} panelDriver = new EssentialsShadeDriver(this, device.Key, buttonPressJoinBase, stringJoinBase, shadeTypeVisibleBase);
}
// Return the driver else if (device is LightingBase)
{
return panelDriver; panelDriver = new EssentialsLightingDriver(this, device.Key, buttonPressJoinBase, buttonVisibleJoinBase, stringJoinBase, lightingTypeVisibleBase);
} }
/// <summary> // Return the driver
/// Determines the join values for the generic environment subpages
/// </summary> return panelDriver;
void SetupEnvironmentUiJoins() }
{
// Calculate which background subpage join to use /// <summary>
BackgroundSubpageJoin = UIBoolJoin.EnvironmentBackgroundSubpageVisibleBase + (uint)DeviceSubDrivers.Count; /// Determines the join values for the generic environment subpages
/// </summary>
void SetupEnvironmentUiJoins()
} {
// Calculate which background subpage join to use
} BackgroundSubpageJoin = UIBoolJoin.EnvironmentBackgroundSubpageVisibleBase + (uint)DeviceSubDrivers.Count;
public interface IEnvironmentSubdriver
{ }
uint SubpageVisibleJoin { get; }
} }
public interface IEnvironmentSubdriver
{
uint SubpageVisibleJoin { get; }
}
} }

View File

@@ -1,266 +1,371 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.UI; using Crestron.SimplSharpPro.UI;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.SmartObjects; using PepperDash.Essentials.Core.SmartObjects;
using PepperDash.Essentials.Core.PageManagers; using PepperDash.Essentials.Core.PageManagers;
using PepperDash.Essentials.Room.Config; using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class EssentialsHeaderDriver : PanelDriverBase public class EssentialsHeaderDriver : PanelDriverBase
{ {
CrestronTouchpanelPropertiesConfig Config; uint EnvironmentCaretVisible;
uint CalendarCaretVisible;
/// <summary> uint CallCaretVisible;
/// The parent driver for this
/// </summary> JoinedSigInterlock CaretInterlock;
EssentialsPanelMainInterfaceDriver Parent;
CrestronTouchpanelPropertiesConfig Config;
/// <summary>
/// Indicates that the SetHeaderButtons method has completed successfully /// <summary>
/// </summary> /// The parent driver for this
public bool HeaderButtonsAreSetUp { get; private set; } /// </summary>
EssentialsPanelMainInterfaceDriver Parent;
StringInputSig HeaderCallButtonIconSig;
/// <summary>
public EssentialsHeaderDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config) /// Indicates that the SetHeaderButtons method has completed successfully
: base(parent.TriList) /// </summary>
{ public bool HeaderButtonsAreSetUp { get; private set; }
Config = config;
Parent = parent; StringInputSig HeaderCallButtonIconSig;
}
public EssentialsHeaderDriver(EssentialsPanelMainInterfaceDriver parent, CrestronTouchpanelPropertiesConfig config)
void SetUpGear(IAVDriver avDriver, EssentialsRoomBase currentRoom) : base(parent.TriList)
{ {
// Gear Config = config;
TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear"); Parent = parent;
TriList.SetSigHeldAction(UIBoolJoin.HeaderIcon5Press, 2000, CaretInterlock = new JoinedSigInterlock(TriList);
avDriver.ShowTech, }
null,
() => void SetUpGear(IAVDriver avDriver, EssentialsRoomBase currentRoom)
{ {
if (currentRoom.OnFeedback.BoolValue) // Gear
avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible); TriList.SetString(UIStringJoin.HeaderButtonIcon5, "Gear");
else TriList.SetSigHeldAction(UIBoolJoin.HeaderIcon5Press, 2000,
avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible); avDriver.ShowTech,
}); null,
TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () => () =>
avDriver.PopupInterlock.HideAndClear()); {
} if (currentRoom.OnFeedback.BoolValue)
{
void SetUpHelpButton(EssentialsRoomPropertiesConfig roomConf) avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPageVisible);
{ CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
// Help roomConf and popup }
if (roomConf.Help != null) else
{ {
TriList.SetString(UIStringJoin.HelpMessage, roomConf.Help.Message); avDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.VolumesPagePowerOffVisible);
TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, roomConf.Help.ShowCallButton); CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret5Visible);
TriList.SetString(UIStringJoin.HelpPageCallButtonText, roomConf.Help.CallButtonText); }
if (roomConf.Help.ShowCallButton) });
TriList.SetSigFalseAction(UIBoolJoin.HelpPageShowCallButtonPress, () => { }); // ************ FILL IN TriList.SetSigFalseAction(UIBoolJoin.TechExitButton, () =>
else avDriver.PopupInterlock.HideAndClear());
TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress); }
}
else // older config void SetUpHelpButton(EssentialsRoomPropertiesConfig roomConf)
{ {
TriList.SetString(UIStringJoin.HelpMessage, roomConf.HelpMessage); // Help roomConf and popup
TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, false); if (roomConf.Help != null)
TriList.SetString(UIStringJoin.HelpPageCallButtonText, null); {
TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress); TriList.SetString(UIStringJoin.HelpMessage, roomConf.Help.Message);
} TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, roomConf.Help.ShowCallButton);
TriList.SetString(UIStringJoin.HeaderButtonIcon4, "Help"); TriList.SetString(UIStringJoin.HelpPageCallButtonText, roomConf.Help.CallButtonText);
TriList.SetSigFalseAction(UIBoolJoin.HeaderIcon4Press, () => if (roomConf.Help.ShowCallButton)
{ {
string message = null; TriList.SetSigFalseAction(UIBoolJoin.HelpPageShowCallButtonPress, () => { }); // ************ FILL IN
var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey) }
as EssentialsHuddleSpaceRoom; else
if (room != null) {
message = room.Config.HelpMessage; TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
else }
message = "Sorry, no help message available. No room connected."; }
//TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message; else // older config
Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible); {
}); TriList.SetString(UIStringJoin.HelpMessage, roomConf.HelpMessage);
} TriList.SetBool(UIBoolJoin.HelpPageShowCallButtonVisible, false);
TriList.SetString(UIStringJoin.HelpPageCallButtonText, null);
uint SetUpEnvironmentButton(EssentialsEnvironmentDriver environmentDriver, uint nextJoin) TriList.ClearBoolSigAction(UIBoolJoin.HelpPageShowCallButtonPress);
{ }
if (environmentDriver != null) TriList.SetString(UIStringJoin.HeaderButtonIcon4, "Help");
{ TriList.SetSigFalseAction(UIBoolJoin.HeaderIcon4Press, () =>
TriList.SetString(nextJoin, "Lights"); {
TriList.SetSigFalseAction(nextJoin, environmentDriver.Toggle); string message = null;
nextJoin--; var room = DeviceManager.GetDeviceForKey(Config.DefaultRoomKey)
return nextJoin; as EssentialsHuddleSpaceRoom;
} if (room != null)
else message = room.Config.HelpMessage;
return nextJoin; else
} message = "Sorry, no help message available. No room connected.";
//TriList.StringInput[UIStringJoin.HelpMessage].StringValue = message;
uint SetUpCalendarButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin) Parent.AvDriver.PopupInterlock.ShowInterlockedWithToggle(UIBoolJoin.HelpPageVisible);
{ CaretInterlock.ShowInterlocked(UIBoolJoin.HeaderCaret4Visible);
// Calendar button });
if (avDriver.CurrentRoom.ScheduleSource != null) }
{
TriList.SetString(nextJoin, "Calendar"); uint SetUpEnvironmentButton(EssentialsEnvironmentDriver environmentDriver, uint nextJoin)
TriList.SetSigFalseAction(nextJoin, avDriver.CalendarPress); {
if (environmentDriver != null)
nextJoin--; {
return nextJoin; var tempJoin = nextJoin;
} TriList.SetString(tempJoin, "Lights");
else EnvironmentCaretVisible = tempJoin + 10;
return nextJoin; TriList.SetSigFalseAction(tempJoin, () =>
} {
environmentDriver.Toggle();
uint SetUpCallButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin) CaretInterlock.ShowInterlocked(EnvironmentCaretVisible);
{ });
// Call button nextJoin--;
TriList.SetString(nextJoin, "DND"); return nextJoin;
TriList.SetSigFalseAction(nextJoin, avDriver.ShowActiveCallsList); }
HeaderCallButtonIconSig = TriList.StringInput[nextJoin]; else
return nextJoin;
nextJoin--; }
return nextJoin;
} uint SetUpCalendarButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
{
/// <summary> // Calendar button
/// Evaluates the call status and sets the icon mode and text label if (avDriver.CurrentRoom.ScheduleSource != null)
/// </summary> {
public void ComputeHeaderCallStatus(VideoCodecBase codec) var tempJoin = nextJoin;
{ TriList.SetString(tempJoin, "Calendar");
if (codec == null) CalendarCaretVisible = tempJoin + 10;
{ TriList.SetSigFalseAction(tempJoin, () =>
Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null"); {
return; avDriver.CalendarPress();
} CaretInterlock.ShowInterlocked(CalendarCaretVisible);
});
if (HeaderCallButtonIconSig == null)
{ nextJoin--;
Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null"); return nextJoin;
return; }
} else
return nextJoin;
// Set mode of header button }
if (!codec.IsInCall)
{ uint SetUpCallButton(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, uint nextJoin)
HeaderCallButtonIconSig.StringValue = "DND"; {
//HeaderCallButton.SetIcon(HeaderListButton.OnHook); // Call button
} var tempJoin = nextJoin;
else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video)) TriList.SetString(tempJoin, "DND");
HeaderCallButtonIconSig.StringValue = "Misc-06_Dark"; CallCaretVisible = tempJoin + 10;
//HeaderCallButton.SetIcon(HeaderListButton.Camera); TriList.SetSigFalseAction(tempJoin, () =>
//TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2); {
else avDriver.ShowActiveCallsList();
HeaderCallButtonIconSig.StringValue = "Misc-09_Dark"; if(avDriver.CurrentRoom.InCallFeedback.BoolValue)
//HeaderCallButton.SetIcon(HeaderListButton.Phone); CaretInterlock.ShowInterlocked(CallCaretVisible);
//TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1); });
HeaderCallButtonIconSig = TriList.StringInput[tempJoin];
// Set the call status text
if (codec.ActiveCalls.Count > 0) nextJoin--;
{ return nextJoin;
if (codec.ActiveCalls.Count == 1) }
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call");
else if (codec.ActiveCalls.Count > 1) /// <summary>
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count)); /// Evaluates the call status and sets the icon mode and text label
} /// </summary>
else public void ComputeHeaderCallStatus(VideoCodecBase codec)
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls"); {
} if (codec == null)
{
/// <summary> Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. codec is null");
/// Sets up Header Buttons for the EssentialsHuddleVtc1Room type return;
/// </summary> }
public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, EssentialsHuddleVtc1Room currentRoom)
{ if (HeaderCallButtonIconSig == null)
HeaderButtonsAreSetUp = false; {
Debug.Console(1, "ComputeHeaderCallStatus() cannot execute. HeaderCallButtonIconSig is null");
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true); return;
}
var roomConf = currentRoom.Config;
// Set mode of header button
SetUpGear(avDriver, currentRoom); if (!codec.IsInCall)
{
SetUpHelpButton(roomConf); HeaderCallButtonIconSig.StringValue = "DND";
//HeaderCallButton.SetIcon(HeaderListButton.OnHook);
uint nextJoin = 3953; }
else if (codec.ActiveCalls.Any(c => c.Type == eCodecCallType.Video))
nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin); HeaderCallButtonIconSig.StringValue = "Misc-06_Dark";
//HeaderCallButton.SetIcon(HeaderListButton.Camera);
nextJoin = SetUpCalendarButton(avDriver, nextJoin); //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 2);
else
nextJoin = SetUpCallButton(avDriver, nextJoin); HeaderCallButtonIconSig.StringValue = "Misc-09_Dark";
//HeaderCallButton.SetIcon(HeaderListButton.Phone);
// blank any that remain //TriList.SetUshort(UIUshortJoin.CallHeaderButtonMode, 1);
for (var i = nextJoin; i > 3950; i--)
{ // Set the call status text
TriList.SetString(i, "Blank"); if (codec.ActiveCalls.Count > 0)
TriList.SetSigFalseAction(i, () => { }); {
} if (codec.ActiveCalls.Count == 1)
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "1 Active Call");
TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress, avDriver.ShowActiveCallsList); else if (codec.ActiveCalls.Count > 1)
TriList.SetString(UIStringJoin.HeaderCallStatusLabel, string.Format("{0} Active Calls", codec.ActiveCalls.Count));
// Set Call Status Subpage Position }
else
if (nextJoin == 3951) TriList.SetString(UIStringJoin.HeaderCallStatusLabel, "No Active Calls");
{ }
// Set to right position
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false); /// <summary>
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true); /// Sets up Header Buttons for the EssentialsHuddleVtc1Room type
} /// </summary>
else if (nextJoin == 3950) public void SetupHeaderButtons(EssentialsHuddleVtc1PanelAvFunctionsDriver avDriver, EssentialsHuddleVtc1Room currentRoom)
{ {
// Set to left position HeaderButtonsAreSetUp = false;
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false); TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
}
var roomConf = currentRoom.Config;
HeaderButtonsAreSetUp = true;
// Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
ComputeHeaderCallStatus(currentRoom.VideoCodec); Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
} Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
/// <summary> SetUpGear(avDriver, currentRoom);
/// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type
/// </summary> SetUpHelpButton(roomConf);
public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, EssentialsHuddleSpaceRoom currentRoom)
{ uint nextJoin = 3953;
HeaderButtonsAreSetUp = false;
nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
nextJoin = SetUpCalendarButton(avDriver, nextJoin);
var roomConf = currentRoom.Config;
nextJoin = SetUpCallButton(avDriver, nextJoin);
SetUpGear(avDriver, currentRoom);
// blank any that remain
SetUpHelpButton(roomConf); for (var i = nextJoin; i > 3950; i--)
{
uint nextJoin = 3953; TriList.SetString(i, "Blank");
TriList.SetSigFalseAction(i, () => { });
nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin); }
// blank any that remain TriList.SetSigFalseAction(UIBoolJoin.HeaderCallStatusLabelPress,
for (var i = nextJoin; i > 3950; i--) () =>
{ {
TriList.SetString(i, "Blank"); avDriver.ShowActiveCallsList();
TriList.SetSigFalseAction(i, () => { }); if (avDriver.CurrentRoom.InCallFeedback.BoolValue)
} CaretInterlock.ShowInterlocked(CallCaretVisible);
});
HeaderButtonsAreSetUp = true;
} // Set Call Status Subpage Position
} if (nextJoin == 3951)
{
// Set to right position
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, false);
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, true);
}
else if (nextJoin == 3950)
{
// Set to left position
TriList.SetBool(UIBoolJoin.HeaderCallStatusLeftPositionVisible, true);
TriList.SetBool(UIBoolJoin.HeaderCallStatusRightPositionVisible, false);
}
HeaderButtonsAreSetUp = true;
ComputeHeaderCallStatus(currentRoom.VideoCodec);
}
/// <summary>
/// Sets up Header Buttons for the EssentialsHuddleSpaceRoom type
/// </summary>
public void SetupHeaderButtons(EssentialsHuddlePanelAvFunctionsDriver avDriver, EssentialsHuddleSpaceRoom currentRoom)
{
HeaderButtonsAreSetUp = false;
TriList.SetBool(UIBoolJoin.TopBarHabaneroDynamicVisible, true);
var roomConf = currentRoom.Config;
// Register for the PopupInterlock IsShowsFeedback event to tie the header carets subpage visiblity to it
Parent.AvDriver.PopupInterlock.StatusChanged -= PopupInterlock_StatusChanged;
Parent.AvDriver.PopupInterlock.StatusChanged += PopupInterlock_StatusChanged;
SetUpGear(avDriver, currentRoom);
SetUpHelpButton(roomConf);
uint nextJoin = 3953;
nextJoin = SetUpEnvironmentButton(Parent.EnvironmentDriver, nextJoin);
// blank any that remain
for (var i = nextJoin; i > 3950; i--)
{
TriList.SetString(i, "Blank");
TriList.SetSigFalseAction(i, () => { });
}
HeaderButtonsAreSetUp = true;
}
///// <summary>
///// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
///// </summary>
///// <param name="sender"></param>
///// <param name="e"></param>
//void IsShownFeedback_OutputChange(object sender, EventArgs e)
//{
// var popupInterlockIsShown = Parent.AvDriver.PopupInterlock.IsShown;
// // Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
// TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, popupInterlockIsShown);
// // Clear all caret visibility
// for (uint i = UIBoolJoin.HeaderCaret5Visible; i >= UIBoolJoin.HeaderCaret1Visible; i--)
// {
// TriList.SetBool(i, false);
// }
// // Set the current caret visible if the popup is still shown
// if (popupInterlockIsShown)
// TriList.SetBool(NextCaretVisible, true);
//}
/// <summary>
/// Whenever a popup is shown/hidden, show/hide the header carets subpage and set the visibility of the correct caret
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void PopupInterlock_StatusChanged(object sender, StatusChangedEventArgs e)
{
// Set the visible state for the HeaderPopupCaretsSubpage to match that of the PopupInterlock state
bool headerPopupShown = false;
// Check if the popup interlock is shown, and if one of the header popups is current, then show the carets subpage
if (e.IsShown)
{
if (e.NewJoin == Parent.EnvironmentDriver.BackgroundSubpageJoin)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HeaderActiveCallsListVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.HelpPageVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.MeetingsOrContacMethodsListVisible)
headerPopupShown = true;
else if (e.NewJoin == UIBoolJoin.VolumesPagePowerOffVisible || e.NewJoin == UIBoolJoin.VolumesPageVisible)
headerPopupShown = true;
}
// Set the carets subpage visibility
TriList.SetBool(UIBoolJoin.HeaderPopupCaretsSubpageVisibile, headerPopupShown);
if (!e.IsShown)
CaretInterlock.HideAndClear();
}
}
} }

View File

@@ -1,129 +1,175 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
public class JoinedSigInterlock public class JoinedSigInterlock
{ {
public uint CurrentJoin { get; private set; } public uint CurrentJoin { get; private set; }
BasicTriList TriList; BasicTriList TriList;
public BoolFeedback IsShownFeedback; public BoolFeedback IsShownFeedback;
bool _IsShown; public event EventHandler<StatusChangedEventArgs> StatusChanged;
public bool IsShown bool _IsShown;
{
get public bool IsShown
{ {
return _IsShown; get
} {
private set return _IsShown;
{ }
_IsShown = value; private set
IsShownFeedback.FireUpdate(); {
} _IsShown = value;
} IsShownFeedback.FireUpdate();
}
//public BoolFeedback ShownFeedback { get; private set; } }
public JoinedSigInterlock(BasicTriList triList) //public BoolFeedback ShownFeedback { get; private set; }
{
TriList = triList; public JoinedSigInterlock(BasicTriList triList)
{
IsShownFeedback = new BoolFeedback(new Func<bool>( () => _IsShown)); TriList = triList;
}
IsShownFeedback = new BoolFeedback(new Func<bool>( () => _IsShown));
/// <summary> }
/// Hides CurrentJoin and shows join. Will check and re-set signal if join
/// equals CurrentJoin /// <summary>
/// </summary> /// Hides CurrentJoin and shows join. Will check and re-set signal if join
public void ShowInterlocked(uint join) /// equals CurrentJoin
{ /// </summary>
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join); public void ShowInterlocked(uint join)
if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue) {
return; var prevJoin = CurrentJoin;
SetButDontShow(join); var wasShown = _IsShown;
TriList.SetBool(CurrentJoin, true); Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
IsShown = true; if (CurrentJoin == join && TriList.BooleanInput[join].BoolValue)
} return;
SetButDontShow(join);
/// <summary> TriList.SetBool(CurrentJoin, true);
/// IsShown = true;
/// </summary>
/// <param name="join"></param> OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
public void ShowInterlockedWithToggle(uint join) }
{
Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join); /// <summary>
if (CurrentJoin == join) ///
HideAndClear(); /// </summary>
else /// <param name="join"></param>
{ public void ShowInterlockedWithToggle(uint join)
if (CurrentJoin > 0) {
TriList.BooleanInput[CurrentJoin].BoolValue = false; var prevJoin = CurrentJoin;
CurrentJoin = join; var wasShown = IsShown;
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true; Debug.Console(2, "Trilist {0:X2}, interlock swapping {1} for {2}", TriList.ID, CurrentJoin, join);
} if (CurrentJoin == join)
} HideAndClear();
/// <summary> else
/// Hides current join and clears CurrentJoin {
/// </summary> if (CurrentJoin > 0)
public void HideAndClear() TriList.BooleanInput[CurrentJoin].BoolValue = false;
{ CurrentJoin = join;
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin); TriList.BooleanInput[CurrentJoin].BoolValue = true;
Hide(); IsShown = true;
CurrentJoin = 0;
} OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
/// <summary> }
/// Hides the current join but does not clear the selected join in case /// <summary>
/// it needs to be reshown /// Hides current join and clears CurrentJoin
/// </summary> /// </summary>
public void Hide() public void HideAndClear()
{ {
Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin); var prevJoin = CurrentJoin;
if (CurrentJoin > 0) var wasShown = IsShown;
{ Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
TriList.BooleanInput[CurrentJoin].BoolValue = false; Hide();
IsShown = false; CurrentJoin = 0;
}
} OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
/// <summary>
/// If CurrentJoin is set, it restores that join /// <summary>
/// </summary> /// Hides the current join but does not clear the selected join in case
public void Show() /// it needs to be reshown
{ /// </summary>
Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin); public void Hide()
if (CurrentJoin > 0) {
{ var prevJoin = CurrentJoin;
TriList.BooleanInput[CurrentJoin].BoolValue = true; var wasShown = IsShown;
IsShown = true;
} Debug.Console(2, "Trilist {0:X2}, interlock hiding {1}", TriList.ID, CurrentJoin);
} if (CurrentJoin > 0)
{
/// <summary> TriList.BooleanInput[CurrentJoin].BoolValue = false;
/// Useful for pre-setting the interlock but not enabling it. Sets CurrentJoin IsShown = false;
/// </summary> OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
/// <param name="join"></param> }
public void SetButDontShow(uint join) }
{
if (CurrentJoin > 0) /// <summary>
{ /// If CurrentJoin is set, it restores that join
TriList.BooleanInput[CurrentJoin].BoolValue = false; /// </summary>
IsShown = false; public void Show()
} {
CurrentJoin = join; var prevJoin = CurrentJoin;
} var wasShown = IsShown;
} Debug.Console(2, "Trilist {0:X2}, interlock showing {1}", TriList.ID, CurrentJoin);
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = true;
IsShown = true;
OnStatusChange(prevJoin, CurrentJoin, wasShown, IsShown);
}
}
/// <summary>
/// Useful for pre-setting the interlock but not enabling it. Sets CurrentJoin
/// </summary>
/// <param name="join"></param>
public void SetButDontShow(uint join)
{
if (CurrentJoin > 0)
{
TriList.BooleanInput[CurrentJoin].BoolValue = false;
IsShown = false;
}
CurrentJoin = join;
}
void OnStatusChange(uint prevJoin, uint newJoin, bool wasShown, bool isShown)
{
var handler = StatusChanged;
if (handler != null)
handler(this, new StatusChangedEventArgs(prevJoin, newJoin, wasShown, isShown));
}
}
public class StatusChangedEventArgs : EventArgs
{
public uint PreviousJoin { get; set; }
public uint NewJoin { get; set; }
public bool WasShown { get; set; }
public bool IsShown { get; set; }
public StatusChangedEventArgs(uint prevJoin, uint newJoin, bool wasShown, bool isShown)
{
PreviousJoin = prevJoin;
NewJoin = newJoin;
WasShown = wasShown;
IsShown = isShown;
}
}
} }