From d5a1e7d19d186bb36ea14ff40558eb7e7b43a097 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sat, 14 Nov 2020 16:34:31 +0100 Subject: [PATCH] Add additional system info (#1078) --- CHANGELOG.md | 15 +++++------ assets/webconfig/content/about.html | 36 ++++++++++++++------------ assets/webconfig/js/content_logging.js | 34 ++++++++++++------------ include/utils/SysInfo.h | 2 ++ libsrc/api/JsonAPI.cpp | 2 ++ libsrc/utils/CMakeLists.txt | 13 ++++++++++ libsrc/utils/SysInfo.cpp | 5 ++++ src/hyperiond/hyperiond.cpp | 22 ++++++++-------- src/hyperiond/main.cpp | 9 +------ 9 files changed, 78 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16d2d452..ae3ea185 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,28 +13,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Provide additional details on Hardware/CPU information - Allow execution with option "--version", while another hyperion daemon is running - New language support: Russian and Chinese (simplified) (#1005) -- added libcec to deb/rpm dependency list -- updated some language files +- Added libcec to deb/rpm dependency list +- Updated some language files - New LED Device SK9822 (#1005) - Support SK9822 type LEDs with adaptive brightness control via SPI (#1017) - Provide additional details on Hardware/CPU information (#1045) -Allow execution with option "--version", while another hyperion daemon is running + - Allow execution with option "--version", while another hyperion daemon is running - New blackbar detection mode "Letterbox", that considers only bars at the top and bottom of picture - Systray icons added - Issue #925 (#1040) - DirectX9 Grabber (#1039) - Added DirectX SDK to CompileHowto -- Hide Systray on exit & Install DirectX Redistributable -- Read-Only configuration database suppor +- Hide Window Systray icon on Hyperion exit & Install DirectX Redistributable +- Read-Only configuration database support ### Changed - boblight: reduce cpu time spent on memcopy and parsing rgb values (#1016) - Windows Installer/Uninstaller notification when Hyperion is running (#1033) - Updated Windows Dependencies -- cleanup packages.cmake & extend NSIS plugin directory +- Cleanup packages.cmake & extend NSIS plugin directory - Optimize images (#1058) - Update LICENSE - Change links from http to https (#1067) - - UI: Separate LED-Layout creation from UI code - Docs: Refreshed EN JSON API documentation @@ -45,7 +44,7 @@ Allow execution with option "--version", while another hyperion daemon is runnin - Fix #1007 - LED's retain last state after clearing a source (#1008) - Fix Lightpack issue #1015 (#1049) - Fix #771 color calibration for Kodi 18 (#1044) -- Fix various JSON API issues #1022, #1019, #997, #993, #992, #976, #969, #964, #980 (#1036) +- Fix various JSON API issues (#1036) - Fix issue #909, Have ratio correction first and then scale (#1047) - Fix display argument in hyperion-qt (#1027) - Fix typos (#1051) diff --git a/assets/webconfig/content/about.html b/assets/webconfig/content/about.html index d53eebb0..665dbc4b 100644 --- a/assets/webconfig/content/about.html +++ b/assets/webconfig/content/about.html @@ -35,33 +35,35 @@ var sys = window.sysInfo.system; var shy = window.sysInfo.hyperion; var info = "
Hyperion Server: \n";
-	info += '- Build:       ' + shy.build + '\n';
-	info += '- Build time:  ' + shy.time + '\n';
-	info += '- Git Remote:  ' + shy.gitremote + '\n';
-	info += '- Version:     ' + shy.version + '\n';
-	info += '- UI Lang:     ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n';
-	info += '- UI Access:   ' + storedAccess + '\n';
-	//info += 'Log lvl:     ' + window.serverConfig.logger.level + '\n';
-	info += '- Avail Capt:  ' + window.serverInfo.grabbers.available + '\n';
-	info += '- Database:    ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
+	info += '- Build:           ' + shy.build + '\n';
+	info += '- Build time:      ' + shy.time + '\n';
+	info += '- Git Remote:      ' + shy.gitremote + '\n';
+	info += '- Version:         ' + shy.version + '\n';
+	info += '- UI Lang:         ' + storedLang + ' (BrowserLang: ' + navigator.language + ')\n';
+	info += '- UI Access:       ' + storedAccess + '\n';
+	//info += '- Log lvl:         ' + window.serverConfig.logger.level + '\n';
+	info += '- Avail Capt:      ' + window.serverInfo.grabbers.available + '\n';
+	info += '- Database:        ' + (shy.readOnlyMode ? "ready-only" : "read/write") + '\n';
 
 	info += '\n';
 
 	info += 'Hyperion Server OS: \n';
-	info += '- Distribution: ' + sys.prettyName + '\n';
-	info += '- Architecture: ' + sys.architecture + '\n';
+	info += '- Distribution:   ' + sys.prettyName + '\n';
+	info += '- Architecture:   ' + sys.architecture + '\n';
 
 	if (sys.cpuModelName)
-	  info += '- CPU Model:    ' + sys.cpuModelName + '\n';
+	  info += '- CPU Model:      ' + sys.cpuModelName + '\n';
 	if (sys.cpuModelType)
-	  info += '- CPU Type:     ' + sys.cpuModelType + '\n';
+	  info += '- CPU Type:       ' + sys.cpuModelType + '\n';
 	if (sys.cpuRevision)
-	  info += '- CPU Revision: ' + sys.cpuRevision + '\n';
+	  info += '- CPU Revision:   ' + sys.cpuRevision + '\n';
 	if (sys.cpuHardware)
-	  info += '- CPU Hardware: ' + sys.cpuHardware + '\n';	
+	  info += '- CPU Hardware:   ' + sys.cpuHardware + '\n';	
 
-	info += '- Kernel:       ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n';
-	info += '- Browser:      ' + navigator.userAgent + ' 
'; + info += '- Kernel: ' + sys.kernelType + ' (' + sys.kernelVersion + ' (WS: ' + sys.wordSize + '))\n'; + info += '- Qt Version: ' + sys.qtVersion + '\n'; + info += '- Python Version: ' + sys.pyVersion + '\n'; + info += '- Browser: ' + navigator.userAgent + ' '; var fc = ['' + $.i18n("about_version") + '', $.i18n("about_build"), $.i18n("about_builddate"), $.i18n("about_translations"), $.i18n("about_resources", $.i18n("general_webui_title")), "System info (Github Issue)", $.i18n("about_3rd_party_licenses")]; var sc = [currentVersion, si.build, si.time, '(' + availLang.length + ')

' + lang + '

' + $.i18n("about_contribute") + '

', libh, info, '
']; diff --git a/assets/webconfig/js/content_logging.js b/assets/webconfig/js/content_logging.js index 5faf2b05..8ace208d 100644 --- a/assets/webconfig/js/content_logging.js +++ b/assets/webconfig/js/content_logging.js @@ -73,30 +73,32 @@ $(document).ready(function() { //create general info info = "### GENERAL ### \n"; - info += 'Build: '+shy.build+'\n'; - info += 'Build time: '+shy.time+'\n'; - info += 'Version: '+shy.version+'\n'; - info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n'; - info += 'UI Access: '+storedAccess+'\n'; - info += 'Log lvl: '+window.serverConfig.logger.level+'\n'; - info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n'; - info += 'Database: '+(shy.readOnlyMode ? "ready-only" : "read/write")+'\n'; + info += 'Build: '+shy.build+'\n'; + info += 'Build time: '+shy.time+'\n'; + info += 'Version: '+shy.version+'\n'; + info += 'UI Lang: '+storedLang+' (BrowserL: '+navigator.language+')\n'; + info += 'UI Access: '+storedAccess+'\n'; + info += 'Log lvl: '+window.serverConfig.logger.level+'\n'; + info += 'Avail Capt: '+window.serverInfo.grabbers.available+'\n'; + info += 'Database: '+(shy.readOnlyMode ? "ready-only" : "read/write")+'\n'; info += '\n'; - info += 'Distribution:'+sys.prettyName+'\n'; - info += 'Architecture:'+sys.architecture+'\n'; + info += 'Distribution: '+sys.prettyName+'\n'; + info += 'Architecture: '+sys.architecture+'\n'; if (sys.cpuModelName) - info += 'CPU Model: ' + sys.cpuModelName + '\n'; + info += 'CPU Model: ' + sys.cpuModelName + '\n'; if (sys.cpuModelType) - info += 'CPU Type: ' + sys.cpuModelType + '\n'; + info += 'CPU Type: ' + sys.cpuModelType + '\n'; if (sys.cpuRevision) - info += 'CPU Revision:' + sys.cpuRevision + '\n'; + info += 'CPU Revision: ' + sys.cpuRevision + '\n'; if (sys.cpuHardware) - info += 'CPU Hardware:' + sys.cpuHardware + '\n'; + info += 'CPU Hardware: ' + sys.cpuHardware + '\n'; - info += 'Kernel: '+sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))\n'; - info += 'Browser/OS: '+navigator.userAgent+'\n\n'; + info += 'Kernel: ' + sys.kernelType+' ('+sys.kernelVersion+' (WS: '+sys.wordSize+'))' + '\n'; + info += 'Qt Version: ' + sys.qtVersion + '\n'; + info += 'Python Version: ' + sys.pyVersion + '\n'; + info += 'Browser/OS: ' + navigator.userAgent + '\n\n'; //create prios info += "### PRIORITIES ### \n"; diff --git a/include/utils/SysInfo.h b/include/utils/SysInfo.h index 3c9ec27c..22d80c27 100644 --- a/include/utils/SysInfo.h +++ b/include/utils/SysInfo.h @@ -21,6 +21,8 @@ public: QString prettyName; QString hostName; QString domainName; + QString qtVersion; + QString pyVersion; }; static HyperionSysInfo get(); diff --git a/libsrc/api/JsonAPI.cpp b/libsrc/api/JsonAPI.cpp index d899e177..f5711b2c 100644 --- a/libsrc/api/JsonAPI.cpp +++ b/libsrc/api/JsonAPI.cpp @@ -285,6 +285,8 @@ void JsonAPI::handleSysInfoCommand(const QJsonObject &, const QString &command, system["prettyName"] = data.prettyName; system["hostName"] = data.hostName; system["domainName"] = data.domainName; + system["qtVersion"] = data.qtVersion; + system["pyVersion"] = data.pyVersion; info["system"] = system; QJsonObject hyperion; diff --git a/libsrc/utils/CMakeLists.txt b/libsrc/utils/CMakeLists.txt index 6b3865ac..40e7efe6 100644 --- a/libsrc/utils/CMakeLists.txt +++ b/libsrc/utils/CMakeLists.txt @@ -1,5 +1,17 @@ # Define the current source locations +# Include the python directory. Also include the parent (which is for example /usr/include) +# which may be required when it is not includes by the (cross-) compiler by default. +if (NOT CMAKE_VERSION VERSION_LESS "3.12") + find_package(Python3 COMPONENTS Interpreter Development REQUIRED) + include_directories(${Python3_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS}/..) + add_compile_definitions(PYTHON_VERSION_MAJOR_MINOR=${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}) +else() + find_package (PythonLibs ${PYTHON_VERSION_STRING} EXACT) # Maps PythonLibs to the PythonInterp version of the main cmake + include_directories(${PYTHON_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS}/..) + add_definitions(-DPYTHON_VERSION_MAJOR_MINOR=${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}) +endif() + SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/utils) SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/utils) @@ -15,6 +27,7 @@ add_library(hyperion-utils target_link_libraries(hyperion-utils hyperion + python Qt5::Core Qt5::Gui Qt5::Network diff --git a/libsrc/utils/SysInfo.cpp b/libsrc/utils/SysInfo.cpp index e5fa1625..3136899d 100644 --- a/libsrc/utils/SysInfo.cpp +++ b/libsrc/utils/SysInfo.cpp @@ -1,3 +1,6 @@ +// Python includes +#include + #include "utils/SysInfo.h" #include "utils/FileUtils.h" @@ -23,6 +26,8 @@ SysInfo::SysInfo() _sysinfo.hostName = QHostInfo::localHostName(); _sysinfo.domainName = QHostInfo::localDomainName(); getCPUInfo(); + _sysinfo.qtVersion = QT_VERSION_STR; + _sysinfo.pyVersion = PY_VERSION; } SysInfo::HyperionSysInfo SysInfo::get() diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index b459b115..b7016df0 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -137,7 +137,7 @@ HyperionDaemon::HyperionDaemon(const QString rootPath, QObject *parent, bool log // ---- grabber ----- #if !defined(ENABLE_DISPMANX) && !defined(ENABLE_OSX) && !defined(ENABLE_FB) && !defined(ENABLE_X11) && !defined(ENABLE_XCB) && !defined(ENABLE_AMLOGIC) && !defined(ENABLE_QT) && !defined(ENABLE_DX) - Warning(_log, "No platform capture can be instantiated, because all grabbers have been left out from the build"); + Info(_log, "No platform capture supported on this platform"); #endif // init system capture (framegrabber) @@ -595,7 +595,7 @@ void HyperionDaemon::handleSettingsUpdate(settings::type settingsType, const QJs connect(this, &HyperionDaemon::videoMode, _v4l2Grabber, &V4L2Wrapper::setVideoMode); connect(this, &HyperionDaemon::settingsChanged, _v4l2Grabber, &V4L2Wrapper::handleSettingsUpdate); #else - Error(_log, "The v4l2 grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The v4l2 grabber is not supported on this platform"); #endif } } @@ -612,7 +612,7 @@ void HyperionDaemon::createGrabberDispmanx() Info(_log, "DISPMANX frame grabber created"); #else - Error(_log, "The dispmanx framegrabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The dispmanx framegrabber is not supported on this platform"); #endif } @@ -628,7 +628,7 @@ void HyperionDaemon::createGrabberAmlogic() Info(_log, "AMLOGIC grabber created"); #else - Error(_log, "The AMLOGIC grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The AMLOGIC grabber is not supported on this platform"); #endif } @@ -647,7 +647,7 @@ void HyperionDaemon::createGrabberX11(const QJsonObject &grabberConfig) Info(_log, "X11 grabber created"); #else - Error(_log, "The X11 grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The X11 grabber is not supported on this platform"); #endif } @@ -666,7 +666,7 @@ void HyperionDaemon::createGrabberXcb(const QJsonObject &grabberConfig) Info(_log, "XCB grabber created"); #else - Error(_log, "The XCB grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The XCB grabber is not supported on this platform"); #endif } @@ -685,7 +685,7 @@ void HyperionDaemon::createGrabberQt(const QJsonObject &grabberConfig) Info(_log, "Qt grabber created"); #else - Error(_log, "The Qt grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The Qt grabber is not supported on this platform"); #endif } @@ -704,7 +704,7 @@ void HyperionDaemon::createGrabberDx(const QJsonObject &grabberConfig) Info(_log, "DirectX grabber created"); #else - Error(_log, "The DirectX grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The DirectX is not supported on this platform"); #endif } @@ -722,7 +722,7 @@ void HyperionDaemon::createGrabberFramebuffer(const QJsonObject &grabberConfig) Info(_log, "Framebuffer grabber created"); #else - Error(_log, "The framebuffer grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The framebuffer is not supported on this platform"); #endif } @@ -740,7 +740,7 @@ void HyperionDaemon::createGrabberOsx(const QJsonObject &grabberConfig) Info(_log, "OSX grabber created"); #else - Error(_log, "The osx grabber can not be instantiated, because it has been left out from the build"); + Debug(_log, "The osx grabber is not supported on this platform"); #endif } @@ -761,6 +761,6 @@ void HyperionDaemon::createCecHandler() Info(_log, "CEC handler created"); #else - Error(_log, "The CEC handler can not be instantiated, because it has been left out from the build"); + Debug(_log, "The CEC handler is not supported on this platform"); #endif } diff --git a/src/hyperiond/main.cpp b/src/hyperiond/main.cpp index 3ddb57e2..dab1390e 100644 --- a/src/hyperiond/main.cpp +++ b/src/hyperiond/main.cpp @@ -256,14 +256,6 @@ int main(int argc, char** argv) return 0; } - if (parser.isSet(versionOption)) - { - std::cout - << "Hyperion Ambilight Daemon" << std::endl - << "\tVersion : " << HYPERION_VERSION << " (" << HYPERION_BUILD_ID << ")" << std::endl - << "\tBuild Time: " << __DATE__ << " " << __TIME__ << std::endl; - } - if (parser.isSet(exportEfxOption)) { Q_INIT_RESOURCE(EffectEngine); @@ -393,6 +385,7 @@ int main(int argc, char** argv) } Info(log,"Starting Hyperion - %s, %s, built: %s:%s", HYPERION_VERSION, HYPERION_BUILD_ID, __DATE__, __TIME__); + Debug(log,"QtVersion [%s]", QT_VERSION_STR); if ( !readonlyMode ) {