public ClientUI()
        {
            ComboBoxBackgroundColorFix.Initialize();
            commandHistory = new List<string>(commandLogMaxLines + 1);
            receivedData = new List<string>(receivedDataMaxLines + 1);

            client = new Client();
            client.IPAddress = IPAddress.Parse("127.0.0.1");
            client.PortReceive = 6666;
            client.PortSend = 5555;
            client.ClientConnectionChanged += OnClientConnectionChanged;
            client.Calibration.OnEnd += Calibration_OnEnd;


            InitializeComponent();

            // Will use settings found in "GazeTrackerSettings.xml" or default values
            TextBoxIPAddress.Text = client.IPAddress.ToString();
            TextBoxPortOut.Text = client.PortSend.ToString();
            TextBoxPortIn.Text = client.PortReceive.ToString();

            // Just so we can do it in run-time (instead of applying it on Connect/Disconnect)
            CheckBoxListenToEvents.Checked += CheckBoxListenToEvents_Checked;
            CheckBoxListenToEvents.Unchecked += CheckBoxListenToEvents_Unchecked;

            SetCommandList();
        }
Exemple #2
0
        public Calibration(Client cli)
        {
            client = cli;

            // Set default parameters
            calParams = new CalibrationParameters();
            calParams.SetDefaultParameters();
        }
Exemple #3
0
 ///<summary>
 /// Class Constructor that handles the Gazetracker and WebSocket clients.
 /// </summary>
 /// <param name="address">The server address: ws://address:port/</param>
 public WSClient(string address)
 {
     createXml();
     wsClient = new WebSocketClient(address)
     {
         OnConnected        = OnConnected,
         OnDisconnect       = OnDisconnect,
         OnFailedConnection = OnFailedConnection,
         OnReceive          = OnReceive
     };
     gtClient = new GazeTrackerClient.Client();
 }
 ///<summary>
 /// Class Constructor that handles the Gazetracker client and the WebSocket connections.
 /// </summary>
 /// <param name="address">The server address: ws://address:port/</param>
 public WSClient(string address)
 {
     createXml();
     wsClient = new WebSocketClient(address)
     {
         OnConnected = OnConnected,
         OnDisconnect = OnDisconnect,
         OnFailedConnection = OnFailedConnection,
         OnReceive = OnReceive
     };
     gtClient = new GazeTrackerClient.Client();
 }
        ///<summary>
        /// Class Constructor that handles the Gazetracker client and the WebSocket connections.
        /// </summary>
        public WSClient()
        {
            createXml();
            wsClient = new WebSocketClient("ws://ciman.math.unipd.it:8000/")
            {
                OnConnected = OnConnected,
                OnDisconnect = OnDisconnect,
                OnFailedConnection = OnFailedConnection,
                OnReceive = OnReceive
            };
            gtClient = new GazeTrackerClient.Client();

            gtClient.ErrorOccured += OnErrorOccured;

            gtClient.Calibration.OnPointChange += new GazeTrackerClient.Calibration.PointChangeHandler(OnCalibrationPointChange);
            gtClient.Calibration.OnEnd += new GazeTrackerClient.Calibration.EndHandler(OnCalibrationEnd);
            gtClient.GazeData.OnGazeData += new GazeTrackerClient.GazeData.GazeDataHandler(OnGazeData);
        }
        ///<summary>
        /// Class Constructor that handles the Gazetracker client and the WebSocket connections.
        /// </summary>
        public WSClient()
        {
            createXml();
            wsClient = new WebSocketClient("ws://ciman.math.unipd.it:8000/")
            {
                OnConnected        = OnConnected,
                OnDisconnect       = OnDisconnect,
                OnFailedConnection = OnFailedConnection,
                OnReceive          = OnReceive
            };
            gtClient = new GazeTrackerClient.Client();

            gtClient.ErrorOccured += OnErrorOccured;

            gtClient.Calibration.OnPointChange += new GazeTrackerClient.Calibration.PointChangeHandler(OnCalibrationPointChange);
            gtClient.Calibration.OnEnd         += new GazeTrackerClient.Calibration.EndHandler(OnCalibrationEnd);
            gtClient.GazeData.OnGazeData       += new GazeTrackerClient.GazeData.GazeDataHandler(OnGazeData);
        }