-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid return shared_ptr to julia for network metadata and store them …
…in the network handle struct. Remove explicit module NetworkCreationUtils Signed-off-by: Bertrand Rix <[email protected]>
- Loading branch information
Showing
4 changed files
with
78 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,65 @@ | ||
module NetworkCreationUtils | ||
using ..Powsybl | ||
using ..Network | ||
using CxxWrap | ||
function _create_network(name::String, network_id::String = "") | ||
handle = Powsybl.create_network(name, network_id) | ||
return Network.NetworkHandle(handle, | ||
Powsybl.id(handle), | ||
Powsybl.name(handle), | ||
Powsybl.source_format(handle), | ||
Powsybl.forecast_distance(handle), | ||
Powsybl.case_date(handle)) | ||
end | ||
|
||
function _create_network(name::String, network_id::String = "") | ||
return Network.NetworkHandle(Powsybl.create_network(name, network_id)) | ||
end | ||
function create_empty(network_id::String = "") | ||
return _create_network("empty", network_id) | ||
end | ||
|
||
function create_empty(network_id::String = "") | ||
return _create_network("empty", network_id) | ||
end | ||
function create_ieee9(network_id::String = "") | ||
return _create_network("ieee9", network_id) | ||
end | ||
|
||
function create_ieee9(network_id::String = "") | ||
return _create_network("ieee9", network_id) | ||
end | ||
function create_ieee14(network_id::String = "") | ||
return _create_network("ieee14", network_id) | ||
end | ||
|
||
function create_ieee14(network_id::String = "") | ||
return _create_network("ieee14", network_id) | ||
end | ||
function create_ieee30(network_id::String = "") | ||
return _create_network("ieee30", network_id) | ||
end | ||
|
||
function create_ieee30(network_id::String = "") | ||
return _create_network("ieee30", network_id) | ||
end | ||
function create_ieee57(network_id::String = "") | ||
return _create_network("ieee57", network_id) | ||
end | ||
|
||
function create_ieee57(network_id::String = "") | ||
return _create_network("ieee57", network_id) | ||
end | ||
function create_ieee118(network_id::String = "") | ||
return _create_network("ieee118", network_id) | ||
end | ||
|
||
function create_ieee118(network_id::String = "") | ||
return _create_network("ieee118", network_id) | ||
end | ||
function create_ieee300(network_id::String = "") | ||
return _create_network("ieee300", network_id) | ||
end | ||
|
||
function create_ieee300(network_id::String = "") | ||
return _create_network("ieee300", network_id) | ||
end | ||
function create_eurostag_tutorial_example1(network_id::String = "") | ||
return _create_network("eurostag_tutorial_example1", network_id) | ||
end | ||
|
||
function create_eurostag_tutorial_example1(network_id::String = "") | ||
return _create_network("eurostag_tutorial_example1", network_id) | ||
end | ||
function create_eurostag_tutorial_example1_with_power_limits(network_id::String = "") | ||
return _create_network("eurostag_tutorial_example1_with_power_limits", network_id) | ||
end | ||
|
||
function create_eurostag_tutorial_example1_with_power_limits(network_id::String = "") | ||
return _create_network("eurostag_tutorial_example1_with_power_limits", network_id) | ||
end | ||
function create_four_substations_node_breaker(network_id::String = "") | ||
return _create_network("four_substations_node_breaker", network_id) | ||
end | ||
|
||
function create_four_substations_node_breaker(network_id::String = "") | ||
return _create_network("four_substations_node_breaker", network_id) | ||
end | ||
function create_four_substations_node_breaker_with_extensions(network_id::String = "") | ||
return _create_network("four_substations_node_breaker_with_extensions", network_id) | ||
end | ||
|
||
function create_four_substations_node_breaker_with_extensions(network_id::String = "") | ||
return _create_network("four_substations_node_breaker_with_extensions", network_id) | ||
end | ||
function create_micro_grid_be(network_id::String = "") | ||
return _create_network("micro_grid_be", network_id) | ||
end | ||
|
||
function create_micro_grid_be(network_id::String = "") | ||
return _create_network("micro_grid_be", network_id) | ||
end | ||
function create_micro_grid_nl(network_id::String = "") | ||
return _create_network("micro_grid_nl", network_id) | ||
end | ||
|
||
function create_micro_grid_nl(network_id::String = "") | ||
return _create_network("micro_grid_nl", network_id) | ||
end | ||
|
||
function create_metrix_tutorial_six_buses(network_id::String = "") | ||
return _create_network("metrix_tutorial_six_buses", network_id) | ||
end | ||
function create_metrix_tutorial_six_buses(network_id::String = "") | ||
return _create_network("metrix_tutorial_six_buses", network_id) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters