1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/REC-html40/loose.dtd"> |
---|
3 | <html> |
---|
4 | <head> |
---|
5 | <title>Description of createcyclecurvefull</title> |
---|
6 | <meta name="keywords" content="createcyclecurvefull"> |
---|
7 | <meta name="description" content="INPUTS"> |
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
9 | <meta name="generator" content="m2html © 2003 Guillaume Flandin"> |
---|
10 | <meta name="robots" content="index, follow"> |
---|
11 | <link type="text/css" rel="stylesheet" href="../../../../m2html.css"> |
---|
12 | </head> |
---|
13 | <body> |
---|
14 | <a name="_top"></a> |
---|
15 | <div><a href="../../../../index.html">Home</a> > <a href="#">machine</a> > <a href="#">Soleil</a> > <a href="../index.html">common</a> > <a href="index.html">cycling</a> > createcyclecurvefull.m</div> |
---|
16 | |
---|
17 | <!--<table width="100%"><tr><td align="left"><a href="../../../../index.html"><img alt="<" border="0" src="../../../../left.png"> Master index</a></td> |
---|
18 | <td align="right"><a href="index.html">Index for machine/Soleil/common/cycling <img alt=">" border="0" src="../../../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>createcyclecurvefull |
---|
21 | </h1> |
---|
22 | |
---|
23 | <h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
24 | <div class="box"><strong>INPUTS</strong></div> |
---|
25 | |
---|
26 | <h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
27 | <div class="box"><strong>function createcylecurvefull(varargin); </strong></div> |
---|
28 | |
---|
29 | <h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
30 | <div class="fragment"><pre class="comment"> INPUTS |
---|
31 | 1. Family</pre></div> |
---|
32 | |
---|
33 | <!-- crossreference --> |
---|
34 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
35 | This function calls: |
---|
36 | <ul style="list-style-image:url(../../../../matlabicon.gif)"> |
---|
37 | <li><a href="setcyclecurve.html" class="code" title="function setcyclecurve(dev_name, curve)">setcyclecurve</a> SETCYCLECURVE - Set curve for cycling magnet in Dserver</li></ul> |
---|
38 | This function is called by: |
---|
39 | <ul style="list-style-image:url(../../../../matlabicon.gif)"> |
---|
40 | </ul> |
---|
41 | <!-- crossreference --> |
---|
42 | |
---|
43 | <h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
44 | <ul style="list-style-image:url(../../../../matlabicon.gif)"> |
---|
45 | <li><a href="#_sub1" class="code">function curve = makecurve(Inom,Imax,MagnetType)</a></li></ul> |
---|
46 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../../up.png"></a></h2> |
---|
47 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function createcylecurvefull(varargin);</a> |
---|
48 | 0002 <span class="comment">% INPUTS</span> |
---|
49 | 0003 <span class="comment">%1. Family</span> |
---|
50 | 0004 |
---|
51 | 0005 DisplayFlag = 1; |
---|
52 | 0006 |
---|
53 | 0007 <span class="comment">% Parse input options</span> |
---|
54 | 0008 InputFlags = {}; |
---|
55 | 0009 <span class="keyword">for</span> i = length(varargin):-1:1 |
---|
56 | 0010 <span class="keyword">if</span> strcmpi(varargin{i},<span class="string">'Display'</span>) |
---|
57 | 0011 DisplayFlag = 1; |
---|
58 | 0012 varargin(i) = []; |
---|
59 | 0013 <span class="keyword">elseif</span> strcmpi(varargin{i},<span class="string">'NoDisplay'</span>) |
---|
60 | 0014 DisplayFlag = 0; |
---|
61 | 0015 varargin(i) = []; |
---|
62 | 0016 <span class="keyword">end</span> |
---|
63 | 0017 <span class="keyword">end</span> |
---|
64 | 0018 |
---|
65 | 0019 <span class="comment">%% Load Golden Magnet parameters</span> |
---|
66 | 0020 |
---|
67 | 0021 FileName = getfamilydata(<span class="string">'OpsData'</span>, <span class="string">'LatticeFile'</span>); |
---|
68 | 0022 DirectoryName = getfamilydata(<span class="string">'Directory'</span>, <span class="string">'OpsData'</span>); |
---|
69 | 0023 cnf=load([DirectoryName FileName]); |
---|
70 | 0024 <span class="comment">%% Setpoints values</span> |
---|
71 | 0025 Setpoint = cnf.ConfigSetpoint; |
---|
72 | 0026 |
---|
73 | 0027 Family = varargin{1}; |
---|
74 | 0028 |
---|
75 | 0029 [FamilyIndex, AO] = isfamily(Family); |
---|
76 | 0030 <span class="keyword">if</span> isempty(FamilyIndex) |
---|
77 | 0031 error(<span class="string">'Unknown Family'</span>); |
---|
78 | 0032 <span class="keyword">end</span> |
---|
79 | 0033 |
---|
80 | 0034 <span class="comment">% create cycling family name</span> |
---|
81 | 0035 CycleFamily = [<span class="string">'Cycle'</span> Family]; |
---|
82 | 0036 [CycleIndex, CycleAO] = isfamily(CycleFamily); |
---|
83 | 0037 |
---|
84 | 0038 <span class="comment">%% Family switchyard</span> |
---|
85 | 0039 Inom = Setpoint.(Family).Data; |
---|
86 | 0040 <span class="keyword">if</span> (ismemberof(CycleFamily,<span class="string">'Cyclage'</span>)) |
---|
87 | 0041 <span class="keyword">for</span> k = 1:tango_group_size(CycleAO.GroupId) |
---|
88 | 0042 <span class="comment">%% PAS BEAU -- utiliser le mml pour etre sur de la correspondance</span> |
---|
89 | 0043 CycleAO.Inom(k) = cnf.ConfigSetpoint.(Family).Data(k); |
---|
90 | 0044 <span class="comment">%% create cycling curve</span> |
---|
91 | 0045 curve = <a href="#_sub1" class="code" title="subfunction curve = makecurve(Inom,Imax,MagnetType)">makecurve</a>(CycleAO.Inom(k),CycleAO.Imax(k),Family) |
---|
92 | 0046 <span class="comment">%% upload cycling curve</span> |
---|
93 | 0047 <span class="keyword">if</span> DisplayFlag |
---|
94 | 0048 fprintf(1,<span class="string">'device : Inom = %f Imax= %f \n'</span>, <span class="keyword">...</span> |
---|
95 | 0049 CycleAO.Inom(k), CycleAO.Imax(k)); |
---|
96 | 0050 plotcyclecurve(curve); |
---|
97 | 0051 <span class="keyword">end</span> |
---|
98 | 0052 reply = input(<span class="string">'Apply to Dserver new cycling curve ? (y/n)'</span>,<span class="string">'s'</span>); |
---|
99 | 0053 <span class="keyword">switch</span> lower(reply) |
---|
100 | 0054 <span class="keyword">case</span> {<span class="string">'Y'</span>,<span class="string">'Yes'</span>} |
---|
101 | 0055 <a href="setcyclecurve.html" class="code" title="function setcyclecurve(dev_name, curve)">setcyclecurve</a>(CycleFamily,curve); |
---|
102 | 0056 <span class="keyword">otherwise</span> |
---|
103 | 0057 disp(<span class="string">'Parameter not set to dserver'</span>) |
---|
104 | 0058 <span class="keyword">end</span> |
---|
105 | 0059 <span class="keyword">end</span> |
---|
106 | 0060 <span class="keyword">else</span> |
---|
107 | 0061 error(<span class="string">'Unknown Cycling Family'</span>) |
---|
108 | 0062 <span class="keyword">end</span> |
---|
109 | 0063 |
---|
110 | 0064 <span class="keyword">end</span> |
---|
111 | 0065 |
---|
112 | 0066 <a name="_sub1" href="#_subfunctions" class="code">function curve = makecurve(Inom,Imax,MagnetType)</a> |
---|
113 | 0067 |
---|
114 | 0068 <span class="keyword">switch</span> MagnetType |
---|
115 | 0069 <span class="keyword">case</span> {<span class="string">'BEND'</span>,<span class="string">'QP'</span>,<span class="string">'CH'</span>,<span class="string">'CV'</span>} |
---|
116 | 0070 curve = [[0 10] |
---|
117 | 0071 [Imax 180] |
---|
118 | 0072 [0.95*Inom 180] |
---|
119 | 0073 [1.05*Inom 180] |
---|
120 | 0074 [0.95*Inom 180] |
---|
121 | 0075 [1.05*Inom 180] |
---|
122 | 0076 [0.95*Inom 180] |
---|
123 | 0077 [Inom 180] ]; |
---|
124 | 0078 <span class="keyword">end</span> |
---|
125 | 0079 <span class="keyword">end</span> |
---|
126 | 0080</pre></div> |
---|
127 | <hr><address>Generated on Mon 21-May-2007 15:35:27 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
128 | </body> |
---|
129 | </html> |
---|