1 | function FileName=idGetFFWDTableFullFileName(idName, CorrectorName, idMode) |
---|
2 | % Written by F. Briquez 30/03/2011 |
---|
3 | % 1) Inputs : idName : such as 'HU36_SIRIUS' |
---|
4 | % : CorrectorName : 'CHE', 'CHS', 'CVE' or 'CVS' |
---|
5 | % : idMode : 'ii', 'x', 'i2' or 'x2' for parallel or anti-parallel normal/advanced modes. |
---|
6 | % (Not case-sensitive) |
---|
7 | % 2) Output : String containing full file name of FFWD table used by the device |
---|
8 | % such as : |
---|
9 | % '/usr/Local/configFiles/InsertionFFTables/ANS-C15-HU36/FF_PARALLEL_CHE_TABLE.txt' |
---|
10 | % 3) Returns empty string '' in case of wrong input. |
---|
11 | |
---|
12 | FileName=''; |
---|
13 | |
---|
14 | Directory=idGetFFWDTableDirectory(idName); |
---|
15 | if (isempty(Directory)) |
---|
16 | fprintf ('Error in ''idGetFFWDTableFullFileName'' : wrong idName ''%s''\n', idName); |
---|
17 | return |
---|
18 | end |
---|
19 | if (strcmpi(CorrectorName, 'CVE')==0&&strcmpi(CorrectorName, 'CHE')==0&&strcmpi(CorrectorName, 'CVS')==0&&strcmpi(CorrectorName, 'CHS')==0) |
---|
20 | fprintf('Error in ''idGetFFWDTableFullFileName'' : Wrong corrector name\n') |
---|
21 | return |
---|
22 | end |
---|
23 | if strcmpi(idMode, 'II') |
---|
24 | idMode='PARALLEL'; |
---|
25 | elseif strcmpi(idMode, 'X') |
---|
26 | idMode='ANTIPARALLEL'; |
---|
27 | elseif strcmpi(idMode, 'I2') |
---|
28 | idMode='PARALLEL2'; |
---|
29 | elseif strcmpi(idMode, 'X2') |
---|
30 | idMode='ANTIPARALLEL2'; |
---|
31 | else fprintf('Error in ''idGetFFWDTableFullFileName'' : Wrong mode. It should be ''ii'' or ''x'' (not case-sensitive)\n') |
---|
32 | return |
---|
33 | end |
---|
34 | FileName=sprintf('FF_%s_%s_TABLE.txt', idMode, CorrectorName); |
---|
35 | FileName=fullfile(Directory, FileName); |
---|
36 | end |
---|