widgets

Package Contents

class widget_graphs_visual(theGraphs, **kwargs)

Bases: PyQt5.QtWidgets.QWidget

Widget element to draw a graph. The traces and graphs to draw are defined in Graphs taken as argument. This widget is linked to the excellent third-party library pyqtgraph, under MIT license

signal_must_update
signal_graph_changed
set_graph_disposition(self, indexGraph, row=1, col=1, rowspan=1, colspan=1)

Change the graphs disposition.

Parameters:
  • indexGraph – index of the graph to change
  • row – row where to place the graph
  • col – column where to place the graph
  • rowspan – number of rows across which the graph spans
  • colspan – number of columns across which the graph spans
Returns:

__create_graph(self, idGraph)
__check_graphs(self)
on_click(self, plotDataItem, clicked_points)
update_graphs(self, singleUpdate=True)

This method is used to update the graph. This is fast but NOT safe (especially when working with threads). To limit the risks, please use self.signal_must_update.emit() instead.

Parameters:singleUpdate – if set to False, the graph will periodically refres each self.refreshtime
fast_update(self)

Use this method to update the graph in a fast way. NOT THREAD SAFE.

exportGraphs(self)

Export the graphs

get_graph(self, idGraph)

Get corresponding GraphVisual of the graph idGraph

keyPressEvent(self, event)

What happens if a key is pressed. R: reset the axes to their default value

delete_graph(self, idGraph)

Delete the graph idGraph

delete(self)
get_all_graphsVisual(self)

Return a dictionary {idGraph: GraphVisual}.

get_layout_buttons(self)

Get the QGraphicsLayout where it’s possible to add buttons, etc.

set_actionOnClick(self, theActionOnClick)

Action to perform when the graph is clicked

Parameters:theActionOnClickon_graph_click_interface
Returns:
set_title(self, idGraph, titleName, **kwargs)

Set title of the graph

Parameters:
  • idGraph – id of the graph
  • titleName – title to set
set_article_template(self, graph_size_x=8.8, graph_size_y=4.4, legendPosition='NW')

Method to set the graphs to article quality graph.

Parameters:
  • graph_size_x – width of the graph in cm
  • graph_size_y – height of the graph in cm
  • legendPosition – position of the legend (NE, SE, SW, NW)
Returns:

class widget_line_drawer(minWinHeight=300, minWinWidth=300, is_light=True)

Bases: PyQt5.QtWidgets.QWidget

Widget allowing to display several lines easily

signal_must_update
on_update_signal(self, listOfLines)
delete_lines(self, key_id)

Dele the lines :param key_id: id to delete :return:

set_lines(self, listOfLines, key_id=0, pen=None)

Set the lines to display :param listOfLines: list of [x1, y1, z1, x2, y2, z2] corresponding to lines :param key_id: id of the trace :param pen: pen used to draw the lines :return:

paintEvent(self, event, painter=None)
get_extrema_lines(self)
class widget_menuButton(theParentButton)

Bases: PyQt5.QtWidgets.QMenu

Same as QMenu, but integrates it behind a button more easily.

showEvent(self, QShowEvent)
class widget_openGL(parent=None)

Bases: PyQt5.QtWidgets.QOpenGLWidget

Interface that provides opengl capabilities. Ensures zoom, light, rotation, etc.

sizeHint(self)
minimumSizeHint(self)
set_deviceDrawer(self, theDeviceDrawer)

Set a drawer optimeed.visualize.gui.widgets.openGLWidget.DeviceDrawerInterface.DeviceDrawerInterface

set_deviceToDraw(self, theDeviceToDraw)

Set the device to draw optimeed.InterfaceDevice.InterfaceDevice

initializeGL(self)
paintGL(self)
resizeGL(self, w, h)
mousePressEvent(self, event)
mouseMoveEvent(self, event)
keyPressEvent(self, event)
wheelEvent(self, QWheelEvent)
class widget_text(theText, is_light=False, convertToHtml=False)

Bases: PyQt5.QtWidgets.QLabel

Widget able to display a text

set_text(self, theText, convertToHtml=False)

Set the text to display

class on_graph_click_delete(theDataLink)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: Delete the points from the graph, and save the modified collection

apply(self)
reset(self)
graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)
get_name(self)
class on_graph_click_export(theDataLink)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: export the selected points

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)
reset_graph(self)
get_name(self)
class on_click_extract_pareto(theDataLink, max_x=False, max_y=False)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: extract the pareto from the cloud of points

graph_clicked(self, the_graph_visual, index_graph, index_trace, _)
get_name(self)
class on_graph_click_showInfo(theLinkDataGraph, visuals=None)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: show informations about the points (loop through attributes)

class DataInformationVisuals
delete_visual(self, theVisual)
add_visual(self, theVisual, theTrace, indexPoint)
get_new_index(self)
curr_index(self)
graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)

Action to perform when a point in the graph has been clicked: Creates new window displaying the device and its informations

get_name(self)
class Repr_opengl(DeviceDrawer)
get_widget(self, theNewDevice)
class Repr_lines(attribute_lines)
get_widget(self, theNewDevice)
class on_graph_click_remove_trace(theDataLink)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

graph_clicked(self, theGraphVisual, index_graph, index_trace, _)
get_name(self)
class on_click_copy_something(theDataLink, functionStrFromDevice)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: copy something

graph_clicked(self, the_graph_visual, index_graph, index_trace, indices_points)
get_name(self)
class on_click_change_symbol(theLinkDataGraph)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On Click: Change the symbol of the point that is clicked

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)
get_name(self)
class on_graph_click_interface

Interface class for the action to perform when a point is clicked

class DataAnimationVisuals(id=0, window_title='Animation')

Bases: PyQt5.QtWidgets.QMainWindow

Spawns a gui that includes button to create animations nicely when paired with widget_graphs_visual

SlIDER_MAXIMUM_VALUE = 500
SLIDER_MINIMUM_VALUE = 1
add_trace(self, trace_id, element_list, theTrace)

Add a trace to the animation.

Parameters:
  • trace_id – id of the trace
  • element_list – List of elements to save: [[OpenGL_item1, text_item1], [OpenGL_item2, text_item2], … [OpenGL_itemN, text_itemN]]
  • theTraceTraceVisual
Returns:

add_elementToTrace(self, trace_id, indexPoint)
delete_point(self, trace_id, thePoint)
reset_all(self)
delete_all(self)
pause_play(self)
show_all(self)
next_frame(self)
slider_handler(self)
frame_selector(self)
set_refreshTime(self)
is_empty(self)
run(self)
closeEvent(self, _)
contains_trace(self, trace_id)
export_picture(self)
class widget_text(theText, is_light=False, convertToHtml=False)

Bases: PyQt5.QtWidgets.QLabel

Widget able to display a text

set_text(self, theText, convertToHtml=False)

Set the text to display

class widget_line_drawer(minWinHeight=300, minWinWidth=300, is_light=True)

Bases: PyQt5.QtWidgets.QWidget

Widget allowing to display several lines easily

signal_must_update
on_update_signal(self, listOfLines)
delete_lines(self, key_id)

Dele the lines :param key_id: id to delete :return:

set_lines(self, listOfLines, key_id=0, pen=None)

Set the lines to display :param listOfLines: list of [x1, y1, z1, x2, y2, z2] corresponding to lines :param key_id: id of the trace :param pen: pen used to draw the lines :return:

paintEvent(self, event, painter=None)
get_extrema_lines(self)
class DataAnimationOpenGL(theOpenGLWidget, theId=0, window_title='Animation')

Bases: optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals

Implements DataAnimationVisuals to show opengl drawing

update_widget_w_animation(self, key, index, the_data_animation)
export_widget(self, painter)
delete_key_widgets(self, key)
class DataAnimationOpenGLwText(*args, is_light=True, **kwargs)

Bases: optimeed.visualize.gui.widgets.graphsVisualWidget.examplesActionOnClick.on_click_anim.DataAnimationOpenGL

Implements DataAnimationVisuals to show opengl drawing and text

update_widget_w_animation(self, key, index, the_data_animation)
get_interesting_elements(self, devices_list)
class DataAnimationLines(is_light=True, theId=0, window_title='Animation')

Bases: optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals

Implements DataAnimationVisuals to show drawing made out of lines (widget_line_drawer)

export_widget(self, painter)
delete_key_widgets(self, key)
update_widget_w_animation(self, key, index, the_data_animation)
get_interesting_elements(self, devices_list)
class DataAnimationVisualswText(is_light=True, theId=0, window_title='Animation')

Bases: optimeed.visualize.gui.widgets.graphsVisualWidget.examplesActionOnClick.on_click_anim.DataAnimationLines

Same as DataAnimationLines but also with text

update_widget_w_animation(self, key, index, the_data_animation)
class on_graph_click_showAnim(theLinkDataGraph, theAnimation)

Bases: optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface

On click: add or remove an element to animate

graph_clicked(self, theGraphVisual, index_graph, index_trace, indices_points)
get_name(self)
class guiPyqtgraph(graphsVisual, **kwargs)

Create a gui for pyqtgraph with trace selection options, export and action on clic choices

refreshTraceList(self)

Refresh all the traces

class DeviceDrawerInterface
keyboard_push_action(self, theKey)
get_colour_scalebar(self)
get_colour_background(self)
get_opengl_options(self)