ADD: added websocket and offline version an dtracklist
This commit is contained in:
21
src/main.cpp
21
src/main.cpp
@@ -1,3 +1,4 @@
|
||||
#include "SimCore/UtilFunctions.hpp"
|
||||
#include <Orders/MoveOrder.hpp>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
@@ -33,10 +34,26 @@ int main()
|
||||
sigIntHandler.sa_flags = 0;
|
||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||
|
||||
bool online = false;
|
||||
|
||||
const char* CommandPortChar = "5555";
|
||||
if (std::getenv("COMMAND_PORT") != nullptr) {
|
||||
CommandPortChar = std::getenv("COMMAND_PORT");
|
||||
}
|
||||
const char* GroundTruthAddr = "239.0.0.1";
|
||||
if (std::getenv("GROUNDTRUTH_ADDR") != nullptr) {
|
||||
CommandPortChar = std::getenv("GROUNDTRUTH_ADDR");
|
||||
}
|
||||
const char* GroundTruthPort = "10000";
|
||||
if (std::getenv("GROUNDTRUTH_PORT") != nullptr) {
|
||||
CommandPortChar = std::getenv("GROUNDTRUTH_PORT");
|
||||
}
|
||||
|
||||
const char* Namespace = "simulator";
|
||||
if (std::getenv("NAMESPACE") != nullptr) {
|
||||
Namespace = std::getenv("NAMESPACE");
|
||||
online = true;
|
||||
}
|
||||
|
||||
|
||||
const char *ServerAddress = nullptr;
|
||||
@@ -48,13 +65,13 @@ int main()
|
||||
|
||||
LOG_S(INFO)<<ServerAddress;
|
||||
|
||||
SimControl::SimControl sc(CommandPortChar);
|
||||
LOG_S(INFO)<<"online:" << online;
|
||||
|
||||
SimControl::SimControl sc(online,CommandPortChar,GroundTruthAddr,SimCore::UtilFunctions::StringToUShort(GroundTruthPort),Namespace);
|
||||
|
||||
|
||||
while (running) {
|
||||
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user