Session 022: Migrate Lts/Tools (72 submodules) to Qt6

- Copied complete Lts/Tools directory from qt5-before to qt6-after
- Updated 32 CMakeLists.txt files (Qt5:: → Qt6::)
- Tools subdirectory already included in parent Lts/CMakeLists.txt
- All 72 tool submodules now present in qt6-migrated-legatus
- Includes: Adler, ArAssets, ConfigX, DBAdministration, DBUpdate,
  DdsView, InfrastructureManagement, and 67 more tools
- C++17 standard (RTI 7.7.0 compatibility maintained)
- Tests deferred until final validation phase

Migration progress:
✅ Lts/Application (68 files)
✅ Lts/DDS (verified Qt6-ready)
✅ Lts/Plugins (60 submodules, verified)
✅ Lts/Projects (5 submodules, verified)
✅ Lts/Proxies (13 submodules, verified)
✅ Lts/Services (47 submodules, verified)
✅ Lts/Tools (72 submodules, copied + CMake updated)
✅ Lts/Viewer (LtsFileDialog, LtsReportDisplay, SituationMap)
🟡 TetraIF (partial)
🟡 Z (partial: nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface)
This commit is contained in:
torsten committed 2026-08-25 14:07:20 +02:00
1 parent 01dce5fe52
commit d5c13033e2
1792 files changed
+982018

No files matched your search

@@ -0,0 +1,111 @@
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream> // Für Dateioperationen
#include <cmath>
#include <vector>
#include <random>
#include <string>
struct State {
double t, x, y, z;
};
class BallistikSimulator {
private:
const double g = 9.81;
const double rho = 1.225;
std::mt19937 gen;
public:
BallistikSimulator() : gen(std::random_device{}()) {}
std::vector<State> simuliereFlug(double v0, double winkelGrad, double masse, double cw, double flaeche, double streuung) {
std::vector<State> trajektorie;
double winkelRad = (winkelGrad * M_PI / 180.0);
// Zufallseinfluss auf den Startwinkel (Streuung)
std::normal_distribution<double> d_winkel(0.0, streuung * 0.01);
double variierterWinkel = winkelRad + d_winkel(gen);
double vx = v0 * std::cos(variierterWinkel);
double vy = v0 * std::sin(variierterWinkel);
double vz = d_winkel(gen) * v0; // Seitliche Abweichung
double x = 0, y = 0, z = 0, t = 0;
double dt = 0.01;
while (y >= 0) {
trajektorie.push_back({ t, x, y, z });
double v = std::sqrt(vx * vx + vy * vy + vz * vz);
double Fw = 0.5 * rho * v * v * cw * flaeche;
vx += (-(Fw * (vx / v)) / masse) * dt;
vy += (-g - (Fw * (vy / v)) / masse) * dt;
vz += (-(Fw * (vz / v)) / masse) * dt;
x += vx * dt;
y += vy * dt;
z += vz * dt;
t += dt;
if (trajektorie.size() > 20000) break;
}
return trajektorie;
}
// Neue Funktion zum Speichern der Daten
void speichereInCSV(const std::vector<State>& pfad, const std::string& dateiname) {
std::ofstream datei(dateiname);
if (datei.is_open()) {
// Header für die CSV-Datei
datei << "Zeit(s);X(Distanz);Y(Hoehe);Z(Seite)\n";
for (const auto& p : pfad) {
datei << p.t << ";" << p.x << ";" << p.y << ";" << p.z << "\n";
}
datei.close();
std::cout << "Daten erfolgreich in " << dateiname << " gespeichert.\n";
}
else {
std::cerr << "Fehler: Datei konnte nicht geöffnet werden!\n";
}
}
void exportiere3DTrajektorien(int anzahl, double v0, double winkel, double masse, double cw, double flaeche, double streuung) {
std::ofstream datei("3d_flugbahnen.csv");
datei << "SchussID;X;Y;Z\n";
for (int i = 0; i < anzahl; ++i) {
auto pfad = simuliereFlug(v0, winkel, masse, cw, flaeche, streuung);
for (const auto& p : pfad) {
datei << i << ";" << p.x << ";" << p.y << ";" << p.z << "\n";
}
}
datei.close();
std::cout << "3D-Daten in '3d_flugbahnen.csv' gespeichert.\n";
}
};
int main() {
BallistikSimulator sim;
// Simulations-Parameter
double v0 = 400.0; // m/s
double winkel = 20.0; // Grad
double masse = 0.015; // 15 Gramm
double cw = 0.29; // cw-Wert (Projektil)
double flaeche = 0.00006; // Querschnittsflaeche
double praezision = 0.2; // Streufaktor
// Flug simulieren
auto pfad = sim.simuliereFlug(v0, winkel, masse, cw, flaeche, praezision);
// Als CSV speichern
sim.speichereInCSV(pfad, "flugbahn.csv");
sim.exportiere3DTrajektorien(10, v0, winkel, masse, cw, flaeche, praezision);
return 0;
}