/// <summary> /// Initializes a new instance of the <see cref="OpenOfficeDrawShapeManipulator"/> class. /// </summary> /// <param name="drawConnection">A connection to the Draw application. ATTENTION: doen not be null.</param> /// <param name="fbReciever">The fb reciever.</param> public OpenOfficeDrawShapeManipulator(IOoDrawConnection drawConnection, IZoomProvider zommable, IFeedbackReceiver fbReciever = null) : base(10) { feedbackReciever = fbReciever; Zoomable = zommable; if (drawConnection == null) { throw new ArgumentNullException("drawConnection", "Without any connection to the Draw application no Manipulation is possible."); } OoConnection = drawConnection; initializePatters(); loadConfiguration(); }
/// <summary> /// Initializes a new instance of the <see cref="OpenOfficeDrawShapeManipulator"/> class. /// </summary> /// <param name="drawConnection">A connection to the Draw application. ATTENTION: doen not be null.</param> /// <param name="fbReciever">The fb reciever.</param> public OpenOfficeDrawShapeManipulator(IOoDrawConnection drawConnection, IZoomProvider zommable, IFeedbackReceiver fbReciever = null) : base(10) { feedbackReciever = fbReciever; Zoomable = zommable; if (drawConnection == null) { throw new ArgumentNullException("drawConnection", "Without any connection to the Draw application no Manipulation is possible."); } OoConnection = drawConnection; initializePatters(); }
public Main() { this.InitializeComponent(); this._deviceConfigurationHelper = new DeviceConfigurationHelper(); this._deviceConfiguration = this._deviceConfigurationHelper.LoadConfig("default"); using (var dialog = new ConfigDialog(_deviceConfiguration)) { dialog.StartPosition = FormStartPosition.CenterParent; var dialogResult = dialog.ShowDialog(this); switch (dialogResult) { case DialogResult.OK: this._deviceConfiguration = dialog.DeviceConfiguration; this._deviceConfigurationHelper.SaveConfig("default", this._deviceConfiguration); break; case DialogResult.Cancel: case DialogResult.None: Task.Run(() => this.Invoke(o => o.Close())); return; } } this.Text = $"Alturos PanTilt TestUI ({Application.ProductVersion})"; this.SetConfigurationInfo(); var startPtHeadCommunication = Task.Run(() => this.StartPanTiltCommunication()); this.UpdateMousePanel(); this.panelMouseControl.MouseWheel += MouseWheelZoom; //Disable TabPage Zoom - No ZoomProvider available //this.tabControl1.TabPages.Remove(this.tabPageCameraZoom); this._zoomProvider = new MockZoomProvider(); this._zoomProvider.SetZoomAsync(0); this._zoomProvider.ZoomChanged += CameraControlZoomChanged; if (this._deviceConfiguration.CameraActive) { //Live Camera Image var url = $"http://{this._deviceConfiguration.CameraIpAddress}{this._deviceConfiguration.CameraJpegUrl}"; IVideoSource source = new JPEGStream(url); ((JPEGStream)source).FrameInterval = 200; this._videoSourcePlayer = new Accord.Controls.VideoSourcePlayer(); this._videoSourcePlayer.VideoSource = source; this._videoSourcePlayer.Start(); this._videoSourcePlayer.Dock = DockStyle.Fill; this.tabPageLiveView.Controls.Add(this._videoSourcePlayer); } else { //Visual Map this._cameraDrawEngine = new DrawEngine(4); this.UpdateCurrentImage(); this.pictureBox_CameraPos.Visible = true; } startPtHeadCommunication.Wait(); if (this._panTiltControl != null) { this.continiousMovementControl1.SetPanTiltControl(this._panTiltControl); this.fastMovementControl1.SetPanTiltControl(this._panTiltControl); this.absolutePositionControl1.SetPanTiltControl(this._panTiltControl); this._panTiltControl.PanTiltAbsolute(0, 0); } }