GridCal.Gui package¶
Subpackages¶
- GridCal.Gui.Analysis package
- GridCal.Gui.Main package
- GridCal.Gui.ProfilesInput package
- Submodules
- GridCal.Gui.ProfilesInput.excel_dialog module
- GridCal.Gui.ProfilesInput.excel_sheet_selection module
- GridCal.Gui.ProfilesInput.gui module
- GridCal.Gui.ProfilesInput.icons_rc module
- GridCal.Gui.ProfilesInput.matplotlibwidget module
- GridCal.Gui.ProfilesInput.profile_dialogue module
- GridCal.Gui.ProfilesInput.update_gui_file module
- Submodules
- GridCal.Gui.TowerBuilder package
- Submodules
- GridCal.Gui.TowerBuilder.LineBuilderDialogue module
- GridCal.Gui.TowerBuilder.gui module
- GridCal.Gui.TowerBuilder.icons_rc module
- GridCal.Gui.TowerBuilder.matplotlibwidget module
- GridCal.Gui.TowerBuilder.test_ module
- GridCal.Gui.TowerBuilder.tower_model module
- GridCal.Gui.TowerBuilder.update_gui_file module
- Submodules
Submodules¶
GridCal.Gui.ConsoleWidget module¶
-
class
GridCal.Gui.ConsoleWidget.
ConsoleWidget
(customBanner=None, *args, **kwargs)¶ Bases:
qtconsole.rich_jupyter_widget.RichJupyterWidget
Convenience class for a live IPython console widget. We can replace the standard banner using the customBanner argument
-
clear
()¶ Clears the terminal
-
execute_command
(command)¶ Execute a command in the frame of the console widget
-
print_text
(text)¶ Prints some plain text to the console
-
push_vars
(variableDict)¶ Given a dictionary containing name / value pairs, push those variables to the IPython console widget
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
GridCal.Gui.GeneralDialogues module¶
-
class
GridCal.Gui.GeneralDialogues.
ElementsDialogue
(name, elements: [])¶ Bases:
PySide2.QtWidgets.QDialog
Selected elements dialogue window
-
accept_click
()¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GeneralDialogues.
LogsDialogue
(name, logs: [])¶ Bases:
PySide2.QtWidgets.QDialog
New profile dialogue window
-
accept_click
()¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GeneralDialogues.
NewProfilesStructureDialogue
¶ Bases:
PySide2.QtWidgets.QDialog
New profile dialogue window
-
accept_click
()¶
-
get_values
()¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GeneralDialogues.
ProfileTypes
¶ Bases:
enum.Enum
An enumeration.
-
Generators
= 2¶
-
Loads
= (1,)¶
-
-
GridCal.Gui.GeneralDialogues.
get_list_model
(lst, checks=False)¶ Pass a list to a list model
GridCal.Gui.GridEditorWidget module¶
-
class
GridCal.Gui.GridEditorWidget.
BatteryGraphicItem
(parent, api_obj, diagramScene)¶ Bases:
PySide2.QtWidgets.QGraphicsItemGroup
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
enable_disable_toggle
()¶ @return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot
()¶ Plot API objects profiles
-
remove
()¶ Remove this element @return:
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
update_line
(pos)¶ Update the line that joins the parent and this object :param pos: position of this object
-
-
class
GridCal.Gui.GridEditorWidget.
BranchGraphicItem
(fromPort, toPort, diagramScene, width=5, branch: GridCal.Engine.Devices.branch.Branch = None)¶ Bases:
PySide2.QtWidgets.QGraphicsLineItem
-
add_to_templates
()¶ Open the appropriate editor dialogue :return:
-
contextMenuEvent
(event)¶ Show context menu @param event: @return:
-
edit
()¶ Open the appropriate editor dialogue :return:
-
enable_disable_toggle
()¶ @return:
-
make_reactance_symbol
()¶ Make the reactance symbol :return:
-
make_switch_symbol
()¶ Mathe the switch symbol :return:
-
make_transformer_symbol
()¶ create the transformer simbol :return:
-
mouseDoubleClickEvent
(event)¶ On double click, edit :param event: :return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot_profiles
()¶ Plot the time series profiles @return:
-
redraw
()¶ Redraw the line with the given positions @return:
-
reduce
()¶ Reduce this branch
-
remove
()¶ Remove this object in the diagram and the API @return:
-
remove_symbol
()¶
-
remove_widget
()¶ Remove this object in the diagram @return:
-
setBeginPos
(pos1)¶ Set the starting position @param pos1: @return:
-
setEndPos
(endpos)¶ Set the starting position @param endpos: @return:
-
setFromPort
(fromPort)¶ Set the From terminal in a connection @param fromPort: @return:
-
setToPort
(toPort)¶ Set the To terminal in a connection @param toPort: @return:
-
setToolTipText
(toolTip: str)¶ Set branch tool tip text Args:
toolTip: text
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
set_pen
(pen)¶ Set pen to all objects Args:
pen:
-
tap_down
()¶ Set one tap down
-
tap_up
()¶ Set one tap up
-
update_symbol
()¶ Make the branch symbol :return:
-
-
class
GridCal.Gui.GridEditorWidget.
BusGraphicItem
(diagramScene, name='Untitled', parent=None, index=0, editor=None, bus: GridCal.Engine.Devices.bus.Bus = None, pos: PySide2.QtCore.QPoint = None)¶ Bases:
PySide2.QtWidgets.QGraphicsRectItem
Represents a block in the diagram Has an x and y and width and height width and height can only be adjusted with a tip in the lower right corner.
- in and output ports
- parameters
- description
-
adapt
()¶ Set the bus width according to the label text
-
add_battery
(api_obj=None)¶ Returns:
-
add_big_marker
(color=PySide2.QtCore.Qt.GlobalColor.red)¶ Add a big marker to the bus Args:
color: Qt Color ot the marker
-
add_generator
(api_obj=None)¶ Returns:
-
add_load
(api_obj=None)¶ Returns:
-
add_shunt
(api_obj=None)¶ Returns:
-
add_static_generator
(api_obj=None)¶ Returns:
-
arrange_children
()¶ This function sorts the load and generators icons Returns:
Nothing
-
change_size
(w, h)¶ Resize block function @param w: @param h: @return:
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
create_children_icons
()¶ Create the icons of the elements that are attached to the API bus object Returns:
Nothing
-
delete_all_connections
()¶
-
delete_big_marker
()¶ Delete the big marker
-
enable_disable_sc
()¶ Returns:
-
enable_disable_toggle
()¶ Toggle bus element state @return:
-
merge
(other_bus_graphic)¶
-
mouseDoubleClickEvent
(event)¶ Mouse double click :param event: event object
-
mouseMoveEvent
(event: PySide2.QtWidgets.QGraphicsSceneMouseEvent)¶ On mouse move of this object… Args:
event: QGraphicsSceneMouseEvent inherited
-
mousePressEvent
(event)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot_profiles
()¶ @return:
-
reduce
()¶ Reduce this bus :return:
-
remove
()¶ Remove this element @return:
-
set_tile_color
(brush)¶ Set the color of the title Args:
brush: Qt Color
-
update
()¶ Update the object :return:
-
class
GridCal.Gui.GridEditorWidget.
Circle
(parent)¶ Bases:
GridCal.Gui.GridEditorWidget.LineUpdateMixin
,PySide2.QtWidgets.QGraphicsEllipseItem
-
class
GridCal.Gui.GridEditorWidget.
DiagramScene
(parent=None, circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit = None)¶ Bases:
PySide2.QtWidgets.QGraphicsScene
-
mouseMoveEvent
(mouseEvent)¶ @param mouseEvent: @return:
-
mouseReleaseEvent
(mouseEvent)¶ @param mouseEvent: @return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GridEditorWidget.
EditorGraphicsView
(scene, parent=None, editor=None, lat0=42, lon0=55, zoom=3)¶ Bases:
PySide2.QtWidgets.QGraphicsView
-
adapt_map_size
()¶
-
add_bus
(bus: GridCal.Engine.Devices.bus.Bus, explode_factor=1.0)¶ Add bus Args:
bus: GridCal Bus object explode_factor: factor to position the node
-
dragEnterEvent
(event)¶ @param event: @return:
-
dragMoveEvent
(event)¶ Move element @param event: @return:
-
dropEvent
(event)¶ Create an element @param event: @return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
view_map
(flag=True)¶ Parameters: flag – Returns:
-
wheelEvent
(event)¶ Zoom @param event: @return:
-
-
class
GridCal.Gui.GridEditorWidget.
GeneralItem
¶ Bases:
object
-
contextMenuEvent
(event)¶
-
delete_all_connections
()¶
-
editParameters
()¶
-
remove_
()¶ @return:
-
rotate
(angle)¶
-
rotate_clockwise
()¶
-
rotate_counterclockwise
()¶
-
-
class
GridCal.Gui.GridEditorWidget.
GeneratorGraphicItem
(parent, api_obj, diagramScene)¶ Bases:
PySide2.QtWidgets.QGraphicsItemGroup
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
enable_disable_toggle
()¶ @return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot
()¶ Plot API objects profiles
-
remove
()¶ Remove this element @return:
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
update_line
(pos)¶ Update the line that joins the parent and this object :param pos: position of this object
-
-
class
GridCal.Gui.GridEditorWidget.
GridEditor
(circuit: GridCal.Engine.Core.multi_circuit.MultiCircuit, lat0=42, lon0=55, zoom=3)¶ Bases:
PySide2.QtWidgets.QSplitter
-
add_branch
(branch)¶ Add branch to the schematic :param branch: Branch object
-
auto_layout
()¶ Automatic layout of the nodes
-
bigger_nodes
()¶ Expand the grid @return:
-
center_nodes
()¶ Center the view in the nodes @return: Nothing
-
export
(filename, w=1920, h=1080)¶ Save the grid to a png file :return:
-
sceneMouseMoveEvent
(event)¶ @param event: @return:
-
sceneMouseReleaseEvent
(event)¶ Finalize the branch creation if its drawing ends in a terminal @param event: @return:
-
schematic_from_api
(explode_factor=1.0)¶ Generate schematic from the API :param explode_factor: factor to separate the nodes :return: Nothing
-
set_limits
(min_x, max_x, min_y, max_y, margin_factor=0.1)¶ Set the picture limits :param min_x: Minimum x value of the buses location :param max_x: Maximum x value of the buses location :param min_y: Minimum y value of the buses location :param max_y: Maximum y value of the buses location :param margin_factor: factor of separation between the buses
-
smaller_nodes
()¶ Contract the grid @return:
-
startConnection
(port: GridCal.Gui.GridEditorWidget.TerminalItem)¶ Start the branch creation @param port: @return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GridEditorWidget.
HandleItem
(parent=None)¶ Bases:
PySide2.QtWidgets.QGraphicsEllipseItem
A handle that can be moved by the mouse: Element to resize the boxes
-
itemChange
(change, value)¶ @param change: @param value: @return:
-
-
class
GridCal.Gui.GridEditorWidget.
LibraryModel
(parent=None)¶ Bases:
PySide2.QtGui.QStandardItemModel
Items model to host the draggable icons
-
mimeData
(idxs)¶ @param idxs: @return:
-
mimeTypes
()¶ @return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GridEditorWidget.
LineEditor
(branch: GridCal.Engine.Devices.branch.Branch, Sbase=100)¶ Bases:
PySide2.QtWidgets.QDialog
-
accept_click
()¶ Set the values :return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GridEditorWidget.
LineUpdateMixin
(parent)¶ Bases:
object
-
itemChange
(change, value)¶
-
-
class
GridCal.Gui.GridEditorWidget.
LoadGraphicItem
(parent, api_obj, diagramScene)¶ Bases:
PySide2.QtWidgets.QGraphicsItemGroup
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
enable_disable_toggle
()¶ @return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot
()¶
-
remove
()¶ Remove this element @return:
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
update_line
(pos)¶ Update the line that joins the parent and this object :param pos: position of this object
-
-
class
GridCal.Gui.GridEditorWidget.
MapWidget
(scene: PySide2.QtWidgets.QGraphicsScene, view: PySide2.QtWidgets.QGraphicsView, lat0=42, lon0=55, zoom=3)¶ Bases:
PySide2.QtWidgets.QGraphicsRectItem
-
change_size
(w, h)¶ Resize block function @param w: @param h: @return:
-
load_map
(lat0=42, lon0=55, zoom=3)¶ Load a map image into the widget :param lat0: :param lon0: :param zoom: 1~14
-
paint
(painter, option, widget=None)¶ Action that happens on widget repaint :param painter: :param option: :param widget:
-
repaint
()¶ Reload with the last parameters
-
-
class
GridCal.Gui.GridEditorWidget.
ObjectFactory
¶ Bases:
object
-
get_box
()¶ @return:
-
get_circle
()¶ @return:
-
-
class
GridCal.Gui.GridEditorWidget.
ParameterDialog
(parent=None)¶ Bases:
PySide2.QtWidgets.QDialog
-
OK
()¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GridEditorWidget.
Polygon
(parent)¶ Bases:
GridCal.Gui.GridEditorWidget.LineUpdateMixin
,PySide2.QtWidgets.QGraphicsPolygonItem
-
class
GridCal.Gui.GridEditorWidget.
QLine
(parent)¶ Bases:
GridCal.Gui.GridEditorWidget.LineUpdateMixin
,PySide2.QtWidgets.QGraphicsLineItem
-
class
GridCal.Gui.GridEditorWidget.
ShuntGraphicItem
(parent, api_obj, diagramScene)¶ Bases:
PySide2.QtWidgets.QGraphicsItemGroup
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
enable_disable_toggle
()¶ @return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot
()¶ Plot API objects profiles
-
remove
()¶ Remove this element @return:
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
update_line
(pos)¶ Update the line that joins the parent and this object :param pos: position of this object
-
-
class
GridCal.Gui.GridEditorWidget.
Square
(parent)¶ Bases:
GridCal.Gui.GridEditorWidget.LineUpdateMixin
,PySide2.QtWidgets.QGraphicsRectItem
-
class
GridCal.Gui.GridEditorWidget.
StaticGeneratorGraphicItem
(parent, api_obj, diagramScene)¶ Bases:
PySide2.QtWidgets.QGraphicsItemGroup
-
contextMenuEvent
(event)¶ Display context menu @param event: @return:
-
enable_disable_toggle
()¶ @return:
-
mousePressEvent
(QGraphicsSceneMouseEvent)¶ mouse press: display the editor :param QGraphicsSceneMouseEvent: :return:
-
plot
()¶ Plot API objects profiles
-
remove
()¶ Remove this element @return:
-
set_enable
(val=True)¶ Set the enable value, graphically and in the API @param val: @return:
-
update_line
(pos)¶ Update the line that joins the parent and this object :param pos: position of this object
-
-
class
GridCal.Gui.GridEditorWidget.
TerminalItem
(name, editor=None, parent=None, h=10, w=10)¶ Bases:
PySide2.QtWidgets.QGraphicsRectItem
Represents a connection point to a subsystem
-
itemChange
(change, value)¶ @param change: @param value: This is a QPointF object with the coordinates of the upper left corner of the TerminalItem @return:
-
mousePressEvent
(event)¶ Start a connection Args:
event:Returns:
-
process_callbacks
(value)¶
-
remove_all_connections
()¶ Removes all the terminal connections Returns:
-
GridCal.Gui.GuiFunctions module¶
-
class
GridCal.Gui.GuiFunctions.
BranchObjectModel
(objects, editable_headers, parent=None, editable=False, non_editable_attributes=[], transposed=False, check_unique=[], catalogue_dict={})¶ Bases:
GridCal.Gui.GuiFunctions.ObjectsModel
-
set_delegates
()¶ Set the cell editor types depending on the attribute_types array :return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
ComboDelegate
(parent, objects, object_names)¶ Bases:
PySide2.QtWidgets.QItemDelegate
-
commitData
= <PySide2.QtCore.Signal object>¶ A delegate that places a fully functioning QComboBox in every cell of the column to which it’s applied
-
createEditor
(self, parent:PySide2.QtWidgets.QWidget, option:PySide2.QtWidgets.QStyleOptionViewItem, index:PySide2.QtCore.QModelIndex) → PySide2.QtWidgets.QWidget¶
-
currentIndexChanged
()¶
-
setEditorData
(self, editor:PySide2.QtWidgets.QWidget, index:PySide2.QtCore.QModelIndex)¶
-
setModelData
(self, editor:PySide2.QtWidgets.QWidget, model:PySide2.QtCore.QAbstractItemModel, index:PySide2.QtCore.QModelIndex)¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
ComplexDelegate
(parent)¶ Bases:
PySide2.QtWidgets.QItemDelegate
-
commitData
= <PySide2.QtCore.Signal object>¶ A delegate that places a fully functioning Complex Editor in every cell of the column to which it’s applied
-
createEditor
(parent, option, index)¶ Parameters: - parent –
- option –
- index –
Returns:
-
returnPressed
()¶ Returns:
-
setEditorData
(editor, index)¶ Parameters: - editor –
- index –
Returns:
-
setModelData
(editor, model, index)¶ Parameters: - editor –
- model –
- index –
Returns:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
EnumModel
(list_of_enums)¶ Bases:
PySide2.QtCore.QAbstractListModel
-
data
(self, index:PySide2.QtCore.QModelIndex, role:int=PySide2.QtCore.Qt.ItemDataRole.DisplayRole) → typing.Any¶
-
rowCount
(self, parent:PySide2.QtCore.QModelIndex=Invalid(PySide2.QtCore.QModelIndex)) → int¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
FloatDelegate
(parent, min_=-9999, max_=9999)¶ Bases:
PySide2.QtWidgets.QItemDelegate
-
commitData
= <PySide2.QtCore.Signal object>¶ A delegate that places a fully functioning QDoubleSpinBox in every cell of the column to which it’s applied
-
createEditor
(self, parent:PySide2.QtWidgets.QWidget, option:PySide2.QtWidgets.QStyleOptionViewItem, index:PySide2.QtCore.QModelIndex) → PySide2.QtWidgets.QWidget¶
-
returnPressed
()¶
-
setEditorData
(self, editor:PySide2.QtWidgets.QWidget, index:PySide2.QtCore.QModelIndex)¶
-
setModelData
(self, editor:PySide2.QtWidgets.QWidget, model:PySide2.QtCore.QAbstractItemModel, index:PySide2.QtCore.QModelIndex)¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
MeasurementsModel
(circuit)¶ Bases:
PySide2.QtCore.QAbstractListModel
-
data
(self, index:PySide2.QtCore.QModelIndex, role:int=PySide2.QtCore.Qt.ItemDataRole.DisplayRole) → typing.Any¶
-
rowCount
(self, parent:PySide2.QtCore.QModelIndex=Invalid(PySide2.QtCore.QModelIndex)) → int¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
ObjectHistory
(max_undo_states=100)¶ Bases:
object
-
add_state
(action_name, data: dict)¶ Add an undo state :param action_name: name of the action that was performed :param data: dictionary {column index -> profile array}
-
can_redo
()¶ is it possible to redo? :return: True / False
-
can_undo
()¶ Is it possible to undo? :return: True / False
-
redo
()¶ Re-do table :return: table instance
-
undo
()¶ Un-do table :return: table instance
-
-
class
GridCal.Gui.GuiFunctions.
ObjectsModel
(objects, editable_headers, parent=None, editable=False, non_editable_attributes=[], transposed=False, check_unique=[])¶ Bases:
PySide2.QtCore.QAbstractTableModel
Class to populate a Qt table view with the properties of objects
-
attr_taken
(attr, val)¶ Checks if the attribute value is taken :param attr: :param val: :return:
-
columnCount
(parent=None)¶ Get number of columns :param parent: :return:
-
copy_to_column
(index)¶ Copy the value pointed by the index to all the other cells in the column :param index: QModelIndex instance :return:
-
data
(index, role=None)¶ Get the data to display :param index: :param role: :return:
-
data_with_type
(index)¶ Get the data to display :param index: :return:
-
flags
(index)¶ Get the display mode :param index: :return:
-
headerData
(p_int, orientation, role)¶ Get the headers to display :param p_int: :param orientation: :param role: :return:
-
rowCount
(parent=None)¶ Get number of rows :param parent: :return:
-
setData
(index, value, role=None)¶ Set data by simple editor (whatever text) :param index: :param value: :param role: :return:
-
set_delegates
()¶ Set the cell editor types depending on the attribute_types array :return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
update
()¶ update table
-
-
class
GridCal.Gui.GuiFunctions.
PandasModel
(data: pandas.core.frame.DataFrame, parent=None, editable=False, editable_min_idx=-1, decimals=6)¶ Bases:
PySide2.QtCore.QAbstractTableModel
Class to populate a Qt table view with a pandas data frame
-
columnCount
(parent=None)¶ Parameters: parent – Returns:
-
copy_to_clipboard
(mode=None)¶ Copy profiles to clipboard Args:
mode: ‘real’, ‘imag’, ‘abs’
-
copy_to_column
(row, col)¶ Copies one value to all the column @param row: Row of the value @param col: Column of the value @return: Nothing
-
data
(index, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Parameters: - index –
- role –
Returns:
-
flags
(self, index:PySide2.QtCore.QModelIndex) → PySide2.QtCore.Qt.ItemFlags¶
-
get_data
(mode=None)¶ - Args:
- mode: ‘real’, ‘imag’, ‘abs’
Returns: index, columns, data
-
headerData
(p_int, orientation, role)¶ Parameters: - p_int –
- orientation –
- role –
Returns:
-
rowCount
(parent=None)¶ Parameters: parent – Returns:
-
save_to_excel
(file_name, mode)¶ - Args:
- file_name: mode: ‘real’, ‘imag’, ‘abs’
Returns:
-
setData
(index, value, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Parameters: - index –
- value –
- role –
Returns:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
ProfilesModel
(multi_circuit, device_type: GridCal.Engine.Devices.meta_devices.DeviceType, magnitude, format, parent, max_undo_states=100)¶ Bases:
PySide2.QtCore.QAbstractTableModel
Class to populate a Qt table view with profiles from objects
-
add_state
(columns, action_name='')¶ Compile data of an action and store the data in the undo history :param columns: list of column indices changed :param action_name: name of the action :return: None
-
columnCount
(parent=None)¶ Get number of columns :param parent: :return:
-
copy_to_clipboard
()¶ Copy profiles to clipboard
-
data
(index, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Get the data to display :param index: :param role: :return:
-
flags
(index)¶ Get the display mode :param index: :return:
-
headerData
(p_int, orientation, role)¶ Get the headers to display :param p_int: :param orientation: :param role: :return:
-
paste_from_clipboard
(row_idx=0, col_idx=0)¶ - Args:
- row_idx: col_idx:
-
redo
()¶ Re-do table changes
-
restore
(data: dict)¶ Set profiles data from undo history :param data: dictionary comming from the history :return:
-
rowCount
(parent=None)¶ Get number of rows :param parent: :return:
-
setData
(index, value, role=PySide2.QtCore.Qt.ItemDataRole.DisplayRole)¶ Set data by simple editor (whatever text) :param index: :param value: :param role: :return:
-
set_delegates
()¶ Set the cell editor types depending on the attribute_types array :return:
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
undo
()¶ Un-do table changes
-
update
()¶
-
-
class
GridCal.Gui.GuiFunctions.
TextDelegate
(parent)¶ Bases:
PySide2.QtWidgets.QItemDelegate
-
commitData
= <PySide2.QtCore.Signal object>¶ A delegate that places a fully functioning QLineEdit in every cell of the column to which it’s applied
-
createEditor
(self, parent:PySide2.QtWidgets.QWidget, option:PySide2.QtWidgets.QStyleOptionViewItem, index:PySide2.QtCore.QModelIndex) → PySide2.QtWidgets.QWidget¶
-
returnPressed
()¶
-
setEditorData
(self, editor:PySide2.QtWidgets.QWidget, index:PySide2.QtCore.QModelIndex)¶
-
setModelData
(self, editor:PySide2.QtWidgets.QWidget, model:PySide2.QtCore.QAbstractItemModel, index:PySide2.QtCore.QModelIndex)¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
class
GridCal.Gui.GuiFunctions.
TreeDelegate
(parent, data={})¶ Bases:
PySide2.QtWidgets.QItemDelegate
-
commitData
= <PySide2.QtCore.Signal object>¶ A delegate that places a fully functioning QComboBox in every cell of the column to which it’s applied
-
createEditor
(self, parent:PySide2.QtWidgets.QWidget, option:PySide2.QtWidgets.QStyleOptionViewItem, index:PySide2.QtCore.QModelIndex) → PySide2.QtWidgets.QWidget¶
-
double_click
()¶
-
setEditorData
(self, editor:PySide2.QtWidgets.QWidget, index:PySide2.QtCore.QModelIndex)¶
-
setModelData
(self, editor:PySide2.QtWidgets.QWidget, model:PySide2.QtCore.QAbstractItemModel, index:PySide2.QtCore.QModelIndex)¶
-
staticMetaObject
= <PySide2.QtCore.QMetaObject object>¶
-
-
GridCal.Gui.GuiFunctions.
get_checked_indices
(mdl: <PySide2.QtGui.QStandardItemModel object at 0x7f11df8b9188>)¶ Get a list of the selected indices in a QStandardItemModel :param mdl: :return:
-
GridCal.Gui.GuiFunctions.
get_list_model
(lst, checks=False)¶ Pass a list to a list model