1 | function [strAllFileNames, res] = idMeasCorEffic(idName, tableCorCur, inclPerturbMeas, fileNameCore, dispData) |
---|
2 | res = -1; |
---|
3 | |
---|
4 | numMeas = length(tableCorCur); |
---|
5 | timeStandBy = 10; |
---|
6 | curAbsTol = 0.001; |
---|
7 | curToSetCHE = 0; |
---|
8 | curToSetCVE = 0; |
---|
9 | curToSetCHS = 0; |
---|
10 | curToSetCVS = 0; |
---|
11 | fileNameCoreWithCor = fileNameCore; |
---|
12 | strCor = ''; |
---|
13 | %strAllFileNames = {}; |
---|
14 | strAllFileNames = ''; |
---|
15 | |
---|
16 | for i = 1:numMeas |
---|
17 | curToSetCHE = tableCorCur(i, 1); |
---|
18 | curToSetCVE = tableCorCur(i, 2); |
---|
19 | curToSetCHS = tableCorCur(i, 3); |
---|
20 | curToSetCVS = tableCorCur(i, 4); |
---|
21 | |
---|
22 | if (dispData ~= 0) |
---|
23 | fprintf('\nCurrents: CHE = %f, CVE = %f, CHS = %f, CVS = %f\n', curToSetCHE, curToSetCVE, curToSetCHS, curToSetCVS); |
---|
24 | end |
---|
25 | |
---|
26 | res = idSetCorCurSync(idName, curToSetCHE, curToSetCVE, curToSetCHS, curToSetCVS, curAbsTol); |
---|
27 | if (res ~= 0) |
---|
28 | fprintf('Failed to set the current values: %f %f %f %f\nLoop on the current values has stopped abnormally\n', curToSetCHE, curToSetCVE, curToSetCHS, curToSetCVS); |
---|
29 | return; |
---|
30 | end |
---|
31 | |
---|
32 | strCor = sprintf('_he%i_ve%i_hs%i_vs%i', curToSetCHE, curToSetCVE, curToSetCHS, curToSetCVS); |
---|
33 | fileNameCoreWithCor = strcat(fileNameCore, strCor); |
---|
34 | |
---|
35 | pause(timeStandBy); |
---|
36 | |
---|
37 | EIaux = idMeasElecBeamUnd(idName, inclPerturbMeas, fileNameCoreWithCor, dispData); |
---|
38 | |
---|
39 | if (strcmp(EIaux.file, '') == 0) |
---|
40 | if(length(strAllFileNames) > 0) |
---|
41 | strAllFileNames = strcat(strAllFileNames, '\n'); |
---|
42 | end |
---|
43 | strAllFileNames = strcat(strAllFileNames, EIaux.file); |
---|
44 | strAllFileNames = sprintf(strAllFileNames); |
---|
45 | %strAllFileNames{i} = EIaux.file; |
---|
46 | end |
---|
47 | end |
---|
48 | |
---|
49 | res = idSetCorCurSync(idName, 0, 0, 0, 0, curAbsTol); |
---|
50 | if (res ~= 0) |
---|
51 | fprintf('Failed to set the current values: 0 0 0 0\n'); |
---|
52 | end |
---|
53 | |
---|
54 | if (strcmp(strAllFileNames, '') == 0) |
---|
55 | %if (length(strAllFileNames) > 0) |
---|
56 | auxListStruct.file = strAllFileNames; |
---|
57 | fileNameCoreList = strcat(fileNameCore, '_cor_meas_list'); |
---|
58 | idSaveStruct(auxListStruct, fileNameCoreList, idName, 0); |
---|
59 | end |
---|