photons.equipment.widgets.daq_counter module

Widget for a NIDAQ to counts pulse edges.

class photons.equipment.widgets.daq_counter.DAQCounterWidget(connection, *, parent=None)[source]

Bases: BaseEquipmentWidget

Widget for a NIDAQ to counts pulse edges.

Parameters:
  • connection (NIDAQ) – The connection to the NIDAQ.

  • parent (QWidget) – The parent widget.

on_counts_changed(samples)[source]

Update the text in the LineEdit.

Return type:

None

on_live_checkbox_changed(checked)[source]

Start or stop the QTimer.

Return type:

None

on_live_spinbox_changed(msec)[source]

Change the timeout interval of the QTimer.

Return type:

None

on_timer_timeout()[source]

Start the worker thread.

Return type:

None

notification_handler(**kwargs)[source]

Handle a notification emitted by the NIDAQ Service.

Return type:

None

stop_timer_and_thread()[source]

Stop the QTimer and the QThread.

Return type:

None

closeEvent(event)[source]

Override QtWidgets.QWidget.closeEvent() to stop the QTimer and QThread.

Return type:

None

class photons.equipment.widgets.daq_counter.CountEdgesWorker(connection, duration, edge, pfi, nsamples)[source]

Bases: Worker

Count edges in a worker thread.

process()[source]

The expensive or blocking operation to process. :rtype: None

Attention

You must override this method.

class photons.equipment.widgets.daq_counter.CountEdgesThread(parent)[source]

Bases: Thread

Moves a Worker to a new QThread.

Parameters

worker

A Worker subclass that has not been instantiated.

Example

See Sleep for an example of a Thread.

error_handler(exception, traceback)[source]

If an exception is raised by the Worker then the default behaviour is to show the error message in a critical() dialog window.

You can override this method to implement your own error handler.

Return type:

None

Parameters

exceptionBaseException

The exception instance

tracebacktraceback

A traceback object.