source: MML/trunk/mml/links/tango/tango_set_attribute_property.m @ 4

Last change on this file since 4 was 4, checked in by zhangj, 11 years ago

Initial import--MML version from SOLEIL@2013

File size: 1.1 KB
Line 
1function tango_set_attribute_property(FamilyName, property, strvalue)
2%TANGO_SET_ATTRIBUTE_PROPERTY - Set an attribute property to a given value
3% tango_set_attribute_property(FamilyName, value)
4%
5% INPUTS
6% 1. FamilyName
7% 2. property to set
8% 3. strvalue - values to set
9%
10% EXAMPLES
11% 1. tango_set_attribute_property('BEND','max_value','600')
12%
13% See also tango_get_attribute_property
14
15%
16% Written by Laurent S. Nadolski
17
18if nargin < 3
19    error('Not enough arguments')
20end
21
22if isfamily(FamilyName)
23    name = family2tango(FamilyName);
24else %not a family name
25    name = FamilyName;
26end
27
28[attrlist devlist] = getattribute(name);
29
30nb = length(devlist);
31
32if size(strvalue,1) == 1
33    strlist = cellstr(repmat(strvalue,nb,1));
34else
35    strlist = strvalue;
36end
37
38%%%
39for k = 1:nb
40    dev = devlist{k,:};
41    attr = attrlist{k,:};
42    attr_config = tango_get_attribute_config(dev,attr);
43    attr_config.(property) = strlist{k};
44    tango_set_attribute_config(dev,attr_config);
45    if (tango_error == -1)
46        %- handle error
47        tango_print_error_stack;
48        fprintf(1,'TracyServer Error %s\n',dev)
49        return;
50    end
51end
Note: See TracBrowser for help on using the repository browser.