/
Draw_Test_Message.m
152 lines (118 loc) · 7.02 KB
/
Draw_Test_Message.m
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
function Draw_Test_Message(win, status, testEvent, trial, timeOn, SN, responseStatus, time)
% This function is to draw text in windows in TEST according to STATUS
%
global bgColor;
global textColor;
global originX;
global originY;
global lineSpace;
global sectionSpace;
global bigTextStyle;
global bigTextSize;
global textStyle;
global textSize;
y = originY;
switch (status)
case 'Begin'
[x, y] = Screen('DrawText', win, 'Begin Test', originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['NEXT DISPLAY IS: ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, 'Press ''spacebar'': Continue with trial # 1', originX, y, textColor, bgColor);
y = y + lineSpace;
Screen('DrawText', win, 'Press ''S'': SAVE and EXIT.', originX, y, textColor, bgColor);
case 'ContinueNextTrail'
tempStr = ['TRIAL # ' int2str(trial) ' TIMEON = ' num2str(timeOn, '%.2f')];
[x, y] = Screen('DrawText', win, tempStr, originX, y, textColor, bgColor);
y = y + sectionSpace;
tempStr = sprintf('Number of bad trials: %d out of %d', (SN - trial), SN);
[x, y] = Screen('DrawText', win, tempStr, originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['NEXT DISPLAY IS: ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['Press ''spacebar'': Continue with trial # ' int2str(trial+1)], originX, y, textColor, bgColor);
y = y + lineSpace;
[x, y] = Screen('DrawText', win, 'Press ''B'': BAD trial and do over.', originX, y, textColor, bgColor);
y = y + lineSpace;
Screen('DrawText', win, 'Press ''S'': SAVE and EXIT.', originX, y, textColor, bgColor);
case 'BadTrial'
tempStr = ['TRIAL # ' int2str(trial) ' TIMEON = ' num2str(timeOn, '%.2f')];
[x, y] = Screen('DrawText', win, tempStr, originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['STATUS: BAD trial was ===> ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, 'Press ''C'': Continue with next trial type.', originX, y, textColor, bgColor);
y = y + lineSpace;
Screen('DrawText', win, 'Press ''R'': Repeat lst trial type.', originX, y, textColor, bgColor);
case 'BeginTrial'
[x, y] = Screen('DrawText', win, ['TEST TRIAL # ' int2str(trial)], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['DISPLAY IS: ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, 'STATUS: Waiting for first look...', originX, y, textColor, bgColor);
y = y + sectionSpace;
switch (responseStatus)
case 1
Screen('DrawText', win, 'primary secondary : 0', originX, y, textColor, bgColor);
case 2
Screen('DrawText', win, '------- secondary : 0', originX, y, textColor, bgColor);
case 3
Screen('DrawText', win, 'primary --------- : 0', originX, y, textColor, bgColor);
case 4
Screen('DrawText', win, '------- --------- : 0', originX, y, textColor, bgColor);
end
Screen('TextStyle', win, bigTextStyle);
Screen('TextSize', win, bigTextSize);
y = y + sectionSpace;
Screen('DrawText', win, 'Recording', originX, y, textColor, bgColor);
Screen('TextStyle', win, textStyle);
Screen('TextSize', win, textSize);
case 'LookTooShort'
[x, y] = Screen('DrawText', win, ['TEST TRIAL # ' int2str(trial)], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['DISPLAY IS: ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, 'STATUS: Looking time too short! Waiting for look...', originX, y, textColor, bgColor);
y = y + sectionSpace;
switch (responseStatus)
case 1
Screen('DrawText', win, ['primary secondary : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 2
Screen('DrawText', win, ['------- secondary : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 3
Screen('DrawText', win, ['primary --------- : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 4
Screen('DrawText', win, ['------- --------- : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
end
Screen('TextStyle', win, bigTextStyle);
Screen('TextSize', win, bigTextSize);
y = y + sectionSpace;
Screen('DrawText', win, 'Recording', originX, y, textColor, bgColor);
Screen('TextStyle', win, textStyle);
Screen('TextSize', win, textSize);
case 'FirstLookRecorded'
[x, y] = Screen('DrawText', win, ['TEST TRIAL # ' int2str(trial)], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, ['DISPLAY IS: ' testEvent], originX, y, textColor, bgColor);
y = y + sectionSpace;
[x, y] = Screen('DrawText', win, 'STATUS: First look has been recorded.', originX, y, textColor, bgColor);
y = y + sectionSpace;
switch (responseStatus)
case 1
Screen('DrawText', win, ['primary secondary : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 2
Screen('DrawText', win, ['------- secondary : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 3
Screen('DrawText', win, ['primary --------- : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
case 4
Screen('DrawText', win, ['------- --------- : ' num2str(time, '%.1f')], originX, y, textColor, bgColor);
end
Screen('TextStyle', win, bigTextStyle);
Screen('TextSize', win, bigTextSize);
y = y + sectionSpace;
Screen('DrawText', win, 'Recording', originX, y, textColor, bgColor);
Screen('TextStyle', win, textStyle);
Screen('TextSize', win, textSize);
end
Screen('Flip', win);
end