Skip to content

Commit

Permalink
change sigma
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 2c71a55 commit a0609c7
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 28 deletions.
7 changes: 2 additions & 5 deletions code_generation/data/attribute_classes/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,8 @@
},
{
"data_type": "double",
"names": [
"i_sigma",
"i_angle_sigma"
],
"description": "sigma of error margin of current (angle) measurement"
"names": "i_sigma",
"description": "sigma of error margin of current measurement"
}
]
},
Expand Down
5 changes: 1 addition & 4 deletions code_generation/data/attribute_classes/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@
"attributes": [
{
"data_type": "double",
"names": [
"i_sigma",
"i_angle_sigma"
],
"names": "i_sigma",
"description": "sigma of error margin of current (angle) measurement"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ struct GenericCurrentSensorInput {
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
double i_sigma{nan}; // sigma of error margin of current measurement

// implicit conversions to BaseInput
operator BaseInput&() { return reinterpret_cast<BaseInput&>(*this); }
Expand All @@ -469,8 +468,7 @@ struct CurrentSensorInput {
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
double i_sigma{nan}; // sigma of error margin of current measurement
RealValue<sym> i_measured{nan}; // measured current and current angle
RealValue<sym> i_angle_measured{nan}; // measured current and current angle

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,31 +398,29 @@ struct get_attributes_list<TransformerTapRegulatorInput> {

template<>
struct get_attributes_list<GenericCurrentSensorInput> {
static constexpr std::array<MetaAttribute, 6> value{
static constexpr std::array<MetaAttribute, 5> 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"),
};
};

template <symmetry_tag sym_type>
struct get_attributes_list<CurrentSensorInput<sym_type>> {
using sym = sym_type;

static constexpr std::array<MetaAttribute, 8> value{
static constexpr std::array<MetaAttribute, 7> 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"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::i_measured>(offsetof(CurrentSensorInput<sym>, i_measured), "i_measured"),
meta_data_gen::get_meta_attribute<&CurrentSensorInput<sym>::i_angle_measured>(offsetof(CurrentSensorInput<sym>, i_angle_measured), "i_angle_measured"),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,11 @@ template <symmetry_tag sym_type>
struct get_attributes_list<CurrentSensorUpdate<sym_type>> {
using sym = sym_type;

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

meta_data_gen::get_meta_attribute<&CurrentSensorUpdate<sym>::id>(offsetof(CurrentSensorUpdate<sym>, id), "id"),
meta_data_gen::get_meta_attribute<&CurrentSensorUpdate<sym>::i_sigma>(offsetof(CurrentSensorUpdate<sym>, i_sigma), "i_sigma"),
meta_data_gen::get_meta_attribute<&CurrentSensorUpdate<sym>::i_angle_sigma>(offsetof(CurrentSensorUpdate<sym>, i_angle_sigma), "i_angle_sigma"),
meta_data_gen::get_meta_attribute<&CurrentSensorUpdate<sym>::i_measured>(offsetof(CurrentSensorUpdate<sym>, i_measured), "i_measured"),
meta_data_gen::get_meta_attribute<&CurrentSensorUpdate<sym>::i_angle_measured>(offsetof(CurrentSensorUpdate<sym>, i_angle_measured), "i_angle_measured"),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,13 +549,11 @@ static_assert(std::same_as<decltype(CurrentSensorInput<symmetric_t>::measured_ob
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));
// static asserts for CurrentSensorInput<asymmetric_t>
static_assert(std::is_standard_layout_v<CurrentSensorInput<asymmetric_t>>);
// static asserts for conversion of CurrentSensorInput<asymmetric_t> to BaseInput
Expand All @@ -575,13 +573,11 @@ static_assert(std::same_as<decltype(CurrentSensorInput<asymmetric_t>::measured_o
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));
// static asserts for SymCurrentSensorInput
static_assert(std::is_standard_layout_v<SymCurrentSensorInput>);
// static asserts for conversion of SymCurrentSensorInput to BaseInput
Expand All @@ -601,13 +597,11 @@ static_assert(std::same_as<decltype(SymCurrentSensorInput::measured_object), dec
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));
// static asserts for AsymCurrentSensorInput
static_assert(std::is_standard_layout_v<AsymCurrentSensorInput>);
// static asserts for conversion of AsymCurrentSensorInput to BaseInput
Expand All @@ -627,13 +621,11 @@ static_assert(std::same_as<decltype(AsymCurrentSensorInput::measured_object), de
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
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ struct CurrentSensorUpdate {

ID id{na_IntID}; // ID of the object
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
RealValue<sym> i_measured{nan}; // measured current and current angle
RealValue<sym> i_angle_measured{nan}; // measured current and current angle

Expand Down

0 comments on commit a0609c7

Please sign in to comment.