-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGRFReactState.m
More file actions
executable file
·54 lines (43 loc) · 1.13 KB
/
GRFReactState.m
File metadata and controls
executable file
·54 lines (43 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// GRFReactState.m
// Experiment
//
// Copyright (c) 2006. All rights reserved.
//
#import "GRFReactState.h"
#import "UtilityFunctions.h"
#import "GRFUtilities.h"
#define kAlpha 2.5
#define kBeta 2.0
@implementation GRFReactState
- (void)stateAction;
{
[[task dataDoc] putEvent:@"react"];
expireTime = [LLSystemUtil timeFromNow:[[task defaults] integerForKey:GRFRespTimeMSKey] -
[[task defaults] integerForKey:GRFTooFastMSKey]];
}
- (NSString *)name {
return @"GRFReact";
}
- (LLState *)nextState {
if ([task mode] == kTaskIdle) { // switched to idle
eotCode = kMyEOTQuit;
return [[task stateSystem] stateNamed:@"Endtrial"];
}
if (![[task defaults] boolForKey:GRFFixateKey]) {
eotCode = kMyEOTCorrect;
return [[task stateSystem] stateNamed:@"Endtrial"];
}
else {
if (![GRFUtilities inWindow:fixWindow]) { // started a saccade
// [[task dataDoc] putEvent:@"saccadeLaunched"];
return [[task stateSystem] stateNamed:@"GRFSaccade"];
}
}
if ([LLSystemUtil timeIsPast:expireTime]) {
eotCode = kMyEOTMissed;
return [[task stateSystem] stateNamed:@"Endtrial"];
}
return nil;
}
@end