ADD: SensorManager with Trackfusion Trackstore and Sensor List wich contains every contact a sensor has
This commit is contained in:
@@ -2,10 +2,13 @@
|
||||
|
||||
#include "DirectCommunicationServer.hpp"
|
||||
#include "Entities/SensorControl.hpp"
|
||||
#include "Entities/Tracklist/Trackfusion.hpp"
|
||||
#include "SimCore/Identifier.hpp"
|
||||
#include "SimCore/Messages/SimTrack.hpp"
|
||||
#include "SimCore/Messages/TracklistUpdate.hpp"
|
||||
#include "SimCore/SimCore.hpp"
|
||||
#include "kubecontrol/PodController.hpp"
|
||||
#include <cstddef>
|
||||
#include <loguru.hpp>
|
||||
|
||||
#include <map>
|
||||
@@ -36,12 +39,34 @@ namespace Entities
|
||||
*/
|
||||
void stopSenser(std::string uuid);
|
||||
|
||||
/**
|
||||
* @brief stopps all sensors
|
||||
*
|
||||
*/
|
||||
void stopAllSensors();
|
||||
|
||||
/**
|
||||
*@brief deletes a sensor pod based on the uuid
|
||||
*@param string uuid sensor
|
||||
*/
|
||||
void deleteSensor(std::string uuid);
|
||||
|
||||
/**
|
||||
* @brief deletes all sensors
|
||||
*
|
||||
*/
|
||||
void deleteAllSensor();
|
||||
|
||||
/**
|
||||
* @brief Get the Sensor By UUID
|
||||
*
|
||||
* @param uuid
|
||||
* @return std::shared_ptr<Sensor::SensorControl>
|
||||
*/
|
||||
std::shared_ptr<Sensor::SensorControl> getSensorByUUID(std::string uuid);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*@brief get the Tracklist as JSON formatted string where you can see the tracks every sensor detects
|
||||
*@return string - JSON formatted string
|
||||
@@ -62,15 +87,49 @@ namespace Entities
|
||||
*/
|
||||
void updateTracklistForSensor(std::string uuidSensor, std::shared_ptr<SimCore::SimTrack> track);
|
||||
|
||||
/**
|
||||
* @brief sends a message to a specific sensor if uuid is passed else it sends to everyone
|
||||
*
|
||||
* @param message - string of the message
|
||||
* @param uuid - uuid as string
|
||||
*/
|
||||
void sendMessageToSensor(std::string message, std::string uuid = "");
|
||||
|
||||
/**
|
||||
* @brief adds a Sensorcontroll unique pointer to sensor store without starting a pod. it is just local
|
||||
* @param sensor
|
||||
*
|
||||
*/
|
||||
void addSensorLocal(std::unique_ptr<Sensor::SensorControl> sensor);
|
||||
|
||||
/**
|
||||
* @brief Get the number of sensors
|
||||
*
|
||||
* @return size_t
|
||||
*/
|
||||
size_t getSensorCount();
|
||||
|
||||
/**
|
||||
* @brief Get the Track List Update object
|
||||
*
|
||||
* @return std::unique_ptr<SimCore::TracklistUpdate>
|
||||
*/
|
||||
std::unique_ptr<SimCore::TracklistUpdate> getTrackListUpdate();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
const SimCore::Identifier OwnId_;
|
||||
ushort SensorPort_ = 5557;
|
||||
|
||||
std::map<std::string, std::unique_ptr<Entities::SensorControl>> SensorStore;
|
||||
std::map<std::string, std::shared_ptr<Sensor::SensorControl>> SensorStore;
|
||||
|
||||
std::shared_ptr<kubecontrol::PodController> PodController_;
|
||||
|
||||
TrackList::Trackfusion Trackfusion_;
|
||||
|
||||
|
||||
|
||||
std::shared_ptr<DirectCommunication::DirectCommunicationServer> SensorServer_ = nullptr;
|
||||
void handlSensorMessages(std::string Message);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user