Skip to content

Commit

Permalink
Improved label redrawing
Browse files Browse the repository at this point in the history
  • Loading branch information
SanPen committed Sep 23, 2024
1 parent 7968abe commit 4193129
Show file tree
Hide file tree
Showing 16 changed files with 260 additions and 241 deletions.
111 changes: 60 additions & 51 deletions .idea/workspace.xml

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

Binary file modified Grids_and_profiles/grids/IEEE57.gridcal
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def __init__(self, first: NodeGraphicItem, second: NodeGraphicItem, container: M
self.container: MapLineContainer = container
self.draw_labels = True

self.style = Qt.SolidLine
self.color = Qt.blue
self.style = Qt.PenStyle.SolidLine
self.color = QColor(115, 115, 115, 200) # translucent gray
self.width = 0.1

self.pos1: QPointF = self.first.get_center_pos()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,14 @@ def add_voltage_level(self) -> None:
max_value=100000.0,
default_value=self.editor.diagram.default_bus_voltage,
title="Add voltage level",
text="Voltage (kV)",
text="Voltage (KV)",
)

inpt.exec()

if inpt.is_accepted:
kv = inpt.value
vl = VoltageLevel(name=f'{kv}kV @ {self.api_object.name}',
vl = VoltageLevel(name=f'{kv}KV @ {self.api_object.name}',
Vnom=kv,
substation=self.api_object)

Expand Down
2 changes: 1 addition & 1 deletion src/GridCal/Gui/Diagrams/MapWidget/grid_map_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ def colour_results(self,
#
# tooltip = str(i) + ': ' + bus.name + '\n' \
# + 'V:' + "{:10.4f}".format(vabs[i]) + " <{:10.4f}".format(vang[i]) + 'º [p.u.]\n' \
# + 'V:' + "{:10.4f}".format(vabs[i] * bus.Vnom) + " <{:10.4f}".format(vang[i]) + 'º [kV]'
# + 'V:' + "{:10.4f}".format(vabs[i] * bus.Vnom) + " <{:10.4f}".format(vang[i]) + 'º [KV]'
# if Sbus is not None:
# tooltip += '\nS: ' + "{:10.4f}".format(Sbus[i] * Sbase) + ' [MVA]'
# if types is not None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, branch: DcLine, Sbase=100, templates=None, current_template=N
# X = self.branch.X * Zbase
# B = self.branch.B * Ybase

I = self.branch.rate / Vf # current in kA
I = self.branch.rate / Vf # current in KA

# ------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -177,7 +177,7 @@ def accept_click(self):
Vf = self.branch.bus_from.Vnom
Vt = self.branch.bus_to.Vnom

Sn = np.round(I * Vf, 2) # nominal power in MVA = kA * kV
Sn = np.round(I * Vf, 2) # nominal power in MVA = KA * KV

Zbase = self.Sbase / (Vf * Vf)
Ybase = 1.0 / Zbase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(self,
R = self.line.R * Zbase / length
X = self.line.X * Zbase / length
B = self.line.B * Ybase / length
I = np.round(self.line.rate / (Vf * 1.73205080757), 6) # current in kA
I = np.round(self.line.rate / (Vf * 1.73205080757), 6) # current in KA

# ------------------------------------------------------------------------------------------

Expand Down Expand Up @@ -225,7 +225,7 @@ def accept_click(self):
x_ohm=self.x_spinner.value(), # ohm / km
c_nf=self.b_spinner.value() * 1e3 / wf, # nF / km
length=self.l_spinner.value(), # km
Imax=self.i_spinner.value(), # kA
Imax=self.i_spinner.value(), # KA
freq=self.frequency, # Hz
Sbase=self.Sbase, # MVA
apply_to_profile=self.apply_to_profile.isChecked()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def add_to_catalogue(self):

if ok:
# rate = I
rated_current = self.api_object.rate / (self.api_object.Vf * 1.73205080757) # MVA = kA * kV * sqrt(3)
rated_current = self.api_object.rate / (self.api_object.Vf * 1.73205080757) # MVA = KA * KV * sqrt(3)

tpe = SequenceLineType(name='SequenceLine from ' + self.api_object.name,
idtag=None,
Expand Down
Loading

0 comments on commit 4193129

Please sign in to comment.