Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
ITCPG.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Stuermer
ITCPG.jl
Commits
d708c97c
Commit
d708c97c
authored
4 years ago
by
Julian Stürmer
Browse files
Options
Downloads
Patches
Plain Diff
Add possibility to plot only inactive branches
parent
7fdd38c2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/PlotPG.jl
+17
-3
17 additions, 3 deletions
src/PlotPG.jl
with
17 additions
and
3 deletions
src/PlotPG.jl
+
17
−
3
View file @
d708c97c
...
...
@@ -45,7 +45,7 @@ function _default_settings(func::Symbol)
"show"
=>
true
),
"Load and generator"
=>
Dict
(
"marker"
=>
"
o
"
,
"marker"
=>
"
s
"
,
"size"
=>
30
,
"color"
=>
"darkorange"
,
"alpha"
=>
1
,
...
...
@@ -79,7 +79,7 @@ function _default_settings(func::Symbol)
),
### Settings for _draw_branches!
"Branches"
=>
Dict
(
"br_status"
=>
"active"
,
# plot only "active" or "all" branches
"br_status"
=>
"active"
,
# plot only "active"
, "inactive"
or "all" branches
"br_coloring"
=>
"equal"
,
# how to color branches (can be set to "equal", "voltage", "MW-loading", "Mvar-loading" or "MVA-loading")
"br_color"
=>
"k"
,
# default color for "equal" coloring
"br_lw"
=>
2
,
...
...
@@ -343,6 +343,8 @@ function _draw_br_equal!(
### Get edges contained in the NDD
if
br_settings
[
"br_status"
]
==
"active"
# only plot active branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
if
b
[
"br_status"
]
==
1
]
elseif
br_settings
[
"br_status"
]
==
"inactive"
# only plot active branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
if
b
[
"br_status"
]
==
0
]
elseif
br_settings
[
"br_status"
]
==
"all"
# plot all branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
]
else
...
...
@@ -386,6 +388,9 @@ function _draw_br_branchloads!(
if
br_status
==
"active"
# only plot active branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
if
b
[
"br_status"
]
==
1
]
branchloads
=
[
b
[
br_coloring
]
for
b
in
branches
if
b
[
"br_status"
]
==
1
]
elseif
br_settings
[
"br_status"
]
==
"inactive"
# only plot inactive branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
if
b
[
"br_status"
]
==
0
]
branchloads
=
[
b
[
br_coloring
]
for
b
in
branches
if
b
[
"br_status"
]
==
0
]
elseif
br_status
==
"all"
# plot all branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
]
branchloads
=
[
b
[
br_coloring
]
for
b
in
branches
]
...
...
@@ -448,6 +453,15 @@ function _draw_br_voltage!(
string
(
b
[
"tl_voltage"
])
for
b
in
branches
if
b
[
"br_status"
]
==
1
]
elseif
br_settings
[
"br_status"
]
==
"inactive"
# only plot inactive branches
edges
=
[
(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
if
b
[
"br_status"
]
==
0
]
voltages
=
[
string
(
b
[
"tl_voltage"
])
for
b
in
branches
if
b
[
"br_status"
]
==
0
]
elseif
br_settings
[
"br_status"
]
==
"all"
# plot all branches
edges
=
[(
b
[
"f_bus"
],
b
[
"t_bus"
])
for
b
in
branches
]
voltages
=
[
string
(
b
[
"tl_voltage"
])
for
b
in
branches
]
...
...
@@ -468,7 +482,7 @@ function _draw_br_voltage!(
push!
(
br_markers
,
mlines
.
Line2D
([],
[],
color
=
tableau
[
i
],
ls
=
"-"
))
push!
(
br_labels
,
string
(
v
)
*
" kV"
)
end
### Draw edges
drawnedges
=
nx
.
draw_networkx_edges
(
G
,
pos
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment