Compare commits

..

12 Commits

Author SHA1 Message Date
Andrew Welker
9755724342 Merge pull request #1164 from PepperDash/feature/hdps-dm-event-updates
Feature/hdps dm event updates
2024-02-02 08:53:29 -06:00
Andrew Welker
3190dacdf8 Merge branch 'development' into feature/hdps-dm-event-updates 2024-02-02 08:34:30 -06:00
Andrew Welker
5bb6405874 Merge pull request #1169 from PepperDash/hotfix/latest-dbs
Hotfix/latest dbs
2024-02-02 08:33:23 -06:00
Andrew Welker
fed3d7e13a Merge branch 'development' into hotfix/latest-dbs 2024-01-25 14:44:35 -06:00
jtalborough
b52c13d8e8 fix: Update PepperDashCore package version to 1.3.2 2024-01-25 13:50:44 -05:00
jtalborough
26f9118154 chore: update PepperDashCore package version 2024-01-25 13:15:12 -05:00
Neil Dorin
bba3c347c6 Merge pull request #1166 from PepperDash/feature/add-cen-io-com-x02
feat: add cen-io-com102 and cen-io-com202 support
2023-12-19 14:45:02 -07:00
jkdevito
be96adcc06 feat: add cen-io-com102 and cen-io-com202 support 2023-12-19 10:50:55 -06:00
Jason DeVito
b245016420 fix: updated dminputchange event debug message 2023-12-14 17:02:14 -06:00
Jason DeVito
19f2c6aa79 fix: update dm event handlers, adds debug statements 2023-12-14 16:32:22 -06:00
Jason DeVito
533ca05ac2 feat: adds additional dm input/output event cases to event handlers 2023-12-14 12:43:46 -06:00
Andrew Welker
d6334538c0 Merge pull request #1142 from PepperDash/feature/ir-bridge-map
Add default IR join map using Crestron IR File naming conventions
2023-10-25 20:38:39 -06:00
6 changed files with 180 additions and 95 deletions

1
.gitignore vendored
View File

@@ -390,4 +390,3 @@ MigrationBackup/
FodyWeavers.xsd FodyWeavers.xsd
essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj essentials-framework/Essentials Interfaces/PepperDash_Essentials_Interfaces/PepperDash_Essentials_Interfaces.csproj
.DS_Store .DS_Store
._.DS_Store

View File

@@ -0,0 +1,85 @@
using System.Collections.Generic;
using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.GeneralIO;
using PepperDash.Core;
using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core.CrestronIO
{
/// <summary>
/// Wrapper class for CEN-IO-COM-Xxx expander module
/// </summary>
[Description("Wrapper class for the CEN-IO-COM-102 & CEN-IO-COM-202 expander module")]
public class CenIoComController : CrestronGenericBaseDevice, IComPorts
{
private readonly CenIoCom _cenIoCom;
public CenIoComController(string key, string name, CenIoCom cenIo)
:base(key, name, cenIo)
{
_cenIoCom = cenIo;
}
#region Implementation of IComPorts
public CrestronCollection<ComPort> ComPorts
{
get { return _cenIoCom.ComPorts; }
}
public int NumberOfComPorts
{
get { return _cenIoCom.NumberOfComPorts; }
}
#endregion
}
public class CenIoCom102ControllerFactory : EssentialsDeviceFactory<CenIoComController>
{
private const string CenIoCom102Type = "ceniocom102";
private const string CenIoCom202Type = "ceniocom202";
public CenIoCom102ControllerFactory()
{
TypeNames = new List<string> { CenIoCom102Type, CenIoCom202Type };
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new CEN-IO-COM-Xxx Device");
var control = CommFactory.GetControlPropertiesConfig(dc);
if (control == null)
{
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, control properties not found");
return null;
}
var ipid = control.IpIdInt;
if (ipid < 2)
{
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, invalid IP-ID found");
return null;
}
switch (dc.Type)
{
case CenIoCom102Type:
{
return new CenIoComController(dc.Key, dc.Name, new CenIoCom102(ipid, Global.ControlSystem));
}
case CenIoCom202Type:
{
return new CenIoComController(dc.Key, dc.Name, new CenIoCom202(ipid, Global.ControlSystem));
}
default:
{
Debug.Console(1, "Factory failed to create a new CEN-IO-COM-Xxx Device, invalid type '{0}'", dc.Type);
return null;
}
}
}
}
}

View File

@@ -1,6 +1,5 @@
using System; using System;
using PepperDash.Core; using PepperDash.Core;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{ {
@@ -12,47 +11,14 @@ namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent); void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
void LinkSystemMonitorToAppServer(); void LinkSystemMonitorToAppServer();
} }
/// <summary> /// <summary>
/// Describes a MobileSystemController that accepts IEssentialsRoom /// Describes a MobileSystemController that accepts IEssentialsRoom
/// </summary> /// </summary>
public interface IMobileControl3 : IMobileControl public interface IMobileControl3 : IMobileControl
{ {
void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent); void CreateMobileControlRoomBridge(IEssentialsRoom room, IMobileControl parent);
void SendMessageObject(object o);
void AddAction(string key, object action);
void RemoveAction(string key);
void AddDeviceMessenger(IMobileControlMessenger messenger);
bool CheckForDeviceMessenger(string key);
}
/// <summary>
/// Describes a mobile control messenger
/// </summary>
public interface IMobileControlMessenger : IKeyed
{
IMobileControl3 AppServerController { get; }
string MessagePath { get; }
void RegisterWithAppServer(IMobileControl3 appServerController);
}
public interface IMobileControlResponseMessage
{
[JsonProperty("type")]
string Type { get; }
[JsonProperty("clientId")]
object ClientId { get; }
[JsonProperty("content")]
object Content { get; }
} }
/// <summary> /// <summary>

View File

@@ -185,6 +185,7 @@
</Compile> </Compile>
<Compile Include="Crestron IO\Cards\CenCi33Controller.cs" /> <Compile Include="Crestron IO\Cards\CenCi33Controller.cs" />
<Compile Include="Crestron IO\Cards\InternalCardCageController.cs" /> <Compile Include="Crestron IO\Cards\InternalCardCageController.cs" />
<Compile Include="Crestron IO\CenIoCom\CenIoComController.cs" />
<Compile Include="Crestron IO\DinCenCn\DinCenCnController.cs" /> <Compile Include="Crestron IO\DinCenCn\DinCenCnController.cs" />
<Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" /> <Compile Include="Crestron IO\DinCenCn\IHasCresnetBranches.cs" />
<Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" /> <Compile Include="Crestron IO\DinIo8\DinIo8Controller.cs" />

View File

@@ -88,7 +88,7 @@ namespace PepperDash_Essentials_DM.Chassis
var audioDevice = new HdPsXxxOutputAudioController(Key, item.Number, _chassis); var audioDevice = new HdPsXxxOutputAudioController(Key, item.Number, _chassis);
Debug.Console(2, this, "Adding HdPsXxxOutputAudioController '{0}' for output '{1}'", audioDevice.Key, item.Number); Debug.Console(2, this, "Adding HdPsXxxOutputAudioController '{0}' for output '{1}'", audioDevice.Key, item.Number);
DeviceManager.AddDevice(audioDevice); DeviceManager.AddDevice(audioDevice);
} }
foreach (var item in _chassis.AnalogAuxiliaryMixer) foreach (var item in _chassis.AnalogAuxiliaryMixer)
{ {
var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis); var audioDevice = new HdPsXxxAnalogAuxMixerController(Key, item.MixerNumber, _chassis);
@@ -111,7 +111,7 @@ namespace PepperDash_Essentials_DM.Chassis
Debug.Console(1, this, "Failed to setup inputs, properties are null"); Debug.Console(1, this, "Failed to setup inputs, properties are null");
return; return;
} }
// iterate through HDMI inputs // iterate through HDMI inputs
foreach (var item in _chassis.HdmiInputs) foreach (var item in _chassis.HdmiInputs)
{ {
@@ -124,7 +124,7 @@ namespace PepperDash_Essentials_DM.Chassis
input.Name.StringValue = name; input.Name.StringValue = name;
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture), InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
() => InputNames[index])); () => InputNames[index]));
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this) var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
@@ -134,11 +134,11 @@ namespace PepperDash_Essentials_DM.Chassis
Debug.Console(1, this, "Adding Input port: {0} - {1}", port.Key, name); Debug.Console(1, this, "Adding Input port: {0} - {1}", port.Key, name);
InputPorts.Add(port); InputPorts.Add(port);
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture), InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
() => input.InputPort.HdcpSupportOnFeedback.BoolValue)); () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture), VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
() => input.VideoDetectedFeedback.BoolValue)); () => input.InputPort.SyncDetectedFeedback.BoolValue));
} }
// iterate through DM Lite inputs // iterate through DM Lite inputs
@@ -147,13 +147,13 @@ namespace PepperDash_Essentials_DM.Chassis
var input = item; var input = item;
var index = item.Number; var index = item.Number;
var key = string.Format("dmLiteIn{0}", index); var key = string.Format("dmLiteIn{0}", index);
var name = string.IsNullOrEmpty(InputNames[index]) var name = string.IsNullOrEmpty(InputNames[index])
? string.Format("DM Input {0}", index) ? string.Format("DM Input {0}", index)
: InputNames[index]; : InputNames[index];
input.Name.StringValue = name; input.Name.StringValue = name;
InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture), InputNameFeedbacks.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
() => InputNames[index])); () => InputNames[index]));
var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this) var port = new RoutingInputPort(key, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, input, this)
@@ -163,11 +163,11 @@ namespace PepperDash_Essentials_DM.Chassis
Debug.Console(0, this, "Adding Input port: {0} - {1}", port.Key, name); Debug.Console(0, this, "Adding Input port: {0} - {1}", port.Key, name);
InputPorts.Add(port); InputPorts.Add(port);
InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture), InputHdcpEnableFeedback.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
() => input.InputPort.HdcpSupportOnFeedback.BoolValue)); () => input.InputPort.HdcpSupportOnFeedback.BoolValue));
VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture), VideoInputSyncFeedbacks.Add(new BoolFeedback(index.ToString(CultureInfo.InvariantCulture),
() => input.VideoDetectedFeedback.BoolValue)); () => input.InputPort.SyncDetectedFeedback.BoolValue));
} }
_chassis.DMInputChange += _chassis_InputChange; _chassis.DMInputChange += _chassis_InputChange;
@@ -186,10 +186,10 @@ namespace PepperDash_Essentials_DM.Chassis
{ {
var output = item; var output = item;
var index = item.Number; var index = item.Number;
var name = string.IsNullOrEmpty(OutputNames[index]) var name = string.IsNullOrEmpty(OutputNames[index])
? string.Format("Port {0}", index) ? string.Format("Port {0}", index)
: OutputNames[index]; : OutputNames[index];
output.Name.StringValue = name; output.Name.StringValue = name;
var hdmiKey = string.Format("hdmiOut{0}", index); var hdmiKey = string.Format("hdmiOut{0}", index);
@@ -209,11 +209,11 @@ namespace PepperDash_Essentials_DM.Chassis
}; };
Debug.Console(1, this, "Adding Port port: {0} - {1}", dmLitePort.Key, name); Debug.Console(1, this, "Adding Port port: {0} - {1}", dmLitePort.Key, name);
OutputPorts.Add(dmLitePort); OutputPorts.Add(dmLitePort);
OutputRouteNameFeedback.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
() => output.VideoOutFeedback.NameFeedback.StringValue));
VideoOutputRouteFeedbacks.Add(new IntFeedback(index.ToString(CultureInfo.InvariantCulture), OutputRouteNameFeedback.Add(new StringFeedback(index.ToString(CultureInfo.InvariantCulture),
() => output.VideoOutFeedback.NameFeedback.StringValue));
VideoOutputRouteFeedbacks.Add(new IntFeedback(index.ToString(CultureInfo.InvariantCulture),
() => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number)); () => output.VideoOutFeedback == null ? 0 : (int)output.VideoOutFeedback.Number));
} }
/* /*
@@ -352,8 +352,8 @@ Selector: {4}
public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType) public void ExecuteSwitch(object inputSelector, object outputSelector, eRoutingSignalType signalType)
{ {
var input = inputSelector as HdPsXxxInput; var input = inputSelector as HdPsXxxInput;
var output = outputSelector as HdPsXxxOutput; var output = outputSelector as HdPsXxxOutput;
Debug.Console(2, this, "ExecuteSwitch: input={0}, output={1}", input, output); Debug.Console(2, this, "ExecuteSwitch: input={0}, output={1}", input, output);
if (output == null) if (output == null)
@@ -456,24 +456,37 @@ Selector: {4}
// _chassis input change event // _chassis input change event
private void _chassis_InputChange(Switch device, DMInputEventArgs args) private void _chassis_InputChange(Switch device, DMInputEventArgs args)
{ {
var eventId = args.EventId; switch (args.EventId)
switch (eventId)
{ {
case DMInputEventIds.VideoDetectedEventId: case DMInputEventIds.RemoteTransmitterDetectedEventId:
{
// signal found on HD-PSXxx > Inputs > Inputs DM Lite X
Debug.Console(2, this, "{0} DM Input Event ID {1}-RemoteTransmitterDetected | Number {2}",
device.ToString(), args.EventId, args.Number);
break;
}
case DMInputEventIds.SourceSyncEventId: // id-14
case DMInputEventIds.VideoDetectedEventId: // id-9
{ {
Debug.Console(1, this, "Event ID {0}: Updating VideoInputSyncFeedbacks", eventId); // signal found on HD-PSXxx > Inputs > HDMI/DM Lite X
foreach (var item in VideoInputSyncFeedbacks) Debug.Console(1, this, "{0} DM Input Event ID {1} | Number {2}: Updating VideoInputSyncFeedbacks",
{ device.Name, args.EventId, args.Number);
item.FireUpdate();
} var input = args.Number;
var feedback = VideoInputSyncFeedbacks[(int)input];
if (feedback == null) return;
feedback.FireUpdate();
break; break;
} }
case DMInputEventIds.InputNameFeedbackEventId: case DMInputEventIds.InputNameFeedbackEventId:
case DMInputEventIds.InputNameEventId: case DMInputEventIds.InputNameEventId:
case DMInputEventIds.NameFeedbackEventId: case DMInputEventIds.NameFeedbackEventId:
{ {
Debug.Console(1, this, "Event ID {0}: Updating name feedbacks", eventId); Debug.Console(1, this, "{0} DM Input Event ID {1}-Name | Number {2}: Updating name feedbacks",
device.Name, args.EventId, args.Number);
var input = args.Number; var input = args.Number;
var name = _chassis.HdmiInputs[input].NameFeedback.StringValue; var name = _chassis.HdmiInputs[input].NameFeedback.StringValue;
@@ -483,7 +496,8 @@ Selector: {4}
} }
default: default:
{ {
Debug.Console(1, this, "Uhandled DM Input Event ID {0}", eventId); Debug.Console(1, this, "{0} DM Input Event ID {1} | Number {2}: Uhandled",
device.Name, args.EventId, args.Number);
break; break;
} }
} }
@@ -491,33 +505,53 @@ Selector: {4}
OnDmInputChange(args); OnDmInputChange(args);
} }
// _chassis output change event // _chassis output change event
private void _chassis_OutputChange(Switch device, DMOutputEventArgs args) private void _chassis_OutputChange(Switch device, DMOutputEventArgs args)
{ {
if (args.EventId != DMOutputEventIds.VideoOutEventId) return; switch (args.EventId)
{
case DMOutputEventIds.VideoOutEventId:
{
Debug.Console(2, this, "{0} DM Output Event Id {1} | Number {2} | Index {3}: VideoOutEventId",
device.Name, args.EventId, args.Number, args.Index);
var output = args.Number; var output = args.Number;
var input = _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback == null var input = _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback == null
? 0 ? 0
: _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback.Number; : _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback.Number;
var outputName = OutputNames[output]; var outputName = OutputNames[output];
var feedback = VideoOutputRouteFeedbacks[outputName]; var feedback = VideoOutputRouteFeedbacks[outputName];
if (feedback == null) return; if (feedback == null) return;
var inputPort = InputPorts.FirstOrDefault( var inputPort = InputPorts.FirstOrDefault(
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback); p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output].VideoOutFeedback);
var outputPort = OutputPorts.FirstOrDefault( var outputPort = OutputPorts.FirstOrDefault(
p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output]); p => p.FeedbackMatchObject == _chassis.HdmiDmLiteOutputs[output]);
feedback.FireUpdate(); feedback.FireUpdate();
OnSwitchChange(new RoutingNumericEventArgs( OnSwitchChange(new RoutingNumericEventArgs(output, input, outputPort, inputPort, eRoutingSignalType.AudioVideo));
output, input, outputPort, inputPort, eRoutingSignalType.AudioVideo));
break;
}
case DMOutputEventIds.RemoteReceiverDetectedEventId:
{
// signal found on HD-PSXxx > Output[s] > Output [X] > DM Lite [X]
Debug.Console(2, this, "{0} DM Output Event Id {1} | Number {2} | Index {3}: RemoteRecevierDetectedEventId",
device.Name, args.EventId, args.Number, args.Index);
break;
}
default:
{
Debug.Console(2, this, "{0} DM Output Event Id {1} | Number {2} | Index:{3}: Unhandled",
device.Name, args.EventId, args.Number, args.Index);
break;
}
}
} }
@@ -543,9 +577,9 @@ Selector: {4}
#region Factory #region Factory
public class HdSp401ControllerFactory : EssentialsDeviceFactory<HdPsXxxController> public class HdPsXxxControllerFactory : EssentialsDeviceFactory<HdPsXxxController>
{ {
public HdSp401ControllerFactory() public HdPsXxxControllerFactory()
{ {
TypeNames = new List<string> { "hdps401", "hdps402", "hdps621", "hdps622" }; TypeNames = new List<string> { "hdps401", "hdps402", "hdps621", "hdps622" };
} }

View File

@@ -1,3 +1,3 @@
<packages> <packages>
<package id="PepperDashCore" version="1.3.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/> <package id="PepperDashCore" version="1.3.2" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
</packages> </packages>