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.
- 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
- 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
- change_event_type()[source]
Action: change highlighted event’s type by cycling through event type list.
- 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.
- highlight_event(annot)[source]
Highlight an annotation on the trace.
- Parameters:
annot (intance of wonambi.widgets.utils.RectMarker) – existing annotation
- 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.
- 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.
- wonambi.widgets.traces.take_raw_name(x)