CHG: changed to fit to the new base message

This commit is contained in:
Henry Winkel
2023-08-11 11:04:49 +02:00
parent 1f96b32aff
commit 2bc36527a3
8 changed files with 21 additions and 21 deletions

View File

@@ -45,7 +45,7 @@ namespace Entities
{
PodController_ = std::make_unique<kubecontrol::PodController>("docs/config");
OwnShipTrack = std::make_shared<SimCore::SimTrack>(OwnID, OwnType, EntityKind);
OwnShipTrack = std::make_shared<SimCore::SimTrack>(OwnID, EnttityName, EntityKind);
OwnShipTrack->setPosition(SimCore::Position());
MovemtServer_ = std::make_shared<DirectCommunication::DirectCommunicationServer>(__MOVEMENT_SERVER_PORT__);
@@ -70,7 +70,7 @@ namespace Entities
OwnShipTrack->setPosition(pos);
LOG_S(INFO)<< "POS: LAT: "<< OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LATITUDE) << " LON: " << OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LONGITUDE);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier());
moveorder.setPosition(pos);
if(MovementWorkerStarted == true)
{
@@ -81,7 +81,7 @@ namespace Entities
void Entity::setSpeed(double val)
{
OwnShipTrack->Speed.setValue(val);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier());
moveorder.Speed.setValue(val);
if(MovementWorkerStarted == true)
{
@@ -92,7 +92,7 @@ namespace Entities
void Entity::setCourse(double val)
{
OwnShipTrack->Course.setValue(val);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier(),WHISPER::SourceType::ENTITY);
Orders::MoveOrder moveorder(OwnShipTrack->getIdentifier());
moveorder.Course.setValue(val);
if(MovementWorkerStarted == true)
{
@@ -144,7 +144,8 @@ namespace Entities
{
if (online_ == true) {
LOG_S(INFO)<<"__ONLINE__";
auto MovementPod = kubecontrol::KubePod("movmentpod-"+EntityName_,xg::newGuid().str(),"movementimage:latest");
MovementPodUUID_ = xg::newGuid().str();
auto MovementPod = kubecontrol::KubePod(MovementPodUUID_,MovementPodUUID_,"movementimage:latest");
MovementPod.setEnvironmentVar("SERVER_IP", SimCore::UtilFunctions::getOwnIP());
LOG_S(INFO)<< MovementPod.createYAML();
PodController_->startPod(MovementPod);
@@ -182,13 +183,13 @@ namespace Entities
if (newTrack != nullptr)
{
OwnShipTrack->setPosition(newTrack->getPosition());
// LOG_S(INFO)<< "new POS: LAT: "<< OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LATITUDE) << " LON: " << OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LONGITUDE);
LOG_S(INFO)<< "new POS: LAT: "<< OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LATITUDE) << " LON: " << OwnShipTrack->getPosition().getGeodesicPos()(SimCore::LONGITUDE);
}
}
if (MovemtServer_->countClients() == 0)
{
MovementWorkerStarted = false;
MovementWorkerStarted = false;
}
}