ADD: added docker file

This commit is contained in:
Henry Winkel
2023-08-11 14:03:14 +02:00
parent bbf4be8108
commit 1b64d4e322
2 changed files with 58 additions and 4 deletions

View File

@@ -33,6 +33,8 @@ namespace SimControl {
SimControl::~SimControl()
{
this->stopMainThread_ = true;
TCPClient_ = nullptr;
@@ -41,6 +43,7 @@ namespace SimControl {
void SimControl::stop()
{
PodController_->stopAllPods();
this->stopMainThread_ = true;
TCPClient_.reset();
@@ -56,6 +59,8 @@ namespace SimControl {
{
LOG_S(INFO)<< "own ship data received";
auto OwnShipPos = std::make_shared<SimCore::Position>(simtrack->getPosition());
LOG_S(INFO)<< "Name: " << simtrack->Name.getValue() ;
LOG_S(INFO)<< " pos: Lat= "<< OwnShipPos->getGeodesicPos().x() << "Lon= "<< OwnShipPos->getGeodesicPos().y();
}
std::this_thread::sleep_for(std::chrono::milliseconds(500));
@@ -67,8 +72,9 @@ namespace SimControl {
void SimControl::MainFunction_()
{
kubecontrol::KubePod ShipPod1("hamburg","ship1","ship:latest");
// std::string uuid = xg::newGuid().str();
std::string uuid = "ship1";
kubecontrol::KubePod ShipPod1("hamburg",uuid,"ship:latest");
ShipPod1.setEnvironmentVar("ENTITY_ID", "ship1");
ShipPod1.setEnvironmentVar("ENTITY_NAME", "hamburg");
ShipPod1.setEnvironmentVar("POS_LAT", "\"55\"");
@@ -78,10 +84,16 @@ namespace SimControl {
ShipPod1.setEnvironmentVar("COMMAND_PORT", "\"5555\"");
ShipPod1.createYAML();
PodController_->startPod(ShipPod1);
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
LOG_S(INFO)<<PodController_->getInfoForPod("hamburg");
// LOG_S(INFO)<<PodController_->getPodsInfo();
Orders::MoveOrder order(this->ID_,WHISPER::SourceType::SIMCOMTROLER);
order.Speed.setValue(5.14444);
Orders::MoveOrder order(this->ID_);
order.Speed.setValue(0);
TCPClient_->sendMessage(order.buildMessage().serialize());