Compare commits

...

3 Commits

Author SHA1 Message Date
Marco De Lucia
29fbbc657b add getSelectedOutputNames() to poet/test/testGetterscpp 2025-08-01 11:41:14 +02:00
Max Lübke
e1ee3f801a fix: throw error when number of headings is not equal to parsed values 2025-08-01 11:13:48 +02:00
Max Lübke
f3444ab2fa fix: reenable setting of SelectedOutputUserNumber 2025-08-01 11:12:10 +02:00
2 changed files with 11 additions and 2 deletions

View File

@ -15,6 +15,11 @@ PhreeqcSelectedOutputParser::PhreeqcSelectedOutputParser(
if (this->_m_has_selected_output) {
parseHeader();
if (this->_m_headings.size() != this->getValues(1).size()) {
throw std::runtime_error(
"Number of headings does not match number of values in selected "
"output.");
}
}
}
@ -132,7 +137,7 @@ PhreeqcSelectedOutputParser::getValues(std::uint32_t cell_id) const {
if (!this->hasSelectedOutput()) {
return {}; // No selected output defined
}
// this->_m_pqc_instance->SetCurrentSelectedOutputUserNumber(cell_id);
this->_m_pqc_instance->SetCurrentSelectedOutputUserNumber(cell_id);
const std::string selected_output_string =
_m_pqc_instance->GetSelectedOutputString();

View File

@ -1,4 +1,4 @@
// Time-stamp: "Last modified 2025-07-28 20:14:08 delucia"
// Time-stamp: "Last modified 2025-08-01 10:54:30 delucia"
#include <iostream>
#include <iomanip>
#include <linux/limits.h>
@ -96,6 +96,10 @@ int main(int argc, char *argv[]) {
auto outonly = pqc_mat1.getMatrixOutOnly();
std::cout << ":: pqc_mat1.getMatrixOutOnly(): \n";
std::cout << outonly << "\n\n";
auto selout = pqc_mat1.getSelectedOutputNames();
std::cout << ":: pqc_mat1.getSelectedOutputNames(): \n";
std::cout << selout << "\n\n";
return 0;
}