Compare commits

..

7 Commits

Author SHA1 Message Date
Max Luebke
fb44cdd679 fix: iterate over SO headers instead of values during initialization 2025-09-23 13:15:16 +02:00
Marco De Lucia
b9fbb85fe8 add getSelectedOutputNames() to poet/test/testGetterscpp 2025-09-23 13:15:16 +02:00
Max Lübke
f95c765e67 fix: throw error when number of headings is not equal to parsed values 2025-09-23 13:15:16 +02:00
Max Lübke
868aedaa41 fix: reenable setting of SelectedOutputUserNumber 2025-09-23 13:15:16 +02:00
Max Luebke
1b12899ffb Selected Output: First prototype with successfull exisiting tests 2025-09-23 13:15:16 +02:00
Max Lübke
953c752431 Merge branch 'fix-exchange' into 'poet'
fix: ensure proper value assignment for exchange totals

See merge request naaice/iphreeqc!31
2025-09-23 12:09:20 +02:00
Max Lübke
a23a1a9f40 fix: ensure proper value assignment for exchange totals 2025-09-23 12:06:55 +02:00

View File

@ -8,6 +8,9 @@ ExchangeWrapper::ExchangeCompWrapper::ExchangeCompWrapper(cxxExchComp &comp)
void ExchangeWrapper::ExchangeCompWrapper::get( void ExchangeWrapper::ExchangeCompWrapper::get(
std::span<LDBLE> &exchange) const { std::span<LDBLE> &exchange) const {
std::size_t exch_index = this->NUM_NOT_TOTALS;
exchange[0] = exch_comp.Get_totals().find(exch_comp.Get_formula())->second; exchange[0] = exch_comp.Get_totals().find(exch_comp.Get_formula())->second;
exchange[1] = exch_comp.Get_charge_balance(); exchange[1] = exch_comp.Get_charge_balance();
exchange[2] = exch_comp.Get_la(); exchange[2] = exch_comp.Get_la();
@ -16,15 +19,16 @@ void ExchangeWrapper::ExchangeCompWrapper::get(
for (const auto &[name, value] : exch_comp.Get_totals()) { for (const auto &[name, value] : exch_comp.Get_totals()) {
if (name != exch_comp.Get_formula()) { if (name != exch_comp.Get_formula()) {
exchange[NUM_NOT_TOTALS + exchange[exch_index++] = value;
std::distance(exch_comp.Get_totals().begin(),
exch_comp.Get_totals().find(name))] = value;
} }
} }
} }
void ExchangeWrapper::ExchangeCompWrapper::set( void ExchangeWrapper::ExchangeCompWrapper::set(
const std::span<LDBLE> &exchange) { const std::span<LDBLE> &exchange) {
std::size_t exch_index = this->NUM_NOT_TOTALS;
exch_comp.Get_totals().find(exch_comp.Get_formula())->second = exchange[0]; exch_comp.Get_totals().find(exch_comp.Get_formula())->second = exchange[0];
exch_comp.Set_charge_balance(exchange[1]); exch_comp.Set_charge_balance(exchange[1]);
exch_comp.Set_la(exchange[2]); exch_comp.Set_la(exchange[2]);
@ -33,9 +37,7 @@ void ExchangeWrapper::ExchangeCompWrapper::set(
for (auto &[name, value] : exch_comp.Get_totals()) { for (auto &[name, value] : exch_comp.Get_totals()) {
if (name != exch_comp.Get_formula()) { if (name != exch_comp.Get_formula()) {
value = exchange[NUM_NOT_TOTALS + value = exchange[exch_index++];
std::distance(exch_comp.Get_totals().begin(),
exch_comp.Get_totals().find(name))];
} }
} }
} }