-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGRFFixonState.m
More file actions
52 lines (43 loc) · 1.15 KB
/
GRFFixonState.m
File metadata and controls
52 lines (43 loc) · 1.15 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
//
// GRFFixonState.m
// Experiment
//
// Copyright (c) 2006. All rights reserved.
//
#import "GRFFixonState.h"
#import "GRFUtilities.h"
#import "GRFDigitalOut.h"
@implementation GRFFixonState
- (void)stateAction {
[stimuli setFixSpot:YES];
[[task dataDoc] putEvent:@"fixOn"];
[digitalOut outputEventName:@"fixOn" withData:0x0000];
[[task synthDataDevice] setEyeTargetOn:NSMakePoint(0, 0)];
expireTime = [LLSystemUtil timeFromNow:[[task defaults] integerForKey:GRFAcquireMSKey]];
if ([[task defaults] boolForKey:GRFDoSoundsKey]) {
[[NSSound soundNamed:kFixOnSound] play];
}
}
- (NSString *)name {
return @"GRFFixon";
}
- (LLState *)nextState {
if ([task mode] == kTaskIdle) {
eotCode = kMyEOTQuit;
return [[task stateSystem] stateNamed:@"Endtrial"];
}
if (![[task defaults] boolForKey:GRFFixateKey]) {
return [[task stateSystem] stateNamed:@"GRFFixate"];
}
else if ([GRFUtilities inWindow:fixWindow]) {
return [[task stateSystem] stateNamed:@"GRFFixGrace"];
}
if ([LLSystemUtil timeIsPast:expireTime]) {
eotCode = kMyEOTIgnored;
return [[task stateSystem] stateNamed:@"Endtrial"];
}
else {
return nil;
}
}
@end