/// <summary> /// Connects to the server and opens camera control /// </summary> public void Start() { if (StreamViewerControl == null) { throw new ArgumentNullException("StreamViewerControl must not be null!"); } if (StreamViewerControl.SourceInfo.CameraControl == null) { throw new ArgumentNullException("StreamViewerControl.SourceInfo.CameraControl may not be null!"); } if (StreamViewerControl.SourceInfo.CameraControl.PTZType == PTZType.Null) { throw new NotSupportedException("PTZType.Null is not supported!"); } // if(string.IsNullOrEmpty(StreamViewerControl.ServerAddress)) // { // throw new ArgumentException("StreamViewerControl.ServerAddress must not be empty!"); // } //start listening to SVC's property events _svc.PropertyChanged += new PropertyChangedEventHandler(SVC_PropertyChanged); client = FutureConcepts.Media.Client.CameraControlClients.ClientFactory.Create(StreamViewerControl.ServerAddress, StreamViewerControl.SourceInfo); client.Opened += new EventHandler(client_Opened); client.Closed += new EventHandler(client_Closed); client.PropertyChanged += new PropertyChangedEventHandler(client_PropertyChanged); client.Open(new ClientConnectRequest(StreamViewerControl.SourceInfo.SourceName)); }
/// <summary> /// Creates an instance of the plugin /// </summary> /// <param name="config">configuration information</param> /// <param name="cameraControl">owning camera control</param> public WonwooWCC261(ICameraControlClient client, Transport.ITransport transport) : base(client, transport) { _stopTimer = new Timer((x) => { SendStopCommand(null); }, null, Timeout.Infinite, Timeout.Infinite); BuildIndexingArray(); }
/// <summary> /// Performs cleanup of all event handlers and such /// </summary> private void DoCleanup() { _svc.PropertyChanged -= new PropertyChangedEventHandler(SVC_PropertyChanged); ptzFavoritesControl.SaveThumbnailImages(); Debug.WriteLine("PTZPalette.DoCleanup()"); if (client != null) { client.Opened -= new EventHandler(client_Opened); client.Closed -= new EventHandler(client_Closed); client.PropertyChanged -= new PropertyChangedEventHandler(client_PropertyChanged); client = null; } if (StreamViewerControl.PTZOverlayControl != null) { StreamViewerControl.PTZOverlayControl.MoveRequested -= new EventHandler <PTZMoveRequestEventArgs>(PTZOverlayControl_MoveRequested); StreamViewerControl.PTZOverlayControl = null; } }
public CameraControlCallback(ICameraControlClient ccc) { _ccc = ccc; }
public static ICameraControlClient Create(String serverAddress, StreamSourceInfo info) { ICameraControlClient result = null; if (info.CameraControl.PTZType == PTZType.Stacked) { StackedCameraControlClient client = new StackedCameraControlClient(); CameraControlClients.Protocol.IProtocol protocol; CameraControlClients.Transport.ITransport transport; if (info.CameraControl.Address != null) { UriBuilder uriBuilder = new UriBuilder(info.CameraControl.Address); if (uriBuilder.Scheme == "test1") { transport = new CameraControlClients.Transport.DebugTest1(info.CameraControl.Address); } else if (uriBuilder.Scheme == "vivotektunnel") { transport = new CameraControlClients.Transport.VivotekTunnel(info.CameraControl.Address); } else { throw new Exception("unknown camera control transport type"); } if (uriBuilder.Path.Contains("wca261")) { protocol = new CameraControlClients.Protocol.WonwooWCA261(client, transport); } else if (uriBuilder.Path.Contains("wcc261")) { protocol = new CameraControlClients.Protocol.WonwooWCC261(client, transport); } else { throw new Exception("unknown camera control protocol type"); } client.Protocol = protocol; CameraCapabilitiesAndLimits caps = new CameraCapabilitiesAndLimits(); caps.HasAbsoluteControls = protocol.HasAbsoluteControls; caps.HasPan = protocol.HasPan; caps.HasTilt = protocol.HasTilt; caps.HasZoom = protocol.HasZoom; caps.HasDigitalZoom = protocol.HasDigitalZoom; caps.HasEmitter = protocol.HasEmitter; caps.HasStabilizer = protocol.HasStabilizer; caps.HasInfrared = protocol.HasInfrared; caps.HasInverter = protocol.HasInverter; caps.HasWiper = protocol.HasWiper; caps.HasFocus = protocol.HasFocus; caps.PanLimitStart = protocol.PanLimitStart; caps.PanLimitAngle = protocol.PanLimitAngle; caps.PanOffset = protocol.PanOffset; caps.TiltMaxAngle = protocol.TiltMaxAngle; caps.TiltMinAngle = protocol.TiltMinAngle; caps.ZoomMaxLevel = protocol.ZoomMaxLevel; caps.ZoomMinLevel = protocol.ZoomMinLevel; caps.FieldOfView = protocol.FieldOfView; info.CameraControl.Capabilities = caps; result = client; } } else { result = new LegacyCameraControlClient(serverAddress); } return(result); }
/// <summary> /// Creates an instance of this plugin /// </summary> /// <param name="config">configuration information</param> /// <param name="cameraControl">owning camera control</param> public WonwooWCA261(ICameraControlClient client, Transport.ITransport transport) : base(client, transport) { }
/// <summary> /// Creates a new instance of the PelcoD control class /// </summary> /// <param name="cameraControl">parent camera control class that will own this plugin</param> public PelcoD(ICameraControlClient client, Transport.ITransport transport) { Debug.WriteLine("PelcoD constructor"); _client = client; _transport = transport; }