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 tango_set_attribute_property</title> |
---|
6 | <meta name="keywords" content="tango_set_attribute_property"> |
---|
7 | <meta name="description" content="TANGO_SET_ATTRIBUTE_PROPERTY - Set an attribute property to a given value"> |
---|
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="../../index.html">mml</a> > <a href="#">links</a> > <a href="index.html">tango</a> > tango_set_attribute_property.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 mml/links/tango <img alt=">" border="0" src="../../../right.png"></a></td></tr></table>--> |
---|
19 | |
---|
20 | <h1>tango_set_attribute_property |
---|
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>TANGO_SET_ATTRIBUTE_PROPERTY - Set an attribute property to a given value</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 tango_set_attribute_property(FamilyName, property, strvalue) </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">TANGO_SET_ATTRIBUTE_PROPERTY - Set an attribute property to a given value |
---|
31 | tango_set_attribute_property(FamilyName, value) |
---|
32 | |
---|
33 | INPUTS |
---|
34 | 1. FamilyName |
---|
35 | 2. property to set |
---|
36 | 3. strvalue - values to set |
---|
37 | |
---|
38 | EXAMPLES |
---|
39 | 1. tango_set_attribute_property('BEND','max_value','600') |
---|
40 | |
---|
41 | See also <a href="tango_get_attribute_property.html" class="code" title="function attr_prop = tango_get_attribute_property(varargin)">tango_get_attribute_property</a></pre></div> |
---|
42 | |
---|
43 | <!-- crossreference --> |
---|
44 | <h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
45 | This function calls: |
---|
46 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
47 | <li><a href="family2tango.html" class="code" title="function [TangoNames, ErrorFlag] = family2tango(varargin)">family2tango</a> FAMILY2TANGO - Converts a familly to TANGO names</li><li><a href="getattribute.html" class="code" title="function [AttributeNames, DeviceNames] = getattribute(varargin)">getattribute</a> GETATTRIBUTE - Decomposes a full attributename into device and attribute names</li></ul> |
---|
48 | This function is called by: |
---|
49 | <ul style="list-style-image:url(../../../matlabicon.gif)"> |
---|
50 | </ul> |
---|
51 | <!-- crossreference --> |
---|
52 | |
---|
53 | |
---|
54 | <h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../../up.png"></a></h2> |
---|
55 | <div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function tango_set_attribute_property(FamilyName, property, strvalue)</a> |
---|
56 | 0002 <span class="comment">%TANGO_SET_ATTRIBUTE_PROPERTY - Set an attribute property to a given value</span> |
---|
57 | 0003 <span class="comment">% tango_set_attribute_property(FamilyName, value)</span> |
---|
58 | 0004 <span class="comment">%</span> |
---|
59 | 0005 <span class="comment">% INPUTS</span> |
---|
60 | 0006 <span class="comment">% 1. FamilyName</span> |
---|
61 | 0007 <span class="comment">% 2. property to set</span> |
---|
62 | 0008 <span class="comment">% 3. strvalue - values to set</span> |
---|
63 | 0009 <span class="comment">%</span> |
---|
64 | 0010 <span class="comment">% EXAMPLES</span> |
---|
65 | 0011 <span class="comment">% 1. tango_set_attribute_property('BEND','max_value','600')</span> |
---|
66 | 0012 <span class="comment">%</span> |
---|
67 | 0013 <span class="comment">% See also tango_get_attribute_property</span> |
---|
68 | 0014 |
---|
69 | 0015 <span class="comment">%</span> |
---|
70 | 0016 <span class="comment">% Written by Laurent S. Nadolski</span> |
---|
71 | 0017 |
---|
72 | 0018 <span class="keyword">if</span> nargin < 3 |
---|
73 | 0019 error(<span class="string">'Not enough arguments'</span>) |
---|
74 | 0020 <span class="keyword">end</span> |
---|
75 | 0021 |
---|
76 | 0022 <span class="keyword">if</span> isfamily(FamilyName) |
---|
77 | 0023 name = <a href="family2tango.html" class="code" title="function [TangoNames, ErrorFlag] = family2tango(varargin)">family2tango</a>(FamilyName); |
---|
78 | 0024 <span class="keyword">else</span> <span class="comment">%not a family name</span> |
---|
79 | 0025 name = FamilyName; |
---|
80 | 0026 <span class="keyword">end</span> |
---|
81 | 0027 |
---|
82 | 0028 [attrlist devlist] = <a href="getattribute.html" class="code" title="function [AttributeNames, DeviceNames] = getattribute(varargin)">getattribute</a>(name); |
---|
83 | 0029 |
---|
84 | 0030 nb = length(devlist); |
---|
85 | 0031 |
---|
86 | 0032 <span class="keyword">if</span> size(strvalue,1) == 1 |
---|
87 | 0033 strlist = cellstr(repmat(strvalue,nb,1)); |
---|
88 | 0034 <span class="keyword">else</span> |
---|
89 | 0035 strlist = strvalue; |
---|
90 | 0036 <span class="keyword">end</span> |
---|
91 | 0037 |
---|
92 | 0038 <span class="comment">%%%</span> |
---|
93 | 0039 <span class="keyword">for</span> k = 1:nb |
---|
94 | 0040 dev = devlist{k,:}; |
---|
95 | 0041 attr = attrlist{k,:}; |
---|
96 | 0042 attr_config = tango_get_attribute_config(dev,attr); |
---|
97 | 0043 attr_config.(property) = strlist{k}; |
---|
98 | 0044 tango_set_attribute_config(dev,attr_config); |
---|
99 | 0045 <span class="keyword">if</span> (tango_error == -1) |
---|
100 | 0046 <span class="comment">%- handle error</span> |
---|
101 | 0047 tango_print_error_stack; |
---|
102 | 0048 fprintf(1,<span class="string">'TracyServer Error %s\n'</span>,dev) |
---|
103 | 0049 <span class="keyword">return</span>; |
---|
104 | 0050 <span class="keyword">end</span> |
---|
105 | 0051 <span class="keyword">end</span></pre></div> |
---|
106 | <hr><address>Generated on Mon 21-May-2007 15:29:18 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address> |
---|
107 | </body> |
---|
108 | </html> |
---|