Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Xiaoying Pu
dm_task
Commits
7fc22c71
Commit
7fc22c71
authored
Nov 24, 2015
by
Xiaoying Pu
Browse files
wired into Trial
parent
6870a34a
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/digit/DigitTaskFacade.java
View file @
7fc22c71
...
...
@@ -138,9 +138,13 @@ public class DigitTaskFacade {
@Override
public
void
run
(
EventType
type
)
{
endRecallingDigit
();
final
boolean
isCorrect
=
endRecallingDigit
();
eventListenerList
.
stream
().
forEach
((
listener
)
->
{
listener
.
run
(
EventType
.
DIGITINPUT_FINISHED
);
if
(
isCorrect
)
{
listener
.
run
(
EventType
.
DIGITINPUT_FINISHED_CORRECT
);
}
else
{
listener
.
run
(
EventType
.
DIGITINPUT_FINISHED_INCORRECT
);
}
});
}
}
...
...
src/util/EventType.java
View file @
7fc22c71
...
...
@@ -15,5 +15,6 @@ public enum EventType {
DIGITINPUT_TO_CONTROLLER
,
UDPMSG_FROM_MT
,
END_MULTI_DECISION
,
DIGITINPUT_FINISHED
;
DIGITINPUT_FINISHED_CORRECT
,
DIGITINPUT_FINISHED_INCORRECT
;
}
src/util/Trial.java
View file @
7fc22c71
...
...
@@ -37,8 +37,6 @@ public class Trial extends Thread {
/* csv dump for digit recall */
private
Persistence
writer
;
private
String
templine
=
""
;
/**
* The constructor
*/
...
...
@@ -99,12 +97,15 @@ public class Trial extends Thread {
sFacade
.
startRecallingDigit
();
pFacade
.
endDecision
();
break
;
case
DIGITINPUT_FINISHED:
// TODO who calls the listener in this case?
// TODO: the counter may be happier if it lived here
case
DIGITINPUT_FINISHED_CORRECT:
// TODO: csv writing here
templine
=
""
;
writer
.
put
(
"correct"
);
writer
.
flush
();
actionQueue
.
add
(
new
ShowDigitAction
(
ActionType
.
START_HWL_DIGIT
));
break
;
case
DIGITINPUT_FINISHED_INCORRECT:
writer
.
put
(
"incorrect"
);
writer
.
flush
();
actionQueue
.
add
(
new
ShowDigitAction
(
ActionType
.
START_HWL_DIGIT
));
break
;
...
...
@@ -195,14 +196,18 @@ public class Trial extends Thread {
if
(
type
==
ActionType
.
START_HWL_DIGIT
||
type
==
ActionType
.
START_LWL_DIGIT
)
{
WLState
curState
;
int
id
=
aTask
.
getTaskID
();
if
(
type
==
ActionType
.
START_HWL_DIGIT
)
{
writer
.
put
(
"HWL"
);
curState
=
WLState
.
HIGH_WORKLOAD
;
sFacade
.
showDigit
(
util
.
WLState
.
HIGH_WORKLOAD
);
}
else
{
writer
.
put
(
"LWL"
);
curState
=
WLState
.
LOW_WORKLOAD
;
sFacade
.
showDigit
(
util
.
WLState
.
LOW_WORKLOAD
);
}
writer
.
put
(
id
);
// start UDP to MouseTracker
// go look at the mousetracker!!!
...
...
test/util/PersistenceTest.java
View file @
7fc22c71
...
...
@@ -19,10 +19,10 @@ public class PersistenceTest {
@Test
public
void
theWholeThing
()
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
for
(
int
i
d
=
0
;
i
d
<
10
;
i
d
++)
{
this
.
writer
.
initEntry
();
this
.
writer
.
put
(
2
);
this
.
writer
.
put
(
3
);
this
.
writer
.
put
(
"HWL"
);
this
.
writer
.
put
(
id
);
this
.
writer
.
put
(
"correct"
);
this
.
writer
.
flush
();
}
...
...
testPersistence.csv
View file @
7fc22c71
time,digit_length,decision_id,response
144838
4635129,2,3
,correct
144838
4635346,2,3
,correct
144838
4635346,2,3
,correct
144838
4635347,2
,3,correct
144838
4635347,2,3
,correct
144838
4635347,2,3
,correct
144838
4635348,2,3
,correct
144838
4635348,2,3
,correct
144838
4635348,2,3
,correct
144838
4635348,2,3
,correct
144838
9767015,HWL,0
,correct
144838
9767175,HWL,1
,correct
144838
9767176,HWL,2
,correct
144838
9767176,HWL
,3,correct
144838
9767176,HWL,4
,correct
144838
9767177,HWL,5
,correct
144838
9767177,HWL,6
,correct
144838
9767177,HWL,7
,correct
144838
9767177,HWL,8
,correct
144838
9767177,HWL,9
,correct
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