Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Eye-Tracking Classroom
/
gaze-server.cs
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b55d8fdf
authored
5 years ago
by
Stefan Schreistetter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified event structure.
parent
46d65b4f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
39 deletions
+28
-39
GazeWebSocketServer.sln
+2
-2
GazeWebSocketServer/GazeWebSocketServer.csproj
+10
-0
TrackerBridge/FakeTracker.cs
+3
-7
TrackerBridge/GazeDataProcessor.cs
+11
-18
TrackerBridge/IBridgeTracker.cs
+0
-2
TrackerBridge/TobiiEyeTracker.cs
+2
-10
No files found.
GazeWebSocketServer.sln
View file @
b55d8fdf
...
...
@@ -13,8 +13,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.ActiveCfg =
Release
|Any CPU
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.Build.0 =
Release
|Any CPU
{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
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
...
...
This diff is collapsed.
Click to expand it.
GazeWebSocketServer/GazeWebSocketServer.csproj
View file @
b55d8fdf
...
...
@@ -50,6 +50,16 @@
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<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>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Configuration" />
...
...
This diff is collapsed.
Click to expand it.
TrackerBridge/FakeTracker.cs
View file @
b55d8fdf
...
...
@@ -8,22 +8,18 @@ namespace TrackerBridge
{
public
class
FakeTracker
:
IBridgeTracker
{
private
event
GazeDataHandler
gazeDataAvailable
;
public
event
GazeDataHandler
GazeDataAvailable
{
add
{
gazeDataAvailable
+=
value
;
GazeDataProcessor
.
AddClient
(
value
);
GazeDataProcessor
.
GazeDataProcessed
+=
value
;
}
remove
{
gazeDataAvailable
-=
value
;
GazeDataProcessor
.
RemoveClient
(
value
);
GazeDataProcessor
.
GazeDataProcessed
-=
value
;
}
}
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
private
Single
trackerFrequency
;
public
GazeDataHandler
GazeDataAvailableMembers
=>
gazeDataAvailable
;
public
String
SerialNumber
=>
throw
new
NotImplementedException
();
public
GazeDataProcessor
GazeDataProcessor
{
get
;
}
...
...
This diff is collapsed.
Click to expand it.
TrackerBridge/GazeDataProcessor.cs
View file @
b55d8fdf
...
...
@@ -11,6 +11,15 @@ namespace TrackerBridge
{
public
class
GazeDataProcessor
{
public
event
GazeDataHandler
GazeDataProcessed
{
add
{
gazeFilters
[
gazeFilters
.
Length
-
1
].
OutputAvailable
+=
value
;
}
remove
{
gazeFilters
[
gazeFilters
.
Length
-
1
].
OutputAvailable
-=
value
;
}
}
private
readonly
IGazeFilter
[]
gazeFilters
;
private
readonly
Single
screenHeight
;
private
readonly
Single
screenWidth
;
...
...
@@ -33,28 +42,12 @@ namespace TrackerBridge
gazeFilters
[
0
]
=
new
GazeDecimator
(
60
);
//TODO: Refactor frequency passthrough
//Chain filters
for
(
Int32
index
=
0
;
index
<
gazeFilters
.
Length
;
index
++)
for
(
Int32
index
=
0
;
index
<
gazeFilters
.
Length
-
1
;
index
++)
{
if
(
index
==
gazeFilters
.
Length
-
1
)
{
gazeFilters
[
index
].
OutputAvailable
+=
tracker
.
GazeDataAvailableMembers
;
}
else
{
gazeFilters
[
index
].
OutputAvailable
+=
gazeFilters
[
index
+
1
].
Input
;
}
gazeFilters
[
index
].
OutputAvailable
+=
gazeFilters
[
index
+
1
].
Input
;
}
}
public
void
AddClient
(
GazeDataHandler
gazeDataHandler
)
{
gazeFilters
[
gazeFilters
.
Length
-
1
].
OutputAvailable
+=
gazeDataHandler
;
}
public
void
RemoveClient
(
GazeDataHandler
gazeDataHandler
)
{
gazeFilters
[
gazeFilters
.
Length
-
1
].
OutputAvailable
-=
gazeDataHandler
;
}
public
void
Initialize
()
{
foreach
(
IGazeFilter
filter
in
gazeFilters
)
...
...
This diff is collapsed.
Click to expand it.
TrackerBridge/IBridgeTracker.cs
View file @
b55d8fdf
...
...
@@ -13,8 +13,6 @@ namespace TrackerBridge
{
event
GazeDataHandler
GazeDataAvailable
;
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
GazeDataHandler
GazeDataAvailableMembers
{
get
;
}
GazeDataProcessor
GazeDataProcessor
{
get
;}
String
SerialNumber
{
get
;
}
...
...
This diff is collapsed.
Click to expand it.
TrackerBridge/TobiiEyeTracker.cs
View file @
b55d8fdf
...
...
@@ -9,20 +9,14 @@ namespace TrackerBridge
{
public
class
TobiiEyeTracker
:
IBridgeTracker
{
//public delegate void ConnectionEventHandler(TobiiEyeTracker sender);
//public delegate void GazeDataHandler(TobiiEyeTracker sender, GazeData data);
public
event
ConnectionEventHandler
ConnectionEvent
;
public
event
ConnectionEventHandler
ConnectionTimeout
;
private
event
GazeDataHandler
gazeDataAvailable
;
public
event
GazeDataHandler
GazeDataAvailable
{
add
{
gazeDataAvailable
+=
value
;
GazeDataProcessor
.
AddClient
(
value
);
GazeDataProcessor
.
GazeDataProcessed
+=
value
;
}
remove
{
gazeDataAvailable
-=
value
;
GazeDataProcessor
.
RemoveClient
(
value
);
GazeDataProcessor
.
GazeDataProcessed
-=
value
;
}
}
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
...
...
@@ -33,8 +27,6 @@ namespace TrackerBridge
public
Boolean
IsConnected
{
get
;
private
set
;
}
=
false
;
public
String
SerialNumber
{
get
;
private
set
;
}
=
null
;
public
GazeDataHandler
GazeDataAvailableMembers
=>
gazeDataAvailable
;
public
TobiiEyeTracker
()
{
GazeDataProcessor
=
new
GazeDataProcessor
(
this
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment