UI.flujo module¶
Module for graphics elements in PFD, defining the main qt graphics class:
GraphicsView: PFD viewer
GraphicsScene: PFD scene to manage the graphical elements
and the different graphical items:
GeometricItem: Common functionality for geometric PFD elements
RectItem: Class to plot a rectangular item
EllipseItem: Class to plot a circle or oval item
TextItem: Class to plot a text item
GraphicsEntity: Common functionality for Entity in PFD
StreamItem: Class to plot a mass stream
EquipmentItem: Class to plot equipment item
Dialog related defined:
SelectStreamProject: Dialog to select a stream from a project
TextItemDlg: Dialog to edit texts in PFD
- class UI.flujo.GraphicsView(PFD=True, parent=None)[source]¶
Bases:
QGraphicsViewClass 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
- class UI.flujo.GraphicsScene(parent=None)[source]¶
Bases:
QGraphicsSceneGraphics 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
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
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': []}¶
- waitClick(numClick, tipo, obj)[source]¶
Init wait for click instance to get click mouse user interaction
- class UI.flujo.GeometricItem(parent=None)[source]¶
Bases:
QAbstractGraphicsShapeItemGeneric class with common functionality for geometric PFD elements
- Attributes:
- icon
Methods
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¶
- class UI.flujo.RectItem(parent=None)[source]¶
Bases:
QGraphicsRectItem,GeometricItemClass 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,GeometricItemClass 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:
QGraphicsTextItemClass to plot a text item
Methods
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'¶
- class UI.flujo.GraphicsEntity[source]¶
Bases:
QObjectClass with common functionality for Entity in PFD
Methods
Export data to spreadsheet file
view()Generate text report with properties calculated of entity
- class UI.flujo.StreamItem(parent=None)[source]¶
Bases:
QGraphicsPathItem,GeometricItem,GraphicsEntityClass to plot a mass stream
- Attributes:
Methods
Define context menu with actions availables to show when required at right click mouse
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
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
Toggle label visibility
- up = None¶
- down = None¶
- free_id = []¶
- tipo = 'stream'¶
- id = 0¶
- property corriente¶
Property with Corriente instance
- property entity¶
Property with Corriente instance
- copyFromProject()[source]¶
Show dialog to select any stream from other pychemqt project to copy it in this object
- class UI.flujo.EquipmentItem(name, dialogoId, parent=None)[source]¶
Bases:
QGraphicsSvgItem,GraphicsEntityClass to plot equipment item
Methods
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
Do actions necessary when remove a equipment object
rotate(angle)Rotate equipment image
showInput(boolean)Set visibility of input/output point
Toggle label visibility
- up = []¶
- down = []¶
- up_used = 0¶
- down_used = 0¶
- id_in = 0¶
- id_out = 0¶
- id = 0¶
- tipo = 'equip'¶
- property equipment¶
Property with Equipment instance
- property entity¶
Property with Equipment instance
- 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
- class UI.flujo.SelectStreamProject(parent=None)[source]¶
Bases:
QDialogDialog to select a stream from any external project
- Attributes:
- project
Methods
changeproject(path)Upgrade dialog with the streams of loaded file
- project = None¶