Added many UI Joins.

This commit is contained in:
Heath Volmer
2017-09-11 16:08:55 -06:00
parent cb5dcc5088
commit b81c667e5f
26 changed files with 1127 additions and 501 deletions

View File

@@ -1,11 +1,13 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Crestron.SimplSharp.CrestronIO; using System.Text.RegularExpressions;
using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions; using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {

View File

@@ -141,6 +141,9 @@
<Compile Include="Fusion\FusionSystemController.cs" /> <Compile Include="Fusion\FusionSystemController.cs" />
<Compile Include="HttpApiHandler.cs" /> <Compile Include="HttpApiHandler.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
<Compile Include="Room\Cotija\CotijaConfig.cs" /> <Compile Include="Room\Cotija\CotijaConfig.cs" />
<Compile Include="Room\Cotija\CotijaRoomBridge.cs" /> <Compile Include="Room\Cotija\CotijaRoomBridge.cs" />
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IChannelExtensions.cs" /> <Compile Include="Room\Cotija\DeviceTypeInterfaces\IChannelExtensions.cs" />
@@ -151,23 +154,24 @@
<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\EssentialsPresentationRoom.cs" /> <Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
<Compile Include="Room\EssentialsRoomBase.cs" /> <Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
<Compile Include="Room\EssentialsRoomConfig.cs" /> <Compile Include="Room\Types\EssentialsRoomBase.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="Room\UI\SubpageReferenceListCallStagingItem.cs" /> <Compile Include="UI\SubpageReferenceListCallStagingItem.cs" />
<Compile Include="UIDrivers\EssentialsCiscoSpark\EssentialsCiscoSparkUiDriver.cs" /> <Compile Include="UIDrivers\EssentialsCiscoSpark\EssentialsCiscoSparkUiDriver.cs" />
<Compile Include="UIDrivers\JoinedSigInterlock.cs" /> <Compile Include="UIDrivers\JoinedSigInterlock.cs" />
<Compile Include="UIDrivers\EssentialsHuddleVTC\HuddleVTCPanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\EssentialsHuddleVTC\HuddleVTCPanelAvFunctionsDriver.cs" />
<Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" /> <Compile Include="UIDrivers\VolumeAndSourceChangeArgs.cs" />
<Compile Include="UIDrivers\UISmartObjectJoin.cs" /> <Compile Include="UI\JoinConstants\UISmartObjectJoin.cs" />
<Compile Include="UIDrivers\UIStringlJoin.cs" /> <Compile Include="UI\JoinConstants\UIStringlJoin.cs" />
<Compile Include="UIDrivers\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" />
@@ -176,22 +180,21 @@
<Compile Include="UIDrivers\Essentials\EssentialsHuddlePanelAvFunctionsDriver.cs" /> <Compile Include="UIDrivers\Essentials\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="UIDrivers\UIBoolJoin.cs" /> <Compile Include="UI\JoinConstants\UIBoolJoin.cs" />
<Compile Include="Room\Cotija\CotijaSystemController.cs" /> <Compile Include="Room\Cotija\CotijaSystemController.cs" />
<Compile Include="Room\UI\DualDisplaySourceSRLController.cs" /> <Compile Include="UI\DualDisplaySourceSRLController.cs" />
<Compile Include="Room\UI\SubpageReferenceListActivityItem.cs" /> <Compile Include="UI\SubpageReferenceListActivityItem.cs" />
<Compile Include="Room\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\EssentialsHuddleSpaceRoom.cs" /> <Compile Include="Room\Types\EssentialsHuddleSpaceRoom.cs" />
<Compile Include="Room\UI\EssentialsTouchpanelController.cs" /> <Compile Include="UI\EssentialsTouchpanelController.cs" />
<Compile Include="Room\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" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="OTHER\" /> <Folder Include="OTHER\" />
<Folder Include="Room\Nyu\" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>

View File

@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Room.Config
{
/// <summary>
///
/// </summary>
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultDisplayKey { get; set; }
public string DefaultAudioKey { get; set; }
public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Room.Config
{
public class EssentialsHuddleVtc1PropertiesConfig
{
}
}

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Room.Config
{
/// <summary>
///
/// </summary>
public class EssentialsPresentationRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultAudioBehavior { get; set; }
public string DefaultAudioKey { get; set; }
public string DefaultVideoBehavior { get; set; }
public List<string> DisplayKeys { get; set; }
public string SourceListKey { get; set; }
public bool HasDsp { get; set; }
public EssentialsPresentationRoomPropertiesConfig()
{
DisplayKeys = new List<string>();
}
}
}

View File

@@ -2,16 +2,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.RegularExpressions;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.DM;
namespace PepperDash.Essentials namespace PepperDash.Essentials.Room.Config
{ {
public class EssentialsRoomConfig : DeviceConfig public class EssentialsRoomConfig : DeviceConfig
{ {
@@ -54,6 +54,15 @@ namespace PepperDash.Essentials
var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterVolumeControlDev, props); var presRoom = new EssentialsPresentationRoom(Key, Name, displaysDict, masterVolumeControlDev, props);
return presRoom; return presRoom;
} }
else if (typeName == "huddlevtc1")
{
var props = JsonConvert.DeserializeObject<EssentialsHuddleVtc1PropertiesConfig>
(this.Properties.ToString());
var vtcRoom = new EssentialsHuddleVtc1Room(Key, Name, null, null, props);
return vtcRoom;
}
return null; return null;
} }
} }
@@ -138,32 +147,4 @@ namespace PepperDash.Essentials
public List<string> Types { get; set; } public List<string> Types { get; set; }
} }
/// <summary>
///
/// </summary>
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultDisplayKey { get; set; }
public string DefaultAudioKey { get; set; }
public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; }
}
/// <summary>
///
/// </summary>
public class EssentialsPresentationRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{
public string DefaultAudioBehavior { get; set; }
public string DefaultAudioKey { get; set; }
public string DefaultVideoBehavior { get; set; }
public List<string> DisplayKeys { get; set; }
public string SourceListKey { get; set; }
public bool HasDsp { get; set; }
public EssentialsPresentationRoomPropertiesConfig()
{
DisplayKeys = new List<string>();
}
}
} }

View File

@@ -1,419 +1,420 @@
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.Room.Config;
namespace PepperDash.Essentials
{ namespace PepperDash.Essentials
public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange {
{ public class EssentialsHuddleSpaceRoom : EssentialsRoomBase, IHasCurrentSourceInfoChange
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange; {
public event SourceInfoChangeHandler CurrentSingleSourceChange; public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
public event SourceInfoChangeHandler CurrentSingleSourceChange;
protected override Func<bool> OnFeedbackFunc
{ protected override Func<bool> OnFeedbackFunc
get {
{ get
return () => {
{ return () =>
var disp = DefaultDisplay as DisplayBase; {
var val = CurrentSourceInfo != null var disp = DefaultDisplay as DisplayBase;
&& CurrentSourceInfo.Type == eSourceListItemType.Route var val = CurrentSourceInfo != null
&& disp != null && CurrentSourceInfo.Type == eSourceListItemType.Route
&& disp.PowerIsOnFeedback.BoolValue; && disp != null
return val; && disp.PowerIsOnFeedback.BoolValue;
}; return val;
} };
} }
/// <summary> }
/// /// <summary>
/// </summary> ///
protected override Func<bool> IsWarmingFeedbackFunc /// </summary>
{ protected override Func<bool> IsWarmingFeedbackFunc
get {
{ get
return () => {
{ return () =>
var disp = DefaultDisplay as DisplayBase; {
if (disp != null) var disp = DefaultDisplay as DisplayBase;
return disp.IsWarmingUpFeedback.BoolValue; if (disp != null)
else return disp.IsWarmingUpFeedback.BoolValue;
return false; else
}; return false;
} };
} }
/// <summary> }
/// /// <summary>
/// </summary> ///
protected override Func<bool> IsCoolingFeedbackFunc /// </summary>
{ protected override Func<bool> IsCoolingFeedbackFunc
get {
{ get
return () => {
{ return () =>
var disp = DefaultDisplay as DisplayBase; {
if (disp != null) var disp = DefaultDisplay as DisplayBase;
return disp.IsCoolingDownFeedback.BoolValue; if (disp != null)
else return disp.IsCoolingDownFeedback.BoolValue;
return false; else
}; return false;
} };
} }
}
public EssentialsRoomPropertiesConfig Config { get; private set; }
public EssentialsRoomPropertiesConfig Config { get; private set; }
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; } public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
public IBasicVolumeControls DefaultVolumeControls { get; private set; } public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
public bool ExcludeFromGlobalFunctions { get; set; }
public bool ExcludeFromGlobalFunctions { get; set; }
/// <summary>
/// The config name of the source list /// <summary>
/// </summary> /// The config name of the source list
public string SourceListKey { get; set; } /// </summary>
public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; }
public string DefaultSourceItem { get; set; }
public ushort DefaultVolume { get; set; }
public ushort DefaultVolume { get; set; }
/// <summary>
/// If room is off, enables power on to last source. Default true /// <summary>
/// </summary> /// If room is off, enables power on to last source. Default true
public bool EnablePowerOnToLastSource { get; set; } /// </summary>
string LastSourceKey; public bool EnablePowerOnToLastSource { get; set; }
string LastSourceKey;
/// <summary>
/// /// <summary>
/// </summary> ///
public IBasicVolumeControls CurrentVolumeControls /// </summary>
{ public IBasicVolumeControls CurrentVolumeControls
get { return _CurrentAudioDevice; } {
set get { return _CurrentAudioDevice; }
{ set
if (value == _CurrentAudioDevice) return; {
if (value == _CurrentAudioDevice) return;
var oldDev = _CurrentAudioDevice;
// derigister this room from the device, if it can var oldDev = _CurrentAudioDevice;
if (oldDev is IInUseTracking) // derigister this room from the device, if it can
(oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio"); if (oldDev is IInUseTracking)
var handler = CurrentVolumeDeviceChange; (oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
if (handler != null) var handler = CurrentVolumeDeviceChange;
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange)); if (handler != null)
_CurrentAudioDevice = value; CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
if (handler != null) _CurrentAudioDevice = value;
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange)); if (handler != null)
// register this room with new device, if it can CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
if (_CurrentAudioDevice is IInUseTracking) // register this room with new device, if it can
(_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio"); if (_CurrentAudioDevice is IInUseTracking)
} (_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
} }
IBasicVolumeControls _CurrentAudioDevice; }
IBasicVolumeControls _CurrentAudioDevice;
/// <summary>
/// The SourceListItem last run - containing names and icons /// <summary>
/// </summary> /// The SourceListItem last run - containing names and icons
public SourceListItem CurrentSourceInfo /// </summary>
{ public SourceListItem CurrentSourceInfo
get { return _CurrentSourceInfo; } {
private set get { return _CurrentSourceInfo; }
{ private set
if (value == _CurrentSourceInfo) return; {
if (value == _CurrentSourceInfo) return;
var handler = CurrentSingleSourceChange;
// remove from in-use tracker, if so equipped var handler = CurrentSingleSourceChange;
if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking) // remove from in-use tracker, if so equipped
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control"); if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
if (handler != null)
handler(this, _CurrentSourceInfo, ChangeType.WillChange); if (handler != null)
handler(this, _CurrentSourceInfo, ChangeType.WillChange);
_CurrentSourceInfo = value;
_CurrentSourceInfo = value;
// add to in-use tracking
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking) // add to in-use tracking
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control"); if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
if (handler != null) (_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
handler(this, _CurrentSourceInfo, ChangeType.DidChange); if (handler != null)
} handler(this, _CurrentSourceInfo, ChangeType.DidChange);
} }
SourceListItem _CurrentSourceInfo; }
SourceListItem _CurrentSourceInfo;
public string CurrentSourceInfoKey { get; private set; }
public string CurrentSourceInfoKey { get; private set; }
/// <summary>
/// /// <summary>
/// </summary> ///
/// <param name="key"></param> /// </summary>
/// <param name="name"></param> /// <param name="key"></param>
public EssentialsHuddleSpaceRoom(string key, string name, IRoutingSinkWithSwitching defaultDisplay, /// <param name="name"></param>
IRoutingSinkNoSwitching defaultAudio, EssentialsRoomPropertiesConfig config) public EssentialsHuddleSpaceRoom(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
: base(key, name) IRoutingSinkNoSwitching defaultAudio, EssentialsRoomPropertiesConfig config)
{ : base(key, name)
Config = config; {
DefaultDisplay = defaultDisplay; Config = config;
DefaultAudioDevice = defaultAudio; DefaultDisplay = defaultDisplay;
if (defaultAudio is IBasicVolumeControls) DefaultAudioDevice = defaultAudio;
DefaultVolumeControls = defaultAudio as IBasicVolumeControls; if (defaultAudio is IBasicVolumeControls)
else if (defaultAudio is IHasVolumeDevice) DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice; else if (defaultAudio is IHasVolumeDevice)
CurrentVolumeControls = DefaultVolumeControls; DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
CurrentVolumeControls = DefaultVolumeControls;
var disp = DefaultDisplay as DisplayBase;
if (disp != null) var disp = DefaultDisplay as DisplayBase;
{ if (disp != null)
// Link power, warming, cooling to display {
disp.PowerIsOnFeedback.OutputChange += (o, a) => // Link power, warming, cooling to display
{ disp.PowerIsOnFeedback.OutputChange += (o, a) =>
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue) {
{ if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
if (!disp.PowerIsOnFeedback.BoolValue) {
CurrentSourceInfo = null; if (!disp.PowerIsOnFeedback.BoolValue)
OnFeedback.FireUpdate(); CurrentSourceInfo = null;
} OnFeedback.FireUpdate();
}; }
};
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
{ disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
IsWarmingUpFeedback.FireUpdate(); {
if (!IsWarmingUpFeedback.BoolValue) IsWarmingUpFeedback.FireUpdate();
(DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); if (!IsWarmingUpFeedback.BoolValue)
}; (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
disp.IsCoolingDownFeedback.OutputChange += (o, a) => };
{ disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
IsCoolingDownFeedback.FireUpdate(); {
if (IsCoolingDownFeedback.BoolValue) IsCoolingDownFeedback.FireUpdate();
(DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume); if (IsCoolingDownFeedback.BoolValue)
}; (DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
} };
}
SourceListKey = "default";
EnablePowerOnToLastSource = true; SourceListKey = "default";
} EnablePowerOnToLastSource = true;
}
/// <summary>
/// /// <summary>
/// </summary> ///
public override void Shutdown() /// </summary>
{ public override void Shutdown()
RunRouteAction("roomOff"); {
} RunRouteAction("roomOff");
}
/// <summary>
/// Routes the default source item, if any /// <summary>
/// </summary> /// Routes the default source item, if any
public void RunDefaultRoute() /// </summary>
{ public void RunDefaultRoute()
if (DefaultSourceItem != null) {
RunRouteAction(DefaultSourceItem); if (DefaultSourceItem != null)
} RunRouteAction(DefaultSourceItem);
}
/// <summary>
/// /// <summary>
/// </summary> ///
/// <param name="routeKey"></param> /// </summary>
public void RunRouteAction(string routeKey) /// <param name="routeKey"></param>
{ public void RunRouteAction(string routeKey)
RunRouteAction(routeKey, null); {
} RunRouteAction(routeKey, null);
}
/// <summary>
/// Gets a source from config list SourceListKey and dynamically build and executes the /// <summary>
/// route or commands /// Gets a source from config list SourceListKey and dynamically build and executes the
/// </summary> /// route or commands
/// <param name="name"></param> /// </summary>
public void RunRouteAction(string routeKey, Action successCallback) /// <param name="name"></param>
{ public void RunRouteAction(string routeKey, Action successCallback)
// Run this on a separate thread {
new CTimer(o => // Run this on a separate thread
{ new CTimer(o =>
Debug.Console(1, this, "Run route action '{0}'", routeKey); {
var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey); Debug.Console(1, this, "Run route action '{0}'", routeKey);
if(dict == null) var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
{ if(dict == null)
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey); {
return; Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
} return;
}
// Try to get the list item by it's string key
if (!dict.ContainsKey(routeKey)) // Try to get the list item by it's string key
{ if (!dict.ContainsKey(routeKey))
Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'", {
routeKey, SourceListKey); Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
return; routeKey, SourceListKey);
} return;
}
var item = dict[routeKey];
//Debug.Console(2, this, "Action {0} has {1} steps", var item = dict[routeKey];
// item.SourceKey, item.RouteList.Count); //Debug.Console(2, this, "Action {0} has {1} steps",
// item.SourceKey, item.RouteList.Count);
// End usage timer on last source
if (!string.IsNullOrEmpty(LastSourceKey)) // End usage timer on last source
{ if (!string.IsNullOrEmpty(LastSourceKey))
var lastSource = dict[LastSourceKey].SourceDevice; {
var lastSource = dict[LastSourceKey].SourceDevice;
try
{ try
if (lastSource != null && lastSource is IUsageTracking) {
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage(); if (lastSource != null && lastSource is IUsageTracking)
} (lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
catch (Exception e) }
{ catch (Exception e)
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e); {
} Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e);
} }
}
// Let's run it
if (routeKey.ToLower() != "roomoff") // Let's run it
{ if (routeKey.ToLower() != "roomoff")
LastSourceKey = routeKey; {
} LastSourceKey = routeKey;
else }
{ else
CurrentSourceInfoKey = null; {
} CurrentSourceInfoKey = null;
}
foreach (var route in item.RouteList)
{ foreach (var route in item.RouteList)
// if there is a $defaultAll on route, run two separate {
if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase)) // if there is a $defaultAll on route, run two separate
{ if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
// Going to assume a single-path route for now {
var tempVideo = new SourceRouteListItem // Going to assume a single-path route for now
{ var tempVideo = new SourceRouteListItem
DestinationKey = "$defaultDisplay", {
SourceKey = route.SourceKey, DestinationKey = "$defaultDisplay",
Type = eRoutingSignalType.Video SourceKey = route.SourceKey,
}; Type = eRoutingSignalType.Video
DoRoute(tempVideo); };
DoRoute(tempVideo);
//var tempAudio = new SourceRouteListItem
//{ //var tempAudio = new SourceRouteListItem
// DestinationKey = "$defaultAudio", //{
// SourceKey = route.SourceKey, // DestinationKey = "$defaultAudio",
// Type = eRoutingSignalType.Audio // SourceKey = route.SourceKey,
//}; // Type = eRoutingSignalType.Audio
//DoRoute(tempAudio); //};
//continue; -- not sure why this was here //DoRoute(tempAudio);
} //continue; -- not sure why this was here
else }
DoRoute(route); else
} DoRoute(route);
}
// Start usage timer on routed source
if (item.SourceDevice is IUsageTracking) // Start usage timer on routed source
{ if (item.SourceDevice is IUsageTracking)
(item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage(); {
} (item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
}
// Set volume control on room, using default if non provided
IBasicVolumeControls volDev = null; // Set volume control on room, using default if non provided
// Handle special cases for volume control IBasicVolumeControls volDev = null;
if (string.IsNullOrEmpty(item.VolumeControlKey) // Handle special cases for volume control
|| item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase)) if (string.IsNullOrEmpty(item.VolumeControlKey)
volDev = DefaultVolumeControls; || item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase)) volDev = DefaultVolumeControls;
volDev = DefaultDisplay as IBasicVolumeControls; else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
// Or a specific device, probably rarely used. volDev = DefaultDisplay as IBasicVolumeControls;
else // Or a specific device, probably rarely used.
{ else
var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey); {
if (dev is IBasicVolumeControls) var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
volDev = dev as IBasicVolumeControls; if (dev is IBasicVolumeControls)
else if (dev is IHasVolumeDevice) volDev = dev as IBasicVolumeControls;
volDev = (dev as IHasVolumeDevice).VolumeDevice; else if (dev is IHasVolumeDevice)
} volDev = (dev as IHasVolumeDevice).VolumeDevice;
CurrentVolumeControls = volDev; }
CurrentVolumeControls = volDev;
// store the name and UI info for routes
if (item.SourceKey == "$off") // store the name and UI info for routes
{ if (item.SourceKey == "$off")
CurrentSourceInfoKey = routeKey; {
CurrentSourceInfo = null; CurrentSourceInfoKey = routeKey;
} CurrentSourceInfo = null;
else if (item.SourceKey != null) }
{ else if (item.SourceKey != null)
CurrentSourceInfoKey = routeKey; {
CurrentSourceInfo = item; CurrentSourceInfoKey = routeKey;
} CurrentSourceInfo = item;
// And finally, set the "control". This will trigger event }
//CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device; // And finally, set the "control". This will trigger event
//CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device;
OnFeedback.FireUpdate();
OnFeedback.FireUpdate();
// report back when done
if (successCallback != null) // report back when done
successCallback(); if (successCallback != null)
successCallback();
}, 0); // end of CTimer
} }, 0); // end of CTimer
}
/// <summary>
/// Will power the room on with the last-used source /// <summary>
/// </summary> /// Will power the room on with the last-used source
public void PowerOnToDefaultOrLastSource() /// </summary>
{ public void PowerOnToDefaultOrLastSource()
if (!EnablePowerOnToLastSource || LastSourceKey == null) {
return; if (!EnablePowerOnToLastSource || LastSourceKey == null)
RunRouteAction(LastSourceKey); return;
} RunRouteAction(LastSourceKey);
}
/// <summary>
/// /// <summary>
/// </summary> ///
/// <param name="route"></param> /// </summary>
/// <returns></returns> /// <param name="route"></param>
bool DoRoute(SourceRouteListItem route) /// <returns></returns>
{ bool DoRoute(SourceRouteListItem route)
IRoutingSinkNoSwitching dest = null; {
IRoutingSinkNoSwitching dest = null;
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
dest = DefaultAudioDevice; if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase)) dest = DefaultAudioDevice;
dest = DefaultDisplay; else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
else dest = DefaultDisplay;
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching; else
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
if (dest == null)
{ if (dest == null)
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey); {
return false; Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
} return false;
}
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
{ if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
dest.ReleaseRoute(); {
if (dest is IPower) dest.ReleaseRoute();
(dest as IPower).PowerOff(); if (dest is IPower)
} (dest as IPower).PowerOff();
else }
{ else
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs; {
if (source == null) var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
{ if (source == null)
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey); {
return false; Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
} return false;
dest.ReleaseAndMakeRoute(source, route.Type); }
} dest.ReleaseAndMakeRoute(source, route.Type);
return true; }
} return true;
}
/// <summary>
/// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions /// <summary>
/// </summary> /// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
public static void AllRoomsOff() /// </summary>
{ public static void AllRoomsOff()
var allRooms = DeviceManager.AllDevices.Where(d => {
d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions); var allRooms = DeviceManager.AllDevices.Where(d =>
foreach (var room in allRooms) d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff"); foreach (var room in allRooms)
} (room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
} }
}
} }

View File

@@ -0,0 +1,420 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials
{
public class EssentialsHuddleVtc1Room : EssentialsRoomBase, IHasCurrentSourceInfoChange
{
public event EventHandler<VolumeDeviceChangeEventArgs> CurrentVolumeDeviceChange;
public event SourceInfoChangeHandler CurrentSingleSourceChange;
protected override Func<bool> OnFeedbackFunc
{
get
{
return () =>
{
var disp = DefaultDisplay as DisplayBase;
var val = CurrentSourceInfo != null
&& CurrentSourceInfo.Type == eSourceListItemType.Route
&& disp != null
&& disp.PowerIsOnFeedback.BoolValue;
return val;
};
}
}
/// <summary>
///
/// </summary>
protected override Func<bool> IsWarmingFeedbackFunc
{
get
{
return () =>
{
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
return disp.IsWarmingUpFeedback.BoolValue;
else
return false;
};
}
}
/// <summary>
///
/// </summary>
protected override Func<bool> IsCoolingFeedbackFunc
{
get
{
return () =>
{
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
return disp.IsCoolingDownFeedback.BoolValue;
else
return false;
};
}
}
public EssentialsHuddleVtc1PropertiesConfig Config { get; private set; }
public IRoutingSinkWithSwitching DefaultDisplay { get; private set; }
public IRoutingSinkNoSwitching DefaultAudioDevice { get; private set; }
public IBasicVolumeControls DefaultVolumeControls { get; private set; }
public bool ExcludeFromGlobalFunctions { get; set; }
/// <summary>
/// The config name of the source list
/// </summary>
public string SourceListKey { get; set; }
public string DefaultSourceItem { get; set; }
public ushort DefaultVolume { get; set; }
/// <summary>
/// If room is off, enables power on to last source. Default true
/// </summary>
public bool EnablePowerOnToLastSource { get; set; }
string LastSourceKey;
/// <summary>
///
/// </summary>
public IBasicVolumeControls CurrentVolumeControls
{
get { return _CurrentAudioDevice; }
set
{
if (value == _CurrentAudioDevice) return;
var oldDev = _CurrentAudioDevice;
// derigister this room from the device, if it can
if (oldDev is IInUseTracking)
(oldDev as IInUseTracking).InUseTracker.RemoveUser(this, "audio");
var handler = CurrentVolumeDeviceChange;
if (handler != null)
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.WillChange));
_CurrentAudioDevice = value;
if (handler != null)
CurrentVolumeDeviceChange(this, new VolumeDeviceChangeEventArgs(oldDev, value, ChangeType.DidChange));
// register this room with new device, if it can
if (_CurrentAudioDevice is IInUseTracking)
(_CurrentAudioDevice as IInUseTracking).InUseTracker.AddUser(this, "audio");
}
}
IBasicVolumeControls _CurrentAudioDevice;
/// <summary>
/// The SourceListItem last run - containing names and icons
/// </summary>
public SourceListItem CurrentSourceInfo
{
get { return _CurrentSourceInfo; }
private set
{
if (value == _CurrentSourceInfo) return;
var handler = CurrentSingleSourceChange;
// remove from in-use tracker, if so equipped
if(_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.RemoveUser(this, "control");
if (handler != null)
handler(this, _CurrentSourceInfo, ChangeType.WillChange);
_CurrentSourceInfo = value;
// add to in-use tracking
if (_CurrentSourceInfo != null && _CurrentSourceInfo.SourceDevice is IInUseTracking)
(_CurrentSourceInfo.SourceDevice as IInUseTracking).InUseTracker.AddUser(this, "control");
if (handler != null)
handler(this, _CurrentSourceInfo, ChangeType.DidChange);
}
}
SourceListItem _CurrentSourceInfo;
public string CurrentSourceInfoKey { get; private set; }
/// <summary>
///
/// </summary>
/// <param name="key"></param>
/// <param name="name"></param>
public EssentialsHuddleVtc1Room(string key, string name, IRoutingSinkWithSwitching defaultDisplay,
IRoutingSinkNoSwitching defaultAudio, EssentialsHuddleVtc1PropertiesConfig config)
: base(key, name)
{
Config = config;
DefaultDisplay = defaultDisplay;
DefaultAudioDevice = defaultAudio;
if (defaultAudio is IBasicVolumeControls)
DefaultVolumeControls = defaultAudio as IBasicVolumeControls;
else if (defaultAudio is IHasVolumeDevice)
DefaultVolumeControls = (defaultAudio as IHasVolumeDevice).VolumeDevice;
CurrentVolumeControls = DefaultVolumeControls;
var disp = DefaultDisplay as DisplayBase;
if (disp != null)
{
// Link power, warming, cooling to display
disp.PowerIsOnFeedback.OutputChange += (o, a) =>
{
if (disp.PowerIsOnFeedback.BoolValue != OnFeedback.BoolValue)
{
if (!disp.PowerIsOnFeedback.BoolValue)
CurrentSourceInfo = null;
OnFeedback.FireUpdate();
}
};
disp.IsWarmingUpFeedback.OutputChange += (o, a) =>
{
IsWarmingUpFeedback.FireUpdate();
if (!IsWarmingUpFeedback.BoolValue)
(DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
};
disp.IsCoolingDownFeedback.OutputChange += (o, a) =>
{
IsCoolingDownFeedback.FireUpdate();
if (IsCoolingDownFeedback.BoolValue)
(DefaultDisplay as IBasicVolumeWithFeedback).SetVolume(DefaultVolume);
};
}
SourceListKey = "default";
EnablePowerOnToLastSource = true;
}
/// <summary>
///
/// </summary>
public override void Shutdown()
{
RunRouteAction("roomOff");
}
/// <summary>
/// Routes the default source item, if any
/// </summary>
public void RunDefaultRoute()
{
if (DefaultSourceItem != null)
RunRouteAction(DefaultSourceItem);
}
/// <summary>
///
/// </summary>
/// <param name="routeKey"></param>
public void RunRouteAction(string routeKey)
{
RunRouteAction(routeKey, null);
}
/// <summary>
/// Gets a source from config list SourceListKey and dynamically build and executes the
/// route or commands
/// </summary>
/// <param name="name"></param>
public void RunRouteAction(string routeKey, Action successCallback)
{
// Run this on a separate thread
new CTimer(o =>
{
Debug.Console(1, this, "Run route action '{0}'", routeKey);
var dict = ConfigReader.ConfigObject.GetSourceListForKey(SourceListKey);
if(dict == null)
{
Debug.Console(1, this, "WARNING: Config source list '{0}' not found", SourceListKey);
return;
}
// Try to get the list item by it's string key
if (!dict.ContainsKey(routeKey))
{
Debug.Console(1, this, "WARNING: No item '{0}' found on config list '{1}'",
routeKey, SourceListKey);
return;
}
var item = dict[routeKey];
//Debug.Console(2, this, "Action {0} has {1} steps",
// item.SourceKey, item.RouteList.Count);
// End usage timer on last source
if (!string.IsNullOrEmpty(LastSourceKey))
{
var lastSource = dict[LastSourceKey].SourceDevice;
try
{
if (lastSource != null && lastSource is IUsageTracking)
(lastSource as IUsageTracking).UsageTracker.EndDeviceUsage();
}
catch (Exception e)
{
Debug.Console(1, this, "*#* EXCEPTION in end usage tracking (257):\r{0}", e);
}
}
// Let's run it
if (routeKey.ToLower() != "roomoff")
{
LastSourceKey = routeKey;
}
else
{
CurrentSourceInfoKey = null;
}
foreach (var route in item.RouteList)
{
// if there is a $defaultAll on route, run two separate
if (route.DestinationKey.Equals("$defaultAll", StringComparison.OrdinalIgnoreCase))
{
// Going to assume a single-path route for now
var tempVideo = new SourceRouteListItem
{
DestinationKey = "$defaultDisplay",
SourceKey = route.SourceKey,
Type = eRoutingSignalType.Video
};
DoRoute(tempVideo);
//var tempAudio = new SourceRouteListItem
//{
// DestinationKey = "$defaultAudio",
// SourceKey = route.SourceKey,
// Type = eRoutingSignalType.Audio
//};
//DoRoute(tempAudio);
//continue; -- not sure why this was here
}
else
DoRoute(route);
}
// Start usage timer on routed source
if (item.SourceDevice is IUsageTracking)
{
(item.SourceDevice as IUsageTracking).UsageTracker.StartDeviceUsage();
}
// Set volume control on room, using default if non provided
IBasicVolumeControls volDev = null;
// Handle special cases for volume control
if (string.IsNullOrEmpty(item.VolumeControlKey)
|| item.VolumeControlKey.Equals("$defaultAudio", StringComparison.OrdinalIgnoreCase))
volDev = DefaultVolumeControls;
else if (item.VolumeControlKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
volDev = DefaultDisplay as IBasicVolumeControls;
// Or a specific device, probably rarely used.
else
{
var dev = DeviceManager.GetDeviceForKey(item.VolumeControlKey);
if (dev is IBasicVolumeControls)
volDev = dev as IBasicVolumeControls;
else if (dev is IHasVolumeDevice)
volDev = (dev as IHasVolumeDevice).VolumeDevice;
}
CurrentVolumeControls = volDev;
// store the name and UI info for routes
if (item.SourceKey == "$off")
{
CurrentSourceInfoKey = routeKey;
CurrentSourceInfo = null;
}
else if (item.SourceKey != null)
{
CurrentSourceInfoKey = routeKey;
CurrentSourceInfo = item;
}
// And finally, set the "control". This will trigger event
//CurrentControlDevice = DeviceManager.GetDeviceForKey(item.SourceKey) as Device;
OnFeedback.FireUpdate();
// report back when done
if (successCallback != null)
successCallback();
}, 0); // end of CTimer
}
/// <summary>
/// Will power the room on with the last-used source
/// </summary>
public void PowerOnToDefaultOrLastSource()
{
if (!EnablePowerOnToLastSource || LastSourceKey == null)
return;
RunRouteAction(LastSourceKey);
}
/// <summary>
///
/// </summary>
/// <param name="route"></param>
/// <returns></returns>
bool DoRoute(SourceRouteListItem route)
{
IRoutingSinkNoSwitching dest = null;
if (route.DestinationKey.Equals("$defaultaudio", StringComparison.OrdinalIgnoreCase))
dest = DefaultAudioDevice;
else if (route.DestinationKey.Equals("$defaultDisplay", StringComparison.OrdinalIgnoreCase))
dest = DefaultDisplay;
else
dest = DeviceManager.GetDeviceForKey(route.DestinationKey) as IRoutingSinkNoSwitching;
if (dest == null)
{
Debug.Console(1, this, "Cannot route, unknown destination '{0}'", route.DestinationKey);
return false;
}
if (route.SourceKey.Equals("$off", StringComparison.OrdinalIgnoreCase))
{
dest.ReleaseRoute();
if (dest is IPower)
(dest as IPower).PowerOff();
}
else
{
var source = DeviceManager.GetDeviceForKey(route.SourceKey) as IRoutingOutputs;
if (source == null)
{
Debug.Console(1, this, "Cannot route unknown source '{0}' to {1}", route.SourceKey, route.DestinationKey);
return false;
}
dest.ReleaseAndMakeRoute(source, route.Type);
}
return true;
}
/// <summary>
/// Runs "roomOff" action on all rooms not set to ExcludeFromGlobalFunctions
/// </summary>
public static void AllRoomsOff()
{
var allRooms = DeviceManager.AllDevices.Where(d =>
d is EssentialsHuddleSpaceRoom && !(d as EssentialsHuddleSpaceRoom).ExcludeFromGlobalFunctions);
foreach (var room in allRooms)
(room as EssentialsHuddleSpaceRoom).RunRouteAction("roomOff");
}
}
}

View File

@@ -6,6 +6,7 @@ using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Room.Config;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {

View File

@@ -12,7 +12,6 @@
public bool ShowDate { get; set; } public bool ShowDate { get; set; }
public bool ShowTime { get; set; } public bool ShowTime { get; set; }
public UiSetupPropertiesConfig Setup { get; set; } public UiSetupPropertiesConfig Setup { get; set; }
public UiHeaderStyle HeaderStyle { get; set; }
/// <summary> /// <summary>
/// The count of sources that will trigger the "additional" arrows to show on the SRL. /// The count of sources that will trigger the "additional" arrows to show on the SRL.
@@ -23,25 +22,12 @@
public CrestronTouchpanelPropertiesConfig() public CrestronTouchpanelPropertiesConfig()
{ {
SourcesOverflowCount = 5; SourcesOverflowCount = 5;
HeaderStyle = UiHeaderStyle.Habanero;
} }
} }
/// <summary>
///
/// </summary>
public class UiSetupPropertiesConfig public class UiSetupPropertiesConfig
{ {
public bool IsVisible { get; set; } public bool IsVisible { get; set; }
} }
/// <summary>
///
/// </summary>
public enum UiHeaderStyle
{
Habanero,
Verbose
}
} }

View File

@@ -12,6 +12,7 @@
public bool ShowDate { get; set; } public bool ShowDate { get; set; }
public bool ShowTime { get; set; } public bool ShowTime { get; set; }
public UiSetupPropertiesConfig Setup { get; set; } public UiSetupPropertiesConfig Setup { get; set; }
public UiHeaderStyle HeaderStyle { get; set; }
/// <summary> /// <summary>
/// The count of sources that will trigger the "additional" arrows to show on the SRL. /// The count of sources that will trigger the "additional" arrows to show on the SRL.
@@ -22,12 +23,25 @@
public CrestronTouchpanelPropertiesConfig() public CrestronTouchpanelPropertiesConfig()
{ {
SourcesOverflowCount = 5; SourcesOverflowCount = 5;
HeaderStyle = UiHeaderStyle.Habanero;
} }
} }
/// <summary>
///
/// </summary>
public class UiSetupPropertiesConfig public class UiSetupPropertiesConfig
{ {
public bool IsVisible { get; set; } public bool IsVisible { get; set; }
} }
/// <summary>
///
/// </summary>
public enum UiHeaderStyle
{
Habanero = 0,
Verbose
}
} }

View File

@@ -22,6 +22,131 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public const uint VolumeDownPress = 902; public const uint VolumeDownPress = 902;
//******************************************************
// Audio Conference
/// <summary>
/// 1001
/// </summary>
public const uint ACKeypadVisible = 1001;
/// <summary>
/// 1002
/// </summary>
public const uint ACStagingPopoverVisible = 1002;
/// <summary>
/// 1011
/// </summary>
public const uint ACSpeedDial1Press = 1011;
/// <summary>
/// 1012
/// </summary>
public const uint ACSpeedDial2Press = 1012;
/// <summary>
/// 1013
/// </summary>
public const uint ACSpeedDial3Press = 1013;
/// <summary>
/// 1014
/// </summary>
public const uint ACSpeedDial4Press = 1014;
/// <summary>
/// 1021
/// </summary>
public const uint ACSpeedDial1Press = 1021;
/// <summary>
/// 1022
/// </summary>
public const uint ACSpeedDial2Press = 1022;
/// <summary>
/// 1023
/// </summary>
public const uint ACSpeedDial3Press = 1023;
/// <summary>
/// 1024
/// </summary>
public const uint ACSpeedDial4Press = 1024;
//******************************************************
// Video Conference
/// <summary>
/// 1201
/// </summary>
public const uint VCKeypadVisible = 1201;
/// <summary>
/// 1202
/// </summary>
public const uint VCStagingInactivePopoverVisible = 1202;
/// <summary>
///
/// </summary>
public const uint VCStagingActivePopoverVisible = 1203;
/// <summary>
/// 1205
/// </summary>
public const uint VCDirectoryVisible = 1205;
/// <summary>
/// 1211
/// </summary>
public const uint VCSpeedDial1Press = 1211;
/// <summary>
/// 1212
/// </summary>
public const uint VCSpeedDial2Press = 1212;
/// <summary>
/// 1213
/// </summary>
public const uint VCSpeedDial3Press = 1213;
/// <summary>
/// 1214
/// </summary>
public const uint VCSpeedDial4Press = 1214;
/// <summary>
/// 1221
/// </summary>
public const uint VCSpeedDial1Press = 1221;
/// <summary>
/// 1222
/// </summary>
public const uint VCSpeedDial2Press = 1222;
/// <summary>
/// 1223
/// </summary>
public const uint VCSpeedDial3Press = 1223;
/// <summary>
/// 1224
/// </summary>
public const uint VCSpeedDial4Press = 1224;
/// <summary>
/// 1231
/// </summary>
public const uint VCStagingRecentsPress = 1231;
/// <summary>
/// 1232
/// </summary>
public const uint VCStagingDirectoryPress = 1232;
/// <summary>
/// 1233
/// </summary>
public const uint VCStagingKeypadPress = 1233;
/// <summary>
/// 1234
/// </summary>
public const uint VCStagingConnectPress = 1234;
//******************************************************
// Keyboard
/// <summary>
/// 2901
/// </summary>
public const uint KeyboardVisible = 2901;
/// <summary>
/// 2910
/// </summary>
public const uint KeyboardClearPress = 2910;
/// <summary>
/// 2911
/// </summary>
public const uint KeyboardClearVisible = 2911;
/// <summary> /// <summary>
/// 3811 /// 3811
/// </summary> /// </summary>

View File

@@ -0,0 +1,38 @@
namespace PepperDash.Essentials
{
public class UISmartObjectJoin
{
//******************************************************
// Video Conference
/// <summary>
/// 1201
/// </summary>
public const uint VCDialKeypad = 1201;
//******************************************************
// General
/// <summary>
/// 3200 The staging, source-select list
/// </summary>
public const uint SourceStagingSRL = 3200;
/// <summary>
/// 15022 The main activity footer
/// </summary>
public const uint ActivityFooterSRL = 15022;
/// <summary>
/// 15045
/// </summary>
public const uint CallStagingSrl = 15045;
/// <summary>
/// 3002
/// </summary>
public const uint CallQuickDialList = 15046;
/// <summary>
/// 3003
/// </summary>
public const uint DirectorySrl = 15047;
}
}

View File

@@ -13,6 +13,13 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
public class UIStringJoin public class UIStringJoin
{ {
//******************************************************
// Keyboard
/// <summary>
/// 1901
/// </summary>
public const uint KeyboardText = 2901;
/// <summary> /// <summary>
/// 3812 /// 3812
/// </summary> /// </summary>

View File

@@ -48,6 +48,12 @@ namespace PepperDash.Essentials.UIDrivers.EssentialsCiscoSpark
{ {
Codec = codec; Codec = codec;
SetupCallStagingSrl(); SetupCallStagingSrl();
InCall = new BoolFeedback(() => false);
LocalPrivacyIsMuted = new BoolFeedback(() => false);
CallQuickDialList = new SmartObjectDynamicList(triList.SmartObjects[UISmartObjectJoin.CallQuickDialList], true, 1);
DirectorySrl = new SubpageReferenceList(triList, UISmartObjectJoin.DirectorySrl, 3, 3, 3);
} }
/// <summary> /// <summary>

View File

@@ -8,6 +8,7 @@ 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;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
@@ -88,7 +89,6 @@ namespace PepperDash.Essentials
/// </summary> /// </summary>
SubpageReferenceList CallStagingSrl; SubpageReferenceList CallStagingSrl;
/// <summary> /// <summary>
/// Tracks which audio page group the UI is in /// Tracks which audio page group the UI is in
/// </summary> /// </summary>
@@ -150,6 +150,7 @@ namespace PepperDash.Essentials
CallButtonSig = ActivityFooterSrl.BoolInputSig(1, 1); CallButtonSig = ActivityFooterSrl.BoolInputSig(1, 1);
ShareButtonSig = ActivityFooterSrl.BoolInputSig(2, 1); ShareButtonSig = ActivityFooterSrl.BoolInputSig(2, 1);
CallStagingSrl = new SubpageReferenceList(TriList, UISmartObjectJoin.CallStagingSrl, 3, 3, 3);
SetupActivityFooterWhenRoomOff(); SetupActivityFooterWhenRoomOff();
@@ -172,7 +173,7 @@ namespace PepperDash.Essentials
var roomConf = CurrentRoom.Config; var roomConf = CurrentRoom.Config;
if (Config.HeaderStyle == null || Config.HeaderStyle == UiHeaderStyle.Habanero) if (Config.HeaderStyle == UiHeaderStyle.Habanero)
{ {
TriList.SetString(UIStringJoin.CurrentRoomName, CurrentRoom.Name); TriList.SetString(UIStringJoin.CurrentRoomName, CurrentRoom.Name);
TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () => TriList.SetSigFalseAction(UIBoolJoin.RoomHeaderButtonPress, () =>

View File

@@ -1,19 +0,0 @@
namespace PepperDash.Essentials
{
public class UISmartObjectJoin
{
/// <summary>
/// 3200 The staging, source-select list
/// </summary>
public const uint SourceStagingSRL = 3200;
/// <summary>
/// 15022 The main activity footer
/// </summary>
public const uint ActivityFooterSRL = 15022;
/// <summary>
/// 15045
/// </summary>
public const uint CallStagingSrl = 15045;
}
}