mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-12 11:15:08 +00:00
Adding DualDisplay to build methods
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using Crestron.SimplSharp;
|
using Crestron.SimplSharp;
|
||||||
using Crestron.SimplSharp.CrestronIO;
|
using Crestron.SimplSharp.CrestronIO;
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
@@ -12,10 +11,9 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash.Essentials.Core.Config;
|
using PepperDash.Essentials.Core.Config;
|
||||||
|
using PepperDash.Essentials.Core.Fusion;
|
||||||
using PepperDash.Essentials.Core.Rooms.Config;
|
using PepperDash.Essentials.Core.Rooms.Config;
|
||||||
using PepperDash.Essentials.DM;
|
using PepperDash.Essentials.DM;
|
||||||
using PepperDash.Essentials.Fusion;
|
|
||||||
using PepperDash.Essentials.Room.Config;
|
|
||||||
//using PepperDash.Essentials.Room.MobileControl;
|
//using PepperDash.Essentials.Room.MobileControl;
|
||||||
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@@ -440,68 +438,71 @@ namespace PepperDash.Essentials
|
|||||||
{
|
{
|
||||||
if (ConfigReader.ConfigObject.Rooms == null)
|
if (ConfigReader.ConfigObject.Rooms == null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "NOTICE: No Essentials Rooms found in current configuration.");
|
Debug.Console(0, Debug.ErrorLogLevel.Warning, "WARNING: Configuration contains no rooms");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
foreach (var roomConfig in ConfigReader.ConfigObject.Rooms)
|
||||||
{
|
{
|
||||||
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
|
var room = EssentialsRoomConfigHelper.GetRoomObject(roomConfig) as EssentialsRoomBase;
|
||||||
if (room == null)
|
if (room != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'", roomConfig.Key);
|
var huddleRoom = room as EssentialsHuddleSpaceRoom;
|
||||||
return;
|
if (huddleRoom != null)
|
||||||
}
|
{
|
||||||
|
DeviceManager.AddDevice(huddleRoom);
|
||||||
|
|
||||||
var huddleRoom = room as EssentialsHuddleSpaceRoom;
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
var vtcRoom = room as EssentialsHuddleVtc1Room;
|
"Room is EssentialsHuddleSpaceRoom, attempting to add to DeviceManager with Fusion");
|
||||||
|
DeviceManager.AddDevice(
|
||||||
|
new EssentialsHuddleSpaceFusionSystemControllerBase(huddleRoom, 0xf1));
|
||||||
|
|
||||||
if (huddleRoom != null)
|
|
||||||
{
|
|
||||||
DeviceManager.AddDevice(huddleRoom);
|
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
// Mobile Control bridge
|
|
||||||
//var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room as EssentialsHuddleSpaceRoom);
|
|
||||||
//AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
|
||||||
//DeviceManager.AddDevice(bridge);
|
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(huddleRoom);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else if (room is EssentialsHuddleVtc1Room)
|
|
||||||
{
|
|
||||||
DeviceManager.AddDevice(room);
|
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
var ddRoom = room as EssentialsDualDisplayRoom;
|
||||||
// Mobile Control bridge
|
//checking for dual display room first, as it inherits from EssentialsHuddleVtc1Room
|
||||||
var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(huddleRoom);
|
if (ddRoom != null)
|
||||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
{
|
||||||
DeviceManager.AddDevice(bridge);
|
DeviceManager.AddDevice(ddRoom);
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room is EssentialsDualDisplayRoom, attempting to add to DeviceManager with Fusion");
|
||||||
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController(ddRoom, 0xf1));
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
// Mobile Control bridge
|
|
||||||
//var bridge = new MobileConrolEssentialsHuddleSpaceRoomBridge(room);
|
|
||||||
//AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
|
||||||
//DeviceManager.AddDevice(bridge);
|
|
||||||
|
|
||||||
CreateMobileControlBridge(room);
|
CreateMobileControlBridge(ddRoom);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
var vtc1Room = room as EssentialsHuddleVtc1Room;
|
||||||
|
if (vtc1Room != null)
|
||||||
{
|
{
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
DeviceManager.AddDevice(vtc1Room);
|
||||||
DeviceManager.AddDevice(room);
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
|
"Room is EssentialsHuddleVtc1Room, attempting to add to DeviceManager with Fusion");
|
||||||
|
DeviceManager.AddDevice(new EssentialsHuddleVtc1FusionController(vtc1Room, 0xf1));
|
||||||
|
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
||||||
|
|
||||||
|
CreateMobileControlBridge(vtc1Room);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Attempting to build Mobile Control Bridge...");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice,
|
||||||
// Mobile Control bridge
|
"Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
||||||
var bridge = new MobileControlEssentialsHuddleSpaceRoomBridge(room);
|
DeviceManager.AddDevice(room);
|
||||||
AddBridgePostActivationHelper(bridge); // Lets things happen later when all devices are present
|
|
||||||
DeviceManager.AddDevice(bridge);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Room is NOT EssentialsRoom, attempting to add to DeviceManager w/o Fusion");
|
}
|
||||||
DeviceManager.AddDevice(room);
|
else
|
||||||
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "WARNING: Cannot create room from config, key '{0}'",
|
||||||
|
roomConfig.Key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ 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.PageManagers;
|
using PepperDash.Essentials.Core.PageManagers;
|
||||||
|
using PepperDashEssentials.UIDrivers.EssentialsDualDisplay;
|
||||||
|
|
||||||
namespace PepperDash.Essentials
|
namespace PepperDash.Essentials
|
||||||
{
|
{
|
||||||
@@ -178,7 +179,7 @@ namespace PepperDash.Essentials
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Panel_SigChange(object currentDevice, Crestron.SimplSharpPro.SigEventArgs args)
|
void Panel_SigChange(object currentDevice, SigEventArgs args)
|
||||||
{
|
{
|
||||||
if (Debug.Level == 2)
|
if (Debug.Level == 2)
|
||||||
Debug.Console(2, this, "Sig change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
Debug.Console(2, this, "Sig change: {0} {1}={2}", args.Sig.Type, args.Sig.Number, args.Sig.StringValue);
|
||||||
@@ -271,6 +272,56 @@ namespace PepperDash.Essentials
|
|||||||
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||||
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||||
}
|
}
|
||||||
|
else if (room is EssentialsDualDisplayRoom)
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "Adding Dual Display VTC AV driver");
|
||||||
|
|
||||||
|
// Header Driver
|
||||||
|
mainDriver.HeaderDriver = new EssentialsHeaderDriver(mainDriver, props);
|
||||||
|
|
||||||
|
// AV Driver
|
||||||
|
var avDriver = new EssentialsDualDisplayPanelAvFunctionsDriver(mainDriver, props);
|
||||||
|
|
||||||
|
var codecDriver = new UIDrivers.VC.EssentialsVideoCodecUiDriver(panelController.Panel, avDriver,
|
||||||
|
(room as EssentialsDualDisplayRoom).VideoCodec, mainDriver.HeaderDriver);
|
||||||
|
avDriver.SetVideoCodecDriver(codecDriver);
|
||||||
|
avDriver.DefaultRoomKey = props.DefaultRoomKey;
|
||||||
|
mainDriver.AvDriver = avDriver;
|
||||||
|
avDriver.CurrentRoom = room as EssentialsHuddleVtc1Room;
|
||||||
|
|
||||||
|
// Environment Driver
|
||||||
|
if (avDriver.CurrentRoom.PropertiesConfig.Environment != null && avDriver.CurrentRoom.PropertiesConfig.Environment.DeviceKeys.Count > 0)
|
||||||
|
{
|
||||||
|
Debug.Console(0, panelController, "Adding environment driver");
|
||||||
|
mainDriver.EnvironmentDriver = new EssentialsEnvironmentDriver(mainDriver, props);
|
||||||
|
|
||||||
|
mainDriver.EnvironmentDriver.GetDevicesFromConfig(avDriver.CurrentRoom.PropertiesConfig.Environment);
|
||||||
|
}
|
||||||
|
|
||||||
|
mainDriver.HeaderDriver.SetupHeaderButtons(avDriver, avDriver.CurrentRoom);
|
||||||
|
|
||||||
|
panelController.LoadAndShowDriver(mainDriver); // This is a little convoluted.
|
||||||
|
|
||||||
|
if (!(panelController.Panel is TswFt5ButtonSystem))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var tsw = panelController.Panel as TswFt5ButtonSystem;
|
||||||
|
// Wire up hard keys
|
||||||
|
tsw.Power.UserObject = new Action<bool>(b => { if (!b) avDriver.EndMeetingPress(); });
|
||||||
|
//tsw.Home.UserObject = new Action<bool>(b => { if (!b) HomePressed(); });
|
||||||
|
if (mainDriver.EnvironmentDriver != null)
|
||||||
|
tsw.Lights.UserObject = new Action<bool>(b =>
|
||||||
|
{
|
||||||
|
if (!b)
|
||||||
|
{
|
||||||
|
//mainDriver.AvDriver.PopupInterlock.ShowInterlockedWithToggle(mainDriver.EnvironmentDriver.BackgroundSubpageJoin);
|
||||||
|
mainDriver.EnvironmentDriver.Toggle();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
tsw.Up.UserObject = new Action<bool>(avDriver.VolumeUpPress);
|
||||||
|
tsw.Down.UserObject = new Action<bool>(avDriver.VolumeDownPress);
|
||||||
|
}
|
||||||
else if (room is EssentialsHuddleVtc1Room)
|
else if (room is EssentialsHuddleVtc1Room)
|
||||||
{
|
{
|
||||||
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
Debug.Console(0, panelController, "Adding huddle space VTC AV driver");
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ namespace PepperDashEssentials.UIDrivers.EssentialsDualDisplay
|
|||||||
{
|
{
|
||||||
private EssentialsDualDisplayRoom _currentRoom;
|
private EssentialsDualDisplayRoom _currentRoom;
|
||||||
|
|
||||||
private BoolInputSig _routeToggleVisibility;
|
private readonly BoolInputSig _routeToggleVisibility;
|
||||||
|
|
||||||
private readonly BoolFeedback _sharingMode;
|
private readonly BoolFeedback _sharingMode;
|
||||||
|
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ namespace PepperDash.Essentials.Core.Config
|
|||||||
|
|
||||||
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
public Dictionary<string, DestinationListItem> GetDestinationListForKey(string key)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(key) || !SourceLists.ContainsKey(key))
|
if (string.IsNullOrEmpty(key) || !DestinationLists.ContainsKey(key))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return DestinationLists[key];
|
return DestinationLists[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, retunes null
|
/// Checks Devices for an item with a Key that matches and returns it if found. Otherwise, returns null
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key">Key of desired device</param>
|
/// <param name="key">Key of desired device</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
|||||||
@@ -18,8 +18,7 @@ namespace PepperDash.Essentials.Core.Rooms.Config
|
|||||||
{
|
{
|
||||||
var typeName = roomConfig.Type.ToLower();
|
var typeName = roomConfig.Type.ToLower();
|
||||||
|
|
||||||
EssentialsRoomBase rm;
|
if (typeName == "huddle")
|
||||||
if (typeName == "huddle")
|
|
||||||
{
|
{
|
||||||
var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
|
var huddle = new EssentialsHuddleSpaceRoom(roomConfig);
|
||||||
|
|
||||||
@@ -27,22 +26,22 @@ namespace PepperDash.Essentials.Core.Rooms.Config
|
|||||||
}
|
}
|
||||||
if (typeName == "huddlevtc1")
|
if (typeName == "huddlevtc1")
|
||||||
{
|
{
|
||||||
rm = new EssentialsHuddleVtc1Room(roomConfig);
|
EssentialsRoomBase rm = new EssentialsHuddleVtc1Room(roomConfig);
|
||||||
|
|
||||||
return rm;
|
return rm;
|
||||||
}
|
}
|
||||||
if (typeName == "ddvc01Bridge")
|
if (typeName == "ddvc01Bridge")
|
||||||
{
|
{
|
||||||
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
return new Device(roomConfig.Key, roomConfig.Name); // placeholder device that does nothing.
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeName != "dualdisplay")
|
if (typeName != "dualdisplay")
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//rm = new EssentialsDualDisplayRoom();
|
var dualDisplay = new EssentialsDualDisplayRoom(roomConfig);
|
||||||
|
return dualDisplay;
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user