1 | function hfcm2zero(varargin) |
---|
2 | %HFCM2ZERO - Set horizontal corrector strengths to zero |
---|
3 | % |
---|
4 | % hfcm2zero(fraction, nstep) |
---|
5 | % |
---|
6 | % INPUTS |
---|
7 | % 1. fract - fraction of corrector strength to put to zero |
---|
8 | % {1} means correctors set to zero |
---|
9 | % 0.5 means half of the corrector strength set to zero |
---|
10 | % 2. nstep - number of step for zeroing correctors {Default: 5} |
---|
11 | % 3. Optional - 'Interactive' Wait for user for each step {Default} |
---|
12 | % 'NoInteractive' pause 10 s for each step |
---|
13 | % |
---|
14 | % See Also vfcm2zero |
---|
15 | |
---|
16 | % |
---|
17 | % Written by Gregory J. Portmann |
---|
18 | % Adapted by Laurent S. Nadolski |
---|
19 | |
---|
20 | InteractiveFlag = 1; |
---|
21 | DefaultNstep = 10; |
---|
22 | iPause = 1; |
---|
23 | |
---|
24 | % Input Parser |
---|
25 | for i = length(varargin):-1:1 |
---|
26 | if strcmpi(varargin{i},'Interactive') |
---|
27 | InteractiveFlag = 1; |
---|
28 | varargin(i) = []; |
---|
29 | elseif strcmpi(varargin{i},'NoInteractive') |
---|
30 | InteractiveFlag = 0; |
---|
31 | varargin(i) = []; |
---|
32 | end |
---|
33 | end |
---|
34 | |
---|
35 | HCORFamily = 'FHCOR'; |
---|
36 | |
---|
37 | if length(varargin) < 1 |
---|
38 | fract = 1; |
---|
39 | else |
---|
40 | fract = varargin{1}; |
---|
41 | end |
---|
42 | |
---|
43 | if length(varargin) < 2 |
---|
44 | nstep = DefaultNstep; |
---|
45 | else |
---|
46 | nstep = varargin{2}; |
---|
47 | end |
---|
48 | |
---|
49 | |
---|
50 | fprintf('1/ Verifier que le FOFB est arrété\n') |
---|
51 | fprintf('2/ Mettre les alimentations des steerers en controle local via LabVIEW\n') |
---|
52 | fprintf('3/ Verifier que le SOFB tourne\n') |
---|
53 | fprintf('Si OK presser la touche Entree\n') |
---|
54 | pause |
---|
55 | |
---|
56 | |
---|
57 | fprintf('Lecture des courant des steerers\n') |
---|
58 | setpt = fract * getam(HCORFamily); |
---|
59 | |
---|
60 | for k = 1:nstep, |
---|
61 | if InteractiveFlag |
---|
62 | %disp([' Step ' num2str(k) ' of ' num2str(nstep) ' Hit Return key to continue (Ctrl-C to stop)']); |
---|
63 | disp([' Etape ' num2str(k) ' sur ' num2str(nstep) ' Presser Enter pour continuer (Ctrl-C to stop)']); |
---|
64 | pause; |
---|
65 | fprintf('Attendre durant l''application des consignes et vérifier l''orbite ...\n') |
---|
66 | setsp(HCORFamily, (1-k/nstep)*setpt, [], -1); |
---|
67 | else |
---|
68 | fprintf('Pause for %d s\n', iPause) |
---|
69 | setsp(HCORFamily, (1-k/nstep)*setpt, [], -1); |
---|
70 | pause(iPause) |
---|
71 | end |
---|
72 | end |
---|