config_set.py
Go to the documentation of this file.
1 # -*- Python -*-
2 # -*- coding: utf-8 -*-
3 
4 '''rtctree
5 
6 Copyright (C) 2009-2014
7  Geoffrey Biggs
8  RT-Synthesis Research Group
9  Intelligent Systems Research Institute,
10  National Institute of Advanced Industrial Science and Technology (AIST),
11  Japan
12  All rights reserved.
13 Licensed under the Eclipse Public License -v 1.0 (EPL)
14 http://www.opensource.org/licenses/eclipse-1.0.txt
15 
16 Object representing a configuration set.
17 
18 '''
19 
20 
21 from rtctree.utils import dict_to_nvlist
22 
23 ##############################################################################
24 ## Configuration set object
25 
27  '''A class representing a configuration set.'''
28  def __init__(self, owner=None, object=None, description=None, data=None,
29  *args, **kwargs):
30  '''Constructor.
31 
32  @param owner The owner of this configuration set, if any. Should be a
33  Component object or None.
34  @param object The CORBA ConfigurationSet object to wrap.
35  @param description A description of this configuration set.
36  @param data The dictionary containing the parameters and their values
37  of this configuration set.
38 
39  '''
40  super(ConfigurationSet, self).__init__(*args, **kwargs)
41  self._owner = owner
42  self._object = object
43  self._description = description
44  self._data = data
45 
46  def has_param(self, param):
47  '''Check if this configuration set has the given parameter.'''
48  return param in self.data
49 
50  def set_param(self, param, value):
51  '''Set a parameter in this configuration set.'''
52  self.data[param] = value
53  self._object.configuration_data = dict_to_nvlist(self.data)
54 
55  @property
56  def data(self):
57  '''Read-only access to the configuration set's parameters.'''
58  return self._data
59 
60  @property
61  def description(self):
62  '''Read-only access to the configuration set's description.'''
63  return self._description
64 
65  @property
66  def object(self):
67  '''The CORBA ConfigurationSet object this object wraps.'''
68  return self._object
69 
70  def _reload(self, object, description, data):
71  '''Reload the configuration set data.'''
72  self._object = object
73  self._description = description
74  self._data = data
75 
76 
77 # vim: tw=79
78 
def set_param(self, param, value)
Definition: config_set.py:50
Configuration set object.
Definition: config_set.py:26
def dict_to_nvlist(dict)
Definition: utils.py:161
def __init__(self, owner=None, object=None, description=None, data=None, args, kwargs)
Definition: config_set.py:29
def _reload(self, object, description, data)
Definition: config_set.py:70


rtctree
Author(s): Geoffrey Biggs
autogenerated on Fri Jun 7 2019 21:56:24