Skip to content

Commit

Permalink
Fixed #278
Browse files Browse the repository at this point in the history
  • Loading branch information
SanPen committed May 6, 2024
1 parent 4fd9db8 commit 95e3aed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/GridCal/Gui/Diagrams/SchematicWidget/Branches/line_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QPushButton, QVBoxLayout, QDialog, QLabel, QDoubleSpinBox, QComboBox, QCheckBox
from GridCal.Gui.GuiFunctions import get_list_model
from GridCal.Gui.messages import error_msg
from GridCalEngine.Devices.Branches.line import Line, SequenceLineType, OverheadLineType, UndergroundLineType


Expand Down Expand Up @@ -62,7 +63,15 @@ def __init__(self, line: Line,
# ------------------------------------------------------------------------------------------

Vf = self.line.bus_from.Vnom
Vt = self.line.bus_to.Vnom
# Vt = self.line.bus_to.Vnom

if Vf <= 0.0:
error_msg(f"Vnom in bus {self.line.bus_from} is {Vf}\n"
f"That causes an infinite base admittance.\n"
f"The process has been aborted.\n"
f"Please correct the data and try again.",
title="Line editor initialization")
return

Zbase = (Vf * Vf) / self.Sbase
Ybase = 1 / Zbase
Expand Down

0 comments on commit 95e3aed

Please sign in to comment.