mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-02-16 13:15:03 +00:00
Compare commits
27 Commits
1.14.2-hot
...
hotfix/dmp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e8749b9da | ||
|
|
4bdac8d9e9 | ||
|
|
2afa9df705 | ||
|
|
316d545bda | ||
|
|
13df52ab49 | ||
|
|
527457baf5 | ||
|
|
d74c5de651 | ||
|
|
b06d0c0deb | ||
|
|
759fb1d729 | ||
|
|
68cbbee6a3 | ||
|
|
93134cae5c | ||
|
|
555915b151 | ||
|
|
fa0f006b9b | ||
|
|
4c0fb6311b | ||
|
|
0dcf45fc84 | ||
|
|
4d2ce83e75 | ||
|
|
da4070bad0 | ||
|
|
daf3f321bd | ||
|
|
9c9b2952aa | ||
|
|
a7a4b75382 | ||
|
|
77f5dafdfe | ||
|
|
b5bf87c634 | ||
|
|
0cfcf61d6b | ||
|
|
2ffe24fd93 | ||
|
|
515ffd07f0 | ||
|
|
16ea7a88be | ||
|
|
0f3b0580f0 |
@@ -404,17 +404,18 @@ namespace PepperDash.Essentials
|
|||||||
Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
|
Debug.Console(2, "MPC3 processor type detected. Adding Mpc3TouchpanelController.");
|
||||||
|
|
||||||
var butToken = devConf.Properties["buttons"];
|
var butToken = devConf.Properties["buttons"];
|
||||||
if (butToken != null)
|
if (butToken == null)
|
||||||
{
|
{
|
||||||
var buttons = butToken.ToObject<Dictionary<string, Essentials.Core.Touchpanels.KeypadButton>>();
|
Debug.Console(0, Debug.ErrorLogLevel.Error,
|
||||||
var tpController = new Essentials.Core.Touchpanels.Mpc3TouchpanelController(devConf.Key, devConf.Name, Global.ControlSystem, buttons);
|
"Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
|
||||||
DeviceManager.AddDevice(tpController);
|
continue;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(0, Debug.ErrorLogLevel.Error, "Error: Unable to deserialize buttons collection for device: {0}", devConf.Key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var buttons = butToken.ToObject<Dictionary<string, Essentials.Core.Touchpanels.KeypadButton>>();
|
||||||
|
var tpController = new Core.Touchpanels.Mpc3TouchpanelController(
|
||||||
|
string.Format("{0}-keypadButtons", devConf.Key), devConf.Name, Global.ControlSystem, buttons);
|
||||||
|
|
||||||
|
DeviceManager.AddDevice(tpController);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.2.1.30543, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -8,6 +8,18 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
public JoinDataComplete IsOnline = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "DM RMC Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "DM RMC Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VideoMuteOn")]
|
||||||
|
public JoinDataComplete VideoMuteOn = new JoinDataComplete(new JoinData { JoinNumber = 3, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DM RMC Mute Video", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VideoMuteOff")]
|
||||||
|
public JoinDataComplete VideoMuteOff = new JoinDataComplete(new JoinData { JoinNumber = 4, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DM RMC UnMute Video", JoinCapabilities = eJoinCapabilities.ToFromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
|
[JoinName("VideoMuteToggle")]
|
||||||
|
public JoinDataComplete VideoMuteToggle = new JoinDataComplete(new JoinData { JoinNumber = 5, JoinSpan = 1 },
|
||||||
|
new JoinMetadata { Description = "DM RMC Mute Video Toggle", JoinCapabilities = eJoinCapabilities.FromSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
[JoinName("CurrentOutputResolution")]
|
[JoinName("CurrentOutputResolution")]
|
||||||
public JoinDataComplete CurrentOutputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
public JoinDataComplete CurrentOutputResolution = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "DM RMC Current Output Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
new JoinMetadata { Description = "DM RMC Current Output Resolution", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Serial });
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace PepperDash.Essentials.Core.Bridges
|
|||||||
|
|
||||||
[JoinName("Online")]
|
[JoinName("Online")]
|
||||||
public JoinDataComplete Online = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
public JoinDataComplete Online = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
new JoinMetadata { Description = "PDU Name", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
new JoinMetadata { Description = "Online", JoinCapabilities = eJoinCapabilities.ToSIMPL, JoinType = eJoinType.Digital });
|
||||||
|
|
||||||
[JoinName("OutletCount")]
|
[JoinName("OutletCount")]
|
||||||
public JoinDataComplete OutletCount = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
public JoinDataComplete OutletCount = new JoinDataComplete(new JoinData { JoinNumber = 1, JoinSpan = 1 },
|
||||||
|
|||||||
@@ -356,16 +356,18 @@ namespace PepperDash.Essentials.Core
|
|||||||
{
|
{
|
||||||
foreach (var customJoinData in joinData)
|
foreach (var customJoinData in joinData)
|
||||||
{
|
{
|
||||||
var join = Joins[customJoinData.Key];
|
JoinDataComplete join;
|
||||||
|
|
||||||
|
if (!Joins.TryGetValue(customJoinData.Key, out join))
|
||||||
|
{
|
||||||
|
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (join != null)
|
if (join != null)
|
||||||
{
|
{
|
||||||
join.SetCustomJoinData(customJoinData.Value);
|
join.SetCustomJoinData(customJoinData.Value);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(2, "No matching key found in join map for: '{0}'", customJoinData.Key);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintJoinMapInfo();
|
PrintJoinMapInfo();
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.2.1.30543, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
using System.Globalization;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using Crestron.SimplSharp;
|
|
||||||
using Crestron.SimplSharpPro;
|
using Crestron.SimplSharpPro;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using PepperDash.Core;
|
using PepperDash.Core;
|
||||||
using PepperDash.Essentials.Core;
|
|
||||||
|
|
||||||
namespace PepperDash.Essentials.Core.Touchpanels
|
namespace PepperDash.Essentials.Core.Touchpanels
|
||||||
{
|
{
|
||||||
@@ -16,82 +12,233 @@ namespace PepperDash.Essentials.Core.Touchpanels
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class Mpc3TouchpanelController : Device
|
public class Mpc3TouchpanelController : Device
|
||||||
{
|
{
|
||||||
MPC3Basic _Touchpanel;
|
readonly MPC3Basic _touchpanel;
|
||||||
|
|
||||||
Dictionary<string, KeypadButton> _Buttons;
|
readonly Dictionary<string, KeypadButton> _buttons;
|
||||||
|
|
||||||
public Mpc3TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
|
public Mpc3TouchpanelController(string key, string name, CrestronControlSystem processor, Dictionary<string, KeypadButton> buttons)
|
||||||
: base(key, name)
|
: base(key, name)
|
||||||
{
|
{
|
||||||
_Touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
|
_touchpanel = processor.ControllerTouchScreenSlotDevice as MPC3Basic;
|
||||||
_Buttons = buttons;
|
if (_touchpanel == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Failed to construct MPC3 Touchpanel Controller with key {0}, check configuration", key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_Touchpanel.ButtonStateChange += new Crestron.SimplSharpPro.DeviceSupport.ButtonEventHandler(_Touchpanel_ButtonStateChange);
|
_touchpanel.ButtonStateChange += _touchpanel_ButtonStateChange;
|
||||||
|
_buttons = buttons;
|
||||||
|
if (_buttons == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this,
|
||||||
|
"Button properties are null, failed to setup MPC3 Touch Controller, check configuration");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
AddPostActivationAction(() =>
|
AddPostActivationAction(() =>
|
||||||
{
|
{
|
||||||
// Link up the button feedbacks to the specified BoolFeedbacks
|
foreach (var button in _buttons)
|
||||||
foreach (var button in _Buttons)
|
|
||||||
{
|
{
|
||||||
var feedbackConfig = button.Value.Feedback;
|
var buttonKey = button.Key.ToLower();
|
||||||
var device = DeviceManager.GetDeviceForKey(feedbackConfig.DeviceKey) as Device;
|
var buttonConfig = button.Value;
|
||||||
if (device != null)
|
|
||||||
{
|
|
||||||
var bKey = button.Key.ToLower();
|
|
||||||
|
|
||||||
var feedback = device.GetFeedbackProperty(feedbackConfig.FeedbackName);
|
InitializeButton(buttonKey, buttonConfig);
|
||||||
|
InitializeButtonFeedback(buttonKey, buttonConfig);
|
||||||
var bFeedback = feedback as BoolFeedback;
|
|
||||||
var iFeedback = feedback as IntFeedback;
|
|
||||||
if (bFeedback != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
if (bKey == "power")
|
|
||||||
{
|
|
||||||
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackPower);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else if (bKey == "mute")
|
|
||||||
{
|
|
||||||
bFeedback.LinkCrestronFeedback(_Touchpanel.FeedbackMute);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Link to the Crestron Feedback corresponding to the button number
|
|
||||||
bFeedback.LinkCrestronFeedback(_Touchpanel.Feedbacks[UInt16.Parse(button.Key)]);
|
|
||||||
}
|
|
||||||
else if (iFeedback != null)
|
|
||||||
{
|
|
||||||
if (bKey == "volumefeedback")
|
|
||||||
{
|
|
||||||
var volFeedback = feedback as IntFeedback;
|
|
||||||
// TODO: Figure out how to subsribe to a volume IntFeedback and link it to the voluem
|
|
||||||
volFeedback.LinkInputSig(_Touchpanel.VolumeBargraph);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "Unable to get BoolFeedback with name: {0} from device: {1}", feedbackConfig.FeedbackName, device.Key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.Console(1, this, "Unable to get device with key: {0}", feedbackConfig.DeviceKey);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void _Touchpanel_ButtonStateChange(GenericBase device, Crestron.SimplSharpPro.DeviceSupport.ButtonEventArgs args)
|
/// <summary>
|
||||||
|
/// Enables/disables buttons based on event type configuration
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="config"></param>
|
||||||
|
public void InitializeButton(string key, KeypadButton config)
|
||||||
|
{
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Button '{0}' config is null, unable to initialize", key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int buttonNumber;
|
||||||
|
TryParseInt(key, out buttonNumber);
|
||||||
|
|
||||||
|
var buttonEventTypes = config.EventTypes;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case ("power"):
|
||||||
|
{
|
||||||
|
if (buttonEventTypes == null)
|
||||||
|
_touchpanel.DisablePowerButton();
|
||||||
|
else
|
||||||
|
_touchpanel.EnablePowerButton();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("volumeup"):
|
||||||
|
{
|
||||||
|
if (buttonEventTypes == null)
|
||||||
|
_touchpanel.DisableVolumeUpButton();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("volumedown"):
|
||||||
|
{
|
||||||
|
if (buttonEventTypes == null)
|
||||||
|
_touchpanel.DisableVolumeDownButton();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("volumefeedback"):
|
||||||
|
{
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("mute"):
|
||||||
|
{
|
||||||
|
if (buttonEventTypes == null)
|
||||||
|
_touchpanel.DisableMuteButton();
|
||||||
|
else
|
||||||
|
_touchpanel.EnableMuteButton();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
if (buttonNumber == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (buttonEventTypes == null)
|
||||||
|
_touchpanel.DisableNumericalButton((uint)buttonNumber);
|
||||||
|
else
|
||||||
|
_touchpanel.EnableNumericalButton((uint)buttonNumber);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Console(1, this, "Button '{0}' {1}", key, buttonEventTypes == null
|
||||||
|
? "is disabled, verify eventTypes are configured."
|
||||||
|
: "is enabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Links button feedback if configured
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key"></param>
|
||||||
|
/// <param name="config"></param>
|
||||||
|
public void InitializeButtonFeedback(string key, KeypadButton config)
|
||||||
|
{
|
||||||
|
if (config == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Button '{0}' config is null, unable to initialize feedback", key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int buttonNumber;
|
||||||
|
TryParseInt(key, out buttonNumber);
|
||||||
|
|
||||||
|
// Link up the button feedbacks to the specified device feedback
|
||||||
|
var buttonFeedback = config.Feedback;
|
||||||
|
if (buttonFeedback == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Button '{0}' feedback not configured and will not be implemented. Verify feedback is configured if required.", key);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var device = DeviceManager.GetDeviceForKey(buttonFeedback.DeviceKey) as Device;
|
||||||
|
if (device == null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Button '{0}' feedback device with key '{0}' not found, feedback will not be implemented. Verify feedback deviceKey is properly configured.",
|
||||||
|
buttonFeedback.DeviceKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO [ ] verify if this can replace the current method
|
||||||
|
var deviceFeedback = device.GetFeedbackProperty(buttonFeedback.FeedbackName);
|
||||||
|
Debug.Console(0, this, "deviceFeedback.GetType().Name: '{0}'", deviceFeedback.GetType().Name);
|
||||||
|
//switch (feedback.GetType().Name.ToLower())
|
||||||
|
//{
|
||||||
|
// case("boolfeedback"):
|
||||||
|
// {
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// case("intfeedback"):
|
||||||
|
// {
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// case("stringfeedback"):
|
||||||
|
// {
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
var boolFeedback = deviceFeedback as BoolFeedback;
|
||||||
|
var intFeedback = deviceFeedback as IntFeedback;
|
||||||
|
|
||||||
|
switch (key)
|
||||||
|
{
|
||||||
|
case ("power"):
|
||||||
|
{
|
||||||
|
if (boolFeedback != null) boolFeedback.LinkCrestronFeedback(_touchpanel.FeedbackPower);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("volumeup"):
|
||||||
|
case ("volumedown"):
|
||||||
|
case ("volumefeedback"):
|
||||||
|
{
|
||||||
|
if (intFeedback != null)
|
||||||
|
{
|
||||||
|
var volumeFeedback = intFeedback;
|
||||||
|
volumeFeedback.LinkInputSig(_touchpanel.VolumeBargraph);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ("mute"):
|
||||||
|
{
|
||||||
|
if (boolFeedback != null) boolFeedback.LinkCrestronFeedback(_touchpanel.FeedbackMute);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
if (boolFeedback != null) boolFeedback.LinkCrestronFeedback(_touchpanel.Feedbacks[(uint)buttonNumber]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Try parse int helper method
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str"></param>
|
||||||
|
/// <param name="result"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public bool TryParseInt(string str, out int result)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = int.Parse(str);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
result = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void _touchpanel_ButtonStateChange(GenericBase device, Crestron.SimplSharpPro.DeviceSupport.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
Debug.Console(1, this, "Button {0} ({1}), {2}", args.Button.Number, args.Button.Name, args.NewButtonState);
|
Debug.Console(1, this, "Button {0} ({1}), {2}", args.Button.Number, args.Button.Name, args.NewButtonState);
|
||||||
var type = args.NewButtonState.ToString();
|
var type = args.NewButtonState.ToString();
|
||||||
|
|
||||||
if (_Buttons.ContainsKey(args.Button.Number.ToString()))
|
if (_buttons.ContainsKey(args.Button.Number.ToString(CultureInfo.InvariantCulture)))
|
||||||
{
|
{
|
||||||
Press(args.Button.Number.ToString(), type);
|
Press(args.Button.Number.ToString(CultureInfo.InvariantCulture), type);
|
||||||
}
|
}
|
||||||
else if(_Buttons.ContainsKey(args.Button.Name.ToString()))
|
else if (_buttons.ContainsKey(args.Button.Name.ToString()))
|
||||||
{
|
{
|
||||||
Press(args.Button.Name.ToString(), type);
|
Press(args.Button.Name.ToString(), type);
|
||||||
}
|
}
|
||||||
@@ -101,29 +248,30 @@ namespace PepperDash.Essentials.Core.Touchpanels
|
|||||||
/// Runs the function associated with this button/type. One of the following strings:
|
/// Runs the function associated with this button/type. One of the following strings:
|
||||||
/// Pressed, Released, Tapped, DoubleTapped, Held, HeldReleased
|
/// Pressed, Released, Tapped, DoubleTapped, Held, HeldReleased
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="number"></param>
|
/// <param name="buttonKey"></param>
|
||||||
/// <param name="type"></param>
|
/// <param name="type"></param>
|
||||||
public void Press(string number, string type)
|
public void Press(string buttonKey, string type)
|
||||||
{
|
{
|
||||||
// TODO: In future, consider modifying this to generate actions at device activation time
|
// TODO: In future, consider modifying this to generate actions at device activation time
|
||||||
// to prevent the need to dynamically call the method via reflection on each button press
|
// to prevent the need to dynamically call the method via reflection on each button press
|
||||||
if (!_Buttons.ContainsKey(number)) { return; }
|
if (!_buttons.ContainsKey(buttonKey)) return;
|
||||||
var but = _Buttons[number];
|
|
||||||
if (but.EventTypes.ContainsKey(type))
|
|
||||||
{
|
|
||||||
foreach (var a in but.EventTypes[type]) { DeviceJsonApi.DoDeviceAction(a); }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var button = _buttons[buttonKey];
|
||||||
|
if (!button.EventTypes.ContainsKey(type)) return;
|
||||||
|
|
||||||
|
foreach (var eventType in button.EventTypes[type]) DeviceJsonApi.DoDeviceAction(eventType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Represents the configuration of a keybad buggon
|
/// Represents the configuration of a keypad button
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class KeypadButton
|
public class KeypadButton
|
||||||
{
|
{
|
||||||
|
[JsonProperty("eventTypes")]
|
||||||
public Dictionary<string, DeviceActionWrapper[]> EventTypes { get; set; }
|
public Dictionary<string, DeviceActionWrapper[]> EventTypes { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("feedback")]
|
||||||
public KeypadButtonFeedback Feedback { get; set; }
|
public KeypadButtonFeedback Feedback { get; set; }
|
||||||
|
|
||||||
public KeypadButton()
|
public KeypadButton()
|
||||||
@@ -134,11 +282,14 @@ namespace PepperDash.Essentials.Core.Touchpanels
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
/// Represents the configuration of a keypad button feedback
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class KeypadButtonFeedback
|
public class KeypadButtonFeedback
|
||||||
{
|
{
|
||||||
|
[JsonProperty("deviceKey")]
|
||||||
public string DeviceKey { get; set; }
|
public string DeviceKey { get; set; }
|
||||||
|
|
||||||
|
[JsonProperty("feedbackName")]
|
||||||
public string FeedbackName { get; set; }
|
public string FeedbackName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -991,28 +991,41 @@ namespace PepperDash.Essentials.DM
|
|||||||
case (DMInputEventIds.OnlineFeedbackEventId):
|
case (DMInputEventIds.OnlineFeedbackEventId):
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
Debug.Console(2, this, "DM Input OnlineFeedbackEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
|
|
||||||
|
if(!InputEndpointOnlineFeedbacks.ContainsKey(args.Number)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (DMInputEventIds.EndpointOnlineEventId):
|
case (DMInputEventIds.EndpointOnlineEventId):
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
Debug.Console(2, this, "DM Input EndpointOnlineEventId for input: {0}. State: {1}", args.Number, device.Inputs[args.Number].EndpointOnlineFeedback);
|
||||||
|
|
||||||
|
if(!InputEndpointOnlineFeedbacks.ContainsKey(args.Number)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
InputEndpointOnlineFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (DMInputEventIds.VideoDetectedEventId):
|
case (DMInputEventIds.VideoDetectedEventId):
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
Debug.Console(2, this, "DM Input {0} VideoDetectedEventId", args.Number);
|
||||||
|
|
||||||
|
if(!VideoInputSyncFeedbacks.ContainsKey(args.Number)){
|
||||||
|
break;
|
||||||
|
}
|
||||||
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
VideoInputSyncFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (DMInputEventIds.InputNameEventId):
|
case (DMInputEventIds.InputNameEventId):
|
||||||
{
|
{
|
||||||
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
Debug.Console(2, this, "DM Input {0} NameFeedbackEventId", args.Number);
|
||||||
if(InputNameFeedbacks.ContainsKey(args.Number))
|
if(!InputNameFeedbacks.ContainsKey(args.Number))
|
||||||
{
|
{
|
||||||
InputNameFeedbacks[args.Number].FireUpdate();
|
break;
|
||||||
}
|
}
|
||||||
|
InputNameFeedbacks[args.Number].FireUpdate();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ using PepperDash.Core;
|
|||||||
using PepperDash.Essentials.Core;
|
using PepperDash.Essentials.Core;
|
||||||
using PepperDash.Essentials.Core.Bridges;
|
using PepperDash.Essentials.Core.Bridges;
|
||||||
using PepperDash_Essentials_DM;
|
using PepperDash_Essentials_DM;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace PepperDash.Essentials.DM
|
namespace PepperDash.Essentials.DM
|
||||||
{
|
{
|
||||||
@@ -16,7 +17,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[Description("Wrapper Class for DM-RMC-4K-SCALER-C")]
|
[Description("Wrapper Class for DM-RMC-4K-SCALER-C")]
|
||||||
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
public class DmRmc4kScalerCController : DmRmcControllerBase, IRoutingInputsOutputs, IBasicVolumeWithFeedback,
|
||||||
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp
|
IIROutputPorts, IComPorts, ICec, IRelayPorts, IHasDmInHdcp, IBasicVideoMuteWithFeedback
|
||||||
{
|
{
|
||||||
private readonly DmRmc4kScalerC _rmc;
|
private readonly DmRmc4kScalerC _rmc;
|
||||||
|
|
||||||
@@ -68,6 +69,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
AddToFeedbackList(DmInHdcpStateFeedback);
|
AddToFeedbackList(DmInHdcpStateFeedback);
|
||||||
|
|
||||||
|
VideoMuteIsOn = new BoolFeedback("HdmiOutputVideoMuteIsOn", () => _rmc.HdmiOutput.BlankEnabledFeedback.BoolValue);
|
||||||
|
|
||||||
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
_rmc.HdmiOutput.OutputStreamChange += HdmiOutput_OutputStreamChange;
|
||||||
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
_rmc.HdmiOutput.ConnectedDevice.DeviceInformationChange += ConnectedDevice_DeviceInformationChange;
|
||||||
@@ -83,6 +85,10 @@ namespace PepperDash.Essentials.DM
|
|||||||
{
|
{
|
||||||
VideoOutputResolutionFeedback.FireUpdate();
|
VideoOutputResolutionFeedback.FireUpdate();
|
||||||
}
|
}
|
||||||
|
else if (args.EventId == EndpointOutputStreamEventIds.BlankEnabledFeedbackEventId)
|
||||||
|
{
|
||||||
|
VideoMuteIsOn.FireUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
void ConnectedDevice_DeviceInformationChange(ConnectedDeviceInformation connectedDevice, ConnectedDeviceEventArgs args)
|
||||||
@@ -216,5 +222,40 @@ namespace PepperDash.Essentials.DM
|
|||||||
_rmc.DmInput.HdcpCapability = hdcpState;
|
_rmc.DmInput.HdcpCapability = hdcpState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region IBasicVideoMuteWithFeedback Members
|
||||||
|
|
||||||
|
public BoolFeedback VideoMuteIsOn
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
private set;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VideoMuteOn()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Video Mute On");
|
||||||
|
_rmc.HdmiOutput.BlankEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void VideoMuteOff()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Video Mute Off");
|
||||||
|
_rmc.HdmiOutput.BlankDisabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region IBasicVideoMute Members
|
||||||
|
|
||||||
|
public void VideoMuteToggle()
|
||||||
|
{
|
||||||
|
Debug.Console(2, this, "Video Mute Toggle");
|
||||||
|
if (_rmc.HdmiOutput.BlankEnabledFeedback.BoolValue == true)
|
||||||
|
VideoMuteOff();
|
||||||
|
else
|
||||||
|
VideoMuteOn();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,6 +61,11 @@ namespace PepperDash.Essentials.DM
|
|||||||
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LinkDmRmcToApi(rmc, trilist, joinMap);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void LinkDmRmcToApi(DmRmcControllerBase rmc, BasicTriList trilist, DmRmcControllerJoinMap joinMap)
|
||||||
|
{
|
||||||
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
Debug.Console(1, rmc, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
|
||||||
|
|
||||||
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
|
||||||
@@ -139,6 +144,18 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count;
|
trilist.UShortInput[joinMap.HdcpInputPortCount.JoinNumber].UShortValue = (ushort)routing.InputPorts.Count;
|
||||||
|
|
||||||
|
var dmRmcScalerCBasicVideoMuteWithFeedback = rmc as IBasicVideoMuteWithFeedback;
|
||||||
|
|
||||||
|
if (dmRmcScalerCBasicVideoMuteWithFeedback != null)
|
||||||
|
{
|
||||||
|
Debug.Console(1, this, "Device is IBasicVideoMuteWithFeedback, linking video mute");
|
||||||
|
trilist.SetSigTrueAction(joinMap.VideoMuteToggle.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteToggle());
|
||||||
|
trilist.SetSigTrueAction(joinMap.VideoMuteOn.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOn());
|
||||||
|
trilist.SetSigTrueAction(joinMap.VideoMuteOff.JoinNumber, () => dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteOff());
|
||||||
|
dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkInputSig(trilist.BooleanInput[joinMap.VideoMuteOn.JoinNumber]);
|
||||||
|
dmRmcScalerCBasicVideoMuteWithFeedback.VideoMuteIsOn.LinkComplementInputSig(trilist.BooleanInput[joinMap.VideoMuteOff.JoinNumber]);
|
||||||
|
}
|
||||||
|
|
||||||
var routingWithFeedback = routing as IRmcRouting;
|
var routingWithFeedback = routing as IRmcRouting;
|
||||||
if (routingWithFeedback == null) return;
|
if (routingWithFeedback == null) return;
|
||||||
|
|
||||||
@@ -149,6 +166,7 @@ namespace PepperDash.Essentials.DM
|
|||||||
|
|
||||||
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber,
|
trilist.SetUShortSigAction(joinMap.AudioVideoSource.JoinNumber,
|
||||||
a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
a => routingWithFeedback.ExecuteNumericSwitch(a, 1, eRoutingSignalType.AudioVideo));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Implementation of IDeviceInfoProvider
|
#region Implementation of IDeviceInfoProvider
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.2.1.30543, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
@@ -153,6 +153,7 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="VideoStatusHelpers.cs" />
|
<Compile Include="VideoStatusHelpers.cs" />
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
|
<None Include="ClassDiagram1.cd" />
|
||||||
<None Include="Properties\ControlSystem.cfg" />
|
<None Include="Properties\ControlSystem.cfg" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ namespace PepperDash.Essentials.Devices.Common.Codec
|
|||||||
return joinable;
|
return joinable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty("dialable")]
|
||||||
|
public bool Dialable { get; set; }
|
||||||
|
|
||||||
//public string ConferenceNumberToDial { get; set; }
|
//public string ConferenceNumberToDial { get; set; }
|
||||||
[JsonProperty("conferencePassword")]
|
[JsonProperty("conferencePassword")]
|
||||||
public string ConferencePassword { get; set; }
|
public string ConferencePassword { get; set; }
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
<HintPath>..\..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="mscorlib" />
|
<Reference Include="mscorlib" />
|
||||||
<Reference Include="PepperDash_Core, Version=1.0.42.30563, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="PepperDash_Core, Version=1.2.1.30543, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
<HintPath>..\..\..\packages\PepperDashCore\lib\net35\PepperDash_Core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -348,6 +348,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual")
|
if (b.DialInfo.ConnectMode.Value.ToLower() == "obtp" || b.DialInfo.ConnectMode.Value.ToLower() == "manual")
|
||||||
meeting.IsOneButtonToPushMeeting = true;
|
meeting.IsOneButtonToPushMeeting = true;
|
||||||
|
|
||||||
|
meeting.Dialable = b.DialInfo.Calls.Call.Count > 0;
|
||||||
|
|
||||||
if (b.DialInfo.Calls.Call != null)
|
if (b.DialInfo.Calls.Call != null)
|
||||||
{
|
{
|
||||||
foreach (Call c in b.DialInfo.Calls.Call)
|
foreach (Call c in b.DialInfo.Calls.Call)
|
||||||
|
|||||||
@@ -940,7 +940,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
|
|||||||
|
|
||||||
//digitals
|
//digitals
|
||||||
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
tokenArray[digitalIndex] = new XSigDigitalToken(digitalIndex + 1, meeting.Joinable);
|
||||||
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, meeting.Id != "0");
|
tokenArray[digitalIndex + 1] = new XSigDigitalToken(digitalIndex + 2, meeting.Dialable);
|
||||||
|
|
||||||
//serials
|
//serials
|
||||||
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, meeting.Organizer);
|
tokenArray[stringIndex] = new XSigSerialToken(stringIndex + 1, meeting.Organizer);
|
||||||
|
|||||||
@@ -1510,6 +1510,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
|
|||||||
|
|
||||||
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
|
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
|
||||||
|
|
||||||
|
meeting.Dialable = meeting.Id != "0";
|
||||||
|
|
||||||
// No meeting.Calls data exists for Zoom Rooms. Leaving out for now.
|
// No meeting.Calls data exists for Zoom Rooms. Leaving out for now.
|
||||||
var now = DateTime.Now;
|
var now = DateTime.Now;
|
||||||
if (meeting.StartTime < now && meeting.EndTime < now)
|
if (meeting.StartTime < now && meeting.EndTime < now)
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<packages>
|
<packages>
|
||||||
<package id="PepperDashCore" version="1.2.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
<package id="PepperDashCore" version="1.3.1" targetFramework="net35" allowedVersions="[1.0,2.0)"/>
|
||||||
</packages>
|
</packages>
|
||||||
|
|||||||
Reference in New Issue
Block a user