Skip to content

Commit f0450d4

Browse files
committed
add new update attributes
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
1 parent eb01480 commit f0450d4

5 files changed

Lines changed: 18 additions & 1 deletion

File tree

code_generation/data/attribute_classes/update.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@
8787
"data_type": "double",
8888
"names": ["u_ref", "u_ref_angle"],
8989
"description": "reference voltage"
90+
},
91+
{
92+
"data_type": "double",
93+
"names": ["sk", "rx_ratio", "z01_ratio"],
94+
"description": "short circuit capacity"
9095
}
9196
]
9297
},

power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/meta_gen/update.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,16 @@ struct get_attributes_list<LoadGenUpdate<sym_type>> {
105105

106106
template<>
107107
struct get_attributes_list<SourceUpdate> {
108-
static constexpr std::array<MetaAttribute, 4> value{
108+
static constexpr std::array<MetaAttribute, 7> value{
109109
// all attributes including base class
110110

111111
meta_data_gen::get_meta_attribute<&SourceUpdate::id>(offsetof(SourceUpdate, id), "id"),
112112
meta_data_gen::get_meta_attribute<&SourceUpdate::status>(offsetof(SourceUpdate, status), "status"),
113113
meta_data_gen::get_meta_attribute<&SourceUpdate::u_ref>(offsetof(SourceUpdate, u_ref), "u_ref"),
114114
meta_data_gen::get_meta_attribute<&SourceUpdate::u_ref_angle>(offsetof(SourceUpdate, u_ref_angle), "u_ref_angle"),
115+
meta_data_gen::get_meta_attribute<&SourceUpdate::sk>(offsetof(SourceUpdate, sk), "sk"),
116+
meta_data_gen::get_meta_attribute<&SourceUpdate::rx_ratio>(offsetof(SourceUpdate, rx_ratio), "rx_ratio"),
117+
meta_data_gen::get_meta_attribute<&SourceUpdate::z01_ratio>(offsetof(SourceUpdate, z01_ratio), "z01_ratio"),
115118
};
116119
};
117120

power_grid_model_c/power_grid_model/include/power_grid_model/auxiliary/update.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ struct SourceUpdate {
104104
IntS status{na_IntS}; // whether the appliance is connected
105105
double u_ref{nan}; // reference voltage
106106
double u_ref_angle{nan}; // reference voltage
107+
double sk{nan}; // short circuit capacity
108+
double rx_ratio{nan}; // short circuit capacity
109+
double z01_ratio{nan}; // short circuit capacity
107110

108111
// implicit conversions to BaseUpdate
109112
operator BaseUpdate&() { return reinterpret_cast<BaseUpdate&>(*this); }

power_grid_model_c/power_grid_model_c/include/power_grid_model_c/dataset_definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,9 @@ PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_id;
884884
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_status;
885885
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_u_ref;
886886
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_u_ref_angle;
887+
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_sk;
888+
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_rx_ratio;
889+
PGM_API extern PGM_MetaAttribute const* const PGM_def_update_source_z01_ratio;
887890
// component sym_voltage_sensor
888891
PGM_API extern PGM_MetaComponent const* const PGM_def_update_sym_voltage_sensor;
889892
// attributes of update sym_voltage_sensor

power_grid_model_c/power_grid_model_c/src/dataset_definitions.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,9 @@ PGM_MetaAttribute const* const PGM_def_update_source_id = PGM_meta_get_attribute
873873
PGM_MetaAttribute const* const PGM_def_update_source_status = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "status");
874874
PGM_MetaAttribute const* const PGM_def_update_source_u_ref = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "u_ref");
875875
PGM_MetaAttribute const* const PGM_def_update_source_u_ref_angle = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "u_ref_angle");
876+
PGM_MetaAttribute const* const PGM_def_update_source_sk = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "sk");
877+
PGM_MetaAttribute const* const PGM_def_update_source_rx_ratio = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "rx_ratio");
878+
PGM_MetaAttribute const* const PGM_def_update_source_z01_ratio = PGM_meta_get_attribute_by_name(nullptr, "update", "source", "z01_ratio");
876879
// component sym_voltage_sensor
877880
PGM_MetaComponent const* const PGM_def_update_sym_voltage_sensor = PGM_meta_get_component_by_name(nullptr, "update", "sym_voltage_sensor");
878881
// attributes of update sym_voltage_sensor

0 commit comments

Comments
 (0)