Skip to content

Commit

Permalink
v1.2. Add API clear_meters(). stepspy is also updated to v1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
changgang committed Apr 22, 2020
1 parent 22b6440 commit 800ef9b
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/steps/STEPS.depend
Original file line number Diff line number Diff line change
Expand Up @@ -2334,7 +2334,7 @@
"header/data_imexporter/psse_imexporter.h"
"header/data_imexporter/bpa_imexporter.h"

1583938871 d:\steps\code\steps\header\apis\steps_api.h
1587542271 d:\steps\code\steps\header\apis\steps_api.h
<cstdlib>
"header/basic/constants.h"

Expand Down
1 change: 1 addition & 0 deletions code/steps/header/apis/steps_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ EXPORT_STEPS_DLL double api_get_dynamic_simulation_time(unsigned int toolkit_ind

EXPORT_STEPS_DLL void api_show_dynamic_simulation_configuration(unsigned int toolkit_index=INDEX_NOT_EXIST);

EXPORT_STEPS_DLL void api_clear_meters(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_prepare_meters(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_prepare_bus_related_meters(unsigned int toolkit_index=INDEX_NOT_EXIST);
EXPORT_STEPS_DLL void api_prepare_generator_related_meters(unsigned int toolkit_index=INDEX_NOT_EXIST);
Expand Down
7 changes: 7 additions & 0 deletions code/steps/source/apis/steps_api_dynamic_simulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,13 @@ void api_show_dynamic_simulation_configuration(unsigned int toolkit_index)
ds.show_dynamic_simulator_configuration();
}

void api_clear_meters(unsigned int toolkit_index)
{
STEPS& toolkit = get_toolkit(toolkit_index);
DYNAMICS_SIMULATOR& ds = toolkit.get_dynamic_simulator();
ds.clear_meters();
}

void api_prepare_meters(unsigned int toolkit_index)
{
STEPS& toolkit = get_toolkit(toolkit_index);
Expand Down
1 change: 1 addition & 0 deletions python/stepspy-current/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ STEPS is a simulation toolkit for powerflow and dynamic simulation of large-scal

## Realse Note

- 1.0.0. Apr. 22, 2020. Add new API: clear_meters() to clear all meters for dynamic simulation. STEPS kernel version should be >=1.2.
- 0.13.0-alpha. Mar. 9, 2020. Add new APIs: change_bus_number() and change_bus_number_with_file(). get_areas(), get_zones(), and get_owners() are marked as deprecated. STEPS kernel version should be >=1.1.1.
- 0.12.0. Feb. 8, 2020. Add new APIs: check_dynamic_least_time_constants(). Recover the save_powerflow_data() API of v0.9.0.
- 0.11.5. Jan. 20, 2020. Add new APIs: set/get_dynamic_model_database_capacity().
Expand Down
2 changes: 1 addition & 1 deletion python/stepspy-current/stepspy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
__all__ = ['help']
__author__ = "Changgang Li <[email protected]>"
__date__ = "March 11, 2020"
__date__ = "April 22, 2020"
__version__ = "1.0.0"

from .stepspy import STEPS
Expand Down
6 changes: 4 additions & 2 deletions python/stepspy-current/stepspy/libsteps/pylibsteps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import platform
import os

libsteps_version = "0.11.2"
libsteps_date = "2020/1/19"
libsteps_version = "0.12.0"
libsteps_date = "2020/4/22"

def get_base_library():
dirname, filename = os.path.split(os.path.abspath(__file__))
Expand Down Expand Up @@ -596,6 +596,8 @@ def load_library():
libsteps.api_show_dynamic_simulation_configuration.restype = None
libsteps.api_show_dynamic_simulation_configuration.argtypes = (c_uint, )

libsteps.api_clear_meters.restype = None
libsteps.api_clear_meters.argtypes = (c_uint, )
libsteps.api_prepare_meters.restype = None
libsteps.api_prepare_meters.argtypes = (c_uint, )
libsteps.api_prepare_bus_related_meters.restype = None
Expand Down
12 changes: 12 additions & 0 deletions python/stepspy-current/stepspy/stepspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -3899,6 +3899,18 @@ def get_dynamic_simulation_time(self):
global STEPS_LIB
return STEPS_LIB.api_get_dynamic_simulation_time(self.toolkit_index)

def clear_meters(self):
"""
Clear all meters in the current simulator.
Args: N/A
Rets: N/A
Tips:
If STEPS() is created with is_default=True, this api can help to clear all meters to avoid adding duplicate meters.
"""
global STEPS_LIB
STEPS_LIB.api_clear_meters(self.toolkit_index)
return

def prepare_meters(self, device_type):
"""
Automatically prepare general meters of all devices of specific device type.
Expand Down

0 comments on commit 800ef9b

Please sign in to comment.