瀏覽代碼

!2 合并startup page

chenliangyu 1 年之前
父節點
當前提交
70abd4394c
共有 100 個文件被更改,包括 95 次插入6980 次删除
  1. 1 16
      CMakeLists.txt
  2. 0 6
      Framework/CMakeLists.txt
  3. 9 1
      Framework/Common/SpBase.h
  4. 12 17
      Framework/libtoolkit/osutil.c
  5. 2 1
      Framework/libtoolkit/osutil.h
  6. 5 0
      Framework/libtoolkit/win/bus.c
  7. 16 0
      Framework/spbase/SpEntity.cpp
  8. 1 0
      Framework/spbase/SpEntity.h
  9. 0 24
      Framework/spbase/SpEntityPrivilege.cpp
  10. 0 1
      Framework/spbase/SpEntityPrivilege.h
  11. 0 1
      Framework/spbase/TokenKeeper_client_g.h
  12. 33 1
      Framework/spbase/sp_bcm.c
  13. 1 0
      Framework/spbase/sp_bcm.h
  14. 8 7
      Framework/spbase/sp_cfg.cpp
  15. 1 1
      Framework/spbase/sp_iom.c
  16. 5 1
      Framework/spbase/sp_ses.c
  17. 1 0
      Framework/sphost/sphost.c
  18. 0 78
      Framework/spshell/CMakeLists.txt
  19. 0 165
      Framework/spshell/PollCenter.cpp
  20. 0 62
      Framework/spshell/PollCenter.h
  21. 0 155
      Framework/spshell/QtBootSender.cpp
  22. 0 61
      Framework/spshell/QtBootSender.h
  23. 0 89
      Framework/spshell/QtMessageSender.cpp
  24. 0 30
      Framework/spshell/QtMessageSender.h
  25. 0 166
      Framework/spshell/Widgets/BootGlobal.h
  26. 0 21
      Framework/spshell/Widgets/BootSplashScreen.cpp
  27. 0 29
      Framework/spshell/Widgets/BootSplashScreen.h
  28. 0 284
      Framework/spshell/Widgets/BootWidget.cpp
  29. 0 56
      Framework/spshell/Widgets/BootWidget.h
  30. 0 20
      Framework/spshell/Widgets/BootWidget.ui
  31. 0 34
      Framework/spshell/Widgets/CustomImportInterface.h
  32. 0 119
      Framework/spshell/Widgets/OperaThread.hpp
  33. 0 62
      Framework/spshell/Widgets/QConsoleListWidget.cpp
  34. 0 38
      Framework/spshell/Widgets/QConsoleListWidget.h
  35. 0 202
      Framework/spshell/Widgets/QInfoListWidget.cpp
  36. 0 177
      Framework/spshell/Widgets/QInfoListWidget.h
  37. 0 206
      Framework/spshell/Widgets/QRvcItemModel.hpp
  38. 0 64
      Framework/spshell/Widgets/QtMessageInfo.h
  39. 0 31
      Framework/spshell/Widgets/RvcSettings.h
  40. 0 34
      Framework/spshell/Widgets/cpuwidget.cpp
  41. 0 21
      Framework/spshell/Widgets/cpuwidget.h
  42. 0 24
      Framework/spshell/Widgets/dialogappversion.cpp
  43. 0 21
      Framework/spshell/Widgets/dialogappversion.h
  44. 0 215
      Framework/spshell/Widgets/dialogconfig.cpp
  45. 0 35
      Framework/spshell/Widgets/dialogconfig.h
  46. 0 111
      Framework/spshell/Widgets/floatwidget/Overlay.cpp
  47. 0 55
      Framework/spshell/Widgets/floatwidget/Overlay.h
  48. 0 148
      Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.cpp
  49. 0 43
      Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.h
  50. 0 581
      Framework/spshell/Widgets/floatwidget/widget.cpp
  51. 0 115
      Framework/spshell/Widgets/floatwidget/widget.h
  52. 0 24
      Framework/spshell/Widgets/floatwidget/widget.ui
  53. 0 1671
      Framework/spshell/Widgets/mainwindow.cpp
  54. 0 310
      Framework/spshell/Widgets/mainwindow.h
  55. 0 570
      Framework/spshell/Widgets/mainwindow.ui
  56. 0 58
      Framework/spshell/Widgets/memorywidget.cpp
  57. 0 22
      Framework/spshell/Widgets/memorywidget.h
  58. 0 92
      Framework/spshell/Widgets/mlabel.cpp
  59. 0 28
      Framework/spshell/Widgets/mlabel.h
  60. 0 251
      Framework/spshell/Widgets/performwidget.cpp
  61. 0 64
      Framework/spshell/Widgets/performwidget.h
  62. 0 24
      Framework/spshell/Widgets/performwidget.ui
  63. 0 50
      Framework/spshell/Widgets/res.qrc
  64. 0 89
      Framework/spshell/Widgets/res/ErrorCode.md
  65. 二進制
      Framework/spshell/Widgets/res/FavIcon.ico
  66. 二進制
      Framework/spshell/Widgets/res/Logo.png
  67. 二進制
      Framework/spshell/Widgets/res/bg.png
  68. 二進制
      Framework/spshell/Widgets/res/bgactive.png
  69. 二進制
      Framework/spshell/Widgets/res/fatcow/contrast_high.png
  70. 二進制
      Framework/spshell/Widgets/res/fatcow/contrast_low.png
  71. 二進制
      Framework/spshell/Widgets/res/fatcow/control_cursor.png
  72. 二進制
      Framework/spshell/Widgets/res/fatcow/control_cursor_blue.png
  73. 二進制
      Framework/spshell/Widgets/res/fatcow/control_eject.png
  74. 二進制
      Framework/spshell/Widgets/res/fatcow/control_eject_blue.png
  75. 二進制
      Framework/spshell/Widgets/res/fatcow/control_end.png
  76. 二進制
      Framework/spshell/Widgets/res/fatcow/control_end_blue.png
  77. 二進制
      Framework/spshell/Widgets/res/fatcow/control_fastforward.png
  78. 二進制
      Framework/spshell/Widgets/res/fatcow/control_fastforward_blue.png
  79. 二進制
      Framework/spshell/Widgets/res/fatcow/control_pause.png
  80. 二進制
      Framework/spshell/Widgets/res/fatcow/control_pause_blue.png
  81. 二進制
      Framework/spshell/Widgets/res/fatcow/control_play.png
  82. 二進制
      Framework/spshell/Widgets/res/fatcow/control_play_blue.png
  83. 二進制
      Framework/spshell/Widgets/res/fatcow/control_power.png
  84. 二進制
      Framework/spshell/Widgets/res/fatcow/control_power_blue.png
  85. 二進制
      Framework/spshell/Widgets/res/fatcow/control_repeat.png
  86. 二進制
      Framework/spshell/Widgets/res/fatcow/control_repeat_blue.png
  87. 二進制
      Framework/spshell/Widgets/res/fatcow/control_rewind.png
  88. 二進制
      Framework/spshell/Widgets/res/fatcow/control_rewind_blue.png
  89. 二進制
      Framework/spshell/Widgets/res/fatcow/control_start.png
  90. 二進制
      Framework/spshell/Widgets/res/fatcow/control_start_blue.png
  91. 二進制
      Framework/spshell/Widgets/res/fatcow/control_stop.png
  92. 二進制
      Framework/spshell/Widgets/res/fatcow/control_stop_blue.png
  93. 二進制
      Framework/spshell/Widgets/res/fatcow/cross.png
  94. 二進制
      Framework/spshell/Widgets/res/fatcow/file_extension_log.png
  95. 二進制
      Framework/spshell/Widgets/res/fatcow/format_painter.png
  96. 二進制
      Framework/spshell/Widgets/res/fatcow/lcd_tv_test.png
  97. 二進制
      Framework/spshell/Widgets/res/fatcow/page_delete.png
  98. 二進制
      Framework/spshell/Widgets/res/fatcow/zoom_layer.png
  99. 0 3
      Framework/spshell/Widgets/res/forms/input.txt
  100. 0 95
      Framework/spshell/Widgets/res/forms/textfinder.ui

+ 1 - 16
CMakeLists.txt

@@ -619,12 +619,6 @@ else()
 	message(WARNING "skipping Tool directory.")
 endif(BUILD_TOOLS)
 
-if(BUILD_PLUGINS)
-	add_subdirectory(Plugins)
-else()
-	message(WARNING "skipping Plugins directory.")
-endif(BUILD_PLUGINS)
-
 if(BUILD_DEVADAPTER)
 	add_subdirectory(DevAdapter)
 else()
@@ -664,6 +658,7 @@ else(MSVC)
 		set(CPACK_GENERATOR "ZIP")
 		message(STATUS "set zip package file type for matching head bank publish")
 	endif()
+
 	if(NOT DEVOPS_ON)
 		install(CODE "execute_process(COMMAND chmod 0777 ${CMAKE_SOURCE_DIR}/addin/packaging/UOS/kill.sh)")
 		install(CODE "execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/addin/packaging/UOS/kill.sh)")
@@ -743,10 +738,6 @@ else(MSVC)
 	file(GLOB VENDOR_ROOT_CONFIG_FILES "${CMAKE_SOURCE_DIR}/addin/hardwarecfg/UOS/root-*.ini")
 	install(FILES ${VENDOR_ROOT_CONFIG_FILES} DESTINATION "${PACK_INSTALL_RUN_DIR}/hardwarecfg" COMPONENT scripts)
 	install(PROGRAMS "${CMAKE_SOURCE_DIR}/addin/startup_scripts/spshellstart.sh" DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT scripts)
-
-
-	file(GLOB LICENSE_FILES "${CMAKE_SOURCE_DIR}/addin/licenses/UOS/*")
-	install(FILES ${LICENSE_FILES} DESTINATION "${RVC_RESOURCE_PATH}/License" COMPONENT scripts)
 endif(MSVC)
 
 if(DEVOPS_ON)
@@ -762,11 +753,6 @@ else()
 endif(DEVOPS_ON)
 
 list(REMOVE_DUPLICATES RVC_CONAN_DEP_LIBS)
-if(CONAN_LIB_DIRS_QT)
-	message(STATUS "remote qt dir:${CONAN_LIB_DIRS_QT}")
-	list(REMOVE_ITEM RVC_CONAN_DEP_LIBS ${CONAN_LIB_DIRS_QT})# 1.0.5-dev5
-	list(REMOVE_ITEM RVC_CONAN_DEP_LIBS ${CONAN_BIN_DIRS_QT})# 1.0.5-dev5
-endif(CONAN_LIB_DIRS_QT)
 
 if(MSVC)
 	if(CONAN_BIN_DIRS_CEFCLIENT_MUTABLE)
@@ -816,7 +802,6 @@ foreach(bin_dir ${RVC_CONAN_DEP_LIBS})
 	endforeach()
 	list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*\\.a$")
 	list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*\\.lib$")
-	# list(FILTER RVC_CONAN_BIN_FILES EXCLUDE REGEX ".*libQt5Charts.so*")
 	install(PROGRAMS ${RVC_CONAN_BIN_FILES} DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT libraries)
 endforeach()
 install(DIRECTORY "${CMAKE_SOURCE_DIR}/addin/res" DESTINATION "${PACK_INSTALL_PREFIX_CUR_VER}" COMPONENT scripts )

+ 0 - 6
Framework/CMakeLists.txt

@@ -1,11 +1,5 @@
 set(RVC_CONAN_DEP_LIBS2)
 
-if(MSVC)
-set(WITH_QT_GUI OFF)
-else()
-set(WITH_QT_GUI ON)
-endif(MSVC)
-
 set(KYSM_LIBRARY_NAME ${CONAN_LIBS_LIBKYSM})
 set(OPENSSL_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_OPENSSL})
 set(OPENSSL_LIB_DIR ${CONAN_LIB_DIRS_OPENSSL})

+ 9 - 1
Framework/Common/SpBase.h

@@ -609,6 +609,12 @@ struct CEntityRunInfo
 	DWORD dwProcessID;					//Process ID of os
 };
 
+/** entity log info */
+struct CEntityLogInfo
+{
+	CSimpleStringA strLogPath;
+};
+
 struct BroadcastSubscribeInfo
 {
 	CUUID SubID;
@@ -637,7 +643,6 @@ struct ISysVarListener
 	virtual void OnSysVarEvent(const char *pszKey,
 		const char *pszValue,const char *pszOldValue,const char *pszEntityName)=0;
 };
-
 struct ITerminalStateChangedListener
 {
 	virtual void OnStateChanged(FrameworkStateEnum oldState, FrameworkStateEnum curState, const char* triggerEntity) = 0;
@@ -842,6 +847,9 @@ struct IEntityFunction
 
 	virtual ErrorCodeEnum GetAllEntityStartInfo(CAutoArray<CSimpleStringA>& strEntityNames, CAutoArray<int>& strEntityIdx, CAutoArray<CEntityStartInfo>& Infos) = 0;
 
+	/** get entity log path via shell 	 */
+	virtual ErrorCodeEnum GetEntityLogPath(const char* pszEntityName, CEntityLogInfo& Info) = 0;
+
 
 	virtual WORD GetDevID() = 0;
 	/**

+ 12 - 17
Framework/libtoolkit/osutil.c

@@ -84,7 +84,7 @@ TOOLKIT_API int osutil_restart_system()
 	return 0;
 }
 
-TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size)
+TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size, int force)
 {
 	const DWORD dwCurProcessID = GetCurrentProcessId();
 	DWORD relateProcessIDs[256];
@@ -338,7 +338,7 @@ TOOLKIT_API int osutil_restart_system()
 }
 
 #ifdef NEW_FEATURE
-TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size)
+TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size, int force)
 {
     int i, j, k;
     const pid_t cur_pid = getpid();
@@ -362,7 +362,7 @@ TOOLKIT_API void osutil_terminate_related_process(char** process_array, const in
 }
 #else
 
-TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size)
+TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size, int force)
 {
     DIR* dir_proc = NULL;
     struct dirent* dir_entity = NULL;
@@ -388,15 +388,12 @@ TOOLKIT_API void osutil_terminate_related_process(char** process_array, const in
                 strcpy(cmdLinePath, "/proc/");
                 strcat(cmdLinePath, dir_entity->d_name);
                 strcat(cmdLinePath, "/cmdline");
-                //printf("%s: open(%s)...\n", __FUNCTION__, cmdLinePath);
                 FILE* fd_cmdline = fopen(cmdLinePath, "rt");
                 if (fd_cmdline != NULL) {
                     memset(processName, 0, DEFAULT_PROCESS_NAME_SIZE);
                     memset(processPath, 0, DEFAULT_PROCESS_PATH_SIZE);
                     fscanf(fd_cmdline, "%s", processPath);
-                    //printf("%s: close(%p)...\n", __FUNCTION__, fd_cmdline);
                     fclose(fd_cmdline);
-                    //printf("%s: close(%p) done!\n", __FUNCTION__, fd_cmdline);
                     if (strrchr(processPath, '/')) {
                         strcpy(processName, strrchr(processPath, '/') + 1);
                     } else {
@@ -404,17 +401,15 @@ TOOLKIT_API void osutil_terminate_related_process(char** process_array, const in
                     }
                     for (i = 0; i < array_size; i++) {
                         if (strcasecmp(processName, process_array[i]) == 0) {
-                            printf("kill %s, %s, %d, %d\n", processPath, processName, pid, cur_pid);
-                            int r = kill(pid, SIGTERM);
-                            if (r != 0) {
-                                printf("kill of pid=%d failed:%d\n", pid, errno);
-                                if(0 == kill(pid, SIGKILL))
-                                    count++;
-                            } else {
-                                Sleep(200);
-                                if (0 == kill(pid, SIGKILL))
-                                    count++;
-                            }
+                            printf("kill %s, %s, %d, %d, type: %s\n", processPath, processName, pid, cur_pid, !!force ? "SIGKILL" : "SIGTERM");
+							int r = kill(pid, !!force ? SIGKILL : SIGTERM);
+							if (r != 0) {
+								printf("kill of pid=%d failed:%d\n", pid, errno);
+							}
+							else {
+								Sleep(200);
+								count++;
+							}
                             break;
                         }
                     }

+ 2 - 1
Framework/libtoolkit/osutil.h

@@ -45,7 +45,8 @@ extern "C" {
 TOOLKIT_API int osutil_detect_unique_app(char **pNames, int nNum, int* alive, alive_process_info* alive_process_arr);
 TOOLKIT_API int osutil_restart_system();
 TOOLKIT_API int osutil_shutdown_system();
-TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size);
+//force: which is only available at UOS, non-zero meaning kill -9 otherwise -15
+TOOLKIT_API void osutil_terminate_related_process(char** process_array, const int array_size, int force);
 
 TOOLKIT_API int osutil_uname(tk_utsname_t* buffer);
 

+ 5 - 0
Framework/libtoolkit/win/bus.c

@@ -1168,6 +1168,7 @@ TOOLKIT_API int bus_endpt_poll(bus_endpt_t* endpt, int timeout)
 	if (rc > 0) {
 		if (result == BUS_RESULT_DATA) {
 			bus_endpt_recv_pkt(endpt, &epid, &type, &pkt);
+			WLog_INFO(TAG, "bus_endpt_recv_pkt BUS_RESULT_DATA, epid:%d, type:0x%08X", epid, type);
 			if (endpt->callback.on_pkt)
 				endpt->callback.on_pkt(endpt, epid, type, &pkt, endpt->callback.user_data);
 			if (pkt)
@@ -1175,6 +1176,7 @@ TOOLKIT_API int bus_endpt_poll(bus_endpt_t* endpt, int timeout)
 		}
 		else if (result == BUS_RESULT_INFO) {
 			bus_endpt_recv_pkt(endpt, &epid, &type, &pkt);
+			WLog_INFO(TAG, "bus_endpt_recv_pkt BUS_RESULT_INFO, epid:%d, type:0x%08X", epid, type);
 			if (endpt->callback.on_inf)
 				endpt->callback.on_inf(endpt, epid, type, &pkt, endpt->callback.user_data);
 			if (pkt)
@@ -1182,6 +1184,7 @@ TOOLKIT_API int bus_endpt_poll(bus_endpt_t* endpt, int timeout)
 		}
 		else if (result == BUS_RESULT_EVENT) {
 			bus_endpt_recv_evt(endpt, &epid, &type, &pkt);
+			WLog_INFO(TAG, "bus_endpt_recv_pkt BUS_RESULT_EVENT, epid:%d, type:0x%08X", epid, type);
 			if (endpt->callback.on_evt)
 				endpt->callback.on_evt(endpt, epid, type, &pkt, endpt->callback.user_data);
 			if (pkt)
@@ -1189,12 +1192,14 @@ TOOLKIT_API int bus_endpt_poll(bus_endpt_t* endpt, int timeout)
 		}
 		else if (result == BUS_RESULT_SYSTEM) {
 			bus_endpt_recv_sys(endpt, &epid, &state);
+			WLog_INFO(TAG, "bus_endpt_recv_pkt BUS_RESULT_SYSTEM, epid:%d, state:%d", epid, state);
 			if (endpt->callback.on_sys)
 				endpt->callback.on_sys(endpt, epid, state, endpt->callback.user_data);
 		}
 		else if (result == BUS_RESULT_MSG) {
 			msg_t* msg = NULL;
 			bus_endpt_recv_msg(endpt, &msg);
+			WLog_INFO(TAG, "bus_endpt_recv_pkt BUS_RESULT_MSG, type:0x%08X", msg->type);
 			if (endpt->callback.on_msg) {
 				endpt->callback.on_msg(endpt, msg->type, msg->nparam, msg->params, 
 					msg->evt ? &msg->evt_result : NULL, 

+ 16 - 0
Framework/spbase/SpEntity.cpp

@@ -1697,6 +1697,22 @@ ErrorCodeEnum SpEntity::GetAllEntityStartInfo(CAutoArray<CSimpleStringA>& strEnt
     return Error_Succeed;
 }
 
+ErrorCodeEnum SpEntity::GetEntityLogPath(const char* pszEntityName, CEntityLogInfo& Info)
+{
+	if (pszEntityName != NULL) {
+		sp_env_t* env = sp_get_env();
+		auto pEntity = sp_cfg_get_entity_by_name(env->cfg, pszEntityName);
+		if (pEntity != NULL) {
+			char tmp[MAX_PATH] = { 0 };
+			auto mod_name = pEntity->mod->name;
+			sp_dir_get_path(env->dir, SP_DIR_ENTITY_DBG_LOG, mod_name, tmp, sizeof(tmp));
+			Info.strLogPath = tmp;
+			return ErrorCodeEnum::Error_Succeed;
+		}
+	}
+	return ErrorCodeEnum::Error_Unexpect;
+}
+
 ErrorCodeEnum SpEntity::GetAllStartedEntity(CAutoArray<CSimpleStringA> &strEntityNames, CAutoArray<DWORD> &dwEntityInstanceIDs)
 {
 	sp_env_t *env = sp_get_env();

+ 1 - 0
Framework/spbase/SpEntity.h

@@ -123,6 +123,7 @@ public:
 	virtual ErrorCodeEnum GetModuleName(DWORD nModuleID, CSimpleStringA &strName); //@
 	virtual ErrorCodeEnum GetEntitySessionInfo(const char *pszEntityName, CAutoArray<CEntitySessionInfo> &Infos);
 	virtual ErrorCodeEnum GetAllEntityStartInfo(CAutoArray<CSimpleStringA>& strEntityNames, CAutoArray<int>& strEntityIdx, CAutoArray<CEntityStartInfo>& Infos);
+	virtual ErrorCodeEnum GetEntityLogPath(const char* pszEntityName, CEntityLogInfo& Info);
 	virtual WORD GetDevID();
 	virtual ErrorCodeEnum GetToken(CSimpleString &channelId, CSimpleString &token);
 

+ 0 - 24
Framework/spbase/SpEntityPrivilege.cpp

@@ -2238,30 +2238,6 @@ ErrorCodeEnum SpEntityPrivilege::TryUpdateToken(CSimpleString& oldToken, CSimple
 }
 
 
-ErrorCodeEnum SpEntityPrivilege::InitCfgUrl(CSimpleString& channelId, CSimpleString& tokenSecret, CSimpleString& CommonLaunchUrl, CSimpleString& CenterConfigTotal)
-{
-	auto cfg = sp_get_env()->cfg;
-
-	if (cfg == NULL || cfg->shell_ini == NULL)
-		return Error_Null;
-
-	if (cfg->shell_ini->channelId)
-		shm_free(cfg->shell_ini->channelId);
-	if (cfg->shell_ini->tokenSecret)
-		shm_free(cfg->shell_ini->tokenSecret);
-	if (cfg->shell_ini->CommonLaunchUrl)
-		shm_free(cfg->shell_ini->CommonLaunchUrl);
-	if (cfg->shell_ini->CenterConfigTotal)
-		shm_free(cfg->shell_ini->CenterConfigTotal);
-
-	cfg->shell_ini->channelId = shm_strdup(channelId.GetData());
-	cfg->shell_ini->tokenSecret = shm_strdup(tokenSecret.GetData());
-	cfg->shell_ini->CommonLaunchUrl = shm_strdup(CommonLaunchUrl.GetData());
-	cfg->shell_ini->CenterConfigTotal = shm_strdup(CenterConfigTotal.GetData());
-	DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("CommonLaunchUrl:%s, CenterConfigTotal:%s"
-		, cfg->shell_ini->CommonLaunchUrl, cfg->shell_ini->CenterConfigTotal);
-	return Error_Succeed;
-}
 
 ErrorCodeEnum SpEntityPrivilege::InitCfgUrl(VTMInitParam& info)
 {

+ 0 - 1
Framework/spbase/SpEntityPrivilege.h

@@ -72,7 +72,6 @@ public:
 
 	//Ïȵ÷ÓÃÕâ¸öÈ¥³õʼ»¯url
 	virtual ErrorCodeEnum InitCfgUrl(VTMInitParam& info);
-	virtual ErrorCodeEnum InitCfgUrl(CSimpleString& channelId, CSimpleString& tokenSecret, CSimpleString& CommonLaunchUrl, CSimpleString& CenterConfigTotal);
 	virtual ErrorCodeEnum TryUpdateCfg();
 	virtual ErrorCodeEnum TryUpdateCenterCfg(bool& isUpdate, bool& isReset, CSimpleString& version);
 	virtual ErrorCodeEnum TryUpdateToken(CSimpleString& oldToken, CSimpleString& newToken);

+ 0 - 1
Framework/spbase/TokenKeeper_client_g.h

@@ -32,7 +32,6 @@ public:
 	}
 	void OnClose(ErrorCodeEnum)
 	{
-		Dbg("session closed.");
 		bSessionClosed = true;
 	}
 	bool QuerySessionClosed()

+ 33 - 1
Framework/spbase/sp_bcm.c

@@ -391,11 +391,43 @@ static void daemon_on_sys(sp_svc_t *svc,int epid, int state, void *user_data)
 	}
 }
 
+int sp_bcm_deamon_refresh(sp_bcm_daemon_t* daemon)
+{
+	int nelts = sp_mod_mgr_get_entity_array_nelts(sp_get_env()->mod_mgr);
+	int i;
+	DbgWithLinkForC(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM, "entity array nelts:%d", nelts);
+	/*
+	daemon_lock(daemon);
+	int oldNelts = daemon->arr_dst_list->nelts;
+	//array_reserve(daemon->arr_dst_list, nelts);
+	//array_reserve(daemon->arr_src_list, nelts);
+	//array_header_t* old_dst = daemon->arr_dst_list;
+	//array_header_t* old_src = daemon->arr_src_list;
+	//daemon->arr_dst_list = array_make(nelts, sizeof(struct list_head));
+	//daemon->arr_src_list = array_make(nelts, sizeof(struct list_head));
+	/*
+	for (i = 0; i < oldNelts; ++i)
+	{
+		ARRAY_IDX(daemon->arr_dst_list, i, struct list_head*) = ARRAY_IDX(old_dst, i, struct list_head*);
+		ARRAY_IDX(daemon->arr_src_list, i, struct list_head*) = ARRAY_IDX(old_src, i, struct list_head*);
+	}
+	
+	for (i = 0; i < nelts - oldNelts; ++i) {
+		INIT_LIST_HEAD((struct list_head*)array_push(daemon->arr_src_list));
+		INIT_LIST_HEAD((struct list_head*)array_push(daemon->arr_dst_list));
+	}
+
+	
+
+	daemon_unlock(daemon);
+	*/
+}
+
 int sp_bcm_daemon_create(sp_svc_t *svc, sp_bcm_daemon_t **p_daemon)
 {
 	sp_bcm_daemon_t *daemon = ZALLOC_T(sp_bcm_daemon_t);
 	int i;
-	int nelts = sp_mod_mgr_get_entity_array_nelts(sp_get_env()->mod_mgr);
+	int nelts = 100;// sp_mod_mgr_get_entity_array_nelts(sp_get_env()->mod_mgr);
 
 	DbgWithLinkForC(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM, "entity array nelts:%d", nelts);
 

+ 1 - 0
Framework/spbase/sp_bcm.h

@@ -53,6 +53,7 @@ DECLARE_REF_COUNT(sp_bcm_listener, sp_bcm_listener_t)
 
 // daemon
 SPBASE_API int sp_bcm_daemon_create(sp_svc_t *svc, sp_bcm_daemon_t **p_daemon);
+SPBASE_API int sp_bcm_deamon_refresh(sp_bcm_daemon_t* daemon);
 SPBASE_API void sp_bcm_daemon_destroy(sp_bcm_daemon_t *daemon);
 SPBASE_API array_header_t *sp_bcm_daemon_get_receiver(sp_bcm_daemon_t *daemon, int entity_id);
 SPBASE_API void sp_bcm_daemon_free_receiver_array(array_header_t *arr_receiver);

+ 8 - 7
Framework/spbase/sp_cfg.cpp

@@ -1991,12 +1991,13 @@ int init_defaultShellCfg(sp_dir_t* dir, sp_cfg_t* cfg)
 	default_shellConfig.insert(std::make_pair("Entity", entitySection));
 	std::map<std::string, std::string> startupSection;
 	long long index = 1;
-#ifdef _WIN32
+	//should not change those orders
 	startupSection.insert(std::make_pair(std::to_string(index++), "GUIConsole"));
-#endif
 	startupSection.insert(std::make_pair(std::to_string(index++), "Chromium"));
 	startupSection.insert(std::make_pair(std::to_string(index++), "VtmLoader"));
 	
+	
+	
 	default_shellConfig.insert(std::make_pair("Startup", startupSection));
 
 	return init_shell_byHttp(dir, cfg->shell_ini, cfg->root_ini, cfg->args, shellvar_path, default_shellConfig);
@@ -2107,11 +2108,11 @@ ErrorCodeEnum init_shell_byHttp(sp_dir_t* dir, sp_cfg_shell_ini_t* shell, sp_cfg
 	}
 	else
 	{
-	std::map<std::string, std::string> sysEventArr = shellConfig[SHELL_SYSEVENT_HEAD];
-	if ((rc = shell_ini__load_sysevent(shell, shellVarIni, sysEventArr)) != 0) {
-		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("load sysevent from shellvar.ini fail");
-		return Error_NotConfig;
-	}
+		std::map<std::string, std::string> sysEventArr = shellConfig[SHELL_SYSEVENT_HEAD];
+		if ((rc = shell_ini__load_sysevent(shell, shellVarIni, sysEventArr)) != 0) {
+			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("load sysevent from shellvar.ini fail");
+			return Error_NotConfig;
+		}
 	}
 
 	

+ 1 - 1
Framework/spbase/sp_iom.c

@@ -214,7 +214,7 @@ static void on_msg(bus_endpt_t *endpt, int msg, int nparam, param_size_t params[
 			bus_endpt_send_info(endpt, epid, pkt_type, pkt);
 			iobuffer_dec_ref(pkt);
 		}
-		WLog_DBG(TAG, "<== on_msg send_info end, pkt type: 0x%08X, %d, %d, %d, %d", pkt_type, this_svc_id, epid, svc_id, pkt_id);
+		WLog_DBG(TAG, "<== on_msg send_info end, pkt type: 0x%08X, this_svc_id:%d, epid:%d, svc_id:%d, pkt_id:%d", pkt_type, this_svc_id, epid, svc_id, pkt_id);
 	} else if (msg == IOM_T_GET_STATE) {
 		int epid = params[0];
 		int *state = (int*)params[1];

+ 5 - 1
Framework/spbase/sp_ses.c

@@ -795,7 +795,7 @@ static void uac_process_redirect(sp_ses_uac_t *uac, int epid, int svc_id, int co
 				uac->remote_epid = ent->mod->cfg->idx;
 				uac->remote_svc_id = ent->cfg->idx;
 				sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_CONN, conn_id, p_pkt);
-				DbgWithLinkForC(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM, "svc_post, epid:%d, svc_id:%d", uac->remote_epid, uac->remote_svc_id);
+				//DbgWithLinkForC(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM, "svc_post, epid:%d, svc_id:%d", uac->remote_epid, uac->remote_svc_id);
 			}
 		}
 	}
@@ -1094,6 +1094,7 @@ int sp_ses_uac_send_info(sp_ses_uac_t *uac, int method_id, int method_sig, iobuf
 		iobuffer_write_head(*info_pkt, IOBUF_T_I4, &method_sig, 0);
 		iobuffer_write_head(*info_pkt, IOBUF_T_I4, &method_id, 0);
 		rc = sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_INFO, uac->conn_id, info_pkt);
+		WLog_INFO(TAG, "sp_ses_uac_send_info from %d", uac->remote_epid);
 	} else {
 		DbgWithLinkForC(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM, "send info failed, uac is not in connected state!");
 		rc = Error_IO;
@@ -1201,6 +1202,7 @@ static void tsx_uac_process_ans(sp_tsx_uac_t *tsx, int end, iobuffer_t **ans_pkt
 	} else {
 		DbgWithLinkForC(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM, "tsx uac current state cannot recv ack!");
 		sp_svc_post(tsx->uac->mgr->svc, tsx->uac->remote_epid, tsx->uac->remote_svc_id, SP_PKT_SES|SES_CMD_ERRC, tsx->uac->conn_id, NULL);
+		WLog_INFO(TAG, "tsx_uac_process_ans remote_epid:%d, remote_svc_id:%d", tsx->uac->remote_epid, tsx->uac->remote_svc_id);
 	}
 	if (trigger)
 		tsx_uac_trigger(tsx, 0, end, ans_pkt);
@@ -1336,6 +1338,7 @@ int sp_tsx_uac_async_req(sp_tsx_uac_t *tsx, int timeout, iobuffer_t **req_pkt)
 		iobuffer_write_head(*req_pkt, IOBUF_T_I4, &tsx->tsx_id, 0);
 		sp_tsx_uac_inc_ref(tsx); // @1
 		rc = sp_svc_post(uac->mgr->svc, uac->remote_epid, uac->remote_svc_id, SP_PKT_SES|SES_CMD_REQ, uac->conn_id, req_pkt);
+		WLog_INFO(TAG, "sp_tsx_uac_async_req remote_epid:%d, remote_svc_id:%d, method_sig:%d, method_id:%d", uac->remote_epid, uac->remote_svc_id, tsx->method_sig, tsx->method_id);
 		if (rc == 0) {
 			if (timeout >= 0) {
 				tsx->op_timer = MALLOC_T(timer_entry);
@@ -1608,6 +1611,7 @@ static void uas_process_req_reply_error(sp_ses_uas_t *uas, int tsx_id, int err)
 
 	iobuffer_write_head(ans_pkt, IOBUF_T_I4, &tsx_id, 0);
 	sp_svc_post(uas->mgr->svc, uas->remote_epid, uas->remote_svc_id, SP_PKT_SES|SES_CMD_ANS, uas->conn_id, &ans_pkt);
+	WLog_INFO(TAG, "uas_process_req_reply_error remote_epid:%d, remote_svc_id:%d", uas->remote_epid, uas->remote_svc_id);
 	if (ans_pkt)
 		iobuffer_dec_ref(ans_pkt);
 }

+ 1 - 0
Framework/sphost/sphost.c

@@ -349,6 +349,7 @@ int main(int argc, char *argv[])
 			curModInfo->group = 0;
 			g_saveFile = atoi((dstParam[5]));
 			setCurEntityIdx(atoi(dstParam[6]));
+			//WLog_initRVC(dstParam[1]);
 			createLogProducer(dstParam[1], dstParam[2]);
 			if (testDua1 > 100 || testDual2 > 100 || testDual3 > 100 || testDual4 > 100)
 				DbgWithLink_sphost("sphost initTest in %d-%d-%d-%d", testDua1, testDual2, testDual3, testDual4);

+ 0 - 78
Framework/spshell/CMakeLists.txt

@@ -1,33 +1,6 @@
 set(MODULE_NAME "spshell")
 set(MODULE_PREFIX "SPSHELL")
 
-if(WITH_QT_GUI)
-message(STATUS "build spshell with QT GUI")
-set(CMAKE_AUTOUIC ON)
-set(CMAKE_AUTOMOC ON)
-set(CMAKE_AUTORCC ON)
-
-if(ARCH_AARCH64)
-    if(NOT CONAN_EXPORTED)
-        conan_cmake_run(REQUIRES qt/5.11.3@LR04.02_ThirdParty/testing BASIC_SETUP 
-        CMAKE_TARGETS BUILD missing)
-    endif(NOT CONAN_EXPORTED)
-    set(QT5_HINT_PATH ${CONAN_QT_ROOT})
-else()
-if(MSVC)
-    set(QT5_HINT_PATH "C:/Qt/Qt5.14.2/5.14.2/msvc2017/")
-else()
-    set(QT5_HINT_PATH "/opt/Qt5.14.2/5.14.2/gcc_64/lib/cmake/")
-endif(MSVC)
-endif(ARCH_AARCH64)
-
-find_package(Qt5 COMPONENTS Widgets REQUIRED 
-    HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-
-find_package(Qt5Charts HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-find_package(Qt5UiTools HINTS ${QT5_HINT_PATH} NO_SYSTEM_ENVIRONMENT_PATH )
-
-endif(WITH_QT_GUI)
 
 set(${MODULE_PREFIX}_SRCS
 	app.cpp
@@ -40,14 +13,6 @@ set(${MODULE_PREFIX}_SRCS
 	TelnetServer.cpp
 )
 
-if(WITH_QT_GUI)
-list(APPEND ${MODULE_PREFIX}_SRCS
-    QtBootSender.cpp
-    PollCenter.cpp
-)
-endif(WITH_QT_GUI)
-
-
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
 
 if (WIN32)
@@ -67,35 +32,9 @@ include_directories(${RVCFRAMEWORK_SOURCES_DIR})
 include_directories(${RVCFRAMEWORK_SOURCES_DIR}/spbase)
 include_directories(${RVCFRAMEWORK_SOURCES_DIR}/libtoolkit)
 
-if(WITH_QT_GUI)
-
-file(GLOB QT_SRCS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/*" 
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/treemodel/*"
-    "${CMAKE_CURRENT_SOURCE_DIR}/Widgets/floatwidget/*")
-
-    if(NOT WIN32)
-        list(REMOVE_ITEM QT_SRCS 
-            Widgets/sysinfowindowsimpl.cpp
-            Widgets/sysinfowindowsimpl.h
-            )
-    else()
-        list(REMOVE_ITEM QT_SRCS 
-            Widgets/sysinfolinuximpl.cpp
-            Widgets/sysinfolinuximpl.h
-            )
-    endif(NOT WIN32)
-
-list(APPEND ${MODULE_PREFIX}_SRCS ${QT_SRCS})
-
-endif(WITH_QT_GUI)
 
 add_executable(${MODULE_NAME} WIN32 ${${MODULE_PREFIX}_SRCS})
 
-if(WITH_QT_GUI)
-    target_compile_definitions(${MODULE_NAME} PRIVATE "WITH_QT")
-endif(WITH_QT_GUI)
-
 if(MSVC)
 # run as administration privilidege
 set_target_properties(${MODULE_NAME}  
@@ -107,10 +46,6 @@ target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
 target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
 target_include_directories(${MODULE_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Widgets)
 
-if(WITH_QT_GUI)
-set_target_properties(${MODULE_NAME} PROPERTIES AUTOMOC TRUE)
-endif(WITH_QT_GUI)
-
 list(APPEND ${MODULE_PREFIX}_LIBS libtoolkit spbase)
 if(MSVC)
     # set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
@@ -123,10 +58,6 @@ else()
     list(APPEND ${MODULE_PREFIX}_LIBS winpr)
 endif()
 
-if(WITH_QT_GUI)
-    list(APPEND ${MODULE_PREFIX}_LIBS Qt5::Widgets Qt5::Core Qt5::Gui Qt5::Charts Qt5::UiTools)
-endif(WITH_QT_GUI)
-
 target_link_libraries(${MODULE_NAME} ${${MODULE_PREFIX}_LIBS})
 
 install(TARGETS ${MODULE_NAME} 
@@ -138,12 +69,3 @@ install(TARGETS ${MODULE_NAME}
 if (WITH_PDB_SAVE AND MSVC)
     install(FILES ${RVC_PDB_BINARY_DIR}/${MODULE_NAME}.pdb DESTINATION ${RVC_PDBSAVE_PATH} COMPONENT symbols)
 endif()
-
-#不再在bin目录下附带QT相关的内容
-if(FALSE AND WITH_QT_GUI AND ARCH_AARCH64)
-    file(GLOB LACK_QT_FILES "${CONAN_LIB_DIRS_QT}/libQt5Charts.so*" "${CONAN_LIB_DIRS_QT}/libQt5DBus.so*")
-    install(PROGRAMS ${LACK_QT_FILES} DESTINATION "${RVC_RUNTIME_PATH}" COMPONENT libraries)
-     if(CONAN_EXPORTED)
-        file(COPY ${LACK_QT_FILES} DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-     endif(CONAN_EXPORTED)
-endif(FALSE AND WITH_QT_GUI AND ARCH_AARCH64)

+ 0 - 165
Framework/spshell/PollCenter.cpp

@@ -1,165 +0,0 @@
-#include "PollCenter.h"
-#include "SpBase.h"
-#include "app.h"
-#include "QtBootSender.h"
-#include <QThread>
-#include "dbgutil.h"
-class ClearThread : public QThread
-{
-public:
-    ClearThread(int code):exitCode(code) {
-    }
-    virtual void run()
-    {
-        app_stop(EXIT_FROM_QT + exitCode);
-    }
-private:
-    int exitCode;
-};
-
-
-void Poller::OnPoll()
-{
-    LOG_FUNCTION();
-    //TODO: deal with rc 
-    int rc = app_run();
-    app_term();
-    emit Finished(rc);
-}
-
-static const char* GetTerminalInfo()
-{
-    const char* defaultInfo = "RVC Terminal Application";
-    static char szInfo[256] = {};
-    if (szInfo[0] != 0)
-        return szInfo;
-    auto env = sp_get_env();
-    if (env == NULL) {
-        return defaultInfo;
-    }
-
-    auto cfg = env->cfg;
-    if (cfg == NULL) {
-        return defaultInfo;
-    }
-
-    sprintf(szInfo, "%s  %s %s  V%d.%d.%d.%d",
-            cfg->root_ini->terminal_no == NULL ? "" : cfg->root_ini->terminal_no,
-            cfg->root_ini->machine_type == NULL ? "" : cfg->root_ini->machine_type,
-            cfg->root_ini->site == NULL ? "" : cfg->root_ini->site,
-            cfg->install_ini->install_version.major,
-            cfg->install_ini->install_version.minor,
-            cfg->install_ini->install_version.revision,
-            cfg->install_ini->install_version.build);
-
-    return szInfo;
-}
-
-static int GetTotalEntityCount()
-{
-    auto env = sp_get_env();
-    if (env == NULL) {
-        return 0;
-    }
-    auto cfg = env->cfg;
-    if (cfg == NULL) {
-        return 0;
-    }
-    return cfg->shell_ini->arr_entity->nelts;
-}
-
-Center::Center(int& argc, char** argv) 
-    :QApplication(argc, argv)
-    ,mWidget(nullptr),mWindow(nullptr), stopFlag(NoInit)
-{
-
-}
-
-void Center::Init()
-{
-    LOG_FUNCTION();
-    QPixmap pixmap(":/res/splash.png");
-    mSplashScreen = new BootSplashScreen(pixmap, 0);
-    mSplashScreen->show();
-
-    mPoller = new Poller();
-    mPoller->moveToThread(&mPollThread);
-
-    connect(this, &Center::StartPoll, mPoller, &Poller::OnPoll);
-    connect(&mPollThread, &QThread::finished, mPoller, &QObject::deleteLater);
-    connect(mPoller, &Poller::Finished, this, &Center::OnFinishedReceived);
-}
-
-int Center::Run()
-{
-    LOG_FUNCTION();
-#ifndef WITH_MAIN_WINDOW
-    mWidget = new BootWidget(QString(GetTerminalInfo()), GetTotalEntityCount());
-    processEvents();
-    mWidget->show();
-    mSplashScreen->finish(mWidget);
-#else
-    mWindow = new MainWindow(QString(GetTerminalInfo()), GetTotalEntityCount());
-    processEvents();
-    mWindow->show();
-    mSplashScreen->finish(mWindow);
-#endif //WITH_MAIN_WINDOW
-
-    TOOLKIT_ASSERT(get_app_instance() != nullptr);
-    TOOLKIT_ASSERT(get_app_instance()->bsc_gui != nullptr);
-    TOOLKIT_ASSERT(get_app_instance()->bsc_gui->gui_inst != nullptr);
-#ifndef WITH_MAIN_WINDOW
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-                          &QtBootSender::ShowMessage, mWidget, &BootWidget::ReceiveMessage);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::ShowMessageVariant, mWidget, &BootWidget::ReceiveMessageVariant
-            //, Qt::DirectConnection);
-            , Qt::QueuedConnection);
-            //, Qt::BlockingQueuedConnection);
-#else
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-                          &QtBootSender::ShowMessage, mWindow, &MainWindow::ReceiveMessage);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::ShowMessageVariant, mWindow, &MainWindow::ReceiveMessageVariant
-            //, Qt::DirectConnection);
-            , Qt::QueuedConnection);
-            //, Qt::BlockingQueuedConnection);
-    connect((QtBootSender*)(get_app_instance()->bsc_gui->gui_inst),
-            &QtBootSender::SendEntityStateChange, mWindow, &MainWindow::ReceiveEntityVariant
-            , Qt::QueuedConnection);
-#endif
-
-    mPollThread.start();
-    emit StartPoll();
-    const int exitCode = exec();
-    if (stopFlag == NoInit) {
-        stopFlag = StopFromGUI;
-        ClearThread* t = new ClearThread(exitCode);
-        t->start();
-        //app_stop();
-        while (stopFlag != StopFinished) {
-            Sleep(200);
-            this->processEvents();
-        }
-        delete t;
-    }
-    return exitCode;
-}
-
-void Center::OnFinishedReceived(int result)
-{
-    LOG_FUNCTION();
-    if (stopFlag == NoInit) {
-        stopFlag = StopFromPoll;
-        this->exit(result);
-    } else {
-        stopFlag = StopFinished;
-    }
-    //exit(result);
-}
-
-Center::~Center()
-{
-    mPollThread.quit();
-    mPollThread.wait();
-}

+ 0 - 62
Framework/spshell/PollCenter.h

@@ -1,62 +0,0 @@
-#ifndef _RVC_SPSHELL_POLL_CENTER_H_
-#define _RVC_SPSHELL_POLL_CENTER_H_
-
-#include <Widgets/BootSplashScreen.h>
-#include <Widgets/BootWidget.h>
-#include <Widgets/mainwindow.h>
-#include <QApplication>
-#include <QObject>
-#include <QThread>
-
-#define WITH_MAIN_WINDOW 1
-
-class Poller : public QObject
-{
-    Q_OBJECT
-
-public:
-    explicit Poller(QObject* parent = nullptr) : QObject(parent)
-    {
-    }
-    ~Poller() {}
-signals:
-    void Finished(int exitCode);
-
-public slots:
-
-    void OnPoll();
-};
-
-class Center : public QApplication
-{
-    Q_OBJECT
-public:
-    Center(int& argc, char** argv);
-    ~Center(); 
-
-    int Run();
-    BootWidget* mWidget;
-    MainWindow* mWindow;
-    BootSplashScreen* GetSplash() { return mSplashScreen; }
-    void Init();
-signals:
-    void StartPoll();
-    void EndPoll(int exitCode);
-
-public slots:
-    void OnFinishedReceived(int result);
-
-private:
-    QThread mPollThread;
-    Poller* mPoller;
-    BootSplashScreen* mSplashScreen;
-    enum StopEnum
-    {
-        NoInit,
-        StopFromPoll,
-        StopFromGUI,
-        StopFinished
-    } stopFlag;
-};
-
-#endif /*_RVC_SPSHELL_POLL_CENTER_H_*/

+ 0 - 155
Framework/spshell/QtBootSender.cpp

@@ -1,155 +0,0 @@
-#include "QtBootSender.h"
-#include "memutil.h"
-#include "charset.h"
-#include "sp_env.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui)
-{
-    int result = 0;
-    sp_gui_format_t* gui = ZALLOC_T(sp_gui_format_t);
-    if (gui != nullptr) {
-        gui->gui_inst = (void*)(new QtBootSender());
-        gui->display = &qt_gui_display;
-        gui->hide = &qt_gui_undisplay;
-        gui->show_entity_info = &qt_gui_show_entity_info;
-        gui->show_running_info = &qt_gui_show_running_info;
-        gui->post_message = &qt_gui_post_message;
-        *p_gui = gui;
-    }
-    return result;
-}
-
-void qt_gui_destroy_format(sp_gui_format_t* p_gui)
-{
-    if (p_gui->gui_inst) {
-        delete ((QtBootSender*)p_gui->gui_inst);
-    }
-    FREE(p_gui);
-}
-
-namespace
-{
-MessageType MappingTypeFromGUI2Msg(int type)
-{
-    switch (type) {
-    case GUI_DISPLAY_ELEM_LOG_DEBUG:
-    case GUI_DISPLAY_ELEM_LOG_EVENT:
-        return TextEvent;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_WARN:
-        return TextWarn;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_ERROR:
-        return TextError;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_FATAL:
-        return TextFatal;
-        break;
-    case GUI_DISPLAY_ELEM_BLUESCREEN:
-        return DisplayBlueScreen;
-        break;
-    case GUI_DISPLAY_ELEM_FATAL_ERROR:
-        return TextFatal;
-        break;
-    case GUI_DISPLAY_ELEM_FATAL_BLOCK:
-        return TextBlock;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_INFO:
-        return TextNotifyInfo;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_WARN:
-        return TextNotifyWarn;
-        break;
-    case GUI_DISPLAY_ELEM_NOTIFY_ERROR:
-        return TextNotifyError;
-        break;
-    case GUI_DISPLAY_ELEM_STARTUP_INFO:
-        return ModStartupInfo;
-        break;
-    case GUI_DISPLAY_ELEM_LOG_OTHER:
-        return StageChangeInfo;
-    default:
-        return MsgTypeMax;
-        break;
-    }
-}
-}
-
-int qt_gui_show_running_info(void* gui, const char* msg, int type)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-#if defined(_MSC_VER)
-    senderInst->SendShowMessage(msg, MappingTypeFromGUI2Msg(type));
-#else
-    bool done = false;
-    if (!toolkit_detect_utf8_str(msg)) {
-        const int len = toolkit_gbk2utf8((char*)msg, strlen(msg) + 1, NULL, 0);
-        if (len > 0) {
-            char* temp = CALLOC_T(len, char);
-            memset(temp, 0, len);
-            if (toolkit_gbk2utf8((char*)msg, strlen(msg) + 1, temp, len) > 0) {
-                senderInst->SendShowMessage(temp, MappingTypeFromGUI2Msg(type));
-                done = true;
-            }
-            FREE(temp);
-        }
-    }
-    if (!done) {
-        senderInst->SendShowMessage(msg, MappingTypeFromGUI2Msg(type));
-    }
-#endif //_MSC_VER
-    return 0;
-}
-
-int qt_gui_show_entity_info(void* gui, const char* entity, int state)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-	sp_env_t *env = sp_get_env();
-    QEntityActiveInfo entityInfo;
-    entityInfo.entityName = entity;
-    entityInfo.entityState = static_cast<EntityState>(state);
-	sp_mod_mgr_t *mod_mgr = env->mod_mgr;
-	sp_entity_t *ent = sp_mod_mgr_find_entity_by_name(mod_mgr, entity);
-	if (ent) {
-        entityInfo.entityDevId = ent->instance_id;
-        entityInfo.entityState = static_cast<EntityState>(ent->state);
-        entityInfo.entityPID = ent->mod->process.pid;
-    	sp_cfg_shell_entity_t *cfg_ent = sp_cfg_get_entity_by_idx(env->cfg, ent->cfg->idx);
-        if(cfg_ent) {
-            char szv[64] = {0};
-            sprintf(szv, "V%d.%d.%d", cfg_ent->version.major, cfg_ent->version.minor, cfg_ent->version.revision);
-            entityInfo.entityVerStr = szv;
-        } else {
-            entityInfo.entityVerStr = "V0.0.0";
-        }
-    } else {
-        entityInfo.entityDevId = 0;
-        entityInfo.entityPID = 0;
-        entityInfo.entityVerStr = "V0.0.0";
-    }
-
-    senderInst->SendEntityInfo(entityInfo);
-
-    return 0;
-}
-
-int qt_gui_display(void* gui)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", DisplayShow);
-    return 0;
-}
-
-int qt_gui_undisplay(void* gui)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", DisplayHide);
-    return 0;
-}
-
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2)
-{
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    senderInst->SendShowMessage("", MappingTypeFromGUI2Msg(param1), (int)param2);
-    return;
-}

+ 0 - 61
Framework/spshell/QtBootSender.h

@@ -1,61 +0,0 @@
-#ifndef _RVC_QT_BOOT_SENDER_H__
-#define _RVC_QT_BOOT_SENDER_H__
-
-#include "sp_gui_def.h"
-
-#include <Widgets/QtMessageInfo.h>
-#include <Widgets/BootWidget.h>
-
-#include <QApplication>
-#include <QObject>
-
-#include "SpBase.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui);
-void qt_gui_destroy_format(sp_gui_format_t* p_gui);
-
-// type: 0 normal msg; 1 bluescreen; 2 fatal error
-int qt_gui_show_running_info(void* gui, const char* msg, int type);
-int qt_gui_show_entity_info(void* gui, const char* entity, int state);
-int qt_gui_display(void* gui);
-int qt_gui_undisplay(void* gui);
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2);
-
-class QtBootSender : public QObject
-{
-    Q_OBJECT
-
-public:
-
-    QtBootSender(QObject* parent = nullptr) :QObject(parent) 
-    {
-    }
-    ~QtBootSender() {}
-
-    void SendShowMessage(const char* msg, MessageType type = TextEvent, int param1 = 0, int param2 = 0)
-    {
-        QtMessageInfo message;
-        message.content = QString(msg);
-        message.type = type;
-        message.param1 = param1;
-        message.param2 = param2;
-        QVariant var;
-        var.setValue(message);
-        emit ShowMessageVariant(var);
-    }
-
-    void SendEntityInfo(QEntityActiveInfo info)
-    {
-        QVariant var;
-        var.setValue(info);
-        emit SendEntityStateChange(var);
-    }
-
-signals:
-    void SendEntityStateChange(QVariant entityInfo);
-    void ShowMessage(const QtMessageInfo* meesage); 
-    void ShowMessageVariant(QVariant info);
-};
-
-
-#endif //_RVC_QT_BOOT_SENDER_H__

+ 0 - 89
Framework/spshell/QtMessageSender.cpp

@@ -1,89 +0,0 @@
-#include "QtMessageSender.h"
-#include "QtBootSender.h"
-
-#include <thread>
-
-#include "Widgets/BootWidget.h"
-#include "MessageSender.h"
-
-#include <QApplication>
-
-#include "SpBase.h"
-#include "memutil.h"
-
-int qt_gui_create_format(sp_gui_format_t** p_gui)
-{
-    int result = 0;
-    sp_gui_format_t* gui = ZALLOC_T(sp_gui_format_t);
-    if (gui != nullptr) {
-        gui->gui_inst = (void*)(new QtBootSender());
-        gui->display = &qt_gui_display;
-        gui->hide = &qt_gui_undisplay;
-        gui->show_entity_info = &qt_gui_show_entity_info;
-        gui->show_running_info = &qt_gui_show_running_info;
-        gui->post_message = &qt_gui_post_message;
-        *p_gui = gui;
-    }
-    return result;
-}
-
-void qt_gui_destroy_format(sp_gui_format_t* p_gui)
-{
-    if (p_gui->gui_inst) {
-        delete p_gui->gui_inst;
-    }
-    FREE(p_gui);
-}
-
-int qt_gui_show_running_info(void* gui, const char* msg, int type)
-{
-    QtMessageInfo message{ QString(msg), TextEvent };
-    QtBootSender* senderInst = (QtBootSender*)gui;
-    emit senderInst->ShowMessage(message);
-    return 0;
-}
-
-int qt_gui_show_entity_info(void* gui, const char* entity, int state)
-{
-    return 0;
-}
-
-int qt_gui_display(void* gui)
-{
-    return 0;
-}
-
-int qt_gui_undisplay(void* gui)
-{
-    return 0;
-}
-
-void qt_gui_post_message(void* gui, unsigned long param1, unsigned long param2)
-{
-
-}
-
-QtMessageSender::QtMessageSender():mWinInitialized(false), sender(nullptr) {
-
-    //sender = new QtBootSender();
-    kSenderInst = new QtBootSender();
-    std::thread uiThread(QtWinThread, this);
-    uiThread.detach();
-    Sleep(300);
-}
-
-QtMessageSender::~QtMessageSender()
-{
-    if (sender) {
-        delete sender;
-        sender = nullptr;
-    }
-}
-
-void QtMessageSender::ShowMessage(const SP::UI::MessageInfo& msg)
-{
-    QtMessageInfo message{ QString(msg.content.GetData()), msg.type };
-    if (kSenderInst) {
-        emit kSenderInst->ShowMessage(message);
-    }
-}

+ 0 - 30
Framework/spshell/QtMessageSender.h

@@ -1,30 +0,0 @@
-#ifndef _RVC_QT_MESSAGE_SENDER_H_
-#define _RVC_QT_MESSAGE_SENDER_H_
-
-#include "MessageSender.h"
-
-class IQtProxy
-{
-public:
-    virtual ~IQtProxy() {}
-};
-
-class QtMessageSender : public SP::UI::ITextSender
-{
-
-public:
-
-    QtMessageSender();
-    ~QtMessageSender();
-
-    void ShowMessage(const SP::UI::MessageInfo& meesage);
-
-private:
-    IQtProxy* sender;
-    bool mWinInitialized;
-};
-
-
-
-
-#endif //_RVC_QT_MESSAGE_SENDER_H_

+ 0 - 166
Framework/spshell/Widgets/BootGlobal.h

@@ -1,166 +0,0 @@
-#ifndef BOOTGLOBAL_H
-#define BOOTGLOBAL_H
-
-#include <QCoreApplication>
-#include <QWidget>
-#include <QColor>
-#include <QLayout>
-#include <QTextCodec>
-#include <QProcess>
-#include <QDebug>
-#include <QMessageBox>
-#include <QStandardPaths>
-#include <QDir>
-
-inline static QColor GetLeftBackgoundColor()
-{
-    return QColor(101, 105, 108, 255); //#65696C
-}
-
-inline static QColor GetRightBackgoundColor()
-{
-    return QColor(161, 163, 165, 255); //#A1A3A5
-}
-
-inline static QColor GetGlobalBackgoundColor()
-{
-    return QColor(161, 163, 165, 255); //#A1A3A5
-}
-
-inline static QColor GetConsoleFrontColor()
-{
-    return QColor(0, 255, 0, 255); //#00FF00
-}
-
-inline static QString GetLogoPicPath()
-{
-    return ":/Pics/res/Logo.png";
-}
-
-inline static void SetWidgetBackgroundColor(QWidget* widget, QColor color)
-{
-    QPalette labelPalette;
-    labelPalette.setColor(QPalette::Background, color);
-    widget->setAutoFillBackground(true);
-    widget->setPalette(labelPalette);
-}
-
-inline static void SlimLayout(QLayout *layout)
-{
-    layout->setContentsMargins(0, 0, 0, 0);
-    //layout->setMargin(0);
-    layout->setSpacing(0);
-}
-
-inline static QString ByteArrayToUnicode(const QByteArray &array)
-{
-    QTextCodec::ConverterState state;
-    QString text = QTextCodec::codecForName("UTF-8")->toUnicode(array.constData(), array.size(), &state);
-    // 如果转换时无效字符数量大于0,说明编码格式不对
-    if (state.invalidChars > 0){
-        text = QTextCodec::codecForName("GBK")->toUnicode(array);
-    }
-    return text;
-}
-
-inline static QString FakeUnicodeToUnicode(const QString& str)
-{
-    QByteArray bytes = str.toUtf8();
-    return ByteArrayToUnicode(bytes);
-}
-
-inline static bool ExtractResFile(QWidget* parent, const QString& resFileName, const QString& destPath)
-{
-    bool result = true;
-    QFile autoRunCfgIn(resFileName);
-    if (!autoRunCfgIn.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        QString content = QString("提取文件 %1 失败:%2").arg(resFileName).arg(autoRunCfgIn.errorString());
-        QMessageBox::critical(parent, "错误", content, QMessageBox::Yes);
-        return false;
-    }
-    QTextStream in(&autoRunCfgIn);
-    QFile autoRunCfgOut(destPath);
-    if (!autoRunCfgOut.open(QIODevice::WriteOnly | QIODevice::Text)) {
-        autoRunCfgIn.close();
-        qDebug() << "open " << destPath << " for write failed" << endl;
-        QString content = QString("写入文件 %1 失败:%2").arg(destPath).arg(autoRunCfgOut.errorString());
-        QMessageBox::critical(parent, "错误", content, QMessageBox::Yes);
-        return false;
-    }
-    QTextStream out(&autoRunCfgOut);
-    while (!in.atEnd())
-        out << in.readAll();
-
-    autoRunCfgOut.close();
-    autoRunCfgIn.close();
-
-    result = QFile::setPermissions(destPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                   | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                   | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                   | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-
-    return result;
-}
-
-inline static QStringList ExecuteShellScripts(QWidget* parent, QString shellCmd)
-{
-
-    qDebug() << __FUNCTION__ << ": " << shellCmd;
-
-    QStringList results, options;
-    QProcess* subScriptsProcess = new QProcess(parent);
-    subScriptsProcess->setProcessChannelMode(QProcess::MergedChannels);
-    subScriptsProcess->start("sh", QStringList() << "-c" << shellCmd);
-    subScriptsProcess->waitForFinished();
-    QString str(subScriptsProcess->readAllStandardOutput());
-    results << QString::number(subScriptsProcess->exitCode());
-    qDebug() << results;
-    results << subScriptsProcess->program() << subScriptsProcess->arguments();
-    results << str;
-    QMessageBox::warning(parent, "Run Shell Scripts Info", results.join("\n"), QMessageBox::Ok);
-    delete subScriptsProcess;
-    return results;
-}
-
-inline static QString getUserName()
-{
-    QString result;
-
-    QProcessEnvironment envs = QProcessEnvironment::systemEnvironment();
-    if (envs.contains("SUDO_USER")) {
-        result = envs.value("SUDO_USER");
-    }
-
-    if (result.isNull() || result.isEmpty()) {
-        result = envs.value("USER");
-    }
-
-    return result;
-}
-
-inline static QString getFrameworkConfigPath()
-{
-    QString appDir = QCoreApplication::applicationDirPath();
-
-#ifdef Q_WS_WIN32
-
-    if (appDir.endsWith("\\bin")) {
-        appDir = appDir.left(appDir.length() - QString("\\bin").length());
-        appDir += "\\cfg";
-    }
-    QString configFileName = appDir + "\\SpShell.ini";
-
-#else
-
-    if (appDir.endsWith("/bin")) {
-        appDir = appDir.left(appDir.length() - QString("/bin").length());
-        appDir += "/cfg";
-    }
-    QString configFileName = appDir + "/SpShell.ini";
-
-#endif
-
-    return configFileName;
-}
-
-#endif // BOOTGLOBAL_H

+ 0 - 21
Framework/spshell/Widgets/BootSplashScreen.cpp

@@ -1,21 +0,0 @@
-#include "BootSplashScreen.h"
-
-BootSplashScreen::BootSplashScreen(QPixmap& pixmap, int elapseTime)
-    : QSplashScreen(pixmap)
-    , mProgressBar(nullptr),mElapseTime(elapseTime)
-{
-    //mProgressBar = new QProgressBar(this);
-    //mProgressBar->setGeometry(0, pixmap.height() - 50, pixmap.width(), 30);
-    //mProgressBar->setRange(0, 100);
-    //mProgressBar->setValue(0);
-
-    setCursor(Qt::BlankCursor);
-    setFont(QFont("宋体", 14));
-}
-
-BootSplashScreen::~BootSplashScreen()
-{
-
-}
-
-

+ 0 - 29
Framework/spshell/Widgets/BootSplashScreen.h

@@ -1,29 +0,0 @@
-#ifndef BOOTSPLASHSCREEN_H
-#define BOOTSPLASHSCREEN_H
-
-#include <QSplashScreen>
-#include <QPixmap>
-#include <QProgressBar>
-#include <QList>
-#include <QtGlobal>
-
-
-class BootSplashScreen : public QSplashScreen
-{
-    Q_OBJECT
-public:
-    BootSplashScreen(QPixmap& pixmap, int elapseTime);
-    ~BootSplashScreen();
-
-private:
-    QProgressBar* mProgressBar;
-    int mElapseTime;
-
-private:
-    void SetProgress();
-
-private:
-    void slotUpdateProgress();
-};
-
-#endif // BOOTSPLASHSCREEN_H

+ 0 - 284
Framework/spshell/Widgets/BootWidget.cpp

@@ -1,284 +0,0 @@
-#include "BootWidget.h"
-#include "BootGlobal.h"
-#include "ui_BootWidget.h"
-
-#include <QLabel>
-#include <QScreen>
-#include <QDateTime>
-
-#include "SpBase.h"
-
-BootWidget::BootWidget(QString systemInfo, int totalEntityCount, QWidget *parent)
-    : QWidget(parent),mSplitter(NULL),mListEvtLog(NULL), mSystemInfo(systemInfo)
-	,mListImportantTip(NULL),mLogoLabel(NULL),mEntityBootTotalLabel(NULL),mEntityBootingLabel(NULL)
-    , mEntityTotalCount(totalEntityCount), mEntityBootedCount(0)
-{
-    setWindowIcon(QIcon(":/res/FavIcon.ico"));
-    setMinimumSize(1920, 1080);
-    SetFullMode();
-    Init();
-}
-
-BootWidget::~BootWidget()
-{
-
-}
-
-void BootWidget::SetFullMode()
-{
-    setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
-    setAttribute(Qt::WA_TranslucentBackground);
-
-    /*
-    setWindowFlags(Qt::Window | Qt::FramelessWindowHint
-                   | Qt::WindowStaysOnTopHint|Qt::Tool
-                   |Qt::X11BypassWindowManagerHint);
-    */
-
-    //setParent(nullptr);
-
-    QList<QScreen *> listScreens =  QGuiApplication::screens();  //多显示器
-    QRect rect = listScreens.at(0)->geometry();
-    const int desktopWidth = rect.width();
-    const int desktopHeight = rect.height();
-    setMinimumSize(desktopWidth, desktopHeight);
-}
-
-void BootWidget::Demo_FulfillLog()
-{
-    for(int i=1; i<=20; ++i)
-    {
-        QString str = QString(QStringLiteral("我是第%1串字符串")).arg(i);
-        QBaseListWidgetItem* item = new QErrorListWidgetItem(str);
-        // 为啥子类不能直接调用父类的接口??
-        item->AppentToWidget(mListEvtLog);
-    }
-}
-
-void BootWidget::Demo_FulfillFatalMsg()
-{
-    for(int i=1; i<1024; ++i)
-    {
-        QString str = QString(QStringLiteral("我是第%1串字符串")).arg(i);
-        QBaseListWidgetItem* item = new QTipListWidgetItem(str);
-        item->AppentToWidget(mListImportantTip);
-    }
-}
-
-void BootWidget::RefreshInfoAboutEntity()
-{
-    int totalBootedEntity(0);
-    QString failedEntityInfo;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if ((mBootEntitiesInfo[i].entityState >= Idle && mBootEntitiesInfo[i].entityState <= Pause)
-                       || mBootEntitiesInfo[i].entityState == Passed || mBootEntitiesInfo[i].entityState == Failed) {
-            totalBootedEntity++;
-        } else if (mBootEntitiesInfo[i].entityState == Lost) {
-            failedEntityInfo += QString(QStringLiteral("模块[%1]启动失败\r\n")).arg(mBootEntitiesInfo[i].entityName);
-        }
-    }
-    QString totalEntityBootInfo = QString(QStringLiteral("%1/%2 个模块启动成功")).arg(totalBootedEntity).arg(mEntityTotalCount);
-    mEntityBootTotalLabel->setText(totalEntityBootInfo);
-    mEntityBootFailedLabel->setText(failedEntityInfo);
-}
-
-void BootWidget::Init()
-{
-    QFont font;
-    font.setFamily(QStringLiteral("微软雅黑"));
-    //font.setPointSize(12);
-    this->setFont(font);
-
-    auto *layoutCenter = new QHBoxLayout(this);
-    auto *layoutLeft = new QVBoxLayout(this);
-    auto *layoutRight = new QVBoxLayout(this);
-    auto *layoutRightArea = new QVBoxLayout(this);
-
-    SlimLayout(layoutCenter);
-    SlimLayout(layoutLeft);
-    SlimLayout(layoutRight);
-    SlimLayout(layoutRightArea);
-
-    layoutRight->addLayout(layoutRightArea);
-
-    mListEvtLog = new QLeftInfoListWidget(this);
-    layoutLeft->addWidget(mListEvtLog);
-
-    //Demo_FulfillLog();
-
-    // LOGO
-    mLogoLabel = new QLabel(this);
-    QPixmap logoPixmap(GetLogoPicPath());
-    if(false)
-    {
-        const int labelWidth = mLogoLabel->width();
-        const int labelHeight = mLogoLabel->height();
-        //logoPixmap = logoPixmap.scaled(labelWidth, labelHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
-        logoPixmap = logoPixmap.scaled(labelWidth, labelHeight, Qt::KeepAspectRatio);
-    } else {
-        //const int pixWidth = logoPixmap.width();
-        //const int pixlHeight = logoPixmap.height();
-        //mLogoLabel->resize(pixWidth, pixlHeight);
-    }
-    mLogoLabel->setAlignment(Qt::AlignCenter);
-    mLogoLabel->setPixmap(logoPixmap);
-    //mLogoLabel->setScaledContents(true);
-    SetWidgetBackgroundColor(mLogoLabel, GetRightBackgoundColor());
-
-    // TerminalInfo
-    QLabel* terminalLabel = new QLabel(this);
-    QFont terminalFont;
-    terminalFont.setFamily(QStringLiteral("微软雅黑"));
-    terminalFont.setPointSize(12);
-    terminalLabel->setFont(terminalFont);
-    terminalLabel->setText(mSystemInfo);
-    terminalLabel->setAlignment(Qt::AlignCenter);
-    SetWidgetBackgroundColor(terminalLabel, GetRightBackgoundColor());
-
-
-    // Entity boot information
-    mEntityBootTotalLabel = new QLabel(this);
-    //equals: entityBootLabel->setText(QString::fromLocal8Bit(("11/55 个模块启动成功")));
-    mEntityBootTotalLabel->setText(QStringLiteral("11/55 个模块启动成功"));
-    mEntityBootTotalLabel->setAlignment(Qt::AlignCenter);
-    QFont fontLabel;
-    fontLabel.setBold(true);
-    fontLabel.setPointSize(12);
-    mEntityBootTotalLabel->setFont(fontLabel);
-    //entityBootLabel->setStyleSheet("font-size:40px;font-style:blod");
-    SetWidgetBackgroundColor(mEntityBootTotalLabel, GetRightBackgoundColor());
-    // no effect.
-    //entityBootLabel->setContentsMargins(0,1000,0,1000);
-    mEntityBootTotalLabel->setMargin(10);
-
-    // Entity startup information
-    {
-        mEntityBootingLabel = new QLabel(this);
-        mEntityBootingLabel->setText(QStringLiteral("正在启动 mod_Browser..."));
-        mEntityBootingLabel->setAlignment(Qt::AlignCenter);
-        fontLabel.setBold(false);
-        fontLabel.setPointSize(12);
-        mEntityBootingLabel->setFont(fontLabel);
-        mEntityBootingLabel->setMargin(5);
-        QPalette pe;
-        pe.setColor(QPalette::Background, GetRightBackgoundColor());
-        pe.setColor(QPalette::Foreground, Qt::white);
-        mEntityBootingLabel->setAutoFillBackground(true);
-        mEntityBootingLabel->setPalette(pe);
-    }
-    {
-        mEntityBootFailedLabel = new QLabel(this);
-        mEntityBootFailedLabel->setText(QStringLiteral("实体[mod_Browser]启动失败"));
-        mEntityBootFailedLabel->setAlignment(Qt::AlignCenter);
-        fontLabel.setBold(false);
-        fontLabel.setPointSize(11);
-        mEntityBootFailedLabel->setFont(fontLabel);
-        mEntityBootFailedLabel->setMargin(5);
-        QPalette pe;
-
-        pe.setColor(QPalette::Background, GetRightBackgoundColor());
-        pe.setColor(QPalette::Foreground, Qt::darkRed);
-        mEntityBootFailedLabel->setAutoFillBackground(true);
-        mEntityBootFailedLabel->setPalette(pe);
-    }
-
-    layoutRightArea->addWidget(mLogoLabel);
-    layoutRightArea->addWidget(terminalLabel);
-    layoutRightArea->addWidget(mEntityBootTotalLabel);
-    layoutRightArea->addWidget(mEntityBootingLabel);
-    layoutRightArea->addWidget(mEntityBootFailedLabel);
-
-    mListImportantTip = new QRightInfoListWidget(this);
-    layoutRightArea->addWidget(mListImportantTip);
-
-    //Demo_FulfillFatalMsg();
-
-    layoutCenter->addLayout(layoutLeft);
-    layoutCenter->addLayout(layoutRight);
-    layoutCenter->setStretch(0, 80);
-    layoutCenter->setStretch(1, 20);
-
-    this->setLayout(layoutCenter);
-}
-
-void BootWidget::paintEvent(QPaintEvent *event)
-{
-    /*
-    QPixmap logoPixmap(GetLogoPicPath());
-    const int pixWidth = logoPixmap.width();
-    const int pixlHeight = logoPixmap.height();
-
-    const int labelWidth = mLogoLabel->width();
-    const int newLabelHeight = labelWidth / (pixWidth / pixlHeight);
-    mLogoLabel->resize(labelWidth, newLabelHeight);
-    */
-}
-
-void BootWidget::ReceiveMessage(const QtMessageInfo* message)
-{
-    QBaseListWidgetItem* item = new QErrorListWidgetItem(message->content);
-    item->AppentToWidget(mListEvtLog);
-}
-
-namespace
-{
-QString CoverWithTimePrefix(QString content)
-{
-    QDateTime time = QDateTime::currentDateTime();
-    QString buffer = time.toString("[hh:mm:ss]");
-    QString result = QString("%1 %2").arg(buffer).arg(content);
-    return result;
-}
-}
-
-void BootWidget::ReceiveMessageVariant(QVariant info)
-{
-    //LOG_FUNCTION();
-
-    //mMutex4BootEntities.lock();
-    QtMessageInfo message = info.value<QtMessageInfo>();
-    if (message.type == TextNormal || message.type == TextEvent) {
-        QBaseListWidgetItem* item = new QInfoListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextWarn) {
-        QBaseListWidgetItem* item = new QWarnListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextError) {
-        QBaseListWidgetItem* item = new QErrorListWidgetItem(CoverWithTimePrefix(message.content));
-        item->AppentToWidget(mListEvtLog);
-    } else if (message.type == TextFatal || message.type == TextBlock) {
-        QBaseListWidgetItem* item = new QTipListWidgetItem(message.content);
-        item->AppentToWidget(mListImportantTip);
-   
-    } else if (message.type == ModBootInfo) { //entity boot info
-        if (message.content.length() == 0 || message.param1 > Failed) {
-            //mMutex4BootEntities.unlock();
-            return;
-        }
-        
-        int localEntityIndex = -1;
-        for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-            if (mBootEntitiesInfo.at(i).entityName == message.content) {
-                localEntityIndex = i;
-                break;
-            }
-        }
-        if (localEntityIndex != -1) {
-            if (mBootEntitiesInfo[localEntityIndex].entityState != message.param1) {
-               // const auto previousState = mBootEntitiesInfo[localEntityIndex].entityState;
-                const auto currState = static_cast<EntityState>(message.param1);
-                mBootEntitiesInfo[localEntityIndex].entityState = currState;
-            }
-        } else {
-            EntityBootInfo newEntityInfo;
-            newEntityInfo.entityName = message.content;
-            newEntityInfo.entityState = static_cast<EntityState>(message.param1);
-            mBootEntitiesInfo.push_back(newEntityInfo);
-        }
-        RefreshInfoAboutEntity();
-    } else if (message.type == ModStartupInfo) {
-        mEntityBootingLabel->setText(message.content);
-    }
-    //mMutex4BootEntities.unlock();
-}
-

+ 0 - 56
Framework/spshell/Widgets/BootWidget.h

@@ -1,56 +0,0 @@
-#ifndef BOOTWIDGET_H
-#define BOOTWIDGET_H
-
-#include <QWidget>
-#include <QSplitter>
-#include <QPlainTextEdit>
-#include <QLabel>
-#include <QMetaType>
-#include <QVector>
-#include <QMutex>
-
-#include "QInfoListWidget.h"
-#include "QtMessageInfo.h"
-#include "QRvcItemModel.hpp"
-
-
-class BootWidget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    BootWidget(QString systemInfo, int totalEntityCount, QWidget *parent = nullptr);
-    ~BootWidget();
-
-    void paintEvent(QPaintEvent *event);
-
-public slots:
-    void ReceiveMessage(const QtMessageInfo* message);
-    void ReceiveMessageVariant(QVariant info);
-private:
-    void Init();
-    void SetFullMode();
-
-    void Demo_FulfillLog();
-    void Demo_FulfillFatalMsg();
-    void RefreshInfoAboutEntity();
-
-private:
-    QSplitter *mSplitter;
-    QLeftInfoListWidget *mListEvtLog;
-    QRightInfoListWidget *mListImportantTip;
-
-    QLabel* mLogoLabel;
-    QLabel* mEntityBootTotalLabel;
-    QLabel* mEntityBootingLabel;
-    QLabel* mEntityBootFailedLabel;
-
-    QPlainTextEdit* mTextEidtFatalMsg;
-    QString mSystemInfo;
-
-    QVector< EntityBootInfo> mBootEntitiesInfo;
-    int mEntityTotalCount;
-    int mEntityBootedCount;
-    QMutex mMutex4BootEntities;
-};
-#endif // BOOTWIDGET_H

+ 0 - 20
Framework/spshell/Widgets/BootWidget.ui

@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>BootWidget</class>
- <widget class="QWidget" name="BootWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>800</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>BootWidget</string>
-  </property>
-  <layout class="QHBoxLayout" name="horizontalLayout_2"/>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 34
Framework/spshell/Widgets/CustomImportInterface.h

@@ -1,34 +0,0 @@
-#ifndef CUSTOMIMPORTINTERFACE_H
-#define CUSTOMIMPORTINTERFACE_H
-
-#include <QObject>
-#include <QWidget>
-#include <QString>
-#include <QVariantList>
-#include <QVariant>
-
-enum InterfaceType
-{
-    WidgetType
-};
-
-class CustomImportInterface
-{
-public:
-    virtual ~CustomImportInterface() = default;
-    virtual QString getVersion() = 0;
-    virtual InterfaceType getType() = 0;
-    virtual QString getDisplayText() = 0;
-    virtual QWidget* getComponent(QWidget *parent, const QStringList& param) = 0;
-    virtual QVariantList getMoreDetail() = 0;
-};
-
-
-QT_BEGIN_NAMESPACE
-
-#define CustomInterface_iid "org.cmbchina.rvcterminal.CustomImportInterface/1.0"
-
-Q_DECLARE_INTERFACE(CustomImportInterface, CustomInterface_iid)
-QT_END_NAMESPACE
-
-#endif // CUSTOMIMPORTINTERFACE_H

+ 0 - 119
Framework/spshell/Widgets/OperaThread.hpp

@@ -1,119 +0,0 @@
-#ifndef RVC_SPSHELL_OPERATION_THREAD_H__
-#define RVC_SPSHELL_OPERATION_THREAD_H__
-
-#include <QThread>
-#include <QString>
-#include <QDebug>
-
-#include <string>
-#ifdef WITH_QT
-#include "SpShellConsole.h"
-#endif //WITH_QT
-
-#include "QRvcItemModel.hpp"
-
-static inline std::string Q2Str(const QString& str)
-{
-    std::string ss = str.toStdString();
-    return ss;
-    //QByteArray ba = mE->entityName.toLatin1();
-    //const char *ent = ba.data();
-}
-
-static inline QString Str2Q(const std::string& str)
-{
-    QString qs = QString::fromStdString(str);
-    return qs;
-}
-
-struct Threadee
-{
-    QString entityName;
-    QString cmdLine;
-    DealType dealType;
-};
- 
-class OperatThread : public QThread
-{
-    Q_OBJECT
-
-signals:
-    void OperateResult(int opt_type, int result, const QString& message);    
-
-public:
-    OperatThread(Threadee* ee, QObject* parent)
-    :mE(ee),QThread(parent)
-    {
-
-    }
-    ~OperatThread()
-    {
-        if(mE) {
-            delete mE;
-            mE = nullptr;
-        }
-    }
-
-    void run()
-    {
-        doSomething();
-    }
-    bool doSomething()
-    {
-        qDebug() << "OperatTheard doing" << endl;
-
-        std::string result;
-#ifdef WITH_QT
-        if(mE != nullptr) {
-            std::string str = mE->entityName.toStdString();
-            QByteArray ba = mE->entityName.toLatin1();
-            const char *ent = ba.data();
-            //const char* ent = str.c_str();
-            switch (mE->dealType)
-            {
-            case Deal_Start:
-                {
-                    if (!mE->cmdLine.isNull() && !mE->cmdLine.isEmpty()) {
-                        QByteArray line = mE->cmdLine.toLatin1();
-                        const char* params = line.data();
-                        result = mConsole.StartEntity(ent, params);
-                    } else {
-                        result = mConsole.StartEntity(ent);
-                    }
-                }
-                break;
-            case Deal_Close:
-                result = mConsole.StopEntity(ent);
-                break;
-            case Deal_Pause:
-                result = mConsole.PauseEntity(ent);
-                break;
-            case Deal_Continue:
-                result = mConsole.ContinueEntity(ent);
-                break;
-            case Deal_Kill:
-                result = mConsole.TerminateEntity(ent);
-                break;
-            case Deal_Test:
-                result = mConsole.TestEntity(ent);
-                break;
-            default:
-                result = "none";
-                break;
-            }
-        }
-#endif //WITH_QT
-        const bool flag = (result.find("succeed") != std::string::npos);
-        emit OperateResult(1, flag ? 0 : -1, mE->entityName);
-        return flag;
-    }
-    
-private:
-    Threadee* mE;
-#ifdef WITH_QT
-    CSpShellConsole mConsole;
-#endif //WITH_QT
-};
-
-
-#endif //RVC_SPSHELL_OPERATION_THREAD_H__

+ 0 - 62
Framework/spshell/Widgets/QConsoleListWidget.cpp

@@ -1,62 +0,0 @@
-#include "QConsoleListWidget.h"
-#include <QScroller>
-#include <QCryptographicHash>
-#include <QDebug>
-
-void QConsoleListWidget::PostInit()
-{
-    qDebug("QConsoleListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background:#000000;outline:0px;}" //去除选中时的虚线
-                        //"QListWidget::item{color:#00FF00;}"
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #000000;}");
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-
-    /* 设置鼠标左键拖动 */
-    //QScroller::grabGesture(this, QScroller::LeftMouseButtonGesture);
-}
-
-void QConsoleListWidget::RemoveDuplicateItem()
-{
-    if(this->count() > reservedItemCount) {
-        int idx = this->count() - 1;
-        while (idx >= reservedItemCount)
-        {
-            auto item = this->takeItem(idx);
-            this->removeItemWidget(item);
-            idx--;
-        }
-    }
-    QListWidgetItem* newItem = currentItem(); //this->item(0);
-    QString content = newItem->text();
-    QString subContent = content.mid(QString("[hh:mm:ss] ").length()); //timestamp prefix length
-    QByteArray hashData = QCryptographicHash::hash(subContent.toLocal8Bit(), QCryptographicHash::Md5);
-    content = hashData.toHex();
-    newItem->setWhatsThis(content);
-    int selectIdx = -1;
-    for (int idx = 0; idx < this->count(); ++idx) {
-        QListWidgetItem* oldItem = this->item(idx);
-        if (oldItem != newItem) {
-            QVariant value = oldItem->data(Qt::WhatsThisRole);
-            if (!value.isNull() && value.isValid()) {
-                if (content == value.toString()) {
-                    selectIdx = idx;
-                    break;
-                }
-            } 
-        }
-    }
-    if (selectIdx != -1) {
-        auto item = this->takeItem(selectIdx);
-        this->removeItemWidget(item);
-    }
-}
-
-void QFatalListWidget::PostInit()
-{
-    qDebug("QFatalListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background:#F5F5F5;outline:0px;}" //去除选中时的虚线
-                        //"QListWidget::item{color:#00FF00;}"
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #F5F5F5;}");
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-
-}

+ 0 - 38
Framework/spshell/Widgets/QConsoleListWidget.h

@@ -1,38 +0,0 @@
-#ifndef QCONSOLELISTWIDGET_H
-#define QCONSOLELISTWIDGET_H
-
-#include "QInfoListWidget.h"
-
-class QConsoleListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QConsoleListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent),reservedItemCount(100)
-        {
-            PostInit();
-        }
-    virtual ~QConsoleListWidget() {}
-
-    virtual void PostInit() override;
-
-    void RemoveDuplicateItem() override;
-
-protected:
-    unsigned int reservedItemCount;
-};
-
-class QFatalListWidget : public QConsoleListWidget
-{
-    Q_OBJECT
-public:
-    QFatalListWidget(QWidget* parent = nullptr)
-        :QConsoleListWidget(parent)
-        {
-            PostInit();
-        }
-    virtual ~QFatalListWidget() {}
-    virtual void PostInit() override;
-};
-
-#endif // QCONSOLELISTWIDGET_H

+ 0 - 202
Framework/spshell/Widgets/QInfoListWidget.cpp

@@ -1,202 +0,0 @@
-#include "QInfoListWidget.h"
-#include "BootGlobal.h"
-#include <QScrollBar>
-
-
-//static const QColor g_sLeftBackgroundColor = QColor(101, 105, 108, 255); //#65696C
-//static const QColor g_sRightBackgroundColor = QColor(161, 163, 165, 255); //#A1A3A5
-
-namespace  {
-
-int ColorDodge(int primaryColor, int secondaryColors)
-{
-    if(secondaryColors >= 255) {
-        return 255;
-    }
-    //基色 +(基色 * 混合色)/(255 - 混合色)= 结果色
-    int result = (primaryColor + (uint)(primaryColor * secondaryColors) / (255 - secondaryColors));
-    if(result > 255) {
-        result = 255;
-    } else if(result < 0) {
-        result = 0;
-    }
-    return result;
-}
-
-QColor GetSortedDisplayColor(const QListWidget* parent)
-{
-    const int stepMax = 100;
-    const int currItemsCount = parent->count();
-
-    const int j = (stepMax - currItemsCount % stepMax);
-    const int gradientR = ColorDodge(205, j);
-    const int gradientG = ColorDodge(38, j);
-    const int gradientB = ColorDodge(38, j);
-    return QColor(gradientR, gradientG, gradientB, 255);
-}
-
-}
-
-
-QBaseListWidgetItem::QBaseListWidgetItem(const QString &text, InfoType it, LevelType lt)
-    :QListWidgetItem(text),infoType(it),levelType(lt)
-{
-    setFlags(Qt::ItemIsEnabled | Qt::NoItemFlags);
-
-}
-
-void QBaseListWidgetItem::AppentToWidget(QInfoListWidget* container, bool insertFront)
-{
-    if(insertFront)
-    {
-        container->insertItem(0, this);
-        container->setCurrentRow(0);
-    } else {
-        container->addItem(this);
-        container->setCurrentRow(container->count()-1);
-    }
-    setForeground(FrontColor());
-    setBackground(BackgroundColor());
-    QFont font;
-    font.setFamily(QStringLiteral("微软雅黑"));
-    font.setPointSize(10);
-    this->setFont(font);
-    if(insertFront) {
-        container->RemoveDuplicateItem();
-    }
-}
-
-QColor QBaseListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(Qt::GlobalColor(colorValue));
-}
-
-QColor QBaseListWidgetItem::BackgroundColor() const
-{
-    return GetLeftBackgoundColor();
-}
-
-QInfoListWidgetItem::QInfoListWidgetItem(const QString &text, LevelType lt)
-    :QBaseListWidgetItem(text, Info, lt)
-{
-
-}
-
-QColor QWarnListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::white;
-    return QColor(colorValue);
-}
-
-QColor QLightWarnListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::yellow;
-    return QColor(colorValue);
-}
-
-QColor QLightWarnListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-QColor QErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::darkRed;
-    return QColor(colorValue);
-}
-
-QColor QLightErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::red;
-    return QColor(colorValue);
-}
-
-QColor QLightErrorListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-QColor QTipErrorListWidgetItem::FrontColor() const
-{
-    auto colorValue = Qt::red;
-    return QColor(colorValue);
-}
-
-QColor QTipErrorListWidgetItem::BackgroundColor() const
-{
-    return QColor(245, 245, 245, 255);
-}
-
-
-QColor QTipListWidgetItem::FrontColor() const
-{
-    QListWidget* parent = listWidget();
-    if(parent != nullptr)
-        return GetSortedDisplayColor(parent);
-    auto colorValue = Qt::darkRed;
-    return QColor(colorValue);
-}
-
-QColor QTipListWidgetItem::BackgroundColor() const
-{
-    return GetRightBackgoundColor();
-}
-
-QColor QConsoleListWidgetItem::FrontColor() const
-{
-    return GetConsoleFrontColor();
-}
-
-QColor QConsoleListWidgetItem::BackgroundColor() const
-{
-    auto colorValue = Qt::black;
-    return QColor(colorValue);
-}
-
-
-QInfoListWidget::QInfoListWidget(QWidget* parent)
-    :QListWidget(parent)
-{
-    Init();
-}
-
-void QInfoListWidget::Init()
-{
-    this->setViewMode(QListView::ListMode);
-    this->setFlow(QListView::TopToBottom);
-    this->setSortingEnabled(false);
-    // Hide the scrollbar
-    this->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    this->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
-    /*disable hightlight when cursor hover*/
-    this->setStyleSheet("QListWidget::item:hover{background: transparent;}");
-    /*hide border*/
-    this->setFrameShape(QListWidget::NoFrame);
-}
-
-void QInfoListWidget::WheelEvent(QWheelEvent* event)
-{
-    int degress = event->angleDelta().ry() * 0.5;
-    if(event->orientation() == Qt::Vertical)
-        verticalScrollBar()->setValue(verticalScrollBar()->value() - degress);
-    event->accept();
-}
-
-void QLeftInfoListWidget::PostInit()
-{
-    qDebug("QLeftInfoListWidget::PostInit()");
-    this->setStyleSheet("QListWidget{background: #65696C;outline:0px;}"
-                        "QListWidget::item{padding-top:1px; padding-bottom:1px;}"
-                        "QListWidget::item:hover{background: #65696C;}");
-}
-
-void QRightInfoListWidget::PostInit()
-{
-    qDebug("QRightInfoListWidget::PostInit()");
-    //SetWidgetBackgroundColor(this, GetRightBackgoundColor());
-    this->setStyleSheet("QListWidget{background: #A1A3A5;outline:0px;}" //去除选中时的虚线
-                        "QListWidget::item:selected,QListWidget::item:hover{background: #A1A3A5;}");
-}

+ 0 - 177
Framework/spshell/Widgets/QInfoListWidget.h

@@ -1,177 +0,0 @@
-#ifndef QINFOLISTWIDGET_H
-#define QINFOLISTWIDGET_H
-
-#include <QWidget>
-#include <QListWidget>
-#include <QWheelEvent>
-
-
-enum InfoType {
-    Info,
-    Event,
-    Warning,
-    Error,
-    Succeed
-};
-
-enum LevelType {
-    None,
-    Lower,
-    Normal,
-    Higher
-};
-
-
-class QInfoListWidget;
-
-
-class QBaseListWidgetItem : public QListWidgetItem
-{
-public:
-    QBaseListWidgetItem(const QString &text, InfoType it, LevelType lt);
-    virtual ~QBaseListWidgetItem() {}
-
-    void AppentToWidget(QInfoListWidget* container, bool insertFront = true);
-
-protected:
-    virtual QColor FrontColor() const;
-    virtual QColor BackgroundColor() const;
-    InfoType infoType;
-    LevelType levelType;
-};
-
-class QInfoListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QInfoListWidgetItem(const QString &text, LevelType lt = None);
-    virtual ~QInfoListWidgetItem() {}
-};
-
-class QWarnListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QWarnListWidgetItem(const QString& text, LevelType lt = None) 
-        :QBaseListWidgetItem(text, InfoType::Warning, lt) {}
-    virtual ~QWarnListWidgetItem() {}
-private:
-    QColor FrontColor() const;
-};
-
-class QLightWarnListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QLightWarnListWidgetItem(const QString& text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Warning, lt) {}
-    virtual ~QLightWarnListWidgetItem() {}
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-};
-
-class QLightErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QLightErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QLightErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QTipErrorListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QTipErrorListWidgetItem(const QString &text, LevelType lt = None)
-        :QBaseListWidgetItem(text, InfoType::Error, lt){}
-    virtual ~QTipErrorListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QTipListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QTipListWidgetItem(const QString &text)
-        :QBaseListWidgetItem(text, InfoType::Error, Higher){
-        setTextAlignment(Qt::AlignCenter);
-    }
-    virtual ~QTipListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-class QConsoleListWidgetItem : public QBaseListWidgetItem
-{
-public:
-    QConsoleListWidgetItem(const QString &text)
-        :QBaseListWidgetItem(text, InfoType::Info, None)
-    {
-
-    }
-    virtual ~QConsoleListWidgetItem() {}
-
-private:
-    QColor FrontColor() const;
-    QColor BackgroundColor() const;
-};
-
-
-class QInfoListWidget : public QListWidget
-{
-    Q_OBJECT
-public:
-    QInfoListWidget(QWidget* parent = nullptr);
-    virtual ~QInfoListWidget() {}
-
-    virtual void PostInit() { qDebug("parent::PostInit"); }
-
-    virtual void RemoveDuplicateItem() 
-    {
-
-    }
-
-protected:
-    void Init();
-    void WheelEvent(QWheelEvent* event);
-};
-
-class QLeftInfoListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QLeftInfoListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent){PostInit();}
-    virtual ~QLeftInfoListWidget() {}
-
-    virtual void PostInit() override;
-};
-
-class QRightInfoListWidget : public QInfoListWidget
-{
-    Q_OBJECT
-public:
-    QRightInfoListWidget(QWidget* parent = nullptr)
-        :QInfoListWidget(parent){PostInit();}
-    virtual ~QRightInfoListWidget() {}
-
-    virtual void PostInit() override;
-};
-
-#endif // QINFOLISTWIDGET_H

+ 0 - 206
Framework/spshell/Widgets/QRvcItemModel.hpp

@@ -1,206 +0,0 @@
-#ifndef QRVCITEMMODEL_HPP
-#define QRVCITEMMODEL_HPP
-
-#include <QVariant>
-#include <QStandardItemModel>
-
-enum EntityState
-{
-    NoStart = 0,
-    Starting,
-    Idle,
-    Busy,
-    Pause,
-    UnLoading,
-    Lost,
-    Close,
-    Killed,
-    Passed,
-    Failed,
-    All
-};
-
-enum EntityStartType
-{
-    Auto,
-    Manual
-};
-
-
-enum DealType {
-    Deal_Start,
-    Deal_Close,
-    Deal_Pause,
-    Deal_Continue,
-    Deal_Kill,
-    Deal_Test
-};
-
-static inline QString MappingSatus2String(const EntityState& state)
-{
-    static QString mappingTable[] = {"NoStart", "Starting", "Idle", "Busy", "Pause", "UnLoading", "Lost", "Close", "Killed", "Passed", "Failed", "All"};
-    return mappingTable[(int)state];
-}
-
-static inline EntityState MappingString2Status(const QString& state)
-{
-    static QString mappingTable[] = {"NoStart", "Starting", "Idle", "Busy", "Pause", "UnLoading", "Lost", "Close", "Killed", "Passed", "Failed", "All"};
-    if(state.isNull() || state.isEmpty())
-        return NoStart;
-    for(int i=0; i<sizeof(mappingTable)/sizeof(mappingTable[0]); ++i)
-    {
-        if(mappingTable[i].compare(state) == 0)
-            return EntityState(i);
-    }
-    return NoStart;
-}
-
-static inline QString MappingStartType2String(const EntityStartType& type)
-{
-    static QString mappingTable[] = {"auto", "manual"};
-    return mappingTable[(int)type];
-}
-
-static inline EntityStartType MappingString2StartType(const QString& type)
-{
-    static QString mappingTable[] = {"auto", "manual"};
-    if(type.isNull() || type.isEmpty())
-        return Manual;
-    for(int i=0; i<sizeof(mappingTable)/sizeof(mappingTable[0]); ++i)
-    {
-        if(mappingTable[i].compare(type) == 0)
-            return EntityStartType(i);
-    }
-    return Manual;
-}
-
-static inline QColor MappingStatus2Color(const EntityState& state)
-{
-    switch (state) {
-    case Lost:
-        return QColor (240,128,128);
-    break;
-    case NoStart:
-        return QColor (245,245,245);
-    break;
-    case Starting:
-    case UnLoading:
-        return QColor (250,250,210);
-    break;
-    case Busy:
-        return QColor (255,255,0);
-    break;
-    case Pause:
-        return QColor (255,218,185);
-    break;
-    case Close:
-    case Killed:
-        return QColor (230,230,250);
-        break;
-    case Passed:
-        return QColor (124,252,0);
-        break;
-    case Failed:
-        return QColor (240,128,128);
-        break;
-    case Idle:
-    case All:
-    default:
-        return QColor (255,250,250);
-    break;
-    }
-}
-
-static inline QVariant MappingStatus2Color(const QString& statusString)
-{
-    //QColor (244,164,96);//
-    if(statusString.compare("Lost") == 0)
-        return QColor (240,128,128); //QColor(Qt::red);
-    else if(statusString.compare("NoStart") == 0)
-        return QColor (245,245,245);//QColor(Qt::lightGray);
-    else if(statusString.compare("Pending") == 0 
-           || statusString.compare("Starting") == 0 
-           || statusString.compare("UnLoading") == 0)
-        return QColor (250,250,210);//QColor(Qt::yellow);
-    else if(statusString.compare("Close") == 0 || statusString.compare("Killed") == 0)
-        return QColor (230,230,250);//QColor(Qt::darkGray);
-    else if(statusString.compare("Pause") == 0)
-        return QColor (255,218,185);//QColor(Qt::blue);
-    else
-        return QVariant();
-}
-
-struct EntityBootInfo
-{
-    QString entityName;
-    EntityState entityState;
-};
-
-struct EntityInfo
-{
-    QString entityName;
-    EntityStartType startType;
-    EntityState state;
-    int pid;
-    QString version;
-
-    bool IsValid() const {
-        return (!entityName.isEmpty());
-    }
-
-    EntityInfo(const EntityInfo& rhs)
-        :entityName(rhs.entityName)
-        ,startType(rhs.startType)
-        ,state(rhs.state)
-        ,pid(rhs.pid)
-        ,version(rhs.version) {}
-
-    EntityInfo(const QString& entityName, EntityStartType startType, EntityState entityState, int pid, const QString& ver)
-        :entityName(entityName)
-        ,startType(startType)
-        ,state(entityState)
-        ,pid(pid)
-        ,version(ver) {}
-};
-
-
-struct EntityRunInfo : public EntityInfo
-{
-    QString startupTimeStr;
-    int fds;
-    EntityRunInfo(const EntityInfo& rhs):EntityInfo(rhs),startupTimeStr("NA"),fds(-1)
-    {}
-
-};
-
-
-class RvcItemModel : public QStandardItemModel
-{
-public:
-    RvcItemModel() {}
-
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
-    {
-        if (!index.isValid())
-            return QVariant();
-
-        if (role == Qt::TextAlignmentRole)
-        {
-            return int(Qt::AlignLeft | Qt::AlignVCenter);
-        }
-        else if (role == Qt::DisplayRole)
-        {
-              return QStandardItemModel::data(index, role);
-        }
-        else if(role == Qt::BackgroundColorRole)
-        {
-            const QString str=this->QStandardItemModel::data(this->index(index.row(),2)).toString();
-            return MappingStatus2Color(str);
-
-        }
-
-        return QVariant();
-    }
-};
-
-#endif // QRVCITEMMODEL_HPP

+ 0 - 64
Framework/spshell/Widgets/QtMessageInfo.h

@@ -1,64 +0,0 @@
-#ifndef RVC_QT_MESSAGE_INFO_H__
-#define RVC_QT_MESSAGE_INFO_H__
-
-#include <QMetaType>
-#include <QString>
-#include <QRvcItemModel.hpp>
-
-struct TerminalInfo
-{
-    QString serialNumber;
-    QString site;
-    QString version;
-};
-
-struct BootInfo
-{
-    uint8_t bootedNum;
-    uint8_t totalBootNum;
-};
-
-enum MessageType
-{
-    TextNormal,
-    TextEvent,
-    TextWarn,
-    TextError,
-    TextFatal,
-    TextBlock,
-    TextNotifyInfo,
-    TextNotifyWarn,
-    TextNotifyError,
-
-    ModStartupInfo,
-    ModBootInfo,
-    ModBootError,
-    DisplayShow,
-    DisplayHide,
-    DisplayBlueScreen,
-    StageChangeInfo,
-    MsgTypeMax
-};
-
-struct QtMessageInfo
-{
-    MessageType type;
-    QString content;
-    int param1;
-    int param2;
-};
-
-struct QEntityActiveInfo
-{
-    QString entityName;
-    EntityState entityState;
-    int entityDevId;
-    int entityPID;
-    QString entityVerStr;
-};
-
-Q_DECLARE_METATYPE(QtMessageInfo)
-Q_DECLARE_METATYPE(QEntityActiveInfo)
-
-#endif // !RVC_QT_MESSAGE_INFO_H__
-

+ 0 - 31
Framework/spshell/Widgets/RvcSettings.h

@@ -1,31 +0,0 @@
-#ifndef RVC_SPSHELL_QT_SETTINGS
-#define RVC_SPSHELL_QT_SETTINGS
-
-#include <QSettings>
-
-#pragma once
-
-class RvcSettings : public QSettings
-{
-public:
-
-    RvcSettings(const QString& fileName, Format format, QObject* parent = nullptr)
-        :QSettings(fileName, format, parent)
-    {
-
-    }
-
-    void SetConfigData(QString strNodeName, QString strKeyName, QVariant varValue)
-    {
-        setValue(QString("/%1/%2").arg(strNodeName).arg(strKeyName), varValue);
-    }
-
-    QVariant GetConfigData(QString strNodeName, QString strKeyName)
-    {
-        QVariant qvar = -1;
-        qvar = value(QString("/%1/%2").arg(strNodeName).arg(strKeyName));
-        return qvar;
-    }
-};
-
-#endif //RVC_SPSHELL_QT_SETTINGS

+ 0 - 34
Framework/spshell/Widgets/cpuwidget.cpp

@@ -1,34 +0,0 @@
-#include "cpuwidget.h"
-#include "sysinfo.h"
-
-using namespace QtCharts;
-
-CpuWidget::CpuWidget(QWidget* parent) :
-#ifdef __arm__
-    SysInfoWidget(parent, 3000, 3000),
-#else
-    SysInfoWidget(parent, 1000, 1000),
-#endif
-
-    mSeries(new QPieSeries(this))
-{
-    mSeries->setHoleSize(0.35);
-    mSeries->append("CPU Load", 0.0);
-    mSeries->append("CPU Free", 0.0);
-    mSeries->setLabelsVisible();
-
-    QChart* chart = chartView().chart();
-    chart->addSeries(mSeries);
-    chart->setTitle("CPU average load");
-}
-
-void CpuWidget::updateSeries()
-{
-    double cpuLoadAverage = SysInfo::instance().cpuLoadAverage();
-    QChart* chart = chartView().chart();
-    QString str = QString("CPU average load %1%").arg(QString::number(cpuLoadAverage,'f',2));
-    chart->setTitle(str);
-    mSeries->clear();
-    mSeries->append("Load", cpuLoadAverage);
-    mSeries->append("Free", 100.0 - cpuLoadAverage);
-}

+ 0 - 21
Framework/spshell/Widgets/cpuwidget.h

@@ -1,21 +0,0 @@
-#ifndef CPUWIDGET_H
-#define CPUWIDGET_H
-
-#include <QtCharts/QPieSeries>
-
-#include "sysinfowidget.h"
-
-class CpuWidget : public SysInfoWidget
-{
-    Q_OBJECT
-public:
-    explicit CpuWidget(QWidget* parent = 0);
-
-protected slots:
-    void updateSeries() override;
-
-private:
-    QtCharts::QPieSeries* mSeries;
-};
-
-#endif // CPUWIDGET_H

+ 0 - 24
Framework/spshell/Widgets/dialogappversion.cpp

@@ -1,24 +0,0 @@
-#include "dialogappversion.h"
-#include "textedit.h"
-#include <QHBoxLayout>
-#include <QLibraryInfo>
-
-DialogAppVersion::DialogAppVersion(QString contentPath, QString titleText, QWidget *parent)
-    :QDialog(parent)
-{
-    textViewer = new TextEdit;
-    textViewer->setContents(contentPath);
-
-    QHBoxLayout *contentLayout = new QHBoxLayout;
-    contentLayout->setMargin(0);
-    contentLayout->setContentsMargins(0,0,0,0);
-    contentLayout->addWidget(textViewer);
-    setLayout(contentLayout);
-
-    setWindowTitle(titleText);
-    resize(1024, 640);
-}
-
-DialogAppVersion::~DialogAppVersion() {}
-
-

+ 0 - 21
Framework/spshell/Widgets/dialogappversion.h

@@ -1,21 +0,0 @@
-#ifndef DIALOGAPPVERSION_H
-#define DIALOGAPPVERSION_H
-
-
-#include <QDialog>
-
-class TextEdit;
-
-class DialogAppVersion : public QDialog
-{
-Q_OBJECT
-
-public:
-    explicit DialogAppVersion(QString contentPath, QString titleText="", QWidget *parent = 0);
-    ~DialogAppVersion();
-
-private:
-    TextEdit *textViewer;
-};
-
-#endif // DIALOGAPPVERSION_H

+ 0 - 215
Framework/spshell/Widgets/dialogconfig.cpp

@@ -1,215 +0,0 @@
-#include "dialogconfig.h"
-#include <QFile>
-#include <QDirModel>
-#include <QHBoxLayout>
-#include <QSplitter>
-#include <QDebug>
-#include <QStandardItemModel>
-#include <QPluginLoader>
-#include <QCoreApplication>
-#include <rootform.h>
-#include <subnormalconfig.h>
-
-#include "CustomImportInterface.h"
-
-#define TreeNodeDataId (Qt::UserRole + 2)
-enum TreeNodeMask
-{
-  NormalConfig,
-  RootIniConfig,
-  CustomConfig
-};
-
-DialogConfig::DialogConfig(DialogInParam* inParam, QWidget *parent)
-    :QDialog(parent),mCustomParentNode(nullptr)
-{
-
-    Qt::WindowFlags windowFlag  = Qt::Dialog;
-    windowFlag  |= Qt::WindowMinimizeButtonHint;
-    windowFlag  |= Qt::WindowMaximizeButtonHint;
-    windowFlag  |= Qt::WindowCloseButtonHint;
-    setWindowFlags(windowFlag);
-
-    QSplitter* splitterMain = new QSplitter(Qt::Horizontal, this);
-    splitterMain->setOpaqueResize(true);
-
-    mTreeView = new QTreeView(splitterMain);
-    mTreeView->setHeaderHidden(true);
-    QStandardItemModel* model = new QStandardItemModel(mTreeView);
-    mTreeView->setModel(model);
-
-    QStandardItem* itemNormal = new QStandardItem("通用设置");
-    itemNormal->setData(NormalConfig, TreeNodeDataId);
-    model->appendRow(itemNormal);
-    QStandardItem* item1 = new QStandardItem("终端设置");
-    model->appendRow(item1);
-    QStandardItem* itemRoot = new QStandardItem("Root.ini设置");
-    itemRoot->setData(RootIniConfig, TreeNodeDataId);
-    item1->appendRow(itemRoot);
-    connect(mTreeView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &DialogConfig::mainTreeSelectionChanged);
-    //connect(mTreeView, SIGNAL(clicked(const QModelIndex)), this, SLOT(mainTreeViewDoubleClick(const QModelIndex)));
-
-    ////////////////////////////////////////////////////
-    QWidget *mainWidget = new QWidget(splitterMain);
-    QVBoxLayout* mainLayout = new QVBoxLayout(mainWidget);
-    //mainLayout->setSpacing(6);
-    //mainLayout->setContentsMargins(11, 11, 11, 11);
-
-    mainWidget->setLayout(mainLayout);
-    splitterMain->addWidget(mainWidget);
-
-    mStackWidget = new QStackedWidget(mainWidget);
-    mainLayout->addWidget(mStackWidget);
-    SubNormalConfig* subNormalWidget = new SubNormalConfig(mainWidget);
-    mStackWidget->addWidget(subNormalWidget);
-    RootForm* rootWidget = new RootForm(inParam->rootIniPath, mStackWidget);
-    mStackWidget->addWidget(rootWidget);
-
-    LoadPlguins();
-
-    splitterMain->setStretchFactor(1, 1);
-    splitterMain->setStretchFactor(2, 1);
-
-    QHBoxLayout *contentLayout = new QHBoxLayout;
-    contentLayout->setMargin(0);
-    contentLayout->setContentsMargins(0,0,0,0);
-    contentLayout->addWidget(splitterMain);
-    setLayout(contentLayout);
-
-    resize(1024, 640);
-    setWindowTitle(tr("选项"));
-}
-
-bool DialogConfig::LoadPlguins()
-{
-    int pluginCount = 0;
-#ifdef WITH_QT
-    QDir pluginsDir(QCoreApplication::applicationDirPath());
-    pluginsDir.cd("plugins");
-    qDebug() << "plugin dir: " << pluginsDir.absolutePath() << endl;
-#ifdef Q_WS_WIN32
-        const QStringList entries = pluginsDir.entryList(QStringList() << "*.dll", QDir::Files);
-#else
-        const QStringList entries = pluginsDir.entryList(QStringList() << "*.so", QDir::Files);
-#endif
-
-    for (const QString &fileName : entries) {
-        QPluginLoader pluginLoader(pluginsDir.absoluteFilePath(fileName));
-        qDebug() << "plugin file: " << pluginsDir.absoluteFilePath(fileName) << endl;
-        QObject *plugin = pluginLoader.instance();
-        if (plugin) {
-            qDebug() << "class name: " << plugin->metaObject()->className() << endl;
-            const QMetaObject* mode = plugin->metaObject()->superClass();
-            while (mode != nullptr) {
-                qDebug() << "super class name: " << mode->className();
-                mode = mode->superClass();
-            }
-
-            CustomImportInterface* pluginItem = qobject_cast<CustomImportInterface *>(plugin);
-            if (pluginItem) {
-                QStringList empty;
-                empty << "HelloHia";
-                QWidget* customWidget = pluginItem->getComponent(this, empty);
-                if(customWidget != nullptr) {
-                    mStackWidget->addWidget(customWidget);
-                    if(mCustomParentNode == nullptr) {
-                        mCustomParentNode = new QStandardItem("自定义");
-                        QStandardItemModel* treeModel = reinterpret_cast<QStandardItemModel*>(mTreeView->model());
-                        treeModel->appendRow(mCustomParentNode);
-                    }
-                    QString pluginTitle = pluginItem->getDisplayText();
-                    QStandardItem* menuItem = new QStandardItem(pluginTitle);
-                    menuItem->setData(CustomConfig + pluginCount, TreeNodeDataId);
-                    mCustomParentNode->appendRow(menuItem);
-                    pluginCount++;
-                } else {
-                    qDebug() << "getComponent failed:" << endl;
-                }
-            } else {
-                qDebug() << "dynamic_cast qobject cast failed:" << endl;
-            }
-        } else {
-            qDebug() << "plug instance failed: " << pluginLoader.errorString() << endl;
-        }
-        pluginLoader.unload();
-    }
-
-#else
-
-    QString fileName = "D:/Projects/Qt/build-MediaDevDetect-Desktop_Qt_5_14_2_MSVC2017_32bit-Debug/debug/MediaDevDetect.dll";
-    QPluginLoader pluginLoader(fileName);
-    QObject *plugin = pluginLoader.instance();
-    if (plugin) {
-        CustomImportInterface* pluginItem = qobject_cast<CustomImportInterface *>(plugin);
-        if (pluginItem) {
-            QStringList empty;
-            empty << "HelloHia";
-            QWidget* customWidget = pluginItem->getComponent(this, empty);
-            if(customWidget != nullptr) {
-                QString pluginTitle = pluginItem->getDisplayText();
-                mStackWidget->addWidget(customWidget);
-                if(mCustomParentNode == nullptr) {
-                    mCustomParentNode = new QStandardItem("Custom");
-                    QStandardItemModel* temp = reinterpret_cast<QStandardItemModel*>(mTreeView->model());
-                    temp->appendRow(mCustomParentNode);
-                }
-                QStandardItem* menuItem = new QStandardItem(pluginTitle);
-                menuItem->setData(CustomConfig + pluginCount, TreeNodeDataId);
-                mCustomParentNode->appendRow(menuItem);
-                pluginCount++;
-            }
-        }
-    }
-    pluginLoader.unload();
-#endif
-
-    return false;
-}
-
-void DialogConfig::mainTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
-{
-    qDebug() << "Enter DialogConfig::mainTreeSelectionChanged" << endl;
-    QItemSelectionModel *selections = mTreeView->selectionModel();
-    QModelIndexList indexes = selections->selectedIndexes();
-    foreach(QModelIndex index, indexes)
-    {
-        //从索引index获取item指针,mModel是tree的数据Model,这里是QStandardItemModel*类型
-        QStandardItem* item = ((QStandardItemModel*)mTreeView->model())->itemFromIndex(index);
-        if (item && index.data(TreeNodeDataId).isValid())
-        {
-            qDebug() << "Enter " << item->text() << " " << index.row() << " " << index.column() << " " << index.data(TreeNodeDataId) << endl;
-            TreeNodeMask menuID = static_cast<TreeNodeMask>(index.data(TreeNodeDataId).toInt());
-            bool done = true;
-            switch(menuID) {
-            case RootIniConfig:
-                mStackWidget->setCurrentIndex(RootIniConfig);
-                done = true;
-                break;
-            case NormalConfig:
-                mStackWidget->setCurrentIndex(NormalConfig);
-
-                break;
-            default:
-                mStackWidget->setCurrentIndex(menuID);
-                done = false;
-                break;
-
-
-            }
-            if(done) {
-                break;
-            }
-        }
-    }
-}
-
-void DialogConfig::mainTreeViewDoubleClick(const QModelIndex index)
-{
-    QAbstractItemModel* m=(QAbstractItemModel*)index.model();
-    for(int columnIndex = 0; columnIndex < m->columnCount(); columnIndex++)
-    {
-        QModelIndex x=m->index(index.row(),columnIndex);
-        QString s= x.data().toString();
-        qDebug() << "mainTreeViewDoubleClick " << s << " " << x.internalId() << endl;
-    }
-}

+ 0 - 35
Framework/spshell/Widgets/dialogconfig.h

@@ -1,35 +0,0 @@
-#ifndef DIALOGCONFIG_H
-#define DIALOGCONFIG_H
-
-#include <QWidget>
-#include <QDialog>
-#include <QTreeView>
-#include <QStackedWidget>
-#include <QStandardItem>
-
-struct DialogInParam
-{
-    QString rootIniPath;
-};
-
-class DialogConfig : public QDialog
-{
-    Q_OBJECT
-public:
-    DialogConfig(DialogInParam* inParam, QWidget *parent);
-    ~DialogConfig() {}
-
-private slots:
-    void mainTreeSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
-    void mainTreeViewDoubleClick(const QModelIndex);
-
-private:
-    bool LoadPlguins();
-
-private:
-    QTreeView* mTreeView;
-    QStackedWidget* mStackWidget;
-    QStandardItem *mCustomParentNode;
-};
-
-#endif // DIALOGCONFIG_H

+ 0 - 111
Framework/spshell/Widgets/floatwidget/Overlay.cpp

@@ -1,111 +0,0 @@
-#include "Overlay.h"
-
-#include <QPainter>
-#include <QPen>
-#include <QDebug>
-#include <QResizeEvent>
-
-Overlay::Overlay(QWidget *parent)
-    : QWidget(parent)
-{
-    setPalette(Qt::transparent);
-    setAttribute(Qt::WA_NoSystemBackground);
-    setAttribute(Qt::WA_TransparentForMouseEvents);
-    newParent();
-
-}
-
-Overlay::~Overlay()
-{
-
-}
-
-void Overlay::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    painter.setRenderHint(QPainter::Antialiasing);
-    //X
-    painter.setPen(QPen(Qt::red));
-    painter.drawLine(width()/8, height()/8, 7*width()/8, 7*height()/8);
-    painter.drawLine(width()/8, 7*height()/8, 7*width()/8, height()/8);
-    //Test String
-    painter.setFont({"arial,helvetica", 48});
-    painter.drawText(rect(), "TEST 1234", Qt::AlignHCenter | Qt::AlignTop);
-
-    qDebug() << "Overlay::paintEvent";
-}
-
-void Overlay::resizeEvent ( QResizeEvent * event ) {
-    QWidget::resizeEvent( event );
-    qDebug() << "Overlay::resizeEvent old=" << event->oldSize() << "  new=" << event->size();
-}
-
-void Overlay::newParent()
-{
-    if ( !parent() )
-        return;
-    parent()->installEventFilter(this);
-    raise();
-}
-
-bool Overlay::eventFilter(QObject *obj, QEvent *ev)
-{
-    if (obj == parent()) {
-        if (ev->type() == QEvent::Resize)
-            resize(static_cast<QResizeEvent*>(ev)->size());
-        else if (ev->type() == QEvent::ChildAdded)
-            raise();
-    }
-    return QWidget::eventFilter(obj, ev);
-}
-
-bool Overlay::event(QEvent *ev)
-{
-    if (ev->type() == QEvent::ParentAboutToChange) {
-        if ( parent() )
-            parent()->removeEventFilter(this);
-    } else {
-        if (ev->type() == QEvent::ParentChange)
-            newParent();
-    }
-    return QWidget::event(ev);
-}
-
-/* =========================== */
-MessageOverlay::MessageOverlay(QWidget *parent, const int drawAlignFlags, const QColor &textColor)
-    : Overlay(parent)
-{
-    m_drawAlignFlags = drawAlignFlags;
-    m_textColor = textColor;
-}
-
-MessageOverlay::~MessageOverlay()
-{
-
-}
-void MessageOverlay::showMessage(const QString msg, const int forSeconds)
-{
-    m_text = msg;
-    m_visible = true;
-    if ( forSeconds > 0 )
-        QTimer::singleShot(forSeconds * 1000, this, SLOT(hideMessage()));
-}
-
-void MessageOverlay::hideMessage()
-{
-    m_visible = false;
-    update();
-}
-
-void MessageOverlay::paintEvent(QPaintEvent *event)
-{
-    QPainter painter(this);
-    if ( m_visible ) {
-        painter.setPen(m_textColor);
-        QFont f;
-        f.setPointSize(36);
-        //painter.setFont({"arial,helvetica", 18});
-        painter.setFont(f);
-        painter.drawText(rect(), m_drawAlignFlags, m_text);
-    }
-}

+ 0 - 55
Framework/spshell/Widgets/floatwidget/Overlay.h

@@ -1,55 +0,0 @@
-#ifndef OVERLAY_H
-#define OVERLAY_H
-
-#include <QWidget>
-#include <QTimer>
-
-/**
- * @brief Overlay Widget
- * Works in Android, IOS, Linux, Windows and MacOS (Catalina, not on HighSierra)
- */
-class Overlay : public QWidget
-{
-    Q_OBJECT
-public:
-    explicit Overlay(QWidget *parent = 0);
-    virtual ~Overlay();
-    
-signals:
-    
-public slots:
-
-protected:
-    void paintEvent(QPaintEvent *event) override;
-    void resizeEvent(QResizeEvent *event) override;
-
-    //! installs the event filter
-    void newParent();
-    //! catches resize and child events from parent widget
-    bool eventFilter(QObject *obj, QEvent *ev) override;
-    //! tracks parent widget changes
-    bool event(QEvent *ev) override;
-
-};
-
-class MessageOverlay : public Overlay
-{
-    Q_OBJECT
-public:
-    explicit MessageOverlay(QWidget *parent = nullptr,
-                            const int drawAlignFlags=Qt::AlignHCenter | Qt::AlignJustify,
-                            const QColor &textColor=QColor(Qt::red));
-    virtual ~MessageOverlay();
-public slots:
-    void showMessage (const QString msg, const int forSeconds=0);
-    void hideMessage ();
-protected:
-    void paintEvent(QPaintEvent *event) override;
-
-    bool m_visible = false;
-    QString m_text;
-    QColor m_textColor = QColor (Qt::red);
-    int m_drawAlignFlags = Qt::AlignHCenter | Qt::AlignJustify;
-};
-
-#endif // OVERLAY_H

+ 0 - 148
Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.cpp

@@ -1,148 +0,0 @@
-#include <QMouseEvent>
-#include <QDebug>
-
-#include <math.h>
-#include "SwipeGestureRecognizer.h"
-
-SwipeGestureRecognizer::SwipeGestureRecognizer()
-{
-}
-
-bool
-SwipeGestureRecognizer::IsValidMove(int dx, int dy)
-{
-   // The moved distance is to small to count as not just a glitch.
-   if ((qAbs(dx) < MINIMUM_DISTANCE) && (qAbs(dy) < MINIMUM_DISTANCE)) {
-       //qDebug() << "invalide dx " << dx << " dy " << dy;
-      return false;
-   }
-
-   return true;
-}
-
-
-// virtual
-QGesture*
-SwipeGestureRecognizer::create(QObject* pTarget)
-{
-   qDebug("SwipeGestureRecognizer::create() called");
-   QGesture *pGesture = new QSwipeGesture(pTarget);
-   return pGesture;
-}
-
-
-// virtual
-QGestureRecognizer::Result
-SwipeGestureRecognizer::recognize(QGesture* pGesture, QObject *pWatched, QEvent *pEvent)
-{
-   QGestureRecognizer::Result result = QGestureRecognizer::Ignore;
-   QSwipeGesture *pSwipe = static_cast<QSwipeGesture*>(pGesture);
-
-   switch(pEvent->type()) {
-      case QEvent::MouseButtonPress: {
-         QMouseEvent* pMouseEvent = static_cast<QMouseEvent*>(pEvent);
-         pSwipe->setProperty("startPoint", pMouseEvent->screenPos());// localPos());
-         result = QGestureRecognizer::MayBeGesture;
-         qDebug() << "Swipe gesture started (start point=" <<  pSwipe->property("startPoint").toPointF() <<  ")";
-      }
-      break;
-      case QEvent::MouseButtonRelease: {
-         QMouseEvent* pMouseEvent = static_cast<QMouseEvent*>(pEvent);
-         const QVariant& propValue = pSwipe->property("startPoint");
-         QPointF startPoint = propValue.toPointF();
-         //Returns the position of the mouse cursor as a QPointF, relative to the widget or item that received the event.
-         QPointF endPoint = pMouseEvent->screenPos(); //localPos();
-         qDebug() << "Swipe gesture ended (end point=" <<  endPoint <<  ")";
-         // process distance and direction
-         int dx = endPoint.x() - startPoint.x();
-         int dy = endPoint.y() - startPoint.y();
-
-         //bugfix: startPoint.isNull because we sometimes get false events with startpoint 0 -> wrong swipe detected!
-         if ( (!IsValidMove(dx, dy)) || ( startPoint.isNull() ) ) {
-            // Just a click, so no gesture.
-            result = QGestureRecognizer::CancelGesture;
-            qDebug("Swipe gesture canceled");
-         } else {
-            // Compute the angle.
-            qDebug() << " startPoint= " << startPoint << " endPoint=" << endPoint << " dx=" << dx << " dy=" << dy;
-            qreal angle = ComputeAngle(dx, dy);
-            pSwipe->setSwipeAngle(angle);
-            result = QGestureRecognizer::FinishGesture;
-            qDebug("Swipe gesture finished");
-         }
-      }
-      break;
-      default:
-        break;
-   }
-
-   return result;
-}
-
-void
-SwipeGestureRecognizer::reset(QGesture *pGesture)
-{
-   pGesture->setProperty("startPoint", QVariant(QVariant::Invalid));
-   parent::reset(pGesture);
-}
-
-qreal
-SwipeGestureRecognizer::ComputeAngle(int dx, int dy)
-{
-   double PI = 3.14159265;
-
-   // Need to convert from screen coordinates direction
-   // into classical coordinates direction.
-   dy = -dy;
-
-   double result = atan2((double)dy, (double)dx) ;
-   result = (result * 180) / PI;
-
-   // Always return positive angle.
-   if (result < 0) {
-      result += 360;
-   }
-
-   return result;
-}
-
-
-
-/*
-==========================================================================
-*/
-
-QSwipeGesture::SwipeDirection
-SwipeGestureUtil::GetHorizontalDirection(QSwipeGesture *pSwipeGesture)
-{
-   qreal angle = pSwipeGesture->swipeAngle();
-   if (0 <= angle && angle <= 45) {
-      return QSwipeGesture::Right;
-   }
-
-   if (135 <= angle && angle <= 225) {
-      return QSwipeGesture::Left;
-   }
-
-   if (315 <= angle && angle <= 360) {
-      return QSwipeGesture::Right;
-   }
-
-   return QSwipeGesture::NoDirection;
-}
-
-QSwipeGesture::SwipeDirection
-SwipeGestureUtil::GetVerticalDirection(QSwipeGesture *pSwipeGesture)
-{
-   qreal angle = pSwipeGesture->swipeAngle();
-
-   if (45 < angle && angle < 135) {
-      return QSwipeGesture::Up;
-   }
-
-   if (225 < angle && angle < 315) {
-      return QSwipeGesture::Down;
-   }
-
-   return QSwipeGesture::NoDirection;
-}

+ 0 - 43
Framework/spshell/Widgets/floatwidget/SwipeGestureRecognizer.h

@@ -1,43 +0,0 @@
-#ifndef SWIPEGESTURERECOGNIZER_H
-#define SWIPEGESTURERECOGNIZER_H
-
-#include <QGestureRecognizer>
-#include <QSwipeGesture>
-
-/**
- * @brief The SwipeGestureRecognizer class
- * needed because the defalt implementation of swipe is a little bit odd: it only triggers on 3 finger swipes! (5.3)
- *
- * http://developer.android.com/design/patterns/gestures.html
- * http://qt-project.org/doc/qt-5/gestures-overview.html
- */
-class SwipeGestureRecognizer : public QGestureRecognizer
-{
-public:
-    SwipeGestureRecognizer();
-
-
-private:
-   static const int MINIMUM_DISTANCE = 10;
-
-   typedef QGestureRecognizer parent;
-
-   bool IsValidMove(int dx, int dy);
-
-   qreal ComputeAngle(int dx, int dy);
-
-   virtual QGesture* create(QObject* pTarget);
-
-   virtual QGestureRecognizer::Result recognize(QGesture* pGesture, QObject *pWatched, QEvent *pEvent);
-
-   void reset (QGesture *pGesture);
-};
-
-
-class SwipeGestureUtil {
-public:
-    static QSwipeGesture::SwipeDirection GetHorizontalDirection(QSwipeGesture *pSwipeGesture);
-    static QSwipeGesture::SwipeDirection GetVerticalDirection(QSwipeGesture *pSwipeGesture);
-};
-
-#endif // SWIPEGESTURERECOGNIZER_H

+ 0 - 581
Framework/spshell/Widgets/floatwidget/widget.cpp

@@ -1,581 +0,0 @@
-#include "widget.h"
-#include "ui_widget.h"
-#include <QMouseEvent>
-#include <QLabel>
-#include <QPainter>
-#include <QApplication>
-#include <QDesktopWidget>
-#include <QDebug>
-#include <QPropertyAnimation>
-#include <QProcess>
-#include <QMessageBox>
-
-#ifdef WITH_QT
-#include "BootGlobal.h"
-#include "RvcSettings.h"
-#endif // WITH_QT
-
-
-inline static QColor GetBackgoundColor()
-{
-    return QColor(161, 163, 165, 255);
-}
-
-inline static QRect GetScreenRect()
-{
-    QDesktopWidget* desk = QApplication::desktop();
-    QRect rect = desk->screenGeometry(desk->primaryScreen());
-    return rect;
-}
-
-const int SHOW_EDGE_WIDTH = 15;
-const int DEFAULT_WIDTH = 40;
-const int CONTINUE_PRESS_INTERVAL = 5000;
-const int CONTINUE_UNPRESS_INTERVAL = 20000;
-const int CONTINUE_HEATBEAT_INTERVAL = 60000;
-
-static bool initialize_once = false;
-
-Widget::Widget(QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::Widget),floatWidget(nullptr),mClipMenu(nullptr),mMainBtn(nullptr)
-    ,mPressContinueTimer(nullptr),mHiddenTimer(nullptr), mHeatbeatTimer(nullptr),mText("ClickMe")
-    ,mCenter(DEFAULT_WIDTH,DEFAULT_WIDTH),mRadius(DEFAULT_WIDTH),mPress(false)
-    , mEdgeStatus(EG_NORMAL),mRecognizer(nullptr),currGraph(0)
-    ,mQuickCmd(""), mCorrectCmd(true)
-{
-    init();
-}
-
-Widget::Widget(const QString text, QPoint center, int radius, QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::Widget),floatWidget(nullptr),mClipMenu(nullptr),mMainBtn(nullptr)
-    ,mPressContinueTimer(nullptr),mHiddenTimer(nullptr), mHeatbeatTimer(nullptr), mText(text)
-    ,mCenter(center),mRadius(radius),mPress(false)
-    , mEdgeStatus(EG_NORMAL),mRecognizer(nullptr),currGraph(0)
-    , mQuickCmd(""), mCorrectCmd(true)
-{
-    init();
-}
-
-
-Widget::~Widget()
-{
-    delete ui;
-}
-
-void Widget::init()
-{
-    ui->setupUi(this);
-    setAutoFillBackground(false);
-    QPalette p = palette();
-    p.setBrush(QPalette::Background, QBrush(":/res/bg.png"));
-    setPalette(p);
-
-    mBeginTimerPos.setX(-1);
-    mBeginTimerPos.setY(-1);
-
-    this->setMouseTracking(true);
-    //this->installEventFilter(this);
-
-    resize(DEFAULT_WIDTH*2, DEFAULT_WIDTH*2);
-    QString styleStr = QString("QWidget{border-radius:%1px;background-color:rgba(0,255,0,200)}").arg(DEFAULT_WIDTH);
-    this->setStyleSheet(styleStr);
-
-    mPress = false;
-    mBeginPos = this->pos();
-    this->setWindowFlags(Qt::Tool | Qt::X11BypassWindowManagerHint
-                         | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint | Qt::WindowMinMaxButtonsHint | Qt::WindowStaysOnTopHint);
-    this->setAttribute(Qt::WA_TranslucentBackground, true);
-
-    mClipMenu = new QMenu(this);
-
-    topOverlay = new MessageOverlay (QApplication::activeWindow(), Qt::AlignJustify);
-    topOverlay->showMessage (QString("Test-Overlay Message"), 10);
-    middleOverlay = new MessageOverlay (nullptr, Qt::AlignVCenter | Qt::AlignHCenter);
-    middleOverlay->showMessage (QString("Test-Overlay Message"), 10);
-    bottomOverlay = new MessageOverlay (nullptr, Qt::AlignBottom | Qt::AlignHCenter);
-    bottomOverlay->showMessage (QString("Test-Overlay Message"), 10);
-
-    registerGesture();
-
-    connect(this, SIGNAL(edgeUpdate()), SLOT(dealWithEdgeUpdate()));
-    connect(this, SIGNAL(popupSettings()), SLOT(dealWithPopupSettings()));
-    resetPos();
-    initQuickMenu();
-}
-
-void Widget::refreshPaint(int refreshType)
-{
-    QPixmap map;
-
-    QPainter p(this);
-    p.setRenderHint(QPainter::Antialiasing);
-    p.setBackgroundMode(Qt::TransparentMode);
-    if(refreshType == 1) {
-        map.load(":/res/bgactive.png");
-        p.setBrush(Qt::red);
-    } else if(refreshType == 2) {
-        map.load(":/res/bg.png");
-        p.setBrush(GetBackgoundColor());
-    } else if(refreshType == 3) {
-        map.load(":/res/bgin.png");
-        p.setBrush(Qt::red);
-    }
-    //map.fill(Qt::transparent);
-    //map.fill(qRgba(255,255,255,0));
-
-    p.setPen(Qt::NoPen);
-
-    QRect rect = this->rect();
-    rect.setWidth(mRadius*2);
-    rect.setHeight(mRadius*2);
-    p.setRenderHint(QPainter::SmoothPixmapTransform, true);
-    p.drawPixmap(rect, map);
-}
-
-void Widget::simulateMouseLease()
-{
-    auto pos = this->pos();//QCursor::pos();
-    QMouseEvent* evtMsLease = new QMouseEvent(QEvent::MouseButtonRelease, pos, Qt::LeftButton, Qt::LeftButton, Qt::NoModifier);
-    QApplication::sendEvent(this,evtMsLease);
-}
-
-void Widget::paintEvent(QPaintEvent *event)
-{
-    qDebug() << __FUNCTION__;
-
-    if(mPress) {
-        refreshPaint(1);
-    } else {
-        refreshPaint(2);
-    }
-
-    if(!initialize_once) {
-        initialize_once = true;
-       // emit edgeUpdate();
-    }
-}
-
-bool Widget::eventFilter(QObject *obj, QEvent *event)
-{
-    if (event->type() == QEvent::MouseButtonPress) {
-        QMouseEvent* mouseEvent = (QMouseEvent*)event;
-        if (mouseEvent->buttons() & Qt::LeftButton) {
-            const QPoint p = mouseEvent->pos();
-            QString s = "x= " + QString::number(p.x()) + " y= " + QString::number(p.y());
-            qDebug() << "mouse left btn press: " << s;
-        }
-    }
-    return QWidget::eventFilter(obj, event);
-}
-
-void Widget::swiperTriggered(QSwipeGesture *gesture)
-{
-    bool result = false;
-
-    if (gesture->state() == Qt::GestureFinished) {
-       qDebug("Swipe angle: %f", gesture->swipeAngle());
-       switch (SwipeGestureUtil::GetHorizontalDirection(gesture)) {
-          case QSwipeGesture::Left:
-             qDebug("Swipe Left detected");
-             //topOverlay->showMessage("Swipe Left detected",5);
-             result = true;
-             break;
-          case QSwipeGesture::Right:
-             qDebug("Swipe Right detected");
-             result = true;
-             break;
-          default:
-             break;
-       }
-       switch (SwipeGestureUtil::GetVerticalDirection(gesture)) {
-          case QSwipeGesture::Up:
-             qDebug("Swipe Up detected");
-             result = true;
-             break;
-          case QSwipeGesture::Down:
-             qDebug("Swipe Down detected");
-             result = true;
-             break;
-          default:
-             break;
-       }
-    }
-    return;
-}
-
-bool Widget::gestureEvent(QGestureEvent *event)
-{
-    qDebug() << "gestureEvent():" << event->gestures().size();
-    if(QGesture* swipe = event->gesture(Qt::SwipeGesture)) {
-        swiperTriggered(static_cast<QSwipeGesture*>(swipe));
-        qDebug() << "swipe";
-    } else if(QGesture* pan = event->gesture(Qt::PanGesture)) {
-        qDebug() << "pan";
-    } else if (QGesture *pinch = event->gesture(Qt::PinchGesture)) {
-        qDebug() << "pinch";
-     } else if (QGesture *tap = event->gesture(Qt::TapGesture)) {
-        qDebug() << "tap";
-    } else if (QGesture *tapAndHold = event->gesture(Qt::TapAndHoldGesture)) {
-        qDebug() << "tap and hold";
-    }
-    return true;
-}
-
-void Widget::registerGesture()
-{
-    mRecognizer = new SwipeGestureRecognizer();
-    mGestType = QGestureRecognizer::registerRecognizer(mRecognizer);
-    grabGesture(mGestType);
-}
-
-void Widget::mousePressEvent(QMouseEvent *event)
-{
-    if(isContains(event->pos()))
-    {
-        setWindowOpacity(1);
-        if(!mPress) {
-            mPress = true;
-            mBeginPos = event->pos();
-            mBeginTimerPos = this->pos();
-            if (mPressContinueTimer) {
-                mPressContinueTimer->stop();
-                mPressContinueTimer->start();
-            }
-        }
-        update();
-    }
-
-    QWidget::mousePressEvent(event);
-}
-
-void Widget::mouseReleaseEvent(QMouseEvent *event)
-{
-    qDebug() << __FUNCTION__ << mPress;
-
-    setWindowOpacity(0.7);
-
-    if(mPress) {
-        mPress = false;
-    }
-
-    update();
-
-    //if(isContains(event->pos()))
-    //    emit clicked();
-
-    if(y() <= 0)
-        mEdgeStatus = EG_TOP;
-    else if(GetScreenRect().width() < (this->x() + width())) {
-        mEdgeStatus = EG_RIGHT;
-    } else if(x() <= 0)
-        mEdgeStatus = EG_LEFT;
-    else
-        mEdgeStatus = EG_NORMAL;
-
-    if (mEdgeStatus != EG_LEFT && mHiddenTimer) {
-        qDebug() << "Schedule restore timer!";
-        mHiddenTimer->stop();
-        mHiddenTimer->start();
-    }
-
-    QWidget::mouseReleaseEvent(event);
-}
-
-void Widget::mouseMoveEvent(QMouseEvent *event)
-{
-    if(mPress && event->buttons() & Qt::LeftButton) {
-        this->move(event->pos() - mBeginPos + this->pos());
-    }
-
-    QWidget::mouseMoveEvent(event);
-}
-
-
-void Widget::enterEvent(QEvent* event)
-{
-    qDebug() << __FUNCTION__;
-
-    //edgeOut();
-
-    if (mMainBtn) {
-        QPoint point = this->pos();
-        point.rx() = point.x() + mMainBtn->width() - DEFAULT_WIDTH;
-        point.ry() = point.y() + mMainBtn->height() - DEFAULT_WIDTH;
-        mMainBtn->move(point);
-    }
-
-    QWidget::enterEvent(event);
-}
-
-void Widget::leaveEvent(QEvent* event)
-{
-
-    qDebug() << __FUNCTION__;
-
-    //edgeIn();
-
-    QWidget::leaveEvent(event);
-}
-
-bool Widget::event(QEvent* event)
-{
-    if (event->type() == QEvent::Gesture) {
-        return gestureEvent(static_cast<QGestureEvent*>(event));
-    }
-    return QWidget::event(event);
-}
-
-void Widget::contextMenuEvent(QContextMenuEvent *event)
-{
-    this->setCursor(Qt::ArrowCursor);
-    mClipMenu->exec(cursor().pos());
-}
-
-void Widget::closeEvent(QCloseEvent *event)
-{
-    this->close();
-}
-
-
-bool Widget::resetPosEhance()
-{
-    if (mPress) {
-        //simulateMouseLease();
-    }
-
-    if(mEdgeStatus != EG_LEFT) {
-        resetPos();
-        return true;
-    }
-    return false;
-}
-
-void Widget::initQuickMenu()
-{
-#ifdef WITH_QT
-    const QString configFileName = getFrameworkConfigPath();
-    QFileInfo fileInfo(configFileName);
-    if (fileInfo.exists()) {
-        RvcSettings* settings = new RvcSettings(configFileName, QSettings::IniFormat);
-        settings->setIniCodec("UTF-8");
-        QString cmdValue = settings->GetConfigData("QuickShortcut", "CmdLine").toString();
-        cmdValue = cmdValue.trimmed();
-        if (cmdValue.isNull() || cmdValue.isEmpty()) {
-            mCorrectCmd = false;
-            mQuickCmd = "未配置";
-        } else {
-            mCorrectCmd = true;
-            mQuickCmd = cmdValue;
-        }
-    } else {
-        mCorrectCmd = false;
-        mQuickCmd = "配置文件缺失";
-    }
-#endif // WITH_QT
-
-    mHiddenTimer = new QTimer(this);
-    mHiddenTimer->setSingleShot(true);
-    connect(mHiddenTimer, SIGNAL(timeout()), this, SLOT(HandleHiddenTimeout()));
-    mHiddenTimer->setInterval(CONTINUE_UNPRESS_INTERVAL);
-
-    mPressContinueTimer = new QTimer(this);
-    mPressContinueTimer->setSingleShot(true);
-    connect(mPressContinueTimer, SIGNAL(timeout()), this, SLOT(HandleTimeout()));
-    mPressContinueTimer->setInterval(CONTINUE_PRESS_INTERVAL);
-
-    mHeatbeatTimer = new QTimer(this);
-    connect(mHeatbeatTimer, SIGNAL(timeout()), this, SLOT(HeatbeatTimeout()));
-    mHeatbeatTimer->setInterval(CONTINUE_HEATBEAT_INTERVAL);
-}
-
-void Widget::resetPos()
-{
-    QRect rect = GetScreenRect();
-    const int wd = rect.width();
-    const int ht = rect.height();
-
-    this->move(0, ht / 3 - this->height() / 2);
-    mEdgeStatus = EG_LEFT;
-    emit edgeUpdate();
-}
-
-void Widget::forceClose()
-{
-    qApp->exit();
-    //this->close();
-}
-
-bool Widget::isContains(QPoint pos)
-{
-    return (mCenter.x() - mRadius < pos.x()
-            && mCenter.x() + mRadius > pos.x()
-            && mCenter.y() - mRadius < pos.y()
-            && mCenter.y() + mRadius > pos.y());
-
-}
-
-#define ABS_MIN_DISTANCE 2
-static bool isAllowDistance(const QPoint& a, const QPoint& b)
-{
-    if (abs(a.x() - b.x()) < ABS_MIN_DISTANCE && abs(a.y() - b.y()) < ABS_MIN_DISTANCE) {
-        return true;
-    }
-    return false;
-}
-
-void Widget::HeatbeatTimeout()
-{
-    qDebug() << "HeatbeatTimeout!" << mPress;
-    if (!mPress) {
-        if (!mHiddenTimer->isActive()) {
-            if (resetPosEhance()) {
-                //simulateMouseLease();
-            }
-        }
-    }
-}
-
-void Widget::HandleTimeout()
-{
-    qDebug() << "HandleTimeout!" << mPress;
-    if(mPress) {
-
-        if(isAllowDistance(this->pos(), mBeginTimerPos)) {
-        //if(this->pos() == mBeginTimerPos) {
-            qDebug() << "Trigger!";
-            mBeginTimerPos.setX(-1);
-            mBeginTimerPos.setY(-1);
-
-            emit popupSettings();
-
-        } else {
-            mBeginTimerPos = this->pos();
-            mPressContinueTimer->start();
-        }
-    } else {
-        mBeginTimerPos.setX(-1);
-        mBeginTimerPos.setY(-1);
-    }
-}
-
-void Widget::HandleHiddenTimeout()
-{
-    qDebug() << __FUNCTION__;
-    resetPosEhance();
-}
-
-void Widget::dealWithEdgeUpdate()
-{
-    qDebug() << __FUNCTION__ << " " << mEdgeStatus;
-    edgeIn();
-}
-
-void Widget::dealWithPopupSettings()
-{
-    qDebug() << __FUNCTION__;
-
-#ifdef WITH_QT
-
-    if (mCorrectCmd) {
-        QProcess* process = new QProcess(this);
-        QString appDir = QCoreApplication::applicationDirPath();
-
-#ifdef Q_WS_WIN32
-        if (appDir.endsWith("\\bin")) {
-            appDir = appDir.left(appDir.length() - QString("\\bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#else
-        if (appDir.endsWith("/bin")) {
-            appDir = appDir.left(appDir.length() - QString("/bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#endif
-
-        process->setStandardOutputFile(QProcess::nullDevice());
-        process->setStandardErrorFile(QProcess::nullDevice());
-        bool result = process->startDetached(mQuickCmd);
-        if (!result) {
-            QMessageBox::critical(nullptr, "错误", QString("唤出快捷菜单失败:%1").arg(process->errorString()));
-        } else {
-            resetPosEhance();
-            simulateMouseLease();
-        }
-        delete process;
-    } else {
-        QString tmp = QString("唤出快捷菜单失败:%1").arg(mQuickCmd);
-        QMessageBox::critical(nullptr, "错误", tmp);
-    }
-
-#else
-    resetPosEhance();
-    QMessageBox::information(nullptr, "提示", "这是唤起快捷菜单的测试说明!");
-
-#endif // WITH_QT
-
-}
-
-void Widget::edgeIn()
-{
-    QPropertyAnimation* ani = new QPropertyAnimation(this, "geometry");
-    ani->setDuration(100);
-    ani->setStartValue(QRect(this->x(), this->y(), width(), height()));
-
-
-    switch (mEdgeStatus) {
-        case EG_TOP:
-
-        ani->setEndValue(QRect(pos().x(), -height() + SHOW_EDGE_WIDTH, width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(pos().x(), -height() + SHOW_EDGE_WIDTH, width(), height());
-        break;
-    case EG_LEFT:
-
-        ani->setEndValue(QRect(-width() + SHOW_EDGE_WIDTH, pos().y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(-width() + SHOW_EDGE_WIDTH, pos().y(), width(), height());
-        break;
-    case EG_RIGHT:
-
-        ani->setEndValue(QRect(GetScreenRect().width() - width() + SHOW_EDGE_WIDTH, pos().y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-
-        //setGeometry(QApplication::desktop()->width() - SHOW_EDGE_WIDTH, pos().y(), width(), height());
-        break;
-    case EG_NORMAL:
-    default:
-        break;
-    }
-}
-
-void Widget::edgeOut()
-{
-    QPropertyAnimation* ani = new QPropertyAnimation(this, "geometry");
-    ani->setDuration(100);
-    ani->setStartValue(QRect(this->x(), this->y(), width(), height()));
-
-    switch (mEdgeStatus) {
-        case EG_TOP:
-        ani->setEndValue(QRect(pos().x(), -SHOW_EDGE_WIDTH, width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(pos().x(), -SHOW_EDGE_WIDTH, width(), height());
-        break;
-    case EG_LEFT:
-        ani->setEndValue(QRect(-SHOW_EDGE_WIDTH, y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(-SHOW_EDGE_WIDTH, y(), width(), height());
-        break;
-    case EG_RIGHT:
-        ani->setEndValue(QRect(GetScreenRect().width() - width() + SHOW_EDGE_WIDTH, y(), width(), height()));
-        ani->start(QAbstractAnimation::DeleteWhenStopped);
-        //setGeometry(QApplication::desktop()->width() - width() + SHOW_EDGE_WIDTH, y(), width(), height());
-        break;
-    case EG_NORMAL:
-    default:
-        break;
-    }
-}

+ 0 - 115
Framework/spshell/Widgets/floatwidget/widget.h

@@ -1,115 +0,0 @@
-#ifndef WIDGET_H
-#define WIDGET_H
-
-#include <QWidget>
-#include <QMenu>
-#include <QPushButton>
-#include <QVBoxLayout>
-#include <QTimer>
-#include <QPointer>
-#include "SwipeGestureRecognizer.h"
-#include "Overlay.h"
-
-enum EG_ENUM {
-    EG_NORMAL,
-    EG_TOP,
-    EG_RIGHT,
-    EG_LEFT,
-    EG_BOTTOM
-};
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class Widget; }
-QT_END_NAMESPACE
-
-class Widget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    Widget(QWidget *parent = nullptr);
-    Widget(const QString text, QPoint center, int radius,  QWidget *parent = nullptr);
-    ~Widget();
-
-    void paintEvent(QPaintEvent *event);
-
-    void mousePressEvent(QMouseEvent *);
-    void mouseReleaseEvent(QMouseEvent *event);
-    void mouseMoveEvent(QMouseEvent *);
-
-    void contextMenuEvent(QContextMenuEvent *event);
-    void closeEvent(QCloseEvent *event);
-
-    void init();
-    bool isContains(QPoint pos);
-
-private slots:
-        void HandleTimeout();
-        void HeatbeatTimeout();
-
-        void forceClose();
-        void dealWithEdgeUpdate();
-        void HandleHiddenTimeout();
-        void dealWithPopupSettings();
-
-protected:
-    void enterEvent(QEvent *event);
-    void leaveEvent(QEvent *event);
-    bool event(QEvent *event);
-
-signals:
-    void clicked();
-    void edgeUpdate();
-    void popupSettings();
-
-protected:
-    bool eventFilter(QObject *obj, QEvent *event);
-
-private:
-    void swiperTriggered(QSwipeGesture* gesture);
-    bool gestureEvent(QGestureEvent* event);
-    void registerGesture();
-    void edgeOut();
-    void edgeIn();
-    void resetPos();
-    bool resetPosEhance();
-    void initQuickMenu();
-    void refreshPaint(int refreshType);
-
-    void simulateMouseLease();
-
-private:
-    Ui::Widget *ui;
-    QPoint dragPosition;
-    bool showColon;
-    QWidget* floatWidget;
-    QMenu* mClipMenu;
-    QPushButton* mMainBtn;
-    QTimer* mPressContinueTimer;
-    QTimer* mHiddenTimer;
-    QTimer* mHeatbeatTimer;
-    QPoint mBeginTimerPos;
-
-    QString mText;
-    QPoint  mCenter;
-    QPoint mBeginPos;
-    int mRadius;
-    int mOpacity;
-
-    bool mPress;
-    EG_ENUM mEdgeStatus;
-
-    SwipeGestureRecognizer* mRecognizer;
-    Qt::GestureType mGestType;
-    int currGraph;
-
-    QPointer<Overlay> testOverlay = nullptr;
-    QPointer<MessageOverlay> topOverlay = nullptr;
-    QPointer<MessageOverlay> middleOverlay = nullptr;
-    QPointer<MessageOverlay> bottomOverlay = nullptr;
-
-    QString mQuickCmd;
-    bool mCorrectCmd;
-
-};
-#endif // WIDGET_H

+ 0 - 24
Framework/spshell/Widgets/floatwidget/widget.ui

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Widget</class>
- <widget class="QWidget" name="Widget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>222</width>
-    <height>202</height>
-   </rect>
-  </property>
-  <property name="font">
-   <font>
-    <stylestrategy>PreferAntialias</stylestrategy>
-   </font>
-  </property>
-  <property name="windowTitle">
-   <string>Widget</string>
-  </property>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 1671
Framework/spshell/Widgets/mainwindow.cpp

@@ -1,1671 +0,0 @@
-#include "mainwindow.h"
-#include "ui_mainwindow.h"
-#include <QHeaderView>
-#include <QDebug>
-#include <QMessageBox>
-#include <QDate>
-#include <QDateTime>
-#include <QDir>
-#include <QFile>
-#include <QFileInfo>
-#include <QDesktopWidget>
-#include <QTextCodec>
-#include <QProcess>
-#include <QFileDialog>
-#include <QStandardPaths>
-
-#include <QPropertyAnimation>
-
-#include <QJsonDocument>
-#include <QJsonObject>
-#include <QJsonArray>
-
-#include "dialogappversion.h"
-#include "dialogconfig.h"
-#include "sysinfo.h"
-#include "textfinder.h"
-#include "textedit.h"
-#include "BootGlobal.h"
-
-#define ENTITY_COLUMN_NAME 0
-#define ENTITY_COLUMN_STATUS 1
-#define ENTITY_COLUMN_PID 2
-#define ENTITY_COLUMN_VERSION 3
-#define ENTITY_COLUMN_BOOTTIME 4
-#define MAX_ENTITY_LIST_COLUMN 5
-
-
-//Mapping to SpBase::FrameworkStateEnum
-#define FRAMEWORK_STATE_NOTINIT 0
-#define FRAMEWORK_STATE_NOCONFIG 1
-#define FRAMEWORK_STATE_BOOTING 2
-#define FRAMEWORK_STATE_RUNNING 3
-#define FRAMEWORK_STATE_SERVING 4
-#define FRAMEWORK_STATE_BREAKDOWN 5
-#define FRAMEWORK_STATE_REPAIRING 6
-#define FRAMEWORK_STATE_UPGRADING 7
-#define FRAMEWORK_STATE_ROOLLBACKING 8
-#define FRAMEWORK_STATE_RECOVING 9
-#define FRAMEWORK_STATE_NOTDISTURB 10
-
-#define STARTUP_SCRIPT "spexplorer.sh"
-
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application STver."
-#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application UATver."
-#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application"
-#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
-#define RVC_TITLE_STRING "RVC Terminal Application DEVver."
-#else/*本地编译等非DevOps环境编译的版本*/
-#define RVC_TITLE_STRING "RVC Terminal Application TESTver."
-#endif
-
-void setRowBackground(const QBrush& brush, QAbstractItemModel* model, int row, const QModelIndex& parent = QModelIndex())
-{
-    if (!model || row < 0 || row >= model->rowCount(parent))
-        return;
-    if (parent.isValid() && parent.model() != model)
-        return;
-    for (int i = 0; i < model->columnCount(parent); ++i)
-        Q_ASSUME(model->setData(model->index(row, i, parent), brush, Qt::BackgroundRole));
-}
-
-static QString EntityInfoHeaderString()
-{
-    return QString("实体名称\t状态\t进程号\t版本\t启动时间\t文件句柄数");
-}
-
-static QString EntityRunInfoToString(const EntityRunInfo& entity)
-{
-    QString result = QString("%1\t%2\t%3\t%4\t%5\t%6")
-            .arg(entity.entityName)
-            .arg(MappingSatus2String(entity.state))
-            .arg(entity.pid)
-            .arg(entity.version)
-            .arg(entity.startupTimeStr)
-            .arg(entity.fds);
-
-    return result;
-}
-
-MainWindow::MainWindow(QWidget* parent)
-    : QMainWindow(parent)
-    , ui(new Ui::MainWindow), mSicon(nullptr), mSilent(false)
-    , mIdleEntityCount(0), mTotalEntityCount(0), mFloatWidget(nullptr)
-{
-    this->Init(RVC_TITLE_STRING);
-}
-
-MainWindow::MainWindow(QString systemInfo, int totalEntityCount, QWidget* parent)
-    : QMainWindow(parent)
-    , ui(new Ui::MainWindow), mSicon(nullptr), mSilent(false)
-    , mIdleEntityCount(0), mTotalEntityCount(0), mFloatWidget(nullptr)
-{
-    this->Init(systemInfo);
-}
-
-void MainWindow::Init(QString title)
-{
-    ui->setupUi(this);
-    setWindowIcon(QIcon(":/res/FavIcon.ico"));
-    if (title.startsWith(RVC_TITLE_STRING)) {
-        setWindowTitle(title);
-    } else {
-        setWindowTitle(QString(RVC_TITLE_STRING " [%1]").arg(title));
-    }
-
-    QPropertyAnimation* animation = new QPropertyAnimation(this, "windowOpacity");
-    animation->setDuration(800);
-    animation->setStartValue(0);
-    animation->setEndValue(1);
-    animation->start();
-
-    //QTextCodec* codec = QTextCodec::codecForName("GBK");
-    //QTextCodec::setCodecForLocale(codec);
-
-
-    this->setMinimumSize(1068, 720);
-    QDesktopWidget* desk = QApplication::desktop();
-    //const int curScreenIdx = desk->screenNumber(this);
-    const int curScreenIdx = desk->primaryScreen();
-    QRect rect = desk->screenGeometry(curScreenIdx);
-    const int wd = rect.width();
-    const int ht = rect.height();
-    this->move((wd - width()) / 2, (ht - height()) / 2);
-
-    ui->splitter->setStretchFactor(0, 1);
-    ui->splitter->setStretchFactor(1, 6);
-    ui->splitter->setStretchFactor(2, 3);
-
-    InitSystemTrayIcon();
-
-    InitEntitiesView();
-#ifndef WITH_QT
-    Test_EntityList();
-    Test_EventLog();
-#endif
-    QStringList selections;
-    for (EntityState i = NoStart; i <= All;) {
-        selections << MappingSatus2String(i);
-        i = EntityState(i + 1);
-    }
-
-    ui->comboBoxStatus->addItems(selections);
-    ui->comboBoxStatus->setCurrentIndex((int)All);
-
-    connect(ui->comboBoxStatus, SIGNAL(currentIndexChanged(int)), this, SLOT(DisplayEntities()));
-    connect(ui->tableWidgetEntities->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(SortEntityItem(int)));
-
-    InitMenuAction();
-    InitStatusBar();
-
-    connect(ui->pushButtonEntStart, SIGNAL(clicked()), this, SLOT(StartEntity()));
-    connect(ui->pushButtonEntClose, SIGNAL(clicked()), this, SLOT(TerminateEntity()));
-    connect(ui->pushButtonEntPause, SIGNAL(clicked()), this, SLOT(PauseEntity()));
-    connect(ui->pushButtonEntContinue, SIGNAL(clicked()), this, SLOT(ContinueEntity()));
-    connect(ui->pushButtonEntKill, SIGNAL(clicked()), this, SLOT(KillEntity()));
-    connect(ui->pushButtonEntTest, SIGNAL(clicked()), this, SLOT(TestEntity()));
-    connect(ui->pushButtonEntLogView, SIGNAL(clicked()), this, SLOT(LogView()));
-    connect(ui->pushButtonClearRunCfg, SIGNAL(clicked()), this, SLOT(RemoveEntityRuninfoConfigFile()));
-    SysInfo::instance().init();
-    QHBoxLayout* cpuLayout = new QHBoxLayout();
-    cpuLayout->setContentsMargins(0, 0, 0, 0);
-    cpuLayout->setSpacing(0);
-    cpuLayout->setMargin(0);
-    ui->tab4CPU->setLayout(cpuLayout);
-    ui->tab4CPU->layout()->addWidget(&mCpuWidget);
-
-    QHBoxLayout* memoryLayout = new QHBoxLayout();
-    memoryLayout->setContentsMargins(0, 0, 0, 0);
-    ui->tab4Memory->setLayout(memoryLayout);
-    ui->tab4Memory->layout()->addWidget(&mMemoryWidget);
-
-    mPerformWidge = new PerformWidget(this);
-    QHBoxLayout* monitorLayout = new QHBoxLayout();
-    monitorLayout->setContentsMargins(0, 0, 0, 0);
-    monitorLayout->addWidget(mPerformWidge);
-    ui->tab4Monitor->setLayout(monitorLayout);
-
-#if 1//#ifdef WITH_QT
-    QWidget* w = ui->splitterMain->widget(1);
-    if (w != nullptr) {
-        w->setParent(nullptr);
-        w->deleteLater();
-    }
-#endif
-
-    /*
-    QStringList arguments = QApplication::arguments();
-    if (arguments.contains("--debug") || arguments.contains("-D")) {
-        QTimer* tm = new QTimer(this);
-        connect(tm, SIGNAL(timeout()), this, SLOT(RecordEntitySnapshot()));
-        tm->start(3000);
-    }
-    */
-
-    //InitFloatWidget();
-}
-
-QAction* MainWindow::CreateMenuAction(QString text, QKeySequence keyShot, QString toolTipText, void (MainWindow::* method)())
-{
-    QAction* action = new QAction(text, this);
-    action->setShortcut(keyShot);
-    //action->setStatusTip(toolTipText);
-    //connect(clearAct, SIGNAL(triggered()), textViewer, SLOT(clear()));
-    connect(action, &QAction::triggered, this, method);
-    return action;
-}
-
-void MainWindow::ProcessStarted()
-{
-    qDebug() << "process started! ";
-}
-
-void MainWindow::GetSubProcessMsg()
-{
-
-}
-
-void MainWindow::TriggerAdditionMenu(QAction* action)
-{
-    qDebug() << "menu: " << action->text();
-    RvcAdditionAction* pAct = reinterpret_cast<RvcAdditionAction*>(action);
-    switch (pAct->userData.type) {
-    case BootEntity:
-    {
-        StartEntityFromCustom(pAct->userData.entityName, pAct->userData.cmdLine);
-    }
-    break;
-    case RunShellScript:
-        break;
-    case CreatesSubProcess:
-    default:
-    {
-        QProcess* process = new QProcess(this);
-        //connect(process, SIGNAL(readyReadStandardOutput()), this, SLOT(GetSubProcessMsg()));
-        //connect(process, SIGNAL(started()), this, SLOT(ProcessStarted()));
-        QString appDir = QCoreApplication::applicationDirPath();
-#ifdef Q_WS_WIN32
-        if (appDir.endsWith("\\bin")) {
-            appDir = appDir.left(appDir.length() - QString("\\bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#else
-        if (appDir.endsWith("/bin")) {
-            appDir = appDir.left(appDir.length() - QString("/bin").length());
-            process->setWorkingDirectory(appDir);
-        }
-#endif
-        process->setStandardOutputFile(QProcess::nullDevice());
-        process->setStandardErrorFile(QProcess::nullDevice());
-        qDebug() << "start process: " << pAct->userData.cmdLine;
-        process->startDetached(pAct->userData.cmdLine);
-        //process->waitForFinished(1000);
-        delete process;
-    }
-    break;
-    }
-}
-
-void MainWindow::InitMenuAction()
-{
-    QMenu* mainMenu = menuBar()->addMenu(QString::fromUtf8("菜单(&M)"));
-    //mainMenu->addAction(CreateMenuAction(QString::fromUtf8("初始化(&I)"), tr("Alt+I"), QString::fromUtf8("初始化终端")
-    //                                     , &MainWindow::InitializeTerminal));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("重启当前版本(&T)"), tr("Alt+T"), QString::fromUtf8("重启可视柜台终端应用")
-                                         , &MainWindow::RestartApp));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("重启应用(&R)"), tr("Alt+R"), QString::fromUtf8("通过读取 active.txt 重启可视柜台终端应用")
-                                         , &MainWindow::RestartAppThroughSpShell));
-    QMenu* sysConfigMenu = mainMenu->addMenu(QString::fromUtf8("关机"));
-    sysConfigMenu->addAction(CreateMenuAction(QString::fromUtf8("重启(&P)"), tr("Alt+P"), QString::fromUtf8("重启操作系统")
-                                              , &MainWindow::RestartSystem));
-    sysConfigMenu->addAction(CreateMenuAction(QString::fromUtf8("关机(&D)"), tr("Alt+D"), QString::fromUtf8("关闭计算机")
-                                              , &MainWindow::ShutdownSystem));
-    mainMenu->addAction(CreateMenuAction(QString::fromUtf8("退出应用(&Q)"), tr("Alt+Q"), QString::fromUtf8("退出可视柜台终端应用")
-                                         , &MainWindow::QuitApp));
-
-    QMenu* configMenu = menuBar()->addMenu(QString::fromUtf8("配置(&C)"));
-    configMenu->addAction(CreateMenuAction(QString::fromUtf8("加载控件(&L)"), tr("Alt+L"), QString::fromUtf8("动态加载控件")
-                                           , &MainWindow::LoadCustomPlguins));
-
-
-    QMenu* toolMenu = menuBar()->addMenu(QString::fromUtf8("工具(&T)"));
-    toolMenu->addAction(CreateMenuAction(QString::fromUtf8("选项(&O)"), tr("Alt+O"), QString::fromUtf8("相关选项设置")
-                                         , &MainWindow::ConfigApp));
-    toolMenu->addAction(CreateMenuAction(QString::fromUtf8("导出快照(&S)"), tr("Alt+S"), QString::fromUtf8("导出实体即时信息快照")
-                                         , &MainWindow::ExportEntitySnapshot));
-
-    QMenu* addMenu = menuBar()->addMenu(QString::fromUtf8("附加(&A)"));
-
-    const QString configFileName = getFrameworkConfigPath();
-    qDebug() << "config file name: " << configFileName;
-    QFileInfo fileInfo(configFileName);
-    if (fileInfo.exists()) {
-        RvcSettings* settings = new RvcSettings(configFileName, QSettings::IniFormat);
-        settings->setIniCodec("UTF-8");
-        int menuCount = settings->GetConfigData("Menu", "Count").toInt();
-        qDebug() << "menu count: " << menuCount;
-        int validIdx = 1;
-        for (int i = 1; i <= menuCount; ++i) {
-
-            QString strIdx = QString::number(i);
-            QString subMenuName = settings->GetConfigData("Menu", strIdx).toString();
-            QString textName = settings->GetConfigData(subMenuName, "TextName").toString();
-            const int exeType = settings->GetConfigData(subMenuName, "Type").toInt();
-            const auto excuteEnum = static_cast<ExecuteType>(exeType);
-            QString cmdLine = settings->GetConfigData(subMenuName, "CmdLine").toString();
-            if (cmdLine.isNull() || cmdLine.isEmpty()) {
-                continue;
-            }
-
-            QString strQuick = QString("Alt+%1").arg(validIdx++);
-            qDebug() << subMenuName << " " << textName << " " << strIdx << " " << cmdLine << " " << strQuick;
-            QString menuName = (!textName.isNull() && !textName.isEmpty()) ? textName : cmdLine;
-            RvcAdditionAction* action = new RvcAdditionAction(menuName, this);
-            action->setShortcut(strQuick);
-            //action->setStatusTip(cmdLine);
-
-            action->userData.type = excuteEnum;
-            cmdLine = cmdLine.trimmed();
-            if (excuteEnum == BootEntity && -1 != cmdLine.indexOf('\t')) {
-                const int idx = cmdLine.indexOf('\t');
-                QStringList params = cmdLine.split("\t");
-                action->userData.entityName = params.at(0);
-                action->userData.cmdLine = cmdLine.mid(idx + 1);
-
-            } else if (excuteEnum == BootEntity) {
-                action->userData.entityName = cmdLine;
-                action->userData.cmdLine = "";
-            } else {
-                action->userData.cmdLine = cmdLine;
-            }
-            addMenu->addAction(action);
-        }
-        if (menuCount > 0) {
-            connect(addMenu, SIGNAL(triggered(QAction*)), this, SLOT(TriggerAdditionMenu(QAction*)));
-        }
-    }
-
-    QMenu* helpMenu = menuBar()->addMenu(QString::fromUtf8("帮助(&H)"));
-    helpMenu->addAction(CreateMenuAction(QString::fromUtf8("关于应用(&A)"), tr("Alt+A"), QString::fromUtf8("可视柜台终端应用版本更新记录")
-                                         , &MainWindow::VersionView));
-    helpMenu->addAction(CreateMenuAction(QString::fromUtf8("错误码对照表(&A)"), tr("Alt+E"), QString::fromUtf8("ErrorCode错误码对照表")
-                                         , &MainWindow::ErrorCodeView));
-}
-
-void MainWindow::ConfigApp()
-{
-    qDebug() << "Enter ConfigApp" << endl;
-#ifdef WITH_QT
-    std::string path = CSpShellConsole::GetRootConfigPath();
-    DialogInParam param;
-    param.rootIniPath = path.c_str();
-    DialogConfig dial(&param, this);
-#else
-    DialogInParam param;
-    param.rootIniPath = "D:\\Run\\hardwarecfg\\root.ini";
-    DialogConfig dial(&param, this);
-#endif
-    dial.exec();
-}
-
-void MainWindow::QuitApp()
-{
-    qDebug() << "Enter QuitApp" << endl;
-#ifdef WITH_QT
-    qApp->exit(APP_EXIT_CODE_QUIT); //or exit
-#else
-    exit(APP_EXIT_CODE_QUIT);
-#endif
-    qDebug() << "Leave QuitApp" << endl;
-}
-
-
-static void ClearArguments(const QString& program, QStringList& arguments)
-{
-    if (arguments.contains(program)) {
-        arguments.removeOne(program);
-    }
-    if (arguments.contains("--restart")) {
-        arguments.removeOne("--restart");
-    }
-    if (arguments.contains("-R")) {
-        arguments.removeOne("-R");
-    }
-    if (!arguments.contains("-Rwait")) {
-        arguments.append("-Rwait");
-    }
-}
-
-void MainWindow::RestartApp()
-{
-    qDebug() << "Enter RestartApp" << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    ClearArguments(program, arguments);
-
-    qDebug() << "Program: " << program << " " << arguments << " " << workingDirectory << endl;
-    bool result = QProcess::startDetached(program, arguments, workingDirectory, &nextProcID);
-    qDebug() << "Program result: " << result << " " << nextProcID;
-    QApplication::exit(APP_EXIT_CODE_RESTART_CURR);
-}
-
-void MainWindow::RestartSystem()
-{
-    QString str = "确定要重启系统吗?";
-    QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                           QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-    if (rb == QMessageBox::Yes) {
-        QProcess::startDetached("sudo shutdown -r now");
-    }
-}
-
-void MainWindow::ShutdownSystem()
-{
-    QString str = "确定要关机吗?";
-    QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                           QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-    if (rb == QMessageBox::Yes) {
-        QProcess::startDetached("sudo shutdown --poweroff now");
-    }
-}
-
-/**  该接口暂且放弃使用,因为使用QT创建子进程会继承文件句柄,改用 RestartAppThroughSpShell 与框架重启公用一套接口*/
-void MainWindow::RestartAppThroughActive()
-{
-    qDebug() << "Enter " << __FUNCTION__ << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    QString newProgrm = program;
-    QString newWorkingDirectory = workingDirectory;
-    QDir versionDir = QDir::current();
-    versionDir.cdUp();
-
-#if 0
-
-    QString activeFilePath = versionDir.filePath("active.txt");
-    QFile activeFile(activeFilePath);
-
-    if (!activeFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("文件 %1 不存在!").arg(activeFilePath));
-        return;
-    }
-
-    if (!activeFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
-        QMessageBox::critical(this, "错误", QString("打开文件 %1 失败:%2").arg(activeFilePath).arg(activeFile.errorString()));
-        return;
-    }
-
-    QByteArray versionContent = activeFile.readAll();
-    versionContent = versionContent.trimmed();
-    activeFile.close();
-
-    if (versionContent.isEmpty() || versionContent.isNull()) {
-        QMessageBox::critical(this, "错误", QString("文件 %1 内容为空!").arg(activeFilePath));
-        return;
-    }
-
-    QStringList programPaths = program.split("/");
-
-
-    QString curVersion = programPaths[programPaths.size() - 3];
-    if (curVersion == QString(versionContent)) {
-        qDebug() << "Detect is the same version: " << (QString)versionContent;
-    } else {
-        qDebug() << "Detect diff version, from " << curVersion << " to " << (QString)versionContent;
-
-        programPaths.replace(programPaths.size() - 3/*x.y.z/bin/spshell*/, versionContent);
-        newProgrm = programPaths.join("/");
-        QStringList workingPaths = workingDirectory.split("/");
-        workingPaths.replace(workingPaths.size() - 1/*/x.y.z*/, versionContent);
-        newWorkingDirectory = workingPaths.join("/");
-    }
-
-#else
-
-    QString scriptFilePath = versionDir.filePath(STARTUP_SCRIPT);
-    QFile scriptFile(scriptFilePath);
-    if (!scriptFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("启动脚本 %1 不存在!").arg(scriptFilePath));
-        return;
-    }
-    auto permitt = scriptFile.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                             | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                             | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                             | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-    if (!permitt) {
-        QMessageBox::critical(this, "错误", QString("设置 %1 文件权限失败:%2!").arg(scriptFilePath).arg(scriptFile.errorString()));
-        return;
-    }
-
-    newProgrm = scriptFilePath;
-    newWorkingDirectory = versionDir.currentPath();
-
-#endif
-
-    ClearArguments(program, arguments);
-
-    qunsetenv("LD_LIBRARY_PATH");
-    qDebug() << "newProgrm: " << newProgrm << " " << arguments << " " << newWorkingDirectory << endl;
-    bool result = QProcess::startDetached(newProgrm, arguments, newWorkingDirectory, &nextProcID);
-    qDebug() << "Program result: " << result << " " << nextProcID;
-    QApplication::exit();
-}
-
-void MainWindow::RestartAppThroughSpShell()
-{
-    qDebug() << "Enter " << __FUNCTION__ << endl;
-    qint64 nextProcID(0);
-    QString program = QApplication::applicationFilePath();
-    QStringList arguments = QApplication::arguments();
-    QString workingDirectory = QDir::currentPath();
-
-    QString newProgrm = program;
-    QString newWorkingDirectory = workingDirectory;
-    QDir versionDir = QDir::current();
-    versionDir.cdUp();
-
-    QString scriptFilePath = versionDir.filePath(STARTUP_SCRIPT);
-    QFile scriptFile(scriptFilePath);
-    if (!scriptFile.exists()) {
-        QMessageBox::critical(this, "错误", QString("启动脚本 %1 不存在!").arg(scriptFilePath));
-        return;
-    }
-    auto permitt = scriptFile.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner
-                                             | QFileDevice::ReadUser | QFileDevice::WriteUser | QFileDevice::ExeUser
-                                             | QFileDevice::ReadGroup | QFileDevice::ReadOther
-                                             | QFileDevice::ExeGroup | QFileDevice::ExeOther);
-    if (!permitt) {
-        QMessageBox::critical(this, "错误", QString("设置 %1 文件权限失败:%2!").arg(scriptFilePath).arg(scriptFile.errorString()));
-        return;
-    }
-
-#ifdef WITH_QT
-    int result = CSpShellConsole::RestartApplication();
-    if (result != 0) {
-        QMessageBox::critical(this, "错误", QString("执行重启请求失败!"));
-        return;
-    }
-#endif
-    QApplication::exit(APP_EXIT_CODE_RESTART_ACTIVE);
-}
-
-void MainWindow::InitializeTerminal()
-{
-    LogView();
-}
-
-void MainWindow::LogView()
-{
-    qDebug() << "Enter LogView" << endl;
-    auto enti = GetCurrentSelectedEntity();
-#ifdef WITH_QT
-    if (!enti.entityName.isEmpty()) {
-        std::string path = CSpShellConsole::GetEntityLogPath(Q2Str(enti.entityName).c_str());
-        TextFinder textFinder(Str2Q(path), enti.entityName, this);
-        textFinder.exec();
-    }
-#endif
-}
-
-void MainWindow::ErrorCodeView()
-{
-
-    qDebug() << "Enter ErrorCodeView" << endl;
-#if 1
-    DialogAppVersion dial(QLatin1String(":/res/sys_errcode.html"), ("系统错误码对照表"), this);
-    dial.exec();
-#else
-    TextEdit mw;
-    QDesktopWidget* desk = QApplication::desktop();
-    const int curScreenIdx = desk->primaryScreen();
-    QRect rect = desk->screenGeometry(curScreenIdx);
-    const int wd = rect.width();
-    const int ht = rect.height();
-    mw.resize(wd / 2, (ht * 2) / 3);
-    mw.move((wd - mw.width()) / 2,
-            (ht - mw.height()) / 2);
-
-    mw.setContents(QLatin1String(":/res/sys_errcode.html"));
-    mw.show();
-#endif
-
-    //TextEdit textEdit(this);
-    //textEdit.setContents(":/res/sys_errcode.html");
-    //textEdit.show();
-}
-
-void MainWindow::RemoveEntityRuninfoConfigFile()
-{
-    auto enti = GetCurrentSelectedEntity();
-#ifdef WITH_QT
-    if (!enti.entityName.isEmpty()) {
-        std::string path = CSpShellConsole::GetEntityRTPath(Q2Str(enti.entityName).c_str());
-        if (!path.empty()) {
-            QFile file(path.c_str());
-            if (file.exists()) {
-                QString str = QString("确定要删除 %1 实体运行时文件?").arg(enti.entityName);
-                QMessageBox::StandardButton rb = QMessageBox::question(NULL, "Warning", str,
-                                                                       QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
-                if (rb == QMessageBox::Yes) {
-                    if (QFile::remove(path.c_str())) {
-                        QMessageBox::information(this, "提示", "删除成功!请重启应用或实体以立即生效!");
-                    } else {
-                        QMessageBox::warning(this, "错误", QString("%1: 删除运行时文件 %2 失败!")
-                                             .arg(enti.entityName).arg(path.c_str()));
-                    }
-                }
-            } else {
-                QMessageBox::warning(this, "提示", QString("%1: %2 运行时文件不存在!").arg(enti.entityName).arg(path.c_str()));
-            }
-        } else {
-            QMessageBox::critical(this, "错误", QString("%1: 获取运行时文件路径失败!").arg(enti.entityName));
-        }
-    } else {
-        QMessageBox::critical(this, "错误", "无法获取实体名称,请选中实体列表所在行!");
-    }
-#endif
-}
-
-void MainWindow::VersionView()
-{
-    qDebug() << "Enter VersionView" << endl;
-    DialogAppVersion dial(QLatin1String(":/res/version_history.html"), ("关于可视柜台终端应用程序"), this);
-    dial.exec();
-}
-
-void MainWindow::DisplayEntities()
-{
-
-    EntityState filterState = EntityState(ui->comboBoxStatus->currentIndex());
-    QString str = MappingSatus2String(filterState);
-
-    if (filterState == All)
-        str = "";
-
-    auto entities = ui->tableWidgetEntities->findItems(str, Qt::MatchExactly);
-    const int rows = ui->tableWidgetEntities->rowCount();
-    qDebug() << "Enter DisplayEntities " << str << " " << rows << "!" << endl;
-    for (int i = 0; i < rows; ++i) {
-        const auto strStatus = ui->tableWidgetEntities->item(i, ENTITY_COLUMN_STATUS)->text();
-        ui->tableWidgetEntities->setRowHidden(i, !str.isEmpty() && strStatus.compare(str) != 0);
-    }
-}
-
-void MainWindow::ResetAllEntityOperateBtnState(bool enable)
-{
-    ui->pushButtonEntStart->setEnabled(enable);
-    ui->pushButtonEntClose->setEnabled(enable);
-    ui->pushButtonEntPause->setEnabled(enable);
-    ui->pushButtonEntContinue->setEnabled(enable);
-    ui->pushButtonEntKill->setEnabled(enable);
-    ui->pushButtonEntTest->setEnabled(enable);
-}
-
-void MainWindow::StartEntityFromCustom(const QString& entityName, const QString& cmdLine)
-{
-    qDebug() << "Enter StartEntityFromCustom " << entityName << " " << cmdLine << "!" << endl;
-
-    const int entityRow = FindEntityRowIndex(entityName);
-    EntityInfo entityInfo = GetEntityInfoByRowIndex(entityRow);
-    if (entityInfo.IsValid()) {
-        const auto curState = entityInfo.state;
-        if (curState != NoStart && curState != Killed && curState != Close) {
-            QString str = QString("%1 实体目前处于运行状态,是否要强制重启?").arg(entityName);
-            QMessageBox::StandardButton rb = QMessageBox::question(this, "确认", str,
-                                                                   QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
-            if (rb == QMessageBox::Yes) {
-                const int result = DealWithEntity(entityInfo, Deal_Kill, "", false);
-                if (result != 0) {
-                    QMessageBox::critical(this, "错误", QString("终止旧实体例程 %1 失败!").arg(entityInfo.entityName));
-                    return;
-                }
-            } else {
-                return;
-            }
-        }
-    }
-
-    Threadee* nE = new Threadee();
-    nE->dealType = Deal_Start;
-    nE->entityName = entityName;
-    nE->cmdLine = cmdLine;
-    OperatThread* ot = new OperatThread(nE, nullptr);
-    connect(ot, &QThread::finished, ot, &QObject::deleteLater);
-    connect(ot, &OperatThread::OperateResult, this, &MainWindow::ReceiveCustomOperatResult);
-    ot->start();
-}
-
-void MainWindow::UpdateEntityOperateBtnState(EntityState currState)
-{
-    switch (currState) {
-    case Idle:
-        ResetAllEntityOperateBtnState();
-        ui->pushButtonEntStart->setEnabled(false);
-        ui->pushButtonEntContinue->setEnabled(false);
-        break;
-    case NoStart:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntStart->setEnabled(true);
-        break;
-    case Starting:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Busy:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Pause:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntContinue->setEnabled(true);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case UnLoading:
-        ResetAllEntityOperateBtnState(false);
-        break;
-    case Lost:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntKill->setEnabled(true);
-        break;
-    case Close:
-    case Killed:
-        ResetAllEntityOperateBtnState(false);
-        ui->pushButtonEntStart->setEnabled(true);
-        break;
-    case Passed:
-    case Failed:
-        ResetAllEntityOperateBtnState();
-        ui->pushButtonEntStart->setEnabled(false);
-        ui->pushButtonEntContinue->setEnabled(false);
-        break;
-    default:
-        ResetAllEntityOperateBtnState(false);
-    }
-}
-
-void MainWindow::EntitySelectionChanged()
-{
-    const QTableWidgetItem* currentItem = ui->tableWidgetEntities->currentItem();
-    qDebug() << QString("Enter EntitySelectionChanged: ") << currentItem->text();
-    //ShowMessage(currentItem->text(), 0);
-    UpdateEntityOperateBtnState(GetCurrentSelectedEntity().state);
-}
-
-void MainWindow::SortEntityItem(int n)
-{
-    static bool sortStatus[MAX_ENTITY_LIST_COLUMN] = { false };
-    ui->tableWidgetEntities->sortItems(n, (sortStatus[n] ? Qt::AscendingOrder : Qt::DescendingOrder));
-    sortStatus[n] = !sortStatus[n];
-}
-
-QTableWidgetItem* MainWindow::FindEnityWidgetItem(QString entityName)
-{
-    auto entities = ui->tableWidgetEntities->findItems(entityName, Qt::MatchExactly);
-    if (entities.count() > 0)
-        return entities[0];
-    return nullptr;
-}
-
-int MainWindow::FindEntityRowIndex(QString entityName)
-{
-    int result = -1;
-    auto item = FindEnityWidgetItem(entityName);
-    if (item)
-        result = item->row();
-    return result;
-}
-
-void MainWindow::RemindEntityStateChangeWith(QString entityName, bool bEnd)
-{
-    const int row = FindEntityRowIndex(entityName);
-    if (row >= 0) {
-        qDebug() << entityName << " " << bEnd << endl;
-        if (bEnd)
-            UpdateItemBackgroundColor(row, MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()));
-        else
-            UpdateItemBackgroundColor(row, Idle);
-    }
-}
-
-void MainWindow::RemindEntityStateChange(int row, EntityState previousState, EntityState currState)
-{
-    UpdateItemBackgroundColor(row, currState);
-#ifndef  NDEBUG
-    if (currState == Lost) {
-        QString info("Entity ");
-        QString entity(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text());
-        info.append(entity);
-        info += " 's State from ";
-        info += MappingSatus2String(previousState);
-        info += " to ";
-        info += MappingSatus2String(currState);
-        Note(info, EntityFire, entity, true);
-    }
-#endif //NDEBUG
-    (new RichTimer(this, ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text()));
-}
-
-void MainWindow::TriggerEntityState(int row, EntityState state, int pid, bool filcker)
-{
-    const EntityState previousState = MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text());
-    if (pid == -1/*for entity reset*/ && (previousState != Passed && previousState != Failed)) {
-        return;
-    }
-    ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->setText(MappingSatus2String(state));
-    if (state == Close || state == NoStart) {
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->setText("0");
-    } else if (pid > 0) {
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->setText(QString::number(pid));
-    }
-    if ((state == Idle) && (previousState == NoStart
-                            || previousState == Starting
-                            || previousState == UnLoading
-                            || previousState == Lost
-                            || previousState == Close
-                            || previousState == Killed
-                            )) {
-        QDateTime currentTime = QDateTime::currentDateTime();
-        QString currentTimeStr = currentTime.toString("MM-dd-hh:mm:ss.zzz");
-        ui->tableWidgetEntities->item(row, ENTITY_COLUMN_BOOTTIME)->setText(currentTimeStr);
-    }
-
-    if (state != previousState) {
-        if (state == Idle) {
-            mIdleEntityCount++;
-        } else if (previousState == Idle) {
-            mIdleEntityCount--;
-        }
-        UpdateEntityStatistics();
-    }
-
-    if (filcker) {
-        RemindEntityStateChange(row, previousState, state);
-        ui->tableWidgetEntities->setCurrentItem(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME));
-        qDebug() << "emit entity select change." << endl;
-        emit ui->tableWidgetEntities->itemSelectionChanged();
-    } else {
-        RemindEntityStateChangeWith(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text(), true);
-    }
-}
-
-int MainWindow::TriggerEntityState(QTableWidgetItem* item, EntityState state, int pid, bool flicker)
-{
-    if (!item)
-        return -1;
-    TriggerEntityState(item->row(), state, pid, flicker);
-    return 0;
-}
-
-int MainWindow::TriggerEntityState(QString entityName, EntityState state, int pid, bool flicker)
-{
-    const int row = FindEntityRowIndex(entityName);
-    if (row >= 0) {
-        TriggerEntityState(row, state, pid, flicker);
-    }
-    return 0;
-}
-
-
-int MainWindow::DealWithEntity(const EntityInfo& entity, DealType dealType, QString extendParam, bool multiThread)
-{
-    qDebug() << "Deal with entity: " << entity.entityName << " with " << QString::number(dealType) << endl;
-
-    int result = -1;
-
-    if (!entity.entityName.isEmpty()) {
-        Threadee* nE = new Threadee();
-        nE->dealType = dealType;
-        nE->entityName = entity.entityName;
-        nE->cmdLine = extendParam;
-        OperatThread* ot = new OperatThread(nE, nullptr);
-
-        if (multiThread) {
-            if (dealType == Deal_Test) {
-                connect(ot, &OperatThread::OperateResult, this, &MainWindow::ReceiveOperatResult);
-            }
-            connect(ot, &QThread::finished, ot, &QObject::deleteLater);
-            ot->start();
-            result = -1 /*forbid changing entity state at screen*/;
-        } else {
-            bool ret = ot->doSomething();
-            result = ret ? 0 : -1;
-        }
-    }
-    return result;
-}
-
-void MainWindow::StartEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Start);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Idle, 8888);
-    }
-}
-
-void MainWindow::PauseEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Pause);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Pause);
-    }
-}
-
-void MainWindow::ContinueEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Continue);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Idle);
-    }
-}
-
-void MainWindow::TerminateEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Close);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Close);
-    }
-}
-
-void MainWindow::KillEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Kill);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Killed);
-    }
-}
-
-void MainWindow::TestEntity()
-{
-    int optResult = DealWithEntity(GetCurrentSelectedEntity(), Deal_Test);
-    if (optResult == 0) {
-        TriggerEntityState(GetCurrentSelectedEntity().entityName, Passed);
-    }
-}
-
-QString MainWindow::GetPerfStorePath()
-{
-#ifdef WITH_QT
-        std::string path = CSpShellConsole::GetTempPath();
-#else
-        std::string path = "C:\\rvc\\temp";
-#endif
-
-        if (!path.empty()) {
-            QDir tempDir(path.c_str());
-            tempDir.mkpath(QString("perf"));
-            if (tempDir.cd("perf")) {
-                return tempDir.absolutePath();
-            } else {
-                qDebug() << "cd " << tempDir.path() << " failed";
-                return QString(path.c_str());
-            }
-        }
-}
-
-QStringList MainWindow::ExecuteShellScripts(QString shellCmd)
-{
-    QStringList results;
-    QProcess* subScriptsProcess = new QProcess(this);
-    subScriptsProcess->setProcessChannelMode(QProcess::MergedChannels);
-    subScriptsProcess->start("sh", QStringList() << "-c" << shellCmd);
-    subScriptsProcess->waitForFinished();
-    QString str(subScriptsProcess->readAllStandardOutput());
-    results << str;
-    results << QString::number(subScriptsProcess->exitCode());
-    QMessageBox::warning(this, "Run ShellScripts Info", results.join("\t"), QMessageBox::Ok);
-    delete subScriptsProcess;
-    return QStringList() << str;
-}
-
-void MainWindow::RecordEntitySnapshot()
-{
-    qDebug() << "Enter " << __FUNCTION__;
-
-#if 0
-    QPixmap p = mPerformWidge->grab();
-    QString filePathName = GetPerfStorePath();
-    filePathName += "/EntityPerf_";
-    filePathName += QDateTime::currentDateTime().toString("yyyyMMdd-hhmmsszzz");
-    filePathName += ".png";
-    if (!p.save(filePathName, "png")) {
-        qDebug() << "save widget screen failed";
-    }
-#endif
-
-    ExportEntityInfo(false);
-}
-
-void MainWindow::ExportEntityInfo(bool fromBtnClick)
-{
-    QTableWidget* table = ui->tableWidgetEntities;
-    QString fileName;
-
-    if (fromBtnClick) {
-        fileName = QFileDialog::getSaveFileName(table,
-                                                "保存"
-                                                , QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation)
-                                                , "文本文件(*.txt)");
-    } else {
-        QDir tempDir(GetPerfStorePath());
-        QDateTime currTime = QDateTime::currentDateTime();
-        QString currTimeString = currTime.toString("yyyyMMdd");
-        QString filePureName = currTimeString + "_EntityInfo.txt";
-        fileName = tempDir.filePath(filePureName);
-        qDebug() << "entity info file path: " << fileName;
-    }
-
-    QFile file(fileName);
-    if (!file.open(fromBtnClick ? (QIODevice::ReadWrite | QIODevice::Text) : (QIODevice::ReadWrite | QIODevice::Append))) {
-        if (fromBtnClick) QMessageBox::warning(this, tr("错误"), tr("<font size='12' color='red'>打开文件失败,数据保存失败!</font>"));
-        else qDebug() << "打开文件失败,数据保存失败! " << file.errorString();
-        return;
-
-    }
-
-    if (!file.isReadable()) {
-        if (fromBtnClick) QMessageBox::warning(this, tr("错误"), tr("<font size='12' color='red'>该文件不可读,数据保存失败!</font>"));
-        else qDebug() << "该文件不可读,数据保存失败! " << file.errorString();
-
-    } else {
-
-        QTextStream out(&file);
-        // const int colCounts = table->columnCount();
-        const int rowCounts = table->rowCount();
-
-        for (int i = 0; i < rowCounts; ++i) {
-            const EntityInfo entityInfo = GetEntityInfoByRowIndex(i);
-            EntityRunInfo entityRunInfo(entityInfo);
-            entityRunInfo.startupTimeStr = ui->tableWidgetEntities->item(i, ENTITY_COLUMN_BOOTTIME)->text();
-            entityRunInfo.fds = PerformWidget::GetProcessFds(entityRunInfo.pid);
-            if (i == 0) {
-                QString currentTime = QDateTime::currentDateTime().toString("yyyy.MM.dd hh:mm:ss.zzz");
-                QString timestamp = QString("\n\nRecord at: %1\n").arg(currentTime);
-                file.write(timestamp.toUtf8());
-                QString header = EntityInfoHeaderString();
-                file.write(header.toUtf8());
-            }
-            QString str = "\n";
-            str += EntityRunInfoToString(entityRunInfo);
-            file.write(str.toUtf8());
-        }
-
-        if (fromBtnClick) QMessageBox::warning(this, tr("信息"), tr("<font size='12' color='green'>实体信息保存成功!</font>"));
-        else qDebug() << "实体信息保存成功!";
-    }
-
-    file.close();
-}
-
-void MainWindow::ExportEntitySnapshot()
-{
-    ExportEntityInfo(true);
-}
-
-
-void MainWindow::Test_EventLog()
-{
-    {
-        for (int i = 0; i < 100; ++i) {
-            QString str = QString(("我是第%1串字符串字符串字符串字-------符串字符串"
-                                   "字符串字-------符串字符串字串字-------符符串字符"
-                                   "串字符串串字-------符字串字符字串字符字串字符字串"
-                                   "字符字串字符字串字-------符符串字串字-------符符"
-                                   "串字符串字串字-------符符串字符串字符串")).arg(i);
-            QtMessageInfo info{ (MessageType)(int)(i % int(MsgTypeMax)) , str,0, 0 };
-            InsertConsole(info);
-        }
-
-    }
-}
-
-EntityInfo MainWindow::GetEntityInfoByRowIndex(int row)
-{
-    if (row == -1)
-        return (EntityInfo{ "", Manual, NoStart, 0, "" });
-
-    return EntityInfo{ ui->tableWidgetEntities->item(row, ENTITY_COLUMN_NAME)->text(), MappingString2StartType(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()),
-                MappingString2Status(ui->tableWidgetEntities->item(row, ENTITY_COLUMN_STATUS)->text()),
-                ui->tableWidgetEntities->item(row, ENTITY_COLUMN_PID)->text().toInt(), ui->tableWidgetEntities->item(row, ENTITY_COLUMN_VERSION)->text() };
-}
-
-EntityInfo MainWindow::GetCurrentSelectedEntity()
-{
-    const QTableWidgetItem* currentItem = ui->tableWidgetEntities->currentItem();
-    if (currentItem) {
-        auto item = GetEntityInfoByRowIndex(currentItem->row());
-        return item;
-    }
-    return GetEntityInfoByRowIndex(-1);
-
-}
-
-void MainWindow::AddEntityEntry(const EntityInfo& entityInst)
-{
-    const int currCows = ui->tableWidgetEntities->rowCount();
-
-    ui->tableWidgetEntities->insertRow(currCows);
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_NAME, new QTableWidgetItem(entityInst.entityName));
-    //ui->tableWidgetEntities->setItem(currCows, 1, new QTableWidgetItem(MappingStartType2String(entityInst.startType)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_STATUS, new QTableWidgetItem(MappingSatus2String(entityInst.state)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_PID, new QTableWidgetItem(QString::number(entityInst.pid)));
-    ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_VERSION, new QTableWidgetItem(entityInst.version));
-
-    if (entityInst.state == Starting || entityInst.state == Idle) {
-        QDateTime currentTime = QDateTime::currentDateTime();
-        QString currentTimeStr = currentTime.toString("MM-dd-hh:mm:ss.zzz");
-        ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_BOOTTIME, new QTableWidgetItem(currentTimeStr));
-    } else {
-        ui->tableWidgetEntities->setItem(currCows, ENTITY_COLUMN_BOOTTIME, new QTableWidgetItem("未知"));
-    }
-
-    mTotalEntityCount++;
-    if (entityInst.state == Idle)
-        mIdleEntityCount++;
-    UpdateEntityStatistics();
-
-    UpdateItemBackgroundColor(currCows, entityInst.state);
-
-}
-
-void MainWindow::UpdateItemBackgroundColor(int row, EntityState state)
-{
-    const int columnCount = ui->tableWidgetEntities->columnCount();
-    auto curColor = MappingStatus2Color(state);
-    qDebug() << "uptate row background color" << endl;
-#if 0
-    for (int col = 0; col < columnCount; ++col) {
-        QTableWidgetItem* item = ui->tableWidgetEntities->item(row, col);
-        item->setBackground(QBrush(curColor));
-        //QPalette palette = item->palette();
-        //palette.setBrush(QPalette::Base, curColor);
-        //item->setPalette(palette);
-    }
-#else
-    setRowBackground(QBrush(curColor), ui->tableWidgetEntities->model(), row);
-#endif
-}
-
-void MainWindow::Test_EntityList()
-{
-
-    AddEntityEntry(EntityInfo{ "MobileDial", Manual, Idle, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "IEBrowser", Manual, NoStart, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "Browser", Manual, Lost, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HelloClient", Manual, Starting, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HelloService", Manual, Busy, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "PortbleScanner", Manual, Pause, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "HealthManager", Manual, UnLoading, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "MediaController", Manual, Close, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "GPIO", Manual, Killed, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "CardIssuer", Manual, Passed, 123, "V1.2.3" });
-    AddEntityEntry(EntityInfo{ "DeviceSwitch", Manual, Failed, 123, "V1.2.3" });
-
-
-    if (-1 != FindEntityRowIndex("NoExist")) {
-        QMessageBox::warning(this, "", "NoExist", QMessageBox::Ok);
-    }
-    if (1 == FindEntityRowIndex("MobileDial")) {
-        QMessageBox::warning(this, "", "NoExist", QMessageBox::Ok);
-    }
-}
-
-bool MainWindow::LoadPlguins()
-{
-    return false;
-}
-
-void MainWindow::LoadCustomPlguins()
-{
-#ifndef WITH_QT
-    static bool sw = false;
-    if (!sw) {
-        this->setWindowState(Qt::WindowMinimized);
-    } else {
-        this->setWindowState((this->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
-    }
-    sw = !sw;
-#else
-    bool result = LoadPlguins();
-    if (result) {
-
-    }
-#endif
-
-}
-
-void MainWindow::EntityItemContextMenu(QPoint pos)
-{
-    auto index = ui->tableWidgetEntities->indexAt(pos);
-    if (index.isValid()) {
-        mEntityPopMenu->exec(QCursor::pos()); // 菜单出现的位置为当前鼠标的位置
-    }
-}
-
-void MainWindow::InitEntitiesView()
-{
-    ui->labelEntCalculate->setText("");
-    ui->tableWidgetEntities->setColumnCount(MAX_ENTITY_LIST_COLUMN);
-    QStringList header;
-    header << "名称" << "状态" << "进程号" << "版本" << "最近启动时间";
-    ui->tableWidgetEntities->setHorizontalHeaderLabels(header);
-
-    ui->tableWidgetEntities->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
-    ui->tableWidgetEntities->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    ui->tableWidgetEntities->setSelectionBehavior(QAbstractItemView::SelectRows);
-    ui->tableWidgetEntities->setSelectionMode(QAbstractItemView::SingleSelection);
-    //ui->tableWidgetEntities->setSelectionModel(mEntitySelectedModel);
-    ui->tableWidgetEntities->verticalHeader()->hide();
-
-    ui->tableWidgetEntities->resizeColumnToContents(1);
-    ui->tableWidgetEntities->horizontalHeader()->setStretchLastSection(true);
-    ui->tableWidgetEntities->horizontalHeader()->setVisible(true);
-    ui->tableWidgetEntities->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
-    ui->tableWidgetEntities->setStyleSheet("selection-background-color:#1E90FF;");
-    connect(ui->tableWidgetEntities, SIGNAL(itemSelectionChanged()), this, SLOT(EntitySelectionChanged()));
-
-    /*
-    ui->tableWidgetEntities->setContextMenuPolicy(Qt::CustomContextMenu);
-    mEntityPopMenu = new QMenu(ui->tableWidgetEntities);
-    QAction *actionUpdateInfo = new QAction();
-    QAction *actionDelInfo = new QAction();
-    actionUpdateInfo ->setText(QString("修改"));
-    actionDelInfo ->setText(QString("删除"));
-    mEntityPopMenu->addAction(actionUpdateInfo);
-    mEntityPopMenu->addAction(actionDelInfo);
-
-    connect(ui->tableWidgetEntities, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(EntityItemContextMenu(QPoint)));
-    */
-
-    mEntityStateChangeReminder = new QTimer(this);
-    mEntityStateChangeReminder->setSingleShot(true);
-
-    //connect(mEntityStateChangeReminder, SIGNAL(timeout()),this, SLOT(RemindEntityStateChange()));
-}
-
-void MainWindow::InitStatusBar()
-{
-    mToolsTip = new QLabel("", this);
-    QFont ft;
-    ft.setPointSize(10);
-    mToolsTip->setFont(ft);
-
-    QPalette pa;
-    pa.setColor(QPalette::WindowText, QColor(105, 105, 105));
-    mToolsTip->setPalette(pa);
-    mToolsTip->setStyleSheet("QLabel {padding: 0px 1px 2px 2px;}");
-
-    statusBar()->addPermanentWidget(mToolsTip);
-
-    TimeDateTimer* timer = new TimeDateTimer(this);
-    timer->Start(1000);
-
-    //mStatusLabel = new MLabel(this);
-    //mStatusLabel->setStyleSheet("QLabel {padding: -10px 2px 2px 1px;}");
-    //statusBar()->addWidget(mStatusLabel);
-}
-
-void MainWindow::TimeUpdate(const QString& timeStr)
-{
-    //qDebug() << "enter TimeUpdate" << endl;
-    mToolsTip->setText(timeStr);
-}
-
-void MainWindow::ShowStatusMessage(QString message, int messageType)
-{
-    Q_UNUSED(messageType);
-    //statusBar()->setStyleSheet("color:green");
-
-    QFontMetrics fontMetrics(statusBar()->font());
-    int fontSize = fontMetrics.width(message);
-    if (fontSize > statusBar()->width()) {
-        message = fontMetrics.elidedText(message, Qt::ElideRight, statusBar()->width());
-    }
-    statusBar()->showMessage(message);
-
-    //mStatusLabel->setText(message);
-}
-
-void MainWindow::OnTrayIconActivated(QSystemTrayIcon::ActivationReason activeRson)
-{
-    switch (activeRson) {
-        // 单击托盘显示窗口
-    case QSystemTrayIcon::Trigger:
-    {
-        showNormal();
-        raise();
-        activateWindow();
-        break;
-    }
-    // 双击
-    case QSystemTrayIcon::DoubleClick:
-    {
-        // ...
-        break;
-    }
-    default:
-        break;
-    }
-}
-
-void MainWindow::messageClicked()
-{
-#ifndef WITH_QT
-    QMessageBox::information(nullptr, tr("Systray"),
-                             tr("Sorry, I already gave what help I could.\n"
-                                "Maybe you should try asking a human?"));
-#endif
-}
-
-void MainWindow::InitSystemTrayIcon()
-{
-    if (QSystemTrayIcon::supportsMessages() && mSicon == nullptr) {
-        mSicon = new QSystemTrayIcon(this);
-        QMenu* menusystemTray = new QMenu(this);
-        menusystemTray->addAction(tr("Show/Hide"));
-        menusystemTray->addAction(tr("About"));
-        menusystemTray->addAction(tr("Quit"));
-        mSicon->setIcon(QIcon(":/res/FavIcon.ico"));
-        mSicon->setToolTip(QString::fromUtf8("RVC Terminal Manager"));
-        mSicon->setContextMenu(menusystemTray);
-        connect(mSicon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(OnTrayIconActivated(QSystemTrayIcon::ActivationReason)));
-        connect(mSicon, &QSystemTrayIcon::messageClicked, this, &MainWindow::messageClicked);
-        mSicon->show();
-
-    }
-}
-
-void MainWindow::Note(QString info, NoteSrcType srcType, QString srcEntity, bool bForce)
-{
-    qDebug() << "Note: " << srcEntity << " " << info << endl;
-
-#ifdef WITH_QT
-    if (mSicon && (bForce || CanDisturb())) {
-        if (srcEntity.isEmpty()) srcEntity = RVC_TITLE_STRING;
-        int showDelayTime = 10000;
-        if (srcType == BootStage) {
-            showDelayTime = 15000;
-        }
-        QSystemTrayIcon::MessageIcon msgIcon = QSystemTrayIcon::MessageIcon(QSystemTrayIcon::Critical);
-        mSicon->showMessage(srcEntity, info, msgIcon, showDelayTime);
-    }
-#endif
-}
-
-void MainWindow::closeEvent(QCloseEvent* event)
-{
-    showMinimized();
-    event->ignore();
-}
-
-namespace
-{
-QString CoverWithTimePrefix(QString content)
-{
-    QDateTime time = QDateTime::currentDateTime();
-    QString buffer = time.toString("[hh:mm:ss]");
-    QString result = QString("%1 %2").arg(buffer).arg(content);
-    return result;
-}
-}
-
-void MainWindow::ReceiveMessage(const QtMessageInfo* message)
-{
-    if (!InsertConsole(*message)) {
-        QBaseListWidgetItem* item = new QConsoleListWidgetItem(CoverWithTimePrefix(message->content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    }
-}
-
-void MainWindow::ReceiveEntityVariant(QVariant info)
-{
-    QEntityActiveInfo entityInfo = info.value<QEntityActiveInfo>();
-    int localEntityIndex = -1;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if (mBootEntitiesInfo.at(i).entityName == entityInfo.entityName) {
-            localEntityIndex = i;
-            break;
-        }
-    }
-    if (localEntityIndex != -1) {
-        if (mBootEntitiesInfo[localEntityIndex].entityState != entityInfo.entityState) {
-            const auto currState = entityInfo.entityState;
-            mBootEntitiesInfo[localEntityIndex].entityState = currState;
-            TriggerEntityState(entityInfo.entityName, currState, entityInfo.entityPID);
-        }
-    } else {
-        EntityBootInfo newEntityInfo;
-        newEntityInfo.entityName = entityInfo.entityName;
-        newEntityInfo.entityState = entityInfo.entityState;
-        mBootEntitiesInfo.push_back(newEntityInfo);
-
-        AddEntityEntry(EntityInfo{ entityInfo.entityName, Manual,
-                       entityInfo.entityState, entityInfo.entityPID, entityInfo.entityVerStr });
-    }
-}
-
-void MainWindow::ReceiveCustomOperatResult(int action, int result, const QString& message)
-{
-    qDebug() << "deal with custom operation result: " << message << " result " << result << endl;
-}
-
-void MainWindow::ReceiveOperatResult(int action, int result, const QString& message)
-{
-    qDebug() << "deal with operation result: " << message << " result " << result << endl;
-    for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-        if (mBootEntitiesInfo.at(i).entityName == message) {
-            const auto& entityInfo = mBootEntitiesInfo.at(i);
-            (new EntityStateRecoverTimer(this, entityInfo.entityName, entityInfo.entityState));
-            TriggerEntityState(entityInfo.entityName, result == 0 ? Passed : Failed, 0);
-            break;
-        }
-    }
-}
-
-void MainWindow::UpdateEntityStatistics()
-{
-    QString text = QString("(正在运行%1个模块,其中%2个正常)").arg(mTotalEntityCount).arg(mIdleEntityCount);
-    qDebug() << mTotalEntityCount << " " << mIdleEntityCount;
-    qDebug() << text;
-    ui->labelEntCalculate->setText(text);
-}
-
-void MainWindow::NotifyLogMessage(MessageType type, const QString& title, const QString& message)
-{
-    QString contentMessage = message;
-    QJsonParseError parseError;
-    QJsonDocument jsonDoc = QJsonDocument::fromJson(message.toUtf8(), &parseError);
-    if (parseError.error == QJsonParseError::NoError) {
-        QJsonObject jsonObject = jsonDoc.object();
-        if (jsonObject.contains(QStringLiteral("errmsg"))) {
-            contentMessage = jsonObject["errmsg"].toString();
-        }
-    }
-
-    if (CanDisturb()) {
-        switch (type) {
-        case TextNotifyInfo:
-            QMessageBox::information(this, title, contentMessage);
-            break;
-        case TextNotifyWarn:
-            QMessageBox::warning(this, title, contentMessage);
-            break;
-        case TextNotifyError:
-            QMessageBox::critical(this, title, contentMessage);
-            break;
-        default:
-            break;
-        }
-    } else {
-        ShowStatusMessage(contentMessage, type);
-    }
-}
-
-
-static bool GetInterestPointWithRegex(const QString& origin, QString& entiName, QString& content)
-{
-    QRegExp rx("^\\[(\\D+)\\]\\s{0,1}(E|W|F|I|D|T):\\s{0,1}\\{(.*)\\}\\(sc:(0x[A-Za-z0-9]+),\\s{0,1}uc:(0x[A-Za-z0-9]+)\\)$");
-    const int pos = rx.indexIn(origin);
-    if (pos > -1) {
-        entiName = rx.cap(1);
-        content = rx.cap(3);
-        QString systemCode = rx.cap(4);
-        QString userCode = rx.cap(5);
-        return true;
-    }
-    return false;
-}
-
-bool MainWindow::InsertConsole(const QtMessageInfo& message)
-{
-    QString content = message.content; //FakeUnicodeToUnicode(message.content);
-    bool dealed = true;
-    if (message.type == TextNormal || message.type == TextEvent) {
-        QBaseListWidgetItem* item = new QConsoleListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextWarn) {
-        QBaseListWidgetItem* item = new QLightWarnListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextError) {
-        QBaseListWidgetItem* item = new QLightErrorListWidgetItem(CoverWithTimePrefix(content));
-        item->AppentToWidget(ui->listWidgetEventLog);
-    } else if (message.type == TextFatal || message.type == TextBlock
-               || (message.type >= TextNotifyInfo && message.type <= TextNotifyError)) {
-        QString entityName;
-        const int  existIdx = content.indexOf(":][:");
-        if (-1 != existIdx) {
-            entityName = content.mid(0, existIdx);
-            content = content.mid(existIdx + QString(":][:").length());
-        }
-        
-#ifndef WITH_QT
-        QBaseListWidgetItem* item2 = new QTipErrorListWidgetItem(CoverWithTimePrefix(content));
-        item2->AppentToWidget(ui->listWidgetFatalLog);
-#endif
-        
-        if (message.type == TextFatal || message.type == TextBlock) {
-            if (-1 == existIdx) { GetInterestPointWithRegex(content, entityName, content); }
-#ifndef  NDEBUG
-            Note(content, BootStage, entityName, true);
-#endif //NDEBUG
-        } else {
-#ifdef WITH_QT
-            NotifyLogMessage(message.type, entityName, content);
-#endif
-        }
-    } else {
-        dealed = false;
-    }
-    return dealed;
-}
-
-void MainWindow::ReceiveMessageVariant(QVariant info)
-{
-    QtMessageInfo message = info.value<QtMessageInfo>();
-    if (InsertConsole(message)) {
-        //empty
-    } else if (message.type == ModBootInfo) { //entity boot info
-        if (message.content.length() == 0 || message.param1 > Failed) {
-            return;
-        }
-
-        int localEntityIndex = -1;
-        for (int i = 0; i < mBootEntitiesInfo.size(); ++i) {
-            if (mBootEntitiesInfo.at(i).entityName == message.content) {
-                localEntityIndex = i;
-                break;
-            }
-        }
-        if (localEntityIndex != -1) {
-            if (mBootEntitiesInfo[localEntityIndex].entityState != message.param1) {
-                // const auto previousState = mBootEntitiesInfo[localEntityIndex].entityState;
-                const auto currState = static_cast<EntityState>(message.param1);
-                mBootEntitiesInfo[localEntityIndex].entityState = currState;
-
-                TriggerEntityState(message.content, currState, 0);
-            }
-        } else {
-            EntityBootInfo newEntityInfo;
-            newEntityInfo.entityName = message.content;
-            newEntityInfo.entityState = static_cast<EntityState>(message.param1);
-            mBootEntitiesInfo.push_back(newEntityInfo);
-
-            AddEntityEntry(EntityInfo{ message.content, Manual, static_cast<EntityState>(message.param1), 123, "V1.2.3" });
-        }
-    } else if (message.type == ModStartupInfo) {
-        //ShowMessage(QString::fromLocal8Bit(message.content), message.type);
-        ShowStatusMessage(message.content, message.type);
-
-    } else if (message.type == DisplayShow) {
-        this->setWindowState((this->windowState() & ~Qt::WindowMinimized) | Qt::WindowActive);
-
-    } else if (message.type == DisplayHide) {
-        this->setWindowState(Qt::WindowMinimized);
-
-    } else if (message.type == StageChangeInfo) {
-        const bool oldSilent = mSilent;
-        if (message.param1 == FRAMEWORK_STATE_RUNNING
-            || message.param1 == FRAMEWORK_STATE_SERVING
-            || message.param1 == FRAMEWORK_STATE_NOTDISTURB
-            || message.param1 == FRAMEWORK_STATE_NOCONFIG) {
-            mSilent = true;
-        } else {
-            mSilent = false;
-        }
-        if (mSilent != oldSilent) {
-            OnSilentStateChange(mSilent);
-        }
-    }
-}
-
-bool MainWindow::CanDisturb() const
-{
-    if (!mSilent) {
-        return true;
-    }
-
-    Qt::WindowStates states = this->windowState();
-    if (!(states & Qt::WindowMinimized) && (states & Qt::WindowActive)) {
-        return true;
-    }
-
-    return false;
-}
-
-void MainWindow::OnSilentStateChange(bool beSilent)
-{
-
-}
-
-void MainWindow::InitFloatWidget()
-{
-    QDesktopWidget* desk = QApplication::desktop();
-    QRect rect = desk->screenGeometry(desk->primaryScreen());
-    const int wd = rect.width();
-    const int ht = rect.height();
-
-    mFloatWidget = new Widget();
-    mFloatWidget->show();
-
-}
-
-MainWindow::~MainWindow()
-{
-    delete ui;
-}
-
-void RichTimer::HandleTimeout(bool toStop)
-{
-    mTimes++;
-    mWin->RemindEntityStateChangeWith(mEntityName, toStop ? true : !(mTimes % 2));
-    if (toStop) {
-        killTimer(mTimerID);
-        delete this;
-    }
-}
-
-void EntityStateRecoverTimer::HandleTimeout()
-{
-    qDebug() << "reset entity state to " << MappingSatus2String(mState) << endl;
-    mWin->TriggerEntityState(mEntityName, mState, -1, false);
-    killTimer(mTimerID);
-    delete this;
-}
-
-void TimeDateTimer::Start(int interval)
-{
-    mTimer->start(interval);
-    connect(mTimer, SIGNAL(timeout()), this, SLOT(HandleTimeout()));
-}
-
-void TimeDateTimer::Stop()
-{
-    mTimer->stop();
-}
-
-void TimeDateTimer::HandleTimeout()
-{
-    mSeconds++;
-    if (mSeconds == 60) {
-        mMinutes++;
-        mSeconds = 0;
-    }
-    if (mMinutes == 60) {
-        mHours++;
-        mMinutes = 0;
-    }
-    if (mHours == 24) {
-        mDays++;
-        mHours = 0;
-    }
-    mWin->TimeUpdate(GetCurrentRunTimeString());
-}
-

+ 0 - 310
Framework/spshell/Widgets/mainwindow.h

@@ -1,310 +0,0 @@
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-#include <QDebug>
-#include <QItemSelectionModel>
-#include <QLabel>
-#include <QMainWindow>
-#include <QSortFilterProxyModel>
-#include <QSystemTrayIcon>
-#include <QTableWidget>
-#include <QTextEdit>
-#include <QTimer>
-#include <QTimerEvent>
-#include <QAction>
-#include <QSystemTrayIcon>
-#include <QAtomicInteger>
-
-#include "RvcSettings.h"
-#include "QRvcItemModel.hpp"
-#include "QtMessageInfo.h"
-
-#include "sysinfowidget.h"
-#include "cpuwidget.h"
-#include "performwidget.h"
-#include "memorywidget.h"
-#include "OperaThread.hpp"
-#include "mlabel.h"
-#include "floatwidget/widget.h"
-
-#define APP_EXIT_CODE_QUIT 0
-#define APP_EXIT_CODE_RESTART_CURR 1
-#define APP_EXIT_CODE_RESTART_ACTIVE 2
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class MainWindow; }
-QT_END_NAMESPACE
-
-
-class MainWindow;
-
-class RichTimer : public QObject
-{
-
-    Q_OBJECT
-public:
-    explicit RichTimer(MainWindow *parent, QString entityName)
-        :QObject((QObject*)parent)
-        ,mWin(parent)
-        ,mEntityName(entityName)
-        ,mTimes(0)
-    {
-        mTimerID = startTimer(300);
-    }
-    virtual void timerEvent(QTimerEvent *event)
-    {
-        if(event->timerId() == mTimerID){
-            HandleTimeout(mTimes == 7);
-        }
-    }
-private:
-    void HandleTimeout(bool toStop);
-    int mTimerID;
-    MainWindow* mWin;
-    QString mEntityName;
-    int mTimes;
-};
-
-class EntityStateRecoverTimer : public QObject
-{
-
-    Q_OBJECT
-public:
-    explicit EntityStateRecoverTimer(MainWindow *parent, QString entityName, EntityState restoreState)
-        :QObject((QObject*)parent)
-        ,mWin(parent)
-        ,mEntityName(entityName)
-        ,mState(restoreState)
-        ,mTimes(0)
-    {
-        mTimerID = startTimer(10000);
-    }
-    virtual void timerEvent( QTimerEvent *event)
-    {
-
-        if(event->timerId() == mTimerID) {
-            HandleTimeout();
-        }
-    }
-private:
-    void HandleTimeout();
-    int mTimerID;
-    MainWindow* mWin;
-    QString mEntityName;
-    EntityState mState;
-    int mTimes;
-};
-
-class TimeDateTimer : public QObject
-{
-    Q_OBJECT
-public:
-    explicit TimeDateTimer(QObject *parent = 0)
-        :QObject(parent)
-        ,mWin(reinterpret_cast<MainWindow*>(parent))
-        ,mDays(0),mHours(0),mMinutes(0),mSeconds(0){
-        mTimer = new QTimer(this);
-    }
-    ~TimeDateTimer(){Stop();}
-    void Start(int interval);
-    void Stop();
-
-private slots:
-        void HandleTimeout();
-
-private:
-    QString GetCurrentRunTimeString()
-    {
-        QString result;
-        if(mDays == 0)
-            result = QString(QStringLiteral("elapsed: %1:%2:%3")).arg(mHours,2,10,QLatin1Char('0'))
-                    .arg(mMinutes,2,10,QLatin1Char('0'))
-                    .arg(mSeconds,2,10,QLatin1Char('0'));
-        else
-            result = QString(QStringLiteral("elapsed: %1 day - %2:%3:%4")).arg(mDays,2,10,QLatin1Char('0'))
-                    .arg(mHours,2,10,QLatin1Char('0'))
-                    .arg(mMinutes,2,10,QLatin1Char('0'))
-                    .arg(mSeconds,2,10,QLatin1Char('0'));
-        return result;
-    }
-
-    MainWindow* mWin;
-    int mDays;
-    int mHours;
-    int mMinutes;
-    int mSeconds;
-    QTimer *mTimer;
-};
-
-enum ExecuteType {
-    CreatesSubProcess = 0,
-    BootEntity,
-    RunShellScript
-};
-
-
-
-class RvcAdditionAction : public QAction
-{
-public:
-    explicit RvcAdditionAction(QObject *parent = nullptr)
-        :QAction(parent) {}
-    explicit RvcAdditionAction(const QString &text, QObject *parent = nullptr)
-        :QAction(text, parent) {}
-    explicit RvcAdditionAction(const QIcon &icon, const QString &text, QObject *parent = nullptr)
-        :QAction(icon, text, parent) {}
-
-    struct AdditionMenuInfo {
-        ExecuteType type;
-        QString cmdLine;
-        QString entityName;
-    } userData;
-};
-
-class MainWindow : public QMainWindow
-{
-    Q_OBJECT
-
-public:
-    MainWindow(QWidget *parent = nullptr);
-    MainWindow(QString systemInfo, int totalEntityCount, QWidget *parent = nullptr);
-    ~MainWindow();
-
-    bool CanDisturb() const;
-
-protected:
-    void closeEvent(QCloseEvent *event) override;
-
-private:
-    void Init(QString title);
-    void Test_EntityList();
-    void Test_EventLog();
-    void InitMenuAction();
-    void InitStatusBar();
-    void InitEntitiesView();
-    void AddEntityEntry(const EntityInfo& entityInst);
-    void InitSystemTrayIcon();
-
-    int TriggerEntityState(QString entityName, EntityState state, int pid = 0, bool flicker = true);
-    int TriggerEntityState(QTableWidgetItem* item, EntityState state, int pid = 0, bool flicker = true);
-    void TriggerEntityState(int row, EntityState state, int pid, bool flicker = true);
-    int FindEntityRowIndex(QString entityName);
-
-    void ShowStatusMessage(QString message, int messageType);
-
-    int DealWithEntity(const EntityInfo& entity, DealType dealType, QString extendParam = "", bool multiThread = true);
-    void UpdateEntityOperateBtnState(EntityState currState);
-    void ResetAllEntityOperateBtnState(bool enable=true);
-    void StartEntityFromCustom(const QString& entityName, const QString& cmdLine);
-    bool LoadPlguins();
-    void OnSilentStateChange(bool beSilent);
-
-    void InitFloatWidget();
-
-public slots:
-    void ReceiveMessage(const QtMessageInfo* message);
-    void ReceiveMessageVariant(QVariant info);
-    void ReceiveEntityVariant(QVariant info);
-    void ReceiveOperatResult(int action, int result, const QString& message);
-    void ReceiveCustomOperatResult(int action, int result, const QString& message);
-
-    void EntityItemContextMenu(QPoint pos);
-private slots:
-
-    void LoadCustomPlguins();
-
-    void DisplayEntities();
-    void EntitySelectionChanged();
-
-    void StartEntity();
-    void PauseEntity();
-    void ContinueEntity();
-    void TerminateEntity();
-    void KillEntity();
-    void TestEntity();
-
-    void SortEntityItem(int n);
-    void RemindEntityStateChange(int row, EntityState previousState, EntityState currState);
-
-    void OnTrayIconActivated(QSystemTrayIcon::ActivationReason activeRson);
-
-    void ConfigApp();
-    void QuitApp();
-    void RestartApp();
-    void RestartSystem();
-    void ShutdownSystem();
-    void RestartAppThroughActive();
-    void RestartAppThroughSpShell();
-    void InitializeTerminal();
-    void VersionView();
-    void LogView();
-    void ErrorCodeView();
-    void RemoveEntityRuninfoConfigFile();
-
-    void TriggerAdditionMenu(QAction* action);
-    void ProcessStarted();
-    void GetSubProcessMsg();
-
-    void messageClicked();
-
-    void ExportEntitySnapshot();
-
-    void RecordEntitySnapshot();
-
-private:
-
-    EntityInfo GetCurrentSelectedEntity();
-    EntityInfo GetEntityInfoByRowIndex(int row);
-    QTableWidgetItem* FindEnityWidgetItem(QString entityName);
-    void UpdateItemBackgroundColor(int row, EntityState state);
-
-    enum NoteSrcType {
-      BootStage,
-      EntityFire
-    };
-    void Note(QString info, NoteSrcType srcType, QString srcEntity, bool bForce = false);
-
-    QAction* CreateMenuAction(QString text, QKeySequence keyShot, QString toolTipText, void (MainWindow::*)());
-    bool InsertConsole(const QtMessageInfo& message);
-    /*弹窗显示信息*/
-    void NotifyLogMessage(MessageType type, const QString& title, const QString& message);
-    void UpdateEntityStatistics();
-    void ExportEntityInfo(bool fromBtnClick);
-
-    QString GetPerfStorePath();
-
-    QStringList ExecuteShellScripts(QString shellCmd);
-    
-private:
-
-    Ui::MainWindow *ui;
-    RvcItemModel* mEntityModel;
-    QItemSelectionModel *mEntitySelectedModel;
-    QSortFilterProxyModel* mEntityFilterModel;
-    QLabel *mToolsTip;
-    MLabel* mStatusLabel;
-    QTimer *mEntityStateChangeReminder;
-    QMenu *mEntityPopMenu;
-    friend RichTimer;
-    friend EntityStateRecoverTimer;
-
-    void RemindEntityStateChangeWith(QString entityName, bool bEnd);
-    friend TimeDateTimer;
-    void TimeUpdate(const QString& timeStr);
-
-    CpuWidget mCpuWidget;
-    MemoryWidget mMemoryWidget;
-    PerformWidget* mPerformWidge;
-
-    QVector< EntityBootInfo> mBootEntitiesInfo;
-
-    QSystemTrayIcon *mSicon;
-    bool mSilent;
-
-    QAtomicInteger<quint32> mIdleEntityCount;
-    QAtomicInteger<quint32> mTotalEntityCount;
-
-    Widget* mFloatWidget;
-
-};
-#endif // MAINWINDOW_H

+ 0 - 570
Framework/spshell/Widgets/mainwindow.ui

@@ -1,570 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1068</width>
-    <height>720</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>RVC Terminal GUIConsole</string>
-  </property>
-  <widget class="QWidget" name="centralWidget">
-   <layout class="QHBoxLayout" name="horizontalLayout_2">
-    <item>
-     <widget class="QSplitter" name="splitterMain">
-      <property name="orientation">
-       <enum>Qt::Horizontal</enum>
-      </property>
-      <widget class="QTabWidget" name="tabWidget">
-       <property name="currentIndex">
-        <number>0</number>
-       </property>
-       <widget class="QWidget" name="tabEntityManagement">
-        <attribute name="title">
-         <string>实体管理</string>
-        </attribute>
-        <layout class="QGridLayout" name="horizontalLayout_18">
-         <item row="0" column="0">
-          <widget class="QSplitter" name="splitter">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <widget class="QWidget" name="layoutWidget1">
-            <layout class="QVBoxLayout" name="verticalLayoutListControl">
-             <property name="spacing">
-              <number>2</number>
-             </property>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout">
-               <property name="spacing">
-                <number>4</number>
-               </property>
-               <property name="sizeConstraint">
-                <enum>QLayout::SetDefaultConstraint</enum>
-               </property>
-               <property name="leftMargin">
-                <number>0</number>
-               </property>
-               <property name="topMargin">
-                <number>2</number>
-               </property>
-               <property name="bottomMargin">
-                <number>2</number>
-               </property>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntStart">
-                 <property name="sizePolicy">
-                  <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-                   <horstretch>0</horstretch>
-                   <verstretch>0</verstretch>
-                  </sizepolicy>
-                 </property>
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>启动实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_play_blue.png</normaloff>:/icons/res/fatcow/control_play_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="autoDefault">
-                  <bool>false</bool>
-                 </property>
-                 <property name="default">
-                  <bool>false</bool>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntClose">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>关闭实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_stop_blue.png</normaloff>:/icons/res/fatcow/control_stop_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="shortcut">
-                  <string>Ctrl+S</string>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntContinue">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>恢复实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_end_blue.png</normaloff>:/icons/res/fatcow/control_end_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntPause">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>暂停实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_pause_blue.png</normaloff>:/icons/res/fatcow/control_pause_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntKill">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>停止实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/control_power_blue.png</normaloff>:/icons/res/fatcow/control_power_blue.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntTest">
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>测试实体</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/lcd_tv_test.png</normaloff>:/icons/res/fatcow/lcd_tv_test.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonEntLogView">
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>查看实体日志</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/file_extension_log.png</normaloff>:/icons/res/fatcow/file_extension_log.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QPushButton" name="pushButtonClearRunCfg">
-                 <property name="minimumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="maximumSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="toolTip">
-                  <string>清除实体运行时文件</string>
-                 </property>
-                 <property name="text">
-                  <string/>
-                 </property>
-                 <property name="icon">
-                  <iconset resource="res.qrc">
-                   <normaloff>:/icons/res/fatcow/page_delete.png</normaloff>:/icons/res/fatcow/page_delete.png</iconset>
-                 </property>
-                 <property name="iconSize">
-                  <size>
-                   <width>32</width>
-                   <height>32</height>
-                  </size>
-                 </property>
-                 <property name="flat">
-                  <bool>true</bool>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>40</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-             <item>
-              <layout class="QHBoxLayout" name="horizontalLayout_17">
-               <property name="spacing">
-                <number>4</number>
-               </property>
-               <property name="sizeConstraint">
-                <enum>QLayout::SetDefaultConstraint</enum>
-               </property>
-               <property name="topMargin">
-                <number>2</number>
-               </property>
-               <property name="bottomMargin">
-                <number>2</number>
-               </property>
-               <item>
-                <widget class="QLabel" name="labelEntCalculate">
-                 <property name="styleSheet">
-                  <string notr="true">color:rgb(100, 100, 100)</string>
-                 </property>
-                 <property name="text">
-                  <string>(正在运行00个模块,其中00个正常)</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QLabel" name="labelStatus">
-                 <property name="text">
-                  <string>状态</string>
-                 </property>
-                </widget>
-               </item>
-               <item>
-                <widget class="QComboBox" name="comboBoxStatus"/>
-               </item>
-               <item>
-                <spacer name="horizontalSpacer_4">
-                 <property name="orientation">
-                  <enum>Qt::Horizontal</enum>
-                 </property>
-                 <property name="sizeHint" stdset="0">
-                  <size>
-                   <width>40</width>
-                   <height>20</height>
-                  </size>
-                 </property>
-                </spacer>
-               </item>
-              </layout>
-             </item>
-            </layout>
-           </widget>
-           <widget class="QTableWidget" name="tableWidgetEntities">
-            <property name="maximumSize">
-             <size>
-              <width>16777215</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <pointsize>9</pointsize>
-             </font>
-            </property>
-            <attribute name="horizontalHeaderVisible">
-             <bool>false</bool>
-            </attribute>
-            <attribute name="verticalHeaderVisible">
-             <bool>false</bool>
-            </attribute>
-            <attribute name="verticalHeaderDefaultSectionSize">
-             <number>25</number>
-            </attribute>
-           </widget>
-           <widget class="QConsoleListWidget" name="listWidgetEventLog">
-            <property name="maximumSize">
-             <size>
-              <width>16777215</width>
-              <height>16777215</height>
-             </size>
-            </property>
-            <property name="font">
-             <font>
-              <pointsize>8</pointsize>
-             </font>
-            </property>
-            <property name="cursor" stdset="0">
-             <cursorShape>IBeamCursor</cursorShape>
-            </property>
-            <property name="mouseTracking">
-             <bool>true</bool>
-            </property>
-            <property name="tabletTracking">
-             <bool>true</bool>
-            </property>
-            <property name="verticalScrollBarPolicy">
-             <enum>Qt::ScrollBarAlwaysOff</enum>
-            </property>
-            <property name="verticalScrollMode">
-             <enum>QAbstractItemView::ScrollPerPixel</enum>
-            </property>
-           </widget>
-          </widget>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="tabResourceManagement">
-        <attribute name="title">
-         <string>性能资源</string>
-        </attribute>
-        <layout class="QVBoxLayout" name="verticalLayout_10">
-         <item>
-          <layout class="QVBoxLayout" name="verticalLayout">
-           <item>
-            <widget class="QTabWidget" name="tabWidgetResource">
-             <property name="tabPosition">
-              <enum>QTabWidget::West</enum>
-             </property>
-             <property name="currentIndex">
-              <number>0</number>
-             </property>
-             <widget class="QWidget" name="tab4Monitor">
-              <attribute name="title">
-               <string>Monitor</string>
-              </attribute>
-             </widget>
-             <widget class="QWidget" name="tab4CPU">
-              <attribute name="title">
-               <string>CPU</string>
-              </attribute>
-             </widget>
-             <widget class="QWidget" name="tab4Memory">
-              <attribute name="title">
-               <string>内存</string>
-              </attribute>
-             </widget>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </widget>
-       <widget class="QWidget" name="tabSettog">
-        <attribute name="title">
-         <string>系统日志</string>
-        </attribute>
-        <layout class="QVBoxLayout" name="verticalLayout_2">
-         <item>
-          <widget class="QTableView" name="view"/>
-         </item>
-        </layout>
-       </widget>
-      </widget>
-      <widget class="QFatalListWidget" name="listWidgetFatalLog">
-       <property name="maximumSize">
-        <size>
-         <width>16777215</width>
-         <height>16777215</height>
-        </size>
-       </property>
-       <property name="font">
-        <font>
-         <pointsize>8</pointsize>
-        </font>
-       </property>
-       <property name="cursor" stdset="0">
-        <cursorShape>IBeamCursor</cursorShape>
-       </property>
-       <property name="mouseTracking">
-        <bool>true</bool>
-       </property>
-       <property name="tabletTracking">
-        <bool>true</bool>
-       </property>
-       <property name="verticalScrollBarPolicy">
-        <enum>Qt::ScrollBarAlwaysOff</enum>
-       </property>
-       <property name="verticalScrollMode">
-        <enum>QAbstractItemView::ScrollPerPixel</enum>
-       </property>
-      </widget>
-     </widget>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QToolBar" name="mainToolBar">
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1068</width>
-     <height>23</height>
-    </rect>
-   </property>
-  </widget>
-  <widget class="QStatusBar" name="statusBar"/>
-  <action name="actionInitialize">
-   <property name="text">
-    <string>终端初始化</string>
-   </property>
-  </action>
-  <action name="actionRestartFrmw">
-   <property name="text">
-    <string>重启应用</string>
-   </property>
-  </action>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <customwidgets>
-  <customwidget>
-   <class>QConsoleListWidget</class>
-   <extends>QListWidget</extends>
-   <header location="global">QConsoleListWidget.h</header>
-  </customwidget>
-  <customwidget>
-   <class>QFatalListWidget</class>
-   <extends>QListWidget</extends>
-   <header>QConsoleListWidget.h</header>
-  </customwidget>
- </customwidgets>
- <resources>
-  <include location="res.qrc"/>
- </resources>
- <connections/>
-</ui>

+ 0 - 58
Framework/spshell/Widgets/memorywidget.cpp

@@ -1,58 +0,0 @@
-#include "memorywidget.h"
-
-#include <QtCharts/QAreaSeries>
-#include <QPen>
-#include <QLinearGradient>
-#include <QDebug>
-
-#include "sysinfo.h"
-
-using namespace QtCharts;
-
-const int CHART_X_RANGE_COUNT = 50;
-const int CHART_X_RANGE_MAX = CHART_X_RANGE_COUNT - 1;
-const int COLOR_DARK_BLUE = 0x209fdf;
-const int COLOR_LIGHT_BLUE = 0xbfdfef;
-const int PEN_WIDTH = 3;
-
-MemoryWidget::MemoryWidget(QWidget *parent) :
-    #ifdef __arm__
-        SysInfoWidget(parent, 1200, 3000),
-    #else
-        SysInfoWidget(parent, 1200, 1000),
-    #endif
-    mSeries(new QLineSeries(this)),
-    mPointPositionX(0)
-{
-    QPen pen(COLOR_DARK_BLUE);
-    pen.setWidth(PEN_WIDTH);
-
-    QLinearGradient gradient(QPointF(0, 0), QPointF(0, 1));
-    gradient.setColorAt(1.0, COLOR_DARK_BLUE);
-    gradient.setColorAt(0.0, COLOR_LIGHT_BLUE);
-    gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
-
-    QAreaSeries* areaSeries = new QAreaSeries(mSeries);
-    areaSeries->setPen(pen);
-    areaSeries->setBrush(gradient);
-
-    QChart* chart = chartView().chart();
-    chart->addSeries(areaSeries);
-    chart->setTitle("Memory used");
-    chart->createDefaultAxes();
-    chart->axisX()->setRange(0, CHART_X_RANGE_MAX);
-    chart->axisX()->setVisible(false);
-    chart->axisY()->setRange(0, 100);
-}
-
-void MemoryWidget::updateSeries()
-{
-    double memoryUsed = SysInfo::instance().memoryUsed();
-    //qDebug() << memoryUsed << endl;
-    mSeries->append(mPointPositionX++, memoryUsed);
-    if (mSeries->count() > CHART_X_RANGE_COUNT) {
-        QChart* chart = chartView().chart();
-        chart->scroll(chart->plotArea().width() / CHART_X_RANGE_MAX, 0);
-        mSeries->remove(0);
-    }
-}

+ 0 - 22
Framework/spshell/Widgets/memorywidget.h

@@ -1,22 +0,0 @@
-#ifndef MEMORYWIDGET_H
-#define MEMORYWIDGET_H
-
-#include <QtCharts/QLineSeries>
-
-#include "sysinfowidget.h"
-
-class MemoryWidget : public SysInfoWidget
-{
-    Q_OBJECT
-public:
-    explicit MemoryWidget(QWidget *parent = nullptr);
-
-protected slots:
-    void updateSeries() override;
-
-private:
-    QtCharts::QLineSeries* mSeries;
-    qint64 mPointPositionX;
-};
-
-#endif // MEMORYWIDGET_H

+ 0 - 92
Framework/spshell/Widgets/mlabel.cpp

@@ -1,92 +0,0 @@
-#include "mlabel.h"
-#include <QPainter>
-#include <QTimer>
-#include <QFontMetrics>
-#include <QTimerEvent>
-
-const QString strSpace("   ");
-
-MLabel::MLabel(QWidget *parent) : QLabel(parent),left(0),timerId(-1),fontSize(10)
-{
-    setStyleSheet(QString("color:black;"));
-}
-
-void MLabel::setText(const QString & txt)
-{
-    QLabel::setText(txt);
-    upateLabelRollingState();
-}
-
-void MLabel::paintEvent(QPaintEvent *e)
-{
-    QPainter p(this);
-    QRect rc = rect();
-    rc.setHeight(rc.height() - 2);
-    rc.setWidth(rc.width() - 2);
-    QFont ft = font();
-    ft.setPointSize(fontSize);
-    p.setFont(ft);
-    p.setPen(QPen(Qt::black));
-
-    //  设置绘制文字的开始位置,也就是将文字往左移动多少
-    rc.setLeft(rc.left() - left);
-
-    //  如果文字已经显示到末尾,则再添加一遍文字,做出循环滚动的效果
-    QString strText = text();
-    if (timerId >= 0) {
-        strText += strSpace + text();
-    }
-    //  绘制文字
-    p.drawText(rc, Qt::AlignVCenter, strText);
-}
-
-void MLabel::timerEvent(QTimerEvent *e)
-{
-    if (e->timerId() == timerId && isVisible()) {
-        //  每次左移1个像素
-        left += 1;
-
-        //  判断是否已经完成一遍循环,完成则恢复起始位置,重新开始循环
-        QFont ft = font();
-        ft.setPointSize(fontSize);
-        QFontMetrics fm(ft);
-        const int txtWidth = fm.width(text());
-        const int spaceWidth = fm.width(strSpace);
-
-        if ((txtWidth + spaceWidth) < left) {
-            left = 0;
-        }
-
-        repaint();
-    }
-
-    QLabel::timerEvent(e);
-}
-
-void MLabel::resizeEvent(QResizeEvent *e)
-{
-    QLabel::resizeEvent(e);
-    upateLabelRollingState();
-}
-
-void MLabel::upateLabelRollingState()
-{
-    //  获取文本大小,小于文本框长度,则无需滚动
-    QFont ft = font();
-    ft.setPointSize(fontSize);
-    QFontMetrics fm(ft);
-    int nW = fm.width(text());
-
-    left = 0;
-    //  开启文本框滚动
-    if (nW > width()) {
-        timerId = startTimer(100);
-    }
-    //  关闭文本框滚动
-    else {
-        if (timerId >= 0) {
-            killTimer(timerId);
-            timerId = -1;
-        }
-    }
-}

+ 0 - 28
Framework/spshell/Widgets/mlabel.h

@@ -1,28 +0,0 @@
-#ifndef MLABEL_H
-#define MLABEL_H
-
-#include <QLabel>
-
-class MLabel : public QLabel
-{
-    Q_OBJECT
-public:
-    MLabel(QWidget* parent = NULL);
-
-public slots:
-    void setText(const QString&);
-
-protected:
-    virtual void paintEvent(QPaintEvent* e);
-    virtual void timerEvent(QTimerEvent* e);
-    virtual void resizeEvent(QResizeEvent* e);
-
-    void upateLabelRollingState();
-
-private:
-    int left;
-    int timerId;
-    int fontSize;
-};
-
-#endif // MLABEL_H

+ 0 - 251
Framework/spshell/Widgets/performwidget.cpp

@@ -1,251 +0,0 @@
-#include "performwidget.h"
-#include "ui_performwidget.h"
-
-#define COLUMN_NAME_INDEX   0
-#define COLUMN_PID_INDEX    1
-#define COLUMN_CPU_INDEX    2
-#define COLUMN_MEM_INDEX    3
-#define COLUMN_COMMAND_INDEX    4
-#define COLUMN_FDS_INDEX    5
-#define MAX_PERFORM_LIST_COLUMN 6
-
-//RUSER      PID %CPU %MEM COMMAND         COMMAND
-#define RAW_RUSER_INDEX   0
-#define RAW_PID_INDEX    1
-#define RAW_CPU_INDEX    2
-#define RAW_MEM_INDEX    3
-#define RAW_COMMAND_INDEX    4
-#define RAW_FDS_INDEX    5
-
-PerformWidget::PerformWidget(QWidget *parent)
-    : QWidget(parent)
-    , ui(new Ui::PerformWidget)
-{
-    ui->setupUi(this);
-
-    ui->performTableWidget->setColumnCount(MAX_PERFORM_LIST_COLUMN);
-    QStringList header;
-#ifdef WITH_QT
-    header << "名称"  << "进程号" << "CPU[%]" << "内存[%]" << "命令" << "文件句柄数";
-#else
-    header << "Name"  << "PIC" << "CPU[%]" << "MEM[%]" << "CMD" << "Fds" ;
-#endif
-
-    ui->performTableWidget->setHorizontalHeaderLabels(header);
-
-    ui->performTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_PID_INDEX, QHeaderView::ResizeToContents);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_CPU_INDEX, QHeaderView::ResizeToContents);
-    //ui->performTableWidget->horizontalHeader()->setSectionResizeMode(COLUMN_MEM_INDEX, QHeaderView::ResizeToContents);
-    ui->performTableWidget->resizeColumnToContents(0);
-
-    ui->performTableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
-    ui->performTableWidget->setSelectionBehavior(QAbstractItemView::SelectRows);
-    ui->performTableWidget->setSelectionMode(QAbstractItemView::SingleSelection);
-    ui->performTableWidget->verticalHeader()->hide();
-    ui->performTableWidget->horizontalHeader()->setStretchLastSection(true);
-    ui->performTableWidget->horizontalHeader()->setVisible(true);
-    ui->performTableWidget->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft | Qt::AlignVCenter);
-    ui->performTableWidget->setStyleSheet("selection-background-color:#1E90FF;");
-    ui->performTableWidget->setFrameShape(QFrame::NoFrame);
-
-    connect(ui->performTableWidget->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(sortByColumn(int)));
-
-    cmd = CPU_SORT;
-    process = new QProcess(this);
-    pro = new QProcess(this);
-    timer = new QTimer(this);
-    timer->setInterval(3000);
-    timer->setSingleShot(true);
-    connect(timer,SIGNAL(timeout()),this,SLOT(GetPerformInfo()));
-    GetPerformInfo();
-}
-
-int PerformWidget::GetProcessFds(int processID)
-{
-#ifdef Q_OS_WIN32
-    return 0;
-#else
-    QProcess* proc = new QProcess();
-    int result = GetProcessFdsImpl(proc, processID);
-    delete proc;
-    return result;
-#endif
-}
-
-int PerformWidget::GetProcessFdsImpl(QProcess* proc, int processID)
-{
-    proc->start("/bin/bash");
-    if (proc->waitForStarted(3000)) {
-        QString cmd = QString(FD_CALCU_SPRINT_STR).arg(processID);
-        qDebug() << __FUNCTION__ << cmd;
-        proc->write(cmd.toLatin1());
-        proc->closeWriteChannel();
-        if (proc->waitForFinished(3000)) {
-            QString result = proc->readAllStandardOutput();
-            if (!result.isEmpty()) {
-                bool ok = false;
-                int res = result.toInt(&ok, 10);
-                qDebug() << __FUNCTION__ << ": result=" << res;
-                if (ok) return res;
-                return -1;
-            } else {
-                qDebug() << __FUNCTION__ << ": empty";
-            }
-        } else {
-            qDebug() << __FUNCTION__ << ":@1 " << proc->errorString();
-        }
-    } else {
-        qDebug() << __FUNCTION__ << ":@2  " << proc->errorString();
-    }
-    return -1;
-}
-
-void PerformWidget::UpdateMemUsed()
-{
-    pro->start("free -m");
-    if(pro->waitForStarted(2000))
-    {
-        if(pro->waitForFinished(1000))
-        {
-            QString result = pro->readAllStandardOutput();
-            if(!result.isEmpty())
-            {
-                memused = 0;
-                qint64 total, used;
-                total = 0;
-                used = 0;
-                reg.setPattern("\\d+.+");
-                QString tmp = reg.match(result).captured(0);
-                QStringList list = tmp.split(QRegularExpression(" +"));
-                result = list.at(0); //total
-                tmp = list.at(5); //available
-                total = result.toLongLong();
-                used = tmp.toLongLong();
-                memused = used * 1000 / total;
-                memused = 1000 - memused;
-                int m = memused % 10;
-                memused /= 10;
-                if (m >= 5) memused += 1;
-            }
-        }
-    }
-}
-
-void PerformWidget::sortByColumn(int selColumn)
-{
-    //ui->performTableWidget->sortItems(selColumn, Qt::AscendingOrder);
-    if (selColumn == COLUMN_CPU_INDEX || selColumn == COLUMN_MEM_INDEX) {
-        if (selColumn == COLUMN_CPU_INDEX) {
-            if (cmd == CPU_SORT)  return;
-            cmd = CPU_SORT;
-        } else if (selColumn == COLUMN_MEM_INDEX) {
-            if (cmd == MEM_SORT)  return;
-            cmd = MEM_SORT;
-        }
-        GetPerformInfo();
-    }
-}
-
-bool PerformWidget::GetPerformInfo()
-{
-    timer->stop();
-
-    ui->performTableWidget->clearContents();
-
-    process->start("/bin/bash");
-    if(process->waitForStarted(3000)) {
-        process->write(cmd.toLatin1());
-        process->closeWriteChannel();
-        process->waitForFinished(3000);
-        QString result = process->readAllStandardOutput();
-        QRegularExpression reg;
-        reg.setPattern(" +");
-        result = result.replace(reg," ");
-        QStringList elemList = result.split("\n");
-        elemList.removeFirst();
-        elemList.removeLast();
-        ui->performTableWidget->setRowCount(elemList.length());
-        for(int i=0;i< elemList.length();i++) {
-            QString line = elemList.at(i);
-            QStringList elems = line.split(" ");
-            QString strPID = elems.at(RAW_PID_INDEX);
-            bool root = false, related = false;
-            for(int j=0; j<ui->performTableWidget->columnCount(); j++) {
-                QTableWidgetItem* item = new QTableWidgetItem;
-                item->setBackground((i % 2 != 0) ? QColor("#f5f5f5") : QColor("#ffffff"));
-                if(j== COLUMN_NAME_INDEX) {
-                    item->setWhatsThis(strPID);
-                    line = elems.at(RAW_COMMAND_INDEX);
-                    if (line.compare("spshell", Qt::CaseInsensitive) == 0 
-                        || line.compare("sphost", Qt::CaseInsensitive) == 0
-                        || line.compare("cefclient", Qt::CaseInsensitive) == 0
-                        || line.compare("guardian", Qt::CaseInsensitive) == 0) {
-                        related = true;
-                        item->setForeground(QBrush(Qt::red));
-
-                        if (line.compare("sphost", Qt::CaseInsensitive) == 0 && elems.count() > 7 && elems.at(7).startsWith("mod_")) {
-                            line = elems.at(7);
-                        }
-                    }
-
-                    item->setToolTip(line);
-                    item->setText(line);
-                }
-                else if (j == COLUMN_PID_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_PID_INDEX));
-                }
-                else if (j == COLUMN_CPU_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_CPU_INDEX));
-                }
-                else if (j == COLUMN_MEM_INDEX) {
-                    item->setTextAlignment(Qt::AlignHCenter);
-                    item->setText(elems.at(RAW_MEM_INDEX));
-                }
-                else if(j== COLUMN_COMMAND_INDEX)
-                {
-                    line = elems.mid(5).join(" ");
-                    item->setText(line);
-                    item->setToolTip(line);
-                } else if(j == COLUMN_FDS_INDEX) {
-                    if (related) {
-                        int fds = GetProcessFdsImpl(pro, strPID.toInt());
-                        item->setText(QString::number(fds));
-                    } else {
-                        item->setText("NA");
-                    }
-
-                }
-                ui->performTableWidget->setItem(i, j, item);
-            }
-        }
-    }
-
-    timer->start();
-
-    return true;
-}
-
-PerformWidget::~PerformWidget()
-{
-    delete ui;
-}
-
-bool PerformWidget::pidselected(const QString &pid)
-{
-    QString sel;
-    for(int i=0;i<selected.length();i++)
-    {
-        sel=selected.at(i);
-        if(pid==sel) {
-            listupdate2freshselected.append(sel);
-            return true;
-        }
-    }
-    return false;
-}
-
-
-

+ 0 - 64
Framework/spshell/Widgets/performwidget.h

@@ -1,64 +0,0 @@
-#ifndef PERFORMWIDGET_H
-#define PERFORMWIDGET_H
-
-#include <QWidget>
-#include <QTimer>
-#include<QDesktopWidget>
-#include<QProcess>
-#include<QRegularExpression>
-#include<QDebug>
-#include<QTableWidgetItem>
-#include<QMouseEvent>
-
-#define CPU_SORT "ps ax -o \"%u %p %C\" -o pmem -o \"%c %a\" --sort=-%cpu|head -21"
-#define MEM_SORT "ps ax -o \"%u %p %C\" -o pmem -o \"%c %a\" --sort=-pmem|head -21"
-#define BG_color "#monitorwindow{ background-color:%1; }\
-                #pushButton{ color:%2; }"
-
-#define FD_CALCU_SPRINT_STR "lsof -p %1 | wc -l"
-
-#define LOW "rgb(50, 162, 106)"
-#define MID "rgb(233, 119, 57)"
-#define HIGH "rgb(179, 10, 13)"
-
-QT_BEGIN_NAMESPACE
-namespace Ui { class PerformWidget; }
-QT_END_NAMESPACE
-
-class PerformWidget : public QWidget
-{
-    Q_OBJECT
-
-public:
-    PerformWidget(QWidget *parent = nullptr);
-    ~PerformWidget();
-
-    static int GetProcessFds(int processID);
-signals:
-    void opencpu();
-
-private:
-
-    static int GetProcessFdsImpl(QProcess* pro, int processID);
-
-public slots:
-    bool GetPerformInfo();
-    void UpdateMemUsed();
-    void sortByColumn(int selColumn);
-private:
-    Ui::PerformWidget *ui;
-    QPoint oldpos;
-    void makelist();
-    bool pidselected(const QString&);
-    QTimer *timer;
-    QProcess *process;
-    QProcess *pro;
-    QStringList selectedpid;
-    QString cmd;
-    QString pressed;
-    QStringList selected;
-    QStringList listupdate2freshselected;
-    int memused;
-    QRegularExpression reg;
-};
-#endif // PERFORMWIDGET_H

+ 0 - 24
Framework/spshell/Widgets/performwidget.ui

@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>PerformWidget</class>
- <widget class="QWidget" name="PerformWidget">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>800</width>
-    <height>600</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>PerformWidget</string>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0">
-    <widget class="QTableWidget" name="performTableWidget"/>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections/>
-</ui>

+ 0 - 50
Framework/spshell/Widgets/res.qrc

@@ -1,50 +0,0 @@
-<RCC>
-    <qresource prefix="/Pics">
-        <file>res/Logo.png</file>
-    </qresource>
-    <qresource prefix="/icons">
-        <file>res/fatcow/contrast_high.png</file>
-        <file>res/fatcow/contrast_low.png</file>
-        <file>res/fatcow/control_cursor.png</file>
-        <file>res/fatcow/control_cursor_blue.png</file>
-        <file>res/fatcow/control_eject.png</file>
-        <file>res/fatcow/control_eject_blue.png</file>
-        <file>res/fatcow/control_end.png</file>
-        <file>res/fatcow/control_end_blue.png</file>
-        <file>res/fatcow/control_fastforward.png</file>
-        <file>res/fatcow/control_fastforward_blue.png</file>
-        <file>res/fatcow/control_pause.png</file>
-        <file>res/fatcow/control_pause_blue.png</file>
-        <file>res/fatcow/control_play.png</file>
-        <file>res/fatcow/control_play_blue.png</file>
-        <file>res/fatcow/control_power.png</file>
-        <file>res/fatcow/control_power_blue.png</file>
-        <file>res/fatcow/control_repeat.png</file>
-        <file>res/fatcow/control_repeat_blue.png</file>
-        <file>res/fatcow/control_rewind.png</file>
-        <file>res/fatcow/control_rewind_blue.png</file>
-        <file>res/fatcow/control_start.png</file>
-        <file>res/fatcow/control_start_blue.png</file>
-        <file>res/fatcow/control_stop.png</file>
-        <file>res/fatcow/control_stop_blue.png</file>
-        <file>res/fatcow/zoom_layer.png</file>
-        <file>res/fatcow/file_extension_log.png</file>
-        <file>res/fatcow/lcd_tv_test.png</file>
-        <file>res/fatcow/format_painter.png</file>
-        <file>res/fatcow/page_delete.png</file>
-        <file>res/fatcow/cross.png</file>
-    </qresource>
-    <qresource prefix="/doc"/>
-    <qresource prefix="/">
-        <file>res/bg.png</file>
-        <file>res/bgactive.png</file>
-        <file>res/FavIcon.ico</file>
-        <file>res/splash.png</file>
-        <file>res/version_history.html</file>
-        <file>res/forms/input.txt</file>
-        <file>res/forms/textfinder.ui</file>
-        <file>res/sys_errcode.html</file>
-        <file>res/spexplorerauto.desktop</file>
-        <file>res/set_nopass_priviledge.sh</file>
-    </qresource>
-</RCC>

+ 0 - 89
Framework/spshell/Widgets/res/ErrorCode.md

@@ -1,89 +0,0 @@
-| 错误码 | 十进制(十六进制) |
-| ---- | ---- |
-| Error_Succeed | 0(0x00000000) |
-| Error_DataCheck | 100(0x00000064) |
-| Error_Null | 101(0x00000065) |
-| Error_Param | 102(0x00000066) |
-| Error_Overflow | 103(0x00000067) |
-| Error_TooSmallBuffer | 104(0x00000068) |
-| Error_NotIntegrated | 105(0x00000069) |
-| Error_CheckSum | 106(0x0000006A) |
-| Error_MisMatched | 107(0x0000006B) |
-| Error_Deprecated | 108(0x0000006C) |
-| Error_TargetBeing | 512(0x00000200) |
-| Error_NoTarget | 513(0x00000201) |
-| Error_NoDefine | 514(0x00000202) |
-| Error_NotImpl | 515(0x00000203) |
-| Error_NotExist | 516(0x00000204) |
-| Error_Duplication | 517(0x00000205) |
-| Error_Unregisted | 518(0x00000206) |
-| Error_AlreadyExist | 519(0x00000207) |
-| Error_MethodNotFound | 520(0x00000208) |
-| Error_Redirect | 521(0x00000209) |
-| Error_BridgeNotBind | 522(0x0000020A) |
-| Error_BridgeNotOK | 523(0x0000020B) |
-| Error_NotSupport | 524(0x0000020C) |
-| Error_NotConfig | 525(0x0000020D) |
-| Error_InvalidState | 768(0x00000300) |
-| Error_NotInit | 769(0x00000301) |
-| Error_Paused | 770(0x00000302) |
-| Error_Stoped | 771(0x00000303) |
-| Error_Losted | 772(0x00000304) |
-| Error_Closed | 773(0x00000305) |
-| Error_Accept | 774(0x00000306) |
-| Error_Failed | 775(0x00000307) |
-| Error_Busy | 776(0x00000308) |
-| Error_TaskControl | 1024(0x00000400) |
-| Error_Pending | 1025(0x00000401) |
-| Error_Cancel | 1026(0x00000402) |
-| Error_Break | 1027(0x00000403) |
-| Error_NotMeetCondition | 1028(0x00000404) |
-| Error_NoPrivilege | 1029(0x00000405) |
-| Error_MethodSignatureFailed | 1030(0x00000406) |
-| Error_PeerAction | 1280(0x00000500) |
-| Error_PeerClose | 1281(0x00000501) |
-| Error_PeerIgnore | 1282(0x00000502) |
-| Error_PeerReject | 1283(0x00000503) |
-| Error_PeerDelay | 1284(0x00000504) |
-| Error_Process | 1536(0x00000600) |
-| Error_NetBroken | 1537(0x00000601) |
-| Error_UpdateFailed | 1538(0x00000602) |
-| Error_RegistryFailed | 1539(0x00000603) |
-| Error_IO | 1540(0x00000604) |
-| Error_Readonly | 1541(0x00000605) |
-| Error_TimeOut | 1792(0x00000700) |
-| Error_BlockTimeOut | 1793(0x00000701) |
-| Error_ThreadTimeOut | 1794(0x00000702) |
-| Error_QueueTimeOut | 1795(0x00000703) |
-| Error_ReplyTimeOut | 1796(0x00000704) |
-| Error_Hardware | 2048(0x00000800) |
-| Error_DevLoadFileFailed | 2049(0x00000801) |
-| Error_DevNotAvailable | 2050(0x00000802) |
-| Error_DevAlreadyConnected | 2051(0x00000803) |
-| Error_DevConnFailed | 2052(0x00000804) |
-| Error_DevCommFailed | 2053(0x00000805) |
-| Error_DevMedia | 2054(0x00000806) |
-| Error_EnvCamera | 2055(0x00000807) |
-| Error_OptCamera | 2056(0x00000808) |
-| Error_AllCamera | 2057(0x00000809) |
-| Error_AudioIN | 2059(0x0000080B) |
-| Error_AudioOut | 2060(0x0000080C) |
-| Error_DevFailAddUp | 2061(0x0000080D) |
-| Error_Interact | 2062(0x0000080E) |
-| Error_MaintainRequired | 2063(0x0000080F) |
-| Error_Socket | 2304(0x00000900) |
-| Error_ConnectFailed | 2305(0x00000901) |
-| Error_ServerNotAvailable | 2306(0x00000902) |
-| Error_Debug | 3840(0x00000F00) |
-| Error_Assert | 3841(0x00000F01) |
-| Error_Trace | 3842(0x00000F02) |
-| Error_Bug | 3843(0x00000F03) |
-| Error_Unrecover | 1879048192(0x70000000) |
-| Error_Resource | 1879048193(0x70000001) |
-| Error_NewProcess | 1879048194(0x70000002) |
-| Error_FailVerify | 1879048195(0x70000003) |
-| Error_Block | 1879048196(0x70000004) |
-| Error_Exception | 1879048197(0x70000005) |
-| Error_Unexpect | 2147483646(0x7FFFFFFE) |
-| Error_IgnoreAll | 2147483647(0x7FFFFFFF) |
-

二進制
Framework/spshell/Widgets/res/FavIcon.ico


二進制
Framework/spshell/Widgets/res/Logo.png


二進制
Framework/spshell/Widgets/res/bg.png


二進制
Framework/spshell/Widgets/res/bgactive.png


二進制
Framework/spshell/Widgets/res/fatcow/contrast_high.png


二進制
Framework/spshell/Widgets/res/fatcow/contrast_low.png


二進制
Framework/spshell/Widgets/res/fatcow/control_cursor.png


二進制
Framework/spshell/Widgets/res/fatcow/control_cursor_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_eject.png


二進制
Framework/spshell/Widgets/res/fatcow/control_eject_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_end.png


二進制
Framework/spshell/Widgets/res/fatcow/control_end_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_fastforward.png


二進制
Framework/spshell/Widgets/res/fatcow/control_fastforward_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_pause.png


二進制
Framework/spshell/Widgets/res/fatcow/control_pause_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_play.png


二進制
Framework/spshell/Widgets/res/fatcow/control_play_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_power.png


二進制
Framework/spshell/Widgets/res/fatcow/control_power_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_repeat.png


二進制
Framework/spshell/Widgets/res/fatcow/control_repeat_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_rewind.png


二進制
Framework/spshell/Widgets/res/fatcow/control_rewind_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_start.png


二進制
Framework/spshell/Widgets/res/fatcow/control_start_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/control_stop.png


二進制
Framework/spshell/Widgets/res/fatcow/control_stop_blue.png


二進制
Framework/spshell/Widgets/res/fatcow/cross.png


二進制
Framework/spshell/Widgets/res/fatcow/file_extension_log.png


二進制
Framework/spshell/Widgets/res/fatcow/format_painter.png


二進制
Framework/spshell/Widgets/res/fatcow/lcd_tv_test.png


二進制
Framework/spshell/Widgets/res/fatcow/page_delete.png


二進制
Framework/spshell/Widgets/res/fatcow/zoom_layer.png


+ 0 - 3
Framework/spshell/Widgets/res/forms/input.txt

@@ -1,3 +0,0 @@
-This user interface was loaded and processed at run-time.
-
-Applications that want to load .ui files at run-time must be configured to be link against the QtUiTools module. A form loader object, provided by the QUiLoader class, is used to construct the user interface. This user interface can be retrieved from any QIODevice; for example, a QFile object can be used to obtain a form stored in a project's resources. The QUiLoader::load() function takes the user interface description contained in the file and constructs the form widget.

+ 0 - 95
Framework/spshell/Widgets/res/forms/textfinder.ui

@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>Form</class>
- <widget class="QWidget" name="Form">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>378</width>
-    <height>158</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Find Text</string>
-  </property>
-  <layout class="QVBoxLayout">
-   <property name="spacing">
-    <number>6</number>
-   </property>
-   <property name="leftMargin">
-    <number>9</number>
-   </property>
-   <property name="topMargin">
-    <number>9</number>
-   </property>
-   <property name="rightMargin">
-    <number>9</number>
-   </property>
-   <property name="bottomMargin">
-    <number>9</number>
-   </property>
-   <item>
-    <layout class="QGridLayout">
-     <property name="leftMargin">
-      <number>0</number>
-     </property>
-     <property name="topMargin">
-      <number>0</number>
-     </property>
-     <property name="rightMargin">
-      <number>0</number>
-     </property>
-     <property name="bottomMargin">
-      <number>0</number>
-     </property>
-     <property name="spacing">
-      <number>6</number>
-     </property>
-     <item row="0" column="1">
-      <widget class="QLineEdit" name="lineEdit"/>
-     </item>
-     <item row="0" column="0">
-      <widget class="QLabel" name="searchLabel">
-       <property name="text">
-        <string>关键词:</string>
-       </property>
-       <property name="buddy">
-        <cstring>lineEdit</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="0" column="2">
-      <widget class="QPushButton" name="findButton">
-       <property name="text">
-        <string>查找(&amp;F)</string>
-       </property>
-      </widget>
-     </item>
-    </layout>
-   </item>
-   <item>
-    <widget class="QTextEdit" name="textEdit"/>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>lineEdit</sender>
-   <signal>returnPressed()</signal>
-   <receiver>findButton</receiver>
-   <slot>animateClick()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>261</x>
-     <y>17</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>320</x>
-     <y>17</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>

Some files were not shown because too many files changed in this diff