Skip to content

Commit 6406ab4

Browse files
committed
refactor talkToMe
1 parent 738c691 commit 6406ab4

File tree

3 files changed

+21
-31
lines changed

3 files changed

+21
-31
lines changed

src/createFilename.m

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,20 @@
4747

4848
cfg = setFilenames(cfg);
4949

50-
talkToMe(cfg);
50+
talkToMe(cfg, sprintf('\nData will be saved in this directory:\n\t%s\n', ...
51+
fullfile(cfg.dir.outputSubject, cfg.fileName.modality)));
52+
53+
talkToMe(cfg, sprintf('\nData will be saved in this file:\n\t%s\n', cfg.fileName.events));
54+
55+
if cfg.eyeTracker.do
56+
57+
talkToMe(cfg, sprintf('\nEyetracking data will be saved in this directory:\n\t%s\n', ...
58+
fullfile(cfg.dir.outputSubject, 'eyetracker')));
59+
60+
talkToMe(cfg, sprintf('\nEyetracking data will be saved in this file:\n\t%s\n', ...
61+
cfg.fileName.eyetracker));
62+
63+
end
5164

5265
cfg = orderfields(cfg);
5366
cfg.fileName = orderfields(cfg.fileName);
@@ -214,27 +227,3 @@
214227
end
215228

216229
end
217-
218-
function talkToMe(cfg)
219-
220-
if cfg.verbose > 0
221-
222-
fprintf(1, '\nData will be saved in this directory:\n\t%s\n', ...
223-
fullfile(cfg.dir.outputSubject, cfg.fileName.modality));
224-
225-
fprintf(1, '\nData will be saved in this file:\n\t%s\n', ...
226-
cfg.fileName.events);
227-
228-
if cfg.eyeTracker.do
229-
230-
fprintf(1, '\nEyetracking data will be saved in this directory:\n\t%s\n', ...
231-
fullfile(cfg.dir.outputSubject, 'eyetracker'));
232-
233-
fprintf(1, '\nEyetracking data will be saved in this file:\n\t%s\n', ...
234-
cfg.fileName.eyetracker);
235-
236-
end
237-
238-
end
239-
240-
end

src/saveEventsFile.m

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,3 @@ function warningSaveEventsFile(cfg, identifier, warningMessage)
545545

546546
end
547547
end
548-
549-
function talkToMe(cfg, message)
550-
if cfg.verbose > 0
551-
fprintf(1, message);
552-
end
553-
end

src/utils/talkToMe.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
% (C) Copyright 2020 CPP_BIDS developers
2+
3+
function talkToMe(cfg, message)
4+
if cfg.verbose > 0
5+
fprintf(1, message);
6+
end
7+
end

0 commit comments

Comments
 (0)