Commit 82c4433d by Stefan2 Schreistetter

Projektdateien hinzufügen.

parent 8b921bde

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29209.62
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GazeWebSocketServer", "GazeWebSocketServer\GazeWebSocketServer.csproj", "{F8F11E64-7946-4054-8C27-F0FCAF967F1A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.Build.0 = Debug|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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DF0A4C29-6D84-4CC7-9520-F2AFEF6A46B7}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tobii.Research;
namespace GazeWebSocketServer
{
class EyeTrackerClient
{
private IEyeTracker eyeTracker;
private GazeDataProcessor gazeDataProcessor;
public EyeTrackerClient()
{
while (eyeTracker == null)
{
EyeTrackerCollection eyeTrackers = EyeTrackingOperations.FindAllEyeTrackers();
if (eyeTrackers.Count > 0)
{
eyeTracker = eyeTrackers[0];
}
}
gazeDataProcessor = new GazeDataProcessor();
eyeTracker.SetGazeOutputFrequency(120f);
}
public void Start()
{
eyeTracker.GazeDataReceived += GazeDataReceivedHandler;
}
public void Stop()
{
eyeTracker.GazeDataReceived -= GazeDataReceivedHandler;
}
private void GazeDataReceivedHandler(object sender, GazeDataEventArgs e)
{
Console.WriteLine(gazeDataProcessor.Extract(e).ToString());
}
}
}
\ No newline at end of file
using System;
using WebSocketSharp;
using WebSocketSharp.Server;
using System.Collections.Generic;
using System.Text;
namespace GazeWebSocketServer
{
public class GazeCoordinateBehavior : WebSocketBehavior
{
protected override void OnOpen()
{
throw new NotImplementedException();
//base.OnOpen();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GazeWebSocketServer
{
struct GazeData
{
public readonly float leftX;
public readonly float leftY;
public readonly float rightX;
public readonly float rightY;
public GazeData(float leftX, float leftY, float rightX, float rightY)
{
this.leftX = leftX;
this.leftY = leftY;
this.rightX = rightX;
this.rightY = rightY;
}
public override string ToString()
{
return $"\"{leftX}\", \"{leftY}\", \"{rightX}\", \"{rightY}\"";
}
}
}
using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tobii.Research;
namespace GazeWebSocketServer
{
class GazeDataProcessor
{
readonly float screenHeight;
readonly float screenWidth;
public GazeDataProcessor()
{
screenHeight = Convert.ToSingle(SystemParameters.PrimaryScreenHeight);
screenWidth = Convert.ToSingle(SystemParameters.PrimaryScreenWidth);
}
public GazeData Extract(GazeDataEventArgs e)
{
GazeData data = new GazeData(e.LeftEye.GazePoint.PositionOnDisplayArea.X*screenWidth,
e.LeftEye.GazePoint.PositionOnDisplayArea.Y*screenHeight,
e.RightEye.GazePoint.PositionOnDisplayArea.X*screenWidth,
e.RightEye.GazePoint.PositionOnDisplayArea.Y*screenHeight);
return data;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F8F11E64-7946-4054-8C27-F0FCAF967F1A}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>GazeWebSocketServer</RootNamespace>
<AssemblyName>GazeWebSocketServer</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>x64</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Tobii.Research, Version=1.7.0.1070, Culture=neutral, PublicKeyToken=70326046dcdce6cb, processorArchitecture=MSIL">
<HintPath>..\packages\Tobii.Research.x64.1.7.0.1070\lib\net452\Tobii.Research.dll</HintPath>
</Reference>
<Reference Include="websocket-sharp, Version=1.0.2.59611, Culture=neutral, PublicKeyToken=5660b08a1845a91e, processorArchitecture=MSIL">
<HintPath>..\packages\WebSocketSharp.1.0.3-rc11\lib\websocket-sharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="EyeTrackerClient.cs" />
<Compile Include="GazeCoordinateBehavior.cs" />
<Compile Include="GazeData.cs" />
<Compile Include="GazeDataProcessor.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Tobii.Research.x64.1.7.0.1070\build\Tobii.Research.x64.targets" Condition="Exists('..\packages\Tobii.Research.x64.1.7.0.1070\build\Tobii.Research.x64.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Tobii.Research.x64.1.7.0.1070\build\Tobii.Research.x64.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Tobii.Research.x64.1.7.0.1070\build\Tobii.Research.x64.targets'))" />
</Target>
</Project>
\ No newline at end of file
using System;
using WebSocketSharp;
using WebSocketSharp.Server;
using Tobii.Research;
namespace GazeWebSocketServer
{
public class Program
{
public static void Main(string[] args)
{
var wssv = new WebSocketServer("ws://localhost:8001");
wssv.AddWebSocketService<GazeCoordinateBehavior>("/gaze");
EyeTrackerClient eyeTrackerClient = new EyeTrackerClient();
eyeTrackerClient.Start();
wssv.Start();
Console.ReadKey(true);
wssv.Stop();
eyeTrackerClient.Stop();
}
}
}
\ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("GazeWebSocketServer")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("OTH Regensburg")]
[assembly: AssemblyProduct("GazeWebSocketServer")]
[assembly: AssemblyCopyright("Copyright © OTH Regensburg 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("f8f11e64-7946-4054-8c27-f0fcaf967f1a")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Tobii.Research.x64" version="1.7.0.1070" targetFramework="net472" />
<package id="WebSocketSharp" version="1.0.3-rc11" targetFramework="net472" />
</packages>
\ No newline at end of file
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