浏览代码

!2 guardian work well on windows and uos

chenliangyu 1 年之前
父节点
当前提交
ee3ecd546b

+ 6 - 6
CMakeSettings.json

@@ -22,9 +22,9 @@
       "ctestCommandArgs": "--output-on-failure",
       "inheritEnvironments": [ "linux_arm" ],
       "remoteMachineName": "${defaultRemoteMachineName}",
-      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/src",
-      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/build/${name}",
-      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/install/${name}",
+      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/src",
+      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/out/build/${name}",
+      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/out/install/${name}",
       "remoteCopySources": true,
       "rsyncCommandArgs": "-t --delete --delete-excluded --exclude \"/build\" --exclude \"/out\" --exclude-from=.gitignore",
       "remoteCopyBuildOutput": false,
@@ -61,9 +61,9 @@
         }
       ],
       "remoteMachineName": "${defaultRemoteMachineName}",
-      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/src",
-      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/build/${name}",
-      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/install/${name}",
+      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/src",
+      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/out/build/${name}",
+      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/out/install/${name}",
       "remoteCopySources": true,
       "rsyncCommandArgs": "-t --delete --delete-excluded --exclude \"/build\" --exclude \"/out\" --exclude-from=.gitignore",
       "remoteCopyBuildOutput": false,

+ 1 - 1
Other/liblog4rvcother/CMakeLists.txt

@@ -15,7 +15,7 @@ set(${MODULE_PREFIX}_SRCS
 
 add_definitions(-DUSE_SKYEYELOG)
 
-
+#set(CMAKE_CXX_FLAGS "${CMAK_CXX_FLAGS} -g3")
 add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
 target_include_directories(${MODULE_NAME} 
     PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}

+ 3 - 3
Other/libpublicFun/CMakeLists.txt

@@ -7,8 +7,8 @@ set(${MODULE_PREFIX}_SRCS
     publicFunExport.h
     portCheck.cpp
     ${ThirdPartyHeadRoot}/CJson/cJSON.c
-    exLog/log.h
-    exLog/log.cpp
+    #exLog/log.h
+    #exLog/log.cpp
 	exLog/skyeyeLog.h
 	exLog/skyeyeLog.cpp
     portCheck.cpp
@@ -42,7 +42,7 @@ endif()
 
 add_library(${MODULE_NAME} SHARED ${${MODULE_PREFIX}_SRCS})
 
-set(CMAKE_CXX_FLAGS "${CMAK_CXX_FLAGS} -g3")
+#set(CMAKE_CXX_FLAGS "${CMAK_CXX_FLAGS} -g3")
 # 依赖libscreencodec、acmstrdec、acmstrenc
 target_include_directories(${MODULE_NAME} PRIVATE
 	${RVC_COMMON_INCLUDE_DIR}

+ 11 - 6
Other/libpublicFun/exLog/skyeyeLog.cpp

@@ -236,13 +236,15 @@ public:
 	}
 	void LogToSender(Link_private* msg)
 	{
+		
 		m_mtx.lock();
 		m_msgArr.push_back(*msg);
 		m_mtx.unlock();
+		
 	}
-
-	bool InitSender(std::string t_endpoint, std::string t_topic)
+	void InitSender(std::string t_endpoint, std::string t_topic)
 	{
+		
 		auto skyeye_sender = [this](std::string t_endpoint, std::string t_topic) {
 			while (true)
 			{
@@ -262,7 +264,7 @@ public:
 				m_mtx.unlock();
 
 				if (sendArr.size() == 0)
-					return; //no need to send
+					continue; //no need to send
 
 				//generate send str
 				Json::Value root;
@@ -290,7 +292,7 @@ public:
 			}
 			
 		};
-
+		
 		std::thread(skyeye_sender, t_endpoint, t_topic).detach();
 	}
 
@@ -492,10 +494,13 @@ void CreateDefaultLogger(std::string terminalno, std::string version, std::strin
 	constParam.m_cmptName = SpDefine::CmptName;
 	constParam.m_serviceUnitId = SpDefine::serviceUnitId;
 	constParam.m_deployUnitId = SpDefine::deployUnitId;
-
+	//std::this_thread::sleep_for(std::chrono::seconds(10));//every 30 seconds
 	skyeye_logger::getDefaultLogger().m_constParam = constParam;
 	TokenManager::getInstance().InitTokenManager(30, SpDefine::CommonLaunchUrl, SpDefine::channelId, SpDefine::tokenSecret, constParam.m_terminalNo, constParam.m_version);
-	skyeye_sender::getInstance().InitSender(SpDefine::endpoint_env, SpDefine::topicSys);
+	//skyeye_sender::getInstance();
+	std::string endpoint = SpDefine::endpoint_env;
+	std::string topic = SpDefine::topicSys;
+	skyeye_sender::getInstance().InitSender(endpoint, topic);
 
 }
 

+ 2 - 0
Tool/guardian/CMakeLists.txt

@@ -25,6 +25,8 @@ else()
     target_link_libraries(${MODULE_NAME} PRIVATE ${WINPR_LIB} ${TOOLKIT_LIB} log4rvcother ${CONAN_PKG_LIBS_JSONCPP})
 endif(MSVC)
 
+#set(CMAKE_CXX_FLAGS "${CMAK_CXX_FLAGS} -g3")
+
 install(TARGETS ${MODULE_NAME} 
     RUNTIME DESTINATION "${RVC_RUNTIME_PATH}"
     ARCHIVE DESTINATION "${RVC_LIBRARY_PATH}"

+ 1 - 1
Tool/guardian/guardian.cpp

@@ -1596,7 +1596,7 @@ int main(int argc, char* argv[])
 	std::string terminalno;
 	int fd0, fd1, fd2;
 	g_bFrameOnline = true;
-
+	//MessageBox(NULL, NULL, NULL, 0);
 	if (argc > 1)
 		terminalno = argv[1];