Graph Visualizer for the VH diagram.

class posydon.visualization.VH_diagram.GraphVisualizer.CaseInfos(column_id, *, centered_txt: str = '', bot_right_txt: str = '', bot_left_txt: str = '', top_right_txt: str = '', tot_left_txt: str = '', border_width: int = 0)[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.Infos

Informations to create a case widget.

Initialize a CaseInfos instance.

border_width: int
bot_left_text: str
bot_right_text: str
centered_text: str
top_left_text: str
top_right_text: str
class posydon.visualization.VH_diagram.GraphVisualizer.ConnectedItem(from_item: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem, to_item: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem)[source]

Bases: object

Represent a visual link between 2 widgets.

Initialize a ConnectedItem instance.

from_item: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem
to_item: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem
class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizer[source]

Bases: PyQt5.QtWidgets.QWidget

Widget used to display the different columns and add widget in them.

Initialize a GraphVisualizer instance.

add_column(column_type, column_span=1)[source]

Create a column according to the column_type.

It takes account for the column_span of the logical column.

Parameters
  • column_type (columnTYPE) – Type of the column to add.

  • column_span (int) – Nb of logical column used.

Returns

ID of created column.

Return type

int

add_line(infos)[source]

Add all lines based on all elements in infos.

For each info in infos, create the corresponding widget and add it to the column with corresponding id (given in each info), only 1 widget per column by call, if one column haven’t any widget associated, column skip this row.

Parameters

infos (Array of Infos) – Array with derivated struct of Infos to create the different widget for this line.

clear()[source]

Clear each column.

get_column(column_id)[source]

Return visual column with the given id.

Parameters

column_id (int) – ID of searched column.

Returns

column with the given ID.

Return type

GraphVisualizercolumn

paintEvent(event)[source]

Paint the event.

reset()[source]

Clear all delete each column.

saveAsPicture(filename)[source]

Render this widget in a picture and save it a filename.

Parameters

filename (str) – Destination file of the picture.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerCase[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem

Case widget in GraphVisualizer.

Provides the ability to display 5 texts: 2 on the top 2 on the bottom, and 1 in center. Can have a border.

Initialize a GraphVisualizerCase instance.

get_attach_point_bot()[source]

Get coordinate to connect this widget with the next one.

get_attach_point_top()[source]

Get coordinate to connect this widget with the previous one.

set_bottom_left_text(text)[source]

Set the text at the bottom left.

set_bottom_rigth_text(text)[source]

Set the text at the bottom right.

set_central_border(width)[source]

Set the text at the central border.

set_central_text(text)[source]

Set the text at the center.

set_top_left_text(text)[source]

Set the text at the top left.

set_top_right_text(text)[source]

Set the text at the top right.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerConnectedcolumn(grid, column_id, column_span=1)[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizercolumn

Simple visual column with arrow between connected widget.

Initialize a GraphVisualizerConnectedcolumn instance.

draw(surface)[source]

Draw the surface.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem[source]

Bases: PyQt5.QtWidgets.QWidget

Define the mother-class for widget in GraphVisualizer.

connected

Indicate if this widget need to be connected with the previous one in the same column.

Type

bool

Initialize a GraphVisualizerItem instrance.

get_attach_point_bot()[source]

Get coordinate to connect this widget with the next one.

Returns

Coordinate to link the widget with the next one.

Return type

int

get_attach_point_top()[source]

Get coordinate to connect this widget with the previous one.

Returns

Coordinate to link the widget with the previous one.

Return type

int

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerPoint[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem

Widget containing GraphVisualizerPointDraw.

Provides the ability to display 2 texts, one at each side.

Initialize a GraphVisualizerPoint instance.

get_attach_point_bot()[source]

Get coordinate to connect this widget with the next one.

get_attach_point_top()[source]

Get coordinate to connect this widget with the previous one.

set_text(text)[source]

Se the text of the label.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerPointDraw[source]

Bases: PyQt5.QtWidgets.QWidget

Define an empty widget with a point drew.

Initialize a GraphVisualizerPointDraw instance.

paintEvent(event)[source]

Paint an event.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerState[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerItem

Widget containing drawings.

Provides the ability to display 4 texts on top & bottom.

Initialize a GraphVisualizerState instance.

get_attach_point_bot()[source]

Get coordinate to connect this widget with the next one.

get_attach_point_top()[source]

Get coordinate to connect this widget with the previous one.

paintEvent(event)[source]

Paint the event.

resizeEvent(event)[source]

Resize the event.

set_bot_text(text, index)[source]

Se the text of the bottom label.

set_distance(dist)[source]

Set the distance.

set_event(filename)[source]

Load the picture ‘filename’ and resize it if needed.

Parameters

filename (str) – Name (+ path) to the picture.

Returns

Indicate if loading & resize success.

Return type

bool

set_first_star(filename)[source]

Load the picture ‘filename’ and resize it if needed.

Parameters

filename (str) – Name (+ path) to the picture.

Returns

Indicate if loading & resize success.

Return type

bool

set_second_star(filename)[source]

Load the picture ‘filename’ and resize it if needed.

Parameters

filename (str) – Name (+ path) to the picture.

Returns

Indicate if loading & resize success.

Return type

bool

set_top_text(text, index)[source]

Set the text of the top label.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizerTimeline(grid, column_id, column_span=1)[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizercolumn

Draw a visual column, compressed by another other column.

Initialize a GraphVisualizerTimeline instance.

draw(surface)[source]

Draw the surface.

class posydon.visualization.VH_diagram.GraphVisualizer.GraphVisualizercolumn(grid, column_id, column_span)[source]

Bases: object

Mother-class of visual column in GraphVisualizer.

Manage one visual column in the QGridLayout (can take several logical columns).

Initialize a GraphVisualizercolumn instance.

Parameters
  • grid (QGridLayout) – Grid where column take place.

  • column_id (int) – Unique id of this column.

  • column_span (int) – Number of logical column used.

add_item(item)[source]

Add one item in the column, connect it to previous if needed.

Parameters

item (GraphVisualizerItem) – Widget to add in column.

clear()[source]

Delete all widget in the column, keep the title.

get_id()[source]

Return the column id.

reset()[source]

Delete everythings (widget + title), reset logical column used.

set_title(title)[source]

Set the title.

skip()[source]

Skip one row.

class posydon.visualization.VH_diagram.GraphVisualizer.INFOSTYPE(value)[source]

Bases: enum.Enum

Enumeration of different type of infos.

CASE = 1
POINT = 2
STATE = 3
class posydon.visualization.VH_diagram.GraphVisualizer.Infos(column_id, infos_type, connected)[source]

Bases: object

Mother-class with common informations uselful for all widget.

Initialize an Infos instance.

column_id: int
connected: bool
infos_type: posydon.visualization.VH_diagram.GraphVisualizer.INFOSTYPE
class posydon.visualization.VH_diagram.GraphVisualizer.PointInfos(column_id, text: str = '')[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.Infos

Informations to create a widget with a point drew.

Initialize a PointInfos instance.

text: str
class posydon.visualization.VH_diagram.GraphVisualizer.StateInfos(column_id, *, S1_filename=None, S2_filename=None, event_filename=None, distance=1)[source]

Bases: posydon.visualization.VH_diagram.GraphVisualizer.Infos

Information to create a widget with a line of diagram inside.

Initialize a StateInfos instance.

S1_filename: str
S2_filename: str
bot_texts: list
distance: int
top_texts: list
class posydon.visualization.VH_diagram.GraphVisualizer.columnTYPE(value)[source]

Bases: enum.Enum

Enumeration of different column type.

CONNECTED = 2
TIMELINE = 1
posydon.visualization.VH_diagram.GraphVisualizer.prepare_case(infos: posydon.visualization.VH_diagram.GraphVisualizer.CaseInfos)[source]

Help to create GraphVisualizerCase from CaseInfos.

Parameters

infos (CaseInfos) – Infos to create the widget.

Returns

Created widget with given infos.

Return type

GraphVisualizerCase

posydon.visualization.VH_diagram.GraphVisualizer.prepare_point(infos: posydon.visualization.VH_diagram.GraphVisualizer.PointInfos)[source]

Help to create GraphVisualizerPoint from PointInfos.

Parameters

infos (PointInfos) – Infos to create the widget.

Returns

Created widget with given infos.

Return type

GraphVisualizerPoint

posydon.visualization.VH_diagram.GraphVisualizer.prepare_state(infos: posydon.visualization.VH_diagram.GraphVisualizer.StateInfos)[source]

Help to create GraphVisualizerState from StateInfos.

Parameters

infos (StateInfos) – Infos to create the widget.

Returns

Created widget with given infos.

Return type

GraphVisualizerState