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
Oct 10, 2019
by
Stefan Schreistetter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified event structure.
parent
46d65b4f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
38 deletions
+27
-38
GazeWebSocketServer.sln
+2
-2
GazeWebSocketServer/GazeWebSocketServer.csproj
+10
-0
TrackerBridge/FakeTracker.cs
+3
-7
TrackerBridge/GazeDataProcessor.cs
+10
-17
TrackerBridge/IBridgeTracker.cs
+0
-2
TrackerBridge/TobiiEyeTracker.cs
+2
-10
No files found.
GazeWebSocketServer.sln
View file @
b55d8fdf
...
@@ -13,8 +13,8 @@ Global
...
@@ -13,8 +13,8 @@ Global
Release|Any CPU = Release|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F8F11E64-7946-4054-8C27-F0FCAF967F1A}.Debug|Any CPU.ActiveCfg =
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 =
Release
|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.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
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{64D52257-ECA7-4F4D-A901-B14D544A1D0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
...
...
GazeWebSocketServer/GazeWebSocketServer.csproj
View file @
b55d8fdf
...
@@ -50,6 +50,16 @@
...
@@ -50,6 +50,16 @@
<WarningLevel>4</WarningLevel>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
</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>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration" />
...
...
TrackerBridge/FakeTracker.cs
View file @
b55d8fdf
...
@@ -8,22 +8,18 @@ namespace TrackerBridge
...
@@ -8,22 +8,18 @@ namespace TrackerBridge
{
{
public
class
FakeTracker
:
IBridgeTracker
public
class
FakeTracker
:
IBridgeTracker
{
{
private
event
GazeDataHandler
gazeDataAvailable
;
public
event
GazeDataHandler
GazeDataAvailable
{
public
event
GazeDataHandler
GazeDataAvailable
{
add
{
add
{
gazeDataAvailable
+=
value
;
GazeDataProcessor
.
GazeDataProcessed
+=
value
;
GazeDataProcessor
.
AddClient
(
value
);
}
}
remove
{
remove
{
gazeDataAvailable
-=
value
;
GazeDataProcessor
.
GazeDataProcessed
-=
value
;
GazeDataProcessor
.
RemoveClient
(
value
);
}
}
}
}
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
private
Single
trackerFrequency
;
private
Single
trackerFrequency
;
public
GazeDataHandler
GazeDataAvailableMembers
=>
gazeDataAvailable
;
public
String
SerialNumber
=>
throw
new
NotImplementedException
();
public
String
SerialNumber
=>
throw
new
NotImplementedException
();
public
GazeDataProcessor
GazeDataProcessor
{
get
;
}
public
GazeDataProcessor
GazeDataProcessor
{
get
;
}
...
...
TrackerBridge/GazeDataProcessor.cs
View file @
b55d8fdf
...
@@ -11,6 +11,15 @@ namespace TrackerBridge
...
@@ -11,6 +11,15 @@ namespace TrackerBridge
{
{
public
class
GazeDataProcessor
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
IGazeFilter
[]
gazeFilters
;
private
readonly
Single
screenHeight
;
private
readonly
Single
screenHeight
;
private
readonly
Single
screenWidth
;
private
readonly
Single
screenWidth
;
...
@@ -33,27 +42,11 @@ namespace TrackerBridge
...
@@ -33,27 +42,11 @@ namespace TrackerBridge
gazeFilters
[
0
]
=
new
GazeDecimator
(
60
);
//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
-
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
()
public
void
Initialize
()
{
{
...
...
TrackerBridge/IBridgeTracker.cs
View file @
b55d8fdf
...
@@ -13,8 +13,6 @@ namespace TrackerBridge
...
@@ -13,8 +13,6 @@ namespace TrackerBridge
{
{
event
GazeDataHandler
GazeDataAvailable
;
event
GazeDataHandler
GazeDataAvailable
;
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
GazeDataHandler
GazeDataAvailableMembers
{
get
;
}
GazeDataProcessor
GazeDataProcessor
{
get
;}
GazeDataProcessor
GazeDataProcessor
{
get
;}
String
SerialNumber
{
get
;
}
String
SerialNumber
{
get
;
}
...
...
TrackerBridge/TobiiEyeTracker.cs
View file @
b55d8fdf
...
@@ -9,20 +9,14 @@ namespace TrackerBridge
...
@@ -9,20 +9,14 @@ namespace TrackerBridge
{
{
public
class
TobiiEyeTracker
:
IBridgeTracker
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
ConnectionEvent
;
public
event
ConnectionEventHandler
ConnectionTimeout
;
public
event
ConnectionEventHandler
ConnectionTimeout
;
private
event
GazeDataHandler
gazeDataAvailable
;
public
event
GazeDataHandler
GazeDataAvailable
{
public
event
GazeDataHandler
GazeDataAvailable
{
add
{
add
{
gazeDataAvailable
+=
value
;
GazeDataProcessor
.
GazeDataProcessed
+=
value
;
GazeDataProcessor
.
AddClient
(
value
);
}
}
remove
{
remove
{
gazeDataAvailable
-=
value
;
GazeDataProcessor
.
GazeDataProcessed
-=
value
;
GazeDataProcessor
.
RemoveClient
(
value
);
}
}
}
}
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
public
event
EventHandler
<
Single
>
TrackingFrequencyChanged
;
...
@@ -33,8 +27,6 @@ namespace TrackerBridge
...
@@ -33,8 +27,6 @@ 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
=>
gazeDataAvailable
;
public
TobiiEyeTracker
()
public
TobiiEyeTracker
()
{
{
GazeDataProcessor
=
new
GazeDataProcessor
(
this
);
GazeDataProcessor
=
new
GazeDataProcessor
(
this
);
...
...
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