-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCRSFixonState.m
More file actions
57 lines (46 loc) · 1.3 KB
/
CRSFixonState.m
File metadata and controls
57 lines (46 loc) · 1.3 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
55
56
57
//
// CRSFixonState.m
// Experiment
//
// Copyright (c) 2006. All rights reserved.
//
#import "CRSFixonState.h"
#import "CRSUtilities.h"
#import "CRSDigitalOut.h"
@implementation CRSFixonState
- (void)stateAction {
bool useFewDigitalCodes;
useFewDigitalCodes = [[task defaults] boolForKey:CRSUseFewDigitalCodesKey];
[stimuli setFixSpot:YES];
[[task dataDoc] putEvent:@"fixOn"];
if (!useFewDigitalCodes)
[digitalOut outputEventName:@"fixOn" withData:0x0000];
[[task synthDataDevice] setEyeTargetOn:NSMakePoint(0, 0)];
expireTime = [LLSystemUtil timeFromNow:[[task defaults] integerForKey:CRSAcquireMSKey]];
if ([[task defaults] boolForKey:CRSDoSoundsKey]) {
[[NSSound soundNamed:kFixOnSound] play];
}
}
- (NSString *)name {
return @"CRSFixon";
}
- (LLState *)nextState {
if ([task mode] == kTaskIdle) {
eotCode = kMyEOTQuit;
return [[task stateSystem] stateNamed:@"Endtrial"];;
}
if (![[task defaults] boolForKey:CRSFixateKey]) {
return [[task stateSystem] stateNamed:@"CRSFixate"];
}
else if ([CRSUtilities inWindow:fixWindow]) {
return [[task stateSystem] stateNamed:@"CRSFixGrace"];
}
if ([LLSystemUtil timeIsPast:expireTime]) {
eotCode = kMyEOTIgnored;
return [[task stateSystem] stateNamed:@"Endtrial"];;
}
else {
return nil;
}
}
@end