mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
ecs-482 address; ecs-415 shutdown on contact; ecs-484 displays on tech
This commit is contained in:
@@ -0,0 +1,16 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Devices.Displays
|
||||||
|
{
|
||||||
|
public interface IInputHdmi1 { void InputHdmi1(); }
|
||||||
|
public interface IInputHdmi2 { void InputHdmi2(); }
|
||||||
|
public interface IInputHdmi3 { void InputHdmi3(); }
|
||||||
|
public interface IInputHdmi4 { void InputHdmi4(); }
|
||||||
|
public interface IInputDisplayPort1 { void InputDisplayPort1(); }
|
||||||
|
public interface IInputDisplayPort2 { void InputDisplayPort2(); }
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,8 @@ namespace PepperDash.Essentials.Devices.Displays
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor
|
public class SamsungMDC : TwoWayDisplayBase, IBasicVolumeWithFeedback, ICommunicationMonitor, IInputDisplayPort1, IInputDisplayPort2,
|
||||||
|
IInputHdmi1, IInputHdmi2, IInputHdmi3, IInputHdmi4
|
||||||
{
|
{
|
||||||
public IBasicCommunication Communication { get; private set; }
|
public IBasicCommunication Communication { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,7 @@
|
|||||||
<Compile Include="Codec\iHasDirectory.cs" />
|
<Compile Include="Codec\iHasDirectory.cs" />
|
||||||
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
|
<Compile Include="Crestron\Gateways\CenRfgwController.cs" />
|
||||||
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
<Compile Include="Display\ComTcpDisplayBase.cs" />
|
||||||
|
<Compile Include="Display\InputInterfaces.cs" />
|
||||||
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
<Compile Include="Display\SamsungMDCDisplay.cs" />
|
||||||
<Compile Include="Display\DeviceFactory.cs" />
|
<Compile Include="Display\DeviceFactory.cs" />
|
||||||
<Compile Include="Display\NecPaSeriesProjector.cs" />
|
<Compile Include="Display\NecPaSeriesProjector.cs" />
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsPresentationPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleRoomPropertiesConfig.cs" />
|
||||||
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
<Compile Include="Room\Config\EssentialsHuddleVtc1PropertiesConfig.cs" />
|
||||||
|
<Compile Include="Room\Config\EssentialsRoomEmergencyConfig.cs" />
|
||||||
<Compile Include="Room\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" />
|
||||||
@@ -154,6 +155,7 @@
|
|||||||
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" />
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\IPowerExtensions.cs" />
|
||||||
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" />
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ISetTopBoxControlsExtensions.cs" />
|
||||||
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" />
|
<Compile Include="Room\Cotija\DeviceTypeInterfaces\ITransportExtensions.cs" />
|
||||||
|
<Compile Include="Room\Emergency\EsentialsRoomEmergencyContactClosure.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
<Compile Include="Room\Types\EssentialsHuddleVtc1Room.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
|
<Compile Include="Room\Types\EssentialsPresentationRoom.cs" />
|
||||||
<Compile Include="Room\Types\EssentialsRoomBase.cs" />
|
<Compile Include="Room\Types\EssentialsRoomBase.cs" />
|
||||||
|
|||||||
@@ -69,11 +69,30 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
rm.DefaultSourceItem = props.DefaultSourceItem;
|
rm.DefaultSourceItem = props.DefaultSourceItem;
|
||||||
rm.DefaultVolume = (ushort)(props.Volumes.Master.Level * 65535 / 100);
|
rm.DefaultVolume = (ushort)(props.Volumes.Master.Level * 65535 / 100);
|
||||||
|
|
||||||
|
rm.Emergency = GetEmergency(props, rm); // Get emergency object, if any
|
||||||
|
|
||||||
return rm;
|
return rm;
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets and operating, standalone emergegncy object that can be plugged into a room.
|
||||||
|
/// Returns null if there is no emergency defined
|
||||||
|
/// </summary>
|
||||||
|
EssentialsRoomEmergencyBase GetEmergency(EssentialsRoomPropertiesConfig props, EssentialsRoomBase room)
|
||||||
|
{
|
||||||
|
// This emergency
|
||||||
|
var emergency = props.Emergency;
|
||||||
|
if (emergency != null)
|
||||||
|
{
|
||||||
|
//switch on emergency type here. Right now only contact and shutdown
|
||||||
|
var e = new EssentialsRoomEmergencyContactClosure(room.Key + "-emergency", props.Emergency, room);
|
||||||
|
DeviceManager.AddDevice(e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -81,6 +100,7 @@ namespace PepperDash.Essentials.Room.Config
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class EssentialsRoomPropertiesConfig
|
public class EssentialsRoomPropertiesConfig
|
||||||
{
|
{
|
||||||
|
public EssentialsRoomEmergencyConfig Emergency { get; set; }
|
||||||
public string HelpMessage { get; set; }
|
public string HelpMessage { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public int ShutdownVacancySeconds { get; set; }
|
public int ShutdownVacancySeconds { get; set; }
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room.Config
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsRoomEmergencyConfig
|
||||||
|
{
|
||||||
|
public EssentialsRoomEmergencyTriggerConfig Trigger { get; set; }
|
||||||
|
|
||||||
|
public string Behavior { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public class EssentialsRoomEmergencyTriggerConfig
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// contact,
|
||||||
|
/// </summary>
|
||||||
|
public string Type { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// Input number if contact
|
||||||
|
/// </summary>
|
||||||
|
public int Number { get; set; }
|
||||||
|
|
||||||
|
public bool TriggerOnClose { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using Crestron.SimplSharp;
|
||||||
|
using Crestron.SimplSharpPro;
|
||||||
|
using Crestron.SimplSharpPro.DeviceSupport;
|
||||||
|
|
||||||
|
using PepperDash.Core;
|
||||||
|
using PepperDash.Essentials.Core;
|
||||||
|
using PepperDash.Essentials.Room.Config;
|
||||||
|
|
||||||
|
namespace PepperDash.Essentials.Room
|
||||||
|
{
|
||||||
|
public abstract class EssentialsRoomEmergencyBase : IKeyed
|
||||||
|
{
|
||||||
|
public string Key { get; private set; }
|
||||||
|
|
||||||
|
public EssentialsRoomEmergencyBase(string key)
|
||||||
|
{
|
||||||
|
Key = key;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class EssentialsRoomEmergencyContactClosure : EssentialsRoomEmergencyBase
|
||||||
|
{
|
||||||
|
EssentialsRoomBase Room;
|
||||||
|
string Behavior;
|
||||||
|
bool TriggerOnClose;
|
||||||
|
|
||||||
|
public EssentialsRoomEmergencyContactClosure(string key, EssentialsRoomEmergencyConfig config, EssentialsRoomBase room) :
|
||||||
|
base(key)
|
||||||
|
{
|
||||||
|
Room = room;
|
||||||
|
var cs = Global.ControlSystem;
|
||||||
|
|
||||||
|
if (config.Trigger.Type.Equals("contact", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
if (config.Trigger.Number <= cs.NumberOfDigitalInputPorts)
|
||||||
|
cs.DigitalInputPorts[(uint)config.Trigger.Number].StateChange += new DigitalInputEventHandler(EsentialsRoomEmergencyContactClosure_StateChange);
|
||||||
|
}
|
||||||
|
Behavior = config.Behavior;
|
||||||
|
TriggerOnClose = config.Trigger.TriggerOnClose;
|
||||||
|
}
|
||||||
|
|
||||||
|
void EsentialsRoomEmergencyContactClosure_StateChange(DigitalInput digitalInput, DigitalInputEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.State && TriggerOnClose || !args.State && !TriggerOnClose)
|
||||||
|
RunEmergencyBehavior();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public void RunEmergencyBehavior()
|
||||||
|
{
|
||||||
|
if (Behavior.Equals("shutdown"))
|
||||||
|
Room.Shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -45,6 +45,8 @@ namespace PepperDash.Essentials
|
|||||||
public int ShutdownVacancySeconds { get; set; }
|
public int ShutdownVacancySeconds { get; set; }
|
||||||
public ShutdownType ShutdownType { get; private set; }
|
public ShutdownType ShutdownType { get; private set; }
|
||||||
|
|
||||||
|
public PepperDash.Essentials.Room.EssentialsRoomEmergencyBase Emergency { get; set; }
|
||||||
|
|
||||||
public string LogoUrl { get; set; }
|
public string LogoUrl { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -41,6 +41,10 @@
|
|||||||
/// 3903
|
/// 3903
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public const uint TechPinDialogKeypad = 3903;
|
public const uint TechPinDialogKeypad = 3903;
|
||||||
|
/// <summary>
|
||||||
|
/// 3904 - Display controls on the tech page
|
||||||
|
/// </summary>
|
||||||
|
public const uint TechDisplayControlsList = 3904;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -11,6 +11,7 @@ using PepperDash.Essentials;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.SmartObjects;
|
using PepperDash.Essentials.Core.SmartObjects;
|
||||||
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
using PepperDash.Essentials.Core.Touchpanels.Keyboards;
|
||||||
|
using PepperDash.Essentials.Devices.Displays;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.UIDrivers
|
namespace PepperDash.Essentials.UIDrivers
|
||||||
{
|
{
|
||||||
@@ -25,6 +26,10 @@ namespace PepperDash.Essentials.UIDrivers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
SubpageReferenceList StatusList;
|
SubpageReferenceList StatusList;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// The list of display controls
|
||||||
|
/// </summary>
|
||||||
|
SubpageReferenceList DisplayList;
|
||||||
|
/// <summary>
|
||||||
/// References lines in the list against device instances
|
/// References lines in the list against device instances
|
||||||
/// </summary>
|
/// </summary>
|
||||||
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
Dictionary<ICommunicationMonitor, uint> StatusListDeviceIndexes;
|
||||||
@@ -96,6 +101,8 @@ namespace PepperDash.Essentials.UIDrivers
|
|||||||
|
|
||||||
BuildStatusList();
|
BuildStatusList();
|
||||||
|
|
||||||
|
BuildDisplayList();
|
||||||
|
|
||||||
SetupPinModal();
|
SetupPinModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +246,47 @@ namespace PepperDash.Essentials.UIDrivers
|
|||||||
StatusList.Count = (ushort)i;
|
StatusList.Count = (ushort)i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Builds the list of display controls
|
||||||
|
/// </summary>
|
||||||
|
void BuildDisplayList()
|
||||||
|
{
|
||||||
|
DisplayList = new SubpageReferenceList(TriList, UISmartObjectJoin.TechDisplayControlsList, 10, 3, 3);
|
||||||
|
|
||||||
|
var devKeys = ConfigReader.ConfigObject.Devices.Where(d =>
|
||||||
|
d.Group.Equals("display", StringComparison.OrdinalIgnoreCase)
|
||||||
|
|| d.Group.Equals("projector", StringComparison.OrdinalIgnoreCase))
|
||||||
|
.Select(dd => dd.Key);
|
||||||
|
Debug.Console(1, "#################### Config has {0} displays", devKeys.Count());
|
||||||
|
var disps = DeviceManager.AllDevices.Where(d =>
|
||||||
|
devKeys.Contains(d.Key));
|
||||||
|
Debug.Console(1, "#################### Devices has {0} displays", disps.Count());
|
||||||
|
ushort i = 0;
|
||||||
|
foreach (var disp in disps)
|
||||||
|
{
|
||||||
|
var display = disp as DisplayBase;
|
||||||
|
if (display != null)
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
DisplayList.StringInputSig(i, 1).StringValue = display.Name;
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 1).SetSigFalseAction(display.PowerOn);
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 2).SetSigFalseAction(display.PowerOff);
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 3).SetSigFalseAction(() =>
|
||||||
|
{ if (display is IInputHdmi1) (display as IInputHdmi1).InputHdmi1(); });
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 4).SetSigFalseAction(() =>
|
||||||
|
{ if (display is IInputHdmi2) (display as IInputHdmi2).InputHdmi2(); });
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 5).SetSigFalseAction(() =>
|
||||||
|
{ if (display is IInputHdmi3) (display as IInputHdmi3).InputHdmi3(); });
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 6).SetSigFalseAction(() =>
|
||||||
|
{ if (display is IInputHdmi4) (display as IInputHdmi4).InputHdmi4(); });
|
||||||
|
DisplayList.GetBoolFeedbackSig(i, 7).SetSigFalseAction(() =>
|
||||||
|
{ if (display is IInputDisplayPort1) (display as IInputDisplayPort1).InputDisplayPort1(); });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DisplayList.Count = i;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@@ -17,3 +17,5 @@ devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingAudioCall", "params
|
|||||||
devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingVideoCall", "params": ["444-444-4444"]}
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"TestIncomingVideoCall", "params": ["444-444-4444"]}
|
||||||
|
|
||||||
devjson:1 {"deviceKey":"mockVc-1", "methodName":"ListCalls"}
|
devjson:1 {"deviceKey":"mockVc-1", "methodName":"ListCalls"}
|
||||||
|
|
||||||
|
devjson:1 {"deviceKey":"room1-emergency", "methodName":"RunEmergencyBehavior"}
|
||||||
Reference in New Issue
Block a user