wonambi.widgets.traces module

Definition of the main widgets, with recordings.

class wonambi.widgets.traces.ConfigTraces(update_widget)[source]

Bases: Config

Widget with preferences in Settings window for Overview.

create_config()[source]

Placeholder: it’ll be replaced with actual layout.

class wonambi.widgets.traces.Traces(parent)[source]

Bases: QGraphicsView

Main widget that contains the recordings to be plotted.

parent

the main window.

Type:

instance of QMainWindow

config

settings for this widget

Type:

instance of ConfigTraces

y_scrollbar_value

position of the vertical scrollbar

Type:

int

data

filtered and reref’ed data

Type:

instance of ChanTime

chan

list of channels (labels and channel group)

Type:

list of str

chan_pos

y-position of each channel (based on value at 0)

Type:

list of int

chan_scale

scaling factor for each channel

Type:

list of float

time_pos

we need to keep track of the position of time label during creation

Type:

list of QPointF

sel_chan

index of self.chan of the first selected channel

Type:

int

sel_xy

x and y position of the first selected point

Type:

tuple of 2 floats

scene

the main scene.

Type:

instance of QGraphicsScene

idx_label

the channel labels on the y-axis

Type:

list of instance of QGraphicsSimpleTextItem

idx_time

the time labels on the x-axis

Type:

list of instance of QGraphicsSimpleTextItem

idx_sel

the rectangle showing the selection (both for selection and event)

Type:

instance of QGraphicsRectItem

idx_info

the rectangle showing the selection

Type:

instance of QGraphicsSimpleTextItem

idx_markers

list of markers in the dataset

Type:

list of QGraphicsRectItem

idx_annot

list of user-made annotations

Type:

list of QGraphicsRectItem

X_length(new_window_length)[source]

Use presets for length of the window.

X_less()[source]

Zoom in on the x-axis.

X_more()[source]

Zoom out on the x-axis.

Y_ampl(new_y_scale)[source]

Make scaling on Y axis using predefined values

Y_dist(new_y_distance)[source]

Use preset values for the distance between lines.

Y_less()[source]

Decrease the scaling.

Y_more()[source]

Increase the scaling.

Y_tighter()[source]

Decrease the distance of the lines.

Y_wider()[source]

Increase the distance of the lines.

add_chan_labels()[source]

Add channel labels on the left.

add_time(extra_time)[source]

Go to the predefined time forward.

add_time_labels()[source]

Add time labels at the bottom.

add_traces()[source]

Add traces based on self.data.

change_event_type()[source]

Action: change highlighted event’s type by cycling through event type list.

create_action()[source]

Create actions associated with this widget.

create_chan_labels()[source]

Create the channel labels, but don’t plot them yet.

Notes

It’s necessary to have the width of the labels, so that we can adjust the main scene.

create_time_labels()[source]

Create the time labels, but don’t plot them yet.

Notes

It’s necessary to have the height of the time labels, so that we can adjust the main scene.

Not very robust, because it uses seconds as integers.

display()[source]

Display the recordings.

display_annotations()[source]

Mark all the bookmarks/events, on top of first plot.

display_grid()[source]

Display grid on x-axis and y-axis.

display_markers()[source]

Add markers on top of first plot.

go_to_epoch(checked=False, test_text_str=None)[source]

Go to any window

highlight_event(annot)[source]

Highlight an annotation on the trace.

Parameters:

annot (intance of wonambi.widgets.utils.RectMarker) – existing annotation

keyPressEvent(self, QKeyEvent)[source]
line_up_with_epoch()[source]

Go to the start of the present epoch.

mouseMoveEvent(event)[source]

When normal selection, update power spectrum with current selection. Otherwise, show the range of the new marker.

mousePressEvent(event)[source]

Create a marker or start selection

Parameters:

event (instance of QtCore.QEvent) – it contains the position that was clicked.

mouseReleaseEvent(event)[source]

Create a new event or marker, or show the previous power spectrum

next_event(delete=False)[source]

Go to next event.

page_next()[source]

Go to the next page.

page_prev()[source]

Go to the previous page.

read_data()[source]

Read the data to plot.

reset()[source]
resizeEvent(event)[source]

Resize scene so that it fits the whole widget.

Parameters:

event (instance of QtCore.QEvent) – not important

Notes

This function overwrites Qt function, therefore the non-standard name. Argument also depends on Qt.

The function is used to change the scale of view, so that the scene fits the whole scene. There are two problems that I could not fix: 1) how to give the width of the label in absolute width, 2) how to strech scene just enough that it doesn’t trigger a scrollbar. However, it’s pretty good as it is now.

step_next()[source]

Go to the next step.

step_prev()[source]

Go to the previous step.

wonambi.widgets.traces.take_raw_name(x)