vent.gui.widgets package

Submodules

vent.gui.widgets.components module

Classes

DoubleSlider([decimals])

Slider capable of representing floats

EditableLabel([parent])

Editable label

KeyPressHandler

Custom key press handler

QHLine([parent, color])

with respct to https://stackoverflow.com/a/51057516

RangeSlider(abs_range, safe_range[, decimals])

Slider with two handles that sets a range

class vent.gui.widgets.components.DoubleSlider(decimals=1, *args, **kargs)[source]

Bases: PySide2.QtWidgets.QSlider

Slider capable of representing floats

Ripped off from and https://stackoverflow.com/a/50300848 ,

Thank you!!!

Methods

_maximum()

_minimum()

_singleStep()

emitDoubleValueChanged()

maximum(self)

minimum(self)

setDecimals(decimals)

setMaximum(self, arg__1)

setMinimum(self, arg__1)

setSingleStep(self, arg__1)

setValue(self, arg__1)

singleStep(self)

value(self)

doubleValueChanged(*args, **kwargs) = <PySide2.QtCore.Signal object>
setDecimals(decimals)[source]
emitDoubleValueChanged()[source]
value(self)int[source]
setMinimum(self, arg__1: int)[source]
setMaximum(self, arg__1: int)[source]
minimum(self)int[source]
_minimum()[source]
maximum(self)int[source]
_maximum()[source]
setSingleStep(self, arg__1: int)[source]
singleStep(self)int[source]
_singleStep()[source]
setValue(self, arg__1: int)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.components.RangeSlider(abs_range, safe_range, decimals=1, *args, **kwargs)[source]

Bases: vent.gui.widgets.components.DoubleSlider

Slider with two handles that sets a range

Parameters
  • abs_range (tuple) – absolute range of slider

  • safe_range (tuple) – default set values for handles of slider

  • decimals (int) – number of decimals of precision

  • *args

  • **kwargs

Methods

__pick(pt)

__pixelPosToRangeValue(pos)

__init__(abs_range, safe_range[, decimals])

Slider with two handles that sets a range

generate_labels()

Generate the text labels for the slider.

mouseMoveEvent(self, ev)

mousePressEvent(self, ev)

paintEvent(self, ev)

resizeEvent(self, event)

setHigh(high)

setLow(low)

setValue(value)

param value

(low, high) to set

value(self)

Attributes

high

low

valueChanged(*args, **kwargs)

(tuple): (low, high) set range of floats

valueChanged(*args, **kwargs) = <PySide2.QtCore.Signal object>

(low, high) set range of floats

Type

(tuple)

__init__(abs_range, safe_range, decimals=1, *args, **kwargs)[source]

Slider with two handles that sets a range

Parameters
  • abs_range (tuple) – absolute range of slider

  • safe_range (tuple) – default set values for handles of slider

  • decimals (int) – number of decimals of precision

  • *args

  • **kwargs

property low
property high
setLow(low)[source]
setHigh(high)[source]
setValue(value)[source]
Parameters

value (tuple) – (low, high) to set

value(self)int[source]
generate_labels()[source]

Generate the text labels for the slider.

Called on init and on resizeEvent

paintEvent(self, ev: PySide2.QtGui.QPaintEvent)[source]
mousePressEvent(self, ev: PySide2.QtGui.QMouseEvent)[source]
mouseMoveEvent(self, ev: PySide2.QtGui.QMouseEvent)[source]
__pick(pt)
__pixelPosToRangeValue(pos)
resizeEvent(self, event: PySide2.QtGui.QResizeEvent)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.components.KeyPressHandler[source]

Bases: PySide2.QtCore.QObject

Custom key press handler https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

Methods

eventFilter(self, watched, event)

escapePressed(*args, **kwargs) = <PySide2.QtCore.Signal object>
returnPressed(*args, **kwargs) = <PySide2.QtCore.Signal object>
eventFilter(self, watched: PySide2.QtCore.QObject, event: PySide2.QtCore.QEvent)bool[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.components.EditableLabel(parent=None, **kwargs)[source]

Bases: PySide2.QtWidgets.QWidget

Editable label https://gist.github.com/mfessenden/baa2b87b8addb0b60e54a11c1da48046

Methods

create_signals()

escapePressedAction()

Escape event handler

labelPressedEvent(event)

Set editable if the left mouse button is clicked

labelUpdatedAction()

Indicates the widget text has been updated

returnPressedAction()

Return/enter event handler

setLabelEditableAction()

Action to make the widget editable

setText(text)

Standard QLabel text setter

text()

Standard QLabel text getter

textChanged(*args, **kwargs) = <PySide2.QtCore.Signal object>
create_signals()[source]
text()[source]

Standard QLabel text getter

setText(text)[source]

Standard QLabel text setter

labelPressedEvent(event)[source]

Set editable if the left mouse button is clicked

setLabelEditableAction()[source]

Action to make the widget editable

labelUpdatedAction()[source]

Indicates the widget text has been updated

returnPressedAction()[source]

Return/enter event handler

escapePressedAction()[source]

Escape event handler

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.components.QHLine(parent=None, color='#FFFFFF')[source]

Bases: PySide2.QtWidgets.QFrame

with respct to https://stackoverflow.com/a/51057516

Methods

setColor(color)

staticMetaObject = <PySide2.QtCore.QMetaObject object>
setColor(color)[source]

vent.gui.widgets.control module

Classes

Control(value)

class vent.gui.widgets.control.Control(value)[source]

Bases: PySide2.QtWidgets.QWidget

Methods

init_ui()

toggle_control(state)

update_value(new_value)

value_changed(*args, **kwargs) = <PySide2.QtCore.Signal object>
init_ui()[source]
toggle_control(state)[source]
update_value(new_value)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>

vent.gui.widgets.monitor_value module

vent.gui.widgets.plot module

Data

PLOT_FREQ

Update frequency of Plot s in Hz

PLOT_TIMER

A QTimer that updates :class:`.TimedPlotCurveItem`s

Classes

Plot(name[, buffer_size, plot_duration, …])

When initializing PlotWidget, parent and background are passed to GraphicsWidget.__init__() and all others are passed to PlotItem.__init__().

vent.gui.widgets.plot.PLOT_TIMER = None

A QTimer that updates :class:`.TimedPlotCurveItem`s

vent.gui.widgets.plot.PLOT_FREQ = 5

Update frequency of Plot s in Hz

class vent.gui.widgets.plot.Plot(name, buffer_size=4092, plot_duration=5, abs_range=None, safe_range=None, color=None, units='', **kwargs)[source]

Bases: pyqtgraph.widgets.PlotWidget.PlotWidget

When initializing PlotWidget, parent and background are passed to GraphicsWidget.__init__() and all others are passed to PlotItem.__init__().

Methods

_safe_limits_changed(val)

set_duration(dur)

set_safe_limits(limits)

update_value(new_value)

new_value: (timestamp from time.time(), value)

limits_changed(*args, **kwargs) = <PySide2.QtCore.Signal object>
set_duration(dur)[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
update_value(new_value)[source]

new_value: (timestamp from time.time(), value)

_safe_limits_changed(val)[source]
set_safe_limits(limits)[source]

vent.gui.widgets.status_bar module

Classes

HeartBeat([update_interval, timeout_dur])

param update_interval

How often to do the heartbeat, in ms

Message_Display()

Power_Button()

Status_Bar()

  • Start/stop button

class vent.gui.widgets.status_bar.Status_Bar[source]

Bases: PySide2.QtWidgets.QWidget

  • Start/stop button

  • Status indicator - a clock that increments with heartbeats,

    or some other visual indicator that things are alright

  • Status bar - most recent alarm or notification w/ means of clearing

  • Override to give 100% oxygen and silence all alarms

Methods

init_ui()

init_ui()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.status_bar.Message_Display[source]

Bases: PySide2.QtWidgets.QFrame

Attributes

alarm_level

Methods

clear_message()

draw_state([state])

init_ui()

make_icons()

update_message(alarm)

param alarm

message_cleared(*args, **kwargs) = <PySide2.QtCore.Signal object>
level_changed(*args, **kwargs) = <PySide2.QtCore.Signal object>
make_icons()[source]
init_ui()[source]
draw_state(state=None)[source]
update_message(alarm)[source]
Parameters

alarm (Alarm) –

clear_message()[source]
property alarm_level
staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.status_bar.HeartBeat(update_interval=100, timeout_dur=5000)[source]

Bases: PySide2.QtWidgets.QFrame

Parameters
  • update_interval (int) – How often to do the heartbeat, in ms

  • timeout (int) – how long to wait before hearing from control process

Methods

__init__([update_interval, timeout_dur])

param update_interval

How often to do the heartbeat, in ms

_heartbeat()

Called every (update_interval) milliseconds to set the text of the timer.

beatheart(heartbeat_time)

check_timeout()

init_ui()

set_indicator([state])

start_timer([update_interval])

param update_interval

How often (in ms) the timer should be updated.

stop_timer()

you can read the sign ya punk

timeout(*args, **kwargs) = <PySide2.QtCore.Signal object>
heartbeat(*args, **kwargs) = <PySide2.QtCore.Signal object>
__init__(update_interval=100, timeout_dur=5000)[source]
Parameters
  • update_interval (int) – How often to do the heartbeat, in ms

  • timeout (int) – how long to wait before hearing from control process

init_ui()[source]
check_timeout()[source]
set_indicator(state=None)[source]
start_timer(update_interval=None)[source]
Parameters

update_interval (float) – How often (in ms) the timer should be updated.

stop_timer()[source]

you can read the sign ya punk

beatheart(heartbeat_time)[source]
_heartbeat()[source]

Called every (update_interval) milliseconds to set the text of the timer.

staticMetaObject = <PySide2.QtCore.QMetaObject object>
class vent.gui.widgets.status_bar.Power_Button[source]

Bases: PySide2.QtWidgets.QPushButton

Methods

init_ui()

init_ui()[source]
staticMetaObject = <PySide2.QtCore.QMetaObject object>

Module contents