UI.flujo module

Module for graphics elements in PFD, defining the main qt graphics class:

and the different graphical items:

Dialog related defined:

UI.flujo.translate(context: str, sourceText: str, disambiguation: str = None, n: int = -1) str
class UI.flujo.GraphicsView(PFD=True, parent=None)[source]

Bases: QGraphicsView

Class for PFD representation

Methods

changeStatusThermo(config)

Show thermodynamic option in statusbar

dragMoveEvent(event)

Acept drag event

dropEvent(event)

Do drop event simulating a click in the button and using the drop point

leaveEvent([event])

Reimplement to set value of status position to the total size

mouseMoveEvent(event)

Reimplemented to print the mouse position on statusbar

mousePressEvent(event)

Reimplement to use in a overview window the mouse click position as the center position in the real PFD window

updatePosition(event)

Update text with mouse position

wheelEvent(event)

Change zoom of window, only work with PFD window, not in overview

zoom(value)

Apply zoom value to a pfd view

mouseMove

zoomChanged

mouseMove

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

zoomChanged

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

__init__(PFD=True, parent=None)[source]
Parameters:
PFDboolean

Set if this GraphicsView is the PFD of project, in that case the windows can’t be closed

mouseMoveEvent(event)[source]

Reimplemented to print the mouse position on statusbar

mousePressEvent(event)[source]

Reimplement to use in a overview window the mouse click position as the center position in the real PFD window

wheelEvent(event)[source]

Change zoom of window, only work with PFD window, not in overview

leaveEvent(event=None)[source]

Reimplement to set value of status position to the total size

zoom(value)[source]

Apply zoom value to a pfd view

dragMoveEvent(event)[source]

Acept drag event

dropEvent(event)[source]

Do drop event simulating a click in the button and using the drop point

updatePosition(event)[source]

Update text with mouse position

changeStatusThermo(config)[source]

Show thermodynamic option in statusbar

class UI.flujo.GraphicsScene(parent=None)[source]

Bases: QGraphicsScene

Graphics PFD scene too manage the graphical elements

Attributes:
obj

Methods

addActions(menu[, pos])

Define actions and state of its to add to context menu

click()

Actions to do when user finished a mouse interaction action

configure()

Show configure dialog for PFD

contextMenuEvent(event)

Create the context menu to show then right click

copy([items])

Copy selected items to internal clickboard, StreamItem is not supported

cut([items])

Copy selected items to internal clickboard and delete of scene

defineShortcut([pos])

Add actions to QGraphicsView to enable keyboard shortcut

delete([items])

Delete items to the PFD

getObject(tipo, idx)

Return the object of project

mousePressEvent(event)

Save event position to locate item when add

paste([pos])

Paste item saved in internal clipboard to the scene

readFromJSON(data)

Read scene object from project file

readItemFromStream(stream)

Read item from internal clickboard and create item

selectAll()

Select all itemin scene

waitClick(numClick, tipo, obj)

Init wait for click instance to get click mouse user interaction

writeItemToStream(stream, item)

Save item as a QDataStream in memory to paste in PFD is requested

writeToJSON(data)

Save json format to write to file

copiedItem = PyQt6.QtCore.QByteArray()
pasteOffset = 5
points = []
addObj = False
addType = ''
project = <lib.project.Project object>
Pos = []
obj = None
objects = {'ellipse': [], 'equip': {}, 'in': {}, 'out': {}, 'square': [], 'stream': {}, 'txt': []}
__init__(parent=None)[source]
mousePressEvent(event)[source]

Save event position to locate item when add

addActions(menu, pos=None)[source]

Define actions and state of its to add to context menu

defineShortcut(pos=None)[source]

Add actions to QGraphicsView to enable keyboard shortcut

contextMenuEvent(event)[source]

Create the context menu to show then right click

selectAll()[source]

Select all itemin scene

copy(items=None)[source]

Copy selected items to internal clickboard, StreamItem is not supported

cut(items=None)[source]

Copy selected items to internal clickboard and delete of scene

paste(pos=None)[source]

Paste item saved in internal clipboard to the scene

delete(items=None)[source]

Delete items to the PFD

configure()[source]

Show configure dialog for PFD

waitClick(numClick, tipo, obj)[source]

Init wait for click instance to get click mouse user interaction

click()[source]

Actions to do when user finished a mouse interaction action

writeItemToStream(stream, item)[source]

Save item as a QDataStream in memory to paste in PFD is requested

readItemFromStream(stream)[source]

Read item from internal clickboard and create item

readFromJSON(data)[source]

Read scene object from project file

writeToJSON(data)[source]

Save json format to write to file

getObject(tipo, idx)[source]

Return the object of project

class UI.flujo.GeometricItem(parent=None)[source]

Bases: QAbstractGraphicsShapeItem

Generic class with common functionality for geometric PFD elements

Attributes:
icon

Methods

contextMenu()

Define context menu of object

delete()

Delete item from scene

format()

Configure formating of line

getPen()

Get item pen properties in a json serializable format

itemChange(key, value)

Set mainwindow current project modified at any change of item

keyPressEvent(event)

Do action when arrows keys are pressed

tipo = ''
icon = None
__init__(parent=None)[source]
_pen()[source]

Load pen properties from preferences

getPen()[source]

Get item pen properties in a json serializable format

delete()[source]

Delete item from scene

format()[source]

Configure formating of line

contextMenu()[source]

Define context menu of object

itemChange(key, value)[source]

Set mainwindow current project modified at any change of item

keyPressEvent(event)[source]

Do action when arrows keys are pressed

class UI.flujo.RectItem(parent=None)[source]

Bases: QGraphicsRectItem, GeometricItem

Class to plot a rectangular item

tipo = 'square'
icon = '/home/docs/checkouts/readthedocs.org/user_builds/pychemqt/checkouts/latest/images/equipment/square.png'
class UI.flujo.EllipseItem(parent=None)[source]

Bases: QGraphicsEllipseItem, GeometricItem

Class to plot a circle or oval item

tipo = 'ellipse'
icon = '/home/docs/checkouts/readthedocs.org/user_builds/pychemqt/checkouts/latest/images/equipment/cirle.png'
class UI.flujo.TextItem(text, parent=None, position=PyQt6.QtCore.QPointF(), transform=<PyQt6.QtGui.QTransform object>, selectable=True)[source]

Bases: QGraphicsTextItem

Class to plot a text item

Methods

contextMenu()

Define context menu of item

delete()

Delete item from scene

itemChange(key, value)

Set mainwindow current project modified at any change of item

keyPressEvent(event)

Do action when arrows keys are pressed

mouseDoubleClickEvent([event])

Show dialog to change text

tipo = 'txt'
__init__(text, parent=None, position=PyQt6.QtCore.QPointF(), transform=<PyQt6.QtGui.QTransform object>, selectable=True)[source]
delete()[source]

Delete item from scene

mouseDoubleClickEvent(event=None)[source]

Show dialog to change text

contextMenu()[source]

Define context menu of item

itemChange(key, value)[source]

Set mainwindow current project modified at any change of item

keyPressEvent(event)[source]

Do action when arrows keys are pressed

class UI.flujo.GraphicsEntity[source]

Bases: QObject

Class with common functionality for Entity in PFD

Methods

exportExcel()

Export data to spreadsheet file

view()

Generate text report with properties calculated of entity

view()[source]

Generate text report with properties calculated of entity

exportExcel()[source]

Export data to spreadsheet file

class UI.flujo.StreamItem(parent=None)[source]

Bases: QGraphicsPathItem, GeometricItem, GraphicsEntity

Class to plot a mass stream

Attributes:
corriente

Property with Corriente instance

down
entity

Property with Corriente instance

up

Methods

contextMenu()

Define context menu with actions availables to show when required at right click mouse

copyFromProject()

Show dialog to select any stream from other pychemqt project to copy it in this object

hoverEnterEvent(event)

Show popup dialog with info when the mouse stay over the object

hoverLeaveEvent(event)

Hide popup dialog when mouse leave object

hoverMoveEvent(event)

Move popup dialog when the mouse move over the object

keyPressEvent(event)

Do action when keys are pressed

mouseDoubleClickEvent([event])

Show Corriente dialog when double click object

postDelete()

Do actions necessary when remove a stream object

redraw([entrada, salida])

Recalcule the stream path in screen

setCorriente(corriente)

Set Corriente instance

solidFit()

Show a dialog to fit solid particle size distribution

toggleLabel()

Toggle label visibility

up = None
down = None
free_id = []
tipo = 'stream'
__init__(parent=None)[source]
id = 0
property corriente

Property with Corriente instance

property entity

Property with Corriente instance

setCorriente(corriente)[source]

Set Corriente instance

mouseDoubleClickEvent(event=None)[source]

Show Corriente dialog when double click object

copyFromProject()[source]

Show dialog to select any stream from other pychemqt project to copy it in this object

keyPressEvent(event)[source]

Do action when keys are pressed

hoverEnterEvent(event)[source]

Show popup dialog with info when the mouse stay over the object

hoverLeaveEvent(event)[source]

Hide popup dialog when mouse leave object

hoverMoveEvent(event)[source]

Move popup dialog when the mouse move over the object

contextMenu()[source]

Define context menu with actions availables to show when required at right click mouse

redraw(entrada=None, salida=None)[source]

Recalcule the stream path in screen

postDelete()[source]

Do actions necessary when remove a stream object

toggleLabel()[source]

Toggle label visibility

solidFit()[source]

Show a dialog to fit solid particle size distribution

class UI.flujo.EquipmentItem(name, dialogoId, parent=None)[source]

Bases: QGraphicsSvgItem, GraphicsEntity

Class to plot equipment item

Attributes:
entity

Property with Equipment instance

equipment

Property with Equipment instance

Methods

contextMenu()

Define context menu with actions availables to show when required at right click mouse

delete()

Delete item from scene

format()

Configure apperance of equipment svg

hoverEnterEvent(event)

Do actions when mouse hover over the object, show input/output point when it's waiting user interaction or popup info in other case

hoverLeaveEvent(event)

Hide object shown at hoverEnterEvent

hoverMoveEvent(event)

Move popup with mouse movement

itemChange(key, value)

Set mainwindow current project modified at any change of item

keyPressEvent(event)

Do action when arrows keys are pressed

mouseDoubleClickEvent([event])

Show equipment dialog when double click object

mouseMoveEvent([event])

Move object in scene and redraw the streams associated to it

mousePressEvent(event)

If any user interaction is waiting manage that mouse click

postDelete()

Do actions necessary when remove a equipment object

rotate(angle)

Rotate equipment image

showInput(boolean)

Set visibility of input/output point

toggleLabel()

Toggle label visibility

up = []
down = []
up_used = 0
down_used = 0
id_in = 0
id_out = 0
__init__(name, dialogoId, parent=None)[source]
id = 0
tipo = 'equip'
property equipment

Property with Equipment instance

property entity

Property with Equipment instance

mouseDoubleClickEvent(event=None)[source]

Show equipment dialog when double click object

mousePressEvent(event)[source]

If any user interaction is waiting manage that mouse click

mouseMoveEvent(event=None)[source]

Move object in scene and redraw the streams associated to it

showInput(boolean)[source]

Set visibility of input/output point

hoverEnterEvent(event)[source]

Do actions when mouse hover over the object, show input/output point when it’s waiting user interaction or popup info in other case

hoverLeaveEvent(event)[source]

Hide object shown at hoverEnterEvent

hoverMoveEvent(event)[source]

Move popup with mouse movement

keyPressEvent(event)[source]

Do action when arrows keys are pressed

itemChange(key, value)[source]

Set mainwindow current project modified at any change of item

contextMenu()[source]

Define context menu with actions availables to show when required at right click mouse

delete()[source]

Delete item from scene

format()[source]

Configure apperance of equipment svg

postDelete()[source]

Do actions necessary when remove a equipment object

toggleLabel()[source]

Toggle label visibility

rotate(angle)[source]

Rotate equipment image

class UI.flujo.SelectStreamProject(parent=None)[source]

Bases: QDialog

Dialog to select a stream from any external project

Attributes:
project

Methods

changeproject(path)

Upgrade dialog with the streams of loaded file

project = None
__init__(parent=None)[source]
changeproject(path)[source]

Upgrade dialog with the streams of loaded file

class UI.flujo.TextItemDlg(text=None, parent=None)[source]

Bases: QDialog

Dialog to edit texts in PFD

Methods

updateUi()

Set enable/disable OK button

__init__(text=None, parent=None)[source]
updateUi()[source]

Set enable/disable OK button