Last change
on this file since 4 was
4,
checked in by zhangj, 10 years ago
|
Initial import--MML version from SOLEIL@2013
|
File size:
782 bytes
|
Line | |
---|
1 | function resErrorFlag = idSetUndParamSeq(idName, idParamVals) |
---|
2 | %Expected: idParamVals = {'phase', -40, 40, 1, 0.01} |
---|
3 | |
---|
4 | resErrorFlag = 0; |
---|
5 | resUnd = 0; |
---|
6 | |
---|
7 | paramName = idParamVals{1}; |
---|
8 | paramStart = idParamVals{2}; |
---|
9 | paramEnd = idParamVals{3}; |
---|
10 | paramStepApprox = idParamVals{4}; |
---|
11 | paramAbsTol = idParamVals{5}; |
---|
12 | |
---|
13 | numParamVals = abs(round((paramEnd - paramStart)/paramStepApprox)) + 1; |
---|
14 | paramStep = 0; |
---|
15 | if(numParamVals > 1) |
---|
16 | paramStep = (paramEnd - paramStart)/(numParamVals - 1); |
---|
17 | end |
---|
18 | |
---|
19 | curParamVal = paramStart; |
---|
20 | for k = 1:numParamVals |
---|
21 | resUnd = idSetUndParamSync(idName, paramName, curParamVal, paramAbsTol); |
---|
22 | if(resUnd ~= 0) |
---|
23 | fprintf('Execution terminated since Undulator Parameter can not be set\n'); |
---|
24 | resErrorFlag = -1; return; |
---|
25 | end |
---|
26 | curParamVal = curParamVal + paramStep; |
---|
27 | end |
---|
Note: See
TracBrowser
for help on using the repository browser.