Files
qt5-legatus-legacy/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplFiredBullet.hpp
T
2026-08-13 18:33:10 +02:00

131 lines
3.3 KiB
C++
Executable File

#pragma once
// **************************************************************************
//
// (C) Copyright 2009 Swiss SIMTEC AG
//
// **************************************************************************
//
// $HeadURL$
// $LastChangedBy$
// $LastChangedDate$
// $LastChangedRevision$
//
// **************************************************************************
// from stereotyped includes
#include "GeoPairingImplSensorData.hpp"
#include "GeoPairingImplMeteoData.hpp"
#include "GeoPairingImplTrajectoryData.hpp"
#include "GeoPairingImplImpactData.hpp"
#include <FW_Ballistic/BallisticService.hpp>
#include "../logger.h"
#include <iostream>
#include <memory>
namespace N_GeoPairingImpl
{
/**
* This class represents the virtual bullet that was shot.
*
* @author Daniel.Schmid
* @version 1.0
* @created 29-Sep-2009 16:15:05
*/
class GeoPairingImplFiredBullet
{
public:
/**
* This is the result of the calculation. The calculation has either not been done
* (e_NONE), processed correctly (e_OK), out of the terrain range (e_OUTOFRANGE),
* or took too long (e_TIMEOUT)
*
* @author Daniel.Schmid
* @version 1.0
* @created 11-Feb-2010 08:51:23
*/
enum E_CalcResult
{
e_NONE = 0,
e_OK,
e_OUTOFRANGE,
e_TIMEOUT
};
GeoPairingImplTrajectoryData m_TrajectoryData;
/**
* Constructur taking the SensorData as input values
*
* @param a_sensorData
*/
explicit GeoPairingImplFiredBullet(const GeoPairingImplSensorData &a_sensorData,
const char *loggerName = nullptr);
/**
* destructor
*/
virtual ~GeoPairingImplFiredBullet() = default;
/**
* Performs the calculation of the trajectory and also returns the result of
* calculation
*/
virtual GeoPairingImplFiredBullet::E_CalcResult calculate(const std::shared_ptr<N_Ballistic::BallisticService> &ballisticService);
virtual GeoPairingImplFiredBullet::E_CalcResult calculateG5G6(double entfernung, double drift, double flugzeit);
/**
* Performs the calculation of multiple trajectories and also returns the result
* of calculation
*
* @param a_nbrRounds
* @param a_widthField
* @param a_lengthField
* @param a_duration
* @param a_heading
*/
virtual GeoPairingImplFiredBullet::E_CalcResult calculateSalve(const std::shared_ptr<N_Ballistic::BallisticService> &ballisticService,
int a_nbrRounds, double &a_widthField,
double &a_lengthField, double &a_duration,
double &a_heading);
/**
* retrieves the Impact Data
*/
GeoPairingImplImpactData *getImpactData();
/**
* retrieves the Trajectory Data
*/
GeoPairingImplTrajectoryData *getTrajectoryData();
/**
* Sets the meteo data that are considered for this bullet
*
* @param a_meteoData
*/
void setMeteoData(const GeoPairingImplMeteoData &a_meteoData);
/**
* spreads the sensor heading and pitch in the min/max field, using random values
*/
void prepareSensorData();
protected:
GeoPairingImplSensorData m_SensorData;
GeoPairingImplMeteoData m_MeteoData;
GeoPairingImplImpactData m_ImpactData;
NGL::INGLLogger &m_logger;
};
}