Skip to content

Commit

Permalink
add measured terminal type to input
Browse files Browse the repository at this point in the history
Signed-off-by: petersalemink95 <peter.salemink95@gmail.com>
  • Loading branch information
petersalemink95 committed Dec 24, 2024
1 parent 8dc4374 commit 5c09d74
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
5 changes: 5 additions & 0 deletions code_generation/data/attribute_classes/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@
"name": "GenericCurrentSensorInput",
"base": "SensorInput",
"attributes": [
{
"data_type": "MeasuredTerminalType",
"names": "measured_terminal_type",
"description": "type of measured terminal"
},
{
"data_type": "AngleMeasurementType",
"names": "angle_measurement_type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ struct TransformerTapRegulatorInput {
struct GenericCurrentSensorInput {
ID id{na_IntID}; // ID of the object
ID measured_object{na_IntID}; // ID of the measured object
MeasuredTerminalType measured_terminal_type{static_cast<MeasuredTerminalType>(na_IntS)}; // type of measured terminal
AngleMeasurementType angle_measurement_type{static_cast<AngleMeasurementType>(na_IntS)}; // type of angle measurement
double i_sigma{nan}; // sigma of error margin of current (angle) measurement
double i_angle_sigma{nan}; // sigma of error margin of current (angle) measurement
Expand All @@ -466,6 +467,7 @@ struct CurrentSensorInput {

ID id{na_IntID}; // ID of the object
ID measured_object{na_IntID}; // ID of the measured object
MeasuredTerminalType measured_terminal_type{static_cast<MeasuredTerminalType>(na_IntS)}; // type of measured terminal
AngleMeasurementType angle_measurement_type{static_cast<AngleMeasurementType>(na_IntS)}; // type of angle measurement
double i_sigma{nan}; // sigma of error margin of current (angle) measurement
double i_angle_sigma{nan}; // sigma of error margin of current (angle) measurement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,12 @@ struct get_attributes_list<TransformerTapRegulatorInput> {

template<>
struct get_attributes_list<GenericCurrentSensorInput> {
static constexpr std::array<MetaAttribute, 5> value{
static constexpr std::array<MetaAttribute, 6> value{
// all attributes including base class

meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::id>(offsetof(GenericCurrentSensorInput, id), "id"),
meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::measured_object>(offsetof(GenericCurrentSensorInput, measured_object), "measured_object"),
meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::measured_terminal_type>(offsetof(GenericCurrentSensorInput, measured_terminal_type), "measured_terminal_type"),
meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::angle_measurement_type>(offsetof(GenericCurrentSensorInput, angle_measurement_type), "angle_measurement_type"),
meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::i_sigma>(offsetof(GenericCurrentSensorInput, i_sigma), "i_sigma"),
meta_data_gen::get_meta_attribute<&GenericCurrentSensorInput::i_angle_sigma>(offsetof(GenericCurrentSensorInput, i_angle_sigma), "i_angle_sigma"),
Expand All @@ -413,11 +414,12 @@ template <symmetry_tag sym_type>
struct get_attributes_list<CurrentSensorInput<sym_type>> {
using sym = sym_type;

static constexpr std::array<MetaAttribute, 7> value{
static constexpr std::array<MetaAttribute, 8> value{
// all attributes including base class

meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::id>(offsetof(CurrentSensorInput<sym>, id), "id"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::measured_object>(offsetof(CurrentSensorInput<sym>, measured_object), "measured_object"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::measured_terminal_type>(offsetof(CurrentSensorInput<sym>, measured_terminal_type), "measured_terminal_type"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::angle_measurement_type>(offsetof(CurrentSensorInput<sym>, angle_measurement_type), "angle_measurement_type"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::i_sigma>(offsetof(CurrentSensorInput<sym>, i_sigma), "i_sigma"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::i_angle_sigma>(offsetof(CurrentSensorInput<sym>, i_angle_sigma), "i_angle_sigma"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,13 @@ static_assert(offsetof(CurrentSensorInput<symmetric_t>, measured_object) == offs
static_assert(std::alignment_of_v<CurrentSensorInput<symmetric_t>> >= std::alignment_of_v<GenericCurrentSensorInput>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::id), decltype(GenericCurrentSensorInput::id)>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::measured_object), decltype(GenericCurrentSensorInput::measured_object)>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::measured_terminal_type), decltype(GenericCurrentSensorInput::measured_terminal_type)>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::angle_measurement_type), decltype(GenericCurrentSensorInput::angle_measurement_type)>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::i_sigma), decltype(GenericCurrentSensorInput::i_sigma)>);
static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::i_angle_sigma), decltype(GenericCurrentSensorInput::i_angle_sigma)>);
static_assert(offsetof(CurrentSensorInput<symmetric_t>, id) == offsetof(GenericCurrentSensorInput, id));
static_assert(offsetof(CurrentSensorInput<symmetric_t>, measured_object) == offsetof(GenericCurrentSensorInput, measured_object));
static_assert(offsetof(CurrentSensorInput<symmetric_t>, measured_terminal_type) == offsetof(GenericCurrentSensorInput, measured_terminal_type));
static_assert(offsetof(CurrentSensorInput<symmetric_t>, angle_measurement_type) == offsetof(GenericCurrentSensorInput, angle_measurement_type));
static_assert(offsetof(CurrentSensorInput<symmetric_t>, i_sigma) == offsetof(GenericCurrentSensorInput, i_sigma));
static_assert(offsetof(CurrentSensorInput<symmetric_t>, i_angle_sigma) == offsetof(GenericCurrentSensorInput, i_angle_sigma));
Expand All @@ -570,11 +572,13 @@ static_assert(offsetof(CurrentSensorInput<asymmetric_t>, measured_object) == off
static_assert(std::alignment_of_v<CurrentSensorInput<asymmetric_t>> >= std::alignment_of_v<GenericCurrentSensorInput>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::id), decltype(GenericCurrentSensorInput::id)>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::measured_object), decltype(GenericCurrentSensorInput::measured_object)>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::measured_terminal_type), decltype(GenericCurrentSensorInput::measured_terminal_type)>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::angle_measurement_type), decltype(GenericCurrentSensorInput::angle_measurement_type)>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::i_sigma), decltype(GenericCurrentSensorInput::i_sigma)>);
static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::i_angle_sigma), decltype(GenericCurrentSensorInput::i_angle_sigma)>);
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, id) == offsetof(GenericCurrentSensorInput, id));
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, measured_object) == offsetof(GenericCurrentSensorInput, measured_object));
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, measured_terminal_type) == offsetof(GenericCurrentSensorInput, measured_terminal_type));
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, angle_measurement_type) == offsetof(GenericCurrentSensorInput, angle_measurement_type));
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, i_sigma) == offsetof(GenericCurrentSensorInput, i_sigma));
static_assert(offsetof(CurrentSensorInput<asymmetric_t>, i_angle_sigma) == offsetof(GenericCurrentSensorInput, i_angle_sigma));
Expand All @@ -594,11 +598,13 @@ static_assert(offsetof(SymCurrentSensorInput, measured_object) == offsetof(Senso
static_assert(std::alignment_of_v<SymCurrentSensorInput> >= std::alignment_of_v<GenericCurrentSensorInput>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::id), decltype(GenericCurrentSensorInput::id)>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::measured_object), decltype(GenericCurrentSensorInput::measured_object)>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::measured_terminal_type), decltype(GenericCurrentSensorInput::measured_terminal_type)>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::angle_measurement_type), decltype(GenericCurrentSensorInput::angle_measurement_type)>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::i_sigma), decltype(GenericCurrentSensorInput::i_sigma)>);
static_assert(std::same_as<decltype(SymCurrentSensorInput::i_angle_sigma), decltype(GenericCurrentSensorInput::i_angle_sigma)>);
static_assert(offsetof(SymCurrentSensorInput, id) == offsetof(GenericCurrentSensorInput, id));
static_assert(offsetof(SymCurrentSensorInput, measured_object) == offsetof(GenericCurrentSensorInput, measured_object));
static_assert(offsetof(SymCurrentSensorInput, measured_terminal_type) == offsetof(GenericCurrentSensorInput, measured_terminal_type));
static_assert(offsetof(SymCurrentSensorInput, angle_measurement_type) == offsetof(GenericCurrentSensorInput, angle_measurement_type));
static_assert(offsetof(SymCurrentSensorInput, i_sigma) == offsetof(GenericCurrentSensorInput, i_sigma));
static_assert(offsetof(SymCurrentSensorInput, i_angle_sigma) == offsetof(GenericCurrentSensorInput, i_angle_sigma));
Expand All @@ -618,11 +624,13 @@ static_assert(offsetof(AsymCurrentSensorInput, measured_object) == offsetof(Sens
static_assert(std::alignment_of_v<AsymCurrentSensorInput> >= std::alignment_of_v<GenericCurrentSensorInput>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::id), decltype(GenericCurrentSensorInput::id)>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::measured_object), decltype(GenericCurrentSensorInput::measured_object)>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::measured_terminal_type), decltype(GenericCurrentSensorInput::measured_terminal_type)>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::angle_measurement_type), decltype(GenericCurrentSensorInput::angle_measurement_type)>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::i_sigma), decltype(GenericCurrentSensorInput::i_sigma)>);
static_assert(std::same_as<decltype(AsymCurrentSensorInput::i_angle_sigma), decltype(GenericCurrentSensorInput::i_angle_sigma)>);
static_assert(offsetof(AsymCurrentSensorInput, id) == offsetof(GenericCurrentSensorInput, id));
static_assert(offsetof(AsymCurrentSensorInput, measured_object) == offsetof(GenericCurrentSensorInput, measured_object));
static_assert(offsetof(AsymCurrentSensorInput, measured_terminal_type) == offsetof(GenericCurrentSensorInput, measured_terminal_type));
static_assert(offsetof(AsymCurrentSensorInput, angle_measurement_type) == offsetof(GenericCurrentSensorInput, angle_measurement_type));
static_assert(offsetof(AsymCurrentSensorInput, i_sigma) == offsetof(GenericCurrentSensorInput, i_sigma));
static_assert(offsetof(AsymCurrentSensorInput, i_angle_sigma) == offsetof(GenericCurrentSensorInput, i_angle_sigma));
Expand Down

0 comments on commit 5c09d74

Please sign in to comment.