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"] [submodule "libs/KubeControl"]
path = libs/KubeControl path = libs/KubeControl
url = ssh://git@dev-gitea.ftewa.ti.unibw-hamburg.de:12000/hwinkel/KubeControl.git 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) add_subdirectory(libs/loguru EXCLUDE_FROM_ALL)
set_property(TARGET loguru PROPERTY POSITION_INDEPENDENT_CODE 1) set_property(TARGET loguru PROPERTY POSITION_INDEPENDENT_CODE 1)
ENDIF() ENDIF()
add_compile_definitions(LOGURU_WITH_STREAMS SQLITE_THREADSAFE=2)
IF(NOT TARGET SimCore)
add_subdirectory(libs/SimCore EXCLUDE_FROM_ALL)
ENDIF()
IF(NOT TARGET KubeControl) IF(NOT TARGET KubeControl)
set(TEST_KUBECONTROL_LIBRARY OFF CACHE BOOL "disable testing") set(TEST_KUBECONTROL_LIBRARY OFF CACHE BOOL "disable testing")

View File

@@ -15,7 +15,7 @@ function(protobuf_generate_cpp)
${ARGN}) ${ARGN})
FILE(GLOB PROTO_FILES ${protobuf_PROTO_PATH}/*.proto) 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}) message(STATUS "protoc path: " ${PROTOC})
FOREACH(proto ${PROTO_FILES}) FOREACH(proto ${PROTO_FILES})
@@ -28,7 +28,7 @@ function(protobuf_generate_cpp)
add_custom_command( add_custom_command(
OUTPUT "${protoDIR}/${protoFILENAME}.pb.cc" OUTPUT "${protoDIR}/${protoFILENAME}.pb.cc"
DEPENDS "${protoDIR}/${protoFILENAME}.proto" 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) 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 // A connection state object is available, and has a default id
// You can subclass ConnectionState and pass an alternate factory // You can subclass ConnectionState and pass an alternate factory
// to override it. It is useful if you want to store custom // to override it. It is useful if you want to store custom
// attributes per connection (authenticated bool flag, attributes, etc...) // 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. // 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:" ; // LOG_S(INFO) << "Headers:" ;
// for (auto it : msg->openInfo.headers) // for (auto it : msg->openInfo.headers)
@@ -189,14 +189,8 @@ namespace SimControl {
} }
else if (msg->type == ix::WebSocketMessageType::Message) 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 { try {
nlohmann::json j = nlohmann::json::parse(msg->str); nlohmann::json j = nlohmann::json::parse(msg->str);
// LOG_S(INFO)<< "Received: " << j["Data"].get<std::string>() << std::endl;
if (j["Data"] == "COP") if (j["Data"] == "COP")
{ {
@@ -204,7 +198,8 @@ namespace SimControl {
nlohmann::json response; nlohmann::json response;
response["Data"] = "COP"; response["Data"] = "COP";
Tracklist_->getJsonTRackList(response); Tracklist_->getJsonTRackList(response);
// response.merge_patch(Tracklist_->getJsonTRackList()); LOG_S(INFO)<<"Tracklist size: " << Tracklist_->getTracklistSize();
// LOG_S(INFO)<<response; // LOG_S(INFO)<<response;
websocket.send(response.dump()); websocket.send(response.dump());
}else if(j["Type"] == "EntityTrackList") }else if(j["Type"] == "EntityTrackList")
@@ -288,7 +283,8 @@ namespace SimControl {
nlohmann::json vars; nlohmann::json vars;
vars["ENTITY_ID"] = uuid; vars["ENTITY_ID"] = uuid;
vars["ENTITY_NAME"] = "hamburg"; vars["ENTITY_NAME"] = "FGS Hamburg";
vars["ENTITY_SIDE"] = "Neutral";
vars["POSITION"]["LAT"] = "55"; vars["POSITION"]["LAT"] = "55";
vars["POSITION"]["LON"] = "8"; vars["POSITION"]["LON"] = "8";
vars["POSITION"]["Height"] = "0"; vars["POSITION"]["Height"] = "0";
@@ -328,6 +324,7 @@ namespace SimControl {
nlohmann::json vars; nlohmann::json vars;
vars["ENTITY_ID"] = uuid; vars["ENTITY_ID"] = uuid;
vars["ENTITY_NAME"] = Name; vars["ENTITY_NAME"] = Name;
vars["ENTITY_SIDE"] = "Neutral";
vars["POSITION"]["LAT"] = lat; vars["POSITION"]["LAT"] = lat;
vars["POSITION"]["LON"] = lon; vars["POSITION"]["LON"] = lon;
vars["POSITION"]["Height"] = height; vars["POSITION"]["Height"] = height;
@@ -414,9 +411,13 @@ namespace SimControl {
client.disconnect(); client.disconnect();
} }
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); // std::this_thread::sleep_for(std::chrono::milliseconds(1000));
PodController_->stopPod(request["ID"]); PodController_->stopPod(request["ID"]);
// std::this_thread::sleep_for(std::chrono::milliseconds(4000));
Tracklist_->deleteTrack(request["ID"]); Tracklist_->deleteTrack(request["ID"]);
} }