| 33 | } |
| 34 | |
| 35 | void StatisticsWindow::initIntern(SimulationFacade simulationFacade) |
| 36 | { |
| 37 | _simulationFacade = simulationFacade; |
| 38 | |
| 39 | auto path = std::filesystem::current_path(); |
| 40 | if (path.has_parent_path()) { |
| 41 | path = path.parent_path(); |
| 42 | } |
| 43 | _startingPath = GlobalSettings::get().getValue("windows.statistics.starting path", path.string()); |
| 44 | _settingsOpen = GlobalSettings::get().getValue("windows.statistics.settings.open", _settingsOpen); |
| 45 | _settingsHeight = GlobalSettings::get().getValue("windows.statistics.settings.height", scale(SettingsHeight)); |
| 46 | _plotHeight = GlobalSettings::get().getValue("windows.statistics.plot height", _plotHeight); |
| 47 | _plotMode = GlobalSettings::get().getValue("windows.statistics.mode", _plotMode); |
| 48 | _timeHorizonForLiveStatistics = GlobalSettings::get().getValue("windows.statistics.live horizon", _timeHorizonForLiveStatistics); |
| 49 | _timeHorizonForLongtermStatistics = GlobalSettings::get().getValue("windows.statistics.long term horizon", _timeHorizonForLongtermStatistics); |
| 50 | _plotType = GlobalSettings::get().getValue("windows.statistics.plot type", _plotType); |
| 51 | _plotScale = GlobalSettings::get().getValue("windows.statistics.plot scale", _plotScale); |
| 52 | auto collapsedPlotIndexJoinedString = GlobalSettings::get().getValue("windows.statistics.collapsed plot indices", std::string()); |
| 53 | |
| 54 | if (!collapsedPlotIndexJoinedString.empty()) { |
| 55 | std::vector<std::string> collapsedPlotIndexStrings; |
| 56 | boost::split(collapsedPlotIndexStrings, collapsedPlotIndexJoinedString, boost::is_any_of(" ")); |
| 57 | for (auto const& s : collapsedPlotIndexStrings) { |
| 58 | _collapsedPlotIndices.emplace(std::stoi(s)); |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | StatisticsWindow::StatisticsWindow() |
| 64 | : AlienWindow("Statistics", "windows.statistics", false) |