i'm trying to implement a Calibration at the beginning of my WPF App.
The App has a Main Window (MyApp.xaml) and this window contains a frame which leads to a page (Calibration.xaml). I started the server before i started the App.
I also referenced TETControls.dll, TETCSharpClient.dll and Newtonsoft.Json
My project works with the .NET Framework 4.5.1
MyApp.xaml.cs looks like this:
- Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using TETControls.Calibration;
using TETControls.Cursor;
using TETControls.TrackBox;
using TETCSharpClient;
using TETCSharpClient.Data;
namespace EyeTribe
{
public partial class MyApp : Window, IGazeListener
{
public MyApp()
{
InitializeComponent();
// Connect client
GazeManager.Instance.Activate(GazeManager.ApiVersion.VERSION_1_0, GazeManager.ClientMode.Push);
frmMainContent.Source = new Uri("Calibration.xaml", UriKind.Relative);
}
public void OnGazeUpdate(GazeData gazeData)
{
throw new NotImplementedException();
}
}
}
And my Calibration.xaml.cs (which should contain the Calibration) looks like this:
- Code: Select all
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TETControls;
using TETControls.Calibration;
using TETControls.Cursor;
using TETControls.TrackBox;
using TETCSharpClient.Data;
using TETCSharpClient;
using MessageBox = System.Windows.MessageBox;
namespace EyeTribe
{
public partial class Calibration : Page
{
public Calibration()
{
InitializeComponent();
}
private void btnCalibrate_Click(object sender, RoutedEventArgs e)
{
CalibrationRunner calRunner = new CalibrationRunner();
calRunner.OnResult += calRunner_OnResult;
calRunner.Start();
}
private void calRunner_OnResult(object sender, CalibrationRunnerEventArgs e)
{
switch (e.Result)
{
case CalibrationRunnerResult.Success:
//MessageBox.Show(this, "Calibration success " + e.CalibrationResult.AverageErrorDegree);
break;
case CalibrationRunnerResult.Abort:
//MessageBox.Show(this, "The calibration was aborted. Reason: " + e.Message);
break;
case CalibrationRunnerResult.Error:
//MessageBox.Show(this, "An error occured during calibration. Reason: " + e.Message);
break;
case CalibrationRunnerResult.Failure:
//MessageBox.Show(this, "Calibration failed. Reason: " + e.Message);
break;
case CalibrationRunnerResult.Unknown:
//MessageBox.Show(this, "Calibration exited with unknown state. Reason: " + e.Message);
break;
}
}
}
}
So I get errors while the app starts:
Exception while connecting to EyeTribe Server: TETCSharpClient.GazeApiManager.RequestTracker(ClientMode mode, ApiVersion version)
TETCSharpClient.GazeManager.HandleServerConnect(Object stateInfo)
and
Error initializing GazeManager, is EyeTribe Server running?
But I did start the server!
And as soon as I click on the Calibrate Button the Calibration starts, but the dot only moves once. It simply stops there and nothing happens (the dot remains at this point).
I get these errors:
Calling CalibrationStart(), but TET C# Client not activated!Calling CalibrationPointStart(), but TET C# Client not activated!"
Calling CalibrationPointEnd(), but TET C# Client not activated!Calling CalibrationAbort(), but TET C# Client not activated!
So what did I miss? I tried to follow the c# tutorial and looked at the samples, but I can't figure out a solution.