103 lines
2.4 KiB
C++
103 lines
2.4 KiB
C++
#pragma once
|
|
|
|
|
|
#include "SimCore/Identifier.hpp"
|
|
#include "SimCore/Messages/SimTrack.hpp"
|
|
#include "SimCore/SimCore.hpp"
|
|
#include <SimCore/Position.hpp>
|
|
#include <chrono>
|
|
#include <list>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace TrackList {
|
|
|
|
struct SensorData {
|
|
SimCore::Identifier sensorID;
|
|
// SimCore::Identifier SensorTrackID;
|
|
std::string Sensorname;
|
|
|
|
|
|
};
|
|
|
|
inline bool operator==(const SensorData& lhs, const SensorData& rhs)
|
|
{
|
|
return lhs.sensorID == rhs.sensorID;
|
|
|
|
}
|
|
|
|
|
|
|
|
class TracklistItem
|
|
{
|
|
public:
|
|
TracklistItem(std::shared_ptr<SimCore::SimTrack> track,SensorData sensorData);
|
|
TracklistItem(std::shared_ptr<SimCore::SimTrack> track);
|
|
|
|
SimCore::Identifier getID();
|
|
|
|
void setPosition(SimCore::Position position);
|
|
SimCore::Position getPosition();
|
|
|
|
void setSpeed(double speed);
|
|
double getSpeed();
|
|
|
|
void setCourse(double course);
|
|
double getCourse();
|
|
|
|
void setPitch(double pitch);
|
|
double getpitch();
|
|
|
|
double getBearing();
|
|
double getRange();
|
|
|
|
SimCore::ObjectSource getObjectSource();
|
|
|
|
std::chrono::time_point<std::chrono::steady_clock> getLastUpdateTimestamp();
|
|
|
|
void updateTrack(std::shared_ptr<SimCore::SimTrack> track,SensorData sensorData);
|
|
|
|
void updateTrack(std::shared_ptr<SimCore::SimTrack> track);
|
|
|
|
bool checkIfSensorIDIsIn(SimCore::Identifier SensorTrackID);
|
|
|
|
bool isSensorIDKnown(SimCore::Identifier);
|
|
|
|
void addSensorDataToSensorList(SensorData sensorData);
|
|
|
|
|
|
private:
|
|
const SimCore::Identifier trackID_;
|
|
|
|
/// position of the track
|
|
SimCore::Position position_;
|
|
/// speed the track
|
|
double speed_ = 0;
|
|
/// course of the track
|
|
double course_ = 0;
|
|
|
|
double pitch_ = 0;
|
|
|
|
/// bearing
|
|
double bearing_;
|
|
///range in meters
|
|
double range_;
|
|
//environment (AIR,SURFACE,SUBSURFACE,SPACE)
|
|
SimCore::Kind::EntityKind kind_;
|
|
|
|
std::chrono::time_point<std::chrono::steady_clock> lastUpdateTimestamp_;
|
|
|
|
SimCore::ObjectSource ObjectSource_;
|
|
|
|
std::vector<SensorData> SensorList;
|
|
|
|
|
|
bool isSensorinSensorlist(SensorData sensorData);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
} |