MCPcopy Create free account
hub / github.com/chrxh/alien / updateLocations

Method updateLocations

source/Gui/SimulationParametersMainWindow.cpp:721–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

719}
720
721void SimulationParametersMainWindow::updateLocations()
722{
723 auto parameters = _simulationFacade->getSimulationParameters();
724
725 _locations = std::vector<Location>(1 + parameters.numZones + parameters.numRadiationSources);
726 auto strength = SimulationParametersEditService::get().getRadiationStrengths(parameters);
727 auto pinnedString = strength.pinned.contains(0) ? ICON_FA_THUMBTACK " " : " ";
728 _locations.at(0) = Location{"Base", LocationType::Base, "-", pinnedString + StringHelper::format(strength.values.front() * 100 + 0.05f, 1) + "%"};
729 for (int i = 0; i < parameters.numZones; ++i) {
730 auto const& zone = parameters.zone[i];
731 auto position = "(" + StringHelper::format(zone.posX, 0) + ", " + StringHelper::format(zone.posY, 0) + ")";
732 _locations.at(zone.locationIndex) = Location{zone.name, LocationType::ParameterZone, position};
733 }
734 for (int i = 0; i < parameters.numRadiationSources; ++i) {
735 auto const& source = parameters.radiationSource[i];
736 auto position = "(" + StringHelper::format(source.posX, 0) + ", " + StringHelper::format(source.posY, 0) + ")";
737 auto pinnedString = strength.pinned.contains(i + 1) ? ICON_FA_THUMBTACK " " : " ";
738 _locations.at(source.locationIndex) = Location{
739 source.name, LocationType::RadiationSource, position, pinnedString + StringHelper::format(strength.values.at(i + 1) * 100 + 0.05f, 1) + "%"};
740 }
741}
742
743void SimulationParametersMainWindow::setDefaultShapeDataForZone(SimulationParametersZone& spot) const
744{

Callers

nothing calls this directly

Calls 2

getRadiationStrengthsMethod · 0.80

Tested by

no test coverage detected