ADD: updated Libraries and tests

This commit is contained in:
Henry Winkel
2023-12-19 15:51:04 +01:00
parent 22149dc61d
commit e675535586
13 changed files with 42 additions and 33 deletions

View File

@@ -23,7 +23,7 @@ class Ship : public Entities::Entity
std::uint32_t GroundTruthPort,
ushort CommandPort
):
Entity( OwnID,EntityName,ownType, EntityKind,SimCore::Side::EntitySide::FRIEND, "127.0.0.1",GroundTruthPort, CommandPort,false)
Entity( OwnID,EntityName,ownType, 10000, EntityKind,SimCore::Side::EntitySide::FRIEND, "127.0.0.1",GroundTruthPort, CommandPort,false)
{
SimCore::Position pos1;
pos1.setGeodesicPos(55, 6, 0);
@@ -33,6 +33,11 @@ class Ship : public Entities::Entity
// LOG_S(INFO)<<std::endl<<Movement_.getPosition().getGeodesicPos();
}
private:
@@ -48,6 +53,11 @@ class Ship : public Entities::Entity
// LOG_S(INFO)<<"distance from start is:" << distance;
};
void stopChild() override
{
};
};

View File

@@ -14,26 +14,26 @@ class Radar : public Entities::Sensor
Radar(SimCore::Identifier OwnID,
SimCore::Identifier ParentID,
SimCore::SensorKinds SensorKind,
std::string GroundTruthAddress,
std::uint32_t GroundTruthPort,
std::uint32_t ParentPort,
std::string ParentIPAddress,
std::string radarType):Sensor(OwnID, ParentID, SensorKind, GroundTruthPort, ParentPort, ParentIPAddress),radarType_(radarType)
std::string radarType):Sensor(OwnID, ParentID, SensorKind,GroundTruthAddress, GroundTruthPort, ParentPort, ParentIPAddress),radarType_(radarType)
{
}
private:
std::string radarType_;
void specificSensorCalculations() override
void specificSensorCalculations(std::unique_ptr<SimCore::SimTrack> track) override
{
LOG_S(INFO)<<"calculating";
};
void specificReloadCharacteristicts() override
{
LOG_S(INFO)<<"loading specifications";
};
};
@@ -46,7 +46,7 @@ SCENARIO("Testing the SimCore Sensor")
SimCore::Identifier IDParent;
SimCore::Identifier IDRadar;
Radar Radar(IDRadar,IDParent,SimCore::SensorKinds::RADAR,8000,8001,"127.0.0.1","APAR");
Radar Radar(IDRadar,IDParent,SimCore::SensorKinds::RADAR,"239.0.0.1",8000,8001,"127.0.0.1","APAR");
Radar.start();
WHEN("constructing Track Object with data")

View File

@@ -22,9 +22,8 @@ SCENARIO("Testing the SimCore Sensor")
{
GIVEN("different Attributes for a Track in different forms")
{
SimCore::Identifier OwnID;
TrackList::TrackList List(OwnID);
List.setTrackTimeout(5000);
TrackList::TrackList List;
// List.setTrackTimeout(5000);
double speed = 10;
double course = 90;
@@ -54,23 +53,23 @@ SCENARIO("Testing the SimCore Sensor")
WHEN("constructing Track Object with data")
{
List.addTrack(track,Sensor1);
List.addTrack(track);
THEN("check if Track attributes are correct")
{
REQUIRE(List.size() == 1);
REQUIRE(List.getSize() == 1);
REQUIRE(List.getTrack(id)->getPosition().getGeocentricPos() == pos.getGeocentricPos());
REQUIRE(List.getTrack(id)->Speed.getValue() == speed);
REQUIRE(List.getTrack(id)->Course.getValue() == course);
REQUIRE(List.getTrack(id)->getSensorCount() == 1);
// REQUIRE(List.getTrack(id)->getSensorCount() == 1);
track->Course.setValue(270);
List.addTrack(track,Sensor2);
List.addTrack(track);
// REQUIRE(List.getTrack(id)->Course.getValue() == 270);
REQUIRE(List.getTrack(id)->getSensorCount() == 2);
// REQUIRE(List.getTrack(id)->getSensorCount() == 2);
std::this_thread::sleep_for(std::chrono::milliseconds(5500));
REQUIRE(List.size() == 0);
REQUIRE(List.getSize() == 0);
List.stopSanitizer();
// List.stopSanitizer();