#pragma once #include "SimCore/Messages/GroundThruthTrack.hpp" #include "SimCore/Messages/Track.hpp" #include #include #include #include #include #include #include #include #include namespace Entities { class Sensor { public: Sensor(SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress); ~Sensor(); void start(); void stop(); protected: std::shared_ptr>> incommingTrackMessages = nullptr; std::shared_ptr> incommingGroundThruthMessages = nullptr; std::shared_ptr> outgoingGroundThruthMessages = nullptr; std::shared_ptr> incommingParentMessages = nullptr; std::shared_ptr> outgoingParentMessages = nullptr; virtual void specificSensorCalculations() = 0; virtual void specificReloadCharacteristicts() = 0; std::shared_ptr ownShipPosition_ = nullptr; private: SimCore::Identifier OwnID_; SimCore::Identifier ParentID_; SimCore::SensorKinds SensorKind_; std::uint32_t GroundTruthPort_; std::uint32_t ParentPort_; std::string ParentIPAddress_; std::shared_ptr GroundTruthUDPService_ = nullptr; std::shared_ptr ParentUDPService_ = nullptr; void groundThruthData(); void parentData(); void SensorCalculations(); void ReloadCharacteristicts(); std::atomic stopReceivingGroundThruth = false; std::atomic ReceivingGroundThruthIsRunnung = false; std::atomic stopsendCalculatedData = false; std::atomic sendCalculatedDataIsRunnung = false; std::atomic stopCalculationData = false; std::atomic CalculationIsRunnung = false; std::thread receiveGroundTruthThread; std::thread sendCalculatedDataThread; std::thread sensorCalculationThread; }; }