gui¶
Subpackages¶
Package Contents¶
-
class
gui_mainWindow
(QtWidgetList, isLight=True, actionOnWindowClosed=None, neverCloseWindow=False, title_window='Awesome Visualisation Tool', size=None)[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
Main class that spawns a Qt window. Use
run()
to display it.
-
app
¶
-
class
gui_collection_exporter
[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
Simple gui that allows to export data
-
signal_has_exported
¶
-
signal_has_reset
¶
-
-
class
DataAnimationVisuals
(id=0, window_title='Animation')[source]¶ 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)[source]¶ 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]]
theTrace –
TraceVisual
- Returns
-
static
get_interesting_elements
(element_list)[source]¶ Function called upon new trace creation. From a list, takes the interesting elements for animation :param element_list: :return: new_element_list
-
abstract
export_widget
(self, painter)[source]¶ Render scene with a painter
- Parameters
painter – PyQt painter
-
abstract
update_widget_w_animation
(self, key, index, the_data_animation)[source]¶ What to do when a new element has to be animated. Example: self.theOpenGLWidget.set_deviceToDraw(the_data_animation.get_element_animations(0, index))
- Parameters
key – key of the trace that has to be animated
index – index that has to be animated
the_data_animation –
DataAnimationTrace
that has to be animated
-
-
class
GuiDataSelector
(list_ListDataStruct_in, actionOnUpdate: Action_on_selector_update)[source]¶ Bases:
PyQt5.QtWidgets.QMainWindow
-
theActionOnUpdate
¶ Generate GUI
-
-
class
widget_graphs_visual
(theGraphs, **kwargs)[source]¶ 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)[source]¶ 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)¶
-
update_graphs
(self, singleUpdate=True)[source]¶ 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
-
keyPressEvent
(self, event)[source]¶ What happens if a key is pressed. R: reset the axes to their default value
Get the QGraphicsLayout where it’s possible to add buttons, etc.
-
set_actionOnClick
(self, theActionOnClick)[source]¶ Action to perform when the graph is clicked
- Parameters
theActionOnClick –
on_graph_click_interface
- Returns
-
set_title
(self, idGraph, titleName, **kwargs)[source]¶ 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')[source]¶ 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)[source]¶ Bases:
PyQt5.QtWidgets.QWidget
Widget allowing to display several lines easily
-
signal_must_update
¶
-
Bases:
PyQt5.QtWidgets.QMenu
Same as QMenu, but integrates it behind a button more easily.
-
class
widget_openGL
(parent=None)[source]¶ Bases:
PyQt5.QtWidgets.QOpenGLWidget
Interface that provides opengl capabilities. Ensures zoom, light, rotation, etc.
-
set_deviceDrawer
(self, theDeviceDrawer)[source]¶ Set a drawer
optimeed.visualize.gui.widgets.openGLWidget.DeviceDrawerInterface.DeviceDrawerInterface
-
-
class
widget_text
(theText, is_light=False, convertToHtml=False)[source]¶ Bases:
PyQt5.QtWidgets.QLabel
Widget able to display a text
-
class
guiPyqtgraph
(graphsVisual, **kwargs)[source]¶ Create a gui for pyqtgraph with trace selection options, export and action on clic choices
-
class
on_graph_click_delete
(theDataLink)[source]¶ 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
-
class
on_graph_click_export
(theDataLink)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On click: export the selected points
-
class
on_click_extract_pareto
(theDataLink, max_x=False, max_y=False)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On click: extract the pareto from the cloud of points
-
class
on_graph_click_showInfo
(theLinkDataGraph, visuals=None)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On click: show informations about the points (loop through attributes)
-
class
on_graph_click_remove_trace
(theDataLink)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
-
class
on_click_copy_something
(theDataLink, functionStrFromDevice)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On Click: copy something
-
class
on_click_change_symbol
(theLinkDataGraph)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On Click: Change the symbol of the point that is clicked
-
class
on_click_measure
[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On Click: Measure distance. Click on two points to perform that action
-
class
on_graph_click_interface
[source]¶ Interface class for the action to perform when a point is clicked
-
abstract
graph_clicked
(self, theGraphsVisual, index_graph, index_trace, indices_points)[source]¶ Action to perform when a graph is clicked
- Parameters
theGraphsVisual – class widget_graphs_visual that has called the method
index_graph – Index of the graph that has been clicked
index_trace – Index of the trace that has been clicked
indices_points – graph Indices of the points that have been clicked
- Returns
-
abstract
-
class
DataAnimationVisuals
(id=0, window_title='Animation')[source] 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)[source] 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]]
theTrace –
TraceVisual
- Returns
-
static
get_interesting_elements
(element_list)[source] Function called upon new trace creation. From a list, takes the interesting elements for animation :param element_list: :return: new_element_list
-
add_elementToTrace
(self, trace_id, indexPoint)[source]
-
delete_point
(self, trace_id, thePoint)[source]
-
reset_all
(self)[source]
-
delete_all
(self)[source]
-
pause_play
(self)[source]
-
show_all
(self)[source]
-
next_frame
(self)[source]
-
slider_handler
(self)[source]
-
frame_selector
(self)[source]
-
set_refreshTime
(self)[source]
-
is_empty
(self)[source]
-
run
(self)[source]
-
closeEvent
(self, _)[source]
-
contains_trace
(self, trace_id)[source]
-
export_picture
(self)[source]
-
abstract
export_widget
(self, painter)[source] Render scene with a painter
- Parameters
painter – PyQt painter
-
abstract
update_widget_w_animation
(self, key, index, the_data_animation)[source] What to do when a new element has to be animated. Example: self.theOpenGLWidget.set_deviceToDraw(the_data_animation.get_element_animations(0, index))
- Parameters
key – key of the trace that has to be animated
index – index that has to be animated
the_data_animation –
DataAnimationTrace
that has to be animated
-
abstract
delete_key_widgets
(self, key)[source] What to do when a key has to be deleted
- Parameters
key – key of the trace that has to be deleted
-
-
class
DataAnimationOpenGL
(theOpenGLWidget, theId=0, window_title='Animation')[source]¶ Bases:
optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals
Implements
DataAnimationVisuals
to show opengl drawing
-
class
DataAnimationOpenGLwText
(*args, is_light=True, **kwargs)[source]¶ -
Implements
DataAnimationVisuals
to show opengl drawing and text
-
class
DataAnimationLines
(get_lines_method, is_light=True, theId=0, window_title='Animation')[source]¶ Bases:
optimeed.visualize.gui.gui_data_animation.DataAnimationVisuals
Implements
DataAnimationVisuals
to show drawing made out of lines (widget_line_drawer
)
-
class
DataAnimationVisualswText
(*args, **kwargs)[source]¶ -
Same as
DataAnimationLines
but also with text
-
class
on_graph_click_showAnim
(theLinkDataGraph, theAnimation)[source]¶ Bases:
optimeed.visualize.gui.widgets.widget_graphs_visual.on_graph_click_interface
On click: add or remove an element to animate
-
class
On_select_new_trace
(theLinkDataGraphs)[source]¶ Bases:
optimeed.visualize.gui.gui_data_selector.Action_on_selector_update