Commit 46d65b4f by Stefan Schreistetter

Adapted project to work with Tracker.

parent 3663b358
...@@ -11,21 +11,16 @@ Global ...@@ -11,21 +11,16 @@ Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
Tracker|Any CPU = Tracker|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.Build.0 = Release|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Release|Any CPU.ActiveCfg = Release|Any CPU {F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Release|Any CPU.Build.0 = Release|Any CPU {F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Release|Any CPU.Build.0 = Release|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Tracker|Any CPU.ActiveCfg = Tracker|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Tracker|Any CPU.Build.0 = Tracker|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU {64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU {64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Release|Any CPU.Build.0 = Release|Any CPU {64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Release|Any CPU.Build.0 = Release|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Tracker|Any CPU.ActiveCfg = Release|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Tracker|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<configuration> <configuration>
<appSettings> <appSettings>
<add key="TrackerSerialNumber" value="TPSP1-010108442544" /> <add key="TrackerSerialNumber" value="TPSP1-010108442544" />
<add key="TrackerFrequency_Hz" value="120" /> <add key="TrackerFrequency_Hz" value="600" />
<add key="OutputFrequency_Hz" value="60" /> <add key="OutputFrequency_Hz" value="60" />
<add key="WebSocketPort" value="8001" /> <add key="WebSocketPort" value="8001" />
<add key="WebSocketEndpoint" value="/gaze" /> <add key="WebSocketEndpoint" value="/gaze" />
......
...@@ -14,6 +14,21 @@ ...@@ -14,6 +14,21 @@
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<NuGetPackageImportStamp> <NuGetPackageImportStamp>
</NuGetPackageImportStamp> </NuGetPackageImportStamp>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
...@@ -26,32 +41,20 @@ ...@@ -26,32 +41,20 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget> <PlatformTarget>x64</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> <Prefer32Bit>false</Prefer32Bit>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Tracker|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Tracker\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="PresentationFramework" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Configuration" /> <Reference Include="System.Configuration" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" /> <Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
...@@ -78,6 +81,18 @@ ...@@ -78,6 +81,18 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TrackerBridge\TrackerBridge.csproj"> <ProjectReference Include="..\TrackerBridge\TrackerBridge.csproj">
<Project>{64d52257-eca7-4f4d-a901-b14d544a1d0a}</Project> <Project>{64d52257-eca7-4f4d-a901-b14d544a1d0a}</Project>
<Name>TrackerBridge</Name> <Name>TrackerBridge</Name>
......
using System; using System;
using System.Threading.Tasks;
using TrackerBridge; using TrackerBridge;
using TrackerBridge.DSP;
namespace GazeWebSocketServer namespace GazeWebSocketServer
{ {
......
using System;
namespace TobiiBridge
{
public class EyeTracker
{
public EyeTracker()
{
}
public EyeTracker(String serialNumber)
{
}
}
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Tobii.Research.x64" Version="1.7.0.1070" />
</ItemGroup>
</Project>
...@@ -11,14 +11,12 @@ namespace TrackerBridge.DSP ...@@ -11,14 +11,12 @@ namespace TrackerBridge.DSP
{ {
public event GazeDataHandler OutputAvailable; public event GazeDataHandler OutputAvailable;
private Single inputFrequency;
private GazeData output; private GazeData output;
private Single outputFrequency; private Single outputFrequency;
private Object outputLock = new Object(); private readonly Object outputLock = new Object();
private Object valueCountLock = new Object(); private readonly Object valueCountLock = new Object();
private Int64 valueCount; private Int64 valueCount;
public Single InputFrequency { get => inputFrequency; set => inputFrequency = value; }
private Int64 ValueCount { private Int64 ValueCount {
get { get {
lock (valueCountLock) lock (valueCountLock)
...@@ -49,10 +47,9 @@ namespace TrackerBridge.DSP ...@@ -49,10 +47,9 @@ namespace TrackerBridge.DSP
} }
} }
public GazeDecimator(Single outputFrequency, Single inputFrequency) public GazeDecimator(Single outputFrequency)
{ {
this.outputFrequency = outputFrequency; this.outputFrequency = outputFrequency;
this.InputFrequency = inputFrequency;
Task.Run(() => TriggerOutput(outputFrequency)); Task.Run(() => TriggerOutput(outputFrequency));
} }
public void Input(GazeData input, Object sender = null) public void Input(GazeData input, Object sender = null)
......
...@@ -30,7 +30,7 @@ namespace TrackerBridge ...@@ -30,7 +30,7 @@ namespace TrackerBridge
screenHeight = Convert.ToSingle(SystemParameters.PrimaryScreenHeight); screenHeight = Convert.ToSingle(SystemParameters.PrimaryScreenHeight);
screenWidth = Convert.ToSingle(SystemParameters.PrimaryScreenWidth); screenWidth = Convert.ToSingle(SystemParameters.PrimaryScreenWidth);
gazeFilters = new IGazeFilter[1]; gazeFilters = new IGazeFilter[1];
gazeFilters[0] = new GazeDecimator(60, tracker.GetTrackingFrequency()); //TODO: Refactor frequency passthrough gazeFilters[0] = new GazeDecimator(60); //TODO: Refactor frequency passthrough
//Chain filters //Chain filters
for(Int32 index= 0; index < gazeFilters.Length; index++) for(Int32 index= 0; index < gazeFilters.Length; index++)
...@@ -85,7 +85,7 @@ namespace TrackerBridge ...@@ -85,7 +85,7 @@ namespace TrackerBridge
if(filter.GetType() == typeof(GazeDecimator)) if(filter.GetType() == typeof(GazeDecimator))
{ {
GazeDecimator decimator = (GazeDecimator)filter; GazeDecimator decimator = (GazeDecimator)filter;
decimator.InputFrequency = frequency; throw new NotImplementedException();
} }
} }
} }
......
...@@ -14,7 +14,17 @@ namespace TrackerBridge ...@@ -14,7 +14,17 @@ namespace TrackerBridge
public event ConnectionEventHandler ConnectionEvent; public event ConnectionEventHandler ConnectionEvent;
public event ConnectionEventHandler ConnectionTimeout; public event ConnectionEventHandler ConnectionTimeout;
public event GazeDataHandler GazeDataAvailable; private event GazeDataHandler gazeDataAvailable;
public event GazeDataHandler GazeDataAvailable {
add {
gazeDataAvailable += value;
GazeDataProcessor.AddClient(value);
}
remove {
gazeDataAvailable -= value;
GazeDataProcessor.RemoveClient(value);
}
}
public event EventHandler<Single> TrackingFrequencyChanged; public event EventHandler<Single> TrackingFrequencyChanged;
private IEyeTracker eyeTracker = null; private IEyeTracker eyeTracker = null;
...@@ -23,11 +33,7 @@ namespace TrackerBridge ...@@ -23,11 +33,7 @@ namespace TrackerBridge
public Boolean IsConnected { get; private set; } = false; public Boolean IsConnected { get; private set; } = false;
public String SerialNumber { get; private set; } = null; public String SerialNumber { get; private set; } = null;
public GazeDataHandler GazeDataAvailableMembers { public GazeDataHandler GazeDataAvailableMembers => gazeDataAvailable;
get {
return GazeDataAvailable;
}
}
public TobiiEyeTracker() public TobiiEyeTracker()
{ {
...@@ -56,11 +62,6 @@ namespace TrackerBridge ...@@ -56,11 +62,6 @@ namespace TrackerBridge
} }
} }
Single IBridgeTracker.GetTrackingFrequency()
{
throw new NotImplementedException();
}
public void SetTrackingFrequency(float value) public void SetTrackingFrequency(float value)
{ {
if (eyeTracker != null && eyeTracker.GetAllGazeOutputFrequencies().Contains(value)) if (eyeTracker != null && eyeTracker.GetAllGazeOutputFrequencies().Contains(value))
......
...@@ -32,9 +32,9 @@ ...@@ -32,9 +32,9 @@
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<PlatformTarget>x64</PlatformTarget>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment