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

@@ -11,7 +11,7 @@ using Crestron.SimplSharp.Reflection;
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 CommunicationGather PortGather { get; private set; }
@@ -25,11 +25,14 @@ namespace PepperDash.Essentials.Devices.Common.Cameras
public bool PowerIsOn { get; private set; }
byte[] IncomingBuffer = new byte[] { };
public BoolFeedback PowerIsOnFeedback { get; private set; }
public BoolFeedback PowerIsOnFeedback { get; private set; }
public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
base(key, name)
{
Presets = props.Presets;
OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));
// Default to all capabilties
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 });
}
}
#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
}
}