Compare commits

...

31 Commits

Author SHA1 Message Date
Neil Dorin
8ae8a3ef41 fix: adds missing JsonProperty decorator 2024-03-14 16:13:02 -06:00
Neil Dorin
0f57799382 feat: Adds TSelector generic type to IHasSurroundSoundModes 2024-03-14 12:26:05 -06:00
Neil Dorin
a2e4c2fad6 feat: Adds ISelectableItems/Item and IHasSurroundSoundModes, modfies IHasInputs, Updates MockDisplay to implement IHasInputs 2024-03-14 11:55:46 -06:00
Neil Dorin
ed5bd360b4 feat: adds more generic ISelectableItems and ISelectableItem interfaces and implements on new IHasInputs and IHasSurroundSoundModes 2024-03-14 10:46:48 -06:00
Andrew Welker
4eeb2145ae chore: update PD Core 2024-03-13 08:34:03 -05:00
Andrew Welker
a5460f16cd feat: add IVideoSync interface & implement on IRoutingInputSlot 2024-03-12 10:51:52 -05:00
Andrew Welker
3b55d6af93 fix: implement DestinationListKey on EssentialsRoomBase 2024-03-08 23:06:26 -06:00
Andrew Welker
285d87d8ac feat: add DestinationListKey to IEssentialsRoom 2024-03-08 22:59:17 -06:00
Andrew Welker
c6690c7765 build: update package names
Updated package names for Core and Devices Common to be valid names and match existing 2.0.0 packages
2024-03-08 21:17:59 -06:00
Andrew Welker
2609006024 feat: implement ILevelControls on DspBase
Also added DspLevelControlPoint class
2024-03-08 21:12:27 -06:00
Andrew Welker
9e61dcd554 refactor: RKST-93 rename interface & properties 2024-03-08 20:41:54 -06:00
Andrew Welker
693d4f8723 feat: RKST-161 add IHasInputs & IInputs interfaces 2024-03-08 20:26:13 -06:00
Andrew Welker
882f41d8bd feat: RKST-160 add IAdvancedVolume interface 2024-03-08 20:11:19 -06:00
Andrew Welker
6669b6125b build: change assembly names to match 1.0.0
This allow 3-series plugins to be loaded correctly
2024-03-08 20:10:44 -06:00
Andrew Welker
9ad151bd7e feat: RKST-131 add IMatrixRouting interfaces 2024-03-08 11:16:48 -06:00
Andrew Welker
b0e9ecf29e build: update PD Core version 2024-03-08 11:16:27 -06:00
Andrew Welker
d4df36b863 feat: add type param for direct route method 2024-03-06 15:39:39 -06:00
Andrew Welker
1146d89abf refactor: Make AddAction generic 2024-02-29 13:40:52 -06:00
Andrew Welker
0ee3e1d52b refactor: modify AddAction method to take the messenger 2024-02-29 13:27:02 -06:00
Andrew Welker
5084861067 feat: add IMobileControlAction interface 2024-02-29 12:36:50 -06:00
Andrew Welker
d6f896c4b2 feat: modify IMobileControl interface 2024-02-28 21:51:03 -06:00
Andrew Welker
7a5dc29946 refactor: remove MC bridge creation 2024-02-20 09:23:32 -06:00
Andrew Welker
812dd0e771 refactor: remove method
Moving all messenger creation to MC EPI.
2024-02-20 09:18:18 -06:00
Andrew Welker
08a4099842 refactor: change ApiOnline to BoolFeedback 2024-02-20 08:27:01 -06:00
Andrew Welker
a3c7d0c96a refactor: add online property for API 2024-02-20 08:13:46 -06:00
Andrew Welker
d7af57ba16 feat: add Properties to IMobileControl3 interface 2024-02-19 17:09:38 -06:00
Andrew Welker
6c2ef7b63b chore: update PepperDash Core version 2024-02-15 16:40:25 -06:00
Andrew Welker
06244b8a18 build: update PepperDash Core 2024-02-14 15:54:42 -06:00
Andrew Welker
b213262cdd refactor: use new method by default 2024-02-14 13:04:36 -06:00
Andrew Welker
e0e08ba22c feat: add methods to add routes to API 2024-02-14 13:02:09 -06:00
Andrew Welker
420ae8c7de refactor: add UpdateAppUrl method to RoomMessenger interface
Also renamed the interface to more accurately represent what it is for
2024-02-08 09:26:29 -06:00
25 changed files with 457 additions and 67 deletions

View File

@@ -0,0 +1,24 @@
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes a device that has selectable inputs
/// </summary>
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>\
/// <example>
/// See MockDisplay for example implemntation
/// </example>
public interface IHasInputs<TKey, TSelector>: IKeyName
{
ISelectableItems<TKey> Inputs { get; }
void SetInput(TSelector selector);
}
}

View File

@@ -0,0 +1,20 @@
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes a device that has selectable surround sound modes
/// </summary>
/// <typeparam name="TKey">the type to use as the key for each input item. Most likely an enum or string</typeparam>
public interface IHasSurroundSoundModes<TKey, TSelector>: IKeyName
{
ISelectableItems<TKey> SurroundSoundModes { get; }
void SetSurroundSoundMode(TSelector selector);
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface ILevelControls
{
Dictionary<string, IBasicVolumeWithFeedback> LevelControlPoints { get; }
}
}

View File

@@ -12,7 +12,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
}
/// <summary>
/*/// <summary>
/// Describes a MobileControlSystemController
/// </summary>
public interface IMobileControl : IKeyed
@@ -20,16 +20,24 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
void LinkSystemMonitorToAppServer();
}
}*/
/// <summary>
/// Describes a MobileSystemController that accepts IEssentialsRoom
/// </summary>
public interface IMobileControl3 : IMobileControl
{
public interface IMobileControl : IKeyed
{
string Host { get; }
string ClientAppUrl { get; }
string SystemUuid { get; }
BoolFeedback ApiOnlineAndAuthorized { get;}
void SendMessageObject(IMobileControlMessage o);
void AddAction(string key, Action<string, JToken> action);
void AddAction<T>(T messenger, Action<string, string, JToken> action) where T:IMobileControlMessenger;
void RemoveAction(string key);
@@ -43,9 +51,11 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
/// </summary>
public interface IMobileControlMessenger: IKeyed
{
IMobileControl3 AppServerController { get; }
IMobileControl AppServerController { get; }
string MessagePath { get; }
void RegisterWithAppServer(IMobileControl3 appServerController);
string DeviceKey { get; }
void RegisterWithAppServer(IMobileControl appServerController);
}
public interface IMobileControlMessage
@@ -64,7 +74,7 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
/// <summary>
/// Describes a MobileControl Room Bridge
/// </summary>
public interface IMobileControlRoomBridge : IKeyed
public interface IMobileControlRoomMessenger : IKeyed
{
event EventHandler<EventArgs> UserCodeChanged;
@@ -85,5 +95,15 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
string RoomName { get; }
string AppUrl { get; }
void UpdateAppUrl(string url);
}
public interface IMobileControlAction
{
IMobileControlMessenger Messenger { get; }
Action<string,string, JToken> Action { get; }
}
}

View File

@@ -0,0 +1,19 @@
using System;
using Newtonsoft.Json;
using PepperDash.Core;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes an item that can be selected
/// </summary>
public interface ISelectableItem : IKeyName
{
event EventHandler ItemUpdated;
[JsonProperty("isSelected")]
bool IsSelected { get; set; }
void Select();
}
}

View File

@@ -0,0 +1,22 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
/// <summary>
/// Describes a collection of items that can be selected
/// </summary>
/// <typeparam name="TKey">type for the keys in the collection. Probably a string or enum</typeparam>
public interface ISelectableItems<TKey>
{
event EventHandler ItemsUpdated;
event EventHandler CurrentItemChanged;
[JsonProperty("items")]
Dictionary<TKey, ISelectableItem> Items { get; set; }
[JsonProperty("currentItem")]
string CurrentItem { get; set; }
}
}

View File

@@ -7,10 +7,10 @@
<TargetFrameworks>net472;net6</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<OutputPath>bin\$(Configuration)\</OutputPath>
<AssemblyName>PepperDash.Essentials.Core</AssemblyName>
<AssemblyName>PepperDash_Essentials_Core</AssemblyName>
<RootNamespace>PepperDash.Essentials.Core</RootNamespace>
<Title>PepperDash Essentials Core</Title>
<PackageId>$(AssemblyName)</PackageId>
<PackageId>PepperDash.Essentials.Core</PackageId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
@@ -23,7 +23,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
</ItemGroup>
<ItemGroup>
<None Include="Crestron\CrestronGenericBaseDevice.cs.orig" />

View File

@@ -357,6 +357,7 @@ namespace PepperDash.Essentials
try
{
types = assy.GetTypes();
Debug.Console(1, $"Got types for assembly {assy.GetName().Name}");
}
catch (TypeLoadException e)
{
@@ -370,6 +371,10 @@ namespace PepperDash.Essentials
{
try
{
Debug.Console(0, $"Checking if type {type.Name} is IPluginDeviceFactory");
Debug.Console(0, $"{type.Name} is plugin factory: {typeof(IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract}");
if (typeof (IPluginDeviceFactory).IsAssignableFrom(type) && !type.IsAbstract)
{
var plugin =

View File

@@ -18,8 +18,6 @@ namespace PepperDash.Essentials.Core
/// </summary>
public abstract class EssentialsRoomBase : ReconfigurableDevice, IEssentialsRoom
{
/// <summary>
///
/// </summary>
@@ -58,7 +56,7 @@ namespace PepperDash.Essentials.Core
/// <summary>
/// The bridge for this room if Mobile Control is enabled
/// </summary>
public IMobileControlRoomBridge MobileControlRoomBridge { get; private set; }
public IMobileControlRoomMessenger MobileControlRoomBridge { get; private set; }
/// <summary>
/// The config name of the source list
@@ -79,6 +77,8 @@ namespace PepperDash.Essentials.Core
}
}
public string DestinationListKey { get; private set; }
protected const string _defaultSourceListKey = "default";
/// <summary>
@@ -194,6 +194,14 @@ namespace PepperDash.Essentials.Core
}
}
protected void SetDestinationListKey(string destinationListKey)
{
if (!string.IsNullOrEmpty(destinationListKey))
{
DestinationListKey = destinationListKey;
}
}
/// <summary>
/// If mobile control is enabled, sets the appropriate properties
/// </summary>
@@ -209,7 +217,7 @@ namespace PepperDash.Essentials.Core
}
else
{
MobileControlRoomBridge = mcBridge as IMobileControlRoomBridge;
MobileControlRoomBridge = mcBridge as IMobileControlRoomMessenger;
Debug.Console(1, this, "*********************Mobile Control Bridge found and enabled for this room");
IsMobileControlEnabled = true;
}

View File

@@ -23,10 +23,12 @@ namespace PepperDash.Essentials.Core
BoolFeedback IsCoolingDownFeedback { get; }
bool IsMobileControlEnabled { get; }
IMobileControlRoomBridge MobileControlRoomBridge { get; }
IMobileControlRoomMessenger MobileControlRoomBridge { get; }
string SourceListKey { get; }
string DestinationListKey { get; }
SecondsCountdownTimer ShutdownPromptTimer { get; }
int ShutdownPromptSeconds { get; }
int ShutdownVacancySeconds { get; }

View File

@@ -48,7 +48,7 @@ namespace PepperDash.Essentials.Core
/// </summary>
public interface IRunDirectRouteAction
{
void RunDirectRoute(string sourceKey, string destinationKey);
void RunDirectRoute(string sourceKey, string destinationKey, eRoutingSignalType type = eRoutingSignalType.AudioVideo);
}
/// <summary>

View File

@@ -0,0 +1,16 @@
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.Routing
{
public interface IVideoSync: IKeyed
{
bool VideoSyncDetected { get; }
event EventHandler VideoSyncChanged;
}
}

View File

@@ -0,0 +1,12 @@
using System.Collections.Generic;
namespace PepperDash.Essentials.Core.Routing
{
public interface IMatrixRouting
{
Dictionary<string, IRoutingInputSlot> InputSlots { get; }
Dictionary<string, IRoutingOutputSlot> OutputSlots { get; }
void Route(string inputSlotKey, string outputSlotKey, eRoutingSignalType type);
}
}

View File

@@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.Routing
{
public interface IRoutingInputSlot: IRoutingSlot, IOnline, IVideoSync
{
string TxDeviceKey { get; }
}
}

View File

@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
namespace PepperDash.Essentials.Core.Routing
{
public interface IRoutingOutputSlot:IRoutingSlot
{
event EventHandler<EventArgs> OutputSlotChanged;
string RxDeviceKey { get; }
Dictionary<eRoutingSignalType, IRoutingInputSlot> CurrentRoutes { get; }
}
}

View File

@@ -0,0 +1,16 @@
using PepperDash.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Core.Routing
{
public interface IRoutingSlot:IKeyName
{
int SlotNumber { get; }
eRoutingSignalType SupportedSignalTypes { get; }
}
}

View File

@@ -36,7 +36,8 @@ namespace PepperDash.Essentials.Core
Video = 2,
AudioVideo = Audio | Video,
UsbOutput = 8,
UsbInput = 16
UsbInput = 16,
SecondaryAudio = 32
}
public enum eRoutingPortConnectionType

View File

@@ -11,7 +11,7 @@ namespace PepperDash.Essentials.Core.Web
{
public class EssentialsWebApi : EssentialsDevice
{
private readonly WebApiServer _server;
private readonly WebApiServer _server;
///<example>
/// http(s)://{ipaddress}/cws/{basePath}
@@ -67,8 +67,6 @@ namespace PepperDash.Essentials.Core.Web
_server = new WebApiServer(Key, Name, BasePath);
SetupRoutes();
Initialize();
}
private void SetupRoutes()
@@ -168,10 +166,27 @@ namespace PepperDash.Essentials.Core.Web
};
foreach (var route in routes.Where(route => route != null))
AddRoute(routes);
}
/// <summary>
/// Add a single route to the API. MUST be done during the activation phase
/// </summary>
/// <param name="route"></param>
public void AddRoute(HttpCwsRoute route)
{
_server.AddRoute(route);
}
/// <summary>
/// Add a collection of routes to the API. MUST be done during the activation phase
/// </summary>
/// <param name="routes"></param>
public void AddRoute(List<HttpCwsRoute> routes)
{
foreach (var route in routes)
{
var r = route;
_server.AddRoute(r);
AddRoute(route);
}
}

View File

@@ -6,12 +6,13 @@ using Crestron.SimplSharp;
using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common.DSP
{
public abstract class DspBase : EssentialsDevice
public abstract class DspBase : EssentialsDevice, ILevelControls
{
public Dictionary<string, DspControlPoint> LevelControlPoints { get; private set; }
public Dictionary<string,IBasicVolumeWithFeedback> LevelControlPoints { get; private set; }
public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
@@ -40,15 +41,36 @@ namespace PepperDash.Essentials.Devices.Common.DSP
// Typical presets:
// call default preset to restore levels and mutes
public abstract class DspControlPoint
public abstract class DspControlPoint :IKeyed
{
string Key { get; set; }
public string Key { get; }
protected DspControlPoint(string key) => Key = key;
}
public abstract class DspLevelControlPoint :DspControlPoint, IBasicVolumeWithFeedback
{
public BoolFeedback MuteFeedback { get; }
public IntFeedback VolumeLevelFeedback { get; }
public class DspDialerBase
protected DspLevelControlPoint(string key, Func<bool> muteFeedbackFunc, Func<int> volumeLevelFeedbackFunc) : base(key)
{
MuteFeedback = new BoolFeedback(muteFeedbackFunc);
VolumeLevelFeedback = new IntFeedback(volumeLevelFeedbackFunc);
}
public abstract void MuteOff();
public abstract void MuteOn();
public abstract void MuteToggle();
public abstract void SetVolume(ushort level);
public abstract void VolumeDown(bool pressRelease);
public abstract void VolumeUp(bool pressRelease);
}
public abstract class DspDialerBase:DspControlPoint
{
protected DspDialerBase(string key) : base(key) { }
}

View File

@@ -8,10 +8,16 @@ using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using Feedback = PepperDash.Essentials.Core.Feedback;
using Newtonsoft.Json;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common.Displays
{
public abstract class DisplayBase : EssentialsDevice, IHasFeedback, IRoutingSinkWithSwitching, IHasPowerControl, IWarmingCooling, IUsageTracking
public abstract class DisplayBase : EssentialsDevice
, IHasFeedback
, IRoutingSinkWithSwitching
, IHasPowerControl
, IWarmingCooling
, IUsageTracking
{
public event SourceInfoChangeHandler CurrentSourceChange;

View File

@@ -1,21 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Routing;
namespace PepperDash.Essentials.Devices.Common.Displays
{
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced
public class MockDisplay : TwoWayDisplayBase, IBasicVolumeWithFeedback, IBridgeAdvanced, IHasInputs<string, string>
{
public RoutingInputPort HdmiIn1 { get; private set; }
public RoutingInputPort HdmiIn2 { get; private set; }
public RoutingInputPort HdmiIn3 { get; private set; }
public RoutingInputPort ComponentIn1 { get; private set; }
public RoutingInputPort VgaIn1 { get; private set; }
public ISelectableItems<string> Inputs { get; private set; }
bool _PowerIsOn;
bool _IsWarmingUp;
@@ -53,7 +51,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
};
}
}
protected override Func<string> CurrentInputFeedbackFunc { get { return () => "Not Implemented"; } }
protected override Func<string> CurrentInputFeedbackFunc { get { return () => Inputs.CurrentItem; } }
int VolumeHeldRepeatInterval = 200;
ushort VolumeInterval = 655;
@@ -63,17 +61,31 @@ namespace PepperDash.Essentials.Devices.Common.Displays
public MockDisplay(string key, string name)
: base(key, name)
{
HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
HdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.Audio | eRoutingSignalType.Video,
eRoutingPortConnectionType.Hdmi, null, this);
ComponentIn1 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.Video,
eRoutingPortConnectionType.Component, null, this);
VgaIn1 = new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
eRoutingPortConnectionType.Composite, null, this);
InputPorts.AddRange(new[] { HdmiIn1, HdmiIn2, HdmiIn3, ComponentIn1, VgaIn1 });
Inputs = new MockDisplayInputs
{
Items = new Dictionary<string, ISelectableItem>
{
{ "HDMI1", new MockDisplayInput ( "HDMI1", "HDMI 1",this ) },
{ "HDMI2", new MockDisplayInput ("HDMI2", "HDMI 2",this ) },
{ "HDMI3", new MockDisplayInput ("HDMI3", "HDMI 3",this ) },
{ "HDMI4", new MockDisplayInput ("HDMI4", "HDMI 4",this )},
{ "DP", new MockDisplayInput ("DP", "DisplayPort", this ) }
}
};
Inputs.CurrentItemChanged += (o, a) => CurrentInputFeedback.FireUpdate();
var hdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, "HDMI1", this);
var hdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, "HDMI2", this);
var hdmiIn3 = new RoutingInputPort(RoutingPortNames.HdmiIn3, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, "HDMI3", this);
var hdmiIn4 = new RoutingInputPort(RoutingPortNames.ComponentIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.Hdmi, "HDMI4", this);
var dpIn = new RoutingInputPort(RoutingPortNames.DisplayPortIn, eRoutingSignalType.AudioVideo,
eRoutingPortConnectionType.DisplayPort, "DP", this);
InputPorts.AddRange(new[] { hdmiIn1, hdmiIn2, hdmiIn3, hdmiIn4, dpIn });
VolumeLevelFeedback = new IntFeedback(() => { return _FakeVolumeLevel; });
MuteFeedback = new BoolFeedback("MuteOn", () => _IsMuted);
@@ -135,13 +147,43 @@ namespace PepperDash.Essentials.Devices.Common.Displays
{
PowerOn();
}
if (!Inputs.Items.TryGetValue(selector.ToString(), out var input))
return;
input.Select();
}
public void SetInput(string selector)
{
ISelectableItem currentInput = null;
try
{
currentInput = Inputs.Items.SingleOrDefault(Inputs => Inputs.Value.IsSelected).Value;
}
catch { }
if (currentInput != null)
{
Debug.Console(2, this, "SetInput: {0}", selector);
currentInput.IsSelected = false;
}
if (!Inputs.Items.TryGetValue(selector, out var input))
return;
input.IsSelected = true;
Inputs.CurrentItem = selector;
}
#region IBasicVolumeWithFeedback Members
public IntFeedback VolumeLevelFeedback { get; private set; }
#region IBasicVolumeWithFeedback Members
public IntFeedback VolumeLevelFeedback { get; private set; }
public void SetVolume(ushort level)
{
@@ -163,11 +205,12 @@ namespace PepperDash.Essentials.Devices.Common.Displays
public BoolFeedback MuteFeedback { get; private set; }
#endregion
#region IBasicVolumeControls Members
#endregion
public void VolumeUp(bool pressRelease)
#region IBasicVolumeControls Members
public void VolumeUp(bool pressRelease)
{
//while (pressRelease)
//{
@@ -207,5 +250,7 @@ namespace PepperDash.Essentials.Devices.Common.Displays
{
LinkDisplayToApi(this, trilist, joinStart, joinMapKey, bridge);
}
}
}
}

View File

@@ -0,0 +1,97 @@
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PepperDash.Essentials.Devices.Common.Displays
{
public class MockDisplayInputs : ISelectableItems<string>
{
private Dictionary<string, ISelectableItem> _items;
public Dictionary<string, ISelectableItem> Items
{
get
{
return _items;
}
set
{
if (_items == value)
return;
_items = value;
ItemsUpdated?.Invoke(this, null);
}
}
private string _currentItem;
public string CurrentItem
{
get
{
return _currentItem;
}
set
{
if (_currentItem == value)
return;
_currentItem = value;
CurrentItemChanged?.Invoke(this, null);
}
}
public event EventHandler ItemsUpdated;
public event EventHandler CurrentItemChanged;
}
public class MockDisplayInput : ISelectableItem
{
private IHasInputs<string, string> _parent;
private bool _isSelected;
public bool IsSelected
{
get
{
return _isSelected;
}
set
{
if (_isSelected == value)
return;
_isSelected = value;
ItemUpdated?.Invoke(this, null);
}
}
public string Name { get; set; }
public string Key { get; set; }
public event EventHandler ItemUpdated;
public MockDisplayInput(string key, string name, MockDisplay parent)
{
Key = key;
Name = name;
_parent = parent;
}
public void Select()
{
_parent.SetInput(Key);
}
}
}

View File

@@ -7,11 +7,11 @@
<TargetFrameworks>net472;net6</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<OutputPath>bin\$(Configuration)\</OutputPath>
<AssemblyName>PepperDash.Essentials.Devices.Common</AssemblyName>
<AssemblyName>Essentials Devices Common</AssemblyName>
<RootNamespace>PepperDash.Essentials.Devices.Common</RootNamespace>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Title>PepperDash Essentials Devices Common</Title>
<PackageId>$(AssemblyName)</PackageId>
<PackageId>PepperDash.Essentials.Devices.Common</PackageId>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
@@ -27,6 +27,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.ProgramLibrary" Version="2.20.42" />
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
</ItemGroup>
</Project>

View File

@@ -35,7 +35,7 @@ namespace PepperDash.Essentials
SecretsManager.Initialize();
SystemMonitor.ProgramInitialization.ProgramInitializationUnderUserControl = true;
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;
// AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainOnAssemblyResolve;
}
private System.Reflection.Assembly CurrentDomainOnAssemblyResolve(object sender, ResolveEventArgs args)
@@ -366,11 +366,11 @@ namespace PepperDash.Essentials
LoadTieLines();
var mobileControl = GetMobileControlDevice();
/*var mobileControl = GetMobileControlDevice();
if (mobileControl == null) return;
mobileControl.LinkSystemMonitorToAppServer();
mobileControl.LinkSystemMonitorToAppServer();*/
}
@@ -480,14 +480,14 @@ namespace PepperDash.Essentials
continue;
}
BuildMC(room as IEssentialsRoom);
// BuildMC(room as IEssentialsRoom);
}
Debug.Console(0, Debug.ErrorLogLevel.Notice, "All Rooms Loaded.");
}
private static void BuildMC(IEssentialsRoom room)
/*private static void BuildMC(IEssentialsRoom room)
{
Debug.Console(0, Debug.ErrorLogLevel.Notice, $"Attempting to build Mobile Control Bridge for {room?.Key}");
@@ -528,7 +528,7 @@ namespace PepperDash.Essentials
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Mobile Control not enabled for this system");
return null;
}
}*/
/// <summary>
/// Fires up a logo server if not already running

View File

@@ -5,7 +5,7 @@
</PropertyGroup>
<PropertyGroup>
<RootNamespace>PepperDash.Essentials</RootNamespace>
<AssemblyName>PepperDash.Essentials</AssemblyName>
<AssemblyName>PepperDashEssentials</AssemblyName>
<TargetFrameworks>net472;net6</TargetFrameworks>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<OutputPath>bin\$(Configuration)\</OutputPath>
@@ -47,7 +47,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Crestron.SimplSharp.SDK.Program" Version="2.20.42" />
<PackageReference Include="PepperDashCore" Version="2.0.0-beta-385" />
<PackageReference Include="PepperDashCore" Version="2.0.0-alpha-392" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\PepperDash.Essentials.Core\PepperDash.Essentials.Core.csproj" />