openalea.core.control package#
Submodules#
openalea.core.control.all module#
openalea.core.control.control module#
Control
- class openalea.core.control.control.Control(name, interface=None, value=None, widget=None, constraints=None, **kwds)[source]#
Bases:
Observed- A Control is an observable variable with
name
interface
constraints on values
- property default#
- property identifier#
- property interface#
- property label#
- property name#
- set_value(value)[source]#
TODO: CPL: To discuss !!!! Deepcopy or not ? Currently, standard python behaviour: copy for non mutable else reference
- property value#
openalea.core.control.manager module#
- class openalea.core.control.manager.ControlContainer[source]#
Bases:
Observed,AbstractListener>>> from openalea.core.control.manager import ControlContainer
- add(name, **kwds)[source]#
Convenience method to create a control and add it to container. See
Control.>>> container = ControlContainer() >>> container.add('i', interface='IInt', value=1) Control('i', IInt, value=1)
- Parameters:
name – Control name
kwds – Control keywords like interface, value, …
- changed()[source]#
Like
namespace()but dictionnary contains only controls with value different than default value.
- control(name=None, uid=None)[source]#
Return all control with name “name”. If no control found, returns None, if only one found, returns it else return a list of control.
If uid is passed, returns corresponding control or None if not found. If uid is passed, it never returns a list as uid is unique.
- namespace(interface=None)[source]#
Returns namespace (dict control name -> value). :param tag: returns namespace corresponding to given tag.
Default, returns global namespace
- notify(sender, event)[source]#
This function is called by observed objects
- Parameters:
sender – the observed object which send notification
event – the data associated to the notification
- update(dic)[source]#
Update controls with dict values. If a name is not referenced in ControlContainer, nothing is done.
Note
Example:
Let “container” a Container with one control “a” with value 1:
container: - a:IInt = 1
after container.update({‘a’:2, ‘b’:3}) we get
- container:
a:IInt = 2
- Parameters:
dic –
dictname -> value
- class openalea.core.control.manager.ControlManager(*args, **kw)[source]#
Bases:
ControlContainer
- class openalea.core.control.manager.Follower(name, func)[source]#
Bases:
AbstractListener- notify(*args, **kwargs)#
This function is called by observed objects
- Parameters:
sender – the observed object which send notification
event – the data associated to the notification
openalea.core.control.pyserial module#
openalea.core.control.serialization module#
- class openalea.core.control.serialization.ControlDeserializer[source]#
Bases:
AbstractDeserializer
- class openalea.core.control.serialization.ControlLoader[source]#
Bases:
AbstractLoader- dtype = 'IControl'#
- protocols = ['text/x-python']#
- class openalea.core.control.serialization.ControlSaver[source]#
Bases:
AbstractSaver- dtype = 'IControl'#
- protocols = ['text/x-python']#