mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Fixed bug that caused selected_output to
accumulate in selected_output storage
This commit is contained in:
parent
b4b9e7da01
commit
6721837c27
19
IPhreeqc.cpp
19
IPhreeqc.cpp
@ -1164,7 +1164,6 @@ void IPhreeqc::check_database(const char* sz_routine)
|
|||||||
delete (*it).second;
|
delete (*it).second;
|
||||||
}
|
}
|
||||||
this->SelectedOutputMap.clear();
|
this->SelectedOutputMap.clear();
|
||||||
this->SelectedOutputStringMap.clear();
|
|
||||||
|
|
||||||
// release
|
// release
|
||||||
this->LogString.clear();
|
this->LogString.clear();
|
||||||
@ -1172,13 +1171,15 @@ void IPhreeqc::check_database(const char* sz_routine)
|
|||||||
this->OutputString.clear();
|
this->OutputString.clear();
|
||||||
this->OutputLines.clear();
|
this->OutputLines.clear();
|
||||||
|
|
||||||
|
// clear selected_output string storage
|
||||||
|
// GetSelectedOutputStringLine and GetSelectedOutputString
|
||||||
std::map< int, std::string >::iterator mit = SelectedOutputStringMap.begin();
|
std::map< int, std::string >::iterator mit = SelectedOutputStringMap.begin();
|
||||||
for (; mit != SelectedOutputStringMap.begin(); ++mit)
|
for (; mit != SelectedOutputStringMap.end(); ++mit)
|
||||||
{
|
{
|
||||||
(*mit).second.clear();
|
(*mit).second.clear();
|
||||||
}
|
}
|
||||||
std::map< int, std::vector< std::string > >::iterator lit = this->SelectedOutputLinesMap.begin();
|
std::map< int, std::vector< std::string > >::iterator lit = this->SelectedOutputLinesMap.begin();
|
||||||
for (; lit != this->SelectedOutputLinesMap.begin(); ++lit)
|
for (; lit != this->SelectedOutputLinesMap.end(); ++lit)
|
||||||
{
|
{
|
||||||
(*lit).second.clear();
|
(*lit).second.clear();
|
||||||
}
|
}
|
||||||
@ -1246,6 +1247,18 @@ void IPhreeqc::do_run(const char* sz_routine, std::istream* pis, PFN_PRERUN_CALL
|
|||||||
if (this->PhreeqcPtr->read_input() == EOF)
|
if (this->PhreeqcPtr->read_input() == EOF)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (this->PhreeqcPtr->simulation == 1)
|
||||||
|
{
|
||||||
|
// force headings for selected output (on every call to do_run)
|
||||||
|
// might want to split tidy_punch to avoid duplicate searches like master_bsearch
|
||||||
|
std::map< int, SelectedOutput >::iterator pit = this->PhreeqcPtr->SelectedOutput_map.begin();
|
||||||
|
for (; pit != this->PhreeqcPtr->SelectedOutput_map.end(); ++pit)
|
||||||
|
{
|
||||||
|
(*pit).second.Set_new_def(true);
|
||||||
|
this->PhreeqcPtr->keycount[Keywords::KEY_SELECTED_OUTPUT] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// bool bWarning = false;
|
// bool bWarning = false;
|
||||||
std::map< int, SelectedOutput >::iterator mit = this->PhreeqcPtr->SelectedOutput_map.begin();
|
std::map< int, SelectedOutput >::iterator mit = this->PhreeqcPtr->SelectedOutput_map.begin();
|
||||||
for (; mit != this->PhreeqcPtr->SelectedOutput_map.end(); ++mit)
|
for (; mit != this->PhreeqcPtr->SelectedOutput_map.end(); ++mit)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user