ADD: updated library and removed some comments

This commit is contained in:
Henry Winkel
2023-12-20 13:52:03 +01:00
parent cabf8dd87f
commit 5e829298fd
6 changed files with 17 additions and 24 deletions

3
.gitmodules vendored
View File

@@ -1,6 +1,3 @@
[submodule "libs/SimCore"]
path = libs/SimCore
url = ssh://git@dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/SimCore.git
[submodule "libs/KubeControl"]
path = libs/KubeControl
url = ssh://git@dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/KubeControl.git

View File

@@ -22,11 +22,7 @@ IF(NOT TARGET loguru)
add_subdirectory(libs/loguru EXCLUDE_FROM_ALL)
set_property(TARGET loguru PROPERTY POSITION_INDEPENDENT_CODE 1)
ENDIF()
IF(NOT TARGET SimCore)
add_subdirectory(libs/SimCore EXCLUDE_FROM_ALL)
ENDIF()
add_compile_definitions(LOGURU_WITH_STREAMS SQLITE_THREADSAFE=2)
IF(NOT TARGET KubeControl)
set(TEST_KUBECONTROL_LIBRARY OFF CACHE BOOL "disable testing")

View File

@@ -15,7 +15,7 @@ function(protobuf_generate_cpp)
${ARGN})
FILE(GLOB PROTO_FILES ${protobuf_PROTO_PATH}/*.proto)
set(PROTOC ${CMAKE_BINARY_DIR}/libs/SimCore/libs/whisper-com/libs/protobuf/protoc)
set(PROTOC ${CMAKE_BINARY_DIR}/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/protoc)
message(STATUS "protoc path: " ${PROTOC})
FOREACH(proto ${PROTO_FILES})
@@ -28,7 +28,7 @@ function(protobuf_generate_cpp)
add_custom_command(
OUTPUT "${protoDIR}/${protoFILENAME}.pb.cc"
DEPENDS "${protoDIR}/${protoFILENAME}.proto"
COMMAND ${PROTOC} --cpp_out=${protoDIR} --proto_path=${protoDIR} --proto_path="${CMAKE_SOURCE_DIR}/libs/OrderLibrary/libs/SimCore/include/SimCore/Messages/Protos" --proto_path="${CMAKE_SOURCE_DIR}/libs/SimCore/libs/whisper-com/libs/protobuf/src" "${protoDIR}/${protoFILENAME}.proto"
COMMAND ${PROTOC} --cpp_out=${protoDIR} --proto_path=${protoDIR} --proto_path="${CMAKE_SOURCE_DIR}/libs/OrderLibrary/libs/SimCore/include/SimCore/Messages/Protos" --proto_path="${CMAKE_SOURCE_DIR}/libs/OrderLibrary/libs/SimCore/libs/whisper-com/libs/protobuf/src" "${protoDIR}/${protoFILENAME}.proto"
)

Submodule libs/SimCore deleted from f83852bf6b

View File

@@ -170,16 +170,16 @@ namespace SimControl {
if (msg->type == ix::WebSocketMessageType::Open)
{
LOG_S(INFO)<< "New connection" ;
// LOG_S(INFO)<< "New connection" ;
// A connection state object is available, and has a default id
// You can subclass ConnectionState and pass an alternate factory
// to override it. It is useful if you want to store custom
// attributes per connection (authenticated bool flag, attributes, etc...)
LOG_S(INFO) << "id: " << connectionState->getId();
// LOG_S(INFO) << "id: " << connectionState->getId();
// The uri the client did connect to.
LOG_S(INFO) << "Uri: " << msg->openInfo.uri ;
// LOG_S(INFO) << "Uri: " << msg->openInfo.uri ;
// LOG_S(INFO) << "Headers:" ;
// for (auto it : msg->openInfo.headers)
@@ -189,14 +189,8 @@ namespace SimControl {
}
else if (msg->type == ix::WebSocketMessageType::Message)
{
// For an echo server, we just send back to the client whatever was received by the server
// All connected clients are available in an std::set. See the broadcast cpp example.
// Second parameter tells whether we are sending the message in binary or text mode.
// Here we send it in the same mode as it was received.
// LOG_S(INFO)<< "Received: " << msg->str << std::endl;
try {
nlohmann::json j = nlohmann::json::parse(msg->str);
// LOG_S(INFO)<< "Received: " << j["Data"].get<std::string>() << std::endl;
if (j["Data"] == "COP")
{
@@ -204,7 +198,8 @@ namespace SimControl {
nlohmann::json response;
response["Data"] = "COP";
Tracklist_->getJsonTRackList(response);
// response.merge_patch(Tracklist_->getJsonTRackList());
LOG_S(INFO)<<"Tracklist size: " << Tracklist_->getTracklistSize();
// LOG_S(INFO)<<response;
websocket.send(response.dump());
}else if(j["Type"] == "EntityTrackList")
@@ -288,7 +283,8 @@ namespace SimControl {
nlohmann::json vars;
vars["ENTITY_ID"] = uuid;
vars["ENTITY_NAME"] = "hamburg";
vars["ENTITY_NAME"] = "FGS Hamburg";
vars["ENTITY_SIDE"] = "Neutral";
vars["POSITION"]["LAT"] = "55";
vars["POSITION"]["LON"] = "8";
vars["POSITION"]["Height"] = "0";
@@ -328,6 +324,7 @@ namespace SimControl {
nlohmann::json vars;
vars["ENTITY_ID"] = uuid;
vars["ENTITY_NAME"] = Name;
vars["ENTITY_SIDE"] = "Neutral";
vars["POSITION"]["LAT"] = lat;
vars["POSITION"]["LON"] = lon;
vars["POSITION"]["Height"] = height;
@@ -414,9 +411,13 @@ namespace SimControl {
client.disconnect();
}
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
// std::this_thread::sleep_for(std::chrono::milliseconds(1000));
PodController_->stopPod(request["ID"]);
// std::this_thread::sleep_for(std::chrono::milliseconds(4000));
Tracklist_->deleteTrack(request["ID"]);
}