Acquisition Live Graphs

Created on Thu Aug 24 17:35:00 2017

@author: eyt21

This module contains the live graph classes to the acquisition window.

Attributes

CHANLVL_FACTOR: float
Not used
TRACE_DECAY: float
The decay factor of the peak plots
TRACE_DURATION: float
Duration before the peak plots decay
class cued_datalogger.acquisition.RecordingGraph.LiveGraph(*args, **kwargs)

Bases: pyqtgraph.widgets.PlotWidget.PlotWidget

A base PlotWidget reimplemented to store extra plot information, such as offsets, colours, and visibility.

Attributes

plotColourChanged: pyqtsignal Emits when colour of a plot change Sends out QColor
plotlines: list of PlotDataItem Contains the individual PlotDataItem
plot_xoffset: list of float Contains the X offset of each plot
plot_yoffset: list of float Contains the Y offset of each plot
plot_colours:list of QColor Contains the current colour of each plot
plot_visible: list of bool Contains the visibility of each plot

Methods

check_line(line)

Check whether a plot line exists

Returns:

int

Index of the plot line, if it exists None otherwise

gen_default_colour()

Generate the default colours of the plots

plot(*arg, **kwargs)

Plot the data and set it to be clickable

Returns:

PlotDataItem

The plot line, effectively

reset_colour()

Clear the colours of the plots

reset_default_colour(num)

Set the default colour of the specified plot

Parameters:

num: int

Index of the line to be set

reset_offsets()

Reset the offsets of the plots

reset_plot_visible()

Reset the visibilities of the plots

reset_plotlines()

Clear all of the lines

set_offset(num, x_off=None, y_off=None)

Set the offsets of the specific line

Parameters:

num : int

Index of the line to be set

x_off : float

X offset of the line to be set, if given a value

x_off : float

Y offset of the line to be set, if given a value

set_plot_colour(num, col)

Set the colour of the specific line

Parameters:

num: int

index of the line to be set

col: QColor

Colour of the line to be set

toggle_plotline(num, visible)

Set the visibility of the specific line

Parameters:

num: int

index of the line to be set

visible: bool

Visibility of the line to be set

update_line(num, x=None, y=None, *arg, **kwargs)

Update the existing lines with new data, with the offsets

Parameters:

num : int

index of the line to be set

x : float

X data of the line to be set, if given a value

y : float

Y data of the line to be set, if given a value

The rest to pass to PlotDataItem.setData

class cued_datalogger.acquisition.RecordingGraph.TimeLiveGraph(*args, **kwargs)

Bases: cued_datalogger.acquisition.RecordingGraph.LiveGraph

Reimplemented LiveGraph. Displays the time domain plot

Attributes

sig_hold: list of bool Contains whether the signal is being held

Methods

set_sig_hold(num, state)

Set the hold status of the specific line

Parameters:

num: int

Index of the line to be set

state: bool

Hold status of the line to be set

class cued_datalogger.acquisition.RecordingGraph.FreqLiveGraph(*args, **kwargs)

Bases: cued_datalogger.acquisition.RecordingGraph.LiveGraph

Reimplemented LiveGraph. Displays the frequency domain plot

Attributes

lastFileDir  

Methods

class cued_datalogger.acquisition.RecordingGraph.LevelsLiveGraph(rec, *args, **kwargs)

Bases: cued_datalogger.acquisition.RecordingGraph.LiveGraph

Reimplemented LiveGraph. Displays the channel levels

Attributes

thresholdChanged: pyqtSignal Emits when the threshold line is moved Sends out the value of the threshold
peak_plots: list of plotDataItem The lines which indicate the channels’ peaks
peak_trace: list of float The values of the channels’ peaks
trace_counter: list of int Counter for the peak plots before they decay
chanlvl_pts: list of plotDataItem Rms plots
chanlvl_bars: list of bool Instantaneous channels’ peaks plots
threshold_line: The line indicating the trigger threshold
level_colourmap: The colour for the peak levels

Methods

change_threshold(arg)

Set the trigger threshold If arg is str, set the threshold_line to match the value otherwise, emit the value of the threshold_line

Parameters:arg: str or InfiniteLine
gen_default_colour()

Reimplemented from LiveGraph.

reset_channel_levels()

Reset the channel levels plot

reset_channel_peaks(rec)

Reset the channel peaks plot

reset_colour()

Reimplemented from LiveGraph.

reset_default_colour(chan)

Reimplemented from LiveGraph.

set_channel_levels(value, maximum)

Set the value of the levels plots Parameters ———- value: float

rms values
maximum: float
Instantaneous maximum value of the plot
set_peaks(num, maximum)

Set the value of the peak plots Parameters ———- num: int

index of the peak to be set
maximum: float
Instantaneous maximum value of the peak
set_plot_colour(num, col)
Parameters:

num: int

index of the point to be set

col: QColor

Colour of the point to be set