Qudi
Public Member Functions | Public Attributes | List of all members
core.mapper.Mapper Class Reference

Public Member Functions

def __init__ (self, kwargs)
 
def add_mapping (self, widget, model, model_getter, model_property_notifier=None, model_setter=None, widget_property_name='', widget_property_notifier=None, converter=None)
 Adds a mapping. More...
 
def clear_mapping (self)
 Clears all mappings.
 
def remove_mapping (self, widget, widget_property_name='')
 Removes the mapping which maps the QtWidget widget to some model data. More...
 
def submit_policy (self)
 Returns the submit policy.
 
def submit_policy (self, policy)
 Sets submit policy. More...
 
def submit (self)
 Submits the current values stored in the widgets to the models.
 
def revert (self)
 Takes the data stored in the models and displays them in the widgets.
 

Public Attributes

 submit_policy
 

Member Function Documentation

◆ add_mapping()

def core.mapper.Mapper.add_mapping (   self,
  widget,
  model,
  model_getter,
  model_property_notifier = None,
  model_setter = None,
  widget_property_name = '',
  widget_property_notifier = None,
  converter = None 
)

Adds a mapping.

Parameters

widget QtWidget A widget displaying some data. You want to map this widget to model data model object Instance of a class holding model data (e.g. a logic or hardware module) model_getter property/callable either a property holding the data to be displayed in widget or a getter method to retrieve data from the model was changed. model_property_notifier Signal A signal that is fired when the data was changed. Default None. If None then data changes are not monitored and the widget is not updated. model_setter callable A setter method which is called to set data to the model. If model_getter is a property the setter can be determined from this property and model_setter is ignored if it is None. If it is not None always this callable is used. Default None widget_property_name str The name of the pyqtProperty of the widget used to map the data. Default '' If it is an empty string the relevant property is guessed from the widget's type. widget_property_notifier Signal Notifier signal which is fired by the widget when the data changed. If None this is determined directly from the property. Example usage: QLineEdit().editingFinished Default None converter Converter converter instance for converting data between widget display and model. Default None

◆ remove_mapping()

def core.mapper.Mapper.remove_mapping (   self,
  widget,
  widget_property_name = '' 
)

Removes the mapping which maps the QtWidget widget to some model data.

Parameters

widget QtWidget/(QtWidget, str) widget the mapping is attached to or a tuple containing the widget and the widget's property name widget_property_name str name of the property of the widget we are dealing with. If '' it will be determined from the widget. Default ''

◆ submit_policy()

def core.mapper.Mapper.submit_policy (   self,
  policy 
)

Sets submit policy.

Submit policy can either be SUBMIT_POLICY_AUTO or SUBMIT_POLICY_MANUAL. If the submit policy is auto then changes in the widgets are automatically submitted to the model. If manual call submit() to submit it.

Parameters

policy enum submit policy


The documentation for this class was generated from the following file: