Merge pull request #461 from PepperDash/release/1.6.5

Release/1.6.5 Main
This commit is contained in:
Andrew Welker 2020-10-22 13:31:25 -06:00 committed by GitHub
commit f22bf60eb6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 6051 additions and 2156 deletions

View file

@ -60,7 +60,7 @@ jobs:
- name: Build Solution - name: Build Solution
shell: powershell shell: powershell
run: | run: |
Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder:v1.4.1 c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)" Invoke-Expression "docker run --rm --mount type=bind,source=""$($Env:GITHUB_WORKSPACE)"",target=""c:/project"" pepperdash/sspbuilder c:\cihelpers\vsidebuild.exe -Solution ""c:\project\$($Env:SOLUTION_FILE).sln"" -BuildSolutionConfiguration $($ENV:BUILD_TYPE)"
# Zip up the output files as needed # Zip up the output files as needed
- name: Zip Build Output - name: Zip Build Output
shell: powershell shell: powershell

3
.gitmodules vendored
View file

@ -1,6 +1,3 @@
[submodule "essentials-framework/pepperdashcore-builds"]
path = essentials-framework/pepperdashcore-builds
url = https://github.com/ndorin/PepperDashCore-Builds.git
[submodule "Essentials-Template-UI"] [submodule "Essentials-Template-UI"]
path = Essentials-Template-UI path = Essentials-Template-UI
url = https://github.com/PepperDash/Essentials-Template-UI.git url = https://github.com/PepperDash/Essentials-Template-UI.git

View file

@ -327,7 +327,11 @@ namespace PepperDash.Essentials
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor")); DeviceManager.AddDevice(new PepperDash.Essentials.Core.Devices.CrestronProcessor("processor"));
// Add global System Monitor device // Add global System Monitor device
DeviceManager.AddDevice(new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor")); if (CrestronEnvironment.DevicePlatform == eDevicePlatform.Appliance)
{
DeviceManager.AddDevice(
new PepperDash.Essentials.Core.Monitoring.SystemMonitorController("systemMonitor"));
}
foreach (var devConf in ConfigReader.ConfigObject.Devices) foreach (var devConf in ConfigReader.ConfigObject.Devices)
{ {

View file

@ -225,6 +225,14 @@
"2": "Output 2", "2": "Output 2",
"3": "Output 3", "3": "Output 3",
"4": "Output 4" "4": "Output 4"
},
"inputSlotSupportsHdcp2":{
"1": "false",
"2": "false",
"3": "false",
"4": "false",
"5": "false",
"6": "false"
} }
} }
}, },

View file

@ -75,10 +75,6 @@
<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>
<Reference Include="PepperDash_Essentials_DM, Version=1.0.0.19343, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\essentials-framework\Essentials DM\Essentials_DM\bin\PepperDash_Essentials_DM.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
@ -215,6 +211,10 @@
<Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project> <Project>{892B761C-E479-44CE-BD74-243E9214AF13}</Project>
<Name>Essentials Devices Common</Name> <Name>Essentials Devices Common</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\essentials-framework\Essentials DM\Essentials_DM\PepperDash_Essentials_DM.csproj">
<Project>{9199CE8A-0C9F-4952-8672-3EED798B284F}</Project>
<Name>PepperDash_Essentials_DM</Name>
</ProjectReference>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>

View file

@ -13,6 +13,7 @@ using PepperDash.Essentials.Room.Config;
using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Devices.Common.AudioCodec; using PepperDash.Essentials.Devices.Common.AudioCodec;
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials namespace PepperDash.Essentials
{ {
@ -313,7 +314,7 @@ namespace PepperDash.Essentials
VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); VideoCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
VideoCodec.IsReadyChange += (o, a) => this.SetCodecExternalSources(); VideoCodec.IsReadyChange += (o, a) => { this.SetCodecExternalSources(); SetCodecBranding(); };
if (AudioCodec != null) if (AudioCodec != null)
AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate(); AudioCodec.CallStatusChange += (o, a) => this.InCallFeedback.FireUpdate();
@ -703,29 +704,36 @@ namespace PepperDash.Essentials
{ {
return; return;
} }
else
{
string codecTieLine = "";
codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
videoCodecWithExternalSwitching.ClearExternalSources();
videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
foreach (var kvp in srcList) string codecTieLine = ConfigReader.ConfigObject.TieLines.SingleOrDefault(x => x.DestinationKey == VideoCodec.Key).DestinationPort;
{ videoCodecWithExternalSwitching.ClearExternalSources();
var srcConfig = kvp.Value; videoCodecWithExternalSwitching.RunRouteAction = RunRouteAction;
var srcList = ConfigReader.ConfigObject.SourceLists.SingleOrDefault(x => x.Key == SourceListKey).Value.OrderBy(kv => kv.Value.Order); ;
if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff") foreach (var kvp in srcList)
{ {
var srcConfig = kvp.Value;
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop); if (kvp.Key != DefaultCodecRouteString && kvp.Key != "roomOff")
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready); {
videoCodecWithExternalSwitching.AddExternalSource(codecTieLine, kvp.Key, srcConfig.PreferredName, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceType.desktop);
videoCodecWithExternalSwitching.SetExternalSourceState(kvp.Key, PepperDash.Essentials.Devices.Common.VideoCodec.Cisco.eExternalSourceMode.Ready);
} }
} }
}
} }
private void SetCodecBranding()
{
var vcWithBranding = VideoCodec as IHasBranding;
if (vcWithBranding == null) return;
Debug.Console(1, this, "Setting Codec Branding");
vcWithBranding.InitializeBranding(Key);
}
#region IPrivacy Members #region IPrivacy Members

View file

@ -1,7 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection; using Crestron.SimplSharp.Reflection;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.EthernetCommunication; using Crestron.SimplSharpPro.EthernetCommunication;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -82,9 +84,9 @@ namespace PepperDash.Essentials.Core.Bridges
protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; } protected Dictionary<string, JoinMapBaseAdvanced> JoinMaps { get; private set; }
public ThreeSeriesTcpIpEthernetIntersystemCommunications Eisc { get; private set; } public BasicTriList Eisc { get; private set; }
public EiscApiAdvanced(DeviceConfig dc) : public EiscApiAdvanced(DeviceConfig dc, BasicTriList eisc) :
base(dc.Key) base(dc.Key)
{ {
JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>(); JoinMaps = new Dictionary<string, JoinMapBaseAdvanced>();
@ -92,44 +94,52 @@ namespace PepperDash.Essentials.Core.Bridges
PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>(); PropertiesConfig = dc.Properties.ToObject<EiscApiPropertiesConfig>();
//PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString()); //PropertiesConfig = JsonConvert.DeserializeObject<EiscApiPropertiesConfig>(dc.Properties.ToString());
Eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(PropertiesConfig.Control.IpIdInt, PropertiesConfig.Control.TcpSshProperties.Address, Global.ControlSystem); Eisc = eisc;
Eisc.SigChange += Eisc_SigChange; Eisc.SigChange += Eisc_SigChange;
AddPostActivationAction( () => AddPostActivationAction(LinkDevices);
}
private void LinkDevices()
{
Debug.Console(1, this, "Linking Devices...");
foreach (var d in PropertiesConfig.Devices)
{ {
Debug.Console(1, this, "Linking Devices..."); var device = DeviceManager.GetDeviceForKey(d.DeviceKey);
foreach (var d in PropertiesConfig.Devices) if (device == null)
{ {
var device = DeviceManager.GetDeviceForKey(d.DeviceKey); continue;
if (device == null) continue;
Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{
Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
"{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
device.Key);
continue;
}
var bridge = device as IBridgeAdvanced;
if (bridge != null) bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
} }
var registerResult = Eisc.Register(); Debug.Console(1, this, "Linking Device: '{0}'", device.Key);
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success) if (!typeof (IBridgeAdvanced).IsAssignableFrom(device.GetType().GetCType()))
{ {
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult); Debug.Console(0, this, Debug.ErrorLogLevel.Notice,
return; "{0} is not compatible with this bridge type. Please use 'eiscapi' instead, or updae the device.",
device.Key);
continue;
} }
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful"); var bridge = device as IBridgeAdvanced;
}); if (bridge != null)
{
bridge.LinkToApi(Eisc, d.JoinStart, d.JoinMapKey, this);
}
}
var registerResult = Eisc.Register();
if (registerResult != eDeviceRegistrationUnRegistrationResponse.Success)
{
Debug.Console(2, this, Debug.ErrorLogLevel.Error, "Registration result: {0}", registerResult);
return;
}
Debug.Console(1, this, Debug.ErrorLogLevel.Notice, "EISC registration successful");
} }
/// <summary> /// <summary>
@ -152,7 +162,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// <summary> /// <summary>
/// Prints all the join maps on this bridge /// Prints all the join maps on this bridge
/// </summary> /// </summary>
public void PrintJoinMaps() public virtual void PrintJoinMaps()
{ {
Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X")); Debug.Console(0, this, "Join Maps for EISC IPID: {0}", Eisc.ID.ToString("X"));
@ -247,7 +257,7 @@ namespace PepperDash.Essentials.Core.Bridges
/// </summary> /// </summary>
/// <param name="currentDevice"></param> /// <param name="currentDevice"></param>
/// <param name="args"></param> /// <param name="args"></param>
void Eisc_SigChange(object currentDevice, SigEventArgs args) protected void Eisc_SigChange(object currentDevice, SigEventArgs args)
{ {
try try
{ {
@ -299,15 +309,34 @@ namespace PepperDash.Essentials.Core.Bridges
{ {
public EiscApiAdvancedFactory() public EiscApiAdvancedFactory()
{ {
TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced" }; TypeNames = new List<string> { "eiscapiadv", "eiscapiadvanced", "vceiscapiadv", "vceiscapiadvanced" };
} }
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
{ {
Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device"); Debug.Console(1, "Factory Attempting to create new EiscApiAdvanced Device");
return new EiscApiAdvanced(dc); var controlProperties = CommFactory.GetControlPropertiesConfig(dc);
switch (dc.Type.ToLower())
{
case "eiscapiadv":
case "eiscapiadvanced":
{
var eisc = new ThreeSeriesTcpIpEthernetIntersystemCommunications(controlProperties.IpIdInt,
controlProperties.TcpSshProperties.Address, Global.ControlSystem);
return new EiscApiAdvanced(dc, eisc);
}
case "vceiscapiadv":
case "vceiscapiadvanced":
{
var eisc = new VirtualControlEISCClient(controlProperties.IpIdInt, InitialParametersClass.RoomId,
Global.ControlSystem);
return new EiscApiAdvanced(dc, eisc);
}
default:
return null;
}
} }
} }

View file

@ -0,0 +1,811 @@
using System;
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_Core.Bridges.JoinMaps
{
public class VideoCodecControllerJoinMap : JoinMapBaseAdvanced
{
#region Status
[JoinName("IsOnline")] public JoinDataComplete IsOnline =
new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
new JoinMetadata
{
Description = "Device is Online",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
#endregion
[JoinName("CallDirection")] public JoinDataComplete CallDirection =
new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Call Direction",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CameraLayout")] public JoinDataComplete CameraLayout =
new JoinDataComplete(new JoinData {JoinNumber = 142, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Layout Toggle",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraLayoutStringFb")] public JoinDataComplete CameraLayoutStringFb =
new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Layout Fb",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraModeAuto")] public JoinDataComplete CameraModeAuto =
new JoinDataComplete(new JoinData {JoinNumber = 131, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Auto",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraModeManual")] public JoinDataComplete CameraModeManual =
new JoinDataComplete(new JoinData {JoinNumber = 132, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Manual",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraModeOff")] public JoinDataComplete CameraModeOff =
new JoinDataComplete(new JoinData {JoinNumber = 133, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Mode Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraNumberSelect")] public JoinDataComplete CameraNumberSelect =
new JoinDataComplete(new JoinData {JoinNumber = 60, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Number Select/FB",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraPanLeft")] public JoinDataComplete CameraPanLeft =
new JoinDataComplete(new JoinData {JoinNumber = 113, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Pan Left",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPanRight")] public JoinDataComplete CameraPanRight =
new JoinDataComplete(new JoinData {JoinNumber = 114, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Pan Right",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraPresetNames")] public JoinDataComplete CameraPresetNames =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Preset Names - XSIG, max of 15",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CameraPresetSelect")] public JoinDataComplete CameraPresetSelect =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Preset Select",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("CameraPresetSave")] public JoinDataComplete CameraPresetSave =
new JoinDataComplete(new JoinData {JoinNumber = 121, JoinSpan = 1},
new JoinMetadata
{
Description = "Save Selected Preset",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSelfView")] public JoinDataComplete CameraSelfView =
new JoinDataComplete(new JoinData {JoinNumber = 141, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Self View Toggle/FB",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSupportsAutoMode")] public JoinDataComplete CameraSupportsAutoMode =
new JoinDataComplete(new JoinData {JoinNumber = 143, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Supports Auto Mode FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraSupportsOffMode")] public JoinDataComplete CameraSupportsOffMode =
new JoinDataComplete(new JoinData {JoinNumber = 144, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Supports Off Mode FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraTiltDown")] public JoinDataComplete CameraTiltDown =
new JoinDataComplete(new JoinData {JoinNumber = 112, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Tilt Down",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraTiltUp")] public JoinDataComplete CameraTiltUp =
new JoinDataComplete(new JoinData {JoinNumber = 111, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Tilt Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraZoomIn")] public JoinDataComplete CameraZoomIn =
new JoinDataComplete(new JoinData {JoinNumber = 115, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Zoom In",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CameraZoomOut")] public JoinDataComplete CameraZoomOut =
new JoinDataComplete(new JoinData {JoinNumber = 116, JoinSpan = 1},
new JoinMetadata
{
Description = "Camera Zoom Out",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("CurrentCallName")] public JoinDataComplete CurrentCallData =
new JoinDataComplete(new JoinData {JoinNumber = 2, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Call Data - XSIG",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentDialString")] public JoinDataComplete CurrentDialString =
new JoinDataComplete(new JoinData {JoinNumber = 1, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Dial String",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentParticipants")] public JoinDataComplete CurrentParticipants =
new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
new JoinMetadata()
{
Description = "Current Participants XSig",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("CurrentSource")] public JoinDataComplete CurrentSource =
new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Source",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DialMeeting1")] public JoinDataComplete DialMeeting1 =
new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
new JoinMetadata
{
Description = "Join first meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialMeeting2")]
public JoinDataComplete DialMeeting2 =
new JoinDataComplete(new JoinData { JoinNumber = 162, JoinSpan = 1 },
new JoinMetadata
{
Description = "Join second meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialMeeting3")]
public JoinDataComplete DialMeeting3 =
new JoinDataComplete(new JoinData { JoinNumber = 163, JoinSpan = 1 },
new JoinMetadata
{
Description = "Join third meeting",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryDialSelectedLine")] public JoinDataComplete DirectoryDialSelectedLine =
new JoinDataComplete(new JoinData {JoinNumber = 106, JoinSpan = 1},
new JoinMetadata
{
Description = "Dial selected directory line",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryEntries")] public JoinDataComplete DirectoryEntries =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Entries - XSig, 255 entries",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryEntryIsContact")] public JoinDataComplete DirectoryEntryIsContact =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Selected Entry Is Contact FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryEntrySelectedName")] public JoinDataComplete DirectoryEntrySelectedName =
new JoinDataComplete(new JoinData {JoinNumber = 356, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Entry Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryEntrySelectedNumber")] public JoinDataComplete DirectoryEntrySelectedNumber =
new JoinDataComplete(new JoinData {JoinNumber = 357, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Entry Number",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectoryFolderBack")] public JoinDataComplete DirectoryFolderBack =
new JoinDataComplete(new JoinData {JoinNumber = 105, JoinSpan = 1},
new JoinMetadata
{
Description = "Go back one directory level",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryHasChanged")] public JoinDataComplete DirectoryHasChanged =
new JoinDataComplete(new JoinData {JoinNumber = 103, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory has changed FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryIsRoot")] public JoinDataComplete DirectoryIsRoot =
new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory is on Root FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryLineSelected")] public JoinDataComplete DirectoryLineSelected =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Line Selected FB",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryRoot")] public JoinDataComplete DirectoryRoot =
new JoinDataComplete(new JoinData {JoinNumber = 104, JoinSpan = 1},
new JoinMetadata
{
Description = "Go to Directory Root",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectoryRowCount")] public JoinDataComplete DirectoryRowCount =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Row Count FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("DirectorySearchBusy")] public JoinDataComplete DirectorySearchBusy =
new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Search Busy FB",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DirectorySearchString")] public JoinDataComplete DirectorySearchString =
new JoinDataComplete(new JoinData {JoinNumber = 100, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Search String",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("DirectorySelectRow")] public JoinDataComplete DirectorySelectRow =
new JoinDataComplete(new JoinData {JoinNumber = 101, JoinSpan = 1},
new JoinMetadata
{
Description = "Directory Select Row",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("DirectorySelectedFolderName")] public JoinDataComplete DirectorySelectedFolderName =
new JoinDataComplete(new JoinData {JoinNumber = 358, JoinSpan = 1},
new JoinMetadata
{
Description = "Selected Directory Folder Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("0")] public JoinDataComplete Dtmf0 =
new JoinDataComplete(new JoinData {JoinNumber = 20, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 0",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("1")] public JoinDataComplete Dtmf1 =
new JoinDataComplete(new JoinData {JoinNumber = 11, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 1",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("2")] public JoinDataComplete Dtmf2 =
new JoinDataComplete(new JoinData {JoinNumber = 12, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 2",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("3")] public JoinDataComplete Dtmf3 =
new JoinDataComplete(new JoinData {JoinNumber = 13, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 3",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("4")] public JoinDataComplete Dtmf4 =
new JoinDataComplete(new JoinData {JoinNumber = 14, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 4",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("5")] public JoinDataComplete Dtmf5 =
new JoinDataComplete(new JoinData {JoinNumber = 15, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 5",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("6")] public JoinDataComplete Dtmf6 =
new JoinDataComplete(new JoinData {JoinNumber = 16, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 6",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("7")] public JoinDataComplete Dtmf7 =
new JoinDataComplete(new JoinData {JoinNumber = 17, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 7",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("8")] public JoinDataComplete Dtmf8 =
new JoinDataComplete(new JoinData {JoinNumber = 18, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 8",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("9")] public JoinDataComplete Dtmf9 =
new JoinDataComplete(new JoinData {JoinNumber = 19, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF 9",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("#")] public JoinDataComplete DtmfPound =
new JoinDataComplete(new JoinData {JoinNumber = 22, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF #",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("*")] public JoinDataComplete DtmfStar =
new JoinDataComplete(new JoinData {JoinNumber = 21, JoinSpan = 1},
new JoinMetadata
{
Description = "DTMF *",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EndCall")] public JoinDataComplete EndCall =
new JoinDataComplete(new JoinData {JoinNumber = 24, JoinSpan = 1},
new JoinMetadata
{
Description = "Hang Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("HookState")] public JoinDataComplete HookState =
new JoinDataComplete(new JoinData {JoinNumber = 31, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Hook State",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingAnswer")] public JoinDataComplete IncomingAnswer =
new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
new JoinMetadata
{
Description = "Answer Incoming Call",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingCall")] public JoinDataComplete IncomingCall =
new JoinDataComplete(new JoinData {JoinNumber = 50, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("IncomingCallName")] public JoinDataComplete IncomingCallName =
new JoinDataComplete(new JoinData {JoinNumber = 51, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call Name",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("IncomingCallNumber")] public JoinDataComplete IncomingCallNumber =
new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
new JoinMetadata
{
Description = "Incoming Call Number",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("IncomingReject")] public JoinDataComplete IncomingReject =
new JoinDataComplete(new JoinData {JoinNumber = 52, JoinSpan = 1},
new JoinMetadata
{
Description = "Reject Incoming Call",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("ManualDial")] public JoinDataComplete ManualDial =
new JoinDataComplete(new JoinData {JoinNumber = 71, JoinSpan = 1},
new JoinMetadata
{
Description = "Dial manual string",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("Meeting Count Fb")] public JoinDataComplete MeetingCount =
new JoinDataComplete(new JoinData {JoinNumber = 161, JoinSpan = 1},
new JoinMetadata
{
Description = "Meeting Count",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("MicMuteOff")] public JoinDataComplete MicMuteOff =
new JoinDataComplete(new JoinData {JoinNumber = 172, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MicMuteOn")] public JoinDataComplete MicMuteOn =
new JoinDataComplete(new JoinData {JoinNumber = 171, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute On",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MicMuteToggle")] public JoinDataComplete MicMuteToggle =
new JoinDataComplete(new JoinData {JoinNumber = 173, JoinSpan = 1},
new JoinMetadata
{
Description = "Mic Mute Toggle",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("MinutesBeforeMeetingStart")] public JoinDataComplete MinutesBeforeMeetingStart =
new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 1},
new JoinMetadata
{
Description = "Minutes before meeting start that a meeting is joinable",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("ParticipantCount")] public JoinDataComplete ParticipantCount =
new JoinDataComplete(new JoinData {JoinNumber = 151, JoinSpan = 1},
new JoinMetadata
{
Description = "Current Participant Count",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("Schedule")] public JoinDataComplete Schedule =
new JoinDataComplete(new JoinData {JoinNumber = 102, JoinSpan = 1},
new JoinMetadata
{
Description = "Schedule Data - XSIG",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("AutoShareWhileInCall")] public JoinDataComplete SourceShareAutoStart =
new JoinDataComplete(new JoinData {JoinNumber = 203, JoinSpan = 1},
new JoinMetadata
{
Description = "When high, will autostart sharing when a call is joined",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SourceShareEnd")] public JoinDataComplete SourceShareEnd =
new JoinDataComplete(new JoinData {JoinNumber = 202, JoinSpan = 1},
new JoinMetadata
{
Description = "Stop Sharing & Feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SourceShareStart")] public JoinDataComplete SourceShareStart =
new JoinDataComplete(new JoinData {JoinNumber = 201, JoinSpan = 1},
new JoinMetadata
{
Description = "Start Sharing & Feedback",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("RecievingContent")] public JoinDataComplete RecievingContent =
new JoinDataComplete(new JoinData {JoinNumber = 204, JoinSpan = 1},
new JoinMetadata
{
Description = "Recieving content from the far end",
JoinType = eJoinType.Digital,
JoinCapabilities = eJoinCapabilities.ToSIMPL
});
[JoinName("SelfviewPosition")] public JoinDataComplete SelfviewPosition =
new JoinDataComplete(new JoinData {JoinNumber = 211, JoinSpan = 1},
new JoinMetadata
{
Description = "advance selfview position",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("SelfviewPositionFb")]
public JoinDataComplete SelfviewPositionFb =
new JoinDataComplete(new JoinData { JoinNumber = 211, JoinSpan = 1 },
new JoinMetadata
{
Description = "advance selfview position",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Serial
});
[JoinName("SpeedDialStart")] public JoinDataComplete SpeedDialStart =
new JoinDataComplete(new JoinData {JoinNumber = 41, JoinSpan = 4},
new JoinMetadata
{
Description = "Speed Dial",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("UpdateMeetings")] public JoinDataComplete UpdateMeetings =
new JoinDataComplete(new JoinData {JoinNumber = 160, JoinSpan = 1},
new JoinMetadata
{
Description = "Update Meetings",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeDown")] public JoinDataComplete VolumeDown =
new JoinDataComplete(new JoinData {JoinNumber = 175, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Down",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeLevel")] public JoinDataComplete VolumeLevel =
new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Level",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Analog
});
[JoinName("VolumeMuteOff")] public JoinDataComplete VolumeMuteOff =
new JoinDataComplete(new JoinData {JoinNumber = 177, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute Off",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeMuteOn")] public JoinDataComplete VolumeMuteOn =
new JoinDataComplete(new JoinData {JoinNumber = 176, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute On",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeMuteToggle")] public JoinDataComplete VolumeMuteToggle =
new JoinDataComplete(new JoinData {JoinNumber = 178, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Mute Toggle",
JoinCapabilities = eJoinCapabilities.ToFromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("VolumeUp")] public JoinDataComplete VolumeUp =
new JoinDataComplete(new JoinData {JoinNumber = 174, JoinSpan = 1},
new JoinMetadata
{
Description = "Volume Up",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("DialPhoneCall")]
public JoinDataComplete DialPhone =
new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
new JoinMetadata
{
Description = "Dial Phone",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("PhoneHookState")]
public JoinDataComplete PhoneHookState =
new JoinDataComplete(new JoinData { JoinNumber = 72, JoinSpan = 1 },
new JoinMetadata
{
Description = "Dial Phone",
JoinCapabilities = eJoinCapabilities.ToSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("EndPhoneCall")]
public JoinDataComplete HangUpPhone =
new JoinDataComplete(new JoinData { JoinNumber = 73, JoinSpan = 1 },
new JoinMetadata
{
Description = "Hang Up PHone",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
[JoinName("PhoneString")]
public JoinDataComplete PhoneDialString =
new JoinDataComplete(new JoinData { JoinNumber = 2, JoinSpan = 1 },
new JoinMetadata
{
Description = "Phone Dial String",
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Serial
});
public VideoCodecControllerJoinMap(uint joinStart) : base(joinStart, typeof (VideoCodecControllerJoinMap))
{
}
public VideoCodecControllerJoinMap(uint joinStart, Type type) : base(joinStart, type)
{
}
}
}

View file

@ -1,120 +1,120 @@
using System; using System;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public class CommFactory public class CommFactory
{ {
public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig) public static EssentialsControlPropertiesConfig GetControlPropertiesConfig(DeviceConfig deviceConfig)
{ {
try try
{ {
return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig> return JsonConvert.DeserializeObject<EssentialsControlPropertiesConfig>
(deviceConfig.Properties["control"].ToString()); (deviceConfig.Properties["control"].ToString());
//Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig)); //Debug.Console(2, "Control TEST: {0}", JsonConvert.SerializeObject(controlConfig));
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e); Debug.Console(0, "ERROR: [{0}] Control properties deserialize failed:\r{1}", deviceConfig.Key, e);
return null; return null;
} }
} }
/// <summary> /// <summary>
/// Returns a comm method of either com port, TCP, SSH, and puts this into the DeviceManager /// Returns a comm method of either com port, TCP, SSH, and puts this into the DeviceManager
/// </summary> /// </summary>
/// <param name="deviceConfig">The Device config object</param> /// <param name="deviceConfig">The Device config object</param>
public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig) public static IBasicCommunication CreateCommForDevice(DeviceConfig deviceConfig)
{ {
EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig); EssentialsControlPropertiesConfig controlConfig = GetControlPropertiesConfig(deviceConfig);
if (controlConfig == null) if (controlConfig == null)
return null; return null;
IBasicCommunication comm = null; IBasicCommunication comm = null;
try try
{ {
var c = controlConfig.TcpSshProperties; var c = controlConfig.TcpSshProperties;
switch (controlConfig.Method) switch (controlConfig.Method)
{ {
case eControlMethod.Com: case eControlMethod.Com:
comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig); comm = new ComPortController(deviceConfig.Key + "-com", GetComPort, controlConfig.ComParams, controlConfig);
break; break;
case eControlMethod.Cec: case eControlMethod.Cec:
comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig); comm = new CecPortController(deviceConfig.Key + "-cec", GetCecPort, controlConfig);
break; break;
case eControlMethod.IR: case eControlMethod.IR:
break; break;
case eControlMethod.Ssh: case eControlMethod.Ssh:
{ {
var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password); var ssh = new GenericSshClient(deviceConfig.Key + "-ssh", c.Address, c.Port, c.Username, c.Password);
ssh.AutoReconnect = c.AutoReconnect; ssh.AutoReconnect = c.AutoReconnect;
if(ssh.AutoReconnect) if(ssh.AutoReconnect)
ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs; ssh.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = ssh; comm = ssh;
break; break;
} }
case eControlMethod.Tcpip: case eControlMethod.Tcpip:
{ {
var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize); var tcp = new GenericTcpIpClient(deviceConfig.Key + "-tcp", c.Address, c.Port, c.BufferSize);
tcp.AutoReconnect = c.AutoReconnect; tcp.AutoReconnect = c.AutoReconnect;
if (tcp.AutoReconnect) if (tcp.AutoReconnect)
tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs; tcp.AutoReconnectIntervalMs = c.AutoReconnectIntervalMs;
comm = tcp; comm = tcp;
break; break;
} }
case eControlMethod.Udp: case eControlMethod.Udp:
{ {
var udp = new GenericUdpServer(deviceConfig.Key + "-udp", c.Address, c.Port, c.BufferSize); var udp = new GenericUdpServer(deviceConfig.Key + "-udp", c.Address, c.Port, c.BufferSize);
comm = udp; comm = udp;
break; break;
} }
case eControlMethod.Telnet: case eControlMethod.Telnet:
break; break;
default: default:
break; break;
} }
} }
catch (Exception e) catch (Exception e)
{ {
Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}", Debug.Console(0, "Cannot create communication from JSON:\r{0}\r\rException:\r{1}",
deviceConfig.Properties.ToString(), e); deviceConfig.Properties.ToString(), e);
} }
// put it in the device manager if it's the right flavor // put it in the device manager if it's the right flavor
var comDev = comm as Device; var comDev = comm as Device;
if (comDev != null) if (comDev != null)
DeviceManager.AddDevice(comDev); DeviceManager.AddDevice(comDev);
return comm; return comm;
} }
public static ComPort GetComPort(EssentialsControlPropertiesConfig config) public static ComPort GetComPort(EssentialsControlPropertiesConfig config)
{ {
var comPar = config.ComParams; var comPar = config.ComParams;
var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey); var dev = GetIComPortsDeviceFromManagedDevice(config.ControlPortDevKey);
if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts) if (dev != null && config.ControlPortNumber <= dev.NumberOfComPorts)
return dev.ComPorts[config.ControlPortNumber]; return dev.ComPorts[config.ControlPortNumber];
Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber); Debug.Console(0, "GetComPort: Device '{0}' does not have com port {1}", config.ControlPortDevKey, config.ControlPortNumber);
return null; return null;
} }
/// <summary> /// <summary>
/// Gets an ICec port from a RoutingInput or RoutingOutput on a device /// Gets an ICec port from a RoutingInput or RoutingOutput on a device
/// </summary> /// </summary>
/// <param name="config"></param> /// <param name="config"></param>
/// <returns></returns> /// <returns></returns>
public static ICec GetCecPort(ControlPropertiesConfig config) public static ICec GetCecPort(ControlPropertiesConfig config)
{ {
var dev = DeviceManager.GetDeviceForKey(config.ControlPortDevKey); var dev = DeviceManager.GetDeviceForKey(config.ControlPortDevKey);
if (dev != null) if (dev != null)
@ -147,64 +147,64 @@ namespace PepperDash.Essentials.Core
Debug.Console(0, "GetCecPort: '{0}' - Configuration missing 'ControlPortName'", config.ControlPortDevKey); Debug.Console(0, "GetCecPort: '{0}' - Configuration missing 'ControlPortName'", config.ControlPortDevKey);
} }
} }
Debug.Console(0, "GetCecPort: Device '{0}' is not a valid device.", config.ControlPortDevKey); Debug.Console(0, "GetCecPort: Device '{0}' is not a valid device.", config.ControlPortDevKey);
return null; return null;
}
/// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
public string CresnetId { get; set; }
/// <summary>
/// Attempts to provide uint conversion of string CresnetId
/// </summary>
public uint CresnetIdInt
{
get
{
try
{
return Convert.ToUInt32(CresnetId, 16);
}
catch (Exception)
{
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
}
}
} }
public string InfinetId { get; set; } /// <summary>
/// Helper to grab the IComPorts device for this PortDeviceKey. Key "controlSystem" will
/// return the ControlSystem object from the Global class.
/// </summary>
/// <returns>IComPorts device or null if the device is not found or does not implement IComPorts</returns>
public static IComPorts GetIComPortsDeviceFromManagedDevice(string ComPortDevKey)
{
if ((ComPortDevKey.Equals("controlSystem", System.StringComparison.OrdinalIgnoreCase)
|| ComPortDevKey.Equals("processor", System.StringComparison.OrdinalIgnoreCase))
&& Global.ControlSystem is IComPorts)
return Global.ControlSystem;
else
{
var dev = DeviceManager.GetDeviceForKey(ComPortDevKey) as IComPorts;
if (dev == null)
Debug.Console(0, "ComPortConfig: Cannot find com port device '{0}'", ComPortDevKey);
return dev;
}
}
}
/// <summary>
///
/// </summary>
public class EssentialsControlPropertiesConfig :
PepperDash.Core.ControlPropertiesConfig
{
[JsonConverter(typeof(ComSpecJsonConverter))]
public ComPort.ComPortSpec ComParams { get; set; }
public string CresnetId { get; set; }
/// <summary>
/// Attempts to provide uint conversion of string CresnetId
/// </summary>
public uint CresnetIdInt
{
get
{
try
{
return Convert.ToUInt32(CresnetId, 16);
}
catch (Exception)
{
throw new FormatException(string.Format("ERROR:Unable to convert Cresnet ID: {0} to hex. Error:\n{1}", CresnetId));
}
}
}
public string InfinetId { get; set; }
/// <summary> /// <summary>
/// Attepmts to provide uiont conversion of string InifinetId /// Attepmts to provide uiont conversion of string InifinetId
/// </summary> /// </summary>
@ -221,13 +221,13 @@ namespace PepperDash.Essentials.Core
throw new FormatException(string.Format("ERROR:Unable to conver Infinet ID: {0} to hex. Error:\n{1}", InfinetId)); throw new FormatException(string.Format("ERROR:Unable to conver Infinet ID: {0} to hex. Error:\n{1}", InfinetId));
} }
} }
} }
} }
public class IrControlSpec public class IrControlSpec
{ {
public string PortDeviceKey { get; set; } public string PortDeviceKey { get; set; }
public uint PortNumber { get; set; } public uint PortNumber { get; set; }
public string File { get; set; } public string File { get; set; }
} }
} }

View file

@ -1,5 +1,6 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using Crestron.SimplSharp.CrestronIO;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -12,8 +13,14 @@ namespace PepperDash.Essentials.Core.Config
/// <summary> /// <summary>
/// Loads the ConfigObject from the file /// Loads the ConfigObject from the file
/// </summary> /// </summary>
public class ConfigReader public class ConfigReader
{ {
public const string LocalConfigPresent =
@"
***************************************************
************* Using Local config file *************
***************************************************";
public static EssentialsConfig ConfigObject { get; private set; } public static EssentialsConfig ConfigObject { get; private set; }
public static bool LoadConfig2() public static bool LoadConfig2()
@ -40,10 +47,10 @@ namespace PepperDash.Essentials.Core.Config
"****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****"); "****Error: Multiple Local Configuration files present. Please ensure only a single file exists and reset program.****");
return false; return false;
} }
else if(configFiles.Length == 1) if(configFiles.Length == 1)
{ {
localConfigFound = true; localConfigFound = true;
Debug.Console(0, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
} }
} }
else else
@ -91,7 +98,13 @@ namespace PepperDash.Essentials.Core.Config
} }
// Get the actual file path // Get the actual file path
filePath = configFiles[0].FullName; filePath = configFiles[0].FullName;
// Generate debug statement if using a local file.
if (localConfigFound)
{
GetLocalFileMessage(filePath);
}
// Read the file // Read the file
using (StreamReader fs = new StreamReader(filePath)) using (StreamReader fs = new StreamReader(filePath))
@ -177,7 +190,65 @@ namespace PepperDash.Essentials.Core.Config
{ {
var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase)); var dev = ConfigObject.Devices.FirstOrDefault(d => d.Key.Equals(key, StringComparison.OrdinalIgnoreCase));
return dev == null ? null : dev.Group; return dev == null ? null : dev.Group;
} }
private static void GetLocalFileMessage(string filePath)
{
var filePathLength = filePath.Length + 2;
var debugStringWidth = filePathLength + 12;
if (debugStringWidth < 51)
{
debugStringWidth = 51;
}
var qualifier = (filePathLength % 2 != 0)
? " Using Local Config File "
: " Using Local Config File ";
var bookend1 = (debugStringWidth - qualifier.Length) / 2;
var bookend2 = (debugStringWidth - filePathLength) / 2;
var newDebugString = new StringBuilder()
.Append(CrestronEnvironment.NewLine)
// Line 1
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 2
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 3
.Append(new string('*', 2))
.Append(new string(' ', debugStringWidth - 4))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 4
.Append(new string('*', 2))
.Append(new string(' ', bookend1 - 2))
.Append(qualifier)
.Append(new string(' ', bookend1 - 2))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 5
.Append(new string('*', 2))
.Append(new string(' ', bookend2 - 2))
.Append(" " + filePath + " ")
.Append(new string(' ', bookend2 - 2))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 6
.Append(new string('*', 2))
.Append(new string(' ', debugStringWidth - 4))
.Append(new string('*', 2))
.Append(CrestronEnvironment.NewLine)
// Line 7
.Append(new string('*', debugStringWidth))
.Append(CrestronEnvironment.NewLine)
// Line 8
.Append(new string('*', debugStringWidth));
Debug.Console(2, Debug.ErrorLogLevel.Notice, "Found Local config file: '{0}'", filePath);
Debug.Console(0, newDebugString.ToString());
}
} }
} }

View file

@ -1,5 +1,5 @@
using System; using System;
using System.Collections.Generic;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection; using Crestron.SimplSharp.Reflection;
@ -81,7 +81,7 @@ namespace PepperDash.Essentials.Core.Config
// } // }
//} //}
/// <summary> /// <summary>,
/// The OS Version of the processor (Firmware Version) /// The OS Version of the processor (Firmware Version)
/// </summary> /// </summary>
[JsonProperty("osVersion")] [JsonProperty("osVersion")]
@ -92,5 +92,18 @@ namespace PepperDash.Essentials.Core.Config
// return Crestron.SimplSharp.CrestronEnvironment.OSVersion.Firmware; // return Crestron.SimplSharp.CrestronEnvironment.OSVersion.Firmware;
// } // }
//} //}
/// <summary>
/// The information gathered by the processor at runtime about it's NICs and their IP addresses.
/// </summary>
[JsonProperty("ipInfo")]
public Dictionary<short, EthernetAdapterInfo> IpInfo
{
get
{
return Global.EthernetAdapterInfoCollection;
}
}
} }
} }

View file

@ -73,21 +73,21 @@ namespace PepperDash.Essentials.Core.CrestronIO.Cards
string cardType; string cardType;
if (!_config.Cards.TryGetValue(i, out cardType)) if (!_config.Cards.TryGetValue(i, out cardType))
{ {
Debug.Console(1, this, "No card found for slot {0}", i); Debug.Console(0, this, "No card found for slot {0}", i);
continue; continue;
} }
if (String.IsNullOrEmpty(cardType)) if (String.IsNullOrEmpty(cardType))
{ {
Debug.Console(0, this, "No card specified for slot {0}", i); Debug.Console(0, this, "No card specified for slot {0}", i);
return; continue;
} }
Func<uint, C3CardControllerBase> cardBuilder; Func<uint, C3CardControllerBase> cardBuilder;
if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder)) if (!_cardDict.TryGetValue(cardType.ToLower(), out cardBuilder))
{ {
Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType); Debug.Console(0, "Unable to find factory for 3-Series card type {0}.", cardType);
return; continue;
} }
try try

View file

@ -179,7 +179,7 @@ namespace PepperDash.Essentials.Core
{ {
public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key) public static eDeviceRegistrationUnRegistrationResponse RegisterWithLogging(this GenericBase device, string key)
{ {
var result = device.Register(); var result = device.Register();
var level = result == eDeviceRegistrationUnRegistrationResponse.Success ? var level = result == eDeviceRegistrationUnRegistrationResponse.Success ?
Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error; Debug.ErrorLogLevel.Notice : Debug.ErrorLogLevel.Error;
Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result); Debug.Console(0, level, "Register device result: '{0}', type '{1}', result {2}", key, device, result);

View file

@ -0,0 +1,8 @@
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface IHasBranding
{
bool BrandingEnabled { get; }
void InitializeBranding(string roomKey);
}
}

View file

@ -0,0 +1,7 @@
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasFarEndContentStatus
{
BoolFeedback ReceivingContent { get; }
}
}

View file

@ -0,0 +1,14 @@
using PepperDash.Essentials.Core;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface IHasPhoneDialing
{
BoolFeedback PhoneOffHookFeedback { get; }
StringFeedback CallerIdNameFeedback { get; }
StringFeedback CallerIdNumberFeedback { get; }
void DialPhoneCall(string number);
void EndPhoneCall();
void SendDtmfToPhone(string digit);
}
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface ILanguageDefinition
{
string LocaleName { get; set; }
string FriendlyName { get; set; }
bool Enable { get; set; }
List<LanguageLabel> UiLabels { get; set; }
List<LanguageLabel> Sources { get; set; }
List<LanguageLabel> Destinations { get; set; }
List<LanguageLabel> SourceGroupNames { get; set; }
List<LanguageLabel> DestinationGroupNames { get; set; }
List<LanguageLabel> RoomNames { get; set; }
}
}

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public interface ILanguageProvider
{
ILanguageDefinition CurrentLanguage { get; set; }
event EventHandler CurrentLanguageChanged;
}
}

View file

@ -0,0 +1,12 @@
using PepperDash.Core;
namespace PepperDash_Essentials_Core.DeviceTypeInterfaces
{
public class LanguageLabel
{
public string Key { get; set; }
public string Description { get; set; }
public string DisplayText { get; set; }
public uint JoinNumber { get; set; }
}
}

View file

@ -0,0 +1,138 @@
using System;
using System.Collections.Generic;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config;
namespace PepperDash_Essentials_Core.Devices
{
public class GenericIrController: EssentialsBridgeableDevice
{
//data storage for bridging
private BasicTriList _trilist;
private uint _joinStart;
private string _joinMapKey;
private EiscApiAdvanced _bridge;
private readonly IrOutputPortController _port;
public string[] IrCommands {get { return _port.IrFileCommands; }}
public GenericIrController(string key, string name, IrOutputPortController irPort) : base(key, name)
{
_port = irPort;
if (_port == null)
{
Debug.Console(0, this, Debug.ErrorLogLevel.Error, "IR Port is null, device will not function");
return;
}
DeviceManager.AddDevice(_port);
_port.DriverLoaded.OutputChange += DriverLoadedOnOutputChange;
}
private void DriverLoadedOnOutputChange(object sender, FeedbackEventArgs args)
{
if (!args.BoolValue)
{
return;
}
if (_trilist == null || _bridge == null)
{
return;
}
LinkToApi(_trilist, _joinStart, _joinMapKey, _bridge);
}
#region Overrides of EssentialsBridgeableDevice
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
//if driver isn't loaded yet, store the variables until it is loaded, then call the LinkToApi method again
if (!_port.DriverIsLoaded)
{
_trilist = trilist;
_joinStart = joinStart;
_joinMapKey = joinMapKey;
_bridge = bridge;
return;
}
var joinMap = new GenericIrControllerJoinMap(joinStart);
var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);
if (!string.IsNullOrEmpty(joinMapSerialized))
joinMap = JsonConvert.DeserializeObject<GenericIrControllerJoinMap>(joinMapSerialized);
for (uint i = 0; i < _port.IrFileCommands.Length; i++)
{
var cmd = _port.IrFileCommands[i];
var joinData = new JoinDataComplete(new JoinData {JoinNumber = i, JoinSpan = 1},
new JoinMetadata
{
Description = cmd,
JoinCapabilities = eJoinCapabilities.FromSIMPL,
JoinType = eJoinType.Digital
});
joinData.SetJoinOffset(joinStart);
joinMap.Joins.Add(cmd,joinData);
trilist.SetBoolSigAction(joinData.JoinNumber, (b) => Press(cmd, b));
}
joinMap.PrintJoinMapInfo();
if (bridge != null)
{
bridge.AddJoinMap(Key, joinMap);
}
else
{
Debug.Console(0, this, "Please update config to use 'eiscapiadvanced' to get all join map features for this device.");
}
}
#endregion
public void Press(string command, bool pressRelease)
{
_port.PressRelease(command, pressRelease);
}
}
public sealed class GenericIrControllerJoinMap : JoinMapBaseAdvanced
{
public GenericIrControllerJoinMap(uint joinStart) : base(joinStart)
{
}
}
public class GenericIrControllerFactory : EssentialsDeviceFactory<GenericIrController>
{
public GenericIrControllerFactory()
{
TypeNames = new List<string> {"genericIrController"};
}
#region Overrides of EssentialsDeviceFactory<GenericIRController>
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
Debug.Console(1, "Factory Attempting to create new Generic IR Controller Device");
var irPort = IRPortHelper.GetIrOutputPortController(dc);
return new GenericIrController(dc.Key, dc.Name, irPort);
}
#endregion
}
}

View file

@ -0,0 +1,17 @@
using System.Collections.Generic;
namespace PepperDash.Essentials.Core
{
public interface IHasDspPresets
{
List<IDspPreset> Presets { get; }
void RecallPreset(IDspPreset preset);
}
public interface IDspPreset
{
string Name { get; }
}
}

View file

@ -21,6 +21,8 @@ namespace PepperDash.Essentials.Core
uint IrPortUid; uint IrPortUid;
IROutputPort IrPort; IROutputPort IrPort;
public BoolFeedback DriverLoaded { get; private set; }
public ushort StandardIrPulseTime { get; set; } public ushort StandardIrPulseTime { get; set; }
public string DriverFilepath { get; private set; } public string DriverFilepath { get; private set; }
public bool DriverIsLoaded { get; private set; } public bool DriverIsLoaded { get; private set; }
@ -35,6 +37,8 @@ namespace PepperDash.Essentials.Core
: base(key) : base(key)
{ {
//if (port == null) throw new ArgumentNullException("port"); //if (port == null) throw new ArgumentNullException("port");
DriverLoaded = new BoolFeedback(() => DriverIsLoaded);
IrPort = port; IrPort = port;
if (port == null) if (port == null)
{ {
@ -48,6 +52,7 @@ namespace PepperDash.Essentials.Core
DeviceConfig config) DeviceConfig config)
: base(key) : base(key)
{ {
DriverLoaded = new BoolFeedback(() => DriverIsLoaded);
AddPostActivationAction(() => AddPostActivationAction(() =>
{ {
IrPort = postActivationFunc(config); IrPort = postActivationFunc(config);
@ -59,7 +64,7 @@ namespace PepperDash.Essentials.Core
} }
var filePath = Global.FilePathPrefix + "ir" + Global.DirectorySeparator + config.Properties["control"]["irFile"].Value<string>(); var filePath = Global.FilePathPrefix + "ir" + Global.DirectorySeparator + config.Properties["control"]["irFile"].Value<string>();
Debug.Console(1, "*************Attemting to load IR file: {0}***************", filePath); Debug.Console(1, "*************Attempting to load IR file: {0}***************", filePath);
LoadDriver(filePath); LoadDriver(filePath);
@ -91,13 +96,15 @@ namespace PepperDash.Essentials.Core
DriverFilepath = path; DriverFilepath = path;
StandardIrPulseTime = 200; StandardIrPulseTime = 200;
DriverIsLoaded = true; DriverIsLoaded = true;
DriverLoaded.FireUpdate();
} }
catch catch
{ {
DriverIsLoaded = false; DriverIsLoaded = false;
var message = string.Format("WARNING IR Driver '{0}' failed to load", path); var message = string.Format("WARNING IR Driver '{0}' failed to load", path);
Debug.Console(0, this, message); Debug.Console(0, this, Debug.ErrorLogLevel.Error, message);
ErrorLog.Error(message); DriverLoaded.FireUpdate();
} }
} }

View file

@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash_Essentials_Core.Gateways
{
public class CenCn2Controller
{
}
}

View file

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Essentials.Core
{
public class EthernetAdapterInfo
{
public EthernetAdapterType Type { get; set; }
public bool DhcpIsOn { get; set; }
public string Hostname { get; set; }
public string MacAddress { get; set; }
public string IpAddress { get; set; }
public string Subnet { get; set; }
public string Gateway { get; set; }
public string Dns1 { get; set; }
public string Dns2 { get; set; }
public string Dns3 { get; set; }
public string Domain { get; set; }
}
}

View file

@ -1,175 +1,180 @@
using System; using System;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharp.CrestronIO; using System.Collections.Generic;
using Crestron.SimplSharp.CrestronDataStore; using Crestron.SimplSharp.CrestronIO;
using Crestron.SimplSharpPro; using Crestron.SimplSharp.CrestronDataStore;
using Crestron.SimplSharpPro;
using PepperDash.Core;
using PepperDash.Essentials.License; using PepperDash.Core;
using PepperDash.Essentials.License;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json;
using Newtonsoft.Json.Schema; using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Schema;
namespace PepperDash.Essentials.Core
{ namespace PepperDash.Essentials.Core
public static class Global {
{ public static class Global
{
public static CrestronControlSystem ControlSystem { get; set; } public static CrestronControlSystem ControlSystem { get; set; }
public static LicenseManager LicenseManager { get; set; } public static eDevicePlatform Platform { get { return CrestronEnvironment.DevicePlatform; } }
/// <summary> public static Dictionary<short, EthernetAdapterInfo> EthernetAdapterInfoCollection { get; private set; }
/// The file path prefix to the folder containing configuration files
/// </summary> public static LicenseManager LicenseManager { get; set; }
public static string FilePathPrefix { get; private set; }
/// <summary>
/// <summary> /// The file path prefix to the folder containing configuration files
/// The file path prefix to the applciation directory /// </summary>
/// </summary> public static string FilePathPrefix { get; private set; }
public static string ApplicationDirectoryPathPrefix
{ /// <summary>
get /// The file path prefix to the applciation directory
{ /// </summary>
return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory(); public static string ApplicationDirectoryPathPrefix
} {
} get
{
/// <summary> return Crestron.SimplSharp.CrestronIO.Directory.GetApplicationDirectory();
/// Returns the directory separator character based on the running OS }
/// </summary> }
public static char DirectorySeparator
{ /// <summary>
get /// Returns the directory separator character based on the running OS
{ /// </summary>
return System.IO.Path.DirectorySeparatorChar; public static char DirectorySeparator
} {
} get
{
/// <summary> return System.IO.Path.DirectorySeparatorChar;
/// Wildcarded config file name for global reference }
/// </summary> }
public const string ConfigFileName = "*configurationFile*.json";
/// <summary>
/// <summary> /// Wildcarded config file name for global reference
/// Sets the file path prefix /// </summary>
/// </summary> public const string ConfigFileName = "*configurationFile*.json";
/// <param name="prefix"></param>
public static void SetFilePathPrefix(string prefix) /// <summary>
{ /// Sets the file path prefix
FilePathPrefix = prefix; /// </summary>
} /// <param name="prefix"></param>
public static void SetFilePathPrefix(string prefix)
static string _AssemblyVersion; {
FilePathPrefix = prefix;
/// <summary> }
/// Gets the Assembly Version of Essentials
/// </summary> static string _AssemblyVersion;
/// <returns>The Assembly Version at Runtime</returns>
public static string AssemblyVersion /// <summary>
{ /// Gets the Assembly Version of Essentials
get /// </summary>
{ /// <returns>The Assembly Version at Runtime</returns>
return _AssemblyVersion; public static string AssemblyVersion
} {
private set get
{ {
_AssemblyVersion = value; return _AssemblyVersion;
} }
} private set
{
/// <summary> _AssemblyVersion = value;
/// Sets the Assembly version to the version of the Essentials Library }
/// </summary> }
/// <param name="assemblyVersion"></param>
public static void SetAssemblyVersion(string assemblyVersion) /// <summary>
{ /// Sets the Assembly version to the version of the Essentials Library
AssemblyVersion = assemblyVersion; /// </summary>
} /// <param name="assemblyVersion"></param>
public static void SetAssemblyVersion(string assemblyVersion)
/// <summary> {
/// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true. AssemblyVersion = assemblyVersion;
/// </summary> }
/// <param name="minimumVersion">Minimum specified version in format of xx.yy.zz</param>
/// <returns>Returns true if the running version meets or exceeds the minimum specified version</returns> /// <summary>
public static bool IsRunningMinimumVersionOrHigher(string minimumVersion) /// Checks to see if the running version meets or exceed the minimum specified version. For beta versions (0.xx.yy), will always return true.
{ /// </summary>
Debug.Console(2, "Comparing running version '{0}' to minimum version '{1}'", AssemblyVersion, minimumVersion); /// <param name="minimumVersion">Minimum specified version in format of xx.yy.zz</param>
/// <returns>Returns true if the running version meets or exceeds the minimum specified version</returns>
if (String.IsNullOrEmpty(minimumVersion)) public static bool IsRunningMinimumVersionOrHigher(string minimumVersion)
{ {
Debug.Console(0,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin"); Debug.Console(2, "Comparing running version '{0}' to minimum version '{1}'", AssemblyVersion, minimumVersion);
return true;
} if (String.IsNullOrEmpty(minimumVersion))
{
var runtimeVersion = Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*"); Debug.Console(0,"Plugin does not specify a minimum version. Loading plugin may not work as expected. Proceeding with loading plugin");
return true;
var runtimeVersionMajor = Int16.Parse(runtimeVersion.Groups[1].Value); }
var runtimeVersionMinor = Int16.Parse(runtimeVersion.Groups[2].Value);
var runtimeVersionBuild = Int16.Parse(runtimeVersion.Groups[3].Value); var runtimeVersion = Regex.Match(AssemblyVersion, @"^(\d*).(\d*).(\d*).*");
var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild); var runtimeVersionMajor = Int16.Parse(runtimeVersion.Groups[1].Value);
var runtimeVersionMinor = Int16.Parse(runtimeVersion.Groups[2].Value);
Version minimumVer; var runtimeVersionBuild = Int16.Parse(runtimeVersion.Groups[3].Value);
try
{ var runtimeVer = new Version(runtimeVersionMajor, runtimeVersionMinor, runtimeVersionBuild);
minimumVer = new Version(minimumVersion);
} Version minimumVer;
catch try
{ {
Debug.Console(2, "unable to parse minimum version {0}. Bypassing plugin load.", minimumVersion); minimumVer = new Version(minimumVersion);
return false; }
} catch
{
Debug.Console(2, "unable to parse minimum version {0}. Bypassing plugin load.", minimumVersion);
// Check for beta build version return false;
if (runtimeVer.Major != 0) }
{
return runtimeVer.CompareTo(minimumVer) >= 0;
} // Check for beta build version
if (runtimeVer.Major != 0)
Debug.Console(2, "Running Local Build. Bypassing Dependency Check."); {
return true; return runtimeVer.CompareTo(minimumVer) >= 0;
}
/*
var minVersion = Regex.Match(minimumVersion, @"^(\d*).(\d*).(\d*)$"); Debug.Console(2, "Running Local Build. Bypassing Dependency Check.");
return true;
if(!minVersion.Success)
{ /*
var minVersion = Regex.Match(minimumVersion, @"^(\d*).(\d*).(\d*)$");
}
if(!minVersion.Success)
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value); {
var minVersionMinor = Int16.Parse(minVersion.Groups[2].Value);
var minVersionBuild = Int16.Parse(minVersion.Groups[3].Value); }
var minVersionMajor = Int16.Parse(minVersion.Groups[1].Value);
var minVersionMinor = Int16.Parse(minVersion.Groups[2].Value);
if (minVersionMajor > runtimeVersionMajor) var minVersionBuild = Int16.Parse(minVersion.Groups[3].Value);
return false;
if (minVersionMinor > runtimeVersionMinor)
return false; if (minVersionMajor > runtimeVersionMajor)
return false;
if (minVersionBuild > runtimeVersionBuild)
return false; if (minVersionMinor > runtimeVersionMinor)
return false;
return true;
*/ if (minVersionBuild > runtimeVersionBuild)
} return false;
static Global() return true;
{ */
// Fire up CrestronDataStoreStatic }
var err = CrestronDataStoreStatic.InitCrestronDataStore();
if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS) static Global()
{ {
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err); // Fire up CrestronDataStoreStatic
return; var err = CrestronDataStoreStatic.InitCrestronDataStore();
} if (err != CrestronDataStore.CDS_ERROR.CDS_SUCCESS)
} {
CrestronConsole.PrintLine("Error starting CrestronDataStoreStatic: {0}", err);
} return;
}
}
}
} }

View file

@ -48,48 +48,39 @@
<ItemGroup> <ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.EthernetCommunications, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.EthernetCommunications.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Fusion, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Fusion.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Remotes, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Remotes.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.ThreeSeriesCards, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.ThreeSeriesCards.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
@ -98,33 +89,30 @@
</Reference> </Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpTimerEventInterface, Version=1.0.6197.20052, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpTimerEventInterface.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -158,6 +146,7 @@
<Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\SetTopBoxControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\StatusSignControllerJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" /> <Compile Include="Bridges\JoinMaps\SystemMonitorJoinMap.cs" />
<Compile Include="Bridges\JoinMaps\VideoCodecControllerJoinMap.cs" />
<Compile Include="Comm and IR\CecPortController.cs" /> <Compile Include="Comm and IR\CecPortController.cs" />
<Compile Include="Comm and IR\CommFactory.cs" /> <Compile Include="Comm and IR\CommFactory.cs" />
<Compile Include="Comm and IR\CommunicationExtras.cs" /> <Compile Include="Comm and IR\CommunicationExtras.cs" />
@ -200,11 +189,19 @@
<Compile Include="Devices\DeviceFeedbackExtensions.cs" /> <Compile Include="Devices\DeviceFeedbackExtensions.cs" />
<Compile Include="Devices\EssentialsBridgeableDevice.cs" /> <Compile Include="Devices\EssentialsBridgeableDevice.cs" />
<Compile Include="Devices\EssentialsDevice.cs" /> <Compile Include="Devices\EssentialsDevice.cs" />
<Compile Include="Devices\GenericIRController.cs" />
<Compile Include="Devices\IDspPreset.cs" />
<Compile Include="Devices\IProjectorInterfaces.cs" /> <Compile Include="Devices\IProjectorInterfaces.cs" />
<Compile Include="Devices\PC\InRoomPc.cs" /> <Compile Include="Devices\PC\InRoomPc.cs" />
<Compile Include="Devices\PC\Laptop.cs" /> <Compile Include="Devices\PC\Laptop.cs" />
<Compile Include="Devices\ReconfigurableDevice.cs" /> <Compile Include="Devices\ReconfigurableDevice.cs" />
<Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" /> <Compile Include="Devices\VolumeDeviceChangeEventArgs.cs" />
<Compile Include="DeviceTypeInterfaces\LanguageLabel.cs" />
<Compile Include="DeviceTypeInterfaces\ILanguageProvider.cs" />
<Compile Include="DeviceTypeInterfaces\IHasBranding.cs" />
<Compile Include="DeviceTypeInterfaces\ILanguageDefinition.cs" />
<Compile Include="DeviceTypeInterfaces\IHasFarEndContentStatus.cs" />
<Compile Include="DeviceTypeInterfaces\IHasPhoneDialing.cs" />
<Compile Include="DeviceTypeInterfaces\IMobileControl.cs" /> <Compile Include="DeviceTypeInterfaces\IMobileControl.cs" />
<Compile Include="Factory\DeviceFactory.cs" /> <Compile Include="Factory\DeviceFactory.cs" />
<Compile Include="Factory\IDeviceFactory.cs" /> <Compile Include="Factory\IDeviceFactory.cs" />
@ -222,8 +219,13 @@
<Compile Include="Fusion\FusionRviDataClasses.cs" /> <Compile Include="Fusion\FusionRviDataClasses.cs" />
<Compile Include="Gateways\CenRfgwController.cs" /> <Compile Include="Gateways\CenRfgwController.cs" />
<Compile Include="Gateways\EssentialsRfGatewayConfig.cs" /> <Compile Include="Gateways\EssentialsRfGatewayConfig.cs" />
<Compile Include="Global\EthernetAdapterInfo.cs" />
<Compile Include="Queues\ComsMessage.cs" />
<Compile Include="Queues\ProcessStringMessage.cs" />
<Compile Include="Queues\GenericQueue.cs" />
<Compile Include="Global\JobTimer.cs" /> <Compile Include="Global\JobTimer.cs" />
<Compile Include="Global\Scheduler.cs" /> <Compile Include="Global\Scheduler.cs" />
<Compile Include="Queues\IQueue.cs" />
<Compile Include="JoinMaps\JoinMapBase.cs" /> <Compile Include="JoinMaps\JoinMapBase.cs" />
<Compile Include="Lighting\Lighting Interfaces.cs" /> <Compile Include="Lighting\Lighting Interfaces.cs" />
<Compile Include="Lighting\LightingBase.cs" /> <Compile Include="Lighting\LightingBase.cs" />
@ -238,6 +240,7 @@
<Compile Include="Plugins\PluginLoader.cs" /> <Compile Include="Plugins\PluginLoader.cs" />
<Compile Include="Presets\PresetBase.cs" /> <Compile Include="Presets\PresetBase.cs" />
<Compile Include="Plugins\IPluginDeviceFactory.cs" /> <Compile Include="Plugins\IPluginDeviceFactory.cs" />
<Compile Include="Queues\IQueueMessage.cs" />
<Compile Include="Ramps and Increments\ActionIncrementer.cs" /> <Compile Include="Ramps and Increments\ActionIncrementer.cs" />
<Compile Include="Config\BasicConfig.cs" /> <Compile Include="Config\BasicConfig.cs" />
<Compile Include="Config\ConfigPropertiesHelpers.cs" /> <Compile Include="Config\ConfigPropertiesHelpers.cs" />
@ -313,6 +316,7 @@
<Compile Include="SmartObjects\SmartObjectDPad.cs" /> <Compile Include="SmartObjects\SmartObjectDPad.cs" />
<Compile Include="SmartObjects\SmartObjectHelperBase.cs" /> <Compile Include="SmartObjects\SmartObjectHelperBase.cs" />
<Compile Include="Routing\TieLine.cs" /> <Compile Include="Routing\TieLine.cs" />
<Compile Include="Queues\StringResponseProcessor.cs" />
<Compile Include="Timers\CountdownTimer.cs" /> <Compile Include="Timers\CountdownTimer.cs" />
<Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" /> <Compile Include="Touchpanels\CrestronTouchpanelPropertiesConfig.cs" />
<Compile Include="Touchpanels\Interfaces.cs" /> <Compile Include="Touchpanels\Interfaces.cs" />

View file

@ -0,0 +1,73 @@
using System;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// IBasicCommunication Message for IQueue
/// </summary>
public class ComsMessage : IQueueMessage
{
private readonly byte[] _bytes;
private readonly IBasicCommunication _coms;
private readonly string _string;
private readonly bool _isByteMessage;
/// <summary>
/// Constructor for a string message
/// </summary>
/// <param name="coms">IBasicCommunication to send the message</param>
/// <param name="message">Message to send</param>
public ComsMessage(IBasicCommunication coms, string message)
{
Validate(coms, message);
_coms = coms;
_string = message;
}
/// <summary>
/// Constructor for a byte message
/// </summary>
/// <param name="coms">IBasicCommunication to send the message</param>
/// <param name="message">Message to send</param>
public ComsMessage(IBasicCommunication coms, byte[] message)
{
Validate(coms, message);
_coms = coms;
_bytes = message;
_isByteMessage = true;
}
private void Validate(IBasicCommunication coms, object message)
{
if (_coms == null)
throw new ArgumentNullException("coms");
if (message == null)
throw new ArgumentNullException("message");
}
/// <summary>
/// Dispatchs the string/byte[] to the IBasicCommunication specified
/// </summary>
public void Dispatch()
{
if (_isByteMessage)
{
_coms.SendBytes(_bytes);
}
else
{
_coms.SendText(_string);
}
}
/// <summary>
/// Shows either the byte[] or string to be sent
/// </summary>
public override string ToString()
{
return _bytes != null ? _bytes.ToString() : _string;
}
}
}

View file

@ -0,0 +1,144 @@
using System;
using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// Threadsafe processing of queued items with pacing if required
/// </summary>
public class GenericQueue : IQueue<IQueueMessage>
{
private readonly string _key;
protected readonly CrestronQueue<IQueueMessage> _queue;
protected readonly Thread _worker;
protected readonly CEvent _waitHandle = new CEvent();
private readonly bool _delayEnabled;
private readonly int _delayTime;
/// <summary>
/// If the instance has been disposed.
/// </summary>
public bool Disposed { get; private set; }
/// <summary>
/// Constructor for generic queue with no pacing
/// </summary>
/// <param name="key">Key</param>
public GenericQueue(string key)
{
_key = key;
_queue = new CrestronQueue<IQueueMessage>();
_worker = new Thread(ProcessQueue, null, Thread.eThreadStartOptions.Running);
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
{
if (programEvent != eProgramStatusEventType.Stopping)
return;
Dispose();
};
}
/// <summary>
/// Constructor for generic queue with no pacing
/// </summary>
/// <param name="key">Key</param>
/// <param name="pacing">Pacing in ms between actions</param>
public GenericQueue(string key, int pacing)
: this(key)
{
_delayEnabled = pacing > 0;
_delayTime = pacing;
}
/// <summary>
/// Thread callback
/// </summary>
/// <param name="obj">The action used to process dequeued items</param>
/// <returns>Null when the thread is exited</returns>
private object ProcessQueue(object obj)
{
while (true)
{
IQueueMessage item = null;
if (_queue.Count > 0)
{
item = _queue.Dequeue();
if (item == null)
break;
}
if (item != null)
{
try
{
Debug.Console(2, this, "Processing queue item: '{0}'", item.ToString());
item.Dispatch();
if (_delayEnabled)
Thread.Sleep(_delayTime);
}
catch (Exception ex)
{
Debug.ConsoleWithLog(0, this, "Caught an exception in the Queue {0}\r{1}\r{2}", ex.Message, ex.InnerException, ex.StackTrace);
}
}
else _waitHandle.Wait();
}
return null;
}
public void Enqueue(IQueueMessage item)
{
_queue.Enqueue(item);
_waitHandle.Set();
}
/// <summary>
/// Disposes the thread and cleans up resources. Thread cannot be restarted once
/// disposed.
/// </summary>
public void Dispose()
{
Dispose(true);
CrestronEnvironment.GC.SuppressFinalize(this);
}
/// <summary>
/// Actually does the disposing. If you override this method, be sure to either call the base implementation
/// or clean up all the resources yourself.
/// </summary>
/// <param name="disposing">set to true unless called from finalizer</param>
protected void Dispose(bool disposing)
{
if (Disposed)
return;
if (disposing)
{
Enqueue(null);
_worker.Join();
_waitHandle.Close();
}
Disposed = true;
}
~GenericQueue()
{
Dispose(false);
}
/// <summary>
/// Key
/// </summary>
public string Key
{
get { return _key; }
}
}
}

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
public interface IQueue<T> : IKeyed, IDisposable where T : class
{
void Enqueue(T item);
bool Disposed { get; }
}
}

View file

@ -0,0 +1,7 @@
namespace PepperDash_Essentials_Core.Queues
{
public interface IQueueMessage
{
void Dispatch();
}
}

View file

@ -0,0 +1,44 @@
using System;
namespace PepperDash_Essentials_Core.Queues
{
/// <summary>
/// Message class for processing strings via an IQueue
/// </summary>
public class ProcessStringMessage : IQueueMessage
{
private readonly Action<string> _action;
private readonly string _message;
/// <summary>
/// Constructor
/// </summary>
/// <param name="message">Message to be processed</param>
/// <param name="action">Action to invoke on the message</param>
public ProcessStringMessage(string message, Action<string> action)
{
_message = message;
_action = action;
}
/// <summary>
/// Processes the string with the given action
/// </summary>
public void Dispatch()
{
if (_action == null || String.IsNullOrEmpty(_message))
return;
_action(_message);
}
/// <summary>
/// To string
/// </summary>
/// <returns>The current message</returns>
public override string ToString()
{
return _message ?? String.Empty;
}
}
}

View file

@ -0,0 +1,106 @@
using System;
using Crestron.SimplSharp;
using PepperDash.Core;
namespace PepperDash_Essentials_Core.Queues
{
public sealed class StringResponseProcessor : IKeyed, IDisposable
{
private readonly Action<string> _processStringAction;
private readonly IQueue<IQueueMessage> _queue;
private readonly IBasicCommunication _coms;
private readonly CommunicationGather _gather;
private StringResponseProcessor(string key, Action<string> processStringAction)
{
_processStringAction = processStringAction;
_queue = new GenericQueue(key);
CrestronEnvironment.ProgramStatusEventHandler += programEvent =>
{
if (programEvent != eProgramStatusEventType.Stopping)
return;
Dispose();
};
}
/// <summary>
/// Constructor that builds an instance and subscribes to coms TextReceived for processing
/// </summary>
/// <param name="coms">Com port to process strings from</param>
/// <param name="processStringAction">Action to process the incoming strings</param>
public StringResponseProcessor(IBasicCommunication coms, Action<string> processStringAction)
: this(coms.Key, processStringAction)
{
_coms = coms;
coms.TextReceived += OnResponseReceived;
}
/// <summary>
/// Constructor that builds an instance and subscribes to gather Line Received for processing
/// </summary>
/// <param name="gather">Gather to process strings from</param>
/// <param name="processStringAction">Action to process the incoming strings</param>
public StringResponseProcessor(CommunicationGather gather, Action<string> processStringAction)
: this(gather.Port.Key, processStringAction)
{
_gather = gather;
gather.LineReceived += OnResponseReceived;
}
private void OnResponseReceived(object sender, GenericCommMethodReceiveTextArgs args)
{
_queue.Enqueue(new ProcessStringMessage(args.Text, _processStringAction));
}
/// <summary>
/// Key
/// </summary>
public string Key
{
get { return _queue.Key; }
}
/// <summary>
/// Disposes the instance and cleans up resources.
/// </summary>
public void Dispose()
{
Dispose(true);
CrestronEnvironment.GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
{
if (Disposed)
return;
if (disposing)
{
if (_coms != null)
_coms.TextReceived -= OnResponseReceived;
if (_gather != null)
{
_gather.LineReceived -= OnResponseReceived;
_gather.Stop();
}
_queue.Dispose();
}
Disposed = true;
}
/// <summary>
/// If the instance has been disposed or not. If it has, you can not use it anymore
/// </summary>
public bool Disposed { get; private set; }
~StringResponseProcessor()
{
Dispose(false);
}
}
}

View file

@ -18,32 +18,29 @@ using PepperDash.Essentials.Core.Bridges;
namespace PepperDash.Essentials.Core namespace PepperDash.Essentials.Core
{ {
[Description("Wrapper class for all HR-Series remotes")] [Description("Wrapper class for all HR-Series remotes")]
public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback public class Hrxx0WirelessRemoteController : EssentialsBridgeableDevice, IHasFeedback, IHR52Button
{ {
private CenRfgwController _gateway; private CenRfgwController _gateway;
private GatewayBase _gatewayBase; private GatewayBase _gatewayBase;
private Hr1x0WirelessRemoteBase _remote;
private Hr1x0WirelessRemoteBase _remote;
public FeedbackCollection<Feedback> Feedbacks { get; set; } public FeedbackCollection<Feedback> Feedbacks { get; set; }
public CrestronCollection<Button> Buttons { get { return _remote.Button; } } public CrestronCollection<Button> Buttons { get { return _remote.Button; } }
private DeviceConfig _config; private DeviceConfig _config;
public Hrxx0WirelessRemoteController(string key, Func<DeviceConfig, Hr1x0WirelessRemoteBase> preActivationFunc, public Hrxx0WirelessRemoteController(string key, Func<DeviceConfig, Hr1x0WirelessRemoteBase> preActivationFunc,
DeviceConfig config) DeviceConfig config)
: base(key, config.Name) : base(key, config.Name)
{ {
Feedbacks = new FeedbackCollection<Feedback>(); Feedbacks = new FeedbackCollection<Feedback>();
var props = JsonConvert.DeserializeObject<CrestronRemotePropertiesConfig>(config.Properties.ToString()); var props = JsonConvert.DeserializeObject<CrestronRemotePropertiesConfig>(config.Properties.ToString());
var type = config.Type;
var rfId = (uint)props.Control.InfinetIdInt;
_config = config; _config = config;
if (props.GatewayDeviceKey == "processor") if (props.GatewayDeviceKey == "processor")
@ -128,7 +125,20 @@ namespace PepperDash.Essentials.Core
if (handler is Action<bool>) if (handler is Action<bool>)
{ {
(handler as Action<bool>)(args.Button.State == eButtonState.Pressed ? true : false); (handler as Action<bool>)(args.Button.State == eButtonState.Pressed ? true : false);
} }
var newHandler = ButtonStateChange;
if (ButtonStateChange != null)
{
newHandler(device, args);
}
var newerHandler = EssentialsButtonStateChange;
if (EssentialsButtonStateChange != null)
{
newerHandler(this, args);
}
} }
catch (Exception e) catch (Exception e)
{ {
@ -312,6 +322,504 @@ namespace PepperDash.Essentials.Core
public void SetTrilistBool(BasicTriList trilist, uint join, bool b) public void SetTrilistBool(BasicTriList trilist, uint join, bool b)
{ {
trilist.BooleanInput[join].BoolValue = b; trilist.BooleanInput[join].BoolValue = b;
} }
#region IHR52Button Members
public Button Custom9
{
get
{
var localRemote = (IHR52Button) _remote;
return localRemote == null ? null : localRemote.Custom9;
}
}
public Button Favorite
{
get
{
var localRemote = (IHR52Button)_remote;
return localRemote == null ? null : localRemote.Favorite;
}
}
public Button Home
{
get
{
var localRemote = (IHR52Button)_remote;
return localRemote == null ? null : localRemote.Home;
}
}
#endregion
#region IHR49Button Members
public Button Clear
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Clear;
}
}
public Button Custom5
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom5;
}
}
public Button Custom6
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom6;
}
}
public Button Custom7
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom7;
}
}
public Button Custom8
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Custom8;
}
}
public Button Enter
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Enter;
}
}
public Button Keypad0
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad0;
}
}
public Button Keypad1
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad1;
}
}
public Button Keypad2Abc
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad2Abc;
}
}
public Button Keypad3Def
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad3Def;
}
}
public Button Keypad4Ghi
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad4Ghi;
}
}
public Button Keypad5Jkl
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad5Jkl;
}
}
public Button Keypad6Mno
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad6Mno;
}
}
public Button Keypad7Pqrs
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad7Pqrs;
}
}
public Button Keypad8Tuv
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad8Tuv;
}
}
public Button Keypad9Wxyz
{
get
{
var localRemote = (IHR49Button)_remote;
return localRemote == null ? null : localRemote.Keypad9Wxyz;
}
}
#endregion
#region IHR33Button Members
public Button Blue
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Blue;
}
}
public Button ChannelDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.ChannelDown;
}
}
public Button ChannelUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.ChannelUp;
}
}
public Button Custom1
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom1;
}
}
public Button Custom2
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom2;
}
}
public Button Custom3
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom3;
}
}
public Button Custom4
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Custom4;
}
}
public Button DialPadDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadDown;
}
}
public Button DialPadEnter
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadEnter;
}
}
public Button DialPadLeft
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadLeft;
}
}
public Button DialPadRight
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadRight;
}
}
public Button DialPadUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.DialPadUp;
}
}
public Button Dvr
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Dvr;
}
}
public Button Exit
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Exit;
}
}
public Button FastForward
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.FastForward;
}
}
public Button Green
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Green;
}
}
public Button Guide
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Blue;
}
}
public Button Information
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Information;
}
}
public Button Last
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Last;
}
}
public Button Menu
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Menu;
}
}
public Button Mute
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Mute;
}
}
public Button NextTrack
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.NextTrack;
}
}
public Button Pause
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Pause;
}
}
public Button Play
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Play;
}
}
public Button Power
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Power;
}
}
public Button PreviousTrack
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.PreviousTrack;
}
}
public Button Record
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Record;
}
}
public Button Red
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Red;
}
}
public Button Rewind
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Rewind;
}
}
public Button Stop
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Stop;
}
}
public Button VolumeDown
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.VolumeDown;
}
}
public Button VolumeUp
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.VolumeUp;
}
}
public Button Yellow
{
get
{
var localRemote = (IHR33Button)_remote;
return localRemote == null ? null : localRemote.Yellow;
}
}
#endregion
#region IButton Members
public CrestronCollection<Button> Button
{
get { return Buttons; }
}
public event ButtonEventHandler ButtonStateChange;
public delegate void EssentialsButtonEventHandler(EssentialsDevice device, ButtonEventArgs args);
public event EssentialsButtonEventHandler EssentialsButtonStateChange;
#endregion
} }
} }

View file

@ -251,6 +251,12 @@ namespace PepperDash.Essentials.Core
tl.StringInput[sigNum].StringValue = value; tl.StringInput[sigNum].StringValue = value;
} }
public static void SetString(this BasicTriList tl, uint sigNum, string value, eStringEncoding encoding)
{
tl.StringInput[sigNum].StringEncoding = encoding;
tl.StringInput[sigNum].StringValue = value;
}
/// <summary> /// <summary>
/// Returns bool value of trilist sig /// Returns bool value of trilist sig
/// </summary> /// </summary>

View file

@ -118,7 +118,10 @@ namespace PepperDash.Essentials.DM
OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>(); OutputEndpointOnlineFeedbacks = new Dictionary<uint, BoolFeedback>();
Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count); Debug.Console(1, this, "{0} Switcher Inputs Present.", Dmps.SwitcherInputs.Count);
Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count); Debug.Console(1, this, "{0} Switcher Outputs Present.", Dmps.SwitcherOutputs.Count);
Debug.Console(1, this, "{0} Inputs in ControlSystem", Dmps.NumberOfSwitcherInputs);
Debug.Console(1, this, "{0} Outputs in ControlSystem", Dmps.NumberOfSwitcherOutputs);
SetupOutputCards(); SetupOutputCards();
@ -128,32 +131,50 @@ namespace PepperDash.Essentials.DM
public override bool CustomActivate() public override bool CustomActivate()
{ {
// Set input and output names from config // Set input and output names from config
if (InputNames != null) SetInputNames();
{
foreach (var kvp in InputNames) SetOutputNames();
{
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if (input != null)
input.Name.StringValue = kvp.Value;
}
}
if (OutputNames != null)
{
foreach (var kvp in OutputNames)
{
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if (output != null)
output.Name.StringValue = kvp.Value;
}
}
// Subscribe to events // Subscribe to events
Dmps.DMInputChange += new DMInputEventHandler(Dmps_DMInputChange); Dmps.DMInputChange += Dmps_DMInputChange;
Dmps.DMOutputChange += new DMOutputEventHandler(Dmps_DMOutputChange); Dmps.DMOutputChange += Dmps_DMOutputChange;
return base.CustomActivate(); return base.CustomActivate();
} }
private void SetOutputNames()
{
if (OutputNames == null)
{
return;
}
foreach (var kvp in OutputNames)
{
var output = (Dmps.SwitcherOutputs[kvp.Key] as DMOutput);
if (output != null && output.Name.Type != eSigType.NA)
{
output.Name.StringValue = kvp.Value;
}
}
}
private void SetInputNames()
{
if (InputNames == null)
{
return;
}
foreach (var kvp in InputNames)
{
var input = (Dmps.SwitcherInputs[kvp.Key] as DMInput);
if (input != null && input.Name.Type != eSigType.NA)
{
input.Name.StringValue = kvp.Value;
}
}
}
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge) public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{ {
var joinMap = new DmpsRoutingControllerJoinMap(joinStart); var joinMap = new DmpsRoutingControllerJoinMap(joinStart);
@ -175,171 +196,197 @@ namespace PepperDash.Essentials.DM
Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X")); Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));
// Link up outputs // Link up outputs
for (uint i = 1; i <= Dmps.NumberOfSwitcherInputs; i++) LinkInputsToApi(trilist, joinMap);
{
Debug.Console(2, this, "Linking Input Card {0}", i);
var ioSlot = i; LinkOutputsToApi(trilist, joinMap);
var ioSlotJoin = ioSlot - 1; }
//if (TxDictionary.ContainsKey(ioSlot)) private void LinkOutputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
//{ {
// Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot); for (uint i = 1; i <= Dmps.SwitcherOutputs.Count; i++)
// var TxKey = TxDictionary[ioSlot]; {
// var TxDevice = DeviceManager.GetDeviceForKey(TxKey) as DmTxControllerBase; Debug.Console(2, this, "Linking Output Card {0}", i);
// //TxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
// // TxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
// // trilist.SetUShortSigAction((ApiMap.HdcpSupport[ioSlot]), u => TxDevice.SetHdcpSupportAll((ePdtHdcpSupport)(u)));
// // TxDevice.HdcpSupportAllFeedback.LinkInputSig(trilist.UShortInput[joinMap. + ioSlot]);
// // trilist.UShortInput[ApiMap.HdcpSupportCapability[ioSlot]].UShortValue = TxDevice.HdcpSupportCapability;
//}
//else
//{
// // dmChassis.VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[ApiMap.TxVideoSyncStatus[ioSlot]]);
//}
if (VideoInputSyncFeedbacks[ioSlot] != null)
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
if (InputNameFeedbacks[ioSlot] != null)
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, new Action<string>(s =>
{
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
if (inputCard != null)
{
if (inputCard.NameFeedback != null && !string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) && inputCard.NameFeedback.StringValue != s)
if (inputCard.Name != null)
inputCard.Name.StringValue = s;
}
}));
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
for (uint i = 1; i <= Dmps.NumberOfSwitcherOutputs; i++)
{
Debug.Console(2, this, "Linking Output Card {0}", i);
var ioSlot = i; var ioSlot = i;
var ioSlotJoin = ioSlot - 1; var ioSlotJoin = ioSlot - 1;
// Control // Control
trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video)); trilist.SetUShortSigAction(joinMap.OutputVideo.JoinNumber + ioSlotJoin,
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio)); o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));
trilist.SetUShortSigAction(joinMap.OutputAudio.JoinNumber + ioSlotJoin,
o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Audio));
trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s => trilist.SetStringSigAction(joinMap.OutputNames.JoinNumber + ioSlotJoin, s =>
{ {
var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput; var outputCard = Dmps.SwitcherOutputs[ioSlot] as DMOutput;
//Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot); //Debug.Console(2, dmpsRouter, "Output Name String Sig Action for Output Card {0}", ioSlot);
if (outputCard != null) if (outputCard == null)
{ {
//Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType); return;
}
if (!(outputCard is Card.Dmps3CodecOutput) && outputCard.NameFeedback != null) //Debug.Console(2, dmpsRouter, "Card Type: {0}", outputCard.CardInputOutputType);
{
if (!string.IsNullOrEmpty(outputCard.NameFeedback.StringValue)) if (outputCard is Card.Dmps3CodecOutput || outputCard.NameFeedback == null)
{ {
//Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue); return;
}
if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null) if (string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{ {
outputCard.Name.StringValue = s; return;
} }
} //Debug.Console(2, dmpsRouter, "NameFeedabck: {0}", outputCard.NameFeedback.StringValue);
}
} if (outputCard.NameFeedback.StringValue != s && outputCard.Name != null)
}); {
outputCard.Name.StringValue = s;
// Feedback }
});
// Feedback
if (VideoOutputFeedbacks[ioSlot] != null) if (VideoOutputFeedbacks[ioSlot] != null)
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]); {
VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo.JoinNumber + ioSlotJoin]);
}
if (AudioOutputFeedbacks[ioSlot] != null) if (AudioOutputFeedbacks[ioSlot] != null)
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]); {
AudioOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputAudio.JoinNumber + ioSlotJoin]);
}
if (OutputNameFeedbacks[ioSlot] != null) if (OutputNameFeedbacks[ioSlot] != null)
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]); {
OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames.JoinNumber + ioSlotJoin]);
}
if (OutputVideoRouteNameFeedbacks[ioSlot] != null) if (OutputVideoRouteNameFeedbacks[ioSlot] != null)
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]); {
OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(
trilist.StringInput[joinMap.OutputCurrentVideoInputNames.JoinNumber + ioSlotJoin]);
}
if (OutputAudioRouteNameFeedbacks[ioSlot] != null) if (OutputAudioRouteNameFeedbacks[ioSlot] != null)
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]); {
OutputAudioRouteNameFeedbacks[ioSlot].LinkInputSig(
trilist.StringInput[joinMap.OutputCurrentAudioInputNames.JoinNumber + ioSlotJoin]);
}
if (OutputEndpointOnlineFeedbacks[ioSlot] != null) if (OutputEndpointOnlineFeedbacks[ioSlot] != null)
OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]); {
} OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
} trilist.BooleanInput[joinMap.OutputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
}
private void LinkInputsToApi(BasicTriList trilist, DmpsRoutingControllerJoinMap joinMap)
{
for (uint i = 1; i <= Dmps.SwitcherInputs.Count; i++)
{
Debug.Console(2, this, "Linking Input Card {0}", i);
var ioSlot = i;
var ioSlotJoin = ioSlot - 1;
if (VideoInputSyncFeedbacks[ioSlot] != null)
{
VideoInputSyncFeedbacks[ioSlot].LinkInputSig(
trilist.BooleanInput[joinMap.VideoSyncStatus.JoinNumber + ioSlotJoin]);
}
if (InputNameFeedbacks[ioSlot] != null)
{
InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames.JoinNumber + ioSlotJoin]);
}
trilist.SetStringSigAction(joinMap.InputNames.JoinNumber + ioSlotJoin, s =>
{
var inputCard = Dmps.SwitcherInputs[ioSlot] as DMInput;
if (inputCard == null)
{
return;
}
if (inputCard.NameFeedback == null || string.IsNullOrEmpty(inputCard.NameFeedback.StringValue) ||
inputCard.NameFeedback.StringValue == s)
{
return;
}
if (inputCard.Name != null)
{
inputCard.Name.StringValue = s;
}
});
if (InputEndpointOnlineFeedbacks[ioSlot] != null)
{
InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(
trilist.BooleanInput[joinMap.InputEndpointOnline.JoinNumber + ioSlotJoin]);
}
}
}
/// <summary> /// <summary>
/// Iterate the SwitcherOutputs collection to setup feedbacks and add routing ports /// Iterate the SwitcherOutputs collection to setup feedbacks and add routing ports
/// </summary> /// </summary>
void SetupOutputCards() void SetupOutputCards()
{ {
foreach (var card in Dmps.SwitcherOutputs) foreach (var card in Dmps.SwitcherOutputs)
{ {
Debug.Console(1, this, "Output Card Type: {0}", card.CardInputOutputType);
var outputCard = card as DMOutput;
var outputCard = card as DMOutput;
if (outputCard == null)
{
Debug.Console(1, this, "Output card {0} is not a DMOutput", card.CardInputOutputType);
continue;
}
Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString()); Debug.Console(1, this, "Adding Output Card Number {0} Type: {1}", outputCard.Number, outputCard.CardInputOutputType.ToString());
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
if (outputCard != null)
{ {
VideoOutputFeedbacks[outputCard.Number] = new IntFeedback(() => if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; }
{ return 0;
if (outputCard.VideoOutFeedback != null) { return (ushort)outputCard.VideoOutFeedback.Number; } ;
else { return 0; }; });
}); AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() =>
AudioOutputFeedbacks[outputCard.Number] = new IntFeedback(() => {
{ if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; }
if (outputCard.AudioOutFeedback != null) { return (ushort)outputCard.AudioOutFeedback.Number; } return 0;
else { return 0; }; ;
}); });
OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() => OutputNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue))
{ {
if (outputCard.NameFeedback != null && !string.IsNullOrEmpty(outputCard.NameFeedback.StringValue)) Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue);
{ return outputCard.NameFeedback.StringValue;
Debug.Console(2, this, "Output Card {0} Name: {1}", outputCard.Number, outputCard.NameFeedback.StringValue); }
return outputCard.NameFeedback.StringValue; return "";
} });
else
{
return "";
}
});
OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() => OutputVideoRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{
if (outputCard.VideoOutFeedback != null && outputCard.VideoOutFeedback.NameFeedback != null)
{ {
if (outputCard.VideoOutFeedback != null && outputCard.VideoOutFeedback.NameFeedback != null) return outputCard.VideoOutFeedback.NameFeedback.StringValue;
{ }
return outputCard.VideoOutFeedback.NameFeedback.StringValue; return NoRouteText;
} });
else OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{ {
return NoRouteText; if (outputCard.AudioOutFeedback != null && outputCard.AudioOutFeedback.NameFeedback != null)
}
});
OutputAudioRouteNameFeedbacks[outputCard.Number] = new StringFeedback(() =>
{ {
if (outputCard.AudioOutFeedback != null && outputCard.AudioOutFeedback.NameFeedback != null) return outputCard.AudioOutFeedback.NameFeedback.StringValue;
{ }
return outputCard.AudioOutFeedback.NameFeedback.StringValue; return NoRouteText;
} });
else
{
return NoRouteText;
} OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => outputCard.EndpointOnlineFeedback);
});
OutputEndpointOnlineFeedbacks[outputCard.Number] = new BoolFeedback(() => { return outputCard.EndpointOnlineFeedback; }); AddOutputCard(outputCard.Number, outputCard);
AddOutputCard(outputCard.Number, outputCard);
}
} }
} }
@ -494,18 +541,23 @@ namespace PepperDash.Essentials.DM
var cecPort = hdmiOutputCard.HdmiOutputPort; var cecPort = hdmiOutputCard.HdmiOutputPort;
AddHdmiOutputPort(number, cecPort); AddHdmiOutputPort(number, cecPort);
}
return; else if (outputCard is Card.Dmps3HdmiOutputBackend)
{
var hdmiOutputCard = outputCard as Card.Dmps3HdmiOutputBackend;
var cecPort = hdmiOutputCard.HdmiOutputPort;
AddHdmiOutputPort(number, cecPort);
} }
else if (outputCard is Card.Dmps3DmOutput) else if (outputCard is Card.Dmps3DmOutput)
{ {
var dmOutputCard = outputCard as Card.Dmps3DmOutput; AddDmOutputPort(number);
}
var cecPort = dmOutputCard.DmOutputPort; else if (outputCard is Card.Dmps3DmOutputBackend)
{
AddDmOutputPort(number); AddDmOutputPort(number);
return;
} }
else if (outputCard is Card.Dmps3ProgramOutput) else if (outputCard is Card.Dmps3ProgramOutput)
{ {
@ -513,50 +565,51 @@ namespace PepperDash.Essentials.DM
var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); var programOutput = new DmpsAudioOutputController(string.Format("processor-programAudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
DeviceManager.AddDevice(programOutput); DeviceManager.AddDevice(programOutput);
return;
} }
else if (outputCard is Card.Dmps3AuxOutput) else if (outputCard is Card.Dmps3AuxOutput)
{ {
if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux1Output) switch (outputCard.CardInputOutputType)
{ {
AddAudioOnlyOutputPort(number, "Aux1"); case eCardInputOutputType.Dmps3Aux1Output:
{
AddAudioOnlyOutputPort(number, "Aux1");
var aux1Output = new DmpsAudioOutputController(string.Format("processor-aux1AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); var aux1Output = new DmpsAudioOutputController(string.Format("processor-aux1AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
DeviceManager.AddDevice(aux1Output); DeviceManager.AddDevice(aux1Output);
} }
else if (outputCard.CardInputOutputType == eCardInputOutputType.Dmps3Aux2Output) break;
{ case eCardInputOutputType.Dmps3Aux2Output:
AddAudioOnlyOutputPort(number, "Aux2"); {
AddAudioOnlyOutputPort(number, "Aux2");
var aux2Output = new DmpsAudioOutputController(string.Format("processor-aux2AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase); var aux2Output = new DmpsAudioOutputController(string.Format("processor-aux2AudioOutput"), "Program Audio Output", outputCard as Card.Dmps3OutputBase);
DeviceManager.AddDevice(aux2Output); DeviceManager.AddDevice(aux2Output);
} }
return; break;
} }
else if (outputCard is Card.Dmps3CodecOutput) }
{ else if (outputCard is Card.Dmps3CodecOutput)
if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec1 {
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec1 switch (number)
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1 {
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1 case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1:
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec1) case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec1:
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString()); case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec1:
else if (number == (uint)CrestronControlSystem.eDmps300cOutputs.Codec2 AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec1.ToString());
|| number == (uint)CrestronControlSystem.eDmps3200cOutputs.Codec2 break;
|| number == (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2 case (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2:
|| number == (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2 case (uint)CrestronControlSystem.eDmps34K250COutputs.Codec2:
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Codec2) case (uint)CrestronControlSystem.eDmps3300cAecOutputs.Codec2:
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString()); AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps300cOutputs.Codec2.ToString());
return; break;
} }
}
else if (outputCard is Card.Dmps3DialerOutput) else if (outputCard is Card.Dmps3DialerOutput)
{ {
AddAudioOnlyOutputPort(number, "Dialer"); AddAudioOnlyOutputPort(number, "Dialer");
return;
} }
else if (outputCard is Card.Dmps3DigitalMixOutput) else if (outputCard is Card.Dmps3DigitalMixOutput)
{ {
@ -567,13 +620,11 @@ namespace PepperDash.Essentials.DM
if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix2 if (number == (uint)CrestronControlSystem.eDmps34K250COutputs.Mix2
|| number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2 || number == (uint)CrestronControlSystem.eDmps34K300COutputs.Mix2
|| number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2) || number == (uint)CrestronControlSystem.eDmps34K350COutputs.Mix2)
AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString()); AddAudioOnlyOutputPort(number, CrestronControlSystem.eDmps34K250COutputs.Mix2.ToString());
return;
} }
else if (outputCard is Card.Dmps3AecOutput) else if (outputCard is Card.Dmps3AecOutput)
{ {
AddAudioOnlyOutputPort(number, "Aec"); AddAudioOnlyOutputPort(number, "Aec");
return;
} }
else else
{ {

View file

@ -1,4 +1,5 @@
using System; using System;
using System.Linq;
using Crestron.SimplSharpPro; using Crestron.SimplSharpPro;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;

View file

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using Crestron.SimplSharpPro.DeviceSupport; using Crestron.SimplSharpPro.DeviceSupport;
using Crestron.SimplSharpPro.DM; using Crestron.SimplSharpPro.DM;
using Crestron.SimplSharpPro.DM.Cards;
using Crestron.SimplSharpPro.DM.Endpoints.Receivers; using Crestron.SimplSharpPro.DM.Endpoints.Receivers;
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
@ -221,6 +222,10 @@ namespace PepperDash.Essentials.DM
DmRmcPropertiesConfig props, string pKey, uint ipid) DmRmcPropertiesConfig props, string pKey, uint ipid)
{ {
var parentDev = DeviceManager.GetDeviceForKey(pKey); var parentDev = DeviceManager.GetDeviceForKey(pKey);
if (parentDev is DmpsRoutingController)
{
return GetDmRmcControllerForDmps(key, name, typeName, parentDev as DmpsRoutingController, props.ParentOutputNumber);
}
if (!(parentDev is IDmSwitch)) if (!(parentDev is IDmSwitch))
{ {
Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.", Debug.Console(0, "Cannot create DM device '{0}'. '{1}' is not a DM Chassis.",
@ -285,6 +290,28 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
private static CrestronGenericBaseDevice GetDmRmcControllerForDmps(string key, string name, string typeName,
DmpsRoutingController controller, uint num)
{
Func<string, string, DMOutput, CrestronGenericBaseDevice> dmpsHandler;
if (ChassisCpu3Dict.TryGetValue(typeName.ToLower(), out dmpsHandler))
{
var output = controller.Dmps.SwitcherOutputs[num] as DMOutput;
if (output != null)
{
return dmpsHandler(key, name, output);
}
Debug.Console(0, Debug.ErrorLogLevel.Error,
"Cannot attach DM-RMC of type '{0}' to output {1} on DMPS chassis. Output is not a DM Output.",
typeName, num);
return null;
}
Debug.Console(0, Debug.ErrorLogLevel.Error, "Cannot create DM-RMC of type '{0}' to output {1} on DMPS chassis", typeName, num);
return null;
}
private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid) private static CrestronGenericBaseDevice GetDmRmcControllerForProcessor(string key, string name, string typeName, uint ipid)
{ {
try try
@ -305,6 +332,8 @@ namespace PepperDash.Essentials.DM
return null; return null;
} }
} }
} }
public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase> public class DmRmcControllerFactory : EssentialsDeviceFactory<DmRmcControllerBase>

View file

@ -48,18 +48,15 @@
<ItemGroup> <ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DM, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DM.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.UI.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL">
@ -68,28 +65,26 @@
</Reference> </Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />

View file

@ -40,9 +40,15 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// <summary> /// <summary>
/// Tracks the directory browse history when browsing beyond the root directory /// Tracks the directory browse history when browsing beyond the root directory
/// </summary> /// </summary>
[Obsolete("Please use the Stack-based history instead")]
List<CodecDirectory> DirectoryBrowseHistory { get; } List<CodecDirectory> DirectoryBrowseHistory { get; }
} }
public interface IHasDirectoryHistoryStack : IHasDirectory
{
Stack<CodecDirectory> DirectoryBrowseHistoryStack { get; }
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -147,6 +153,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }
[JsonProperty("parentFolderId")]
public string ParentFolderId { get; set; }
} }
/// <summary> /// <summary>
@ -157,8 +166,6 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("contacts")] [JsonProperty("contacts")]
public List<DirectoryContact> Contacts { get; set; } public List<DirectoryContact> Contacts { get; set; }
[JsonProperty("parentFolderId")]
public string ParentFolderId { get; set; }
public DirectoryFolder() public DirectoryFolder()
{ {
@ -177,6 +184,8 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("title")] [JsonProperty("title")]
public string Title { get; set; } public string Title { get; set; }
[JsonProperty("contactMethods")] [JsonProperty("contactMethods")]
public List<ContactMethod> ContactMethods { get; set; } public List<ContactMethod> ContactMethods { get; set; }

View file

@ -24,24 +24,32 @@ namespace PepperDash.Essentials.Devices.Common.Codec
public class CodecScheduleAwareness public class CodecScheduleAwareness
{ {
List<Meeting> _Meetings; List<Meeting> _meetings;
public event EventHandler<MeetingEventArgs> MeetingEventChange; public event EventHandler<MeetingEventArgs> MeetingEventChange;
public event EventHandler<EventArgs> MeetingsListHasChanged; public event EventHandler<EventArgs> MeetingsListHasChanged;
/// <summary> private int _meetingWarningMinutes = 5;
public int MeetingWarningMinutes
{
get { return _meetingWarningMinutes; }
set { _meetingWarningMinutes = value; }
}
/// <summary>
/// Setter triggers MeetingsListHasChanged event /// Setter triggers MeetingsListHasChanged event
/// </summary> /// </summary>
public List<Meeting> Meetings public List<Meeting> Meetings
{ {
get get
{ {
return _Meetings; return _meetings;
} }
set set
{ {
_Meetings = value; _meetings = value;
var handler = MeetingsListHasChanged; var handler = MeetingsListHasChanged;
if (handler != null) if (handler != null)
@ -51,13 +59,20 @@ namespace PepperDash.Essentials.Devices.Common.Codec
} }
} }
private CTimer ScheduleChecker; private CTimer _scheduleChecker;
public CodecScheduleAwareness() public CodecScheduleAwareness()
{ {
Meetings = new List<Meeting>(); Meetings = new List<Meeting>();
ScheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000); _scheduleChecker = new CTimer(CheckSchedule, null, 1000, 1000);
}
public CodecScheduleAwareness(long pollTime)
{
Meetings = new List<Meeting>();
_scheduleChecker = new CTimer(CheckSchedule, null, pollTime, pollTime);
} }
private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting) private void OnMeetingChange(eMeetingEventChangeType changeType, Meeting meeting)
@ -74,9 +89,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
// Iterate the meeting list and check if any meeting need to do anythingk // Iterate the meeting list and check if any meeting need to do anythingk
const double meetingTimeEpsilon = 0.0001; const double meetingTimeEpsilon = 0.0001;
foreach (Meeting m in Meetings) foreach (var m in Meetings)
{ {
eMeetingEventChangeType changeType = eMeetingEventChangeType.Unkown; var changeType = eMeetingEventChangeType.Unkown;
if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start if (m.TimeToMeetingStart.TotalMinutes <= m.MeetingWarningMinutes.TotalMinutes) // Meeting is about to start
changeType = eMeetingEventChangeType.MeetingStartWarning; changeType = eMeetingEventChangeType.MeetingStartWarning;
@ -100,12 +115,17 @@ namespace PepperDash.Essentials.Devices.Common.Codec
/// </summary> /// </summary>
public class Meeting public class Meeting
{ {
public TimeSpan MeetingWarningMinutes = TimeSpan.FromMinutes(5); public int MinutesBeforeMeeting;
public string Id { get; set; } public string Id { get; set; }
public string Organizer { get; set; } public string Organizer { get; set; }
public string Title { get; set; } public string Title { get; set; }
public string Agenda { get; set; } public string Agenda { get; set; }
public TimeSpan MeetingWarningMinutes
{
get { return TimeSpan.FromMinutes(MinutesBeforeMeeting); }
}
public TimeSpan TimeToMeetingStart public TimeSpan TimeToMeetingStart
{ {
get get
@ -134,7 +154,7 @@ namespace PepperDash.Essentials.Devices.Common.Codec
{ {
get get
{ {
return StartTime.AddMinutes(-5) <= DateTime.Now return StartTime.AddMinutes(-MinutesBeforeMeeting) <= DateTime.Now
&& DateTime.Now <= EndTime; //.AddMinutes(-5); && DateTime.Now <= EndTime; //.AddMinutes(-5);
} }
} }

View file

@ -6,390 +6,398 @@ using Crestron.SimplSharp;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
namespace PepperDash.Essentials.Devices.Common.DSP namespace PepperDash.Essentials.Devices.Common.DSP
{ {
// QUESTIONS: // QUESTIONS:
// //
// When subscribing, just use the Instance ID for Custom Name? // When subscribing, just use the Instance ID for Custom Name?
// Verbose on subscriptions? // Verbose on subscriptions?
// Example subscription feedback responses // Example subscription feedback responses
// ! "publishToken":"name" "value":-77.0 // ! "publishToken":"name" "value":-77.0
// ! "myLevelName" -77 // ! "myLevelName" -77
public class BiampTesiraForteDsp : DspBase public class BiampTesiraForteDsp : DspBase
{ {
public IBasicCommunication Communication { get; private set; } public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; }
new public Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; } public new Dictionary<string, TesiraForteLevelControl> LevelControlPoints { get; private set; }
public bool isSubscribed; public bool isSubscribed;
private CTimer SubscriptionTimer; private CTimer SubscriptionTimer;
CrestronQueue CommandQueue; private CrestronQueue CommandQueue;
bool CommandQueueInProgress = false; private bool CommandQueueInProgress = false;
//new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; } //new public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
//new public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; } //new public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
/// <summary> /// <summary>
/// Shows received lines as hex /// Shows received lines as hex
/// </summary> /// </summary>
public bool ShowHexResponse { get; set; } public bool ShowHexResponse { get; set; }
public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm, BiampTesiraFortePropertiesConfig props) : public BiampTesiraForteDsp(string key, string name, IBasicCommunication comm,
base(key, name) BiampTesiraFortePropertiesConfig props) :
{ base(key, name)
CommandQueue = new CrestronQueue(100); {
CommandQueue = new CrestronQueue(100);
Communication = comm;
var socket = comm as ISocketStatus; Communication = comm;
if (socket != null) var socket = comm as ISocketStatus;
{ if (socket != null)
// This instance uses IP control {
// This instance uses IP control
socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
} socket.ConnectionChange += new EventHandler<GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
else }
{ else
// This instance uses RS-232 control {
} // This instance uses RS-232 control
PortGather = new CommunicationGather(Communication, "\x0d\x0a"); }
PortGather.LineReceived += this.Port_LineReceived; PortGather = new CommunicationGather(Communication, "\x0d\x0a");
if (props.CommunicationMonitorProperties != null) PortGather.LineReceived += this.Port_LineReceived;
{ if (props.CommunicationMonitorProperties != null)
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties); {
} CommunicationMonitor = new GenericCommunicationMonitor(this, Communication,
else props.CommunicationMonitorProperties);
{ }
//#warning Need to deal with this poll string else
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000, "SESSION get aliases\x0d\x0a"); {
} //#warning Need to deal with this poll string
CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 120000, 120000, 300000,
LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>(); "SESSION get aliases\x0d\x0a");
}
foreach (KeyValuePair<string, BiampTesiraForteLevelControlBlockConfig> block in props.LevelControlBlocks)
{ LevelControlPoints = new Dictionary<string, TesiraForteLevelControl>();
this.LevelControlPoints.Add(block.Key, new TesiraForteLevelControl(block.Key, block.Value, this));
} foreach (KeyValuePair<string, BiampTesiraForteLevelControlBlockConfig> block in props.LevelControlBlocks)
{
} this.LevelControlPoints.Add(block.Key, new TesiraForteLevelControl(block.Key, block.Value, this));
}
public override bool CustomActivate()
{ }
Communication.Connect();
CommunicationMonitor.StatusChange += (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); }; public override bool CustomActivate()
CommunicationMonitor.Start(); {
Communication.Connect();
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator); CommunicationMonitor.StatusChange +=
CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "", ConsoleAccessLevelEnum.AccessOperator); (o, a) => { Debug.Console(2, this, "Communication monitor state: {0}", CommunicationMonitor.Status); };
return true; CommunicationMonitor.Start();
}
CrestronConsole.AddNewConsoleCommand(SendLine, "send" + Key, "", ConsoleAccessLevelEnum.AccessOperator);
void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e) CrestronConsole.AddNewConsoleCommand(s => Communication.Connect(), "con" + Key, "",
{ ConsoleAccessLevelEnum.AccessOperator);
Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString()); return true;
}
if (e.Client.IsConnected)
{ private void socket_ConnectionChange(object sender, GenericSocketStatusChageEventArgs e)
// Tasks on connect {
} Debug.Console(2, this, "Socket Status Change: {0}", e.Client.ClientStatus.ToString());
else
{ if (e.Client.IsConnected)
// Cleanup items from this session {
// Tasks on connect
if (SubscriptionTimer != null) }
{ else
SubscriptionTimer.Stop(); {
SubscriptionTimer = null; // Cleanup items from this session
}
if (SubscriptionTimer != null)
isSubscribed = false; {
CommandQueue.Clear(); SubscriptionTimer.Stop();
CommandQueueInProgress = false; SubscriptionTimer = null;
} }
}
isSubscribed = false;
/// <summary> CommandQueue.Clear();
/// Initiates the subscription process to the DSP CommandQueueInProgress = false;
/// </summary> }
void SubscribeToAttributes() }
{
SendLine("SESSION set verbose true"); /// <summary>
/// Initiates the subscription process to the DSP
foreach (KeyValuePair<string, TesiraForteLevelControl> level in LevelControlPoints) /// </summary>
{ private void SubscribeToAttributes()
level.Value.Subscribe(); {
} SendLine("SESSION set verbose true");
if (!CommandQueueInProgress) foreach (KeyValuePair<string, TesiraForteLevelControl> level in LevelControlPoints)
SendNextQueuedCommand(); {
level.Value.Subscribe();
ResetSubscriptionTimer(); }
}
if (!CommandQueueInProgress)
/// <summary> SendNextQueuedCommand();
/// Resets or Sets the subscription timer
/// </summary> ResetSubscriptionTimer();
void ResetSubscriptionTimer() }
{
isSubscribed = true; /// <summary>
/// Resets or Sets the subscription timer
if (SubscriptionTimer != null) /// </summary>
{ private void ResetSubscriptionTimer()
SubscriptionTimer = new CTimer(o => SubscribeToAttributes(), 30000); {
SubscriptionTimer.Reset(); isSubscribed = true;
} if (SubscriptionTimer != null)
} {
SubscriptionTimer = new CTimer(o => SubscribeToAttributes(), 30000);
/// <summary> SubscriptionTimer.Reset();
/// Handles a response message from the DSP
/// </summary> }
/// <param name="dev"></param> }
/// <param name="args"></param>
void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args) /// <summary>
{ /// Handles a response message from the DSP
if (Debug.Level == 2) /// </summary>
Debug.Console(2, this, "RX: '{0}'", /// <param name="dev"></param>
ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text); /// <param name="args"></param>
private void Port_LineReceived(object dev, GenericCommMethodReceiveTextArgs args)
Debug.Console(1, this, "RX: '{0}'", args.Text); {
if (Debug.Level == 2)
try Debug.Console(2, this, "RX: '{0}'",
{ ShowHexResponse ? ComTextHelper.GetEscapedText(args.Text) : args.Text);
if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
{ Debug.Console(1, this, "RX: '{0}'", args.Text);
// Indicates a new TTP session
try
SubscribeToAttributes(); {
} if (args.Text.IndexOf("Welcome to the Tesira Text Protocol Server...") > -1)
else if (args.Text.IndexOf("publishToken") > -1) {
{ // Indicates a new TTP session
// response is from a subscribed attribute
SubscribeToAttributes();
string pattern = "! \"publishToken\":[\"](.*)[\"] \"value\":(.*)"; }
else if (args.Text.IndexOf("publishToken") > -1)
Match match = Regex.Match(args.Text, pattern); {
// response is from a subscribed attribute
if (match.Success)
{ string pattern = "! \"publishToken\":[\"](.*)[\"] \"value\":(.*)";
string key; Match match = Regex.Match(args.Text, pattern);
string customName; if (match.Success)
{
string value;
string key;
customName = match.Groups[1].Value;
string customName;
// Finds the key (everything before the '~' character
key = customName.Substring(0, customName.IndexOf("~", 0) - 1); string value;
value = match.Groups[2].Value; customName = match.Groups[1].Value;
foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints) // Finds the key (everything before the '~' character
{ key = customName.Substring(0, customName.IndexOf("~", 0) - 1);
if (customName == controlPoint.Value.LevelCustomName || customName == controlPoint.Value.MuteCustomName)
{ value = match.Groups[2].Value;
controlPoint.Value.ParseSubscriptionMessage(customName, value);
return; foreach (KeyValuePair<string, TesiraForteLevelControl> controlPoint in LevelControlPoints)
} {
if (customName == controlPoint.Value.LevelCustomName ||
} customName == controlPoint.Value.MuteCustomName)
} {
controlPoint.Value.ParseSubscriptionMessage(customName, value);
/// same for dialers return;
/// same for switchers }
} }
else if (args.Text.IndexOf("+OK") > -1) }
{
if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1 ) // Check for a simple "+OK" only 'ack' repsonse or a list response and ignore /// same for dialers
return; /// same for switchers
// response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command }
else if (args.Text.IndexOf("+OK") > -1)
if (!CommandQueue.IsEmpty) {
{ if (args.Text == "+OK" || args.Text.IndexOf("list\":") > -1)
if (CommandQueue.Peek() is QueuedCommand) // Check for a simple "+OK" only 'ack' repsonse or a list response and ignore
{ return;
// Expected response belongs to a child class
QueuedCommand tempCommand = (QueuedCommand)CommandQueue.TryToDequeue(); // response is not from a subscribed attribute. From a get/set/toggle/increment/decrement command
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
if (!CommandQueue.IsEmpty)
tempCommand.ControlPoint.ParseGetMessage(tempCommand.AttributeCode, args.Text); {
} if (CommandQueue.Peek() is QueuedCommand)
else {
{ // Expected response belongs to a child class
// Expected response belongs to this class QueuedCommand tempCommand = (QueuedCommand) CommandQueue.TryToDequeue();
string temp = (string)CommandQueue.TryToDequeue(); //Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
//Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
tempCommand.ControlPoint.ParseGetMessage(tempCommand.AttributeCode, args.Text);
} }
else
if (CommandQueue.IsEmpty) {
CommandQueueInProgress = false; // Expected response belongs to this class
else string temp = (string) CommandQueue.TryToDequeue();
SendNextQueuedCommand(); //Debug.Console(1, this, "Command Dequeued. CommandQueue Size: {0}", CommandQueue.Count);
} }
if (CommandQueue.IsEmpty)
} CommandQueueInProgress = false;
else if (args.Text.IndexOf("-ERR") > -1) else
{ SendNextQueuedCommand();
// Error response
}
switch (args.Text)
{
case "-ERR ALREADY_SUBSCRIBED": }
{ else if (args.Text.IndexOf("-ERR") > -1)
ResetSubscriptionTimer(); {
break; // Error response
}
default: switch (args.Text)
{ {
Debug.Console(0, this, "Error From DSP: '{0}'", args.Text); case "-ERR ALREADY_SUBSCRIBED":
break; {
} ResetSubscriptionTimer();
} break;
}
} default:
} {
catch (Exception e) Debug.Console(0, this, "Error From DSP: '{0}'", args.Text);
{ break;
if (Debug.Level == 2) }
Debug.Console(2, this, "Error parsing response: '{0}'\n{1}", args.Text, e); }
}
}
} }
catch (Exception e)
/// <summary> {
/// Sends a command to the DSP (with delimiter appended) if (Debug.Level == 2)
/// </summary> Debug.Console(2, this, "Error parsing response: '{0}'\n{1}", args.Text, e);
/// <param name="s">Command to send</param> }
public void SendLine(string s)
{ }
Debug.Console(1, this, "TX: '{0}'", s);
Communication.SendText(s + "\x0a"); /// <summary>
} /// Sends a command to the DSP (with delimiter appended)
/// </summary>
/// <summary> /// <param name="s">Command to send</param>
/// Adds a command from a child module to the queue public void SendLine(string s)
/// </summary> {
/// <param name="command">Command object from child module</param> Debug.Console(1, this, "TX: '{0}'", s);
public void EnqueueCommand(QueuedCommand commandToEnqueue) Communication.SendText(s + "\x0a");
{ }
CommandQueue.Enqueue(commandToEnqueue);
//Debug.Console(1, this, "Command (QueuedCommand) Enqueued '{0}'. CommandQueue has '{1}' Elements.", commandToEnqueue.Command, CommandQueue.Count); /// <summary>
/// Adds a command from a child module to the queue
if(!CommandQueueInProgress) /// </summary>
SendNextQueuedCommand(); /// <param name="command">Command object from child module</param>
} public void EnqueueCommand(QueuedCommand commandToEnqueue)
{
/// <summary> CommandQueue.Enqueue(commandToEnqueue);
/// Adds a raw string command to the queue //Debug.Console(1, this, "Command (QueuedCommand) Enqueued '{0}'. CommandQueue has '{1}' Elements.", commandToEnqueue.Command, CommandQueue.Count);
/// </summary>
/// <param name="command"></param> if (!CommandQueueInProgress)
public void EnqueueCommand(string command) SendNextQueuedCommand();
{ }
CommandQueue.Enqueue(command);
//Debug.Console(1, this, "Command (string) Enqueued '{0}'. CommandQueue has '{1}' Elements.", command, CommandQueue.Count);
/// <summary>
if (!CommandQueueInProgress) /// Adds a raw string command to the queue
SendNextQueuedCommand(); /// </summary>
} /// <param name="command"></param>
public void EnqueueCommand(string command)
/// <summary> {
/// Sends the next queued command to the DSP CommandQueue.Enqueue(command);
/// </summary> //Debug.Console(1, this, "Command (string) Enqueued '{0}'. CommandQueue has '{1}' Elements.", command, CommandQueue.Count);
void SendNextQueuedCommand()
{ if (!CommandQueueInProgress)
//Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected); SendNextQueuedCommand();
}
//if (CommandQueue.IsEmpty)
// CommandQueueInProgress = false; /// <summary>
/// Sends the next queued command to the DSP
//Debug.Console(1, this, "CommandQueue has {0} Elements:\n", CommandQueue.Count); /// </summary>
private void SendNextQueuedCommand()
//foreach (object o in CommandQueue) {
//{ //Debug.Console(2, this, "Attempting to send next queued command. CommandQueueInProgress: {0} Communication isConnected: {1}", CommandQueueInProgress, Communication.IsConnected);
// if (o is string)
// Debug.Console(1, this, "{0}", o); //if (CommandQueue.IsEmpty)
// else if(o is QueuedCommand) // CommandQueueInProgress = false;
// {
// var item = (QueuedCommand)o; //Debug.Console(1, this, "CommandQueue has {0} Elements:\n", CommandQueue.Count);
// Debug.Console(1, this, "{0}", item.Command);
// } //foreach (object o in CommandQueue)
//} //{
// if (o is string)
//Debug.Console(1, this, "End of CommandQueue"); // Debug.Console(1, this, "{0}", o);
// else if(o is QueuedCommand)
if (Communication.IsConnected && !CommandQueue.IsEmpty) // {
{ // var item = (QueuedCommand)o;
CommandQueueInProgress = true; // Debug.Console(1, this, "{0}", item.Command);
// }
if (CommandQueue.Peek() is QueuedCommand) //}
{
QueuedCommand nextCommand = new QueuedCommand(); //Debug.Console(1, this, "End of CommandQueue");
nextCommand = (QueuedCommand)CommandQueue.Peek(); if (Communication.IsConnected && !CommandQueue.IsEmpty)
{
SendLine(nextCommand.Command); CommandQueueInProgress = true;
}
else if (CommandQueue.Peek() is QueuedCommand)
{ {
string nextCommand = (string)CommandQueue.Peek(); QueuedCommand nextCommand = new QueuedCommand();
SendLine(nextCommand); nextCommand = (QueuedCommand) CommandQueue.Peek();
}
} SendLine(nextCommand.Command);
}
} else
{
/// <summary> string nextCommand = (string) CommandQueue.Peek();
/// Sends a command to execute a preset
/// </summary> SendLine(nextCommand);
/// <param name="name">Preset Name</param> }
public override void RunPreset(string name) }
{
SendLine(string.Format("DEVICE recallPreset {0}", name)); }
}
/// <summary>
public class QueuedCommand /// Sends a command to execute a preset
{ /// </summary>
public string Command { get; set; } /// <param name="name">Preset Name</param>
public string AttributeCode { get; set; } public void RunPreset(string name)
public TesiraForteControlPoint ControlPoint { get; set; } {
} SendLine(string.Format("DEVICE recallPreset {0}", name));
} }
public class BiampTesiraForteDspFactory : EssentialsDeviceFactory<BiampTesiraForteDsp> public class QueuedCommand
{ {
public BiampTesiraForteDspFactory() public string Command { get; set; }
{ public string AttributeCode { get; set; }
TypeNames = new List<string>() { "biamptesira" }; public TesiraForteControlPoint ControlPoint { get; set; }
} }
}
public override EssentialsDevice BuildDevice(DeviceConfig dc)
{ public class BiampTesiraForteDspFactory : EssentialsDeviceFactory<BiampTesiraForteDsp>
Debug.Console(1, "Factory Attempting to create new BiampTesira Device"); {
var comm = CommFactory.CreateCommForDevice(dc); public BiampTesiraForteDspFactory()
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>( {
dc.Properties.ToString()); TypeNames = new List<string>() {"biamptesira"};
return new BiampTesiraForteDsp(dc.Key, dc.Name, comm, props); }
}
} public override EssentialsDevice BuildDevice(DeviceConfig dc)
{
} Debug.Console(1, "Factory Attempting to create new BiampTesira Device");
var comm = CommFactory.CreateCommForDevice(dc);
var props = Newtonsoft.Json.JsonConvert.DeserializeObject<BiampTesiraFortePropertiesConfig>(
dc.Properties.ToString());
return new BiampTesiraForteDsp(dc.Key, dc.Name, comm, props);
}
}
}

View file

@ -15,18 +15,19 @@ namespace PepperDash.Essentials.Devices.Common.DSP
public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; } public Dictionary<string, DspControlPoint> DialerControlPoints { get; private set; }
public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; } public Dictionary<string, DspControlPoint> SwitcherControlPoints { get; private set; }
public abstract void RunPreset(string name); public DspBase(string key, string name) :
base(key, name)
public DspBase(string key, string name) : {
base(key, name) { } }
// in audio call feedback // in audio call feedback
// VOIP // VOIP
// Phone dialer // Phone dialer
} }
// Fusion // Fusion

View file

@ -48,57 +48,47 @@
<ItemGroup> <ItemGroup>
<Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.DeviceSupport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.DeviceSupport.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Gateways, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Gateways.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.GeneralIO, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.GeneralIO.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="Crestron.SimplSharpPro.Lighting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="Crestron.SimplSharpPro.Lighting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SSPDevices\Crestron.SimplSharpPro.Lighting.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="mscorlib" /> <Reference Include="mscorlib" />
<Reference Include="PepperDash_Core, Version=1.0.41.31808, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="PepperDash_Core, Version=1.0.41.31808, 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>
<Reference Include="PepperDash_Essentials_Core, Version=0.0.0.22043, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Essentials Core\PepperDashEssentialsBase\bin\PepperDash_Essentials_Core.dll</HintPath>
</Reference>
<Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpCustomAttributesInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpCustomAttributesInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpHelperInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpHelperInterface.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpNewtonsoft, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpNewtonsoft.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpPro, Version=1.5.3.17, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath> <HintPath>..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpPro.exe</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL"> <Reference Include="SimplSharpReflectionInterface, Version=1.0.5583.25238, Culture=neutral, PublicKeyToken=1099c178b3b54c3b, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath> <HintPath>..\..\..\..\..\..\..\..\ProgramData\Crestron\SDK\SimplSharpReflectionInterface.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -130,6 +120,8 @@
<Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" /> <Compile Include="VideoCodec\CiscoCodec\RoomPresets.cs" />
<Compile Include="Cameras\CameraControl.cs" /> <Compile Include="Cameras\CameraControl.cs" />
<Compile Include="Display\PanasonicThDisplay.cs" /> <Compile Include="Display\PanasonicThDisplay.cs" />
<Compile Include="VideoCodec\Interfaces\IHasParticipants.cs" />
<Compile Include="VideoCodec\Interfaces\IHasSelfviewPosition.cs" />
<Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" /> <Compile Include="VideoCodec\Interfaces\iVideoCodecInfo.cs" />
<Compile Include="Codec\iHasCallFavorites.cs" /> <Compile Include="Codec\iHasCallFavorites.cs" />
<Compile Include="Codec\iHasCallHistory.cs" /> <Compile Include="Codec\iHasCallHistory.cs" />
@ -187,6 +179,12 @@
<Compile Include="VideoCodec\ZoomRoom\ZoomRoomPropertiesConfig.cs" /> <Compile Include="VideoCodec\ZoomRoom\ZoomRoomPropertiesConfig.cs" />
<None Include="Properties\ControlSystem.cfg" /> <None Include="Properties\ControlSystem.cfg" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Essentials Core\PepperDashEssentialsBase\PepperDash_Essentials_Core.csproj">
<Project>{A49AD6C8-FC0A-4CC0-9089-DFB4CF92D2B5}</Project>
<Name>PepperDash_Essentials_Core</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CompactFramework.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>

View file

@ -17,7 +17,6 @@ using PepperDash.Essentials.Core.CrestronIO;
using PepperDash.Essentials.Devices.Common; using PepperDash.Essentials.Devices.Common;
using PepperDash.Essentials.Devices.Common.DSP; using PepperDash.Essentials.Devices.Common.DSP;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.Environment; using PepperDash.Essentials.Devices.Common.Environment;
namespace PepperDash.Essentials.Devices.Common namespace PepperDash.Essentials.Devices.Common

View file

@ -5,17 +5,20 @@ using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.CrestronThread; using Crestron.SimplSharpPro.CrestronThread;
using Crestron.SimplSharpPro.DeviceSupport;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.DeviceTypeInterfaces;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Cameras; using PepperDash.Essentials.Devices.Common.Cameras;
using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.Codec;
using PepperDash.Essentials.Devices.Common.VideoCodec; using PepperDash.Essentials.Devices.Common.VideoCodec;
using PepperDash_Essentials_Core.DeviceTypeInterfaces;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
{ {
@ -25,10 +28,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory, public class CiscoSparkCodec : VideoCodecBase, IHasCallHistory, IHasCallFavorites, IHasDirectory,
IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView, IHasScheduleAwareness, IOccupancyStatusProvider, IHasCodecLayouts, IHasCodecSelfView,
ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching ICommunicationMonitor, IRouting, IHasCodecCameras, IHasCameraAutoMode, IHasCodecRoomPresets, IHasExternalSourceSwitching, IHasBranding
{ {
public event EventHandler<DirectoryEventArgs> DirectoryResultReturned; public event EventHandler<DirectoryEventArgs> DirectoryResultReturned;
private CTimer _brandingTimer;
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
public StatusMonitorBase CommunicationMonitor { get; private set; } public StatusMonitorBase CommunicationMonitor { get; private set; }
@ -401,13 +406,19 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
CreateOsdSource(); CreateOsdSource();
if (props.ExternalSourceListEnabled != null) ExternalSourceListEnabled = props.ExternalSourceListEnabled;
{
ExternalSourceListEnabled = props.ExternalSourceListEnabled; if (props.UiBranding == null)
} {
return;
}
Debug.Console(2, this, "Setting branding properties enable: {0} _brandingUrl {1}", props.UiBranding.Enable,
props.UiBranding.BrandingUrl);
BrandingEnabled = props.UiBranding.Enable;
_brandingUrl = props.UiBranding.BrandingUrl;
} }
/// <summary>
/// Runs in it's own thread to dequeue messages in the order they were received to be processed /// Runs in it's own thread to dequeue messages in the order they were received to be processed
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
@ -443,6 +454,83 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
TieLineCollection.Default.Add(tl); TieLineCollection.Default.Add(tl);
} }
public void InitializeBranding(string roomKey)
{
Debug.Console(1, this, "Initializing Branding for room {0}", roomKey);
if (!BrandingEnabled)
{
return;
}
var mcBridgeKey = String.Format("mobileControlBridge-{0}", roomKey);
var mcBridge = DeviceManager.GetDeviceForKey(mcBridgeKey) as IMobileControlRoomBridge;
if (!String.IsNullOrEmpty(_brandingUrl))
{
Debug.Console(1, this, "Branding URL found: {0}", _brandingUrl);
if (_brandingTimer != null)
{
_brandingTimer.Stop();
_brandingTimer.Dispose();
}
_brandingTimer = new CTimer((o) =>
{
if (_sendMcUrl)
{
SendMcBrandingUrl(mcBridge);
_sendMcUrl = false;
}
else
{
SendBrandingUrl();
_sendMcUrl = true;
}
}, 0, 15000);
} else if (String.IsNullOrEmpty(_brandingUrl))
{
Debug.Console(1, this, "No Branding URL found");
if (mcBridge == null) return;
Debug.Console(2, this, "Setting QR code URL: {0}", mcBridge.QrCodeUrl);
mcBridge.UserCodeChanged += (o, a) => SendMcBrandingUrl(mcBridge);
SendMcBrandingUrl(mcBridge);
}
}
private void SendMcBrandingUrl(IMobileControlRoomBridge mcBridge)
{
if (mcBridge == null)
{
return;
}
Debug.Console(1, this, "Sending url: {0}", mcBridge.QrCodeUrl);
SendText("xconfiguration userinterface custommessage: \"Scan the QR code with a mobile phone to get started\"");
SendText("xconfiguration userinterface osd halfwakemessage: \"Tap the touch panel or scan the QR code with a mobile phone to get started\"");
SendText(String.Format(
"xcommand userinterface branding fetch type: branding url: {0}",
mcBridge.QrCodeUrl));
SendText(String.Format(
"xcommand userinterface branding fetch type: halfwakebranding url: {0}",
mcBridge.QrCodeUrl));
}
private void SendBrandingUrl()
{
Debug.Console(1, this, "Sending url: {0}", _brandingUrl);
SendText(String.Format("xcommand userinterface branding fetch type: branding url: {0}",
_brandingUrl));
SendText(String.Format("xcommand userinterface branding fetch type: halfwakebranding url: {0}",
_brandingUrl));
}
/// <summary> /// <summary>
/// Starts the HTTP feedback server and syncronizes state of codec /// Starts the HTTP feedback server and syncronizes state of codec
/// </summary> /// </summary>
@ -1388,6 +1476,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
SendText("xCommand Standby Deactivate"); SendText("xCommand Standby Deactivate");
} }
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Reboots the codec /// Reboots the codec
/// </summary> /// </summary>
@ -1835,6 +1928,10 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
private set; private set;
} }
public bool BrandingEnabled { get; private set; }
private string _brandingUrl;
private bool _sendMcUrl;
/// <summary> /// <summary>
/// Adds an external source to the Cisco /// Adds an external source to the Cisco
/// </summary> /// </summary>
@ -2006,6 +2103,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.Cisco
public override EssentialsDevice BuildDevice(DeviceConfig dc) public override EssentialsDevice BuildDevice(DeviceConfig dc)
{ {
Debug.Console(1, "Factory Attempting to create new Cisco Codec Device"); Debug.Console(1, "Factory Attempting to create new Cisco Codec Device");
var comm = CommFactory.CreateCommForDevice(dc); var comm = CommFactory.CreateCommForDevice(dc);
return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm); return new VideoCodec.Cisco.CiscoSparkCodec(dc, comm);
} }

View file

@ -40,6 +40,9 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("phonebookResultsLimit")] [JsonProperty("phonebookResultsLimit")]
public uint PhonebookResultsLimit { get; set; } public uint PhonebookResultsLimit { get; set; }
[JsonProperty("UiBranding")]
public BrandingLogoProperties UiBranding { get; set; }
} }
public class SharingProperties public class SharingProperties
@ -47,4 +50,13 @@ namespace PepperDash.Essentials.Devices.Common.Codec
[JsonProperty("autoShareContentWhileInCall")] [JsonProperty("autoShareContentWhileInCall")]
public bool AutoShareContentWhileInCall { get; set; } public bool AutoShareContentWhileInCall { get; set; }
} }
public class BrandingLogoProperties
{
[JsonProperty("enable")]
public bool Enable { get; set; }
[JsonProperty("brandingUrl")]
public string BrandingUrl { get; set; }
}
} }

View file

@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces
{
public interface IHasParticipants
{
CodecParticipants Participants { get; }
}
public interface IHasParticipantVideoMute:IHasParticipants
{
void MuteVideoForParticipant(int userId);
void UnmuteVideoForParticipant(int userId);
void ToggleVideoForParticipant(int userId);
}
public interface IHasParticipantAudioMute:IHasParticipantVideoMute
{
void MuteAudioForParticipant(int userId);
void UnmuteAudioForParticipant(int userId);
void ToggleAudioForParticipant(int userId);
}
public class CodecParticipants
{
private List<Participant> _currentParticipants;
public List<Participant> CurrentParticipants {
get { return _currentParticipants; }
set
{
_currentParticipants = value;
var handler = ParticipantsListHasChanged;
if(handler == null) return;
handler(this, new EventArgs());
}
}
public event EventHandler<EventArgs> ParticipantsListHasChanged;
public CodecParticipants()
{
_currentParticipants = new List<Participant>();
}
}
public class Participant
{
public bool IsHost { get; set; }
public string Name { get; set; }
public bool CanMuteVideo { get; set; }
public bool CanUnmuteVideo { get; set; }
public bool VideoMuteFb { get; set; }
public bool AudioMuteFb { get; set; }
}
}

View file

@ -0,0 +1,14 @@
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
namespace PepperDash.Essentials.Core.DeviceTypeInterfaces
{
public interface IHasSelfviewPosition
{
StringFeedback SelfviewPipPositionFeedback { get; }
void SelfviewPipPositionSet(CodecCommandWithLabel position);
void SelfviewPipPositionToggle();
}
}

View file

@ -3,9 +3,10 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Crestron.SimplSharpPro.DeviceSupport;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core; using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Bridges;
using PepperDash.Essentials.Core.Config; using PepperDash.Essentials.Core.Config;
using PepperDash.Essentials.Core.Routing; using PepperDash.Essentials.Core.Routing;
using PepperDash.Essentials.Devices.Common.Codec; using PepperDash.Essentials.Devices.Common.Codec;
@ -226,6 +227,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
_StandbyIsOn = false; _StandbyIsOn = false;
} }
public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Called by routing to make it happen /// Called by routing to make it happen
/// </summary> /// </summary>

View file

@ -11,6 +11,7 @@ using PepperDash.Essentials.Devices.Common.Codec;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using PepperDash.Essentials.Devices.Common.VideoCodec.Interfaces;
namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
@ -57,6 +58,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public List<zStatus.AudioVideoInputOutputLineItem> AudioInputs { get; set; } public List<zStatus.AudioVideoInputOutputLineItem> AudioInputs { get; set; }
public List<zStatus.AudioVideoInputOutputLineItem> AudioOuputs { get; set; } public List<zStatus.AudioVideoInputOutputLineItem> AudioOuputs { get; set; }
public List<zStatus.AudioVideoInputOutputLineItem> Cameras { get; set; } public List<zStatus.AudioVideoInputOutputLineItem> Cameras { get; set; }
public zEvent.PhoneCallStatus PhoneCall { get; set; }
public ZoomRoomStatus() public ZoomRoomStatus()
{ {
@ -73,6 +75,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
AudioInputs = new List<zStatus.AudioVideoInputOutputLineItem>(); AudioInputs = new List<zStatus.AudioVideoInputOutputLineItem>();
AudioOuputs = new List<zStatus.AudioVideoInputOutputLineItem>(); AudioOuputs = new List<zStatus.AudioVideoInputOutputLineItem>();
Cameras = new List<zStatus.AudioVideoInputOutputLineItem>(); Cameras = new List<zStatus.AudioVideoInputOutputLineItem>();
PhoneCall = new zEvent.PhoneCallStatus();
} }
} }
@ -85,6 +88,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public zConfiguration.Audio Audio { get; set; } public zConfiguration.Audio Audio { get; set; }
public zConfiguration.Video Video { get; set; } public zConfiguration.Video Video { get; set; }
public zConfiguration.Client Client { get; set; } public zConfiguration.Client Client { get; set; }
public zConfiguration.Camera Camera { get; set; }
public ZoomRoomConfiguration() public ZoomRoomConfiguration()
{ {
@ -92,6 +96,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
Audio = new zConfiguration.Audio(); Audio = new zConfiguration.Audio();
Video = new zConfiguration.Video(); Video = new zConfiguration.Video();
Client = new zConfiguration.Client(); Client = new zConfiguration.Client();
Camera = new zConfiguration.Camera();
} }
} }
@ -255,9 +260,9 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// <returns></returns> /// <returns></returns>
public static CodecDirectory ConvertZoomContactsToGeneric(List<Contact> zoomContacts) public static CodecDirectory ConvertZoomContactsToGeneric(List<Contact> zoomContacts)
{ {
var directory = new Codec.CodecDirectory(); var directory = new CodecDirectory();
var folders = new List<Codec.DirectoryItem>(); var folders = new List<DirectoryItem>();
var roomFolder = new DirectoryFolder(); var roomFolder = new DirectoryFolder();
@ -272,9 +277,11 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
// If so, setup a rooms and contacts folder and add them. // If so, setup a rooms and contacts folder and add them.
roomFolder.Name = "Rooms"; roomFolder.Name = "Rooms";
roomFolder.ParentFolderId = "root";
roomFolder.FolderId = "rooms"; roomFolder.FolderId = "rooms";
contactFolder.Name = "Contacts"; contactFolder.Name = "Contacts";
contactFolder.ParentFolderId = "root";
contactFolder.FolderId = "contacts"; contactFolder.FolderId = "contacts";
folders.Add(roomFolder); folders.Add(roomFolder);
@ -285,21 +292,15 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
try try
{ {
if (zoomContacts.Count > 0) if (zoomContacts.Count == 0) return directory;
{ {
foreach (Contact c in zoomContacts) foreach (Contact c in zoomContacts)
{ {
var contact = new ZoomDirectoryContact(); var contact = new ZoomDirectoryContact {Name = c.ScreenName, ContactId = c.Jid};
contact.Name = c.ScreenName;
contact.ContactId = c.Jid;
if (folders.Count > 0) if (folders.Count > 0)
{ {
if (c.IsZoomRoom) contact.ParentFolderId = c.IsZoomRoom ? "rooms" : "contacts";
contact.FolderId = roomFolder.FolderId;
else
contact.FolderId = contactFolder.FolderId;
} }
contacts.Add(contact); contacts.Add(contact);
@ -371,7 +372,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public CallRecordInfo CallRecordInfo { get; set; } public CallRecordInfo CallRecordInfo { get; set; }
public zCommand.InfoResult Info { get; set; } private zCommand.InfoResult _info;
public zCommand.InfoResult Info
{
get
{
return _info;
}
set
{
_info = value;
NotifyPropertyChanged("Info");
}
}
public Call() public Call()
{ {
@ -577,7 +591,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public string meetingID { get; set; } public string meetingID { get; set; }
public string password { get; set; } public string password { get; set; }
public string meetingOption { get; set; } public string meetingOption { get; set; }
public int MeetingNumber { get; set; } public long MeetingNumber { get; set; }
public string callerName { get; set; } public string callerName { get; set; }
public string avatarURL { get; set; } public string avatarURL { get; set; }
public int lifeTime { get; set; } public int lifeTime { get; set; }
@ -688,6 +702,86 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
[JsonProperty("why_cannot_pin_share")] [JsonProperty("why_cannot_pin_share")]
public string WhyCannotPinShare { get; set; } public string WhyCannotPinShare { get; set; }
} }
public class PhoneCallStatus:NotifiableObject
{
private bool _isIncomingCall;
private string _peerDisplayName;
private string _peerNumber;
private bool _offHook;
public string CallId { get; set; }
public bool IsIncomingCall {
get { return _isIncomingCall; }
set
{
if(value == _isIncomingCall) return;
_isIncomingCall = value;
NotifyPropertyChanged("IsIncomingCall");
} }
public string PeerDisplayName
{
get { return _peerDisplayName; }
set
{
if (value == _peerDisplayName) return;
_peerDisplayName = value;
NotifyPropertyChanged("PeerDisplayName");
}
}
public string PeerNumber
{
get { return _peerNumber; }
set
{
if (value == _peerNumber) return;
_peerNumber = value;
NotifyPropertyChanged("PeerNumber");
}
}
public string PeerUri { get; set; }
private ePhoneCallStatus _status;
public ePhoneCallStatus Status
{
get { return _status; }
set
{
_status = value;
OffHook = _status == ePhoneCallStatus.PhoneCallStatus_Accepted ||
_status == ePhoneCallStatus.PhoneCallStatus_InCall ||
_status == ePhoneCallStatus.PhoneCallStatus_Init ||
_status == ePhoneCallStatus.PhoneCallStatus_Ringing;
}
}
public bool OffHook
{
get { return _offHook; }
set
{
if (value == _offHook) return;
_offHook = value;
NotifyPropertyChanged("OffHook");
}
}
}
public enum ePhoneCallStatus
{
PhoneCallStatus_Ringing,
PhoneCallStatus_Terminated,
PhoneCallStatus_Accepted,
PhoneCallStatus_InCall,
PhoneCallStatus_Init,
}
} }
/// <summary> /// <summary>
@ -701,9 +795,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public bool OptimizeVideoSharing { get; set; } public bool OptimizeVideoSharing { get; set; }
} }
public class Camera public class Camera : NotifiableObject
{ {
public bool Mute { get; set; } private bool _mute;
public bool Mute
{
get { return _mute; }
set
{
Debug.Console(1, "Camera Mute response received: {0}", value);
if (value == _mute) return;
_mute = value;
NotifyPropertyChanged("Mute");
}
}
} }
public class Microphone : NotifiableObject public class Microphone : NotifiableObject
@ -757,12 +865,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
DownLeft DownLeft
} }
public class Layout public class Layout:NotifiableObject
{ {
public bool ShareThumb { get; set; } public bool ShareThumb { get; set; }
public eLayoutStyle Style { get; set; } public eLayoutStyle Style { get; set; }
public eLayoutSize Size { get; set; } public eLayoutSize Size { get; set; }
public eLayoutPosition Position { get; set; }
private eLayoutPosition _position;
public eLayoutPosition Position {
get { return _position; }
set
{
_position = value;
NotifyPropertyChanged("Position");
} }
} }
public class Lock public class Lock
@ -831,13 +947,13 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
get get
{ {
return this._volume; return _volume;
} }
set set
{ {
if (value != _volume) if (value != _volume)
{ {
this._volume = value; _volume = value;
NotifyPropertyChanged("Volume"); NotifyPropertyChanged("Volume");
} }
} }
@ -913,7 +1029,7 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// </summary> /// </summary>
public class zCommand public class zCommand
{ {
public partial class BookingsListResult public class BookingsListResult
{ {
[JsonProperty("accessRole")] [JsonProperty("accessRole")]
public string AccessRole { get; set; } public string AccessRole { get; set; }
@ -949,8 +1065,20 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public ThirdParty ThirdParty { get; set; } public ThirdParty ThirdParty { get; set; }
} }
public static List<Meeting> GetGenericMeetingsFromBookingResult(List<BookingsListResult> bookings,
int minutesBeforeMeetingStart)
{
var rv = GetGenericMeetingsFromBookingResult(bookings);
foreach (var meeting in rv)
{
meeting.MinutesBeforeMeeting = minutesBeforeMeetingStart;
}
return rv;
}
/// <summary> /// <summary>
/// Extracts the necessary meeting values from the Cisco bookings response ans converts them to the generic class /// Extracts the necessary meeting values from the Zoom bookings response and converts them to the generic class
/// </summary> /// </summary>
/// <param name="bookings"></param> /// <param name="bookings"></param>
/// <returns></returns> /// <returns></returns>
@ -983,6 +1111,12 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public; meeting.Privacy = b.IsPrivate ? eMeetingPrivacy.Private : eMeetingPrivacy.Public;
// 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;
if (meeting.StartTime < now && meeting.EndTime < now)
{
Debug.Console(1, "Skipping meeting {0}. Meeting is in the past.", meeting.Title);
continue;
}
meetings.Add(meeting); meetings.Add(meeting);
@ -1070,6 +1204,23 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
{ {
HandStatus = new HandStatus(); HandStatus = new HandStatus();
} }
public static List<Participant> GetGenericParticipantListFromParticipantsResult(
List<ListParticipant> participants)
{
return
participants.Select(
p =>
new Participant
{
Name = p.UserName,
IsHost = p.IsHost,
CanMuteVideo = p.IsVideoCanMuteByHost,
CanUnmuteVideo = p.IsVideoCanUnmuteByHost,
AudioMuteFb = p.AudioStatusState == "AUDIO_MUTED",
VideoMuteFb = p.VideoStatusIsSending
}).ToList();
}
} }
public class CallinCountryList public class CallinCountryList

View file

@ -68,7 +68,6 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
/// <summary> /// <summary>
/// Builds the command and triggers the parent ZoomRoom to send it /// Builds the command and triggers the parent ZoomRoom to send it
/// </summary> /// </summary>
/// <param name="id"></param>
/// <param name="state"></param> /// <param name="state"></param>
/// <param name="action"></param> /// <param name="action"></param>
void SendCommand(eZoomRoomCameraState state, eZoomRoomCameraAction action) void SendCommand(eZoomRoomCameraState state, eZoomRoomCameraAction action)
@ -79,23 +78,25 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
void StartContinueTimer() void StartContinueTimer()
{ {
if(ContinueTimer == null) if (ContinueTimer == null)
ContinueTimer = new CTimer((o) => SendContinueAction(LastAction), ContinueTime); ContinueTimer = new CTimer((o) => SendContinueAction(LastAction), null, ContinueTime, ContinueTime);
} }
void SendContinueAction(eZoomRoomCameraAction action) void SendContinueAction(eZoomRoomCameraAction action)
{ {
SendCommand(eZoomRoomCameraState.Continue, action); SendCommand(eZoomRoomCameraState.Continue, action);
ContinueTimer.Reset();
} }
void StopContinueTimer() void StopContinueTimer()
{ {
if (ContinueTimer != null) if (ContinueTimer == null)
{ {
ContinueTimer.Stop(); return;
ContinueTimer.Dispose();
} }
ContinueTimer.Stop();
ContinueTimer.Dispose();
ContinueTimer = null;
} }
#region IHasCameraPtzControl Members #region IHasCameraPtzControl Members
@ -111,22 +112,26 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public void PanLeft() public void PanLeft()
{ {
if (!isMoving) if (isMoving)
{ {
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left); return;
StartContinueTimer();
isPanning = true;
} }
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Left);
StartContinueTimer();
isPanning = true;
} }
public void PanRight() public void PanRight()
{ {
if (!isMoving) if (isMoving)
{ {
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right); return;
StartContinueTimer();
isPanning = true;
} }
SendCommand(eZoomRoomCameraState.Start, eZoomRoomCameraAction.Right);
StartContinueTimer();
isPanning = true;
} }
public void PanStop() public void PanStop()

View file

@ -12,5 +12,18 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
public class ZoomRoomPropertiesConfig public class ZoomRoomPropertiesConfig
{ {
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public bool DisablePhonebookAutoDownload { get; set; }
public bool SupportsCameraAutoMode { get; set; }
public bool SupportsCameraOff { get; set; }
//if true, the layouts will be set automatically when sharing starts/ends or a call is joined
public bool AutoDefaultLayouts { get; set; }
/* This layout will be selected when Sharing starts (either from Far end or locally)*/
public string DefaultSharingLayout { get; set; }
//This layout will be selected when a call is connected and no content is being shared
public string DefaultCallLayout { get; set; }
} }
} }

@ -1 +0,0 @@
Subproject commit 18cb0c273eb8b750f657d74160ad82eff1b24bca

View file

@ -1,3 +1,3 @@
<packages> <packages>
<package id="PepperDashCore" version="1.0.41" targetFramework="net35" allowedVersions="[1.0,1.1)"/> <package id="PepperDashCore" version="1.0.42" targetFramework="net35" allowedVersions="[1.0,1.1)"/>
</packages> </packages>