Bases: PyQt4.QtCore.QObject
The contexts current setup object.
Bases: PyQt4.QtCore.QObject
self, old, new
self, old, new
Bases: mesycontrol.app_model.AppObject
True if hardware and config values are equal.
Creates a config for this device using the default values from the device profile.
True if hardware and config IDCs differ.
Bases: object
Manages the app_model tree. Subscribes to changes to both the hardware and config trees and updates the app_model tree.
Bases: mesycontrol.app_model.AppObject
Bases: PyQt4.QtCore.QObject
Clears the memory cache. Returns True if any parameters where cleared. Otherwise False is returned.
Removes the cached memory value at the given address. Emits parameter_changed and returns True if the parameter was present in the memory cache. Otherwise False is returned.
Returns the integer value of the cached parameter at the given address or None if the parameter is not present in the cache. address must be within PARAM_RANGE, otherwise a ValueError will be raised.
Get a parameter from the devices memory cache if available. Otherwise use Device.read_parameter() to read the parameter from the hardware. Returns a ResultFuture whose result is a ReadResult instance.
memory
address, value
Read a parameter from the device. This method returns a ResultFuture whose result is a ReadResult instance. On read success the local memory cache is updated with the newly read value.
Bases: PyQt4.QtCore.QObject
Bases: PyQt4.QtCore.QObject
Manages MRC instances
Bases: mesycontrol.basic_model.ReadResult
The result type for a read operation. A namedtuple with added conversion to int.
Bases: mesycontrol.future.Future
Future subclass used to hold ReadResult/SetResult instances. This class adds an int() conversion method to easily obtain the result value.
Bases: mesycontrol.basic_model.SetResult
The result type for a set operation. Adds requested_value to the fields of ReadResult and conversions to int and bool. The bool conversion returns True if value equals requested value.
Bases: PyQt4.QtCore.QAbstractItemModel
Bases: object
Support class for implementing the nodes of a Qt tree model.
Find and return the node pointing to the given ref. If no node can be found None is returned.
Get this nodes model. If no model is set for this node return the parent nodes model. Return None if no model is set for the node hierarchy.
Get this nodes model. If no model is set for this node return the parent nodes model. Return None if no model is set for the node hierarchy.
No argument variant of notify_data_changed(). Useful to connect to signals whose arguments are to be discarded (the args would take the place of col1 and col2 which is not desired).
Calls notify_data_changed on the nodes model if a model is set. col1 and col2 specify the first and last column that changed. If col2 is None it will be set to the models column count. If the node has no model this method does nothing.
Bases: mesycontrol.config_util.GeneratorRunner
Bases: mesycontrol.config_util.GeneratorRunner
Bases: mesycontrol.config_util.GeneratorRunner
Bases: mesycontrol.config_util.GeneratorRunner
Bases: PyQt4.QtGui.QDialog
Bases: mesycontrol.basic_model.Device
Clears the memory cache. Returns True if any parameters where cleared. Otherwise False is returned.
Removes the cached memory value at the given address. Emits parameter_changed and returns True if the parameter was present in the memory cache. Otherwise False is returned.
Set the devices address. address must be within DEV_RANGE.
Set the devices bus number. Bus must be in BUS_RANGE.
Set the memory cache at the given address to the given value. Emits parameter_changed and returns True if the value changes. Otherwise no signal is emitted and False is returned. Raises ValueError if address is out of range.
Set the devices identifier code.
Bases: mesycontrol.basic_model.MRC
Bases: mesycontrol.basic_model.MRCRegistry
Bases: PyQt4.QtCore.QObject
Bases: exceptions.RuntimeError
Bases: exceptions.RuntimeError
Bases: object
Bases: exceptions.RuntimeError
Device may be an app_model.Device instance or a DeviceBase subclass.
Applies config values to the hardware for each of the given devices. Required MRC connections are established.
Write parameters from source to dest. First criticals are set to their safe value, then non_criticals are written to the destination and finally criticals are set to the value they have in the source device.
Bases: xml.etree.ElementTree.TreeBuilder
Load a Setup from the given source. Source may be a filename or a file like object.
Write the given device config to destination. The optional parameter_names should map parameter_address to parameter_name. These names will be added as comments in the resulting XML.
Bases: object
Device Identifier Code
Device name (e.g. MHV4). Should be unique.
Bases: object
Numeric address of the parameter.
True if this parameter affects a critical
True if this parameters value should not be stored
Index number of this parameter if it is part of a sequence
True if this parameter should be polled repeatedly.
Range instance limiting this parameters values.
True if this parameter is read only. Its
Optional safe value if this parameter is critical.
Optional list of Unit definitions for this parameter.
Bases: object
Provides access to device modules.
Returns a mapping of device_idc to a dictionary of param_address -> param_name. Basically the known parameter names for each device.
Bases: PyQt4.QtGui.QStyledItemDelegate
Bases: PyQt4.QtCore.QAbstractTableModel
Bases: PyQt4.QtGui.QSortFilterProxyModel
QSortFilterProxyModel subclass to be used with the DeviceTableView. Filtering capabilities:
- known addresses
- read / write addresses
- addresses with the poll flag set
Bases: object
A weak method implementation
Bases: mesycontrol.eventloop_callback.ref
Exactly like ref, but calling it will cause the referent method to be called with the same arguments. If the referent’s object no longer lives, ReferenceError is raised.
If quiet is True, then a ReferenceError is not raise and the callback silently fails if it is no longer valid.
Bases: PyQt4.QtCore.QEvent
A custom QEvent that contains a callback reference
Also provides class methods for conveniently executing arbitrary callback, to be dispatched to the event loop.
Bases: PyQt4.QtCore.QObject
Qt wrapper around a Future object using Qt signals to notify about state changes.
Bases: PyQt4.QtGui.QTextBrowser
Bases: PyQt4.QtGui.QWidget
Bases: PyQt4.QtGui.QMdiSubWindow
Updates the window title and the object name taking into account the display_mode and the device state.
Bases: PyQt4.QtGui.QPlainTextEdit
Bases: object
Link between hardware_model.MRC and MRCConnection. Reacts to changes to the connection state and updates the hardware model accordingly. Also takes requests from the hardware model and forwards them to the connection.
Add a poll subscription for the given (bus, address, item). Item may be a single parameter address or a tuple of (lower, upper) addresses to poll. The poll item is removed if the given subscriber is destroyed.
Read the parameter at (bus, device address). Returns a basic_model.ResultFuture containing a basic_model.ReadResult instance on success.
Bases: mesycontrol.basic_model.Device
Add parameters that should be polled repeatedly. As long as the given subscriber object is alive and the device is connected, the given item will be polled. Item may be a single parameter address or a tuple of (lower, upper) addresses to poll. If the server and mrc support reading parameter ranges and a tuple is given, the read range command will be used.
error object
Bases: mesycontrol.basic_model.MRC
future object
error object
Set the hardware controller this MRC should use. The MRC holds a strong reference to the controller.
Updates the local write access and can_acquire flags. Emits write_access_changed() if one of the two flags changed.
is_silenced
proto.MRCStatus
has_write_access, can_acquire
Bases: PyQt4.QtGui.QComboBox
QComboBox subclass which automatically shows its popup on receiving a non-spontaneous showEvent.
Bases: PyQt4.QtGui.QSplitter
QSplitter using DoubleClickSplitterHandles.
Bases: PyQt4.QtGui.QSplitterHandle
Double click support for QSplitterHandle. Emits the doubleClicked signal if a double click occured on the handle and the mouse button is released within 200ms (if the mouse button is not released the user is most likely dragging the handle).
Bases: object
Bases: PyQt4.QtGui.QStyledItemDelegate
Adds an MRC connection using the given url to the hardware_registry. If `do_connect’ is True this function will start a connection attempt and return the corresponding Future object. Otherwise the newly added MRC will be in disconnected state and None is returned.
Bases: PyQt4.QtCore.QObject
connected and ready to send requests
Establishing the connection. The argument is a
error object
disconnected; not ready to handle requests
Message
Message
Message
request, Future
request, Future
request, response, Future
Bases: mesycontrol.mrc_connection.AbstractConnection
delay between server startup and connection attempt
Connection factory. Supported keyword arguments in order of priority:
- config: MRCConnectionConfig instance specifying the details of the connection.
- url: A string that is passed to util.parse_connection_url(). The resulting dictionary will then be used to create the connection.
- mc_host, mc_port: Creates a MRCConnection to the given host and port.
- serial_port, baud_rate: Creates a LocalMRCConnection using the given serial port and baud rate.
- host, port: Creates a LocalMRCConnection connecting to the MRC on the given host and port.
Additionally ‘parent’ may specify a parent QObject for the resulting connection.
Bases: object
Adds a callback to be invoked when this binding updates its target.
The callback will be called with the result_future that caused the update as its first argument and the optional args and kwargs as the following arguments.
If the given method_or_func is a bound method a weak reference to the corresponding object will be stored. This way the parameter binding won’t keep any objects alive just because they’re registered as a callback.
http://stackoverflow.com/questions/1673483/how-to-store-callback-methods
Gets the value of this bindings parameter and updates the target display once the value is retrieved.
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: mesycontrol.parameter_binding.AbstractParameterBinding
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: exceptions.Exception
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: mesycontrol.parameter_binding.ReadWriteProfile
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
Bases: PyQt4.QtCore.QObject
Bases: mesycontrol.parameter_binding.DefaultParameterBinding
The default port to listen on
The maximum port number.
Bases: PyQt4.QtCore.QObject
exit_status, exit_code, exit_code_string
Bases: PyQt4.QtCore.QObject
Acts as a decorator for an app_model.Device. Should be subclassed to create device specific classes, e.g. class MHV4(DeviceBase).
self, old, new
self, old, new
Bases: PyQt4.QtCore.QObject
Mesycontrol TCP client
Connect to the given host and port. Returns a Future that fullfills once the connection has been established or an errors occurs. Disconnects if the client currently is connected.
Disconnect. Returns a Future that fullfills once the connection has been disconnected or an error occurs.
Message
Message
Message
Adds the given request to the outgoing queue. Returns a Future that fullfills once a response is received or an error occurs.
request, Future
request, Future
request, response, Future
instance of SocketError
Bases: logging.Handler
Logging handler passing log_records to callbacks.
Bases: PyQt4.QtGui.QDoubleSpinBox
Bases: PyQt4.QtGui.QSpinBox
Bases: object
Exception handler registry for use with sys.excepthook. Contains a list of handler objects which will get called in the order they where registered when an exception occurs.
Bases: PyQt4.QtGui.QWidget
Like a vertical QToolBar but having a fixed width. I did not manage to get a QToolBar to have a fixed width. That’s the only reason this class exists.
Bases: PyQt4.QtCore.QObject
Disable automatic garbage collection and instead collect manually every INTERVAL milliseconds.
This is done to ensure that garbage collection only happens in the GUI thread, as otherwise Qt can crash.
Bases: object
Log records with a level greater or equal to minimum_level will pass through this filter.
Bases: PyQt4.QtCore.QObject
Bases: PyQt4.QtGui.QWidget
Bases: exceptions.Exception
Uses the Win32 registry to return an iterator of serial (COM) ports existing on this computer. Source: http://eli.thegreenplace.net/2009/07/31/listing-all-serial-ports-on-windows-with-python/
This version of PyQts uic.loadUi() adds support for loading from resource files.
Parses the given connection URL. Returns a dictionary ready to be passed to mrc_connection.factory() to create a connection instance. Supported URL formats: - For serial connections:
<serial_port>@<baud> serial://<serial_port>[@<baud=9600>]
<host>:<port> tcp://<host>[:<port=4001>]
mc://<host>[:<port=23000>]
Uses a local Qt event loop to wait for the given signal to arrive.
expected_args specifies which arguments are expected once the signal is emitted. If expected_args is None any arguments are valid. To specify a placeholder argument use the AnyValue class above (put the class directly into the argument sequence, don’t instantiate it).
timeout_ms gives the maximum time in milliseconds to wait for the signal. If 0 this function will wait forever.
emitting_callable can be used to pass a callable object to the function. This callable will be invoked from within the internal event loop. This is neccessary to avoid missing signals connected via Qt’s direct connection mechanism (the signal would arrive before the event loop was started and thus it would be missed completely).
The return value is True if the signal arrived within the given timeout and with the correct arguments. Otherwise False is returned.