Bringes in stashed changes to camera functions

This commit is contained in:
Neil Dorin
2019-11-26 14:27:17 -07:00
parent 84374a8af0
commit 3e9b67a1ad
10 changed files with 130 additions and 38 deletions

View File

@@ -108,6 +108,7 @@
<Reference Include="System.Data" /> <Reference Include="System.Data" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AppServer\Messengers\CameraBaseMessenger.cs" />
<Compile Include="AppServer\Messengers\ConfigMessenger.cs" /> <Compile Include="AppServer\Messengers\ConfigMessenger.cs" />
<Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" /> <Compile Include="AppServer\Messengers\Ddvc01AtcMessenger.cs" />
<Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" /> <Compile Include="AppServer\Messengers\AudioCodecBaseMessenger.cs" />

View File

@@ -4,6 +4,10 @@ using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp; using Crestron.SimplSharp;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
namespace PepperDash.Essentials.Room.Config namespace PepperDash.Essentials.Room.Config
{ {
/// <summary> /// <summary>
@@ -11,9 +15,28 @@ namespace PepperDash.Essentials.Room.Config
/// </summary> /// </summary>
public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig public class EssentialsHuddleRoomPropertiesConfig : EssentialsRoomPropertiesConfig
{ {
/// <summary>
/// The key of the default display device
/// </summary>
[JsonProperty("defaultDisplayKey")]
public string DefaultDisplayKey { get; set; } public string DefaultDisplayKey { get; set; }
/// <summary>
/// The key of the default audio device
/// </summary>
[JsonProperty("defaultAudioKey")]
public string DefaultAudioKey { get; set; } public string DefaultAudioKey { get; set; }
/// <summary>
/// The key of the source list for the room
/// </summary>
[JsonProperty("sourceListKey")]
public string SourceListKey { get; set; } public string SourceListKey { get; set; }
/// <summary>
/// The key of the default source item from the source list
/// </summary>
[JsonProperty("defaultSourceItem")]
public string DefaultSourceItem { get; set; } public string DefaultSourceItem { get; set; }
} }
} }

View File

@@ -67,36 +67,68 @@ namespace PepperDash.Essentials.Core
[JsonProperty("name")] [JsonProperty("name")]
public string Name { get; set; } public string Name { get; set; }
/// <summary>
/// Specifies and icon for the source list item
/// </summary>
[JsonProperty("icon")] [JsonProperty("icon")]
public string Icon { get; set; } public string Icon { get; set; }
/// <summary>
/// Alternate icon
/// </summary>
[JsonProperty("altIcon")] [JsonProperty("altIcon")]
public string AltIcon { get; set; } public string AltIcon { get; set; }
/// <summary>
/// Indicates if the item should be included in the source list
/// </summary>
[JsonProperty("includeInSourceList")] [JsonProperty("includeInSourceList")]
public bool IncludeInSourceList { get; set; } public bool IncludeInSourceList { get; set; }
/// <summary>
/// Used to specify the order of the items in the source list when displayed
/// </summary>
[JsonProperty("order")] [JsonProperty("order")]
public int Order { get; set; } public int Order { get; set; }
/// <summary>
/// The key of the device for volume control
/// </summary>
[JsonProperty("volumeControlKey")] [JsonProperty("volumeControlKey")]
public string VolumeControlKey { get; set; } public string VolumeControlKey { get; set; }
/// <summary>
/// The type of source list item
/// </summary>
[JsonProperty("type")] [JsonProperty("type")]
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(StringEnumConverter))]
public eSourceListItemType Type { get; set; } public eSourceListItemType Type { get; set; }
/// <summary>
/// The list of routes to execute for this source list item
/// </summary>
[JsonProperty("routeList")] [JsonProperty("routeList")]
public List<SourceRouteListItem> RouteList { get; set; } public List<SourceRouteListItem> RouteList { get; set; }
/// <summary>
/// Indicates if this source should be disabled for sharing to the far end call participants via codec content
/// </summary>
[JsonProperty("disableCodecSharing")] [JsonProperty("disableCodecSharing")]
public bool DisableCodecSharing { get; set; } public bool DisableCodecSharing { get; set; }
/// <summary>
/// Indicates if this source should be disabled for routing to a shared output
/// </summary>
[JsonProperty("disableRoutedSharing")] [JsonProperty("disableRoutedSharing")]
public bool DisableRoutedSharing { get; set; } public bool DisableRoutedSharing { get; set; }
[JsonProperty("destinations")] [JsonProperty("destinations")]
public List<eSourceListItemDestinationTypes> Destinations { get; set; } public List<eSourceListItemDestinationTypes> Destinations { get; set; }
/// <summary>
/// A means to reference a source list for this source item, in the event that this source has an input that can have sources routed to it
/// </summary>
[JsonProperty("sourceListKey")]
public string SourceListKey { get; set; }
public SourceListItem() public SourceListItem()
{ {

View File

@@ -147,6 +147,7 @@
<Compile Include="Monitoring\SystemMonitorController.cs" /> <Compile Include="Monitoring\SystemMonitorController.cs" />
<Compile Include="Microphone Privacy\MicrophonePrivacyController.cs" /> <Compile Include="Microphone Privacy\MicrophonePrivacyController.cs" />
<Compile Include="Microphone Privacy\MicrophonePrivacyControllerConfig.cs" /> <Compile Include="Microphone Privacy\MicrophonePrivacyControllerConfig.cs" />
<Compile Include="Presets\PresetBase.cs" />
<Compile Include="Ramps and Increments\ActionIncrementer.cs" /> <Compile Include="Ramps and Increments\ActionIncrementer.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" />

View File

@@ -2,13 +2,16 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Crestron.SimplSharp;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Devices.Common.Codec;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Crestron.SimplSharp;
using Crestron.SimplSharp.Reflection; using Crestron.SimplSharp.Reflection;
using PepperDash.Core;
using PepperDash.Essentials.Core;
using PepperDash.Essentials.Core.Presets;
using PepperDash.Essentials.Devices.Common.Codec;
using Newtonsoft.Json;
namespace PepperDash.Essentials.Devices.Common.Cameras namespace PepperDash.Essentials.Devices.Common.Cameras
{ {
@@ -21,8 +24,16 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
Focus = 8 Focus = 8
} }
public abstract class CameraBase : Device public abstract class CameraBase : Device, IRoutingOutputs
{ {
public eCameraControlMode ControlMode { get; protected set; }
#region IRoutingOutputs Members
public RoutingPortCollection<RoutingOutputPort> OutputPorts { get; protected set; }
#endregion
public bool CanPan public bool CanPan
{ {
get get
@@ -59,14 +70,36 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
protected eCameraCapabilities Capabilities { get; set; } protected eCameraCapabilities Capabilities { get; set; }
public CameraBase(string key, string name) : public CameraBase(string key, string name) :
base(key, name) { } base(key, name)
{
OutputPorts = new RoutingPortCollection<RoutingOutputPort>();
ControlMode = eCameraControlMode.Manual;
}
} }
public class CameraPreset : PresetBase
{
public CameraPreset(int id, string description, bool def, bool isDef)
: base(id, description, def, isDef)
{
}
}
public class CameraPropertiesConfig public class CameraPropertiesConfig
{ {
public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; } public CommunicationMonitorConfig CommunicationMonitorProperties { get; set; }
public ControlPropertiesConfig Control { get; set; } public ControlPropertiesConfig Control { get; set; }
[JsonProperty("supportsAutoMode")]
public bool SupportsAutoMode { get; set; }
[JsonProperty("supportsOffMode")]
public bool SupportsOffMode { get; set; }
[JsonProperty("presets")]
public List<CameraPreset> Presets { get; set; }
} }
} }

View File

@@ -10,8 +10,8 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
{ {
public enum eCameraControlMode public enum eCameraControlMode
{ {
Off = 0, Manual = 0,
Manual, Off,
Auto Auto
} }

View File

@@ -11,7 +11,7 @@ using Crestron.SimplSharp.Reflection;
namespace PepperDash.Essentials.Devices.Common.Cameras namespace PepperDash.Essentials.Devices.Common.Cameras
{ {
public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor public class CameraVisca : CameraBase, IHasCameraPtzControl, ICommunicationMonitor, IHasCameraPresets
{ {
public IBasicCommunication Communication { get; private set; } public IBasicCommunication Communication { get; private set; }
public CommunicationGather PortGather { get; private set; } public CommunicationGather PortGather { get; private set; }
@@ -30,6 +30,9 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) : public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
base(key, name) base(key, name)
{ {
Presets = props.Presets;
OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));
// Default to all capabilties // Default to all capabilties
Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus; Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;
@@ -206,5 +209,22 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
SendBytes(new byte[] { 0x81, 0x01, 0x04, 0x3F, 0x01, (byte)presetNumber, 0xFF }); SendBytes(new byte[] { 0x81, 0x01, 0x04, 0x3F, 0x01, (byte)presetNumber, 0xFF });
} }
} #region IHasCameraPresets Members
public event EventHandler<EventArgs> PresetsListHasChanged;
public List<CameraPreset> Presets { get; private set; }
public void PresetSelect(int preset)
{
RecallPreset(preset);
}
public void PresetStore(int preset, string description)
{
SavePreset(preset);
}
#endregion
}
} }

View File

@@ -102,6 +102,7 @@
<Compile Include="AudioCodec\MockAC\MockAcPropertiesConfig.cs" /> <Compile Include="AudioCodec\MockAC\MockAcPropertiesConfig.cs" />
<Compile Include="Cameras\CameraBase.cs" /> <Compile Include="Cameras\CameraBase.cs" />
<Compile Include="Cameras\CameraVisca.cs" /> <Compile Include="Cameras\CameraVisca.cs" />
<Compile Include="Cameras\IHasCameraPresets.cs" />
<Compile Include="Codec\eCodecCallDirection.cs" /> <Compile Include="Codec\eCodecCallDirection.cs" />
<Compile Include="Codec\eCodecCallType.cs" /> <Compile Include="Codec\eCodecCallType.cs" />
<Compile Include="Codec\eCodecCallStatus.cs" /> <Compile Include="Codec\eCodecCallStatus.cs" />

View File

@@ -7,6 +7,7 @@ using Crestron.SimplSharp;
using Newtonsoft.Json; using Newtonsoft.Json;
using PepperDash.Core; using PepperDash.Core;
using PepperDash.Essentials.Core.Presets;
using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco; using PepperDash.Essentials.Devices.Common.VideoCodec.Cisco;
namespace PepperDash.Essentials.Devices.Common.VideoCodec namespace PepperDash.Essentials.Devices.Common.VideoCodec
@@ -67,34 +68,14 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec
} }
/// <summary> /// <summary>
/// Represents a room preset on a video coded. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled. /// Represents a room preset on a video codec. Typically stores camera position(s) and video routing. Can be recalled by Far End if enabled.
/// </summary> /// </summary>
public class CodecRoomPreset public class CodecRoomPreset : PresetBase
{ {
[JsonProperty("id")]
public int ID { get; set; }
/// <summary>
/// Used to store the name of the preset
/// </summary>
[JsonProperty("description")]
public string Description { get; set; }
/// <summary>
/// Indicates if the preset is defined(stored) in the codec
/// </summary>
[JsonProperty("defined")]
public bool Defined { get; set; }
/// <summary>
/// Indicates if the preset has the capability to be defined
/// </summary>
[JsonProperty("isDefinable")]
public bool IsDefinable { get; set; }
public CodecRoomPreset(int id, string description, bool def, bool isDef) public CodecRoomPreset(int id, string description, bool def, bool isDef)
: base(id, description, def, isDef)
{ {
ID = id;
Description = description;
Defined = def;
IsDefinable = isDef;
} }
} }
} }

View File

@@ -979,8 +979,8 @@ namespace PepperDash.Essentials.Devices.Common.VideoCodec.ZoomRoom
meeting.StartTime = b.StartTime; meeting.StartTime = b.StartTime;
if (b.EndTime != null) if (b.EndTime != null)
meeting.EndTime = b.EndTime; meeting.EndTime = b.EndTime;
if (b.IsPrivate != null)
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.