Skip to content

Commit

Permalink
Add population enablement setting to save files
Browse files Browse the repository at this point in the history
  • Loading branch information
naavis committed Feb 20, 2021
1 parent 38747a5 commit 3efccdc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/haloray-core/gui/stateSaver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ void StateSaver::SaveState(QString filename, SimulationEngine *engine, CrystalPo
auto population = crystals->get(i);

settings.setValue("Name", QString::fromStdString(crystals->getName(i)));
settings.setValue("Enabled", population.enabled);

settings.setValue("CaRatioAverage", (double)population.caRatioAverage);
settings.setValue("CaRatioStd", (double)population.caRatioStd);
Expand Down Expand Up @@ -96,6 +97,7 @@ void StateSaver::LoadState(QString filename, SimulationStateModel *simState, Cry
settings.setArrayIndex(i);
auto pop = CrystalPopulation::createRandom();
unsigned int weight = settings.value("Weight", 1).toUInt();
pop.enabled = settings.value("Enabled", pop.enabled).toBool();

pop.caRatioAverage = settings.value("CaRatioAverage", pop.caRatioAverage).toFloat();
pop.caRatioStd = settings.value("CaRatioStd", pop.caRatioStd).toFloat();
Expand Down

0 comments on commit 3efccdc

Please sign in to comment.