Skip to content

Commit

Permalink
Fixed contingency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
SanPen committed Nov 16, 2023
1 parent d1c9e0d commit cde8448
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
18 changes: 5 additions & 13 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/GridCal/Gui/Main/SubClasses/Model/diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,11 +1322,15 @@ def get_selected_contingency_devices(self) -> List[dev.EditableDevice]:
Get the selected buses
:return:
"""
lst: List[dev.EditableDevice] = list()
for k, elm in enumerate(self.circuit.get_contingency_devices()):
if elm.graphic_obj is not None:
if elm.graphic_obj.isSelected():
lst.append(elm)
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()
else:
lst = list()

return lst

def get_selected_investment_devices(self) -> List[dev.EditableDevice]:
Expand Down

0 comments on commit cde8448

Please sign in to comment.