123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390 |
- .. This is a autogemerated documentation from python docstrings. It was generated using DStrings2Doc.
- .. module:: backendinterface
- .. _backendinterface:
- Module backendinterface
- =======================
- This is the interface to the backend.
- It is used to make the backend easily interchangable.
- All Functions that interface directly with the backend are prefixed with bk\_
- Functions only used internal in this module will be prefixed _bif_
- .. py:method:: initStatus(st)
- Initialize Status variables. These variables are used to transfer status variables over different modules.
- :param st: variable to use (most likely a DummyStorage instance)
- .. py:method:: _bif_enable_wait_cursor()
- Show the "Wait Cursor"
- .. py:method:: _bif_disable_wait_cursor()
- Show the normal Cursor
- .. py:method:: _bif_continuous_read_is_enabled(board_id, popup_title_text=None)
- Checks if continuous read is enabled and if yes shows a popup dialog to ask if it shall be disabled
- :param board_id: id of the board do manipulate
- :param popup_title_text: Text to display in the popup that asks to disable continuous read
- :return: bool (True if continuous read is enabled and not disabled in popup else False)
- .. py:method:: bk_status_readout()
- Read Status for every connected board
- .. py:method:: _bif_status_readout(board_id)
- Read Status from board and update variables
- as well as enable and disable corresponding Buttons
- .. py:class:: PopupDialog(QtGui.QDialog)
- Simple Class to show a popup dialog.
- .. py:method:: __init__(self, text, title=None, parent=None)
- .. py:method:: on_okay(self)
- Handler for the press of the ok button
- .. py:method:: on_cancel(self)
- Handler for the press of the cancel button
- .. py:method:: get_return_value(self)
- Get True if the Window was closed with OK else False
- :return: True if OK else False
- .. py:method:: bk_start_board(board_id)
- Start the Board.
- This will set initial Registers to power up the Board.
- :param board_id: id of the board do manipulate
- .. py:class:: _bif_ProgressBar(QtGui.QProgressBar)
- Simple Progressbar class.
- .. py:method:: __init__(self, min, max, text)
- .. py:method:: remove(self, timeout=None)
- Remove this instance of a progressbar
- :param timeout: the time from calling this function to wanishing of the progressbar
- .. py:method:: bk_calibrate(board_id, do_the_rest=None)
- Send commands to the board that will enable it to calibrate itself.
- This function checks if a read command is still running. BUT: It does not check if
- the board is acquiring or something like this.
- So Another instance of KCG can still be acquiring or calibrating at the same time. This can be dangerous.
- :param board_id: id of the board do manipulate
- :param do_the_rest: function to call after calibration. This is used when "Prepare Board" is pressed.
- .. py:method:: bk_sync_board(board_id)
- Sends commands to the board to sync with triggers.
- :param board_id: id of the board do manipulate
- .. py:method:: bk_write_values(board_id, defaults=False)
- Write values to board.
- :param board_id: id of the board do manipulate
- :param defaults: (bool) if True Writes default values
- .. py:method:: bk_stop_board(board_id)
- Stops the board and shuts it down
- :param board_id: id of the board do manipulate
- .. py:method:: bk_soft_reset(board_id)
- Perform a soft reset.
- :param board_id: id of the board do manipulate
- .. py:method:: bk_update_config(board_id, key, value, silent=False)
- Interface to the update command of the BoardConfiguration class.
- :param board_id: id of the board do manipulate
- :param key: Key to update
- :param value: Value to set for key
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_get_config(board_id, key)
- Interface to the get command of the BoardConfiguration class.
- :param board_id: id of the board do manipulate
- :param key: Key to get the value for
- :return: value stored for key
- .. py:method:: bk_get_board_status(board_id, status_variable)
- Interface to the status class for each board.
- :param board_id: id of the board do manipulate
- :param status_variable: Key to get the value for
- :return: value stored for key
- .. py:method:: bk_get_status(board_id)
- Interface to the get_status of the board
- NOTE: This is not get_board_status
- :return: status dictionary
- .. py:method:: bk_get_board_config(board_id)
- Get the board config instance
- :param board_id: the id of the board
- :return: the config instance
- .. py:method:: bk_change_num_of_orbits(board_id, value, silent=False)
- Send new number of orbits to board and update in config
- :param board_id: id of the board do manipulate
- :param value: the value to send
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_change_num_of_skipped_orbits(board_id, value, silent=False)
- Send new number of orbits to skip to board and update in config
- :param board_id: id of the board do manipulate
- :param value: the value to send
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_change_count(board_id, value, silent=False)
- Change the number of acquisitions you want to make.
- :param board_id: id of the board do manipulate
- :param value: (int) Number of acquisitions
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_change_wait(board_id, value, silent=False)
- Change the time between acquisitions.
- :param board_id: id of the board do manipulate
- :param value: (bool) Time in seconds
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_change_build_spectrograms(board_id, value, silent=False)
- Change if spectrograms are built or not)
- :param board_id: id of the board do manipulate
- :param value: (bool) True or False built or not
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: bk_change_pilot_bunch(board_id, value, silent=False)
- Change if pilot bunch is simulated
- :param board_id: id of the board do manipulate
- :param value: (bool) True or False to simulate or not
- :param silent: (bool) if True do not inform observers on update
- .. py:method:: _bif_iterate_spectrograms(board_id, path)
- BROKEN (DOES NOT GET ANY DATA)
- Built Spectrograms line by line
- :param board_id: id of the board do manipulate
- :param path: where to built the spectrogram
- .. py:method:: _bif_read_data_and_save(board_id)
- Tell the pci command to start acquisition and save data
- Also generates the filename from settings
- :param board_id: id of the board do manipulate
- .. py:method:: _bif_read_and_update_data_from_file(board_id, filename)
- Proxy function for _bif_read_and_update to call with correct read_func
- :param board_id: id of the board do manipulate
- :param filename: filename to read data from
- .. py:method:: _bif_read_and_update_data_from_string(board_id, raw_data)
- Proxy function for _bif_read_and_update to call with correct read_func
- :param board_id: id of the board do manipulate
- :param raw_data: Data as string
- .. py:method:: _bif_read_and_update(board_id, read_func, *args)
- Function to read data from file or string (depending on read_func) and update plots etc.
- :param board_id: id of the board do manipulate
- :param read_func: function to use to read data
- :param args: filename or raw_data (see _bif_read_and_update_from_{filename, string}
- .. py:method:: bk_acquire(board_id)
- Toggle Acqisition
- :param board_id: id of the board do manipulate
- .. py:method:: _bif_stop_acquisition(board_id)
- Stop acquisition
- This does stop the timer started by _bif_start_acquisition()
- :param board_id: id of the board do manipulate
- .. py:method:: _bif_start_acquisition(board_id)
- Start acquisition.
- This will start a timer to automatically acquire data.
- :param board_id: id of the board do manipulate
- .. py:method:: bk_single_read(board_id)
- Perform a single read of data
- :param board_id: id of the board do manipulate
- .. py:method:: _bif_set_continuous_read_active(board_id)
- Enable continuous read
- :param board_id: id of the board do manipulate
- .. py:method:: _bif_set_continuous_read_inactive(board_id)
- Disable continuous read
- :param board_id: id of the board do manipulate
- .. py:method:: bk_continuous_read(board_id, interval=100)
- Toggle continuous read
- :param board_id: id of the board do manipulate
- :param interval: Time between two consecutive reads.
- .. py:method:: _bif_continuous_read(board_id, interval=None)
- Perform continuous read based on a timer.
- :param interval:
- .. py:method:: _bif_read_data(board_id)
- Reads data acquired by board.
- :param board_id: id of the board do manipulate
- .. py:method:: bk_board_connected(board_id)
- Interface to the board to check if it is connected.
- :param board_id: id of the board do manipulate
- .. py:method:: bk_get_temperature(board_id)
- Get Temperature from board and format it
- :param board_id: id of the board do manipulate
- .. py:method:: bk_time_scan(board_id, c_frm, c_to, f_frm, f_to, ts_pbar, plot_func, orbits_observe=None, orbits_skip=None)
- Toggle Timescan.
- :param board_id: id of the board do manipulate
- :param c_frm: (int) From value for Coarse scan
- :param c_to: (int) To value for Coarse scan
- :param f_frm: (int) From value for Fine scan
- :param f_to: (int) To value for fine scan
- :param ts_pbar: Handle to the Timescan Progressbar
- :param plot_func: Function to plot when timescan ended.
- :param orbits_observe: Number of orbits to observe for the timescan (original values will be restored after timescan)
- :param orbits_skip: Number of orbits to skipfor the timescan (original values will be restored after timescan)
- .. py:method:: _bif_stop_time_scan(board_id, ts_pbar)
- Stop the timescan. This stops the timer.
- :param board_id: id of the board do manipulate
- :param ts_pbar: Timescan Progressbar handle
- .. py:method:: _bif_start_time_scan(board_id, c_frm, c_to, f_frm, f_to, timescan_progressbar, plot_func, orbits_observe, orbits_skip)
- Start the timscan. This starts the timer
- :param board_id: id of the board do manipulate
- :param c_frm: From value for coarse scan
- :param c_to: To value for coarse scan
- :param f_frm: From value for fine scan
- :param f_to: To value for fine scan
- :param timescan_progressbar: Handle for the timescanprogressbar
- :param plot_func: Function to use to plot the data
- :param orbits_observe: Number of orbits to observe for the timescan (original values will be restored after timescan)
- :param orbits_skip: Number of orbits to skipfor the timescan (original values will be restored after timescan)
- .. py:method:: bk_check_for_board(board_id)
- Check if board is connected
- Also overrides the bk_status_readout function with a function that does nothing (suppresses read attempts that
- generate errors - if no board is connected, there is nothing to read from)
- Also overrides the bk_get_temperature function as of the same reasons
- :param board_id: id of the board do manipulate
- .. py:method:: bk_toggle_wait_on_trigger(board_id, num_of_acquisitions=None, skip=None, timeout=None, method=None)
- Toggle waiting for trigger signal to acquire
- :param board_id: id of the board do manipulate
- :param num_of_acquisitions: number of acquisitions to wait for
- :param skip: how much trigger signals to skip between acquisitions
- :param timeout: the timeout for the pci to wait for date
- :param method: wait method to use
- 1 for wait in pci command and 2 for waiting until register is set that KAPTURE has read data
- NOTE: this also means that method 1 enables simultaneous read and write to dma and method 2 does write and
- read sequentially
- .. py:method:: _bif_start_wait_on_trigger(board_id, num_of_acquisitions=None, skip=None, timeout=None, method=None)
- Start waiting on external acquisition trigger. This starts the timer
- :param board_id: id of the board do manipulate
- :param num_of_acquisitions: number of acquisitions to do
- :param count_label: Handle for the countlabel
- :param method: wait method to use
- 1 for wait in pci command and 2 for waiting until register is set that KAPTURE has read data
- NOTE: this also means that method 1 enables simultaneous read and write to dma and method 2 does write and
- read sequentially
|