|
1 | 1 | function user_feedback( sanity_table, switcher ) |
2 | | -%USER_FEEDBACK informs the user if his input is correct |
| 2 | +%USER_FEEDBACK informs the user if (and where) his input is wrong |
3 | 3 |
|
4 | 4 | switch switcher |
5 | 5 | case 1 |
6 | 6 | %% General Settings |
7 | 7 | % Path Errors |
8 | 8 | if ~sanity_table(1) |
9 | | - errordlg('File not found. Specify a correct file path for Animal Groups','File error'); |
10 | | - elseif ~sanity_table(2) |
11 | 9 | errordlg('Folder not found. Specify a correct folder path for Trajectory Data','Path error'); |
12 | | - elseif ~sanity_table(3) |
| 10 | + elseif ~sanity_table(2) |
13 | 11 | errordlg('Folder not found. Specify a correct Output Folder path','Path error'); |
14 | 12 | % Files Format Errors |
15 | | - elseif ~sanity_table(4) |
| 13 | + elseif ~sanity_table(3) |
16 | 14 | errordlg('ID Field. Field needs to contain the animal id field name as specified in the csv file','Input Error'); |
17 | | - elseif ~sanity_table(5) |
18 | | - errordlg('Group Field. Field needs to contain the animal group field name as specified in the csv file','Input Error'); |
19 | | - elseif ~sanity_table(6) |
| 15 | + elseif ~sanity_table(4) |
20 | 16 | errordlg('Rec Time Field. Field needs to contain the recorded time field name as specified in the csv file','Input Error'); |
21 | | - elseif ~sanity_table(7) |
| 17 | + elseif ~sanity_table(5) |
22 | 18 | errordlg('X Field. Field needs to contain the X coordinates field name as specified in the csv file','Input Error'); |
23 | | - elseif ~sanity_table(8) |
| 19 | + elseif ~sanity_table(6) |
24 | 20 | errordlg('Y Field. Field needs to contain the Y coordinates field name as specified in the csv file','Input Error'); |
25 | 21 | % Experiment Settings Errors |
26 | | - elseif ~sanity_table(9) |
| 22 | + elseif ~sanity_table(7) |
27 | 23 | errordlg('Sessions. Field needs to contain a numerical value','Input Error'); |
28 | | - elseif ~sanity_table(10) |
| 24 | + elseif ~sanity_table(9) |
29 | 25 | errordlg('Days. Field needs to contain a numerical value','Input Error'); |
30 | | - elseif ~sanity_table(11) |
31 | | - errordlg('Trials per Session. The arguments needs to be numbericals and the number of arguments needs to be equal to the number of Sessions','Input Error'); |
| 26 | + elseif ~sanity_table(8) |
| 27 | + errordlg('Trials per Day. The arguments needs to be numbericals and the number of arguments needs to be equal to the number of Days','Input Error'); |
32 | 28 | % Experiment Properties Errors |
33 | | - elseif ~sanity_table(12) |
| 29 | + elseif ~sanity_table(10) |
34 | 30 | errordlg('Trial timeout. Field needs to contain a numerical value','Input Error'); |
35 | | - elseif ~sanity_table(13) |
| 31 | + elseif ~sanity_table(11) |
36 | 32 | errordlg('Centre X. Field needs to contain a numerical value','Input Error'); |
37 | | - elseif ~sanity_table(14) |
| 33 | + elseif ~sanity_table(12) |
38 | 34 | errordlg('Centre Y. Field needs to contain a numerical value','Input Error'); |
39 | | - elseif ~sanity_table(15) |
| 35 | + elseif ~sanity_table(13) |
40 | 36 | errordlg('Arena radius. Field needs to contain a numerical value','Input Error'); |
41 | | - elseif ~sanity_table(16) |
| 37 | + elseif ~sanity_table(14) |
42 | 38 | errordlg('Platform X. Field needs to contain a numerical value','Input Error'); |
43 | | - elseif ~sanity_table(17) |
| 39 | + elseif ~sanity_table(15) |
44 | 40 | errordlg('Platform Y. Field needs to contain a numerical value','Input Error'); |
45 | | - elseif ~sanity_table(18) |
| 41 | + elseif ~sanity_table(16) |
46 | 42 | errordlg('Platform radius. Field needs to contain a numerical value','Input Error'); |
47 | 43 | end |
48 | 44 |
|
49 | 45 | case 2 |
50 | | - %% Segmentation |
| 46 | + %% General Settings |
51 | 47 | % Path Errors |
52 | 48 | if ~sanity_table(1) |
53 | | - errordlg('File not found. Specify a correct file path for Animal Groups','File error'); |
54 | | - elseif ~sanity_table(2) |
55 | 49 | errordlg('Folder not found. Specify a correct folder path for Trajectory Data','Path error'); |
56 | | - elseif ~sanity_table(3) |
| 50 | + elseif ~sanity_table(2) |
57 | 51 | errordlg('Folder not found. Specify a correct Output Folder path','Path error'); |
58 | 52 | % Files Format Errors |
59 | | - elseif ~sanity_table(4) |
| 53 | + elseif ~sanity_table(3) |
60 | 54 | errordlg('ID Field. Field needs to contain the animal id field name as specified in the csv file','Input Error'); |
61 | | - elseif ~sanity_table(5) |
62 | | - errordlg('Group Field. Field needs to contain the animal group field name as specified in the csv file','Input Error'); |
63 | | - elseif ~sanity_table(6) |
| 55 | + elseif ~sanity_table(4) |
64 | 56 | errordlg('Rec Time Field. Field needs to contain the recorded time field name as specified in the csv file','Input Error'); |
65 | | - elseif ~sanity_table(7) |
| 57 | + elseif ~sanity_table(5) |
66 | 58 | errordlg('X Field. Field needs to contain the X coordinates field name as specified in the csv file','Input Error'); |
67 | | - elseif ~sanity_table(8) |
| 59 | + elseif ~sanity_table(6) |
68 | 60 | errordlg('Y Field. Field needs to contain the Y coordinates field name as specified in the csv file','Input Error'); |
69 | 61 | % Experiment Settings Errors |
70 | | - elseif ~sanity_table(9) |
| 62 | + elseif ~sanity_table(7) |
71 | 63 | errordlg('Sessions. Field needs to contain a numerical value','Input Error'); |
72 | | - elseif ~sanity_table(10) |
| 64 | + elseif ~sanity_table(9) |
73 | 65 | errordlg('Days. Field needs to contain a numerical value','Input Error'); |
74 | | - elseif ~sanity_table(11) |
75 | | - errordlg('Trials per Session. The arguments needs to be numbericals and the number of arguments needs to be equal to the number of Sessions','Input Error'); |
| 66 | + elseif ~sanity_table(8) |
| 67 | + errordlg('Trials per Day. The arguments needs to be numbericals and the number of arguments needs to be equal to the number of Days','Input Error'); |
76 | 68 | % Experiment Properties Errors |
77 | | - elseif ~sanity_table(12) |
| 69 | + elseif ~sanity_table(10) |
78 | 70 | errordlg('Trial timeout. Field needs to contain a numerical value','Input Error'); |
79 | | - elseif ~sanity_table(13) |
| 71 | + elseif ~sanity_table(11) |
80 | 72 | errordlg('Centre X. Field needs to contain a numerical value','Input Error'); |
81 | | - elseif ~sanity_table(14) |
| 73 | + elseif ~sanity_table(12) |
82 | 74 | errordlg('Centre Y. Field needs to contain a numerical value','Input Error'); |
83 | | - elseif ~sanity_table(15) |
| 75 | + elseif ~sanity_table(13) |
84 | 76 | errordlg('Arena radius. Field needs to contain a numerical value','Input Error'); |
85 | | - elseif ~sanity_table(16) |
| 77 | + elseif ~sanity_table(14) |
86 | 78 | errordlg('Platform X. Field needs to contain a numerical value','Input Error'); |
87 | | - elseif ~sanity_table(17) |
| 79 | + elseif ~sanity_table(15) |
88 | 80 | errordlg('Platform Y. Field needs to contain a numerical value','Input Error'); |
89 | | - elseif ~sanity_table(18) |
90 | | - errordlg('Platform radius. Field needs to contain a numerical value','Input Error'); |
| 81 | + elseif ~sanity_table(16) |
| 82 | + errordlg('Platform radius. Field needs to contain a numerical value','Input Error'); |
91 | 83 | % Segmentation |
92 | 84 | elseif ~sanity_table(19) |
93 | 85 | errordlg('Segment length. Field needs to contain a numerical value','Input Error'); |
|
0 commit comments