| 25 | } |
| 26 | |
| 27 | void updateAtomSelectionDebug(const DebugViews& debugViews, const Lattice::Simulation& simulation) { |
| 28 | const AtomStorage& atoms = simulation.atoms(); |
| 29 | const auto& selectedAtomIds = ToolsManager::pickingSystem->getSelectedAtomIds(); |
| 30 | if (selectedAtomIds.size() == 1) { |
| 31 | debugViews.atomSingle->visible = true; |
| 32 | debugViews.atomBatch->visible = false; |
| 33 | const size_t selectedIndex = atoms.indexOf(*selectedAtomIds.begin()); |
| 34 | if (selectedIndex < atoms.size()) { |
| 35 | debugViews.atomSingle->add_data("Позиция", atoms.pos(selectedIndex)); |
| 36 | const float speed = glm::length(atoms.vel(selectedIndex)); |
| 37 | debugViews.atomSingle->add_data("Скорость (A/dt)", speed); |
| 38 | debugViews.atomSingle->add_data("Скорость (м/с)", speed * Units::SpeedUnitToMps); |
| 39 | debugViews.atomSingle->add_data("Скорость (км/ч)", speed * Units::SpeedUnitToKmph); |
| 40 | debugViews.atomSingle->add_data("Силы", atoms.force(selectedIndex)); |
| 41 | debugViews.atomSingle->add_data("Пред. силы", atoms.prevForce(selectedIndex)); |
| 42 | debugViews.atomSingle->add_data("Потенциальная энергия", atoms.energy(selectedIndex)); |
| 43 | const AtomData::Type atomType = atoms.type(selectedIndex); |
| 44 | debugViews.atomSingle->add_data("Масса", AtomData::getProps(atomType).mass); |
| 45 | debugViews.atomSingle->add_data("Радиус", AtomData::getProps(atomType).radius); |
| 46 | debugViews.atomSingle->add_data("Тип", static_cast<int>(atomType)); |
| 47 | } |
| 48 | } |
| 49 | else { |
| 50 | debugViews.atomBatch->visible = true; |
| 51 | debugViews.atomSingle->visible = false; |
| 52 | debugViews.atomBatch->add_data("Выбрано атомов", selectedAtomIds.size()); |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | void updateSimulationDebug(const DebugViews& debugViews, const Lattice::Simulation& simulation, std::string_view integratorName) { |
| 57 | struct StepsRateSample { |