From 5e829298fd17093311a6c84f31559659c57d9818 Mon Sep 17 00:00:00 2001 From: Henry Winkel Date: Wed, 20 Dec 2023 13:52:03 +0100 Subject: [PATCH] ADD: updated library and removed some comments --- .gitmodules | 3 --- CMakeLists.txt | 6 +----- cmake/Modules/protobuf.cmake | 4 ++-- libs/OrderLibrary | 2 +- libs/SimCore | 1 - src/SimControl/SimControl.cpp | 25 +++++++++++++------------ 6 files changed, 17 insertions(+), 24 deletions(-) delete mode 160000 libs/SimCore diff --git a/.gitmodules b/.gitmodules index da86c86..fdca28b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f7feee..c2ef752 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/cmake/Modules/protobuf.cmake b/cmake/Modules/protobuf.cmake index 562be9a..5345033 100644 --- a/cmake/Modules/protobuf.cmake +++ b/cmake/Modules/protobuf.cmake @@ -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" ) diff --git a/libs/OrderLibrary b/libs/OrderLibrary index 68c5c61..9d892fd 160000 --- a/libs/OrderLibrary +++ b/libs/OrderLibrary @@ -1 +1 @@ -Subproject commit 68c5c6123739b49888a5903a7067c2ec288b0328 +Subproject commit 9d892fdcb61515e89b340509649f6d0c0c8395eb diff --git a/libs/SimCore b/libs/SimCore deleted file mode 160000 index f83852b..0000000 --- a/libs/SimCore +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f83852bf6b461734e43bfbc137205fde222d336f diff --git a/src/SimControl/SimControl.cpp b/src/SimControl/SimControl.cpp index d12ffa9..2c5bb86 100644 --- a/src/SimControl/SimControl.cpp +++ b/src/SimControl/SimControl.cpp @@ -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::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)<stopPod(request["ID"]); + + // std::this_thread::sleep_for(std::chrono::milliseconds(4000)); + + Tracklist_->deleteTrack(request["ID"]); }