91 lines
2.2 KiB
C++
91 lines
2.2 KiB
C++
|
|
#include "SimCore/Identifier.hpp"
|
|
#include "SimCore/Orientation.hpp"
|
|
#include "SimCore/Position.hpp"
|
|
#include "WHISPER/Messages/Message.hpp"
|
|
#include <SimCore/SimCore.hpp>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <thread>
|
|
#include <tuple>
|
|
#define CATCH_CONFIG_MAIN
|
|
#include <catch2/catch.hpp>
|
|
#include <Entities/Entity.hpp>
|
|
|
|
// SimCore::Identifier OwnID, SimCore::Identifier ParentID, SimCore::SensorKinds SensorKind,std::uint32_t GroundTruthPort, std::uint32_t ParentPort,std::string ParentIPAddress
|
|
class Ship : public Entities::Entity
|
|
{
|
|
|
|
public:
|
|
Ship(SimCore::Identifier OwnID,
|
|
std::string EntityName,
|
|
WHISPER::SourceType ownType,
|
|
SimCore::Kind::EntityKind EntityKind,
|
|
std::uint32_t GroundTruthPort,
|
|
ushort CommandPort
|
|
):
|
|
Entity( OwnID,EntityName,ownType, 10000, EntityKind,SimCore::Side::EntitySide::FRIEND, "127.0.0.1",GroundTruthPort, CommandPort, 5557,false)
|
|
{
|
|
SimCore::Position pos1;
|
|
pos1.setGeodesicPos(55, 6, 0);
|
|
// Movement_.setPosition(pos1);
|
|
// Movement_.setCourse(0);
|
|
// Movement_.setSpeed(100);
|
|
|
|
// LOG_S(INFO)<<std::endl<<Movement_.getPosition().getGeodesicPos();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
private:
|
|
|
|
void childWorker() override
|
|
{
|
|
|
|
|
|
|
|
// LOG_S(INFO)<<std::endl<<Movement_.getPosition().getGeodesicPos();
|
|
// double distance, bearing1;
|
|
// std::tie(distance, bearing1) = Movement_.getPosition().distanceBearingToPosition(pos1);
|
|
// LOG_S(INFO)<<"distance from start is:" << distance;
|
|
};
|
|
|
|
void stopChild() override
|
|
{
|
|
|
|
};
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
SCENARIO("Testing the SimCore Sensor")
|
|
{
|
|
GIVEN("different Attributes for a Track in different forms")
|
|
{
|
|
SimCore::Identifier ID1;
|
|
Ship Ship(ID1,"FGSHamburg",WHISPER::SourceType::ENTITY,SimCore::Kind::EntityKind::SURFACE,8000,8001);
|
|
Ship.start();
|
|
std::this_thread::sleep_for(std::chrono::milliseconds(10000));
|
|
Ship.stop();
|
|
WHEN("constructing Track Object with data")
|
|
{
|
|
|
|
THEN("check if Track attributes are correct")
|
|
{
|
|
// REQUIRE(testOperator == true);
|
|
|
|
|
|
|
|
|
|
|
|
} //THEN
|
|
} // WHEN
|
|
} // GIVEN
|
|
} //SCENARIO
|