From 679268e67f922c3189f0e366b5ca5d127cbbf247 Mon Sep 17 00:00:00 2001 From: santi Date: Wed, 3 Apr 2024 11:32:48 +0100 Subject: [PATCH 01/19] Improved 'add_map_diagram' to create the diagram from the circuit --- .idea/workspace.xml | 83 ++++++++----------- .../Gui/Diagrams/MapWidget/grid_map_widget.py | 4 +- .../Gui/Main/SubClasses/Model/diagrams.py | 20 ++++- 3 files changed, 53 insertions(+), 54 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 993dafbed..81bb52ee4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,17 +29,10 @@ - + + - - + + + + + + + + + + + + - - - + + + - - + + @@ -1381,7 +1398,7 @@ - + 1656059954202 @@ -1726,7 +1743,7 @@ - - @@ -1797,7 +1813,8 @@ - @@ -2270,9 +2287,9 @@ @@ -2427,7 +2444,7 @@ - + @@ -2528,7 +2545,7 @@ - + diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py index 06d0c6897..8cc57ccfd 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py @@ -15,20 +15,20 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union import numpy as np from PySide6.QtCore import Qt from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu, QLabel, QDoubleSpinBox, QPushButton, QVBoxLayout, QComboBox, QDialog, QGraphicsScene from GridCal.Gui.GuiFunctions import get_list_model -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.line import SequenceLineType, OverheadLineType, UndergroundLineType from GridCalEngine.Devices.Branches.dc_line import DcLine from GridCalEngine.enumerations import DeviceType from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget class DcLineEditor(QDialog): @@ -230,8 +230,8 @@ def load_template_btn_click(self): class DcLineGraphicItem(LineGraphicTemplateItem): def __init__(self, - from_port: TerminalItem, - to_port: TerminalItem, + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem], editor: BusBranchEditorWidget, width=5, api_object: DcLine = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py index 52bd71492..e62a20945 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py @@ -15,22 +15,22 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.hvdc_line import HvdcLine from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget class HvdcGraphicItem(LineGraphicTemplateItem): def __init__(self, - from_port: TerminalItem, - to_port: TerminalItem, + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem], editor: BusBranchEditorWidget, width=5, api_object: HvdcLine = None): diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py index 5618deeaa..030c734ea 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py @@ -19,7 +19,7 @@ from PySide6.QtCore import Qt, QRectF from PySide6.QtGui import QPen, QIcon, QPixmap, QBrush from PySide6.QtWidgets import QMenu, QGraphicsRectItem, QGraphicsSceneContextMenuEvent -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_editor import LineEditor from GridCal.Gui.messages import yes_no_question, warning_msg from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -27,7 +27,7 @@ from GridCalEngine.enumerations import DeviceType if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget class LineGraphicItem(LineGraphicTemplateItem): @@ -36,8 +36,8 @@ class LineGraphicItem(LineGraphicTemplateItem): """ def __init__(self, - from_port: TerminalItem, - to_port: Union[TerminalItem, None], + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem, None], editor: BusBranchEditorWidget, width=5, api_object: Line = None): diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py index 2586f4830..babbfe808 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py @@ -23,8 +23,10 @@ from PySide6.QtWidgets import (QGraphicsLineItem, QGraphicsRectItem, QGraphicsPolygonItem, QGraphicsEllipseItem, QGraphicsSceneMouseEvent, QGraphicsTextItem) from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, GenericDBWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.cn_graphics import CnGraphicItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.busbar_graphics import BusBarGraphicItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem from GridCal.Gui.messages import yes_no_question @@ -41,8 +43,8 @@ from GridCalEngine.Devices.Fluid.fluid_path import FluidPath if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget - from GridCal.Gui.Diagrams.BusBranchEditorWidget import Transformer3WGraphicItem + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem class ArrowHead(QGraphicsPolygonItem): @@ -216,6 +218,10 @@ def setToolTipText(self, toolTip: str): self.c2.setToolTip(toolTip) def redraw(self): + """ + + :return: + """ h = self.parent.pos2.y() - self.parent.pos1.y() b = self.parent.pos2.x() - self.parent.pos1.x() ang = np.arctan2(h, b) @@ -282,6 +288,10 @@ def setToolTipText(self, toolTip: str): self.setToolTip(toolTip) def redraw(self): + """ + + :return: + """ h = self.parent.pos2.y() - self.parent.pos1.y() b = self.parent.pos2.x() - self.parent.pos1.x() ang = np.arctan2(h, b) @@ -404,8 +414,8 @@ class LineGraphicTemplateItem(GenericDBWidget, QGraphicsLineItem): """ def __init__(self, - from_port: TerminalItem, - to_port: Union[TerminalItem, None], + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem, None], editor: BusBranchEditorWidget, width=5, api_object: Union[Line, Transformer2W, VSC, UPFC, HvdcLine, DcLine, FluidPath, None] = None, @@ -450,8 +460,8 @@ def __init__(self, self.pos1: QPointF = QPointF(0.0, 0.0) self.pos2: QPointF = QPointF(0.0, 0.0) - self._from_port: Union[TerminalItem, None] = None - self._to_port: Union[TerminalItem, None] = None + self._from_port: Union[BarTerminalItem, RoundTerminalItem, None] = None + self._to_port: Union[BarTerminalItem, RoundTerminalItem, None] = None # arrows self.view_arrows = True @@ -471,14 +481,14 @@ def __init__(self, self.set_colour(self.color, self.width, self.style) - def get_terminal_from(self) -> Union[None, TerminalItem]: + def get_terminal_from(self) -> Union[None, BarTerminalItem, RoundTerminalItem]: """ Get the terminal from :return: TerminalItem """ return self._from_port - def get_terminal_to(self) -> Union[None, TerminalItem]: + def get_terminal_to(self) -> Union[None, BarTerminalItem, RoundTerminalItem]: """ Get the terminal to :return: TerminalItem @@ -634,7 +644,7 @@ def plot_profiles(self): i = self.editor.circuit.get_branches().index(self.api_object) self.editor.plot_branch(i, self.api_object) - def set_from_port(self, from_port: TerminalItem): + def set_from_port(self, from_port: BarTerminalItem): """ Set the From terminal in a connection @param from_port: TerminalItem @@ -650,7 +660,7 @@ def set_from_port(self, from_port: TerminalItem): self._from_port.update() self._from_port.get_parent().setZValue(0) - def set_to_port(self, to_port: TerminalItem): + def set_to_port(self, to_port: BarTerminalItem): """ Set the To terminal in a connection @param to_port: TerminalItem @@ -770,11 +780,11 @@ def set_arrows_with_power(self, Sf: complex, St: complex) -> None: Pf = Sf.real Qf = Sf.imag Pt = St.real - Qt = St.imag + Qt_ = St.imag self.arrow_from_1.set_value(Pf, True, Pf < 0, name="Pf", units="MW") self.arrow_from_2.set_value(Qf, True, Qf < 0, name="Qf", units="MVAr") self.arrow_to_1.set_value(Pt, True, Pt > 0, name="Pt", units="MW") - self.arrow_to_2.set_value(Qt, True, Qt > 0, name="Qt", units="MVAr") + self.arrow_to_2.set_value(Qt_, True, Qt_ > 0, name="Qt", units="MVAr") def set_arrows_with_hvdc_power(self, Pf: float, Pt: float) -> None: """ @@ -833,6 +843,46 @@ def is_to_port_a_bus(self) -> bool: else: return False + def is_from_port_a_cn(self) -> bool: + """ + + :return: + """ + if self._from_port: + return isinstance(self.get_terminal_from_parent(), CnGraphicItem) + else: + return False + + def is_to_port_a_cn(self) -> bool: + """ + + :return: + """ + if self._to_port: + return isinstance(self.get_terminal_to_parent(), CnGraphicItem) + else: + return False + + def is_from_port_a_busbar(self) -> bool: + """ + + :return: + """ + if self._from_port: + return isinstance(self.get_terminal_from_parent(), BusBarGraphicItem) + else: + return False + + def is_to_port_a_busbar(self) -> bool: + """ + + :return: + """ + if self._to_port: + return isinstance(self.get_terminal_to_parent(), BusBarGraphicItem) + else: + return False + def is_from_port_a_tr3(self) -> bool: """ @@ -840,7 +890,8 @@ def is_from_port_a_tr3(self) -> bool: """ if self._from_port: if 'Transformer3WGraphicItem' not in sys.modules: - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem + from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import \ + Transformer3WGraphicItem return isinstance(self.get_terminal_from_parent(), Transformer3WGraphicItem) else: return False @@ -852,7 +903,8 @@ def is_to_port_a_tr3(self) -> bool: """ if self._to_port: if 'Transformer3WGraphicItem' not in sys.modules: - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem + from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import \ + Transformer3WGraphicItem return isinstance(self.get_terminal_to_parent(), Transformer3WGraphicItem) else: return False @@ -961,6 +1013,34 @@ def connected_between_bus_and_fluid_node(self): """ return self.is_from_port_a_bus() and self.is_to_port_a_fluid_node() + def connected_between_cn_and_bus(self): + """ + + :return: + """ + return self.is_from_port_a_cn() and self.is_to_port_a_bus() + + def connected_between_bus_and_cn(self): + """ + + :return: + """ + return self.is_from_port_a_bus() and self.is_to_port_a_cn() + + def connected_between_busbar_and_bus(self): + """ + + :return: + """ + return self.is_from_port_a_busbar() and self.is_to_port_a_bus() + + def connected_between_bus_and_busbar(self): + """ + + :return: + """ + return self.is_from_port_a_bus() and self.is_to_port_a_busbar() + def should_be_a_converter(self) -> bool: """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py index bc44d16c2..37d0bc4d3 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py @@ -15,10 +15,10 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.series_reactance import SeriesReactance from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -28,7 +28,9 @@ class SeriesReactanceGraphicItem(LineGraphicTemplateItem): - def __init__(self, from_port: TerminalItem, to_port: TerminalItem, + def __init__(self, + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem], editor: BusBranchEditorWidget, width=5, api_object: SeriesReactance = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py index 1e5efc8b3..164f186b8 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py @@ -17,8 +17,8 @@ from __future__ import annotations from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap -from PySide6.QtWidgets import QMenu, QGraphicsScene -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from PySide6.QtWidgets import QMenu +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.switch import Switch from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -28,8 +28,8 @@ class SwitchGraphicItem(LineGraphicTemplateItem): - def __init__(self, from_port: TerminalItem, - to_port: Union[TerminalItem, None], + def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem, None], editor: BusBranchEditorWidget, width=5, api_object: Switch = None): diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py index bf5752908..6684cad7f 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py @@ -15,11 +15,11 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.messages import yes_no_question from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer_editor import (TransformerEditor, reverse_transformer_short_circuit_study) @@ -35,7 +35,9 @@ class TransformerGraphicItem(LineGraphicTemplateItem): TransformerGraphicItem """ - def __init__(self, from_port: TerminalItem, to_port: TerminalItem, + def __init__(self, + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem], editor: BusBranchEditorWidget, width=5, api_object: Transformer2W = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py index 3cc5f4fa2..e0a27cc42 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py @@ -23,7 +23,7 @@ from GridCalEngine.Devices.Branches.transformer3w import Transformer3W from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import RoundTerminalItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.winding_graphics import WindingGraphicItem from GridCal.Gui.messages import yes_no_question @@ -105,7 +105,7 @@ def __init__(self, editor: BusBranchEditorWidget, yt = diameter * np.sin(angles) + diameter self.winding_circles: List[QGraphicsEllipseItem] = list() - self.terminals: List[TerminalItem] = list() + self.terminals: List[RoundTerminalItem] = list() self.connection_lines: List[WindingGraphicItem | None] = list() pen = QPen(self.color, self.pen_width, self.style) @@ -116,7 +116,7 @@ def __init__(self, editor: BusBranchEditorWidget, winding_circle.setRect(0.0, 0.0, diameter, diameter) winding_circle.setPos(x[i], y[i]) - terminal = TerminalItem("t", parent=self, editor=self.editor) + terminal = RoundTerminalItem("t", parent=self, editor=self.editor) terminal.setPos(xt[i], yt[i]) terminal.setRotation(angles_deg[i]) @@ -280,12 +280,10 @@ def update_conn(self) -> None: # Arrange line positions for terminal in self.terminals: - x = int(2 * terminal.w / 3) - y = int(2 * terminal.h / 3) - m = QPointF(x, y) + m = QPointF(int(terminal.xc), int(terminal.yc)) terminal.process_callbacks(self.pos() + terminal.pos() - m) - def get_connection_winding(self, from_port: TerminalItem, to_port: TerminalItem): + def get_connection_winding(self, from_port: RoundTerminalItem, to_port: RoundTerminalItem): """ Find the winding between the terminals :param from_port: "from" terminal [TerminalItem] diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py index 4b6769d34..401682b3b 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py @@ -18,7 +18,7 @@ from typing import TYPE_CHECKING from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem from GridCalEngine.Devices.Branches.upfc import UPFC from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -28,7 +28,7 @@ class UpfcGraphicItem(LineGraphicTemplateItem): - def __init__(self, from_port: TerminalItem, to_port: TerminalItem, + def __init__(self, from_port: BarTerminalItem, to_port: BarTerminalItem, editor: BusBranchEditorWidget, width=5, api_object: UPFC = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py index 629ce576e..8f49c6116 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py @@ -15,10 +15,10 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. from __future__ import annotations -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.vsc import VSC from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -31,7 +31,9 @@ class VscGraphicItem(LineGraphicTemplateItem): Graphics item for the VSC converter """ - def __init__(self, from_port: TerminalItem, to_port: TerminalItem, + def __init__(self, + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem], editor: BusBranchEditorWidget, width=5, api_object: VSC = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py index 935b8a275..1b67a58b0 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py @@ -20,20 +20,20 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.messages import yes_no_question from GridCalEngine.Devices.Branches.winding import Winding from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget class WindingGraphicItem(LineGraphicTemplateItem): def __init__(self, - from_port: TerminalItem, - to_port: Union[TerminalItem, None], + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem, None], editor: BusBranchEditorWidget, width=5, api_object: Winding = None): diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py index 9b901d214..a755e244b 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py @@ -29,7 +29,7 @@ from GridCalEngine.Devices.types import FLUID_TYPES from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, FONT_SCALE, GenericDBWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem, HandleItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_turbine_graphics import FluidTurbineGraphicItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_pump_graphics import FluidPumpGraphicItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_p2x_graphics import FluidP2xGraphicItem @@ -135,7 +135,7 @@ def __init__(self, editor: BusBranchEditorWidget, fluid_node: FluidNode, self.label.setScale(FONT_SCALE) # connection terminals the block - self._terminal = TerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) + self._terminal = BarTerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) self._terminal.setPen(QPen(Qt.transparent, self.pen_width, self.style, Qt.RoundCap, Qt.RoundJoin)) # Create corner for resize: @@ -386,7 +386,7 @@ def contextMenuEvent(self, event): menu.exec_(event.screenPos()) - def get_terminal(self) -> TerminalItem: + def get_terminal(self) -> BarTerminalItem: """ Get the hosting terminal of this bus object :return: TerminalItem diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py index e611804cc..bcd935654 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py @@ -19,7 +19,7 @@ from PySide6.QtCore import Qt from PySide6.QtGui import QPen, QIcon, QPixmap, QColor from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import GenericDBWidget, ACTIVE from GridCal.Gui.messages import yes_no_question from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem @@ -27,7 +27,7 @@ from GridCalEngine.enumerations import DeviceType if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget class FluidPathGraphicItem(LineGraphicTemplateItem): @@ -36,8 +36,8 @@ class FluidPathGraphicItem(LineGraphicTemplateItem): """ def __init__(self, - from_port: TerminalItem, - to_port: Union[TerminalItem, None], + from_port: Union[BarTerminalItem, RoundTerminalItem], + to_port: Union[BarTerminalItem, RoundTerminalItem, None], editor: BusBranchEditorWidget, width=10, api_object: FluidPath = None, diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py index c56142f5e..16ec5303a 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py @@ -25,7 +25,7 @@ from GridCal.Gui.messages import yes_no_question from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, FONT_SCALE, EMERGENCY) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem, HandleItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.load_graphics import LoadGraphicItem, Load from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, @@ -111,7 +111,7 @@ def __init__(self, self.tile.setOpacity(0.7) # connection terminals the block - self._terminal = TerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) + self._terminal = BarTerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) self._terminal.setPen(QPen(Qt.transparent, self.pen_width, self.style, Qt.RoundCap, Qt.RoundJoin)) # Create corner for resize: @@ -668,7 +668,7 @@ def mouseDoubleClickEvent(self, event: QtWidgets.QGraphicsSceneMouseEvent): self.setToolTip(msg) - def get_terminal(self) -> TerminalItem: + def get_terminal(self) -> BarTerminalItem: """ Get the hosting terminal of this bus object :return: TerminalItem diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py index 5e07fbe71..219336417 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py @@ -25,7 +25,7 @@ from GridCal.Gui.messages import yes_no_question from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, FONT_SCALE, EMERGENCY) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem, HandleItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.load_graphics import LoadGraphicItem, Load from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, @@ -111,7 +111,7 @@ def __init__(self, self.tile.setOpacity(0.7) # connection terminals the block - self._terminal = TerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) + self._terminal = BarTerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) self._terminal.setPen(QPen(Qt.transparent, self.pen_width, self.style, Qt.RoundCap, Qt.RoundJoin)) # Create corner for resize: @@ -668,7 +668,7 @@ def mouseDoubleClickEvent(self, event: QtWidgets.QGraphicsSceneMouseEvent): self.setToolTip(msg) - def get_terminal(self) -> TerminalItem: + def get_terminal(self) -> BarTerminalItem: """ Get the hosting terminal of this bus object :return: TerminalItem diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py index 2ea1c00f5..45022f636 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py @@ -39,7 +39,6 @@ from GridCalEngine.Devices.Substation.bus import Bus from GridCalEngine.Devices.Substation.busbar import BusBar from GridCalEngine.Devices.Substation.connectivity_node import ConnectivityNode -from GridCalEngine.Devices.Parents.editable_device import EditableDevice from GridCalEngine.Devices.Branches.line import Line from GridCalEngine.Devices.Branches.dc_line import DcLine from GridCalEngine.Devices.Branches.transformer import Transformer2W @@ -61,7 +60,7 @@ from GridCalEngine.Devices.types import BRANCH_TYPES from GridCal.Gui.Diagrams.graphics_manager import GraphicsManager -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import TerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.cn_graphics import CnGraphicItem from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.busbar_graphics import BusBarGraphicItem @@ -120,24 +119,30 @@ def __init__(self, parent: "BusBranchEditorWidget" = None) -> None: self.setColumnCount(1) - def add(name: str, icon_name: str): - _icon = QIcon() - _icon.addPixmap(QPixmap(f":/Icons/icons/{icon_name}.svg")) - _item = QStandardItem(_icon, name) - _item.setToolTip("Drag & drop this into the schematic") - self.appendRow(_item) - self.bus_name = "Bus" self.transformer3w_name = "3W-Transformer" self.fluid_node_name = "Fluid-node" self.cn_name = "Connectivity node" self.bb_name = "Bus bar" - add(name=self.bus_name, icon_name="bus_icon") - add(name=self.transformer3w_name, icon_name="transformer3w") - add(name=self.fluid_node_name, icon_name="dam") - add(name=self.cn_name, icon_name="cn_icon") - add(name=self.bb_name, icon_name="bus_bar_icon") + self.add(name=self.bus_name, icon_name="bus_icon") + self.add(name=self.transformer3w_name, icon_name="transformer3w") + self.add(name=self.fluid_node_name, icon_name="dam") + self.add(name=self.cn_name, icon_name="cn_icon") + self.add(name=self.bb_name, icon_name="bus_bar_icon") + + def add(self, name: str, icon_name: str): + """ + Add element to the library + :param name: Name of the element + :param icon_name: Icon name, the path is taken care of + :return: + """ + _icon = QIcon() + _icon.addPixmap(QPixmap(f":/Icons/icons/{icon_name}.svg")) + _item = QStandardItem(_icon, name) + _item.setToolTip(f"Drag & drop {name} into the schematic") + self.appendRow(_item) @staticmethod def to_bytes_array(val: str) -> QByteArray: @@ -1209,7 +1214,7 @@ def get_buses(self) -> List[Tuple[int, Bus, BusGraphicItem]]: return lst - def start_connection(self, port: Union[TerminalItem, RoundTerminalItem]) -> LineGraphicTemplateItem: + def start_connection(self, port: Union[BarTerminalItem, RoundTerminalItem]) -> LineGraphicTemplateItem: """ Start the branch creation @param port: @@ -1254,7 +1259,7 @@ def scene_mouse_press_event(self, event: QGraphicsSceneMouseEvent) -> None: self.displacement = self.newCenterPos - self.startPos self.editor_graphics_view.setDragMode(QGraphicsView.DragMode.NoDrag) - def create_line(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_port: TerminalItem): + def create_line(self, bus_from: Bus, bus_to: Bus, from_port: BarTerminalItem, to_port: BarTerminalItem): """ :param bus_from: @@ -1287,7 +1292,7 @@ def create_line(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_po # set the connection placement graphic_object.setZValue(-1) - def create_dc_line(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_port: TerminalItem): + def create_dc_line(self, bus_from: Bus, bus_to: Bus, from_port: BarTerminalItem, to_port: BarTerminalItem): """ :param bus_from: @@ -1319,7 +1324,7 @@ def create_dc_line(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to # set the connection placement graphic_object.setZValue(-1) - def create_winding(self, from_port: TerminalItem, to_port: TerminalItem, api_object: Winding): + def create_winding(self, from_port: BarTerminalItem, to_port: BarTerminalItem, api_object: Winding): """ :param from_port: @@ -1345,7 +1350,7 @@ def create_winding(self, from_port: TerminalItem, to_port: TerminalItem, api_obj return winding_graphics - def create_transformer(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_port: TerminalItem): + def create_transformer(self, bus_from: Bus, bus_to: Bus, from_port: BarTerminalItem, to_port: BarTerminalItem): """ :param bus_from: @@ -1377,7 +1382,7 @@ def create_transformer(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem # set the connection placement graphic_object.setZValue(-1) - def create_vsc(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_port: TerminalItem): + def create_vsc(self, bus_from: Bus, bus_to: Bus, from_port: BarTerminalItem, to_port: BarTerminalItem): """ :param bus_from: @@ -1409,7 +1414,7 @@ def create_vsc(self, bus_from: Bus, bus_to: Bus, from_port: TerminalItem, to_por # set the connection placement graphic_object.setZValue(-1) - def create_fluid_path(self, source: FluidNode, target: FluidNode, from_port: TerminalItem, to_port: TerminalItem): + def create_fluid_path(self, source: FluidNode, target: FluidNode, from_port: BarTerminalItem, to_port: BarTerminalItem): """ :param source: @@ -1450,14 +1455,14 @@ def create_branch_on_mouse_release_event(self, event: QGraphicsSceneMouseEvent) # Clear or finnish the started connection: if self.started_branch is not None: - items = self.diagram_scene.items(event.scenePos()) # get the item (the terminal) at the mouse position + items = self.diagram_scene.items(event.scenePos()) # get the widgets at the mouse position + + for arriving_widget in items: + if isinstance(arriving_widget, Union[BarTerminalItem, RoundTerminalItem]): # arrivinf to a bus or bus-bar - for item in items: - if isinstance(item, TerminalItem): # connect only to terminals - if item.get_parent() is not self.started_branch.get_terminal_from_parent(): # forbid connecting to itself + if arriving_widget.get_parent() is not self.started_branch.get_terminal_from_parent(): # forbid connecting to itself - self.started_branch.set_to_port(item) - # self.started_branch.bus_to = item.parent + self.started_branch.set_to_port(arriving_widget) if self.started_branch.connected_between_buses(): # electrical branch between electrical buses @@ -2207,13 +2212,11 @@ def add_api_transformer_3w(self, elm: Transformer3W): return tr3_graphic_object def add_api_fluid_node(self, node: FluidNode, - injections_by_tpe: Dict[DeviceType, List[EditableDevice]], - explode_factor: float = 1.0): + injections_by_tpe: Dict[DeviceType, List[ALL_DEV_TYPES]]): """ Add API bus to the diagram :param node: FluidNode instance :param injections_by_tpe - :param explode_factor: explode factor """ x = 0 y = 0 @@ -2454,8 +2457,7 @@ def add_object_to_the_schematic( injections_by_fluid_node = self.circuit.get_injection_devices_grouped_by_fluid_node() graphic_obj = self.add_api_fluid_node(node=elm, - injections_by_tpe=injections_by_fluid_node.get(elm, dict()), - explode_factor=1.0) + injections_by_tpe=injections_by_fluid_node.get(elm, dict())) elif isinstance(elm, Line): graphic_obj = self.add_api_line(elm) @@ -2552,8 +2554,7 @@ def add_elements_to_schematic(self, prog_func((i + 1) / nn * 100.0) self.add_api_fluid_node(node=elm, - injections_by_tpe=injections_by_fluid_node.get(elm, dict()), - explode_factor=1.0) + injections_by_tpe=injections_by_fluid_node.get(elm, dict())) # -------------------------------------------------------------------------------------------------------------- if text_func is not None: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py index 66c6456af..a06afc681 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py @@ -30,7 +30,7 @@ from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem -class TerminalItem(QGraphicsRectItem): +class BarTerminalItem(QGraphicsRectItem): """ Represents a connection point to a subsystem """ @@ -175,7 +175,7 @@ def itemChange(self, change: QGraphicsItem.GraphicsItemChange, value: Any) -> An self.process_callbacks(value) return value else: - return super(TerminalItem, self).itemChange(change, value) + return super(BarTerminalItem, self).itemChange(change, value) def mousePressEvent(self, event: QGraphicsSceneMouseEvent) -> None: """ @@ -209,17 +209,14 @@ class HandleItem(QGraphicsEllipseItem): A handle that can be moved by the mouse: Element to resize the boxes """ - def __init__(self, parent: TerminalItem = None, callback: Callable = None) -> None: + def __init__(self, parent: BarTerminalItem = None, callback: Callable = None) -> None: """ @param parent: """ QGraphicsEllipseItem.__init__(self, QRectF(-4, -4, 8, 8), parent) - self.callbacks_list = list() - - if callback is not None: - self.callbacks_list.append(callback) + self.callback = callback self.setBrush(Qt.red) self.setFlag(self.GraphicsItemFlag.ItemIsMovable, True) @@ -237,8 +234,8 @@ def itemChange(self, change: QGraphicsItem.GraphicsItemChange, value: Any): x, y = value.x(), value.y() # This cannot be a signal because this is not a QObject - for cb in self.callbacks_list: - res = cb(x, y) + if self.callback is not None: + res = self.callback(x, y) if res: x, y = res value = QPointF(x, y) diff --git a/src/GridCal/Gui/Main/MainWindow.py b/src/GridCal/Gui/Main/MainWindow.py index e5ad2cb32..0727eac3c 100644 --- a/src/GridCal/Gui/Main/MainWindow.py +++ b/src/GridCal/Gui/Main/MainWindow.py @@ -947,7 +947,7 @@ def setupUi(self, mainWindow): self.horizontalLayout_7.addWidget(self.simulationDataSplitter) icon83 = QIcon() - icon83.addFile(u":/Icons/icons/squares.svg", QSize(), QIcon.Normal, QIcon.Off) + icon83.addFile(u":/Icons/icons/spmat.svg", QSize(), QIcon.Normal, QIcon.Off) self.tabWidget_3.addTab(self.compiledArraysTab, icon83, "") self.commentsTab = QWidget() self.commentsTab.setObjectName(u"commentsTab") diff --git a/src/GridCal/Gui/Main/MainWindow.ui b/src/GridCal/Gui/Main/MainWindow.ui index 9d64a88ff..f041935d5 100644 --- a/src/GridCal/Gui/Main/MainWindow.ui +++ b/src/GridCal/Gui/Main/MainWindow.ui @@ -966,7 +966,7 @@ - :/Icons/icons/squares.svg:/Icons/icons/squares.svg + :/Icons/icons/spmat.svg:/Icons/icons/spmat.svg Compiled arrays diff --git a/src/GridCal/Gui/Main/icons.qrc b/src/GridCal/Gui/Main/icons.qrc index 878bbd2ab..06042bc73 100644 --- a/src/GridCal/Gui/Main/icons.qrc +++ b/src/GridCal/Gui/Main/icons.qrc @@ -1,5 +1,6 @@ + icons/spmat.svg icons/bus_bar_icon.svg icons/cn_icon.svg icons/to_series_reactance.svg diff --git a/src/GridCal/Gui/Main/icons/dcopf.svg b/src/GridCal/Gui/Main/icons/dcopf.svg index 5eefd2e9f..c6b7c2b1b 100644 --- a/src/GridCal/Gui/Main/icons/dcopf.svg +++ b/src/GridCal/Gui/Main/icons/dcopf.svg @@ -1,19 +1,19 @@ + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + sodipodi:docname="dcopf.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -22,7 +22,6 @@ image/svg+xml - @@ -52,17 +51,18 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1853" - inkscape:window-height="1025" + inkscape:window-width="2505" + inkscape:window-height="1016" id="namedview8" showgrid="false" - inkscape:zoom="13.520834" - inkscape:cx="-2.1136703" - inkscape:cy="21.771562" - inkscape:window-x="67" + inkscape:zoom="12.094472" + inkscape:cx="19.347682" + inkscape:cy="21.786813" + inkscape:window-x="55" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="g901" /> + inkscape:current-layer="g901" + inkscape:pagecheckerboard="0" /> + d="m -53.708468,8.4317961 10.730707,-8.43821959" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2c5aa0;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m -54.244566,-11.248855 9.358109,9.3580978" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2c5aa0;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="M -42.782634,0.31783021 -30.029458,11.05073" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2c5aa0;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#5555ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.78192;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#5f8dd3;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.31891;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#5599ff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.89096;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#37abc8;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.48947;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#2a7fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.31399;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + sodipodi:docname="pf.svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> @@ -22,7 +22,6 @@ image/svg+xml - @@ -52,17 +51,18 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1853" - inkscape:window-height="1025" + inkscape:window-width="2505" + inkscape:window-height="1016" id="namedview8" showgrid="false" inkscape:zoom="13.520833" - inkscape:cx="0.87612862" - inkscape:cy="20.11427" - inkscape:window-x="67" + inkscape:cx="0.88751928" + inkscape:cy="20.080124" + inkscape:window-x="55" inkscape:window-y="27" inkscape:window-maximized="1" - inkscape:current-layer="g901" /> + inkscape:current-layer="g901" + inkscape:pagecheckerboard="0" /> + d="M -53.708468,10.294116 -42.977761,1.8558963" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2ca05a;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m -54.244566,-9.3865352 9.358109,9.35809781" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2ca05a;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + d="m -42.782634,2.18015 12.753176,10.7329" + style="fill:#e6e6e6;fill-rule:evenodd;stroke:#2ca05a;stroke-width:2.79348;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#37c871;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.78192;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#00aa44;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.31891;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#00d4aa;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.89096;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#00aa88;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.48947;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + style="opacity:1;fill:#37c871;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:3.31399;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/GridCal/Gui/Main/icons_rc.py b/src/GridCal/Gui/Main/icons_rc.py index ac7ed6030..7636ef400 100644 --- a/src/GridCal/Gui/Main/icons_rc.py +++ b/src/GridCal/Gui/Main/icons_rc.py @@ -5185,104 +5185,103 @@ stroke-opacity:1\ \x22 />\x0a \x0a\x0a\ -\x00\x00\x05\xf8\ +\x00\x00\x05\xf0\ \x00\ -\x00\x15Cx\xda\xedX\xdbn\xe36\x10}\xdf\xaf\x10\ -\x94\x97\x0djQ\xbcJ\xa4\xd6N\xd1bQl\x81\xed\ -K\xef\xed\x9b\x22\xd1\x8e\x1aY4(9N\xf6\xeb;\ -\x94\xad\x8bmy\x9bE\xb6X\xa0\xa8\x82\x04\xe2\xcc\x90\ -\x9c9sfHe\xfe\xf5\xe3\xba\xf4\x1e\xb4\xad\x0bS\ --|\x82\xb0\xef\xe9*3yQ\xad\x16\xfe/?\x7f\ -\x17H\xdf\xab\x9b\xb4\xca\xd3\xd2Tz\xe1W\xc6\xff\xfa\ -\xe6\xd5\xbc~X\xbd\xf2<\x0f&Wu\x92g\x0b\xff\ -\xaei6I\x18n\xb6\xb6D\xc6\xae\xc2<\x0bu\xa9\ -\xd7\xbaj\xea\x90 \x12\xfa\x83y6\x98gV\xa7M\ -\xf1\xa03\xb3^\x9b\xaangV\xf5\xd5\xc8\xd8\xe6\xcb\ -\xdez\xb7\xdb\xa1\x1dk\x8d\x88R*\xc44\xa44\x00\ -\x8b\xa0~\xaa\x9a\xf418\x9e\x0a>NM\xa5\x18\xe3\ -\x10t\x83\xe5\xf3\xac\x92\x1aP\xd9\xc0oo\xde\x09P\ -m\xb66\xd3K\x98\xa7Q\xa5\x9b\xf0\xed\xcfo{e\ -\x80Q\xde\xe4\xa3e\x8a\xea\xbe\xce\xd2\x8d>\xda\xb5\x13\ -\xee\x11H\xd7\xba\xde\xa4\x99\xae\xc3N\xde\xce\xdf\x15y\ -s\xb7\xf0\xb9lGw\xbaX\xdd5\xfd\xf0\xa1\xd0\xbb\ -o\xcd\xe3\xc2\xc7\x1e\xf6\xb8\xf4\x0e\xe2\x22_\xf8\x10\x06\ -\xdd\xdb\x0cy&{\xeda\xf9\xa4\xd7`\xa4(b\xde\ -k\xca\xb1\x10<\x9ay\x14\x13\x19`\x16\x10r\xddN\ -\xe9\xe2Jr\x939G\x17~\x9e\x99\xcd\x129\xacn\ -\xc0`\xbe\xd6M\x9a\xa7M\xea\x8c\xf7\xfbw\x12B[\ -\x0b\xb0\x81\x9c%?\xbe\xfdn?\x82q\x96%\xbf\x19\ -{\x7f\x18\xc2\xe3\x0c\xd2[\xb3\x85\xf8\xfc\x9b^<\xcf\ -\xb3\x04P^\xa7\xcdM\xb1NW\xda%\xe8+@u\ -\x1e\x0e\x8a#\xe3\xe6i\xa3\x87E\xf7\xcbZ\xbdO\xd7\ -$g\xf3l]\xb8I\xe1OMQ\x96\xdf\xbbM|\ -/G\ -*\x03\xf5\x0fL\x84R=\x88\xcd\xed_:k\x1aS\ -jp\xce\xb1\x97t\xd9\x5cY\x08mJ\xbe-r=\ -\xa5\xe8s\xe8\xdc\xeb7\x9a\xd4\xd6winv\x0b\x9f\ -\x9e*wE\x05\x8a\xe0\xd0\x92\x88\x14\xec\x82E\xd7\xa6\ -\x08\xa6\xc2\x1f\xc8\xdf\x03\xd5\xf1\xa2\xbe3;\x17\x09d\ -4-k}\xba\xda\x07c G\x84!A\xb1d\xfc\ -T\x9dA\xe3\x0b(\x22\x84E1>s%\x83\xf0(\ -AqLDt)\x12X \x8a/\xe8\xdc\xf4K\xba\ -u\xfaX\xac\x8b\x0f:\x1fR5\xec\xbb\xb5\x16\xea3\ -(\xd3'\x0dy^)L\x0eL\x9a\xaf\x06(V\x9c\ -\x88\xbe\x0d\xac\xc6\x15\xba\xe2\x82\xf3\x7f\xae-\x86\xcfj\ -k\x86\xbdw\xee\x14\xf8\xd5\xfdy\x07'\xc2\x9f#\x93\ -\xc1?SU@*c\x03\xf0\xf4!m\xb6V\x0f<\ -8\xa9\xb1\xa4\x82\xf3\x7f\xd4\x0b\x07O\x0f\xbe\xba\xe0&\ -\x0b\x0b\xba\xb2-\x1e_C\xe9\xc5LQ\xc5g\xe0\xdd\ -l\x18\xc5Pr\x0a\x02%3\x86Q\xcc\xa8\xc2\xecz\ -\xdc\xf3\x8f\xa3\xfe\x14\xefG\x18\x91\x98\x1c)\xdc\xa9\xe4\ -\x05\x82\xa1\x18K\x1e\xc9\x19\x87\x17\xc7\x0e\xe1\x11\xe7\x04\ -\x86\xd1,\x90\x883I\x89\x8a\x8e\xa6\x8e1\xb9\xd2\x91\ -\xfbys\xb9\x09\xd1L\xa4\xe9I\x13\xa2(V\x8c\xc7\ -*\xa6\x9d\xbc, \x92t\x93\xdcn\x9bf,\xfb\xcb\ -\x14U\x02'\x92\xb6\x9d\xf4P\xae\x09\xe9\x04\xad\xb6\x04\ -\x0a6\x09\xefdy\x0aukm\xfat\x9a\xb4\xcf\x07\ -'\x9b\x82\x93#\xca\xb9\x88\xa2Y@8R1\xe3J\ -x\x0a1!\x09V\xb3\xf6\x05+I\xffG\xf3\x0cM\ -1\x81&#H\xc6\x98F@D\x12C\xdb\xe3\x14\xc7\ -^\xa0\x90\xc4\x9cH9#\x04q.\xe9I\x22>\x1f\ -\x9c\x91\xfct8\xff\x19\xbd3\xe0\x8f\xbd\xef\x8fQ\x03\ -'\x17\x5c\xc3\xe0j\x9ee\x1fG\xfc\xc2\x9c\xcf\x90\x94\ -x\x22)\x1c\xe0\x914b|\x160\xc4q\x04\x84\xe6\ -\x1e\x5c\x12b\xc1H\x1c\xcd\xc8\xbe\x83\xfd\x97\x18\xae\xcb\ -\xb2\xd8\xd4\xc7\xb7h8\x0f\x19\xc2\x02\x1c\x8a\x8eA\xb2\ -\x8fNC\x04\x931=\xe6\xb4;\x82#D\x09\xe8\xe8\ -q\xd2\xdb\xa3[\x08\xc4(\xc5,\xbe\x90\x0c\x16\x05Q\ -0I\xf5!\xc0=\xc2\x02\x9e\xe5r\x8f\xf0\xb1n\x12\ -\xf01){\xb4%Q\x94\x09v\x86\xac5\xdb*\x7f\ -\x09\xd9\x9f\x83,\x85\xce\xc9%aS\xc8\xe2\x08\xa8\x17\ -Eg\xc8\xc6\x88+\x16Q\x11\x9d#K\xa1c\x00|\ -\x8c\x5cF\x96<\x0b\xd7\xa5\xccs\xf6\x02\x5c\x19bD\ -*Bi\xfcep\x85\xc3)V\x82\xf4w\xc7\x01W\ -\x8e8!D\x91s\xc6\xba\xceK#A\x858\x07\x96\ -Q\x14\xf1H\xc4\xf4#\x94}\x1ea\x95z\x11a\x19\ -\xdc\x9f\xb0\x8a\x00\xdc/\x03,4B\x09wr\xca&\ -\x08+$\xb4\xae)\x5c\xdb\xfb\x81R\x13\x84u\x97\xb2\ -\x88E\xe42a\x9f\x83*\x8b\xd3\xdbL\xbe\x08U\x0e\ -\xd7R\xf8,\x8b\xbf\x14\xaa\x12\x03vLN\xa0\xaa\xa8\ - \x98\x9c\xa3\x0as\xa4\x10r\x0aU\x0e\xf1\x08,\xf8\ -G\xd8\x8a\x9f\x83+M\xe3\xe5\x0b\xd9\xca\x08SR*\ -\xfao\xe2:\x0fW\xdd\x07\xfb\xea\xf4\xcbj\xf4i2\ -\xfa\xd0G\x18G1\x95l\x16P\x010\xc6T\xa9k\ -\xff\xf8c\x8c\xc0\xc7\xd8\xe1\xf3\xcd\xad:w\xff~\xba\ -y\xf57\xf92\x0a\xdb\ +\x00\x15L';\x9b\xc3\xce\ +x\xa7-\xef\xaaT\xad\xf5\xb4\xaf\x09\x89w\x89\x14B\ +\xe9\x82S*'\x1eA\x84\x04\x08~\xd9U3\xa9\x02\ +\x7f\xd7\xf0\x99f&-\xd5\x0a\xdc\xccR\xb3^\x84\xb0\ +M\xa3\x87\x18\xcbj\xda.=\xf7o\xebz=\x8d\xa2\ +\xedv\x1b\xb6\xc2\xd0\xd8e\xe4\xe6Vk\x95\xea*j\ +\xe5\xbd\xf9\xed.\xdd\xfcV\x10VfcS\xbd\x80%\ +tX\xea:z\xfd\xe1u\xa7\x0cP\x98\xd5\xd9a\x99\ +\xc1\xee[\xda\xecK\x10B\xd1\xd0Y\x18=\xd1\xd2f\ +\x8b1K,\xa5\x8c\x10\x89\x00)\xb0\x08\xaa\xc7\xb2V\ +\x0fAY]\xf4\xa6\xa6i73\xb5Z\xd5\xf9\xbdN\ +\xcdje\xcaj\x07\xc7\xc08;\x18\xaf7\xb6h,\ +\xb24\xd2\x85^\xe9\xb2\xae\x22\xc8S\xe4_\x83\xfdl\ +\xa5k\x95\xa9Z\xb9\xb9\xbb|\xb7\x12L\x1a\x0b\xb0\x01\ +\x9f\xa6\xbf\xbc~\xb3\x1b\xc18M\xa7\x7f\x18{\xb7\x1f\ +\xc2\xe3\x0c\xd4\x8d\xd9\x00\x9f\xfc\xebN<\xcb\xd2)\xe0\ +\xbcR\xf5u\xbeRK\xed\xb0\xf8\x01\xfc\x9bE\x07\xc5\ +\xc0\xb8~\x5c\xeb\xc3\xa2\xbbe\xad\xde%l4\x9e,\ +]\xe5nR\xf4k\x9d\x17\xc5\xcfn\x13\xdf\x8b:?\ +\xa3\xbd\xa3\xfb0\xa2^\x1c\xb3\xa8\x0d\xb3\x19ezQ\ +\x1d\x10p#\x8c\xda\xe8W\xca\xdei\xdb\xfa\xd5q\xbe\ +\xaaMz\xe7\xac\x7f\xb4\xd6l\xf1;(<[\xfb\xad\ +\x99\xb19\x00=\xf7\xd5\xa66\x9d\xd0\xea\xc5_Pa\ +P\xb7=\xc9\x9fC\xc9\xd9\x15\xab\xfa\xb1\x00\x14\x0c\xd4\ +\xda\xa20\xdb\xe9}^\xe57\x85\xf6O\x1c\xcb\xab\xc6\ +\xb5\xb9_\xdb\x8d\xee\xd21[\xab\xfa\xf6\x00\xae\xdb\xc6\ +I\x18\x97\xc2?\x88A\xfa\xde\x03w&\xf0\xf1\xdey\ +\x1c\xbe\x05\xbc\xf9\x1a`\x12\xf2\x9ex'mM?y\ +\xbdE\xf6\x9e. %\x81\xdd\x14z\xaa\xefui\xb2\ +\xeceU[s\xa7\xa7\x17\xa8y\xf6\xc3\xa0\xe9KS\ +\xe8f\xeb\xba\xb7HmUY9\x92@\x03JU\xa1\ +/Q(\xaev\xd2B\xd5\xfar\xe7\xceU\x97nH\ +h\x93\xa7]r]\x06\x9bo]\xb7q\xed\x22s]\ +n\xb7\xc5\x1a\xa8\x92\x9a\xc2\xd8\xb9\x7f\xb1h\x9e\xfd\xde\ +7\xc6f\xda\xb6\xaa\xb8y\x06*\x03=\x07H\x07\xbd\ +n/67\x1fuZ\xd7\xa6\xd0\xe0\x9c#*n\xb3\ +\xb9\xb4\x10\xda\x98|\x93gzL\xd1\xe5\xd0\xb9\xd7m\ +4\xaa\xadnUf\xb6s\x9f\x1c+\xb7y\x09\x8a`\ +\xdf\xed\x09G\xfc\x8cE{\x02`\x84\xdb\x08\x1d+:\ +\xa0Z^T\xb7f\xeb\x22\x81\x8c\xaa\xa2\xd2\xc7\xab}\ +2\x06r\x04\xe9@\x92\xb1\xe4\xc4\x9d\x14\xce\x14,C\ +\xca\x92X\x9c*!:\x82\xc3D\xc4\x02\xd33n\xc2\ +|~.\x047=9\xa3[\xa9\x87|\x95\x7f\xd2\xd9\ +!S\x87}7\xd6By\x06\x85z\xd4\x90\xe6\xa5D\ +x\x0c\xe3\xf4V\xa7@\xa9\x1b\xa3l\xe6\xd2\xb0\xe3\xda\ +ly\x00k\xc90\xef\x1a\xc5\xb2_\xc3K\xc6\x19\xfb\ +\xf7\xea\xa3\xe8\xa4\xfa&\xc8{\xeb\x8e\xe0\xdf\xdd\x9f\xb7\ +p\x1c\xff\xdd39\x84`\xca\x12hgl\x00\xc1\xdc\ +\xabzc\xf5\x81)GU8-\xe1:\xd0o\x8c\xcb\ +\xa1+\xbd\xf8\x8fJ\x0fZ\xb4\xcd\x1f.\xa18\x13*\ +\x89d\x13\xf0nr\x18%P\x94\x12\x02\xc5\x13\x8a\xc2\ +\x84\x12\x89\xe8U\xff\x00\x18F\xfd_\xbc\xefa\x84\x13\ +(\x17:v?/\xcf\xf7)\x92r\xa5\x8e\ +\xfa\x14\x09\x13I\x99h\x85E\x0eq\xa8\xf5\xf4fS\ +\xd7}\xd9G\x93\x97S8\x9c\xb4m\xa5\xcd\xa0\x00J\ +\xd6S\xd6\xca2\x05el\xadzl2\xd4J\xf7\x85\ +?\xc5\xbd\x94}90\xe9\x18\x98,$\x8c\xf18\x9e\ +\x04\x18.pL\x08\xce=(Z.0\x92\x93\xe6\x0b\ +\x92\x89\xf8\x1f\xca!\x94|\x04J\x8aC\x91 \x12\x03\ +\x071PTJ\x1e'^ C\x81\x18\x16b\x02\xf0\ +2&HB\xe2\xef\x19\xcc\x81\xeb\xdd\x09k\xe0P\x83\ +\xcb\x18\xdc\x9a\xd3\xf4\xf3x\x9f\x99\xf3\x05R\x92\x1c\xa7\ +\xe4\xbd\x170\xc0F\x90\x98B\xf7\x0a\xa1S\x08\x8a\x08\ +\x86D\xc1\xbd\x05z\x18or\x828:*\x8c\xef\x99\ +\xde\xba(\xf2u5\xbcJ\xc3QI!L\x09\xcc\x1b\ +bd\x1f\x9c\x06s*\x122$\xb4;\x9de(i\ +\x0c\x1d\xf8H\x03s\x02\xceCJ\x08\xa2\xc9\x99\x5c\xd0\ +8\x88\x83QP;\xb7_\xee\xe0\xe5\xf0,\x16;x\ +\x87\xbaQ\xb4\xfb\x08tP\x0b,\xc9\x09\xac\xd6l\xca\ +\xeck\xc3JB\x990\xb8\xbf\x8c\xc1\x8ab\xa0]\x1c\ +\x9f\xc0\xea\xba,\x06N\xc6\xa7\xb0\x12\xe8\x15\x80\x1d\xc5\ +\xe7a\xc5O\x02u!\xb2\x8c>\x03T\x0a\xc5\x22$\ +\xfe6\xa0\xc2\x81\x94H\x8e);\x01\x95\x85\x0cc,\ +\xf1)W]\xc3\xe5\x0c\xc5cd\xa5$\x8cY\xcc\xbb\ +\xfb\xe9\x18Y\x9fFU)\x9fEU\x0a7&$\xe3\ +o\x83*\x0d\x99@\x82\x12:BU.\xa0]\x8d\x81\ +\xea.\x04\xa0\x19\xa1\xaa\xbb\x83\xc5\xd0\x1e\xceS\xf5)\ +\x90\xd2D\xdd\xa4\xe2Y\x902\xb8\x85&\xdf\x0aR\x81\ +\x008*F \x95\x84c\x84O!E!\x8e\x91\xe4\ +\x08\x89SL\x19D\x03\xefl\xec3DEOA\x95\ +\xa8d\xf1L\xa2RL\xa5\xfc\x9a\xa8\xce\xa2e\xfb\xf2\ +\xbe<~\x87\xea\xbd\x84\xf4^\xfaC\x84\xe2\x84\x08:\ +\x09\x08\x0f\x05\x9cXR^\xf9\xc3\xd7.\x0c\xaf]\xfb\ +\x175\xb7\xea\xcc\xfd\xd7\xe9\xfa\xc5?\xedQ\x0d\x1e\ \x00\x00\x0e_\ <\ ?xml version=\x221.\ @@ -5723,105 +5722,104 @@ \x13\xcb\x88<\x06n\x08\x1f<\xaao\x81\x1b\xf8$N\ \xe5\xe00\xe3\xdb\xce\x01\x5c\xb9\xa3\xb4\xdf\xbf\xfa\x1fY\ H\x8e\x0f\ -\x00\x00\x06\x06\ +\x00\x00\x05\xf9\ \x00\ -\x00\x15\x85x\xda\xedX\xdbn\xe36\x10}\xdf\xaf\x10\ -\xb4/\xbb\xa8E\xf1.R\xb5S\xb4X\x14-\xd0\xbe\ -\xf4\xde\xbe1\x12\xe3\xa8\x91EC\x92\xe3d\xbf\xbeC\ -\xd9\xba8\x96w\xb3\xd8\xb6\x0b\x14u\xe0@\x9c\x19\x92\ -3g\xce\x0cE/\xbfx\xd8\x94\xc1\xbd\xad\x9b\xc2U\ -\xab\x90 \x1c\x06\xb6\xca\x5c^T\xebU\xf8\xf3O_\ -G*\x0c\x9a\xd6T\xb9)]eWa\xe5\xc2/\xae\ -^,\x9b\xfb\xf5\x8b \x08`r\xd5\xa4y\xb6\x0ao\ -\xdbv\x9b\xc6\xf1vW\x97\xc8\xd5\xeb8\xcfb[\xda\ -\x8d\xad\xda&&\x88\xc4\xe1h\x9e\x8d\xe6YmM[\ -\xdc\xdb\xccm6\xaej\xba\x99U\xf3rb\x5c\xe77\ -\x83\xf5~\xbfG{\xd6\x19\x11\xadu\x8ciLi\x04\ -\x16Q\xf3X\xb5\xe6!:\x9d\x0a>\xceM\xa5\x18\xe3\ -\x18t\xa3\xe5\xf3\xac\xd2\x06P\xd9\xc2w0\xef\x05\xa8\ -q\xbb:\xb370\xcf\xa2\xca\xb6\xf1\x9b\x9f\xde\x0c\xca\ -\x08\xa3\xbc\xcd'\xcb\x14\xd5]\x93\x99\xad=\xd9\xb5\x17\ -\x1e\x100\x1b\xdblMf\x9b\xb8\x97w\xf3\xf7E\xde\ -\xde\xaeB\xae\xba\xd1\xad-\xd6\xb7\xed0\xbc/\xec\xfe\ -+\xf7\xb0\x0aq\x80\x03\xae\x82\xa3\xb8\xc8W!\x84A\ -\x0f6c\x9e\xc9A{\x5c>\x1d4\x18i\x8aX\xf0\ -\x8ar,\x04\x97\x8b\x80b\xa2\x22\xcc\x22B^wS\ -\xfa\xb8\xd2\xdce\xde\xd1U\xb8\xbdA\x1e\xa8+\xd0.\ -7\xb65\xb9i\x8d\xb7\xde\xc0\x5c\xbb\x1d\x04\x17^\x0d\xe2e\x9e\xa5\x00\ -\xf1\xc6\xb4W\xc5\xc6\xac\xad\xcf\xceg\x00\xe92\x1e\x15\ -'\xc6\xed\xe3\xd6\x8e\x8b\x1e\x96\xad\xed!W\xb3\x84\xcd\ -\xb3M\xe1'\xc5?\xb6EY~\xeb7\x09\x83\xf8\xc9\ -\xa2E[\xdaQ\xb8\x8c\x8f\xde\x1fc\x8b'\xc1-\xe3\ ->\xf6n\x94\xdb\x9bf\x84\xc5\x8f\x08\xee!\xd9\x98\xfa\ -\xce\xd6\xfdFCV\x9a\xd6ew\xde\xfa\xcb\xbav{\ -\xf2\x1d\x14b\xdd\x86\xbd\x99\xab\x0b(\xafUhv\xad\ -\x1b\x84\xb5\xbd\xf9\xddg\x11O%\xbf\x9dJ.\xae\xd8\ -\xb4\x8f%@\xe3\x80\x0d7\xa5\xdb\xa7\xf7ES\x5c\x97\ -6'\ -*\x07\xc5\x0fL\x84:=\x8a\xdd\xf5\x9f6k[W\ -Zp\xce\xb3\x97\xf4\xd9\x5c\xd7\x10\xda\x9c|W\xe4v\ -N1\xe4\xd0\xbb7l4\xabmnM\xee\xf6\xab\x90\ ->U\xee\x8b\x0a\x14\xd1\xb1\x1f\x11%\xd8\x05\x8b\xbeG\ -\x11LE8\x92\x7f\x00\xaa\xe7Es\xeb\xf6>\x12\xc8\ -\xa8)\x1b\xfbt\xb5\xb7\xceA\x8e\x08C\x82b\xc5\xce\ -6\xcb|\xd7C*\x91\x84*y\xe6l\x06\xe1Q\x8c\ -\x08\xe14\xb9\xe0&\xcc\x97\x97t~\xf6%\xdd\xc6<\ -\x14\x9b\xe2\xad\xcd\xc7L\x8d\xdb\xee\xea\x1a\xca3*\xcd\ -\xa3\x854\xaf5&G\x22-\xd7#\x12kN\xc4\xd0\ -\x05\xd6\xd3\x02]s\xc1\xf9\xfbK\x8b\xe1\xb3\xd2Z\xe0\ -\xe0\x1b\x7f\x02\xfc\xe2\xff}\x03\xa7\xc1\x1f\x13\x93\xd1?\ -WU\xc0)WG\xe0\xe9\xbdiw\xb5\x1di\xf0\xa4\ -\xc4\xd2\x0a\xce\xfeI+\x1c==\xfa\xea\x83\x9b\xad+\ -h\xcau\xf1\xf0\x0a*/a\x9aj\xbe\x00\xef\x16\xe3\ -Hj\x04\x07\xb9 bA\x13D\x14\xd5\x0cN\x99I\ -\xc3=\x8d\xfaC\xbc\x9f`D\x12r\xa2\xf0\x87R\x10\ -\x09\x86\x12\xac\xb8T\x0b\x0e\x0f\x09\x11R\x04\x04\xa3\x84\ -a\x18-\x22\x858S\x94hy2u\x8a\xc9K+\ -\xfd\xdf\xe7\x97{\x10\xcd\x0c\x16\xe6\xb4\x07Q\x94h\xc6\ -\x13\x9d\xd0^^\x16\x10\x89\xd9\xa6\xd7\xbb\xb6\x9d\xca\xfe\ -tE\x95\xc2\x81d\xeb^z\xac\xd6\x94\xf4\x82N[\ -\x02\x05\xdb\x94\xf7\xb2\xdc@\xd9\xd6\xb5y|\x9a\xb4\xbf\ -\x0fN6\x07'G\x94s!\xe5\x22\x22\x1c\xe9\x84q\ --\x02\x8d\x98P\x04\xebE\xf7\x80\xb5\xa2\xff\xa3y\x86\ -\xa6x\x8a\xe6\xf7A\xc4\x08\xb43L%\x10\x91$\xd0\ -\xf58\xc5I\x10q\x8a0t9\x8f\xb1@\x92*\xaa\ -\x94\xf8\x87\x00\x95\xea\xc3\x01}?~g\xd0\x9fz?\ -\x9c\xa3\x0e\x8e.x\x0f\x83\x17\xf3,{7\xe6\x17\xe6\ -\xfc\x0diIfH\x0e\x09H\x14\x95\x8c/\x22\x868\ -\x96@i\x1e\xc0[B\x22\x18I\xe4\xa2k\x1fT\xff\ -\x978n\xcb\xb2\xd86\xa7\xaf\xd1p\x222\x84\x058\ -$OA\xaa\x1f\xbc\x86\x08\xa6\x12zJL\x7f\x06K\ -D\x09\xe8\xe8i\xd2\xfd\xd9\x1d\x09\x81\x18\xa5\x98%\x17\ -\x92\xc1d$#6\x87\xeb\x18\xe0\x01a\x96d*9\ -\x0c\xa2S\xdd,\xe0SR\x0eh+\xa2)\x13\xec\x0c\ -\xd9\xda\xed\xaa\xfcc\xc8\xfe\x1cd)\xf4N\xae\x08\x9b\ -C\x16K\xa0\x9e\x94g\xc8&\x88k&\xa9\x90\xe7\xc8\ -R\x8d`1\xc9\xc8ed\xc9sp\xc5\xd8\x18\xce?\ -\x02W\x86\x18Q\x9aP\x9a|\x1a\x5c\xe1xJ\xe0E\ -\x83\xf13\x5c9\xe2\x84\x10M\xce\x19\xeb{/\x95\x82\ -\x0aq\x0e,\xa3Hr)\x12\xfa\x0e\xca>\x0f\xd8\x9c\ -\x1b\xf3Q\xc0*\x8d\xb5\x04p?\x0d\xb0\xd0\x08\x15\xbc\ -\x94S6CX\xa1\xa0u\xcd\xe1\xca\x91\xf2\x84\xd53\ -\xad\x80A\x01`\xe8\x14\x17q}.]\x95\xfa(T\ -\xb9\xd2Pk2\xf9T\xa8*\x0c\xd815\x83\xaa\xa6\ -\x82`r\x8e*\xccQB(=\xd3\x068\xc4#\xb0\ -\xe0\xef`+\xfeW\xda\xabo\x03L+\xa5\xe9?\x89\ -\xeb2^\xf77\xf6\xf5\xd3\xbb\xd5\xe4r2\xb9\xe9#\ -\x8ceB\x15[DT\x00\x8c\x09\xd5\xfauxz\x1d\ -#p\x1d\x1b~\x09xrU\x93\x93\xee1\xbb\x01F\ -\x82P\x0ew\x9e\xfe\xd7\x84\xce\xb3\xa5\xff\x0d\xeb\xea\xc5\ -_\xb0\xe5\x19\x00\ +\x00\x15xx\xda\xedXmo\xdb6\x10\xfe\xde_!\ +(_\x12\xcc\x92\xf8*\x91\xae\x9dbCQt@\xf7\ +e\xeb^\xbf1\x12m\xab\x91E\x83\x92\xe3\xa4\xbf~\ +G\xd9\x92%[\xee:\xb4]\xb1aJl\x88wG\ +\xf2\xee\xb9\x87G\xd2\xb3\x17\x8f\xeb\xc2{\xd0\xb6\xcaM\ +9\xf7q\x88|O\x97\xa9\xc9\xf2r9\xf7\x7f~\xfb\ +*\x10\xbeW\xd5\xaa\xccTaJ=\xf7K\xe3\xbf\xb8\ +}6\xab\x1e\x96\xcf<\xcf\xdb\xe5Y\xbd\x9a\xfbL\xf8\ +\xae\xb5\xd2\xf9rUw\xcd\x87\x5c\xef\xbe3\x8fs\x1f\ +y\xc8c\xc2;\x88\xf3l\xeeCw\xb2\xb79\xce\x8c\ +\xf7\xda\xf2\xbeJ\xd5FO\xfb\x9a\x90x\xd7H!\x94\ +.8\xa5r\xe2\x11DH\x80\xe0\x9f\xdd4\x9d*\xf0\ +w\x03\x9fif\xd2R\xad\xc1\xcd\xcd\x22\x849\x1a%\ +\x04XV\xd3v\xdc\xb9\xbf\xaa\xeb\xcd4\x8av\xbb]\ +\xd8\x0aCc\x97\x91\xebXmT\xaa\xab\xa8\x95\xf7\xfa\ +\xb7St\xfd[AX\x99\xadM\xf5\x02\x86\xd0a\xa9\ +\xeb\xe8\xe5\xdb\x97\x9d2@aVg\xc7a\x06\xb3\xef\ +h3/A\x08ECg\xa1\xf5\x91\x966[\x8cY\ +b)e\x84H\x040\x81EP=\x95\xb5z\x0c\xca\ +\xea\xaa\xd75M\xbb\x9e\xa9\xd5\xaa\xce\x1ftj\xd6k\ +SV{8\x06\xc6\xd9\xd1x\xb3\xb5Ec\x91\xa5\x91\ +.\xf4Z\x97u\x15A\x92\x22\xff\x16\xecgk]\xab\ +L\xd5\xca\xf5\xdd'\xbb\x95`\xd2X\x80\x0d\xf84\xfd\ +\xf1\xe5\xab}\x0b\xdai:\xfd\xd5\xd8\xfbC\x13\x1eg\ +\xa0\xee\xcc\x16\xc8\xe4\xdfv\xe2Y\x96N\x01\xe7\xb5\xaa\ +o\xf3\xb5Zj\x87\xc57\xe0\xdf,:*\x06\xc6\xf5\ +\xd3F\x1f\x07\xdd\x0fk\xf5>a\xa3\xf1d\xe9:w\ +\x9d\xa2\x9f\xea\xbc(\xbew\x93\xf8^\xd4\xf9\x19\x1d\x1c\ +=\x84\x11\xf5\xe2\x98Em\x98M+\xd3\x8b\xea\x88\x80\ +ka\xd4F\xbfV\xf6^\xdb\xd6\xaf\x8e\xf0Um\xd2\ +{g\xfd\xad\xb5f\x87\xdf\xc0\xaa\xb3\xb5\xdf\x9a\x19\x9b\ +\x03\xd0s_mk\xd3\x09\xad^\xfc\x0e\xcb\x0b\x16m\ +O\xf2\xdbPrq\xc4\xaa~*\x00\x05\x03\x0bmQ\ +\x98\xdd\xf4!\xaf\xf2\xbbB\xfbg\x8e\xe5U\xe3\xda\xdc\ +\xaf\xedVw\xe9\x98mT\xbd:\x82\xeb\xa6q\x12\xc6\ +\xa5\xf0\x8fb\x90\xfe\xe0\x81;\x13\xf8xo<\x0eo\ +\x01o^\x03LB\xde\x13\xef\xa5\xad\xe9{\xaf7\xc8\ +\xc1\xd3\x05\xa4$\xb0\xdbBO\xf5\x83.M\x96=\xaf\ +jk\xee\xf5\xf4\x0a5\xcf\xa1\x194Ei\x0a\xa5l\ +S\xf7\x06\xa9\xad*+G\x12\xa8>\xa9*\xf45\x0a\ +\xc5\xcd^Z\xa8Z_\xef\xdd\xb9\xe9\xd2\x0d\x09m\xf2\ +\xb4O\xae\xcb`\xf3\xd6\x95\x1aW.2W\xe2\xf6S\ +l\x80*\xa9)\x8c\x9d\xfbW\x8b\xe69\xcc}gl\ +\xa6m\xab\x8a\x9bg\xa02Ps\x80tP\xe8\x0eb\ +s\xf7N\xa7um\x0a\x0d\xce9\xa2\xe26\x9bK\x0b\ +\xa1\x8d\xc9\xb7y\xa6\xc7\x14]\x0e\x9d{\xddD\xa3\xda\ +j\xa52\xb3\x9b\xfb\xe4T\xb9\xcbKP\x04\x87RO\ +8\xe2\x17,\xda\xf2\x8f\x11n#t\xac\xe8\x80jy\ +Q\xad\xcc\xceE\x02\x19UE\xa5OG{o\x0c\xe4\ +\x08\xd3\x90\x13$(=U\xa7nC\x09\x85H8\x96\ +D\x9ci!<\x02\x04\x12\x08\x13v\xc1O\x18\x80_\ +\x8a\xc1uO.\xe8\xd6\xea1_\xe7\xefuvL\xd5\ +q\xde\xad\xb5\xb0>\x83B=i\xc8\xf3R\x22<\x06\ +r\xba\xd2)p\xea\xce(\x9b\xb9<\xec\xc96[\x1e\ +\xd1Z2\xcc\xbbJ\xb1\xec/\xe2%\xe3\x8c\xfd\xf5\xf2\ +\xa3\xe8l\xf9M\x90\xf7\xdam\xc0\xbf\xb8\xaf\xd7\xb0\x19\ +\xff\xd139\x86`\xca\x12xgl\x00\xc1<\xa8z\ +k\xf5\x91*'\xcbpZ\xc2a\xa0_\x19\x97CW\ +z\xf1\x9f\xac=\xa8\xd16\x7f\xbc\x86\xd5\x99PI$\ +\x9b\x80w\x93c+\x96!l]\x1c\xf3\x09IB,\ +\x88\xa4\xf8\xa6\xbf\x03\x0c\xa3\xfe;\xde\xf70\xc2\x09\x1e\ +(\x1a\x94\x02N\xc3\x04\x09\x16\x8b\x09F!\xf8\x82q\ +\xec\x05\x8c\x842I\x92\x18\x83\x8f\x82s!c:\xe8\ +\xda\xc7\xe4J\xc7\xee\xef\xf9\xe5:ER\x85\xb8\x1a\xd6\ +)\x12&\x922\xd1\x0a\x8b\x1c\xc2P\x9b\xe9\xdd\xb6\xae\ +\xfb\xb2w&/\xa7\xb09i\xdbJ\x9bF\x01\x8c\xac\ +\xa7\xac\x95e\x0a\x96\xb1\xb5\xea\xa9IP+=,\xfc\ +)\xeee\xec\xf3aIO\xb1\x5c\x03\x96,$\x8c\xf1\ +8\x9e\x042\xa4\x22\xe6\x94\x13\x0f\xde\xb8\xc0HN\x9a\ +\x17$\x13\x81\xff\xc7r\x88%\x1f\xe1%\x05\xe6%\x88\ +\xc4\xc9$\xc08\x944!,i\x88\x89D\x12;\x84\ +\xa1\xdc1L\x89D\xf2\xdf\x0c\xe7\xc0\xf5n\x935\xb0\ +\xaf\xc1y\x0c\x0e\xcei\xfaa\xc4/\xf4\xf9\x0cII\ +F\x08\x0e\xf0'\x82\xc4\x94M\x08\x94)\x84\xb9\x07\xe7\ +\x87\x84S\x9c\xc4\xae|$\x90\x8e\xff\x0c\xb7uQ\xe4\ +\x9bjx\x90\x86}\x92\x86\x88\xcb\x04x9\x08\xd4>\ +:\x0d\xe6T$d\xc8f\xb75\x03\x81\x13)\x98\x1c\ +\xa6\xdbm\xe9\x01\xe7!%\x04\xd1\xe4B\x1ah\x1c\xc4\ +\xc1h\xf1\xed\xdc~\xbe\x87\x97&\xa9H\xf6\x8d`\xa8\ +\x1bE\xbb\x8f@\x07\xb5\x80\xc3\xc5\x19\xac\xd6l\xcb\xec\ +K\xc3\xea6\x1c&0\x1d\x83\x15\xc5\xc0\xb8\xee\xf8\xd8\ +\x83\x95\xba\x13\x0f\x17\xfc\x1cV\x22C\x18,\xa6\xf82\ +\xac\xf8c@EH)\xc6>\x01T\x1aR,$\xfe\ +:\xa0\xc2v\x94\xc0\xa9\x82\xb23PY\x08\x1b=\x96\ +\xf8\x9c\xab\xae\xda\xc6\xb0\xc8\xe5\x08\xaa\x94\x841\x8by\ +B>@\xd6\x8fC5cJ}\x12\xaa\x02\xea~\xfc\ +uP\xa5!\x13pD't\x84\xaa\x5c@\xb9\x1a\x01\ +U\xc2\xc1\x00Nzr\xa4\x00P`>\x22\xf82S\ +?\x96\xa7B|\x12\xa2LH\x96|-D\x05\x02\xdc\ +\xa8\x18AT\x12\x8e\x11>_\xfbpj\x05l\xa48\ +G\x94A,p]c\x1f`)\xfaG\x0a\xaa[\xfb\ +T\xca/\x89\xe9,Z\xb6\xf7\xf6\xe5\xe9\xed\xa9w\xfd\ +\xe8\xdd\xf7C\x84\xe2\x84\x08:\x09\x08w\xf7I \xe5\ +\x8d?\xbcpa\xb8pu\xbf\x07\x9c\x5c\xc6\xe2^\xc9\ +\x18\x9d\x00\x85\x1c7\x5co\x7fSh<\x9b\xb9\x1f\xad\ +n\x9f\xfd\x09.-\x1a%\ \x00\x00\x07z\ \x00\ \x00(\x84x\xda\xddZ[o\xe36\x16~\xcf\xaf\xd0\ @@ -10299,6 +10297,84 @@ 25.887299)\x22\x0a \ id=\x22g4144\x22 />\ \x0a \x0a\x0a\ +\x00\x00\x04\xb5\ +\x00\ +\x00\x1egx\xda\xe5YKo\xdbF\x10\xbe\xfbW\xb0\ +\xf4%A\xcb\xe5\xbe\x1f\x8c\xa4\x00m\x10 \xd76E\ +\xcf4\xb9\x92\x18\x93\x5caI[v~}\x86\x12)\ +R\xae\x1d\x14\xd2\xa5\x00\x09\xe9\xb03\xb3;3\xdf\xbc\ +\x96\xd2\xe2\xe3SU\x06\x8f\xd67\x85\xab\x97!A8\ +\x0cl\x9d\xb9\xbc\xa87\xcb\xf0\xef\xaf\x9f#\x1d\x06M\ +\x9b\xd6yZ\xba\xda.\xc3\xda\x85\x1fW7\x8b_\xa2\ +(\xf8\xc3\xdb\xb4\xb5y\xb0/\xdam\xf0\xa5\xbeo\xb2\ +tg\x83w\xdb\xb6\xdd%q\xbc\xdf\xefQ\xd1\x13\x91\ +\xf3\x9b\xf8}\x10E\xab\x9b\x9bE\xf3\xb8\xb9\x09\x82\xa9\ +N\x12v\x84\x22_\x86\xc0\xa3\x87\xc5\xbe\xc8\xdb-\xf0\ +\xccq\xb9\xb5\xc5f\xdb\x8e\xeb\xc7\xc2\xee\x7fwO\xcb\ +\x10\x078\x00b00\x1a\xb0|\x07\xdf$wY\x9d\ +V`p\xb3\xab\xd2\x16\xc1\xc1G%\xbdE\xc9T=\ +\xa2\xc1;\x9cb\x9c\xad\x05c\xe6\xb7\x80bJ#\x0c\ +\x1f\xfe\xfe\xb0\x09 \xaa\x9bd\xd8\xba\x0c\xdf\xf2\xb0S\ +\xd8\xec\xd2\xcc6\xf1@\x9f\xec\x1fL;\xed\x1f\x08\xa8\ +q\x0f>\xb3k8\xc2\xa2\xda\xb6\xf1\xa7\xaf\x9fN\xcc\ +\x08\xa3\xbc\xcd\xc7c\xce\xb4\xef\xd9A/\xc5\x18\xc7\x83\ +\x87\xbd\xb2\xc7\xcd\x7f\x94\xf4\xf9\xfa5Ib\x8c\x891\ +\x8d\x01\x09\x90\x88\x9a\xe7\xbaM\x9f\xa2\xba\xb9\x9dl\xcd\ +\xb2\xd3\xce\xac\xcb\x85\xe2\xd1f\xae\xaa\x5c\xdd\x1c\xe18\ +\x13\xceG\xe1\xdd\x83/\x0f\x12y\x16\xdb\xd2V\xb6n\ +\x9b\x18\xe2\x10\x87+\x90_T\xb6M\xf3\xb4M\xbb\xbd\ +\xc7\xb4\x18(\xfa \x00\x22`R\xf2\xe7\xa7\xcf\xc7\x15\ +\xac\xb3,\xf9\xc7\xf9\xfb~\x09O'\x90\xde\xb9\x07\xc8\ +\x99pu\x22/\xf2,\x01\x98!!VE\x95nl\ +\x07\xc5\xaf`\xde\x22\x1e\x19g\xc2\xed\xf3\xce\x8e\x87\x1e\ +\x8f\xf5\xf6\x18\xafW\xdd\xc9\xb3\xaa\xe86\xc5\x7f\xb5E\ +Y~\xe9\x94\x84A|\xb23\xee\x0d\xed\xdd\x88'~\ +,\xe2\xc1\xcb\xc3*\xb7\xebf\x04\xa0[\xc9\xfe\xa0\xc5\ +)\xc7\xbb|\xcb\xbbR8\x0a\xee@Y\xe6J\xe7\x97\ +\xe1\xed\xfa\xf0\x84G\xc6\x9d\xf3\xb9\xf5\x03K\x1e\x9e3\ +\x96\x83\xa4\x05\xb3\xa1\x18z\xb2\xbb\xfbf\xb3\xb6u\xa5\ +\xf5i\xdd\xb9Jp\xcf\xd9x\xa8\xcc\xd7\xe8\x0fEn\ +_c\x9c*\xae3\xef\xa4\xe8Un\xb3Ms\xb7_\ +\x86\xf4%s_\xd4\xc0\x88\xfa\xa6@\x05\x16oH\x9c\ +\xfa\x04&\x83\x87\x1d|'\xa0xOl\xb6n\xdfy\ +\xb2\x0c\xd7i\xd9\xd8\x97\xa7}w\xae\xea:\x03\xa5\x86\ +H\xa9^\xb23h<\x11\xd1\x0a\x11\xa2%\xff\x17\x17\ +\xdcS\x181E\xb52o\xd8\x09\x07\x88\xb7|\x80\xed\ +T\xbd\xc1\xab\xd2\xa7\xa2*\xbe\xdb|\x0c\xd5\xa8\xf7\xc1\ +{\xa8\xa4\xa8L\x9f\xad\x9f\xb4\xd2\x17 g[\x9b\xdd\ +[\x7f\xe7R\x9fwq\xe8\x93\xcaC\xbc{l\xda\xe7\ +\x12\x02\xb8\x86\xfcMj\xe8\xf9\x1f\x9a\xd6\xbb{\x9b\xdc\ +\x9a\xc3\xd3/\x8f\xc1H\x08Cl\xa0\x94EmAM\ +\xe2\xddC\x9dO\x89\xdf\x5cQ\x9fS\xa1H\xac/\xc1\ +\x956\xe1\x03-O!\xfe\xde\xa7\xcfS\xadQ\x9f1\ +\x09\xf9\xb0K\x0b\xf0\xee\x90\xafI\x95z\xf0\xa1\x09\x8e\ +BAg\xeb$\xdc\x9d/\x06\x0f\x00\x0d\xa3Dr\xa4\ +\x94\x11C^\x9cREh\xc4\x95RC\x1c!4\x84\ +#-%\xe5\x83hW\x18\x0aa\xc1\x85&?\xc7k\ +\xc0\xa8[LL\xff\x19\x82\x0cQ\xc6\xb1\xf8_\x82(\ +\xa5\xc1\xe7(J\xa4\xa40\x5c\xe9\x17(\x0et6\xa2\ +\xc8(R\x9c*NF\x14\x99\x00\xa8\x05\x96\xb3\x031\ +\x12\x17\xc3\xc85\x12\x98p\xa6G\x18;\x92\xd0\x9c\x9b\ +\xf9\xe1H/\xc6QR\xa4\x0d7\x86\x8d8\xcaC\x86\ +2Mg\x88ctyak\x8d\xa8\xa2X\xd1\x11I\ +!\x116\x90\x91r\x8eH\xf2\x8b\x91\x14\xf0\xbe%\x05\ +\x15#\x90\x1aC\x87\xd4\x0a\xcf\x12Hr1\x90\x86!\ +\x03\xf7-2\x99\xd8p=\xc3J0\xc3\xe7\x87\xa4\xbc\ +\x18G\xa5\x91\xc2\x82\x1a3\xe2\xa8\x00G\x18?\x9c\xcd\ +ph_1\xb6\x09!H\x09z\xba\xc9wM\xd2 \ +J\x14\xd7|\x96\xe3\xe6\xf2.\xc9\x81f\x94\x9c\xce\x1b\ +x\xbfC\x86\x18%\xe6\x08\xa5V\x97g%\x93\xf0b\ +*\xcdd\xe2H\x86\x88\x11\x86\x90Yf\xa5\xbe\xa2\xc0\ +)b\x5cN[%\xc1\x14\x09\xc9\x0c\x9beV^^\ +\xdf\x02&\x8c\x11l\x92\x94\x84bD\xb4\x10\xb3\xbc\x99\ +\xcb\xcb_r4A\x9a\x0b\xcc\xa6I\xc9\x09\x8c\x1d,\ +\xe6y5\xbf\xa2U\xc2\xe5\x9c\x10?\x0a \x0a\ \x0a\ -\x00\x00\x08]\ -<\ -?xml version=\x221.\ -0\x22 encoding=\x22UTF\ --8\x22 standalone=\x22\ -no\x22?>\x0a\x0a\ -\x0a\x0a <\ -metadata\x0a id\ -=\x22metadata8\x22>\x0a \ - \x0a \ - \x0a image/svg+x\ -ml\x0a \ - \x0a \x0a <\ -/cc:Work>\x0a \x0a \x0a \x0a \x0a \x0a\x0a\ \x00\x00\x06\xc2\ <\ ?xml version=\x221.\ @@ -26837,6 +26777,142 @@ ty:1\x22 />\x0a \x0a \x0a\x0a\ \ +\x00\x00\x08]\ +<\ +?xml version=\x221.\ +0\x22 encoding=\x22UTF\ +-8\x22 standalone=\x22\ +no\x22?>\x0a\x0a\ +\x0a\x0a <\ +metadata\x0a id\ +=\x22metadata8\x22>\x0a \ + \x0a \ + \x0a image/svg+x\ +ml\x0a \ + \x0a \x0a <\ +/cc:Work>\x0a \x0a \x0a \x0a \x0a \x0a\x0a\ \x00\x00\x09^\ \x00\ \x00O\xf4x\xda\xed\x5cY\x8f\xdb8\x12~\xcf\xaf\x10\ @@ -28291,6 +28367,10 @@ \x0c\x01Z\x07\ \x00d\ \x00y\x00n\x00.\x00s\x00v\x00g\ +\x00\x09\ +\x03\x87\xae'\ +\x00s\ +\x00p\x00m\x00a\x00t\x00.\x00s\x00v\x00g\ \x00\x0c\ \x04B\x11\xc7\ \x00a\ @@ -28650,10 +28730,6 @@ \x03 .'\ \x00d\ \x00e\x00t\x00e\x00c\x00t\x00_\x00t\x00r\x00.\x00s\x00v\x00g\ -\x00\x08\ -\x08\x96W\xc7\ -\x00b\ -\x00a\x00r\x00s\x00.\x00s\x00v\x00g\ \x00\x0f\ \x07\xf8iG\ \x00u\ @@ -28679,6 +28755,10 @@ \x00a\ \x00d\x00d\x00_\x00c\x00o\x00n\x00t\x00i\x00n\x00g\x00e\x00n\x00c\x00y\x00.\x00s\ \x00v\x00g\ +\x00\x08\ +\x08\x96W\xc7\ +\x00b\ +\x00a\x00r\x00s\x00.\x00s\x00v\x00g\ \x00\x12\ \x0f\x03\xea\x87\ \x00c\ @@ -28712,307 +28792,309 @@ \x00\x00\x00\x00\x00\x00\x00\x00\ \x00\x00\x00.\x00\x01\x00\x00\x00\x01\x00\x00\x00\x00\ \x00\x00\x01\x8b\xd7}+v\ -\x00\x00\x00T\x00\x02\x00\x00\x00\x96\x00\x00\x00\x05\ +\x00\x00\x00T\x00\x02\x00\x00\x00\x97\x00\x00\x00\x05\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x0c\xe8\x00\x00\x00\x00\x00\x01\x00\x04\xc7\x09\ +\x00\x00\x0d\x00\x00\x00\x00\x00\x00\x01\x00\x04\xcb\xad\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0a\x88\x00\x00\x00\x00\x00\x01\x00\x03\xc9\x00\ +\x00\x00\x0a\xa0\x00\x00\x00\x00\x00\x01\x00\x03\xcd\xa4\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x12|\x00\x00\x00\x00\x00\x01\x00\x06\x8f\xd8\ +\x00\x00\x12\x94\x00\x00\x00\x00\x00\x01\x00\x06\x94|\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x01\x00\x00\x00\x00\x00\x00\x01\x00\x00eu\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x09Z\x00\x00\x00\x00\x00\x01\x00\x03f\x9a\ +\x00\x00\x09r\x00\x00\x00\x00\x00\x01\x00\x03k>\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x12\xa0\x00\x00\x00\x00\x00\x01\x00\x06\x9b}\ +\x00\x00\x12\xb8\x00\x00\x00\x00\x00\x01\x00\x06\xa0!\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x06\xe8\x00\x00\x00\x00\x00\x01\x00\x02\x8b\x88\ +\x00\x00\x07\x00\x00\x00\x00\x00\x00\x01\x00\x02\x90,\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x05\x10\x00\x00\x00\x00\x00\x01\x00\x01\xf2\xd6\ +\x00\x00\x05\x10\x00\x00\x00\x00\x00\x01\x00\x01\xf2\xc1\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x00\xd0\x00\x00\x00\x00\x00\x01\x00\x00N2\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x02\x18\x00\x00\x00\x00\x00\x01\x00\x00\xd0 \ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0eH\x00\x00\x00\x00\x00\x01\x00\x05CI\ +\x00\x00\x0e`\x00\x00\x00\x00\x00\x01\x00\x05G\xed\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x12\x0a\x00\x00\x00\x00\x00\x01\x00\x06k\x0b\ +\x00\x00\x12\x0c\x00\x00\x00\x00\x00\x01\x00\x06gN\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x0c`\x00\x00\x00\x00\x00\x01\x00\x04\xa5\x07\ +\x00\x00\x0cx\x00\x00\x00\x00\x00\x01\x00\x04\xa9\xab\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0b\xaa\x00\x00\x00\x00\x00\x01\x00\x04?N\ +\x00\x00\x0b\xc2\x00\x00\x00\x00\x00\x01\x00\x04C\xf2\ \x00\x00\x01\x8d\x0d\x8c\x812\ -\x00\x00\x04\xba\x00\x00\x00\x00\x00\x01\x00\x01\xdc\x1e\ +\x00\x00\x04\xba\x00\x00\x00\x00\x00\x01\x00\x01\xdc\x09\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0ej\x00\x00\x00\x00\x00\x01\x00\x05L\xde\ +\x00\x00\x0e\x82\x00\x00\x00\x00\x00\x01\x00\x05Q\x82\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0e\x9e\x00\x01\x00\x00\x00\x01\x00\x05br\ +\x00\x00\x0e\xb6\x00\x01\x00\x00\x00\x01\x00\x05g\x16\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x114\x00\x00\x00\x00\x00\x01\x00\x06(\xde\ +\x00\x00\x11L\x00\x00\x00\x00\x00\x01\x00\x06-\x82\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x04\xa4\x00\x00\x00\x00\x00\x01\x00\x01\xccz\ +\x00\x00\x04\xa4\x00\x00\x00\x00\x00\x01\x00\x01\xcce\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x08\xa6\x00\x01\x00\x00\x00\x01\x00\x03\x18\xe3\ +\x00\x00\x08\xbe\x00\x01\x00\x00\x00\x01\x00\x03\x1d\x87\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x04`\x00\x00\x00\x00\x00\x01\x00\x01\xac\xf1\ +\x00\x00\x06\xb4\x00\x01\x00\x00\x00\x01\x00\x02{\xc6\ +\x00\x00\x01\x8e\xaa\x03\xff\x1c\ +\x00\x00\x04`\x00\x00\x00\x00\x00\x01\x00\x01\xac\xdc\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0a2\x00\x00\x00\x00\x00\x01\x00\x03\xa48\ +\x00\x00\x0aJ\x00\x00\x00\x00\x00\x01\x00\x03\xa8\xdc\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x11y\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x04\x82\x00\x00\x00\x00\x00\x01\x00\x01\xbd>\ +\x00\x00\x04\x82\x00\x00\x00\x00\x00\x01\x00\x01\xbd)\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x0e\x14\x00\x00\x00\x00\x00\x01\x00\x05![\ +\x00\x00\x0e,\x00\x00\x00\x00\x00\x01\x00\x05%\xff\ \x00\x00\x01\x8e\x84\x8f\xee@\ -\x00\x00\x06\xb4\x00\x01\x00\x00\x00\x01\x00\x02{\xdb\ +\x00\x00\x06\xcc\x00\x01\x00\x00\x00\x01\x00\x02\x80\x7f\ \x00\x00\x01\x88\xae\xf9[%\ -\x00\x00\x12\xb6\x00\x00\x00\x00\x00\x01\x00\x06\xb5\x9e\ +\x00\x00\x12\xce\x00\x00\x00\x00\x00\x01\x00\x06\xbaB\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x0a\xa8\x00\x01\x00\x00\x00\x01\x00\x03\xd5\xf1\ +\x00\x00\x0a\xc0\x00\x01\x00\x00\x00\x01\x00\x03\xda\x95\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x00\xa4\x00\x00\x00\x00\x00\x01\x00\x004\x02\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x01(\x00\x00\x00\x00\x00\x01\x00\x00s\x90\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x10\x04\x00\x00\x00\x00\x00\x01\x00\x05\xcf\x19\ +\x00\x00\x10\x1c\x00\x00\x00\x00\x00\x01\x00\x05\xd3\xbd\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0f\xc8\x00\x01\x00\x00\x00\x01\x00\x05\xbbK\ +\x00\x00\x0f\xe0\x00\x01\x00\x00\x00\x01\x00\x05\xbf\xef\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x09~\x00\x01\x00\x00\x00\x01\x00\x03o\xca\ +\x00\x00\x09\x96\x00\x01\x00\x00\x00\x01\x00\x03tn\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x09\x16\x00\x00\x00\x00\x00\x01\x00\x03K\xb6\ +\x00\x00\x09.\x00\x00\x00\x00\x00\x01\x00\x03PZ\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x0c\xa0\x00\x01\x00\x00\x00\x01\x00\x04\xba\xd4\ +\x00\x00\x0c\xb8\x00\x01\x00\x00\x00\x01\x00\x04\xbfx\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x03\xaa\x00\x01\x00\x00\x00\x01\x00\x01gZ\ +\x00\x00\x03\xaa\x00\x01\x00\x00\x00\x01\x00\x01gE\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x08\xba\x00\x00\x00\x00\x00\x01\x00\x03-k\ +\x00\x00\x08\xd2\x00\x00\x00\x00\x00\x01\x00\x032\x0f\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x07\xd8\x00\x00\x00\x00\x00\x01\x00\x02\xd7\x19\ +\x00\x00\x07\xf0\x00\x00\x00\x00\x00\x01\x00\x02\xdb\xbd\ \x00\x00\x01\x8e\xa3p\xab\x0c\ -\x00\x00\x0d\x0e\x00\x00\x00\x00\x00\x01\x00\x04\xce\xa2\ +\x00\x00\x0d&\x00\x00\x00\x00\x00\x01\x00\x04\xd3F\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x092\x00\x01\x00\x00\x00\x01\x00\x03Y\x08\ +\x00\x00\x09J\x00\x01\x00\x00\x00\x01\x00\x03]\xac\ \x00\x00\x01\x88\xae\xf9[%\ \x00\x00\x02\x80\x00\x01\x00\x00\x00\x01\x00\x00\xf2\xcc\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x070\x00\x00\x00\x00\x00\x01\x00\x02\xac\x07\ +\x00\x00\x07H\x00\x00\x00\x00\x00\x01\x00\x02\xb0\xab\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x08X\x00\x00\x00\x00\x00\x01\x00\x02\xfeJ\ +\x00\x00\x08p\x00\x00\x00\x00\x00\x01\x00\x03\x02\xee\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x06$\x00\x01\x00\x00\x00\x01\x00\x02R\xeb\ +\x00\x00\x06$\x00\x01\x00\x00\x00\x01\x00\x02R\xd6\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0d\x8e\x00\x01\x00\x00\x00\x01\x00\x04\xfd\x00\ +\x00\x00\x0d\xa6\x00\x01\x00\x00\x00\x01\x00\x05\x01\xa4\ \x00\x00\x01\x88\xae\xf9[%\ -\x00\x00\x0d\x5c\x00\x01\x00\x00\x00\x01\x00\x04\xe8(\ +\x00\x00\x0dt\x00\x01\x00\x00\x00\x01\x00\x04\xec\xcc\ \x00\x00\x01\x8b\xd7}+z\ \x00\x00\x02d\x00\x00\x00\x00\x00\x01\x00\x00\xe2n\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x11\x18\x00\x01\x00\x00\x00\x01\x00\x06\x1bk\ +\x00\x00\x110\x00\x01\x00\x00\x00\x01\x00\x06 \x0f\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x03|\x00\x01\x00\x00\x00\x01\x00\x01Tx\ +\x00\x00\x03|\x00\x01\x00\x00\x00\x01\x00\x01Tp\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x03P\x00\x01\x00\x00\x00\x01\x00\x01@\x19\ -\x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0a\xca\x00\x00\x00\x00\x00\x01\x00\x03\xdd\x93\ +\x00\x00\x01\x8e\xaa\x0b\xd3@\ +\x00\x00\x0a\xe2\x00\x00\x00\x00\x00\x01\x00\x03\xe27\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x02\xe4\x00\x00\x00\x00\x00\x01\x00\x01 +\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x12`\x00\x00\x00\x00\x00\x01\x00\x06\x82B\ +\x00\x00\x12x\x00\x00\x00\x00\x00\x01\x00\x06\x86\xe6\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11\xac\x00\x00\x00\x00\x00\x01\x00\x06Mw\ +\x00\x00\x11\xae\x00\x00\x00\x00\x00\x01\x00\x06I\xba\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x02\x98\x00\x00\x00\x00\x00\x01\x00\x00\xf7-\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x02:\x00\x01\x00\x00\x00\x01\x00\x00\xdbA\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0e\xe6\x00\x01\x00\x00\x00\x01\x00\x05o\x03\ +\x00\x00\x0e\xfe\x00\x01\x00\x00\x00\x01\x00\x05s\xa7\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x01<\x00\x00\x00\x00\x00\x01\x00\x00}9\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0b\xee\x00\x00\x00\x00\x00\x01\x00\x04vF\ +\x00\x00\x0c\x06\x00\x00\x00\x00\x00\x01\x00\x04z\xea\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x00z\x00\x00\x00\x00\x00\x01\x00\x00\x1ac\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11\x8e\x00\x00\x00\x00\x00\x01\x00\x06BK\ +\x00\x00\x11\x90\x00\x00\x00\x00\x00\x01\x00\x06>\x8e\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x08p\x00\x00\x00\x00\x00\x01\x00\x03\x05\xdc\ +\x00\x00\x08\x88\x00\x00\x00\x00\x00\x01\x00\x03\x0a\x80\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x03\xfa\x00\x00\x00\x00\x00\x01\x00\x01{\xd6\ +\x00\x00\x03\xfa\x00\x00\x00\x00\x00\x01\x00\x01{\xc1\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0f&\x00\x00\x00\x00\x00\x01\x00\x05\x88b\ +\x00\x00\x0f>\x00\x00\x00\x00\x00\x01\x00\x05\x8d\x06\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x01\x8e\x00\x01\x00\x00\x00\x01\x00\x00\xa2\xf8\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x06\x12\x00\x00\x00\x00\x00\x01\x00\x02C\xc6\ +\x00\x00\x06\x12\x00\x00\x00\x00\x00\x01\x00\x02C\xb1\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0f\xe6\x00\x00\x00\x00\x00\x01\x00\x05\xc4K\ +\x00\x00\x0f\xfe\x00\x00\x00\x00\x00\x01\x00\x05\xc8\xef\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x03\x98\x00\x01\x00\x00\x00\x01\x00\x01aP\ -\x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x10\xa8\x00\x01\x00\x00\x00\x01\x00\x05\xf8D\ +\x00\x00\x03\x98\x00\x01\x00\x00\x00\x01\x00\x01aH\ +\x00\x00\x01\x8e\xaa\x00\xc5\xb4\ +\x00\x00\x10\xc0\x00\x01\x00\x00\x00\x01\x00\x05\xfc\xe8\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x07\x02\x00\x00\x00\x00\x00\x01\x00\x02\x95\x8f\ +\x00\x00\x07\x1a\x00\x00\x00\x00\x00\x01\x00\x02\x9a3\ \x00\x00\x01\x8e.\xfc\xa1\x83\ -\x00\x00\x0e\x8a\x00\x00\x00\x00\x00\x01\x00\x05W\xf5\ +\x00\x00\x0e\xa2\x00\x00\x00\x00\x00\x01\x00\x05\x5c\x99\ \x00\x00\x01\x88\xae\xf9[%\ \x00\x00\x01\xc6\x00\x00\x00\x00\x00\x01\x00\x00\xae\xd1\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x09\xf8\x00\x00\x00\x00\x00\x01\x00\x03\x98\x03\ +\x00\x00\x0a\x10\x00\x00\x00\x00\x00\x01\x00\x03\x9c\xa7\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x052\x00\x00\x00\x00\x00\x01\x00\x02\x02{\ +\x00\x00\x052\x00\x00\x00\x00\x00\x01\x00\x02\x02f\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x02\xaa\x00\x00\x00\x00\x00\x01\x00\x00\xff\x1d\ \x00\x00\x01\x88\xae\xf9[%\ -\x00\x00\x06x\x00\x00\x00\x00\x00\x01\x00\x02b\x90\ +\x00\x00\x06x\x00\x00\x00\x00\x00\x01\x00\x02b{\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0d\xae\x00\x00\x00\x00\x00\x01\x00\x05\x04\x1d\ +\x00\x00\x0d\xc6\x00\x00\x00\x00\x00\x01\x00\x05\x08\xc1\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11j\x00\x00\x00\x00\x00\x01\x00\x06;\x85\ +\x00\x00\x11l\x00\x00\x00\x00\x00\x01\x00\x067\xc8\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0c\x18\x00\x00\x00\x00\x00\x01\x00\x04\x94\x0b\ +\x00\x00\x0c0\x00\x00\x00\x00\x00\x01\x00\x04\x98\xaf\ \x00\x00\x01\x8eL\x1c\xec)\ -\x00\x00\x07\xa0\x00\x00\x00\x00\x00\x01\x00\x02\xc2\xc9\ +\x00\x00\x07\xb8\x00\x00\x00\x00\x00\x01\x00\x02\xc7m\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x05\xa8\x00\x00\x00\x00\x00\x01\x00\x02,!\ +\x00\x00\x05\xa8\x00\x00\x00\x00\x00\x01\x00\x02,\x0c\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x10\xe4\x00\x01\x00\x00\x00\x01\x00\x06\x0e\x02\ +\x00\x00\x10\xfc\x00\x01\x00\x00\x00\x01\x00\x06\x12\xa6\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11T\x00\x00\x00\x00\x00\x01\x00\x063$\ +\x00\x00\x128\x00\x00\x00\x00\x00\x01\x00\x06u#\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x08B\x00\x00\x00\x00\x00\x01\x00\x02\xf8\x09\ +\x00\x00\x08Z\x00\x00\x00\x00\x00\x01\x00\x02\xfc\xad\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x02\xd0\x00\x00\x00\x00\x00\x01\x00\x01\x0a0\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x07\xfe\x00\x00\x00\x00\x00\x01\x00\x02\xe2\xfc\ +\x00\x00\x08\x16\x00\x00\x00\x00\x00\x01\x00\x02\xe7\xa0\ \x00\x00\x01\x8e.\xfc\xa1\x87\ -\x00\x00\x0aV\x00\x00\x00\x00\x00\x01\x00\x03\xb6\xc2\ +\x00\x00\x0an\x00\x00\x00\x00\x00\x01\x00\x03\xbbf\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x09D\x00\x00\x00\x00\x00\x01\x00\x03^\xfa\ +\x00\x00\x09\x5c\x00\x00\x00\x00\x00\x01\x00\x03c\x9e\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0ft\x00\x00\x00\x00\x00\x01\x00\x05\x9d(\ +\x00\x00\x0f\x8c\x00\x00\x00\x00\x00\x01\x00\x05\xa1\xcc\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0b\xca\x00\x00\x00\x00\x00\x01\x00\x04M\xe1\ +\x00\x00\x0b\xe2\x00\x00\x00\x00\x00\x01\x00\x04R\x85\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x0a\x10\x00\x01\x00\x00\x00\x01\x00\x03\x9f\x82\ +\x00\x00\x0a(\x00\x01\x00\x00\x00\x01\x00\x03\xa4&\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x10\xc8\x00\x00\x00\x00\x00\x01\x00\x06\x02\xf9\ +\x00\x00\x10\xe0\x00\x00\x00\x00\x00\x01\x00\x06\x07\x9d\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x07Z\x00\x00\x00\x00\x00\x01\x00\x02\xb4\xb5\ +\x00\x00\x07r\x00\x00\x00\x00\x00\x01\x00\x02\xb9Y\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x032\x00\x00\x00\x00\x00\x01\x00\x015\x01\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11\xec\x00\x00\x00\x00\x00\x01\x00\x06b(\ +\x00\x00\x11\xee\x00\x00\x00\x00\x00\x01\x00\x06^k\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x04\x0e\x00\x01\x00\x00\x00\x01\x00\x01\x87\xe2\ +\x00\x00\x04\x0e\x00\x01\x00\x00\x00\x01\x00\x01\x87\xcd\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0c\x04\x00\x00\x00\x00\x00\x01\x00\x04\x86h\ +\x00\x00\x0c\x1c\x00\x00\x00\x00\x00\x01\x00\x04\x8b\x0c\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x08\xd6\x00\x01\x00\x00\x00\x01\x00\x036\xdd\ +\x00\x00\x08\xee\x00\x01\x00\x00\x00\x01\x00\x03;\x81\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x00\x90\x00\x00\x00\x00\x00\x01\x00\x00!\xe4\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x10\x88\x00\x01\x00\x00\x00\x01\x00\x05\xf1z\ +\x00\x00\x10\xa0\x00\x01\x00\x00\x00\x01\x00\x05\xf6\x1e\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x04\xf2\x00\x00\x00\x00\x00\x01\x00\x01\xe8\x10\ +\x00\x00\x04\xf2\x00\x00\x00\x00\x00\x01\x00\x01\xe7\xfb\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x09\xce\x00\x00\x00\x00\x00\x01\x00\x03\x8a\x90\ +\x00\x00\x09\xe6\x00\x00\x00\x00\x00\x01\x00\x03\x8f4\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0f\xac\x00\x00\x00\x00\x00\x01\x00\x05\xad6\ +\x00\x00\x0f\xc4\x00\x00\x00\x00\x00\x01\x00\x05\xb1\xda\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x10\xfc\x00\x00\x00\x00\x00\x01\x00\x06\x12W\ +\x00\x00\x11\x14\x00\x00\x00\x00\x00\x01\x00\x06\x16\xfb\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x05p\x00\x00\x00\x00\x00\x01\x00\x02\x10\xa0\ +\x00\x00\x05p\x00\x00\x00\x00\x00\x01\x00\x02\x10\x8b\ \x00\x00\x01\x8d\x0d\x8c\x812\ -\x00\x00\x08\xfe\x00\x00\x00\x00\x00\x01\x00\x03C@\ +\x00\x00\x09\x16\x00\x00\x00\x00\x00\x01\x00\x03G\xe4\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x06P\x00\x01\x00\x00\x00\x01\x00\x02Y\x19\ +\x00\x00\x06P\x00\x01\x00\x00\x00\x01\x00\x02Y\x04\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0b|\x00\x01\x00\x00\x00\x01\x00\x048\xca\ +\x00\x00\x0b\x94\x00\x01\x00\x00\x00\x01\x00\x04=n\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x07\x88\x00\x00\x00\x00\x00\x01\x00\x02\xbb\xf6\ +\x00\x00\x07\xa0\x00\x00\x00\x00\x00\x01\x00\x02\xc0\x9a\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x06\xd2\x00\x00\x00\x00\x00\x01\x00\x02\x80\xad\ +\x00\x00\x06\xea\x00\x00\x00\x00\x00\x01\x00\x02\x85Q\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x042\x00\x00\x00\x00\x00\x01\x00\x01\x8dL\ +\x00\x00\x042\x00\x00\x00\x00\x00\x01\x00\x01\x8d7\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0d@\x00\x00\x00\x00\x00\x01\x00\x04\xe1<\ +\x00\x00\x0dX\x00\x00\x00\x00\x00\x01\x00\x04\xe5\xe0\ \x00\x00\x01\x8e\xa3p\xab\x0c\ -\x00\x00\x0c0\x00\x00\x00\x00\x00\x01\x00\x04\x9b2\ +\x00\x00\x0cH\x00\x00\x00\x00\x00\x01\x00\x04\x9f\xd6\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x01x\x00\x00\x00\x00\x00\x01\x00\x00\x9a\xd5\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x01V\x00\x01\x00\x00\x00\x01\x00\x00\x95\xeb\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x0fF\x00\x01\x00\x00\x00\x01\x00\x05\x96\x10\ +\x00\x00\x0f^\x00\x01\x00\x00\x00\x01\x00\x05\x9a\xb4\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0e\xfe\x00\x00\x00\x00\x00\x01\x00\x05u\xbd\ +\x00\x00\x0f\x16\x00\x00\x00\x00\x00\x01\x00\x05za\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x00\xba\x00\x00\x00\x00\x00\x01\x00\x00@\xd4\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x01\xe4\x00\x01\x00\x00\x00\x01\x00\x00\xba\x91\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x04H\x00\x00\x00\x00\x00\x01\x00\x01\xa5\xd2\ +\x00\x00\x04H\x00\x00\x00\x00\x00\x01\x00\x01\xa5\xbd\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0d\xfe\x00\x00\x00\x00\x00\x01\x00\x05\x17\xe4\ +\x00\x00\x0e\x16\x00\x00\x00\x00\x00\x01\x00\x05\x1c\x88\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0f\x8a\x00\x01\x00\x00\x00\x01\x00\x05\xa4d\ +\x00\x00\x0f\xa2\x00\x01\x00\x00\x00\x01\x00\x05\xa9\x08\ \x00\x00\x01\x8b\xd7}+z\ \x00\x00\x02\xfa\x00\x01\x00\x00\x00\x01\x00\x01)\x17\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0e\xc8\x00\x01\x00\x00\x00\x01\x00\x05iH\ +\x00\x00\x0e\xe0\x00\x01\x00\x00\x00\x01\x00\x05m\xec\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x06\xa0\x00\x00\x00\x00\x00\x01\x00\x02l\x97\ +\x00\x00\x06\xa0\x00\x00\x00\x00\x00\x01\x00\x02l\x82\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0d$\x00\x00\x00\x00\x00\x01\x00\x04\xd6%\ +\x00\x00\x0d<\x00\x00\x00\x00\x00\x01\x00\x04\xda\xc9\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x10B\x00\x00\x00\x00\x00\x01\x00\x05\xe0\xb0\ +\x00\x00\x10Z\x00\x00\x00\x00\x00\x01\x00\x05\xe5T\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0an\x00\x00\x00\x00\x00\x01\x00\x03\xbf\xf3\ +\x00\x00\x0a\x86\x00\x00\x00\x00\x00\x01\x00\x03\xc4\x97\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0c\xd0\x00\x00\x00\x00\x00\x01\x00\x04\xbf(\ +\x00\x00\x0c\xe8\x00\x00\x00\x00\x00\x01\x00\x04\xc3\xcc\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x05D\x00\x01\x00\x00\x00\x01\x00\x02\x09\xb0\ +\x00\x00\x05D\x00\x01\x00\x00\x00\x01\x00\x02\x09\x9b\ \x00\x00\x01\x8e.\xfc\xa1\x83\ -\x00\x00\x10,\x00\x00\x00\x00\x00\x01\x00\x05\xd9e\ +\x00\x00\x10D\x00\x00\x00\x00\x00\x01\x00\x05\xde\x09\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x03\xd6\x00\x00\x00\x00\x00\x01\x00\x01n\xd8\ +\x00\x00\x03\xd6\x00\x00\x00\x00\x00\x01\x00\x01n\xc3\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x10X\x00\x01\x00\x00\x00\x01\x00\x05\xe9*\ +\x00\x00\x10p\x00\x01\x00\x00\x00\x01\x00\x05\xed\xce\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0b\x0e\x00\x00\x00\x00\x00\x01\x00\x03\xfbk\ +\x00\x00\x0b&\x00\x00\x00\x00\x00\x01\x00\x04\x00\x0f\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x09\xae\x00\x01\x00\x00\x00\x01\x00\x03t\xdc\ +\x00\x00\x09\xc6\x00\x01\x00\x00\x00\x01\x00\x03y\x80\ \x00\x00\x01\x8b\xd7}+z\ -\x00\x00\x07\xbc\x00\x00\x00\x00\x00\x01\x00\x02\xcap\ +\x00\x00\x07\xd4\x00\x00\x00\x00\x00\x01\x00\x02\xcf\x14\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x03h\x00\x00\x00\x00\x00\x01\x00\x01F\x15\ +\x00\x00\x03h\x00\x00\x00\x00\x00\x01\x00\x01F\x0d\ \x00\x00\x01\x88\xae\xf9[-\ \x00\x00\x03\x18\x00\x01\x00\x00\x00\x01\x00\x01/\xd7\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0b0\x00\x00\x00\x00\x00\x01\x00\x04\x17j\ +\x00\x00\x0bH\x00\x00\x00\x00\x00\x01\x00\x04\x1c\x0e\ \x00\x00\x01\x88\xae\xf9[%\ -\x00\x00\x0c\x88\x00\x00\x00\x00\x00\x01\x00\x04\xad\x98\ +\x00\x00\x0c\xa0\x00\x00\x00\x00\x00\x01\x00\x04\xb2<\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x0a\xea\x00\x00\x00\x00\x00\x01\x00\x03\xee,\ +\x00\x00\x0b\x02\x00\x00\x00\x00\x00\x01\x00\x03\xf2\xd0\ \x00\x00\x01\x8b\xd7}+~\ -\x00\x00\x0d\xce\x00\x01\x00\x00\x00\x01\x00\x05\x0c$\ +\x00\x00\x0d\xe6\x00\x01\x00\x00\x00\x01\x00\x05\x10\xc8\ \x00\x00\x01\x88\xae\xf9[)\ \x00\x00\x00\xea\x00\x00\x00\x00\x00\x01\x00\x00Ze\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x126\x00\x01\x00\x00\x00\x01\x00\x06x\xe0\ +\x00\x00\x12N\x00\x01\x00\x00\x00\x01\x00\x06}\x84\ \x00\x00\x01\x8e.\xfc\xa1\x83\ -\x00\x00\x05\x84\x00\x00\x00\x00\x00\x01\x00\x02\x22i\ +\x00\x00\x05\x84\x00\x00\x00\x00\x00\x01\x00\x02\x22T\ \x00\x00\x01\x88\xae\xf9[-\ -\x00\x00\x08\x22\x00\x00\x00\x00\x00\x01\x00\x02\xec\xe9\ +\x00\x00\x08:\x00\x00\x00\x00\x00\x01\x00\x02\xf1\x8d\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x0bP\x00\x00\x00\x00\x00\x01\x00\x04 \xae\ +\x00\x00\x0bh\x00\x00\x00\x00\x00\x01\x00\x04%R\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x08\x8c\x00\x00\x00\x00\x00\x01\x00\x03\x0e\xc2\ +\x00\x00\x08\xa4\x00\x00\x00\x00\x00\x01\x00\x03\x13f\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x05\xe4\x00\x00\x00\x00\x00\x01\x00\x029\xf9\ +\x00\x00\x05\xe4\x00\x00\x00\x00\x00\x01\x00\x029\xe4\ \x00\x00\x01\x88\xae\xf9[)\ -\x00\x00\x11\xc6\x00\x00\x00\x00\x00\x01\x00\x06T\xe9\ +\x00\x00\x11\xc8\x00\x00\x00\x00\x00\x01\x00\x06Q,\ \x00\x00\x01\x8e.\xfc\xa1\x83\ " diff --git a/src/GridCalEngine/Devices/Branches/transformer3w.py b/src/GridCalEngine/Devices/Branches/transformer3w.py index e51221b77..552cf5672 100644 --- a/src/GridCalEngine/Devices/Branches/transformer3w.py +++ b/src/GridCalEngine/Devices/Branches/transformer3w.py @@ -171,7 +171,9 @@ def bus1(self) -> Bus: def bus1(self, obj: Bus): self._bus1 = obj self.winding1.bus_to = obj - self.winding1.set_hv_and_lv(self.winding1.HV, self.winding1.LV) + + if obj is not None: + self.winding1.set_hv_and_lv(self.winding1.HV, self.winding1.LV) @property def bus2(self) -> Bus: @@ -184,7 +186,9 @@ def bus2(self) -> Bus: def bus2(self, obj: Bus): self._bus2 = obj self.winding2.bus_to = obj - self.winding2.set_hv_and_lv(self.winding2.HV, self.winding2.LV) + + if obj is not None: + self.winding2.set_hv_and_lv(self.winding2.HV, self.winding2.LV) @property def bus3(self) -> Bus: @@ -197,7 +201,9 @@ def bus3(self) -> Bus: def bus3(self, obj: Bus): self._bus3 = obj self.winding3.bus_to = obj - self.winding3.set_hv_and_lv(self.winding3.HV, self.winding3.LV) + + if obj is not None: + self.winding3.set_hv_and_lv(self.winding3.HV, self.winding3.LV) @property def V1(self) -> float: diff --git a/src/GridCalEngine/api.py b/src/GridCalEngine/api.py index 7c060b281..ac57f5759 100644 --- a/src/GridCalEngine/api.py +++ b/src/GridCalEngine/api.py @@ -22,10 +22,10 @@ from GridCalEngine.enumerations import * -def open_file(filename: str) -> MultiCircuit: +def open_file(filename: Union[str, List[str]]) -> MultiCircuit: """ Open file - :param filename: name of the file (.gridcal, .ejson, .m, etc.) + :param filename: name of the file (.gridcal, .ejson, .m, .xml, .zip, etc.) or list of files (.xml, .zip) :return: MultiCircuit instance """ return FileOpen(file_name=filename).open() From f467c785005665aae4d32cd96a0d8cc9008b1533 Mon Sep 17 00:00:00 2001 From: Mate Zsebehazi Date: Fri, 5 Apr 2024 09:34:46 +0200 Subject: [PATCH 04/19] CGMES list cross associations fix --- src/GridCalEngine/IO/cim/cgmes/cgmes_circuit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GridCalEngine/IO/cim/cgmes/cgmes_circuit.py b/src/GridCalEngine/IO/cim/cgmes/cgmes_circuit.py index 4fdb2575d..d59a7b953 100644 --- a/src/GridCalEngine/IO/cim/cgmes/cgmes_circuit.py +++ b/src/GridCalEngine/IO/cim/cgmes/cgmes_circuit.py @@ -186,7 +186,7 @@ def find_attribute(referenced_object, obj, property_name, association_inverse_di if isinstance(obj, globals()[c_class]) and c_prop == property_name: i_class = str(inverse).split('.')[0] i_prop = str(inverse).split('.')[-1] - if isinstance(referenced_object, globals()[i_class]) and i_prop in referenced_object.get_all_properties(): + if isinstance(referenced_object, globals()[i_class]) and i_prop in vars(referenced_object): return i_prop else: continue From 67981fc5fde6806cc98af86816e4c147e3cb328a Mon Sep 17 00:00:00 2001 From: Mate Zsebehazi Date: Fri, 5 Apr 2024 09:35:41 +0200 Subject: [PATCH 05/19] Gridcal to CGMES Transformer2W conversion --- .../IO/cim/cgmes/cgmes_to_gridcal.py | 6 +- src/GridCalEngine/IO/cim/cgmes/cgmes_utils.py | 6 +- .../cgmes/cgmes_v2_4_15/devices/__init__.py | 2 + .../IO/cim/cgmes/gridcal_to_cgmes.py | 97 ++++++++++++++++--- 4 files changed, 92 insertions(+), 19 deletions(-) diff --git a/src/GridCalEngine/IO/cim/cgmes/cgmes_to_gridcal.py b/src/GridCalEngine/IO/cim/cgmes/cgmes_to_gridcal.py index 3bea8e4b1..2854347aa 100644 --- a/src/GridCalEngine/IO/cim/cgmes/cgmes_to_gridcal.py +++ b/src/GridCalEngine/IO/cim/cgmes/cgmes_to_gridcal.py @@ -628,7 +628,8 @@ def get_gcdev_ac_transformers(cgmes_model: CgmesCircuit, for cgmes_elm in device_list: - windings = get_windings(cgmes_elm) + windings = list(cgmes_elm.PowerTransformerEnd) + # windings = get_windings(cgmes_elm) # windings: List[PowerTransformerEnd] = list(cgmes_elm.references_to_me['PowerTransformerEnd']) if len(windings) == 2: @@ -763,9 +764,10 @@ def get_gcdev_ac_transformers(cgmes_model: CgmesCircuit, gcdev_elm.winding3.X0 = x0 gcdev_elm.winding3.G0 = g0 gcdev_elm.winding3.B0 = b0 - gcdev_model.add_transformer3w(gcdev_elm) gcdev_elm.winding3.rate = windings[2].ratedS + gcdev_model.add_transformer3w(gcdev_elm) + else: logger.add_error(msg='Not exactly three terminals', diff --git a/src/GridCalEngine/IO/cim/cgmes/cgmes_utils.py b/src/GridCalEngine/IO/cim/cgmes/cgmes_utils.py index 460055167..489eceb8f 100644 --- a/src/GridCalEngine/IO/cim/cgmes/cgmes_utils.py +++ b/src/GridCalEngine/IO/cim/cgmes/cgmes_utils.py @@ -74,7 +74,8 @@ def get_pu_values_power_transformer(power_transformer: PowerTransformer, System_ :return: """ try: - windings = get_windings(power_transformer) + # windings = get_windings(power_transformer) + windings = list(power_transformer.PowerTransformerEnd) R, X, G, B = 0, 0, 0, 0 R0, X0, G0, B0 = 0, 0, 0, 0 @@ -103,7 +104,8 @@ def get_pu_values_power_transformer3w(power_transformer: PowerTransformer, Syste :return: """ try: - windings = get_windings(power_transformer) + # windings = get_windings(power_transformer) + windings = list(power_transformer.PowerTransformerEnd) r12, r23, r31, x12, x23, x31 = 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 diff --git a/src/GridCalEngine/IO/cim/cgmes/cgmes_v2_4_15/devices/__init__.py b/src/GridCalEngine/IO/cim/cgmes/cgmes_v2_4_15/devices/__init__.py index 0cae8db7d..868e3847f 100644 --- a/src/GridCalEngine/IO/cim/cgmes/cgmes_v2_4_15/devices/__init__.py +++ b/src/GridCalEngine/IO/cim/cgmes/cgmes_v2_4_15/devices/__init__.py @@ -19,3 +19,5 @@ from GridCalEngine.IO.cim.cgmes.cgmes_v2_4_15.devices.ac_line_segment import ACLineSegment from GridCalEngine.IO.cim.cgmes.cgmes_v2_4_15.devices.regulating_cond_eq import RegulatingCondEq from GridCalEngine.IO.cim.cgmes.cgmes_v2_4_15.devices.regulating_control import RegulatingControl +from GridCalEngine.IO.cim.cgmes.cgmes_v2_4_15.devices.power_transformer import PowerTransformer +from GridCalEngine.IO.cim.cgmes.cgmes_v2_4_15.devices.power_transformer_end import PowerTransformerEnd diff --git a/src/GridCalEngine/IO/cim/cgmes/gridcal_to_cgmes.py b/src/GridCalEngine/IO/cim/cgmes/gridcal_to_cgmes.py index e0cac8bc6..db2b747f8 100644 --- a/src/GridCalEngine/IO/cim/cgmes/gridcal_to_cgmes.py +++ b/src/GridCalEngine/IO/cim/cgmes/gridcal_to_cgmes.py @@ -63,6 +63,34 @@ def find_object_by_attribute(object_list: List, target_attr_name, target_value): return None +def get_ohm_values_power_transformer(r, x, g, b, r0, x0, g0, b0, nominal_power, rated_voltage): + """ + Get the transformer ohm values + :return: + """ + try: + Sbase_system = 100 + Zbase = (rated_voltage * rated_voltage) / nominal_power + Ybase = 1.0 / Zbase + R, X, G, B = 0, 0, 0, 0 + R0, X0, G0, B0 = 0, 0, 0, 0 + machine_to_sys = Sbase_system / nominal_power + R = r * Zbase / machine_to_sys + X = x * Zbase / machine_to_sys + G = g * Ybase / machine_to_sys + B = b * Ybase / machine_to_sys + R0 = r0 * Zbase / machine_to_sys if r0 is not None else 0 + X0 = x0 * Zbase / machine_to_sys if x0 is not None else 0 + G0 = g0 * Ybase / machine_to_sys if g0 is not None else 0 + B0 = b0 * Ybase / machine_to_sys if b0 is not None else 0 + + except KeyError: + R, X, G, B = 0, 0, 0, 0 + R0, X0, G0, B0 = 0, 0, 0, 0 + + return R, X, G, B, R0, X0, G0, B0 + + # endregion # region create new classes for CC @@ -99,7 +127,6 @@ def create_cgmes_terminal(bus: Bus, def create_cgmes_load_response_char( load: gcdev.Load, logger: DataLogger) -> cgmes.LoadResponseCharacteristic: - new_rdf_id = get_new_rdfid() lrc = cgmes.LoadResponseCharacteristic(rdfid=new_rdf_id) # lrc.name = @@ -268,7 +295,6 @@ def get_cgmes_voltage_levels(multi_circuit_model: MultiCircuit, def get_cgmes_tn_nodes(multi_circuit_model: MultiCircuit, cgmes_model: CgmesCircuit, logger: DataLogger) -> None: - for bus in multi_circuit_model.buses: tn = cgmes.TopologicalNode(rdfid=bus.idtag) @@ -299,7 +325,6 @@ def get_cgmes_tn_nodes(multi_circuit_model: MultiCircuit, def get_cgmes_cn_nodes(multi_circuit_model: MultiCircuit, cgmes_model: CgmesCircuit, logger: DataLogger) -> None: - for mc_elm in multi_circuit_model.connectivity_nodes: cn = cgmes.ConnectivityNode(rdfid=form_rdfid(mc_elm.idtag)) @@ -313,7 +338,7 @@ def get_cgmes_cn_nodes(multi_circuit_model: MultiCircuit, if tn is not None: cn.TopologicalNode = tn cn.ConnectivityNodeContainer = tn.ConnectivityNodeContainer - tn.ConnectivityNodes = cn # link back + tn.ConnectivityNodes = cn # link back else: logger.add_error(msg='No TopologinalNode found', device=cn, @@ -440,7 +465,7 @@ def get_cgmes_ac_line_segments(multicircuit_model: MultiCircuit, object_list=cgmes_model.BaseVoltage_list, target_attr_name="nominalVoltage", target_value=mc_elm.get_max_bus_nominal_voltage() - ) # which Vnom we need? + ) # which Vnom we need? vnom = line.BaseVoltage.nominalVoltage if vnom is not None: @@ -463,13 +488,11 @@ def get_cgmes_ac_line_segments(multicircuit_model: MultiCircuit, def get_cgmes_operational_limits(multicircuit_model: MultiCircuit, cgmes_model: CgmesCircuit, logger: DataLogger): - # OperationalLimitSet and OperationalLimitType pass - def get_cgmes_current_limits(multicircuit_model: MultiCircuit, cgmes_model: CgmesCircuit, logger: DataLogger): @@ -508,7 +531,7 @@ def get_cgmes_generators(multicircuit_model: MultiCircuit, cgmes_syn.name = mc_elm.name # cgmes_syn.aggregate is optional, not exported # cgmes_syn.EquipmentContainer: VoltageLevel - #TODO implement control_node in MultiCircuit + # TODO implement control_node in MultiCircuit # has_control: do we have control # control_type: voltage or power control, .. # is_controlled: enabling flag (already have) @@ -518,7 +541,7 @@ def get_cgmes_generators(multicircuit_model: MultiCircuit, # cgmes_syn.ratedPowerFactor = cgmes_syn.ratedS = mc_elm.Snom - cgmes_syn.GeneratingUnit = cgmes_gen # linking them together + cgmes_syn.GeneratingUnit = cgmes_gen # linking them together cgmes_gen.RotatingMachine = cgmes_syn # linking them together cgmes_syn.maxQ = mc_elm.Qmax cgmes_syn.minQ = mc_elm.Qmin @@ -528,12 +551,56 @@ def get_cgmes_generators(multicircuit_model: MultiCircuit, cgmes_model.SynchronousMachine_list.append(cgmes_syn) -def get_cgmes_power_transformers(): - pass - +def get_cgmes_power_transformers(multicircuit_model: MultiCircuit, + cgmes_model: CgmesCircuit, + logger: DataLogger): + for mc_elm in multicircuit_model.transformers2w: + cm_transformer = cgmes.PowerTransformer(rdfid=form_rdfid(mc_elm.idtag)) + cm_transformer.uuid = mc_elm.idtag + cm_transformer.description = mc_elm.code + cm_transformer.name = mc_elm.name + cm_transformer.Terminals = [create_cgmes_terminal(mc_elm.bus_from, cgmes_model, logger), + create_cgmes_terminal(mc_elm.bus_to, cgmes_model, logger)] + + cm_transformer.PowerTransformerEnd = [] + pte1 = cgmes.PowerTransformerEnd() + pte1.PowerTransformer = cm_transformer + R, X, G, B, R0, X0, G0, B0 = (mc_elm.R, mc_elm.X, mc_elm.G, mc_elm.B, mc_elm.R0, + mc_elm.X0, mc_elm.G0, mc_elm.B0) + r, x, g, b, r0, x0, g0, b0 = get_ohm_values_power_transformer(R, X, G, B, R0, X0, G0, B0, mc_elm.Sn, mc_elm.HV) + pte1.r = r + pte1.x = x + pte1.g = g + pte1.b = b + pte1.r0 = r0 + pte1.x0 = x0 + pte1.g0 = g0 + pte1.b0 = b0 + pte1.ratedU = mc_elm.HV + pte1.ratedS = mc_elm.Sn + pte1.endNumber = 1 + + pte2 = cgmes.PowerTransformerEnd() + pte2.PowerTransformer = cm_transformer + pte2.r = 0 + pte2.x = 0 + pte2.g = 0 + pte2.b = 0 + pte2.r0 = 0 + pte2.x0 = 0 + pte2.g0 = 0 + pte2.b0 = 0 + pte2.ratedU = mc_elm.LV + pte2.ratedS = mc_elm.Sn + pte2.endNumber = 2 + + cm_transformer.PowerTransformerEnd.append(pte1) + cgmes_model.PowerTransformerEnd_list.append(pte1) + cm_transformer.PowerTransformerEnd.append(pte2) + cgmes_model.PowerTransformerEnd_list.append(pte2) + + cgmes_model.PowerTransformer_list.append(cm_transformer) -def get_cgmes_power_transformer_ends(): - pass # endregion @@ -566,7 +633,7 @@ def gridcal_to_cgmes(gc_model: MultiCircuit, logger: DataLogger) -> CgmesCircuit get_cgmes_ac_line_segments(gc_model, cgmes_model, logger) # transformers, windings - + get_cgmes_power_transformers(gc_model, cgmes_model, logger) # shunts return cgmes_model From 8fe4ef9c14e258b374a1207352d00124b3b1de7a Mon Sep 17 00:00:00 2001 From: santi Date: Fri, 5 Apr 2024 10:22:16 +0100 Subject: [PATCH 06/19] Added modelling authority, still unsure how to use it --- .idea/workspace.xml | 219 +- src/GridCal/Gui/Main/MainWindow.py | 1096 ++++--- src/GridCal/Gui/Main/MainWindow.ui | 2776 ++++++++--------- .../Gui/Main/SubClasses/Model/objects.py | 10 + .../Devices/Aggregation/__init__.py | 1 + .../Aggregation/modelling_authority.py | 35 + src/GridCalEngine/Devices/multi_circuit.py | 110 +- src/GridCalEngine/Devices/types.py | 11 +- src/GridCalEngine/IO/gridcal/pack_unpack.py | 5 +- src/GridCalEngine/enumerations.py | 2 + .../code_generation/new_circuit_objects.py | 27 +- 11 files changed, 2160 insertions(+), 2132 deletions(-) create mode 100644 src/GridCalEngine/Devices/Aggregation/modelling_authority.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b8a1946e7..412ebca78 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,34 +29,18 @@ - - - - - - - - - - - - + + + + + @@ -1780,7 +1773,6 @@ - @@ -1805,7 +1797,8 @@ - @@ -2278,9 +2271,14 @@ @@ -2435,7 +2433,7 @@ - + diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py index b5a380671..97b1d1058 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py +++ b/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py @@ -545,8 +545,9 @@ def __init__(self, self.displacement = QPoint() self.startPos: Union[QPoint, None] = None - self.pos_label = QGraphicsTextItem() - self.add_to_scene(self.pos_label) + # for graphics dev porpuses + # self.pos_label = QGraphicsTextItem() + # self.add_to_scene(self.pos_label) # current time index from the GUI (None or 0, 1, 2, ..., n-1) self._time_index: Union[None, int] = time_index @@ -1243,7 +1244,8 @@ def scene_mouse_move_event(self, event: QGraphicsSceneMouseEvent) -> None: pos = event.scenePos() self.started_branch.setEndPos(pos) - self.pos_label.setPlainText(f"{event.scenePos().x()}, {event.scenePos().y()}") + # for graphics dev porpuses + # self.pos_label.setPlainText(f"{event.scenePos().x()}, {event.scenePos().y()}") def scene_mouse_press_event(self, event: QGraphicsSceneMouseEvent) -> None: """ From 7a8f5fa4597a3fcdd9e0eb51316dae8610b0d4de Mon Sep 17 00:00:00 2001 From: santi Date: Fri, 5 Apr 2024 12:50:53 +0100 Subject: [PATCH 10/19] Implemented early CGMES boundary select from the GUI --- src/GridCal/Gui/Main/MainWindow.py | 80 +++++++++-- src/GridCal/Gui/Main/MainWindow.ui | 132 ++++++++++++++++++ .../Main/SubClasses/Settings/configuration.py | 59 +++++++- 3 files changed, 257 insertions(+), 14 deletions(-) diff --git a/src/GridCal/Gui/Main/MainWindow.py b/src/GridCal/Gui/Main/MainWindow.py index 3463f69cb..3507f1036 100644 --- a/src/GridCal/Gui/Main/MainWindow.py +++ b/src/GridCal/Gui/Main/MainWindow.py @@ -3627,6 +3627,7 @@ def setupUi(self, mainWindow): self.horizontalLayout_40.setObjectName(u"horizontalLayout_40") self.frame_77 = QFrame(self.tab_8) self.frame_77.setObjectName(u"frame_77") + self.frame_77.setMinimumSize(QSize(300, 0)) self.frame_77.setFrameShape(QFrame.NoFrame) self.frame_77.setFrameShadow(QFrame.Raised) self.verticalLayout_37 = QVBoxLayout(self.frame_77) @@ -3684,6 +3685,55 @@ def setupUi(self, mainWindow): self.horizontalLayout_40.addWidget(self.frame_77) + self.frame_79 = QFrame(self.tab_8) + self.frame_79.setObjectName(u"frame_79") + self.frame_79.setMinimumSize(QSize(300, 0)) + self.frame_79.setFrameShape(QFrame.NoFrame) + self.frame_79.setFrameShadow(QFrame.Raised) + self.gridLayout_5 = QGridLayout(self.frame_79) + self.gridLayout_5.setObjectName(u"gridLayout_5") + self.verticalSpacer_25 = QSpacerItem(20, 436, QSizePolicy.Minimum, QSizePolicy.Expanding) + + self.gridLayout_5.addItem(self.verticalSpacer_25, 5, 0, 1, 1) + + self.cgmes_boundary_set_label = QLabel(self.frame_79) + self.cgmes_boundary_set_label.setObjectName(u"cgmes_boundary_set_label") + + self.gridLayout_5.addWidget(self.cgmes_boundary_set_label, 3, 0, 1, 1) + + self.selectCGMESBoundarySetButton = QPushButton(self.frame_79) + self.selectCGMESBoundarySetButton.setObjectName(u"selectCGMESBoundarySetButton") + self.selectCGMESBoundarySetButton.setMaximumSize(QSize(80, 16777215)) + + self.gridLayout_5.addWidget(self.selectCGMESBoundarySetButton, 3, 1, 1, 1) + + self.label_90 = QLabel(self.frame_79) + self.label_90.setObjectName(u"label_90") + + self.gridLayout_5.addWidget(self.label_90, 2, 0, 1, 2) + + self.line_31 = QFrame(self.frame_79) + self.line_31.setObjectName(u"line_31") + palette42 = QPalette() + palette42.setBrush(QPalette.Active, QPalette.WindowText, brush2) + palette42.setBrush(QPalette.Inactive, QPalette.WindowText, brush2) + palette42.setBrush(QPalette.Disabled, QPalette.WindowText, brush1) + self.line_31.setPalette(palette42) + self.line_31.setFrameShadow(QFrame.Plain) + self.line_31.setLineWidth(4) + self.line_31.setFrameShape(QFrame.HLine) + + self.gridLayout_5.addWidget(self.line_31, 1, 0, 1, 2) + + self.label_134 = QLabel(self.frame_79) + self.label_134.setObjectName(u"label_134") + self.label_134.setFont(font2) + + self.gridLayout_5.addWidget(self.label_134, 0, 0, 1, 2) + + + self.horizontalLayout_40.addWidget(self.frame_79) + self.horizontalSpacer_27 = QSpacerItem(659, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.horizontalLayout_40.addItem(self.horizontalSpacer_27) @@ -3716,11 +3766,11 @@ def setupUi(self, mainWindow): self.label_69 = QLabel(self.frame_41) self.label_69.setObjectName(u"label_69") - palette42 = QPalette() - palette42.setBrush(QPalette.Active, QPalette.WindowText, brush3) - palette42.setBrush(QPalette.Inactive, QPalette.WindowText, brush3) - palette42.setBrush(QPalette.Disabled, QPalette.WindowText, brush1) - self.label_69.setPalette(palette42) + palette43 = QPalette() + palette43.setBrush(QPalette.Active, QPalette.WindowText, brush3) + palette43.setBrush(QPalette.Inactive, QPalette.WindowText, brush3) + palette43.setBrush(QPalette.Disabled, QPalette.WindowText, brush1) + self.label_69.setPalette(palette43) self.label_69.setFont(font2) self.label_69.setAlignment(Qt.AlignBottom|Qt.AlignLeading|Qt.AlignLeft) @@ -3731,11 +3781,11 @@ def setupUi(self, mainWindow): self.line_5 = QFrame(self.frame_7) self.line_5.setObjectName(u"line_5") - palette43 = QPalette() - palette43.setBrush(QPalette.Active, QPalette.WindowText, brush2) - palette43.setBrush(QPalette.Inactive, QPalette.WindowText, brush2) - palette43.setBrush(QPalette.Disabled, QPalette.WindowText, brush1) - self.line_5.setPalette(palette43) + palette44 = QPalette() + palette44.setBrush(QPalette.Active, QPalette.WindowText, brush2) + palette44.setBrush(QPalette.Inactive, QPalette.WindowText, brush2) + palette44.setBrush(QPalette.Disabled, QPalette.WindowText, brush1) + self.line_5.setPalette(palette44) self.line_5.setFrameShadow(QFrame.Plain) self.line_5.setLineWidth(4) self.line_5.setFrameShape(QFrame.HLine) @@ -4952,6 +5002,16 @@ def retranslateUi(self, mainWindow): self.saveResultsCheckBox.setToolTip(QCoreApplication.translate("mainWindow", u"If checked, the results are stored inside the gridcal file in a compressed format.", None)) #endif // QT_CONFIG(tooltip) self.saveResultsCheckBox.setText(QCoreApplication.translate("mainWindow", u"Save results in .gridcal files", None)) +#if QT_CONFIG(tooltip) + self.cgmes_boundary_set_label.setToolTip(QCoreApplication.translate("mainWindow", u"Path of the CGMES default boundary set (single zip file)", None)) +#endif // QT_CONFIG(tooltip) + self.cgmes_boundary_set_label.setText(QCoreApplication.translate("mainWindow", u"...", None)) +#if QT_CONFIG(tooltip) + self.selectCGMESBoundarySetButton.setToolTip(QCoreApplication.translate("mainWindow", u"Select the CGMES boundary set (single zip file)", None)) +#endif // QT_CONFIG(tooltip) + self.selectCGMESBoundarySetButton.setText(QCoreApplication.translate("mainWindow", u"Select", None)) + self.label_90.setText(QCoreApplication.translate("mainWindow", u"Boundary set", None)) + self.label_134.setText(QCoreApplication.translate("mainWindow", u"CGMES", None)) self.settings_tabWidget.setTabText(self.settings_tabWidget.indexOf(self.tab_8), QCoreApplication.translate("mainWindow", u"File", None)) self.label_68.setText("") self.label_69.setText(QCoreApplication.translate("mainWindow", u"General settings", None)) diff --git a/src/GridCal/Gui/Main/MainWindow.ui b/src/GridCal/Gui/Main/MainWindow.ui index 3c58c8e17..069abdc3a 100644 --- a/src/GridCal/Gui/Main/MainWindow.ui +++ b/src/GridCal/Gui/Main/MainWindow.ui @@ -7531,6 +7531,12 @@ + + + 300 + 0 + + QFrame::NoFrame @@ -7660,6 +7666,132 @@ + + + + + 300 + 0 + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + Qt::Vertical + + + + 20 + 436 + + + + + + + + Path of the CGMES default boundary set (single zip file) + + + ... + + + + + + + + 80 + 16777215 + + + + Select the CGMES boundary set (single zip file) + + + Select + + + + + + + Boundary set + + + + + + + + + + + + 186 + 189 + 182 + + + + + + + + + 186 + 189 + 182 + + + + + + + + + 190 + 190 + 190 + + + + + + + + QFrame::Plain + + + 4 + + + Qt::Horizontal + + + + + + + + 16 + + + + CGMES + + + + + + diff --git a/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py b/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py index ab2160178..d1fa7ad3a 100644 --- a/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py +++ b/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py @@ -49,6 +49,8 @@ def config_data_to_struct(data_, struct_): instance.setChecked(bool(data_[key])) elif isinstance(instance, QtWidgets.QRadioButton): instance.setChecked(bool(data_[key])) + elif isinstance(instance, str): + pass else: raise Exception('unknown structure') else: @@ -69,9 +71,14 @@ def __init__(self, parent=None): # create main window ResultsMain.__init__(self, parent) + self.current_boundary_set: str = "" + # check boxes self.ui.dark_mode_checkBox.clicked.connect(self.change_theme_mode) + # buttons + self.ui.selectCGMESBoundarySetButton.clicked.connect(self.select_cgmes_boundary_set) + def change_theme_mode(self) -> None: """ Change the GUI theme @@ -265,7 +272,8 @@ def get_config_structure(self) -> Dict[str, Dict[str, any]]: "contingency_massive_report": self.ui.contingency_detailed_massive_report_checkBox }, "file": { - "store_results_in_file": self.ui.saveResultsCheckBox + "store_results_in_file": self.ui.saveResultsCheckBox, + "current_boundary_set": self.current_boundary_set } } @@ -275,8 +283,9 @@ def get_gui_config_data(self) -> Dict[str, Dict[str, Union[float, int, str, bool :return: """ - def struct_to_data(data_: Dict[str, Union[float, int, str, bool, Dict[str, Union[float, int, str, bool, Dict]]]], - struct_: Dict[str, Dict[str, any]]): + def struct_to_data( + data_: Dict[str, Union[float, int, str, bool, Dict[str, Union[float, int, str, bool, Dict]]]], + struct_: Dict[str, Dict[str, any]]): """ Recursive function to get the config dictionary from the GUI values :param data_: Dictionary to fill @@ -296,8 +305,16 @@ def struct_to_data(data_: Dict[str, Union[float, int, str, bool, Dict[str, Union data_[key] = value.isChecked() elif isinstance(value, QtWidgets.QRadioButton): data_[key] = value.isChecked() + elif isinstance(value, str): + data_[key] = value + elif isinstance(value, int): + data_[key] = value + elif isinstance(value, float): + data_[key] = value + elif isinstance(value, bool): + data_[key] = value else: - raise Exception('unknown structure') + raise Exception(f'unknown structure {value}') struct = self.get_config_structure() data = dict() @@ -323,6 +340,22 @@ def apply_gui_config(self, data: dict): struct = self.get_config_structure() config_data_to_struct(data_=data, struct_=struct) + # CGMES boundary set + + """ + "file": { + "store_results_in_file": self.ui.saveResultsCheckBox, + "current_boundary_set": self.current_boundary_set + } + """ + + file_data = data.get("file", None) + if file_data is not None: + bd_path = file_data.get("current_boundary_set", "") + if os.path.exists(bd_path): + self.current_boundary_set = bd_path + self.ui.cgmes_boundary_set_label.setText(bd_path) + if self.ui.dark_mode_checkBox.isChecked(): set_dark_mode() else: @@ -342,3 +375,21 @@ def load_gui_config(self) -> None: print(e) self.save_gui_config() print("Config file was erroneous, wrote a new one") + + def select_cgmes_boundary_set(self): + """ + Select the current boundary set + """ + files_types = ("Boundary set (*.zip)") + + dialogue = QtWidgets.QFileDialog(None, + caption='Select Boundary set file', + directory=self.project_directory, + filter=files_types) + # dialogue.setOption(QtWidgets.QFileDialog.Option.DontUseNativeDialog, True) + + if dialogue.exec(): + filenames = dialogue.selectedFiles() + if len(filenames) > 0: + self.current_boundary_set = filenames[0] + self.ui.cgmes_boundary_set_label.setText(self.current_boundary_set) From 1f1f28baf2be1f519f9ef812c49e6ff8ef04b0e7 Mon Sep 17 00:00:00 2001 From: santi Date: Fri, 5 Apr 2024 13:58:23 +0100 Subject: [PATCH 11/19] Improved the save typing --- .idea/workspace.xml | 155 +++++++------- .../grids/Texas 2000 + VSC.gridcal | Bin 645546 -> 965924 bytes pics/GridCal.png | Bin 263041 -> 232645 bytes pics/GridCal4_icon.png | Bin 0 -> 43834 bytes pics/GridCal5_icon.svg | 189 ++++++++++++++++++ pics/GridCal_banner1.png | Bin 0 -> 19587 bytes pics/GridCal_black.png | Bin 0 -> 2715396 bytes pics/GridCal_icon.png | Bin 0 -> 79592 bytes .../Main/SubClasses/Settings/configuration.py | 18 +- src/GridCal/Gui/Main/SubClasses/base_gui.py | 2 + src/GridCal/Gui/Main/SubClasses/io.py | 21 +- src/GridCal/Session/file_handler.py | 31 ++- src/GridCalEngine/IO/file_handler.py | 29 ++- 13 files changed, 332 insertions(+), 113 deletions(-) create mode 100644 pics/GridCal4_icon.png create mode 100644 pics/GridCal5_icon.svg create mode 100644 pics/GridCal_banner1.png create mode 100644 pics/GridCal_black.png create mode 100644 pics/GridCal_icon.png diff --git a/.idea/workspace.xml b/.idea/workspace.xml index b7acf77cb..97b87b2c0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,11 +29,20 @@ - - - - - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -83,7 +170,7 @@ + - @@ -690,8 +777,8 @@ - + @@ -1391,7 +1478,9 @@ - + + + 1656059954202 @@ -1736,7 +1825,7 @@ - @@ -1782,7 +1871,6 @@ - @@ -1807,7 +1895,8 @@ - @@ -2234,11 +2323,6 @@ 998 @@ -2442,7 +2598,7 @@ - + @@ -2450,7 +2606,7 @@ - + diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/__init__.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/__init__.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/dc_line_graphics.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/dc_line_graphics.py index 8cc57ccfd..4bf84caaa 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/dc_line_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/dc_line_graphics.py @@ -21,14 +21,14 @@ from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu, QLabel, QDoubleSpinBox, QPushButton, QVBoxLayout, QComboBox, QDialog, QGraphicsScene from GridCal.Gui.GuiFunctions import get_list_model -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.line import SequenceLineType, OverheadLineType, UndergroundLineType from GridCalEngine.Devices.Branches.dc_line import DcLine from GridCalEngine.enumerations import DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class DcLineEditor(QDialog): @@ -232,7 +232,7 @@ class DcLineGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: DcLine = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/hvdc_graphics.py similarity index 91% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/hvdc_graphics.py index e62a20945..b01b013e2 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/hvdc_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/hvdc_graphics.py @@ -18,12 +18,12 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.hvdc_line import HvdcLine -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class HvdcGraphicItem(LineGraphicTemplateItem): @@ -31,7 +31,7 @@ class HvdcGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: HvdcLine = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_editor.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_editor.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_editor.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_editor.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics.py index 030c734ea..050e03f57 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics.py @@ -19,15 +19,15 @@ from PySide6.QtCore import Qt, QRectF from PySide6.QtGui import QPen, QIcon, QPixmap, QBrush from PySide6.QtWidgets import QMenu, QGraphicsRectItem, QGraphicsSceneContextMenuEvent -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_editor import LineEditor +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_editor import LineEditor from GridCal.Gui.messages import yes_no_question, warning_msg -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem from GridCalEngine.Devices.Branches.line import Line, SequenceLineType from GridCalEngine.enumerations import DeviceType if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class LineGraphicItem(LineGraphicTemplateItem): @@ -38,7 +38,7 @@ class LineGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem, None], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: Line = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py index babbfe808..f1bc8b0d9 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/line_graphics_template.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py @@ -22,12 +22,12 @@ from PySide6.QtGui import QPen, QCursor, QPixmap, QBrush, QColor, QTransform, QPolygonF from PySide6.QtWidgets import (QGraphicsLineItem, QGraphicsRectItem, QGraphicsPolygonItem, QGraphicsEllipseItem, QGraphicsSceneMouseEvent, QGraphicsTextItem) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, GenericDBWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.cn_graphics import CnGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.busbar_graphics import BusBarGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, GenericDBWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.bus_graphics import BusGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.cn_graphics import CnGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.busbar_graphics import BusBarGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem from GridCal.Gui.messages import yes_no_question from GridCalEngine.Devices.Substation.bus import Bus @@ -43,8 +43,8 @@ from GridCalEngine.Devices.Fluid.fluid_path import FluidPath if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem class ArrowHead(QGraphicsPolygonItem): @@ -416,7 +416,7 @@ class LineGraphicTemplateItem(GenericDBWidget, QGraphicsLineItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem, None], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: Union[Line, Transformer2W, VSC, UPFC, HvdcLine, DcLine, FluidPath, None] = None, arrow_size=10): @@ -890,7 +890,7 @@ def is_from_port_a_tr3(self) -> bool: """ if self._from_port: if 'Transformer3WGraphicItem' not in sys.modules: - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import \ + from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import \ Transformer3WGraphicItem return isinstance(self.get_terminal_from_parent(), Transformer3WGraphicItem) else: @@ -903,7 +903,7 @@ def is_to_port_a_tr3(self) -> bool: """ if self._to_port: if 'Transformer3WGraphicItem' not in sys.modules: - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import \ + from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import \ Transformer3WGraphicItem return isinstance(self.get_terminal_to_parent(), Transformer3WGraphicItem) else: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/series_reactance_graphics.py similarity index 91% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/series_reactance_graphics.py index 37d0bc4d3..7e681542f 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/series_reactance_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/series_reactance_graphics.py @@ -18,12 +18,12 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.series_reactance import SeriesReactance -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class SeriesReactanceGraphicItem(LineGraphicTemplateItem): @@ -31,7 +31,7 @@ class SeriesReactanceGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem], - editor: BusBranchEditorWidget, width=5, + editor: DiagramEditorWidget, width=5, api_object: SeriesReactance = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/switch_graphics.py similarity index 90% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/switch_graphics.py index 164f186b8..7c262306d 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/switch_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/switch_graphics.py @@ -18,19 +18,19 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.switch import Switch -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class SwitchGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem, None], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: Switch = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer2w_graphics.py similarity index 94% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer2w_graphics.py index 6684cad7f..ef5cece6b 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer2w_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer2w_graphics.py @@ -18,16 +18,16 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer_editor import (TransformerEditor, - reverse_transformer_short_circuit_study) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer_editor import (TransformerEditor, + reverse_transformer_short_circuit_study) from GridCalEngine.Devices.Branches.transformer import Transformer2W, TransformerType from GridCalEngine.enumerations import DeviceType if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class TransformerGraphicItem(LineGraphicTemplateItem): @@ -38,7 +38,7 @@ class TransformerGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem], - editor: BusBranchEditorWidget, width=5, + editor: DiagramEditorWidget, width=5, api_object: Transformer2W = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer3w_graphics.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer3w_graphics.py index 07884242b..a3b5b1032 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer3w_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer3w_graphics.py @@ -22,13 +22,13 @@ from PySide6.QtWidgets import QGraphicsItem, QGraphicsEllipseItem, QGraphicsRectItem, QMenu, QGraphicsSceneMouseEvent from GridCalEngine.Devices.Branches.transformer3w import Transformer3W -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.winding_graphics import WindingGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.winding_graphics import WindingGraphicItem from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class Transformer3WGraphicItem(QGraphicsRectItem): @@ -42,7 +42,7 @@ class Transformer3WGraphicItem(QGraphicsRectItem): - description """ - def __init__(self, editor: BusBranchEditorWidget, + def __init__(self, editor: DiagramEditorWidget, elm: Transformer3W, pos: QPoint = None, parent=None, diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer_editor.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer_editor.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/transformer_editor.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/transformer_editor.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/upfc_graphics.py similarity index 91% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/upfc_graphics.py index 401682b3b..fe17b2282 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/upfc_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/upfc_graphics.py @@ -18,18 +18,18 @@ from typing import TYPE_CHECKING from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem from GridCalEngine.Devices.Branches.upfc import UPFC -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class UpfcGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: BarTerminalItem, to_port: BarTerminalItem, - editor: BusBranchEditorWidget, width=5, + editor: DiagramEditorWidget, width=5, api_object: UPFC = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/vsc_graphics.py similarity index 91% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/vsc_graphics.py index 8f49c6116..fc04f2ab8 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/vsc_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/vsc_graphics.py @@ -18,12 +18,12 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCalEngine.Devices.Branches.vsc import VSC -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class VscGraphicItem(LineGraphicTemplateItem): @@ -34,7 +34,7 @@ class VscGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem], - editor: BusBranchEditorWidget, width=5, + editor: DiagramEditorWidget, width=5, api_object: VSC = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/winding_graphics.py similarity index 91% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/winding_graphics.py index 1b67a58b0..0bd09c3a6 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Branches/winding_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/winding_graphics.py @@ -20,13 +20,13 @@ from typing import TYPE_CHECKING, Union from PySide6.QtGui import QIcon, QPixmap from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem from GridCal.Gui.messages import yes_no_question from GridCalEngine.Devices.Branches.winding import Winding -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class WindingGraphicItem(LineGraphicTemplateItem): @@ -34,7 +34,7 @@ class WindingGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem, None], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=5, api_object: Winding = None): """ diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/__init__.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/__init__.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py index a755e244b..f5e5d9e01 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_node_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py @@ -28,15 +28,15 @@ from GridCalEngine.Devices.Parents.editable_device import EditableDevice from GridCalEngine.Devices.types import FLUID_TYPES -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, FONT_SCALE, GenericDBWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_turbine_graphics import FluidTurbineGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_pump_graphics import FluidPumpGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_p2x_graphics import FluidP2xGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, FONT_SCALE, GenericDBWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, HandleItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_turbine_graphics import FluidTurbineGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_pump_graphics import FluidPumpGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_p2x_graphics import FluidP2xGraphicItem from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class RoundedRect(QtWidgets.QGraphicsRectItem): @@ -92,7 +92,7 @@ class FluidNodeGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): - description """ - def __init__(self, editor: BusBranchEditorWidget, fluid_node: FluidNode, + def __init__(self, editor: DiagramEditorWidget, fluid_node: FluidNode, parent=None, index=0, h: int = 20, w: int = 80, x: int = 0, y: int = 0): GenericDBWidget.__init__(self, parent=parent, api_object=fluid_node, editor=editor, draw_labels=True) diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_p2x_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_p2x_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_p2x_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_p2x_graphics.py index d2c9260c8..2e28be1fa 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_p2x_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_p2x_graphics.py @@ -20,12 +20,12 @@ from PySide6.QtGui import QPen, QIcon, QPixmap from PySide6.QtWidgets import (QMenu, QGraphicsTextItem) from GridCalEngine.Devices.Fluid.fluid_p2x import FluidP2x -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class FluidP2xGraphicItem(InjectionTemplateGraphicItem): @@ -33,7 +33,7 @@ class FluidP2xGraphicItem(InjectionTemplateGraphicItem): FluidP2xGraphicItem """ - def __init__(self, parent, api_obj: FluidP2x, editor: "BusBranchEditorWidget"): + def __init__(self, parent, api_obj: FluidP2x, editor: "DiagramEditorWidget"): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_path_graphics.py similarity index 92% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_path_graphics.py index bcd935654..a0cb8ae63 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_path_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_path_graphics.py @@ -19,15 +19,15 @@ from PySide6.QtCore import Qt from PySide6.QtGui import QPen, QIcon, QPixmap, QColor from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import GenericDBWidget, ACTIVE +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import GenericDBWidget, ACTIVE from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem from GridCalEngine.Devices.Fluid.fluid_path import FluidPath from GridCalEngine.enumerations import DeviceType if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class FluidPathGraphicItem(LineGraphicTemplateItem): @@ -38,7 +38,7 @@ class FluidPathGraphicItem(LineGraphicTemplateItem): def __init__(self, from_port: Union[BarTerminalItem, RoundTerminalItem], to_port: Union[BarTerminalItem, RoundTerminalItem, None], - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, width=10, api_object: FluidPath = None, arrow_size=15): diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_pump_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_pump_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_pump_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_pump_graphics.py index 30ba2a4ca..107162a08 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_pump_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_pump_graphics.py @@ -20,12 +20,12 @@ from PySide6.QtGui import QPen, QIcon, QPixmap from PySide6.QtWidgets import (QMenu, QGraphicsTextItem) from GridCalEngine.Devices.Fluid.fluid_pump import FluidPump -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class FluidPumpGraphicItem(InjectionTemplateGraphicItem): @@ -33,7 +33,7 @@ class FluidPumpGraphicItem(InjectionTemplateGraphicItem): FluidPumpGraphicItem """ - def __init__(self, parent, api_obj: FluidPump, editor: "BusBranchEditorWidget"): + def __init__(self, parent, api_obj: FluidPump, editor: "DiagramEditorWidget"): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_turbine_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_turbine_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_turbine_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_turbine_graphics.py index 9d5f5f386..47e4de902 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Fluid/fluid_turbine_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_turbine_graphics.py @@ -19,12 +19,12 @@ from PySide6.QtGui import QPen, QIcon, QPixmap from PySide6.QtWidgets import (QMenu, QGraphicsTextItem, QGraphicsSceneMouseEvent) from GridCalEngine.Devices.Fluid.fluid_turbine import FluidTurbine -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class FluidTurbineGraphicItem(InjectionTemplateGraphicItem): @@ -32,7 +32,7 @@ class FluidTurbineGraphicItem(InjectionTemplateGraphicItem): FluidTurbineGraphicItem """ - def __init__(self, parent, api_obj: FluidTurbine, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: FluidTurbine, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/__init__.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/__init__.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/battery_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/battery_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/battery_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/battery_graphics.py index 0682a95e1..b356d0a0b 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/battery_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/battery_graphics.py @@ -18,18 +18,18 @@ from typing import TYPE_CHECKING from PySide6 import QtWidgets, QtGui from GridCalEngine.Devices.Injections.battery import Battery, DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.GuiFunctions import ObjectsModel from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class BatteryGraphicItem(InjectionTemplateGraphicItem): - def __init__(self, parent, api_obj: Battery, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: Battery, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/controllable_shunt_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/controllable_shunt_graphics.py similarity index 94% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/controllable_shunt_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/controllable_shunt_graphics.py index 340c9f27e..214ad2d87 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/controllable_shunt_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/controllable_shunt_graphics.py @@ -18,19 +18,19 @@ from typing import TYPE_CHECKING from PySide6 import QtWidgets, QtGui from GridCalEngine.Devices.Injections.controllable_shunt import ControllableShunt, DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class ControllableShuntGraphicItem(InjectionTemplateGraphicItem): """ ExternalGrid graphic item """ - def __init__(self, parent, api_obj: ControllableShunt, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: ControllableShunt, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/current_injection_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/current_injection_graphics.py similarity index 94% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/current_injection_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/current_injection_graphics.py index 8c30bb979..dc7a279b3 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/current_injection_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/current_injection_graphics.py @@ -18,19 +18,19 @@ from typing import TYPE_CHECKING from PySide6 import QtWidgets, QtGui, QtCore from GridCalEngine.Devices.Injections.current_injection import CurrentInjection, DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class CurrentInjectionGraphicItem(InjectionTemplateGraphicItem): """ ExternalGrid graphic item """ - def __init__(self, parent, api_obj: CurrentInjection, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: CurrentInjection, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/external_grid_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/external_grid_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/external_grid_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/external_grid_graphics.py index d96bdafdc..571031ed2 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/external_grid_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/external_grid_graphics.py @@ -18,20 +18,20 @@ from typing import TYPE_CHECKING from PySide6 import QtWidgets, QtGui, QtCore from GridCalEngine.Devices.Injections.external_grid import ExternalGrid, DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.GuiFunctions import ObjectsModel from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget import DiagramEditorWidget class ExternalGridGraphicItem(InjectionTemplateGraphicItem): """ ExternalGrid graphic item """ - def __init__(self, parent, api_obj: ExternalGrid, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: ExternalGrid, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/generator_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/generator_graphics.py similarity index 97% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/generator_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/generator_graphics.py index e23139cf4..5bac0791b 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/generator_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/generator_graphics.py @@ -24,15 +24,15 @@ from GridCalEngine.Devices.Injections.generator import Generator from GridCalEngine.Devices.Injections.generator_q_curve import GeneratorQCurve from GridCalEngine.basic_structures import Mat, Vec -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle -from GridCal.Gui.Diagrams.BusBranchEditorWidget.matplotlibwidget import MatplotlibWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Circle +from GridCal.Gui.Diagrams.DiagramEditorWidget.matplotlibwidget import MatplotlibWidget from GridCal.Gui.messages import yes_no_question, info_msg -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.SolarPowerWizard.solar_power_wizzard import SolarPvWizard from GridCal.Gui.WindPowerWizard.wind_power_wizzard import WindFarmWizard if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class GeneratorQCurveEditorTableModel(QAbstractTableModel): @@ -279,7 +279,7 @@ class GeneratorGraphicItem(InjectionTemplateGraphicItem): GeneratorGraphicItem """ - def __init__(self, parent, api_obj: Generator, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: Generator, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/injections_template_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/injections_template_graphics.py similarity index 95% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/injections_template_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/injections_template_graphics.py index 98b2a5c61..aab13fac1 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/injections_template_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/injections_template_graphics.py @@ -20,12 +20,12 @@ from PySide6.QtGui import QPen, QCursor from PySide6.QtWidgets import QGraphicsLineItem, QGraphicsItemGroup from GridCal.Gui.messages import yes_no_question, error_msg, warning_msg -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import GenericDBWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import GenericDBWidget from GridCalEngine.enumerations import DeviceType from GridCalEngine.Devices.types import INJECTION_DEVICE_TYPES if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class InjectionTemplateGraphicItem(GenericDBWidget, QGraphicsItemGroup): @@ -39,7 +39,7 @@ def __init__(self, device_type_name: str, w: int, h: int, - editor: BusBranchEditorWidget): + editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/load_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/load_graphics.py similarity index 92% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/load_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/load_graphics.py index 593327584..6118db8dc 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/load_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/load_graphics.py @@ -19,18 +19,18 @@ from PySide6.QtCore import QPointF from PySide6.QtGui import QPen, QIcon, QPixmap, QPolygonF from PySide6.QtWidgets import QMenu -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Polygon -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Polygon +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.messages import yes_no_question from GridCalEngine.Devices.Injections.load import Load if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class LoadGraphicItem(InjectionTemplateGraphicItem): - def __init__(self, parent, api_obj: Load, editor: BusBranchEditorWidget): + def __init__(self, parent, api_obj: Load, editor: DiagramEditorWidget): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/shunt_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/shunt_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/shunt_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/shunt_graphics.py index 023a7c093..d22031d21 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/shunt_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/shunt_graphics.py @@ -19,18 +19,18 @@ from PySide6 import QtWidgets from PySide6.QtCore import QPointF, QLineF from PySide6.QtGui import QPen, QIcon, QPixmap -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Line -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Line +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.messages import yes_no_question from GridCalEngine.Devices.Injections.shunt import Shunt if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class ShuntGraphicItem(InjectionTemplateGraphicItem): - def __init__(self, parent, api_obj: Shunt, editor: "BusBranchEditorWidget"): + def __init__(self, parent, api_obj: Shunt, editor: "DiagramEditorWidget"): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/static_generator_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/static_generator_graphics.py similarity index 94% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/static_generator_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/static_generator_graphics.py index bb49d6d37..731a7ade6 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Injections/static_generator_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Injections/static_generator_graphics.py @@ -19,17 +19,17 @@ from PySide6.QtGui import QPen, QIcon, QPixmap from PySide6.QtWidgets import QMenu, QGraphicsTextItem from GridCalEngine.Devices.Injections.static_generator import StaticGenerator, DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE, DEACTIVATED, OTHER, Square +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.injections_template_graphics import InjectionTemplateGraphicItem from GridCal.Gui.messages import yes_no_question if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class StaticGeneratorGraphicItem(InjectionTemplateGraphicItem): - def __init__(self, parent, api_obj: StaticGenerator, editor: "BusBranchEditorWidget"): + def __init__(self, parent, api_obj: StaticGenerator, editor: "DiagramEditorWidget"): """ :param parent: diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/__init__.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/__init__.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py similarity index 95% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py index 16ec5303a..3bebdf2b6 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/bus_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py @@ -23,21 +23,21 @@ from PySide6.QtWidgets import QMenu, QGraphicsSceneMouseEvent from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, - FONT_SCALE, EMERGENCY) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.load_graphics import LoadGraphicItem, Load -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, - StaticGenerator) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, - ExternalGrid) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.current_injection_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, + FONT_SCALE, EMERGENCY) +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, HandleItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.load_graphics import LoadGraphicItem, Load +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, + StaticGenerator) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, + ExternalGrid) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.current_injection_graphics import ( CurrentInjectionGraphicItem, CurrentInjection) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.controllable_shunt_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.controllable_shunt_graphics import ( ControllableShuntGraphicItem, ControllableShunt) @@ -47,7 +47,7 @@ from GridCalEngine.Devices.Substation import Bus if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class BusGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): @@ -64,7 +64,7 @@ class BusGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): def __init__(self, parent=None, index=0, - editor: BusBranchEditorWidget = None, + editor: DiagramEditorWidget = None, bus: Bus = None, h: int = 40, w: int = 80, diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/busbar_graphics.py similarity index 95% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/busbar_graphics.py index 219336417..b782ae549 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/busbar_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/busbar_graphics.py @@ -23,21 +23,21 @@ from PySide6.QtWidgets import QMenu, QGraphicsSceneMouseEvent from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, - FONT_SCALE, EMERGENCY) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, HandleItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.load_graphics import LoadGraphicItem, Load -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, - StaticGenerator) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, - ExternalGrid) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.current_injection_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, + FONT_SCALE, EMERGENCY) +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, HandleItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.load_graphics import LoadGraphicItem, Load +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, + StaticGenerator) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, + ExternalGrid) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.current_injection_graphics import ( CurrentInjectionGraphicItem, CurrentInjection) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.controllable_shunt_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.controllable_shunt_graphics import ( ControllableShuntGraphicItem, ControllableShunt) @@ -47,7 +47,7 @@ from GridCalEngine.Devices.Substation.busbar import BusBar if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class BusBarGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): @@ -64,7 +64,7 @@ class BusBarGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): def __init__(self, parent=None, index=0, - editor: BusBranchEditorWidget = None, + editor: DiagramEditorWidget = None, node: BusBar = None, h: int = 40, w: int = 80, diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/cn_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/cn_graphics.py similarity index 93% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/cn_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/cn_graphics.py index 252618b58..1b8f81b32 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/Substation/cn_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/cn_graphics.py @@ -23,21 +23,21 @@ from PySide6.QtWidgets import QMenu, QGraphicsSceneMouseEvent from GridCal.Gui.messages import yes_no_question -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, - FONT_SCALE, EMERGENCY) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.load_graphics import LoadGraphicItem, Load -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, - StaticGenerator) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, - ExternalGrid) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.current_injection_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import (GenericDBWidget, ACTIVE, DEACTIVATED, + FONT_SCALE, EMERGENCY) +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.load_graphics import LoadGraphicItem, Load +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.generator_graphics import GeneratorGraphicItem, Generator +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.static_generator_graphics import (StaticGeneratorGraphicItem, + StaticGenerator) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.battery_graphics import (BatteryGraphicItem, Battery) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.shunt_graphics import (ShuntGraphicItem, Shunt) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.external_grid_graphics import (ExternalGridGraphicItem, + ExternalGrid) +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.current_injection_graphics import ( CurrentInjectionGraphicItem, CurrentInjection) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.controllable_shunt_graphics import ( +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.controllable_shunt_graphics import ( ControllableShuntGraphicItem, ControllableShunt) @@ -47,7 +47,7 @@ from GridCalEngine.Devices.Substation.connectivity_node import ConnectivityNode if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget class CnGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): @@ -64,7 +64,7 @@ class CnGraphicItem(GenericDBWidget, QtWidgets.QGraphicsRectItem): def __init__(self, parent=None, index=0, - editor: BusBranchEditorWidget = None, + editor: DiagramEditorWidget = None, node: ConnectivityNode = None, h: int = 40, w: int = 40, diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/__init__.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/__init__.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/diagram_editor_widget.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/diagram_editor_widget.py index 97b1d1058..94f02ff09 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/bus_branch_editor_widget.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/diagram_editor_widget.py @@ -60,24 +60,24 @@ from GridCalEngine.Devices.types import BRANCH_TYPES from GridCal.Gui.Diagrams.graphics_manager import GraphicsManager -from GridCal.Gui.Diagrams.BusBranchEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.cn_graphics import CnGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.busbar_graphics import BusBarGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_path_graphics import FluidPathGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics import LineGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.winding_graphics import WindingGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.dc_line_graphics import DcLineGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer2w_graphics import TransformerGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.hvdc_graphics import HvdcGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.vsc_graphics import VscGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.upfc_graphics import UpfcGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.series_reactance_graphics import SeriesReactanceGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE +from GridCal.Gui.Diagrams.DiagramEditorWidget.terminal_item import BarTerminalItem, RoundTerminalItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.bus_graphics import BusGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.cn_graphics import CnGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.busbar_graphics import BusBarGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_path_graphics import FluidPathGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics import LineGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.winding_graphics import WindingGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.dc_line_graphics import DcLineGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer2w_graphics import TransformerGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.hvdc_graphics import HvdcGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.vsc_graphics import VscGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.upfc_graphics import UpfcGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.series_reactance_graphics import SeriesReactanceGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.generator_graphics import GeneratorGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE from GridCal.Gui.GeneralDialogues import InputNumberDialogue import GridCal.Gui.Visualization.visualization as viz import GridCal.Gui.Visualization.palettes as palettes @@ -88,7 +88,7 @@ ''' Structure: -{BusBranchEditorWidget: QSplitter} +{DiagramEditorWidget: QSplitter} | - .editor_graphics_view {QGraphicsView} (Handles the drag and drop) | @@ -110,7 +110,7 @@ class BusBranchLibraryModel(QStandardItemModel): This is the list of draggable items """ - def __init__(self, parent: "BusBranchEditorWidget" = None) -> None: + def __init__(self, parent: "DiagramEditorWidget" = None) -> None: """ Items model to host the draggable icons @param parent: @@ -231,7 +231,7 @@ class BusBranchDiagramScene(QGraphicsScene): This class is needed to augment the mouse move and release events """ - def __init__(self, parent: "BusBranchEditorWidget"): + def __init__(self, parent: "DiagramEditorWidget"): """ :param parent: @@ -450,9 +450,9 @@ def find_my_node(idtag_: str, return graphic_obj -class BusBranchEditorWidget(QSplitter): +class DiagramEditorWidget(QSplitter): """ - BusBranchEditorWidget + DiagramEditorWidget This is the bus-branch editor """ @@ -462,7 +462,7 @@ def __init__(self, default_bus_voltage: float = 10.0, time_index: Union[None, int] = None): """ - Creates the Diagram Editor (BusBranchEditorWidget) + Creates the Diagram Editor (DiagramEditorWidget) :param circuit: Circuit that is handling :param diagram: BusBranchDiagram to use (optional) :param default_bus_voltage: Default bus voltages (kV) @@ -545,6 +545,9 @@ def __init__(self, self.displacement = QPoint() self.startPos: Union[QPoint, None] = None + # for vecinity diagram porpuses + self.root_bus: Union[Bus, None] = None + # for graphics dev porpuses # self.pos_label = QGraphicsTextItem() # self.add_to_scene(self.pos_label) @@ -752,7 +755,8 @@ def create_fluid_node_graphics(self, node: FluidNode, x: int, y: int, h: int, w: graphic_object = FluidNodeGraphicItem(editor=self, fluid_node=node, x=x, y=y, h=h, w=w) return graphic_object - def create_connectivity_node_graphics(self, node: ConnectivityNode, x: int, y: int, h: int, w: int) -> CnGraphicItem: + def create_connectivity_node_graphics(self, node: ConnectivityNode, x: int, y: int, h: int, + w: int) -> CnGraphicItem: """ Add connectivity node to graphics :param node: GridCal connectivity node object @@ -1421,7 +1425,8 @@ def create_vsc(self, bus_from: Bus, bus_to: Bus, from_port: BarTerminalItem, to_ # set the connection placement graphic_object.setZValue(-1) - def create_fluid_path(self, source: FluidNode, target: FluidNode, from_port: BarTerminalItem, to_port: BarTerminalItem): + def create_fluid_path(self, source: FluidNode, target: FluidNode, from_port: BarTerminalItem, + to_port: BarTerminalItem): """ :param source: @@ -1465,7 +1470,8 @@ def create_branch_on_mouse_release_event(self, event: QGraphicsSceneMouseEvent) items = self.diagram_scene.items(event.scenePos()) # get the widgets at the mouse position for arriving_widget in items: - if isinstance(arriving_widget, Union[BarTerminalItem, RoundTerminalItem]): # arrivinf to a bus or bus-bar + if isinstance(arriving_widget, + Union[BarTerminalItem, RoundTerminalItem]): # arrivinf to a bus or bus-bar if arriving_widget.get_parent() is not self.started_branch.get_terminal_from_parent(): # forbid connecting to itself @@ -4205,11 +4211,123 @@ def generate_bus_branch_diagram(buses: List[Bus], return diagram + +def make_vecinity_diagram(circuit: MultiCircuit, root_bus: Bus, max_level: int = 1): + """ + Create a vecinity diagram + :param circuit: MultiCircuit + :param root_bus: Bus + :param max_level: max expansion level + :return: + """ + + branch_idx = list() + bus_idx = list() + + bus_dict = circuit.get_bus_index_dict() + + # get all Branches + all_branches = circuit.get_branches() + branch_dict = {b: i for i, b in enumerate(all_branches)} + + # create a pool of buses + bus_pool = [(root_bus, 0)] # store the bus objects and their level from the root + + buses = set() + fluid_nodes = set() + selected_branches = set() + + while len(bus_pool) > 0: + + # search the next bus + bus, level = bus_pool.pop() + + bus_idx.append(bus_dict[bus]) + + # add searched bus + buses.add(bus) + + if level < max_level: + + for i, br in enumerate(all_branches): + + if br.bus_from == bus: + bus_pool.append((br.bus_to, level + 1)) + selected_branches.add(br) + + elif br.bus_to == bus: + bus_pool.append((br.bus_from, level + 1)) + selected_branches.add(br) + + else: + pass + + # sort Branches + lines = list() + dc_lines = list() + transformers2w = list() + transformers3w = list() + windings = list() + hvdc_lines = list() + vsc_converters = list() + upfc_devices = list() + fluid_paths = list() + + for obj in selected_branches: + + branch_idx.append(branch_dict[obj]) + + if obj.device_type == DeviceType.LineDevice: + lines.append(obj) + + elif obj.device_type == DeviceType.DCLineDevice: + dc_lines.append(obj) + + elif obj.device_type == DeviceType.Transformer2WDevice: + transformers2w.append(obj) + + elif obj.device_type == DeviceType.Transformer3WDevice: + transformers3w.append(obj) + + elif obj.device_type == DeviceType.WindingDevice: + windings.append(obj) + + elif obj.device_type == DeviceType.HVDCLineDevice: + hvdc_lines.append(obj) + + elif obj.device_type == DeviceType.VscDevice: + vsc_converters.append(obj) + + elif obj.device_type == DeviceType.UpfcDevice: + upfc_devices.append(obj) + + else: + raise Exception('Unrecognized branch type ' + obj.device_type.value) + + # Draw schematic subset + diagram = generate_bus_branch_diagram(buses=list(buses), + lines=lines, + dc_lines=dc_lines, + transformers2w=transformers2w, + transformers3w=transformers3w, + windings=windings, + hvdc_lines=hvdc_lines, + vsc_devices=vsc_converters, + upfc_devices=upfc_devices, + fluid_nodes=list(fluid_nodes), + fluid_paths=fluid_paths, + explode_factor=1.0, + prog_func=None, + text_func=print, + name=root_bus.name + 'vecinity') + + return diagram + # if __name__ == "__main__": # from PySide6.QtWidgets import QApplication # app = QApplication(sys.argv) # -# window = BusBranchEditorWidget(circuit=MultiCircuit(), +# window = DiagramEditorWidget(circuit=MultiCircuit(), # diagram=BusBranchDiagram(), # default_bus_voltage=10.0) # diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/generic_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/generic_graphics.py similarity index 96% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/generic_graphics.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/generic_graphics.py index b49d44434..f7b025d94 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/generic_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/generic_graphics.py @@ -24,7 +24,7 @@ from GridCalEngine.Devices.types import ALL_DEV_TYPES if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget try: IS_DARK = darkdetect.theme() == "Dark" @@ -174,13 +174,13 @@ class GenericDBWidget: def __init__(self, parent, api_object: ALL_DEV_TYPES, - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, draw_labels: bool): """ Constructor :param parent: :param api_object: Any database object - :param editor: BusBranchEditorWidget + :param editor: DiagramEditorWidget :param draw_labels: """ @@ -188,7 +188,7 @@ def __init__(self, self.api_object: ALL_DEV_TYPES = api_object - self.editor: BusBranchEditorWidget = editor + self.editor: DiagramEditorWidget = editor self.draw_labels: bool = draw_labels diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/matplotlibwidget.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/matplotlibwidget.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/matplotlibwidget.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/matplotlibwidget.py diff --git a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/terminal_item.py similarity index 94% rename from src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py rename to src/GridCal/Gui/Diagrams/DiagramEditorWidget/terminal_item.py index 06a22efec..43a8ea420 100644 --- a/src/GridCal/Gui/Diagrams/BusBranchEditorWidget/terminal_item.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/terminal_item.py @@ -20,14 +20,14 @@ from PySide6.QtGui import QPen, QCursor from PySide6.QtWidgets import (QGraphicsRectItem, QGraphicsItem, QGraphicsEllipseItem, QGraphicsSceneMouseEvent) -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import ACTIVE +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import ACTIVE if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem - from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem + from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget + from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem + from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem + from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.bus_graphics import BusGraphicItem + from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem class BarTerminalItem(QGraphicsRectItem): @@ -37,7 +37,7 @@ class BarTerminalItem(QGraphicsRectItem): def __init__(self, name: str, - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, parent: Union[None, BusGraphicItem, Transformer3WGraphicItem, FluidNodeGraphicItem] = None, h=10.0, w=10.0): @@ -252,7 +252,7 @@ class RoundTerminalItem(QGraphicsEllipseItem): def __init__(self, name: str, - editor: BusBranchEditorWidget, + editor: DiagramEditorWidget, parent: Union[None, BusGraphicItem, Transformer3WGraphicItem, FluidNodeGraphicItem] = None, h=10.0, w=10.0): diff --git a/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py b/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py index 2fb78ddbd..09a1dd7b4 100644 --- a/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py +++ b/src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py @@ -30,6 +30,7 @@ from GridCalEngine.basic_structures import Vec, CxVec, IntVec from GridCalEngine.Devices.Substation.substation import Substation from GridCalEngine.Devices.Substation.voltage_level import VoltageLevel +from GridCalEngine.Devices.types import ALL_DEV_TYPES from GridCal.Gui.Diagrams.MapWidget.map_widget import MapWidget, PolylineData, Place import GridCal.Gui.Visualization.visualization as viz @@ -84,6 +85,10 @@ def set_diagram(self, diagram: MapDiagram): """ self.diagram = diagram + def delete_diagram_element(self, device: ALL_DEV_TYPES): + # TODO: Implement this + pass + @property def name(self): """ diff --git a/src/GridCal/Gui/Diagrams/diagrams_model.py b/src/GridCal/Gui/Diagrams/diagrams_model.py new file mode 100644 index 000000000..5d8d5fa5c --- /dev/null +++ b/src/GridCal/Gui/Diagrams/diagrams_model.py @@ -0,0 +1,83 @@ +from typing import Dict, List, Union, Any, Tuple, TYPE_CHECKING +from PySide6 import QtCore, QtWidgets, QtGui +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget +from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget + + +class DiagramsModel(QtCore.QAbstractListModel): + """ + Model for the diagrams + # from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerGUI + # from GridCal.Gui.DiagramEditorWidget import DiagramEditorWidget + # from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget + """ + + def __init__(self, list_of_diagrams: List[Union[DiagramEditorWidget, GridMapWidget]]): + """ + Enumeration model + :param list_of_diagrams: list of enumeration values to show + """ + QtCore.QAbstractListModel.__init__(self) + self.items = list_of_diagrams + + self.bus_branch_editor_icon = QtGui.QIcon() + self.bus_branch_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/schematic.svg")) + + self.bus_branch_vecinity_icon = QtGui.QIcon() + self.bus_branch_vecinity_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/grid_icon.svg")) + + self.map_editor_icon = QtGui.QIcon() + self.map_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/map.svg")) + + def flags(self, index: QtCore.QModelIndex): + """ + Get the display mode + :param index: + :return: + """ + return (QtCore.Qt.ItemFlag.ItemIsEditable | + QtCore.Qt.ItemFlag.ItemIsEnabled | + QtCore.Qt.ItemFlag.ItemIsSelectable) + + def rowCount(self, parent=QtCore.QModelIndex()) -> int: + """ + + :param parent: + :return: + """ + return len(self.items) + + def data(self, index: QtCore.QModelIndex, role=QtCore.Qt.ItemDataRole.DisplayRole): + """ + + :param index: + :param role: + :return: + """ + if index.isValid(): + + diagram = self.items[index.row()] + + if role == QtCore.Qt.ItemDataRole.DisplayRole: + return diagram.name + elif role == QtCore.Qt.ItemDataRole.DecorationRole: + + if isinstance(diagram, DiagramEditorWidget): + return self.bus_branch_editor_icon + elif isinstance(diagram, GridMapWidget): + return self.map_editor_icon + + return None + + def setData(self, index, value, role=None): + """ + Set data by simple editor (whatever text) + :param index: + :param value: + :param role: + :return: + """ + + self.items[index.row()].name = value + + return True diff --git a/src/GridCal/Gui/Diagrams/graphics_manager.py b/src/GridCal/Gui/Diagrams/graphics_manager.py index 508986a4b..861bbd156 100644 --- a/src/GridCal/Gui/Diagrams/graphics_manager.py +++ b/src/GridCal/Gui/Diagrams/graphics_manager.py @@ -20,20 +20,20 @@ from GridCalEngine.Devices.types import ALL_DEV_TYPES from GridCalEngine.enumerations import DeviceType -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Substation.bus_graphics import BusGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Fluid.fluid_path_graphics import FluidPathGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics import LineGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.winding_graphics import WindingGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.dc_line_graphics import DcLineGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer2w_graphics import TransformerGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.hvdc_graphics import HvdcGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.vsc_graphics import VscGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.upfc_graphics import UpfcGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.series_reactance_graphics import SeriesReactanceGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem -from GridCal.Gui.Diagrams.BusBranchEditorWidget.Injections.generator_graphics import GeneratorGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Substation.bus_graphics import BusGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_node_graphics import FluidNodeGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Fluid.fluid_path_graphics import FluidPathGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics import LineGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.winding_graphics import WindingGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.dc_line_graphics import DcLineGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer2w_graphics import TransformerGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.hvdc_graphics import HvdcGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.vsc_graphics import VscGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.upfc_graphics import UpfcGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.series_reactance_graphics import SeriesReactanceGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.line_graphics_template import LineGraphicTemplateItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Branches.transformer3w_graphics import Transformer3WGraphicItem +from GridCal.Gui.Diagrams.DiagramEditorWidget.Injections.generator_graphics import GeneratorGraphicItem ALL_BUS_BRACH_GRAPHICS = Union[ diff --git a/src/GridCal/Gui/GuiFunctions.py b/src/GridCal/Gui/GuiFunctions.py index f2fe003ae..40cc377eb 100644 --- a/src/GridCal/Gui/GuiFunctions.py +++ b/src/GridCal/Gui/GuiFunctions.py @@ -32,11 +32,6 @@ from GridCalEngine.Devices.Branches.line_locations import LineLocations from GridCalEngine.Devices.types import ALL_DEV_TYPES -if TYPE_CHECKING: # Only imports the below statements during type checking - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget - from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget - from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerWidget - class TreeDelegate(QtWidgets.QItemDelegate): """ @@ -2356,90 +2351,87 @@ def redo(self): self.update() -class DiagramsModel(QtCore.QAbstractListModel): - """ - Model for the diagrams - # from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerGUI - # from GridCal.Gui.BusBranchEditorWidget import BusBranchEditorWidget - # from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget - """ - - def __init__(self, list_of_diagrams: List[Union[BusBranchEditorWidget, GridMapWidget, BusViewerWidget]]): - """ - Enumeration model - :param list_of_diagrams: list of enumeration values to show - """ - QtCore.QAbstractListModel.__init__(self) - self.items = list_of_diagrams - - self.bus_branch_editor_icon = QtGui.QIcon() - self.bus_branch_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/schematic.svg")) - - self.bus_branch_vecinity_icon = QtGui.QIcon() - self.bus_branch_vecinity_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/grid_icon.svg")) - - self.map_editor_icon = QtGui.QIcon() - self.map_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/map.svg")) - - def flags(self, index: QtCore.QModelIndex): - """ - Get the display mode - :param index: - :return: - """ - return (QtCore.Qt.ItemFlag.ItemIsEditable | - QtCore.Qt.ItemFlag.ItemIsEnabled | - QtCore.Qt.ItemFlag.ItemIsSelectable) - - def rowCount(self, parent=QtCore.QModelIndex()) -> int: - """ - - :param parent: - :return: - """ - return len(self.items) - - def data(self, index: QtCore.QModelIndex, role=QtCore.Qt.ItemDataRole.DisplayRole): - """ - - :param index: - :param role: - :return: - """ - if index.isValid(): - - diagram = self.items[index.row()] - - if role == QtCore.Qt.ItemDataRole.DisplayRole: - return diagram.name - elif role == QtCore.Qt.ItemDataRole.DecorationRole: - - # TODO: Is this the only way? - from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget - from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget - from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerWidget - - if isinstance(diagram, BusBranchEditorWidget): - return self.bus_branch_editor_icon - elif isinstance(diagram, GridMapWidget): - return self.map_editor_icon - elif isinstance(diagram, BusViewerWidget): - return self.bus_branch_vecinity_icon - - return None - - def setData(self, index, value, role=None): - """ - Set data by simple editor (whatever text) - :param index: - :param value: - :param role: - :return: - """ - - self.items[index.row()].name = value - - return True +# class DiagramsModel(QtCore.QAbstractListModel): +# """ +# Model for the diagrams +# # from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerGUI +# # from GridCal.Gui.DiagramEditorWidget import DiagramEditorWidget +# # from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget +# """ +# +# def __init__(self, list_of_diagrams: List[Union[DiagramEditorWidget, GridMapWidget, BusViewerWidget]]): +# """ +# Enumeration model +# :param list_of_diagrams: list of enumeration values to show +# """ +# QtCore.QAbstractListModel.__init__(self) +# self.items = list_of_diagrams +# +# self.bus_branch_editor_icon = QtGui.QIcon() +# self.bus_branch_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/schematic.svg")) +# +# self.bus_branch_vecinity_icon = QtGui.QIcon() +# self.bus_branch_vecinity_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/grid_icon.svg")) +# +# self.map_editor_icon = QtGui.QIcon() +# self.map_editor_icon.addPixmap(QtGui.QPixmap(":/Icons/icons/map.svg")) +# +# def flags(self, index: QtCore.QModelIndex): +# """ +# Get the display mode +# :param index: +# :return: +# """ +# return (QtCore.Qt.ItemFlag.ItemIsEditable | +# QtCore.Qt.ItemFlag.ItemIsEnabled | +# QtCore.Qt.ItemFlag.ItemIsSelectable) +# +# def rowCount(self, parent=QtCore.QModelIndex()) -> int: +# """ +# +# :param parent: +# :return: +# """ +# return len(self.items) +# +# def data(self, index: QtCore.QModelIndex, role=QtCore.Qt.ItemDataRole.DisplayRole): +# """ +# +# :param index: +# :param role: +# :return: +# """ +# if index.isValid(): +# +# diagram = self.items[index.row()] +# +# if role == QtCore.Qt.ItemDataRole.DisplayRole: +# return diagram.name +# elif role == QtCore.Qt.ItemDataRole.DecorationRole: +# +# # TODO: Is this the only way? +# from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget +# from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget +# +# if isinstance(diagram, DiagramEditorWidget): +# return self.bus_branch_editor_icon +# elif isinstance(diagram, GridMapWidget): +# return self.map_editor_icon +# +# return None +# +# def setData(self, index, value, role=None): +# """ +# Set data by simple editor (whatever text) +# :param index: +# :param value: +# :param role: +# :return: +# """ +# +# self.items[index.row()].name = value +# +# return True def get_list_model(lst: List[Union[str, DeviceType]], checks=False, check_value=False) -> QtGui.QStandardItemModel: diff --git a/src/GridCal/Gui/Main/MainWindow.ui b/src/GridCal/Gui/Main/MainWindow.ui index 069abdc3a..dd4a5da3b 100644 --- a/src/GridCal/Gui/Main/MainWindow.ui +++ b/src/GridCal/Gui/Main/MainWindow.ui @@ -9274,15 +9274,6 @@ QProgressBar::chunk{ New diagram from selection - - - - :/Icons/icons/grid_icon.svg:/Icons/icons/grid_icon.svg - - - New bus vecinity diagram - - diff --git a/src/GridCal/Gui/Main/SubClasses/Model/diagrams.py b/src/GridCal/Gui/Main/SubClasses/Model/diagrams.py index 1996be3c2..2f143a17c 100644 --- a/src/GridCal/Gui/Main/SubClasses/Model/diagrams.py +++ b/src/GridCal/Gui/Main/SubClasses/Model/diagrams.py @@ -28,22 +28,24 @@ import GridCal.Gui.GuiFunctions as gf import GridCal.Gui.Visualization.palettes as palettes from GridCalEngine.IO.file_system import get_create_gridcal_folder -from GridCal.Gui.GeneralDialogues import CheckListDialogue, StartEndSelectionDialogue, InputSearchDialogue -from GridCal.Gui.Diagrams.BusViewer.bus_viewer_dialogue import BusViewerWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import (BusBranchEditorWidget, - BusGraphicItem, - generate_bus_branch_diagram) -from GridCal.Gui.Diagrams.NodeBreakerEditorWidget.node_breaker_editor_widget import NodeBreakerEditorWidget +from GridCal.Gui.GeneralDialogues import CheckListDialogue, StartEndSelectionDialogue, InputSearchDialogue, \ + InputNumberDialogue +from GridCalEngine.Devices.types import ALL_DEV_TYPES + +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import (DiagramEditorWidget, + BusGraphicItem, + generate_bus_branch_diagram, + make_vecinity_diagram) from GridCal.Gui.Diagrams.MapWidget.grid_map_widget import GridMapWidget, generate_map_diagram +from GridCal.Gui.Diagrams.diagrams_model import DiagramsModel from GridCal.Gui.messages import yes_no_question, error_msg, info_msg from GridCal.Gui.Main.SubClasses.Model.compiled_arrays import CompiledArraysMain from GridCal.Gui.Main.object_select_window import ObjectSelectWindow from GridCal.Gui.Diagrams.MapWidget.TileProviders.blue_marble import BlueMarbleTiles from GridCal.Gui.Diagrams.MapWidget.TileProviders.cartodb import CartoDbTiles -from GridCalEngine.Devices.types import ALL_DEV_TYPES -ALL_EDITORS = Union[BusBranchEditorWidget, GridMapWidget, BusViewerWidget, NodeBreakerEditorWidget] -ALL_EDITORS_NONE = Union[None, BusBranchEditorWidget, GridMapWidget, BusViewerWidget, NodeBreakerEditorWidget] +ALL_EDITORS = Union[DiagramEditorWidget, GridMapWidget] +ALL_EDITORS_NONE = Union[None, DiagramEditorWidget, GridMapWidget] class DiagramsMain(CompiledArraysMain): @@ -132,10 +134,7 @@ def __init__(self, parent=None): self.ui.actionAdd_general_bus_branch_diagram.triggered.connect(self.add_complete_bus_branch_diagram) self.ui.actionNew_bus_branch_diagram_from_selection.triggered.connect( self.new_bus_branch_diagram_from_selection) - self.ui.actionAdd_bus_vecinity_diagram.triggered.connect(self.add_bus_vecinity_diagram_from_diagram_selection) self.ui.actionAdd_map.triggered.connect(self.add_map_diagram) - self.ui.actionAdd_substation_diagram.triggered.connect(self.add_node_breaker_diagram) - # self.ui.actionRemove_selected_diagram.triggered.connect(self.remove_diagram) self.ui.actionBigger_nodes.triggered.connect(self.bigger_nodes) self.ui.actionSmaller_nodes.triggered.connect(self.smaller_nodes) self.ui.actionCenter_view.triggered.connect(self.center_nodes) @@ -176,7 +175,7 @@ def auto_layout(self): diagram_widget = self.get_selected_diagram_widget() if diagram_widget: - if isinstance(diagram_widget, BusBranchEditorWidget) or isinstance(diagram_widget, BusViewerWidget): + if isinstance(diagram_widget, DiagramEditorWidget): # guilty assumption do_it = True @@ -207,7 +206,7 @@ def bigger_nodes(self): """ diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget) or isinstance(diagram, BusViewerWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.expand_node_distances() diagram.center_nodes() @@ -217,7 +216,7 @@ def smaller_nodes(self): """ diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget) or isinstance(diagram, BusViewerWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.shrink_node_distances() diagram.center_nodes() @@ -228,7 +227,7 @@ def center_nodes(self): diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget) or isinstance(diagram, BusViewerWidget): + if isinstance(diagram, DiagramEditorWidget): selected = self.get_selected_buses() if len(selected) == 0: @@ -244,7 +243,7 @@ def get_selected_buses(self) -> List[Tuple[int, dev.Bus, BusGraphicItem]]: :return: list of (bus position, bus object, bus_graphics object) """ diagram_widget = self.get_selected_diagram_widget() - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): return diagram_widget.get_selected_buses() else: return list() @@ -255,7 +254,7 @@ def get_current_buses(self) -> List[Tuple[int, dev.Bus, BusGraphicItem]]: :return: list of (bus position, bus object, bus_graphics object) """ diagram_widget = self.get_selected_diagram_widget() - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): return diagram_widget.get_buses() else: return list() @@ -265,7 +264,7 @@ def explosion_factor_change(self): Change the node explosion factor """ for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.expand_factor = self.ui.explosion_factor_doubleSpinBox.value() def zoom_in(self): @@ -274,10 +273,11 @@ def zoom_in(self): """ diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): - diagram.editor_graphics_view.zoom_in() - elif isinstance(diagram, NodeBreakerEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.editor_graphics_view.zoom_in() + elif isinstance(diagram, GridMapWidget): + # TODO implement this + pass def zoom_out(self): """ @@ -285,10 +285,11 @@ def zoom_out(self): """ diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): - diagram.editor_graphics_view.zoom_out() - elif isinstance(diagram, NodeBreakerEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.editor_graphics_view.zoom_out() + elif isinstance(diagram, GridMapWidget): + # TODO implement this + pass def edit_time_interval(self): """ @@ -727,33 +728,27 @@ def colour_diagrams(self) -> None: for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): self.grid_colour_function(plot_function=diagram.colour_results, current_study=current_study, t_idx=t_idx) - elif isinstance(diagram, BusViewerWidget): - self.grid_colour_function(plot_function=diagram.colour_results, - current_study=current_study, - t_idx=t_idx) elif isinstance(diagram, GridMapWidget): self.grid_colour_function(plot_function=diagram.colour_results, current_study=current_study, t_idx=t_idx) - elif isinstance(diagram, NodeBreakerEditorWidget): - pass # this is not implemented yet def set_diagrams_list_view(self) -> None: """ Create the diagrams list view """ - mdl = gf.DiagramsModel(self.diagram_widgets_list) + mdl = DiagramsModel(self.diagram_widgets_list) self.ui.diagramsListView.setModel(mdl) def get_selected_diagram_widget(self) -> ALL_EDITORS_NONE: """ Get the currently selected diagram - :return: None, BusBranchEditorWidget, GridMapWidget, BusViewerGUI + :return: None, DiagramEditorWidget, GridMapWidget, BusViewerGUI """ indices = self.ui.diagramsListView.selectedIndexes() @@ -771,7 +766,7 @@ def redraw_current_diagram(self): if diagram_widget: - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): # set pointer to the circuit diagram = generate_bus_branch_diagram(buses=self.circuit.buses, lines=self.circuit.lines, @@ -800,10 +795,10 @@ def set_selected_diagram_on_click(self): if diagram: self.set_diagram_widget(diagram) - def add_complete_bus_branch_diagram_now(self, name='All bus branches') -> BusBranchEditorWidget: + def add_complete_bus_branch_diagram_now(self, name='All bus branches') -> DiagramEditorWidget: """ Add ageneral bus-branch diagram - :return BusBranchEditorWidget + :return DiagramEditorWidget """ diagram = generate_bus_branch_diagram(buses=self.circuit.get_buses(), lines=self.circuit.get_lines(), @@ -821,14 +816,14 @@ def add_complete_bus_branch_diagram_now(self, name='All bus branches') -> BusBra text_func=None, name=name) - diagram_widget = BusBranchEditorWidget(circuit=self.circuit, - diagram=diagram, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), - time_index=self.get_diagram_slider_index()) + diagram_widget = DiagramEditorWidget(circuit=self.circuit, + diagram=diagram, + default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), + time_index=self.get_diagram_slider_index()) diagram_widget.setStretchFactor(1, 10) diagram_widget.center_nodes() - self.add_diagram_widget(diagram_widget) + self.add_diagram_widget_and_diagram(diagram_widget=diagram_widget, diagram=diagram) self.set_diagrams_list_view() self.set_diagram_widget(diagram_widget) @@ -848,12 +843,15 @@ def new_bus_branch_diagram_from_selection(self): if diagram_widget: - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): diagram = diagram_widget.get_selection_diagram() - self.add_diagram_widget(BusBranchEditorWidget(self.circuit, - diagram=diagram, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), - time_index=self.get_diagram_slider_index())) + + diagram_widget = DiagramEditorWidget(self.circuit, + diagram=diagram, + default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), + time_index=self.get_diagram_slider_index()) + + self.add_diagram_widget_and_diagram(diagram_widget=diagram_widget, diagram=diagram) self.set_diagrams_list_view() def add_bus_vecinity_diagram_from_model(self): @@ -909,13 +907,25 @@ def add_bus_vecinity_diagram_from_model(self): root_bus = sel_obj.bus_from if root_bus is not None: - diagram = BusViewerWidget(circuit=self.circuit, - root_bus=root_bus, - name=root_bus.name + ' vecinity', - view_toolbar=False, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value()) - self.add_diagram_widget(diagram) - self.set_diagrams_list_view() + + dlg = InputNumberDialogue(min_value=1, max_value=99, + default_value=1, is_int=True, + title='Vecinity diagram', + text='Select the expansion level') + + if dlg.exec(): + diagram = make_vecinity_diagram(circuit=self.circuit, + root_bus=root_bus, + max_level=dlg.value) + + diagram_widget = DiagramEditorWidget(self.circuit, + diagram=diagram, + default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), + time_index=self.get_diagram_slider_index()) + + self.add_diagram_widget_and_diagram(diagram_widget=diagram_widget, + diagram=diagram) + self.set_diagrams_list_view() def create_circuit_stored_diagrams(self): """ @@ -928,10 +938,10 @@ def create_circuit_stored_diagrams(self): for diagram in self.circuit.diagrams: if isinstance(diagram, dev.BusBranchDiagram): - diagram_widget = BusBranchEditorWidget(self.circuit, - diagram=diagram, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), - time_index=self.get_diagram_slider_index()) + diagram_widget = DiagramEditorWidget(self.circuit, + diagram=diagram, + default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value(), + time_index=self.get_diagram_slider_index()) diagram_widget.setStretchFactor(1, 10) diagram_widget.center_nodes() self.diagram_widgets_list.append(diagram_widget) @@ -952,37 +962,11 @@ def create_circuit_stored_diagrams(self): # map_widget.GotoLevelAndPosition(5, -15.41, 40.11) self.diagram_widgets_list.append(map_widget) - elif isinstance(diagram, dev.NodeBreakerDiagram): - diagram_widget = NodeBreakerEditorWidget(self.circuit, - diagram=diagram, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value()) - diagram_widget.setStretchFactor(1, 10) - # diagram_widget.center_nodes() - self.diagram_widgets_list.append(diagram_widget) - else: raise Exception("Unknown diagram type") self.set_diagrams_list_view() - def add_bus_vecinity_diagram_from_diagram_selection(self): - """ - Add a bus vecinity diagram - :return: - """ - - sel_buses = self.get_selected_buses() - - if len(sel_buses): - bus_idx, root_bus, graphic_item = sel_buses[0] - diagram = BusViewerWidget(circuit=self.circuit, - root_bus=root_bus, - name=root_bus.name + ' vecinity', - view_toolbar=False, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value()) - self.add_diagram_widget(diagram) - self.set_diagrams_list_view() - def add_map_diagram(self) -> None: """ Adds a Map diagram @@ -1010,34 +994,24 @@ def add_map_diagram(self) -> None: name='Map diagram', diagram=diagram) - self.add_diagram_widget(map_widget) + self.add_diagram_widget_and_diagram(diagram_widget=map_widget, diagram=diagram) self.set_diagrams_list_view() self.set_diagram_widget(widget=map_widget) - def add_node_breaker_diagram(self): - """ - Add substation diagram - """ - - node_breaker_widget = NodeBreakerEditorWidget(circuit=self.circuit, - diagram=None, - default_bus_voltage=self.ui.defaultBusVoltageSpinBox.value()) - - self.add_diagram_widget(node_breaker_widget) - self.set_diagrams_list_view() - self.set_diagram_widget(widget=node_breaker_widget) - - def add_diagram_widget(self, diagram_widget: ALL_EDITORS): + def add_diagram_widget_and_diagram(self, + diagram_widget: ALL_EDITORS, + diagram: Union[dev.BusBranchDiagram, dev.MapDiagram]): """ Add diagram widget, it also adds the diagram to the circuit for later :param diagram_widget: Diagram widget object + :param diagram: BusBranchDiagram or MapDiagram """ # add the widget pointer self.diagram_widgets_list.append(diagram_widget) # add the diagram to the circuit - self.circuit.add_diagram(diagram_widget.diagram) + self.circuit.add_diagram(diagram) def remove_diagram(self): """ @@ -1087,7 +1061,7 @@ def remove_all_diagram_widgets(self) -> None: def set_diagram_widget(self, widget: ALL_EDITORS): """ Set the current diagram in the container - :param widget: BusBranchEditorWidget, GridMapWidget, BusViewerGUI + :param widget: DiagramEditorWidget, GridMapWidget, BusViewerGUI """ self.remove_all_diagram_widgets() @@ -1122,7 +1096,7 @@ def diagrams_time_slider_change(self) -> None: # modify the time index in all the bus-branch diagrams for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_time_index(time_index=idx2) # TODO: consider other diagrams @@ -1176,7 +1150,7 @@ def export_diagram(self): """ diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): # declare the allowed file types files_types = "Scalable Vector Graphics (*.svg);;Portable Network Graphics (*.png)" @@ -1204,7 +1178,7 @@ def set_xy_from_lat_lon(self): diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): if yes_no_question("All nodes in the current diagram will be positioned to a 2D plane projection " "of their latitude and longitude. " @@ -1221,7 +1195,7 @@ def set_big_bus_marker(self, buses: List[dev.Bus], color: QtGui.QColor): for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_big_bus_marker(buses=buses, color=color) def set_big_bus_marker_colours(self, @@ -1237,7 +1211,7 @@ def set_big_bus_marker_colours(self, for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_big_bus_marker_colours(buses=buses, colors=colors, tool_tips=tool_tips) @@ -1249,7 +1223,7 @@ def clear_big_bus_markers(self): for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.clear_big_bus_markers() def delete_selected_from_the_schematic(self): @@ -1258,7 +1232,7 @@ def delete_selected_from_the_schematic(self): """ diagram_widget = self.get_selected_diagram_widget() - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): diagram_widget.delete_Selected() else: pass @@ -1268,7 +1242,7 @@ def try_to_fix_buses_location(self): Try to fix the location of the buses """ diagram_widget = self.get_selected_diagram_widget() - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): selected_buses = diagram_widget.get_selected_buses() if len(selected_buses) > 0: diagram_widget.try_to_fix_buses_location(buses_selection=selected_buses) @@ -1283,12 +1257,10 @@ def get_selected_devices(self) -> List[ALL_DEV_TYPES]: diagram = self.get_selected_diagram_widget() - if isinstance(diagram, BusBranchEditorWidget): - lst = diagram.get_selection_api_objects() - elif isinstance(diagram, BusViewerWidget): - lst = diagram.get_selection_api_objects() - elif isinstance(diagram, NodeBreakerEditorWidget): + if isinstance(diagram, DiagramEditorWidget): lst = diagram.get_selection_api_objects() + elif isinstance(diagram, GridMapWidget): + lst = list() else: lst = list() @@ -1464,18 +1436,12 @@ def default_voltage_change(self): for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): - diagram.default_bus_voltage = val - - elif isinstance(diagram, BusViewerWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.default_bus_voltage = val elif isinstance(diagram, GridMapWidget): pass - elif isinstance(diagram, NodeBreakerEditorWidget): - pass - def delete_from_all_diagrams(self, elements: List[ALL_DEV_TYPES]): """ Delete elements from all editors @@ -1483,16 +1449,11 @@ def delete_from_all_diagrams(self, elements: List[ALL_DEV_TYPES]): :return: """ for diagram_widget in self.diagram_widgets_list: - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): diagram_widget.delete_diagram_elements(elements) - elif isinstance(diagram_widget, BusViewerWidget): - diagram_widget.grid_editor.delete_diagram_elements(elements) - elif isinstance(diagram_widget, GridMapWidget): pass - elif isinstance(diagram_widget, NodeBreakerEditorWidget): - pass def search_diagram(self): """ @@ -1508,7 +1469,7 @@ def search_diagram(self): diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.graphical_search(search_text=dlg.searchText.lower()) def show_diagrams_context_menu(self, pos: QtCore.QPoint): diff --git a/src/GridCal/Gui/Main/SubClasses/Model/objects.py b/src/GridCal/Gui/Main/SubClasses/Model/objects.py index 6ccd45df3..a1101a937 100644 --- a/src/GridCal/Gui/Main/SubClasses/Model/objects.py +++ b/src/GridCal/Gui/Main/SubClasses/Model/objects.py @@ -32,7 +32,7 @@ from GridCal.Gui.Main.SubClasses.Model.diagrams import DiagramsMain from GridCal.Gui.TowerBuilder.LineBuilderDialogue import TowerBuilderGUI from GridCal.Gui.GeneralDialogues import LogsDialogue -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget from GridCal.Gui.SystemScaler.system_scaler import SystemScaler @@ -468,7 +468,7 @@ def add_objects_to_current_diagram(self): diagram = self.get_selected_diagram_widget() - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): injections_by_bus = self.circuit.get_injection_devices_grouped_by_bus() injections_by_fluid_node = self.circuit.get_injection_devices_grouped_by_fluid_node() logger = bs.Logger() @@ -1043,6 +1043,16 @@ def show_objects_context_menu(self, pos: QtCore.QPoint): icon_path=":/Icons/icons/edit.svg", function_ptr=self.launch_object_editor) + gf.add_menu_entry(menu=context_menu, + text="Add", + icon_path=":/Icons/icons/plus.svg", + function_ptr=self.add_objects) + + gf.add_menu_entry(menu=context_menu, + text="Delete", + icon_path=":/Icons/icons/minus.svg", + function_ptr=self.delete_selected_objects) + context_menu.addSeparator() gf.add_menu_entry(menu=context_menu, diff --git a/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py b/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py index 6eae0c686..87d1d211b 100644 --- a/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py +++ b/src/GridCal/Gui/Main/SubClasses/Settings/configuration.py @@ -22,39 +22,58 @@ from GridCalEngine.IO.file_system import get_create_gridcal_folder from GridCal.Gui.Main.SubClasses.Results.results import ResultsMain -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import set_dark_mode, set_light_mode +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import set_dark_mode, set_light_mode -def config_data_to_struct(data_: Dict[str, Any], struct_: Dict[str, Any]) -> None: +def config_data_to_struct(data_: Dict[str, Union[Dict[str, Any], str, Any]], + struct_: Dict[str, Dict[str, Any]]) -> None: """ Recursive function to set the GUI objects' values from the config dictionary :param data_: config dictionary with values from the file :param struct_: result of self.get_config_structure() """ - for key, instance in struct_.items(): - if key in data_: - if isinstance(instance, dict): - config_data_to_struct(data_[key], instance) - elif isinstance(instance, QtWidgets.QComboBox): - val = data_[key] - index = instance.findText(val) - if -1 < index < instance.count(): - instance.setCurrentIndex(index) - elif isinstance(instance, QtWidgets.QDoubleSpinBox): - instance.setValue(float(data_[key])) - elif isinstance(instance, QtWidgets.QSpinBox): - instance.setValue(int(data_[key])) - elif isinstance(instance, QtWidgets.QCheckBox): - instance.setChecked(bool(data_[key])) - elif isinstance(instance, QtWidgets.QRadioButton): - instance.setChecked(bool(data_[key])) - elif isinstance(instance, str): + for key, object_to_set in struct_.items(): + + # get the value in data_ that corresponds to the object to be set + corresponding_data = data_.get(key, None) + + if corresponding_data is not None: + + print("config debug:", key, corresponding_data) + + if isinstance(object_to_set, dict): + config_data_to_struct(corresponding_data, object_to_set) + + elif isinstance(object_to_set, QtWidgets.QComboBox): + index = object_to_set.findText(corresponding_data) + if -1 < index < object_to_set.count(): + object_to_set.setCurrentIndex(index) + + elif isinstance(object_to_set, QtWidgets.QDoubleSpinBox): + object_to_set.setValue(float(corresponding_data)) + + elif isinstance(object_to_set, QtWidgets.QSpinBox): + object_to_set.setValue(int(corresponding_data)) + + elif isinstance(object_to_set, QtWidgets.QCheckBox): + object_to_set.setChecked(bool(corresponding_data)) + + elif isinstance(object_to_set, QtWidgets.QRadioButton): + object_to_set.setChecked(bool(corresponding_data)) + + elif isinstance(object_to_set, str): + pass + elif isinstance(object_to_set, float): + pass + elif isinstance(object_to_set, int): + pass + elif isinstance(object_to_set, bool): pass else: raise Exception('unknown structure') else: - print(key) + print(f"{key} has no entry in config") class ConfigurationMain(ResultsMain): @@ -93,7 +112,7 @@ def change_theme_mode(self) -> None: diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_dark_mode() self.colour_diagrams() @@ -109,7 +128,7 @@ def change_theme_mode(self) -> None: diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_light_mode() self.colour_diagrams() diff --git a/src/GridCal/Gui/Main/SubClasses/base_gui.py b/src/GridCal/Gui/Main/SubClasses/base_gui.py index ca93aefae..b4d205665 100644 --- a/src/GridCal/Gui/Main/SubClasses/base_gui.py +++ b/src/GridCal/Gui/Main/SubClasses/base_gui.py @@ -58,7 +58,7 @@ from GridCal.Gui.TowerBuilder.LineBuilderDialogue import TowerBuilderGUI from GridCal.Gui.GeneralDialogues import clear_qt_layout from GridCal.Gui.ConsoleWidget import ConsoleWidget -from GridCal.Gui.Diagrams.BusBranchEditorWidget.generic_graphics import IS_DARK +from GridCal.Gui.Diagrams.DiagramEditorWidget.generic_graphics import IS_DARK from GridCal.templates import (get_cables_catalogue, get_transformer_catalogue, get_wires_catalogue, get_sequence_lines_catalogue) diff --git a/src/GridCal/Gui/Main/SubClasses/io.py b/src/GridCal/Gui/Main/SubClasses/io.py index 26e7cf8fa..baede1661 100644 --- a/src/GridCal/Gui/Main/SubClasses/io.py +++ b/src/GridCal/Gui/Main/SubClasses/io.py @@ -27,7 +27,7 @@ from GridCalEngine.Devices.multi_circuit import MultiCircuit from GridCal.Gui.CoordinatesInput.coordinates_dialogue import CoordinatesInputGUI from GridCal.Gui.GeneralDialogues import LogsDialogue, CustomQuestionDialogue -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget from GridCal.Gui.messages import yes_no_question, error_msg, warning_msg, info_msg from GridCal.Gui.GridGenerator.grid_generator_dialogue import GridGeneratorGUI from GridCal.Gui.RosetaExplorer.RosetaExplorer import RosetaExplorerGUI @@ -342,8 +342,9 @@ def post_open_file(self) -> None: self.ui.diskSessionsTreeView.setModel(mdl) # apply the GUI settings if found: - if 'gui_config' in self.open_file_thread_object.json_files: - self.apply_gui_config(data=self.open_file_thread_object.json_files['gui_config']) + gui_config_data = self.open_file_thread_object.json_files.get('gui_config', None) + if gui_config_data is not None: + self.apply_gui_config(data=gui_config_data) # clear the results self.clear_results() @@ -371,7 +372,7 @@ def post_open_file(self) -> None: # center nodes diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.center_nodes() self.collect_memory() @@ -422,7 +423,7 @@ def post_add_circuit(self): # add to schematic if diagram_widget is not None: - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): injections_by_bus = self.circuit.get_injection_devices_grouped_by_bus() injections_by_fluid_node = self.circuit.get_injection_devices_grouped_by_fluid_node() diagram_widget.add_elements_to_schematic(buses=new_circuit.buses, @@ -509,6 +510,27 @@ def save_file(self): # save directly self.save_file_now(self.file_name) + def get_file_save_options(self) -> filedrv.FileSavingOptions: + """ + Compose the file saving options + :return: FileSavingOptions + """ + + if self.ui.saveResultsCheckBox.isChecked(): + sessions = [self.session] + else: + sessions = list() + + # get json files to store + json_files = {"gui_config": self.get_gui_config_data()} + + options = filedrv.FileSavingOptions(cgmes_boundary_set=self.current_boundary_set, + simulation_drivers=self.get_simulations(), + sessions=sessions, + dictionary_of_json_files=json_files) + + return options + def save_file_now(self, filename): """ Save the file right now, without questions @@ -526,22 +548,9 @@ def save_file_now(self, filename): if ok: self.save_file_thread_object.quit() - simulation_drivers = self.get_simulations() - - if self.ui.saveResultsCheckBox.isChecked(): - sessions = [self.session] - else: - sessions = [] - - # get json files to store - json_files = {"gui_config": self.get_gui_config_data(), - "cgmes_boundary_set": self.current_boundary_set} - self.save_file_thread_object = filedrv.FileSaveThread(circuit=self.circuit, file_name=filename, - simulation_drivers=simulation_drivers, - sessions=sessions, - extra_info=json_files) + options=self.get_file_save_options()) # make connections self.save_file_thread_object.progress_signal.connect(self.ui.progressBar.setValue) @@ -609,7 +618,7 @@ def grid_generator(self): # set circuit name diagram = self.get_selected_diagram_widget() if diagram is not None: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.name.setText(f"Random grid {self.circuit.get_bus_number()} buses") # set base magnitudes diff --git a/src/GridCal/Gui/Main/SubClasses/simulations.py b/src/GridCal/Gui/Main/SubClasses/simulations.py index d434e3225..f8e1b04ba 100644 --- a/src/GridCal/Gui/Main/SubClasses/simulations.py +++ b/src/GridCal/Gui/Main/SubClasses/simulations.py @@ -29,7 +29,7 @@ import GridCalEngine.Simulations.PowerFlow.grid_analysis as grid_analysis import GridCal.Gui.GuiFunctions as gf import GridCal.Gui.Visualization.visualization as viz -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget +from GridCal.Gui.Diagrams.DiagramEditorWidget.diagram_editor_widget import DiagramEditorWidget from GridCalEngine.Compilers.circuit_to_newton_pa import get_newton_mip_solvers_list from GridCalEngine.Simulations.driver_types import SimulationTypes from GridCal.Gui.messages import yes_no_question, error_msg, warning_msg, info_msg @@ -220,7 +220,7 @@ def get_simulations(self): # # set the threads so that the diagram scene objects can plot them for diagram in self.diagram_widgets_list: - if isinstance(diagram, BusBranchEditorWidget): + if isinstance(diagram, DiagramEditorWidget): diagram.set_results_to_plot(all_threads) return all_threads @@ -806,7 +806,7 @@ def run_short_circuit(self): for diagram_widget in self.diagram_widgets_list: - if isinstance(diagram_widget, BusBranchEditorWidget): + if isinstance(diagram_widget, DiagramEditorWidget): for i, bus, graphic_object in diagram_widget.get_buses(): if graphic_object.any_short_circuit(): diff --git a/src/GridCal/Session/file_handler.py b/src/GridCal/Session/file_handler.py index 4778b1e1f..fb8d71e81 100644 --- a/src/GridCal/Session/file_handler.py +++ b/src/GridCal/Session/file_handler.py @@ -15,14 +15,13 @@ # along with this program; if not, write to the Free Software Foundation, # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. import os -from typing import Union, List, Dict, Any +from typing import Union, List, Dict from PySide6.QtCore import QThread, Signal from GridCal.Session.session import SimulationSession -from GridCalEngine.Simulations.driver_template import DriverTemplate from GridCalEngine.basic_structures import Logger from GridCalEngine.IO.gridcal.zip_interface import get_session_tree, load_session_driver_objects -from GridCalEngine.IO.file_handler import FileOpen, FileSave +from GridCalEngine.IO.file_handler import FileOpen, FileSave, FileSavingOptions from GridCalEngine.Devices.multi_circuit import MultiCircuit from GridCalEngine.IO.cim.cgmes.cgmes_circuit import CgmesCircuit from GridCalEngine.data_logger import DataLogger @@ -59,7 +58,7 @@ def __init__(self, file_name: Union[str, List[str]]): self.__cancel__ = False - def get_session_tree(self): + def get_session_tree(self) -> Dict[str, Union[SimulationSession]]: """ Get the session tree structure from a GridCal file :return: @@ -81,13 +80,15 @@ def load_session_objects(self, session_name: str, study_name: str): """ if isinstance(self.file_name, str): if self.file_name.endswith('.gridcal'): - return load_session_driver_objects(self.file_name, session_name, study_name) + return load_session_driver_objects(file_name_zip=self.file_name, + session_name=session_name, + study_name=study_name) else: return dict() else: return dict() - def run(self): + def run(self) -> None: """ run the file open procedure """ @@ -120,7 +121,10 @@ def run(self): self.done_signal.emit() - def cancel(self): + def cancel(self) -> None: + """ + Set the cancel flag + """ self.__cancel__ = True @@ -135,16 +139,12 @@ class FileSaveThread(QThread): def __init__(self, circuit: MultiCircuit, file_name: str, - simulation_drivers: List[DriverTemplate] = None, - sessions: List[SimulationSession] = None, - extra_info: Dict[str, Any] = None): + options: FileSavingOptions): """ Constructor :param circuit: MultiCircuit instance :param file_name: name of the file where to save - :param simulation_drivers: List of Simulation Drivers - :param sessions: List of SimulationSession - :param extra_info: Dictionary of extra information that needs to be passed to the driver + :param options: FileSavingOptions """ QThread.__init__(self) @@ -154,11 +154,7 @@ def __init__(self, self.valid = False - self.simulation_drivers = simulation_drivers if simulation_drivers is not None else list() - - self.sessions = sessions if sessions is not None else list() - - self.extra_info = extra_info if extra_info is not None else dict() + self.options = options self.logger = Logger() @@ -206,13 +202,11 @@ def run(self) -> None: self.logger = Logger() - file_handler = FileSave(self.circuit, - self.file_name, + file_handler = FileSave(circuit=self.circuit, + file_name=self.file_name, + options=self.options, text_func=self.progress_text.emit, - progress_func=self.progress_signal.emit, - simulation_drivers=self.simulation_drivers, - sessions=self.sessions, - extra_info=self.extra_info) + progress_func=self.progress_signal.emit) try: self.logger = file_handler.save() except PermissionError: diff --git a/src/GridCalEngine/IO/file_handler.py b/src/GridCalEngine/IO/file_handler.py index a189b6767..1a8fa45cb 100644 --- a/src/GridCalEngine/IO/file_handler.py +++ b/src/GridCalEngine/IO/file_handler.py @@ -29,9 +29,8 @@ from GridCalEngine.IO.cim.cim16.cim_parser import CIMExport from GridCalEngine.IO.gridcal.excel_interface import save_excel, load_from_xls, interpret_excel_v3, interprete_excel_v2 from GridCalEngine.IO.gridcal.pack_unpack import gather_model_as_data_frames, parse_gridcal_data, gather_model_as_jsons -from GridCalEngine.IO.matpower.matpower_parser import interpret_data_v1 +from GridCalEngine.IO.matpower.matpower_parser import interpret_data_v1, parse_matpower_file from GridCalEngine.IO.dgs.dgs_parser import dgs_to_circuit -from GridCalEngine.IO.matpower.matpower_parser import parse_matpower_file from GridCalEngine.IO.others.dpx_parser import load_dpx from GridCalEngine.IO.others.ipa_parser import load_iPA from GridCalEngine.IO.gridcal.json_parser import parse_json, parse_json_data_v2, parse_json_data_v3 @@ -50,6 +49,32 @@ from GridCalEngine.Devices.multi_circuit import MultiCircuit +class FileSavingOptions: + """ + This class is to store the extra stuff that needs to be passed to save more complex files + """ + def __init__(self, + cgmes_boundary_set: str = "", + simulation_drivers: List[DriverTemplate] = None, + sessions: List[Any] = None, + dictionary_of_json_files: Dict[str, Dict[str, Any]] = None): + """ + Constructor + :param cgmes_boundary_set: CGMES boundary set zip file path + :param simulation_drivers: List of Simulation Drivers + :param sessions: List of sessions + :param dictionary_of_json_files: Dictionary of json files + """ + + self.cgmes_boundary_set: str = cgmes_boundary_set + + self.simulation_drivers = simulation_drivers if simulation_drivers else list() + + self.sessions = sessions if sessions else list() + + self.dictionary_of_json_files = dictionary_of_json_files if dictionary_of_json_files else dict() + + class FileOpen: """ File open interface @@ -286,31 +311,23 @@ class FileSave: def __init__(self, circuit: MultiCircuit, - file_name, + file_name: str, + options: FileSavingOptions = FileSavingOptions(), text_func=None, - progress_func=None, - simulation_drivers: List[DriverTemplate] = None, - sessions: List[Any] = None, - extra_info: Dict[str, Any] = None): + progress_func=None): """ File saver :param circuit: MultiCircuit :param file_name: file name to save to + :param options: FileSavingOptions :param text_func: Pointer to the text function :param progress_func: Pointer to the progress function - :param simulation_drivers: List of Simulation Drivers - :param sessions: List of sessions - :param extra_info: Dictionary of json files """ self.circuit = circuit self.file_name = file_name - self.simulation_drivers = simulation_drivers if simulation_drivers else list() - - self.sessions = sessions if sessions else list() - - self.extra_info = extra_info if extra_info else dict() + self.options = options self.text_func = text_func @@ -383,9 +400,9 @@ def save_zip(self) -> Logger: save_gridcal_data_to_zip(dfs=dfs, filename_zip=self.file_name, model_data=model_data, - sessions=self.sessions, + sessions=self.options.sessions, diagrams=self.circuit.diagrams, - json_files=self.extra_info, + json_files=self.options.dictionary_of_json_files, text_func=self.text_func, progress_func=self.progress_func, logger=logger) @@ -415,7 +432,9 @@ def save_json_v3(self) -> Logger: :return:logger with information """ - logger = save_json_file_v3(self.file_name, self.circuit, self.simulation_drivers) + logger = save_json_file_v3(self.file_name, + self.circuit, + self.options.simulation_drivers) return logger def save_cim(self): diff --git a/src/GridCal/Gui/Diagrams/BusViewer/__init__.py b/src/trunk/BusViewer/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/__init__.py rename to src/trunk/BusViewer/__init__.py diff --git a/src/GridCal/Gui/Diagrams/BusViewer/bus_viewer_dialogue.py b/src/trunk/BusViewer/bus_viewer_dialogue.py similarity index 95% rename from src/GridCal/Gui/Diagrams/BusViewer/bus_viewer_dialogue.py rename to src/trunk/BusViewer/bus_viewer_dialogue.py index bc72bf9f2..17520d787 100644 --- a/src/GridCal/Gui/Diagrams/BusViewer/bus_viewer_dialogue.py +++ b/src/trunk/BusViewer/bus_viewer_dialogue.py @@ -19,15 +19,18 @@ from typing import List, Union from GridCal.Gui.Diagrams.BusViewer.gui import Ui_BusViewerWindow, QMainWindow -from GridCal.Gui.Diagrams.BusBranchEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget, generate_bus_branch_diagram +from GridCal.Gui.Diagrams.DiagramEditorWidget.bus_branch_editor_widget import BusBranchEditorWidget, generate_bus_branch_diagram import GridCalEngine.Devices as dev +from GridCalEngine.Devices.types import ALL_DEV_TYPES from GridCalEngine.enumerations import DeviceType from GridCalEngine.Devices.multi_circuit import MultiCircuit from GridCalEngine.Devices.Substation import Bus class BusViewerWidget(QMainWindow): - + """ + BusViewerWidget + """ def __init__(self, circuit: MultiCircuit, root_bus: dev.Bus, name='', parent=None, view_toolbar=True, default_bus_voltage: float = 10.0): """ @@ -136,6 +139,14 @@ def shrink_node_distances(self): if self.grid_editor is not None: self.grid_editor.shrink_node_distances() + def delete_diagram_element(self, device: ALL_DEV_TYPES): + """ + Delete element from the diagram + :param device: + :return: + """ + self.grid_editor.delete_diagram_element(device=device) + def center_nodes(self, margin_factor: float = 0.1, elements: Union[None, List[Bus]] = None): """ Center the nodes in the screen diff --git a/src/GridCal/Gui/Diagrams/BusViewer/gui.py b/src/trunk/BusViewer/gui.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/gui.py rename to src/trunk/BusViewer/gui.py diff --git a/src/GridCal/Gui/Diagrams/BusViewer/gui.ui b/src/trunk/BusViewer/gui.ui similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/gui.ui rename to src/trunk/BusViewer/gui.ui diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons.qrc b/src/trunk/BusViewer/icons.qrc similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons.qrc rename to src/trunk/BusViewer/icons.qrc diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons/automatic_layout.svg b/src/trunk/BusViewer/icons/automatic_layout.svg similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons/automatic_layout.svg rename to src/trunk/BusViewer/icons/automatic_layout.svg diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons/grid_icon.svg b/src/trunk/BusViewer/icons/grid_icon.svg similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons/grid_icon.svg rename to src/trunk/BusViewer/icons/grid_icon.svg diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons/minus (gray).svg b/src/trunk/BusViewer/icons/minus (gray).svg similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons/minus (gray).svg rename to src/trunk/BusViewer/icons/minus (gray).svg diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons/plus (gray).svg b/src/trunk/BusViewer/icons/plus (gray).svg similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons/plus (gray).svg rename to src/trunk/BusViewer/icons/plus (gray).svg diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons/resize.svg b/src/trunk/BusViewer/icons/resize.svg similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons/resize.svg rename to src/trunk/BusViewer/icons/resize.svg diff --git a/src/GridCal/Gui/Diagrams/BusViewer/icons_rc.py b/src/trunk/BusViewer/icons_rc.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/icons_rc.py rename to src/trunk/BusViewer/icons_rc.py diff --git a/src/GridCal/Gui/Diagrams/BusViewer/update_gui_file.py b/src/trunk/BusViewer/update_gui_file.py similarity index 100% rename from src/GridCal/Gui/Diagrams/BusViewer/update_gui_file.py rename to src/trunk/BusViewer/update_gui_file.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/Rectangle_Connector.py b/src/trunk/NodeBreakerEditorWidget/Branches/Rectangle_Connector.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/Rectangle_Connector.py rename to src/trunk/NodeBreakerEditorWidget/Branches/Rectangle_Connector.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/__init__.py b/src/trunk/NodeBreakerEditorWidget/Branches/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/__init__.py rename to src/trunk/NodeBreakerEditorWidget/Branches/__init__.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/dc_line_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/dc_line_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/dc_line_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/dc_line_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/hvdc_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/hvdc_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/hvdc_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/hvdc_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_editor.py b/src/trunk/NodeBreakerEditorWidget/Branches/line_editor.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_editor.py rename to src/trunk/NodeBreakerEditorWidget/Branches/line_editor.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/line_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/line_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_graphics_template.py b/src/trunk/NodeBreakerEditorWidget/Branches/line_graphics_template.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/line_graphics_template.py rename to src/trunk/NodeBreakerEditorWidget/Branches/line_graphics_template.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/switch_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/switch_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/switch_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/switch_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/transformer2w_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/transformer2w_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/transformer2w_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/transformer2w_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/transformer_editor.py b/src/trunk/NodeBreakerEditorWidget/Branches/transformer_editor.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/transformer_editor.py rename to src/trunk/NodeBreakerEditorWidget/Branches/transformer_editor.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/upfc_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/upfc_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/upfc_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/upfc_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/vsc_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/vsc_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/vsc_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/vsc_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/winding_graphics.py b/src/trunk/NodeBreakerEditorWidget/Branches/winding_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Branches/winding_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Branches/winding_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Connector.py b/src/trunk/NodeBreakerEditorWidget/Connector.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Connector.py rename to src/trunk/NodeBreakerEditorWidget/Connector.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/__init__.py b/src/trunk/NodeBreakerEditorWidget/Fluid/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/__init__.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/__init__.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_node_graphics.py b/src/trunk/NodeBreakerEditorWidget/Fluid/fluid_node_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_node_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/fluid_node_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_p2x_graphics.py b/src/trunk/NodeBreakerEditorWidget/Fluid/fluid_p2x_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_p2x_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/fluid_p2x_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_path_graphics.py b/src/trunk/NodeBreakerEditorWidget/Fluid/fluid_path_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_path_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/fluid_path_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_pump_graphics.py b/src/trunk/NodeBreakerEditorWidget/Fluid/fluid_pump_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_pump_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/fluid_pump_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_turbine_graphics.py b/src/trunk/NodeBreakerEditorWidget/Fluid/fluid_turbine_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Fluid/fluid_turbine_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Fluid/fluid_turbine_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/__init__.py b/src/trunk/NodeBreakerEditorWidget/Injections/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/__init__.py rename to src/trunk/NodeBreakerEditorWidget/Injections/__init__.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/battery_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/battery_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/battery_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/battery_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/external_grid_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/external_grid_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/external_grid_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/external_grid_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/generator_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/generator_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/generator_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/generator_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/injections_template_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/injections_template_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/injections_template_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/injections_template_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/load_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/load_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/load_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/load_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/shunt_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/shunt_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/shunt_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/shunt_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/static_generator_graphics.py b/src/trunk/NodeBreakerEditorWidget/Injections/static_generator_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Injections/static_generator_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Injections/static_generator_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Substation/__init__.py b/src/trunk/NodeBreakerEditorWidget/Substation/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Substation/__init__.py rename to src/trunk/NodeBreakerEditorWidget/Substation/__init__.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Substation/bus_graphics.py b/src/trunk/NodeBreakerEditorWidget/Substation/bus_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/Substation/bus_graphics.py rename to src/trunk/NodeBreakerEditorWidget/Substation/bus_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/__init__.py b/src/trunk/NodeBreakerEditorWidget/__init__.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/__init__.py rename to src/trunk/NodeBreakerEditorWidget/__init__.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/generic_graphics.py b/src/trunk/NodeBreakerEditorWidget/generic_graphics.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/generic_graphics.py rename to src/trunk/NodeBreakerEditorWidget/generic_graphics.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/matplotlibwidget.py b/src/trunk/NodeBreakerEditorWidget/matplotlibwidget.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/matplotlibwidget.py rename to src/trunk/NodeBreakerEditorWidget/matplotlibwidget.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/node_breaker_editor_widget.py b/src/trunk/NodeBreakerEditorWidget/node_breaker_editor_widget.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/node_breaker_editor_widget.py rename to src/trunk/NodeBreakerEditorWidget/node_breaker_editor_widget.py diff --git a/src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/terminal_item.py b/src/trunk/NodeBreakerEditorWidget/terminal_item.py similarity index 100% rename from src/GridCal/Gui/Diagrams/NodeBreakerEditorWidget/terminal_item.py rename to src/trunk/NodeBreakerEditorWidget/terminal_item.py From 434514ce9aceb3568164ff56dff1bb23d9caef05 Mon Sep 17 00:00:00 2001 From: santi Date: Fri, 5 Apr 2024 18:34:41 +0100 Subject: [PATCH 13/19] Revisited the jacobian formation at CPF because of some shit with scipy... --- .idea/workspace.xml | 316 ++++-------------- src/GridCal/Gui/GuiFunctions.py | 2 +- .../continuation_power_flow.py | 24 +- src/tests/newton_equivalence_test.py | 33 +- 4 files changed, 108 insertions(+), 267 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 1c948e587..3a81e60e4 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,107 +29,11 @@ - + - - - + + - + @@ -1376,7 +1375,8 @@ - + + 1656059954202 @@ -1721,7 +1721,7 @@ - @@ -1767,8 +1767,6 @@ - - @@ -1792,7 +1790,9 @@ - @@ -2264,6 +2264,11 @@ 374 @@ -2273,14 +2278,14 @@ - + - + @@ -2418,7 +2423,7 @@ - + @@ -2426,7 +2431,7 @@ - + diff --git a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py index f5e5d9e01..21ab8faf0 100644 --- a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Fluid/fluid_node_graphics.py @@ -99,8 +99,8 @@ def __init__(self, editor: DiagramEditorWidget, fluid_node: FluidNode, QtWidgets.QGraphicsRectItem.__init__(self, parent) self.min_w = 180.0 - self.min_h = 20.0 - self.offset = 10 + self.min_h = 40.0 + self.offset = 20 self.h = h if h >= self.min_h else self.min_h self.w = w if w >= self.min_w else self.min_w @@ -118,32 +118,23 @@ def __init__(self, editor: DiagramEditorWidget, fluid_node: FluidNode, self.color = ACTIVE['fluid'] self.style = ACTIVE['style'] - # square - # self.tile_inside = RoundedRect(0, self.min_h/3, self.min_w, self.min_h / 3, 15, self) - # self.tile_inside.setBrush(QBrush(ACTIVE['fluid'])) - # self.tile_inside.setOpacity(0.7) - - self.tile = QGraphicsRectItem(0, 0, 20, 20) - self.tile.setPen(QPen(ACTIVE['color'])) - self.tile.setBrush(QBrush(ACTIVE['fluid'])) - self.tile.setOpacity(0.7) - # self.tile.set_percentage(36.0) - # Label: - self.label = QtWidgets.QGraphicsTextItem(fluid_node.name, self) + self.label = QtWidgets.QGraphicsTextItem(self.api_object.name if self.api_object is not None else "", self) self.label.setDefaultTextColor(ACTIVE['text']) self.label.setScale(FONT_SCALE) + # square + self.tile = QtWidgets.QGraphicsRectItem(0, 0, 20, 20, self) + self.tile.setOpacity(0.7) + # connection terminals the block self._terminal = BarTerminalItem('s', parent=self, editor=self.editor) # , h=self.h)) self._terminal.setPen(QPen(Qt.transparent, self.pen_width, self.style, Qt.RoundCap, Qt.RoundJoin)) # Create corner for resize: - self.sizer = HandleItem(self._terminal) - self.sizer.setPos(self.w, 20) - self.sizer.callbacks_list.append(self.change_size) # Connect the callback + self.sizer = HandleItem(self._terminal, callback=self.change_size) + self.sizer.setPos(self.w, self.h) self.sizer.setFlag(self.GraphicsItemFlag.ItemIsMovable) - # self.adapt() self.big_marker = None @@ -249,45 +240,31 @@ def change_size(self, w: int, h: Union[None, int] = None): @return: """ # Limit the block size to the minimum size: - if h is None: - h = self.min_h - - if w < self.min_w: - w = self.min_w - - self.setRect(0.0, 0.0, w, h) - self.h = h - self.w = w + self.w = w if w > self.min_w else self.min_w + self.setRect(0.0, 0.0, self.w, self.min_h) + y0 = self.offset + x0 = 0 # center label: - rect = self.label.boundingRect() - lw, lh = rect.width(), rect.height() - lx = (w - lw) / 2 - ly = (h - lh) / 2 - lh * (FONT_SCALE - 1) - self.label.setPos(lx, ly) + self.label.setPos(self.w + 5, -20) # lower - y0 = h + self.offset - x0 = 0 self._terminal.setPos(x0, y0) - self._terminal.setRect(0, 0, w, 10) - - # Set text - if self.api_object is not None: - self.label.setPlainText(self.api_object.name) + self._terminal.setRect(0, 20, self.w, 10) # rearrange children self.arrange_children() + # update editor diagram position self.editor.update_diagram_element(device=self.api_object, x=self.pos().x(), y=self.pos().y(), - w=w, - h=h, + w=self.w, + h=int(self.min_h), r=self.rotation(), graphic_object=self) - return w, h + return self.w, self.min_h def arrange_children(self): """ @@ -500,7 +477,9 @@ def remove(self, ask=True): self.editor.remove_element(device=self.api_object, graphic_object=self) def update_color(self): - + """ + Update the colour + """ self.set_tile_color(QBrush(ACTIVE['color'])) def plot_profiles(self): diff --git a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py index 3bebdf2b6..4f1902a86 100644 --- a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Substation/bus_graphics.py @@ -236,16 +236,16 @@ def change_size(self, w: int, dummy: float = 0.0): """ # Limit the block size to the minimum size: self.w = w if w > self.min_w else self.min_w - self.setRect(0.0, 0.0, w, self.min_h) + self.setRect(0.0, 0.0, self.w, self.min_h) y0 = self.offset x0 = 0 # center label: - self.label.setPos(w + 5, -20) + self.label.setPos(self.w + 5, -20) # lower self._terminal.setPos(x0, y0) - self._terminal.setRect(0, 20, w, 10) + self._terminal.setRect(0, 20, self.w, 10) # rearrange children self.arrange_children() @@ -254,12 +254,12 @@ def change_size(self, w: int, dummy: float = 0.0): self.editor.update_diagram_element(device=self.api_object, x=self.pos().x(), y=self.pos().y(), - w=w, + w=self.w, h=int(self.min_h), r=self.rotation(), graphic_object=self) - return w, self.min_h + return self.w, self.min_h def arrange_children(self) -> None: """ diff --git a/src/GridCalEngine/Simulations/OPF/linear_opf_ts.py b/src/GridCalEngine/Simulations/OPF/linear_opf_ts.py index cad2faa73..ee1418338 100644 --- a/src/GridCalEngine/Simulations/OPF/linear_opf_ts.py +++ b/src/GridCalEngine/Simulations/OPF/linear_opf_ts.py @@ -1397,7 +1397,7 @@ def add_hydro_formulation(t: Union[int, None], # f_obj -= p2x_flow - if t is not None: + if time_global_tidx is not None: # constraints for the node level for m in range(node_data.nelm): if t == 0: From 8d7367358c665b5b8e496b0c6ceacf08d11eafcd Mon Sep 17 00:00:00 2001 From: Carlos-Alegre Date: Mon, 8 Apr 2024 10:26:11 +0200 Subject: [PATCH 16/19] Sf and St bound slacks bugfix --- .../Simulations/OPF/NumericalMethods/ac_opf.py | 4 ++-- .../OPF/NumericalMethods/ac_opf_derivatives.py | 8 ++++++-- src/trunk/acopf/acopf_run.py | 8 ++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf.py b/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf.py index ae70c83a6..007df7a56 100644 --- a/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf.py +++ b/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf.py @@ -556,8 +556,8 @@ def ac_optimal_power_flow(nc: NumericalCircuit, if use_bound_slacks: nsl = 2 * npq + 2 * n_br_mon # Slack relaxations for constraints - c_s = nc.branch_data.overload_cost[br_mon_idx] + 1e-9 - c_v = nc.bus_data.cost_v[pq] + 1e-9 + c_s = 0.0000001 * nc.branch_data.overload_cost[br_mon_idx] + 1e-9 + c_v = 1000 * nc.bus_data.cost_v[pq] + 1e-9 sl_sf0 = np.ones(n_br_mon) sl_st0 = np.ones(n_br_mon) sl_vmax0 = np.ones(npq) diff --git a/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf_derivatives.py b/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf_derivatives.py index f6de7283e..36f7fb465 100644 --- a/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf_derivatives.py +++ b/src/GridCalEngine/Simulations/OPF/NumericalMethods/ac_opf_derivatives.py @@ -925,8 +925,12 @@ def jacobians_and_hessians(x: Vec, c1: Vec, c2: Vec, c_s: Vec, c_v: Vec, Cg: csr SfX = sp.hstack([Sfva, Sfvm, lil_matrix((M, 2 * Ng + nsl + ndc))]) StX = sp.hstack([Stva, Stvm, lil_matrix((M, 2 * Ng + nsl + ndc))]) - HSf = 2 * (Sfmat.real @ SfX.real + Sfmat.imag @ SfX.imag) - HSt = 2 * (Stmat.real @ StX.real + Stmat.imag @ StX.imag) + if use_bound_slacks: + HSf = 2 * (Sfmat.real @ SfX.real + Sfmat.imag @ SfX.imag) + Hslsf + HSt = 2 * (Stmat.real @ StX.real + Stmat.imag @ StX.imag) + Hslst + else: + HSf = 2 * (Sfmat.real @ SfX.real + Sfmat.imag @ SfX.imag) + HSt = 2 * (Stmat.real @ StX.real + Stmat.imag @ StX.imag) if ctQ != ReactivePowerControlMode.NoControl: # tanmax curves (simplified capability curves of generators) diff --git a/src/trunk/acopf/acopf_run.py b/src/trunk/acopf/acopf_run.py index d7e078c83..476644da7 100644 --- a/src/trunk/acopf/acopf_run.py +++ b/src/trunk/acopf/acopf_run.py @@ -351,7 +351,7 @@ def casehvdc(): # Go back two directories new_directory = os.path.abspath(os.path.join(cwd, '..', '..', '..')) - file_path = os.path.join(new_directory, 'Grids_and_profiles', 'grids', 'IEEE14 - ntc areas_voltages_hvdc_shifter_l10free.gridcal') + file_path = os.path.join(new_directory, 'Grids_and_profiles', 'grids', 'IEEE25.gridcal') grid = gce.FileOpen(file_path).open() @@ -371,10 +371,10 @@ def casehvdc(): # linn5bus_example() # two_grids_of_3bus() # case9() - case14() + # case14() # case_gb() # case6ww() # case_pegase89() - # case300() + #case300() # casepegase13k() - # casehvdc() + casehvdc() From 98009006e1c4008bed9dacd6fb716918116f212e Mon Sep 17 00:00:00 2001 From: santi Date: Mon, 8 Apr 2024 09:51:39 +0100 Subject: [PATCH 17/19] Enable, disable results tags --- .idea/workspace.xml | 82 +- .../Branches/dc_line_graphics.py | 9 +- .../Branches/hvdc_graphics.py | 10 +- .../Branches/line_graphics.py | 7 + .../Branches/switch_graphics.py | 9 +- .../Branches/transformer2w_graphics.py | 7 + .../Branches/upfc_graphics.py | 7 + .../Branches/vsc_graphics.py | 7 + .../Branches/winding_graphics.py | 7 + .../Substation/bus_graphics.py | 58 +- .../diagram_editor_widget.py | 16 + .../DiagramEditorWidget/generic_graphics.py | 28 +- src/GridCal/Gui/Diagrams/graphics_manager.py | 2 +- src/GridCal/Gui/GuiFunctions.py | 30 +- src/GridCal/Gui/Main/ConsoleLog.py | 2 +- src/GridCal/Gui/Main/MainWindow.py | 342 +- src/GridCal/Gui/Main/MainWindow.ui | 29 +- .../Gui/Main/SubClasses/Model/diagrams.py | 20 + src/GridCal/Gui/Main/icons_rc.py | 13325 ++++++++-------- 19 files changed, 6788 insertions(+), 7209 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 213c8c175..4faac6c76 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,10 +29,26 @@ - + - - - - - - - - - - - - - - - - - - + - + - - - + + + - + - + + - @@ -1398,7 +1376,7 @@ - + 1656059954202 @@ -1743,7 +1721,7 @@ - @@ -1789,7 +1767,6 @@ - @@ -1814,7 +1791,8 @@ - @@ -2445,7 +2423,7 @@ - + @@ -2453,7 +2431,7 @@ - + @@ -2532,6 +2510,7 @@ + @@ -2547,7 +2526,7 @@ - + diff --git a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py index f1bc8b0d9..4beea024a 100644 --- a/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py +++ b/src/GridCal/Gui/Diagrams/DiagramEditorWidget/Branches/line_graphics_template.py @@ -101,7 +101,8 @@ def set_colour(self, color: QColor, w, style: Qt.PenStyle): self.setBrush(color) self.label.setDefaultTextColor(color) - def set_value(self, value: float, redraw=True, backwards=False, name="", units="", format_str="{:10.2f}"): + def set_value(self, value: float, redraw=True, backwards=False, name="", units="", format_str="{:10.2f}", + draw_label: bool = True): """ Set the sign with a value :param value: any real value @@ -110,13 +111,17 @@ def set_value(self, value: float, redraw=True, backwards=False, name="", units=" :param name: name of the displayed magnitude (i.e. Pf) :param units: the units of the displayed magnitude (i.e MW) :param format_str: the formatting string of the displayed magnitude + :param draw_label: Draw label """ # self.backwards = value < 0 self.backwards = backwards - x = format_str.format(value) - msg = f'{name}:{x} {units}' - self.label.setPlainText(msg) - self.setToolTip(msg) + + self.label.setVisible(draw_label) + if draw_label: + x = format_str.format(value) + msg = f'{name}:{x} {units}' + self.label.setPlainText(msg) + self.setToolTip(msg) if redraw: self.redraw() @@ -781,10 +786,10 @@ def set_arrows_with_power(self, Sf: complex, St: complex) -> None: Qf = Sf.imag Pt = St.real Qt_ = St.imag - self.arrow_from_1.set_value(Pf, True, Pf < 0, name="Pf", units="MW") - self.arrow_from_2.set_value(Qf, True, Qf < 0, name="Qf", units="MVAr") - self.arrow_to_1.set_value(Pt, True, Pt > 0, name="Pt", units="MW") - self.arrow_to_2.set_value(Qt_, True, Qt_ > 0, name="Qt", units="MVAr") + self.arrow_from_1.set_value(Pf, True, Pf < 0, name="Pf", units="MW", draw_label=self.draw_labels) + self.arrow_from_2.set_value(Qf, True, Qf < 0, name="Qf", units="MVAr", draw_label=self.draw_labels) + self.arrow_to_1.set_value(Pt, True, Pt > 0, name="Pt", units="MW", draw_label=self.draw_labels) + self.arrow_to_2.set_value(Qt_, True, Qt_ > 0, name="Qt", units="MVAr", draw_label=self.draw_labels) def set_arrows_with_hvdc_power(self, Pf: float, Pt: float) -> None: """ @@ -792,10 +797,10 @@ def set_arrows_with_hvdc_power(self, Pf: float, Pt: float) -> None: :param Pf: Complex power from :param Pt: Complex power to """ - self.arrow_from_1.set_value(Pf, True, Pf < 0, name="Pf", units="MW") - self.arrow_from_2.set_value(Pf, True, Pf < 0, name="Pf", units="MW") - self.arrow_to_1.set_value(Pt, True, Pt > 0, name="Pt", units="MW") - self.arrow_to_2.set_value(Pt, True, Pt > 0, name="Pt", units="MW") + self.arrow_from_1.set_value(Pf, True, Pf < 0, name="Pf", units="MW", draw_label=self.draw_labels) + self.arrow_from_2.set_value(Pf, True, Pf < 0, name="Pf", units="MW", draw_label=self.draw_labels) + self.arrow_to_1.set_value(Pt, True, Pt > 0, name="Pt", units="MW", draw_label=self.draw_labels) + self.arrow_to_2.set_value(Pt, True, Pt > 0, name="Pt", units="MW", draw_label=self.draw_labels) def change_bus(self): """ From ebcc4331620d0ee123ebaa1646ee3996b3ce695f Mon Sep 17 00:00:00 2001 From: JosepFanals Date: Mon, 8 Apr 2024 12:32:02 +0200 Subject: [PATCH 19/19] Implemented min and max SOC in fluid node --- .idea/workspace.xml | 537 +++++++----------- .../Compilers/circuit_to_data.py | 4 + .../DataStructures/fluid_node_data.py | 5 +- src/GridCalEngine/Devices/Fluid/fluid_node.py | 53 ++ .../Simulations/OPF/linear_opf_ts.py | 13 +- 5 files changed, 293 insertions(+), 319 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3a81e60e4..0c17f1c87 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -29,11 +29,11 @@