Esempio n. 1
0
        //public event QualityHandler OnQuality;

        #endregion

        public Calibration(Client cli)
        {
            client = cli;

            // Set default parameters
            calParams = new CalibrationParameters();
            calParams.SetDefaultParameters();
        }
Esempio n. 2
0
    ///////////////////////////////////////////////////////////////////////////////
    // Inherited methods                                                         //
    ///////////////////////////////////////////////////////////////////////////////
    #region OVERRIDES

    /// <summary>
    /// Connects to the Gazetracker camera system via UDP connection.
    /// </summary>
    /// <returns><strong>True</strong> if connection succeded, otherwise
    /// <strong>false</strong>.</returns>
    public override bool Connect()
    {
      try
      {
        this.client = new Client
        {
          IPAddress = IPAddress.Parse(this.Settings.GazeDataServerIPAddress),
          PortReceive = this.Settings.GazeDataServerPort,
          PortSend = this.Settings.CommandServerPort
        };

        this.client.ClientConnectionChanged += this.ClientClientConnectionChanged;
        this.client.ErrorOccured += this.ClientErrorOccured;
        this.client.Calibration.OnEnd += this.Calibration_OnEnd;
        this.client.GazeData.OnGazeData += this.GazeData_OnGazeData;

        if (!this.client.IsRunning)
        {
          this.client.Connect();
        }
      }
      catch (Exception ex)
      {
        var dlg = new ConnectionFailedDialog { ErrorMessage = ex.Message };
        dlg.ShowDialog();
        this.CleanUp();
        return false;
      }

      this.clientStatus.IsConnected = true;
      return true;
    }