diff --git a/source/daemon/CMakeLists.txt b/source/daemon/CMakeLists.txt index 0d270977..c0e0c94a 100644 --- a/source/daemon/CMakeLists.txt +++ b/source/daemon/CMakeLists.txt @@ -27,13 +27,12 @@ set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_C_STANDARD 11) -set(CMAKE_C_STANDARD_REQUIRED ON) - set(Qt5_DIR "/usr/lib/x86_64-linux-gnu/cmake/Qt5/") find_package(Qt5 COMPONENTS Network SerialPort REQUIRED) +if(NOT WIN32) # added to make program editable in qt-creator on windows + find_library(PAHO_MQTT3C paho-mqtt3c REQUIRED) find_library(PAHO_MQTT3A paho-mqtt3a REQUIRED) find_library(PAHO_MQTT3CS paho-mqtt3cs REQUIRED) @@ -44,6 +43,9 @@ find_library(CRYPTOPP crypto++ REQUIRED) find_library(CONFIGPP config++ REQUIRED) find_library(PIGPIOD_IF2 pigpiod_if2 REQUIRED) find_library(RT rt REQUIRED) + +endif() + find_library(MUONDETECTOR_LIB NAMES muondetector HINTS "${CMAKE_CURRENT_BINARY_DIR}/../lib/" REQUIRED) add_compile_options( @@ -131,9 +133,12 @@ set(LOGIN_SOURCE_FILES ) set(LOGIN_INSTALL_FILES - "${PROJECT_CONFIG_DIR}/muondetector-login-helper" + "${PROJECT_CONFIG_DIR}/muondetector-login" ) +set(DAEMON_INSTALL_FILES + "${PROJECT_CONFIG_DIR}/muondetector.conf" + ) configure_file( "${PROJECT_CONFIG_DIR}/muondetector-daemon.1" @@ -143,10 +148,6 @@ configure_file( "${PROJECT_CONFIG_DIR}/muondetector-login.1" "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1" ) -configure_file( - "${PROJECT_CONFIG_DIR}/muondetector-login-helper.1" - "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1" - ) add_executable(muondetector-login ${LOGIN_SOURCE_FILES}) @@ -188,12 +189,13 @@ target_link_libraries(muondetector-daemon ) -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") +if (CMAKE_BUILD_TYPE STREQUAL Release) + add_custom_command(TARGET muondetector-daemon POST_BUILD + COMMAND ${CMAKE_STRIP} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/muondetector-daemon") + add_custom_command(TARGET muondetector-login POST_BUILD + COMMAND ${CMAKE_STRIP} "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/muondetector-login") +endif () -set(DAEMON_INSTALL_FILES - "${PROJECT_CONFIG_DIR}/muondetector.conf" - ) @@ -202,13 +204,12 @@ include(GNUInstallDirs) add_custom_target(changelog ALL COMMAND gzip -cn9 "${PROJECT_CONFIG_DIR}/changelog" > "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz") add_custom_target(manpage ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1.gz") add_custom_target(manpage-login ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1.gz") -add_custom_target(manpage-login-helper ALL COMMAND gzip -cn9 "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1" > "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1.gz") -install(TARGETS muondetector-daemon muondetector-login DESTINATION bin COMPONENT daemon) +install(TARGETS muondetector-daemon DESTINATION bin COMPONENT daemon) +install(TARGETS muondetector-login DESTINATION lib/muondetector/bin COMPONENT daemon) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/changelog.gz" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT daemon) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-daemon.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-login-helper.1.gz" DESTINATION "share/man/man1/" COMPONENT daemon) install(FILES "${PROJECT_CONFIG_DIR}/copyright" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT daemon) install(FILES ${DAEMON_INSTALL_FILES} DESTINATION "/etc/muondetector/" COMPONENT daemon) install(FILES "${PROJECT_CONFIG_DIR}/muondetector-daemon.service" DESTINATION "/lib/systemd/system" COMPONENT daemon) @@ -218,6 +219,8 @@ install(PROGRAMS ${LOGIN_INSTALL_FILES} DESTINATION bin COMPONENT daemon) set(CPACK_GENERATOR "DEB") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "pigpiod, libpaho-mqttpp") set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_CONFIG_DIR}/license") set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${PROJECT_CONFIG_DIR}/preinst;${PROJECT_CONFIG_DIR}/postinst;${PROJECT_CONFIG_DIR}/prerm;${PROJECT_CONFIG_DIR}/conffiles") set(CPACK_PACKAGE_VENDOR "MuonPi.org") @@ -232,7 +235,6 @@ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION " It opens serial and i2c connections to th It runs in the background and sends the data to the central server. It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "MuonPi ") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.28), libc++ (>=7), lftp (>=4.7), libcrypto++6, libqt5serialport5 (>= 5), libpaho-mqttpp (>=1.1.0), libconfig++-dev, pigpiod") set(CPACK_PACKAGE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/../packages/") include(CPack) diff --git a/source/daemon/config/changelog b/source/daemon/config/changelog index e84df6bb..01632126 100644 --- a/source/daemon/config/changelog +++ b/source/daemon/config/changelog @@ -7,7 +7,7 @@ muondetector-daemon (2.0.1) ; urgency=low * Updates: - added configuration option for input polarity (input1_polarity/input2_polarity) in muondetector.conf file - -- MuonPi Wed, 16. Dec 2020 21:55:00 +0100 + -- MuonPi Fri, 29. Jan 2021 10:10:00 +0100 muondetector-daemon (2.0.0) ; urgency=low diff --git a/source/daemon/config/license b/source/daemon/config/license index d886c3d2..9bda05cc 100644 --- a/source/daemon/config/license +++ b/source/daemon/config/license @@ -3,7 +3,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ #Source: https://github.com/marvin5300/muondetector Files: * -Copyright: 2020 Marvin Peter +Copyright: 2020 MuonPi.org License: GPL-3.0+ License: GPL-3.0+ diff --git a/source/daemon/config/muondetector-daemon.1 b/source/daemon/config/muondetector-daemon.1 index 52cf9ce3..1f0be361 100644 --- a/source/daemon/config/muondetector-daemon.1 +++ b/source/daemon/config/muondetector-daemon.1 @@ -1,5 +1,5 @@ .\" manpage for muondetector-daemon -.\" Contact marvin.peter@physik.uni-giessen.de to correct errors or typos +.\" Contact developer@muonpi.org to correct errors or typos .TH "muondetector-daemon" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector manpage" .SH "NAME" muondetector-daemon - daemon for muondetector board @@ -111,7 +111,7 @@ Default .SH "BUGS" No known bugs. .SH "AUTHOR" -Marvin Peter +MuonPi.org .SH "COPYRIGHT" License: GPL-3.0+ .PP diff --git a/source/daemon/config/muondetector-login b/source/daemon/config/muondetector-login new file mode 100755 index 00000000..bc6159bd --- /dev/null +++ b/source/daemon/config/muondetector-login @@ -0,0 +1,2 @@ +#!/bin/bash +sudo runuser -u muonuser -- /usr/lib/muondetector/bin/muondetector-login diff --git a/source/daemon/config/muondetector-login-helper b/source/daemon/config/muondetector-login-helper deleted file mode 100755 index 60995b73..00000000 --- a/source/daemon/config/muondetector-login-helper +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -sudo runuser -u muonuser -- /var/muondetector/muondetector-login diff --git a/source/daemon/config/muondetector-login-helper.1 b/source/daemon/config/muondetector-login-helper.1 deleted file mode 100644 index 3abadc4d..00000000 --- a/source/daemon/config/muondetector-login-helper.1 +++ /dev/null @@ -1,17 +0,0 @@ -.\" Manpage for muondetector-login-helper -.\" Contact developer@muonpi.org to correct errors or typos. -.TH "muondetector-login-helper" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector login helper manpage" -.SH NAME -muondetector-login-helper \- Wrapper to execute the muondetector-login as the correct user. -.SH SYNOPSIS -muondetector-login-helper -.SH DESCRIPTION -The muondetector-login-helper script starts the program muondetector-login as the correct user to ensure proper execution. -.SH OPTIONS -The muondetector-login-helper program does not take any options. All necessary information is asked for interactively. -.SH SEE ALSO -muondetector-login(1), muondetector-daemon(1) -.SH BUGS -No known bugs. -.SH AUTHOR -MuonPi (developer@muonpi.org) diff --git a/source/daemon/config/muondetector-login.1 b/source/daemon/config/muondetector-login.1 index cb46683a..0c81b6ae 100644 --- a/source/daemon/config/muondetector-login.1 +++ b/source/daemon/config/muondetector-login.1 @@ -1,16 +1,16 @@ .\" Manpage for muondetector-login .\" Contact developer@muonpi.org to correct errors or typos. -.TH "muondetector-login" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector manpage" +.TH "muondetector-login" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector login manpage" .SH NAME -muondetector-login \- Store login information for the muondetector daemon safely +muondetector-login \- Wrapper to execute the muondetector-login as the correct user. .SH SYNOPSIS muondetector-login .SH DESCRIPTION -The muondetector-login program asks for the login information for the muondetector-daemon and stores it safely instead of writing it to the configuration file in plain text. This program should be ran as the user 'muonuser'. There is a helper script available which sets the correct user. +The muondetector-login script starts the program muondetector-login as the correct user to ensure proper execution. .SH OPTIONS The muondetector-login program does not take any options. All necessary information is asked for interactively. .SH SEE ALSO -muondetector-login-helper(1), muondetector-daemon(1) +muondetector-login(1), muondetector-daemon(1) .SH BUGS No known bugs. .SH AUTHOR diff --git a/source/daemon/config/preinst b/source/daemon/config/preinst index 8f30edb3..99c26d3c 100755 --- a/source/daemon/config/preinst +++ b/source/daemon/config/preinst @@ -1,6 +1,6 @@ #!/bin/bash -e mkdir -p /var/muondetector -useradd muonuser -g users -G dialout,pi,i2c,users -s /usr/sbin/nologin -r -N -M -b /var/muondetector +useradd muonuser -g users -G dialout,pi,i2c,users -s /usr/sbin/nologin -r -N -M -b /var/muondetector || echo "User already exists" chown muonuser:users /var/muondetector chmod g+w /var/muondetector diff --git a/source/daemon/include/calibration.h b/source/daemon/include/calibration.h index 3bcd00c4..0c39eab9 100644 --- a/source/daemon/include/calibration.h +++ b/source/daemon/include/calibration.h @@ -24,7 +24,7 @@ struct CalibStruct; // meaning of entries (columns is: // static const std::vector> CALIBITEMS = { - std::make_tuple("VERSION", "UINT8", "2") , + std::make_tuple("VERSION", "UINT8", "3") , std::make_tuple("FEATURE_FLAGS", "UINT8", "0") , std::make_tuple("CALIB_FLAGS", "UINT8", "0") , std::make_tuple("DATE", "UINT32", "0") , @@ -32,12 +32,9 @@ static const std::vector> CALI std::make_tuple("VDIV", "UINT16", "1100") , std::make_tuple("COEFF0", "FLOAT", "0.0") , std::make_tuple("COEFF1", "FLOAT", "1.0") , - std::make_tuple("COEFF2", "FLOAT", "1.0") , + std::make_tuple("COEFF2", "FLOAT", "0.0") , std::make_tuple("COEFF3", "FLOAT", "1.0") , std::make_tuple("WRITE_CYCLES", "UINT32", "1") - /* list init formally introduced in C++17 - * but it works with the current gnu c++ compiler with gnu++11 extensions. - * if your compiler is more strict, you should use init via make_tuple*/ }; diff --git a/source/daemon/include/gpio_mapping.h b/source/daemon/include/gpio_mapping.h index e1d98c9a..93cdecbf 100644 --- a/source/daemon/include/gpio_mapping.h +++ b/source/daemon/include/gpio_mapping.h @@ -9,40 +9,8 @@ // define pins on the raspberry pi, UBIAS_EN is the power on/off pin for bias voltage // PREAMP_1/2 enables the DC voltage to power the preamp through the signal cable -// Attention: the GPIO pin definitions are referring to wiringPi standard except the EVT input pins -// which are in pigpio standard - -// HW Ver. 1 -/* -//#define UBIAS_EN 4 // pigpio -#define UBIAS_EN 7 // wiringpi -#define PREAMP_1 28 // pigpio 20 -#define PREAMP_2 29 // pigpio 21 -#define EVT_AND 5 -#define EVT_XOR 6 -#define GAIN_HL 0 // pigpio 17 -#define ADC_READY 23 -#define TIMEPULSE 18 -#define STATUS1 13 // (23) -#define STATUS2 19 // (24) -#define STATUS3 26 // (25) -*/ -// HW Ver 2: pigpio pin numbers (wiring pi numbers) -//#define UBIAS_EN 26 // (25) -//#define PREAMP_1 4 // (7) -//#define PREAMP_2 17 // (0) -//#define EVT_AND 22 // (3) -//#define EVT_XOR 27 // (2) -//#define GAIN_HL 6 // (22) -//#define ADC_READY 12 // (26) -//#define TIMEPULSE 18 // (1) -//#define TIME_MEAS_OUT 5 // (21) -//#define STATUS1 13 // (23) -//#define STATUS2 19 // (24) -//#define PREAMP_FAULT 23 // (4) - // ATTENTION: -// TO MAKE IT MORE SIMPLE THERE WILL BE ONLY PIGPIO, +// TO MAKE IT MORE SIMPLE THERE WILL BE ONLY PIGPIO NAMING STANDARD, // NO WIRING PI FROM NOW static const std::map GPIO_PINMAP_VERSIONS[MAX_HW_VER+1] = { diff --git a/source/daemon/src/main.cpp b/source/daemon/src/main.cpp index 8986fe08..111bc266 100644 --- a/source/daemon/src/main.cpp +++ b/source/daemon/src/main.cpp @@ -319,7 +319,7 @@ int main(int argc, char *argv[]) //if (verbose>2) qWarning() << "No 'ublox_device' setting in configuration file. Will guess..."; QDir directory("/dev","*",QDir::Name, QDir::System); - QStringList serialports = directory.entryList(QStringList({"ttyS0","ttyAMA0"})); + QStringList serialports = directory.entryList(QStringList({"ttyS0","ttyAMA0","serial0"})); if (!serialports.empty()){ gpsdevname=QString("/dev/"+serialports.last()); //if (verbose>2) diff --git a/source/gui/CMakeLists.txt b/source/gui/CMakeLists.txt index 712539a7..7e58a4b6 100644 --- a/source/gui/CMakeLists.txt +++ b/source/gui/CMakeLists.txt @@ -33,6 +33,7 @@ set(QWT_DIR "C:/Qwt-6.1.4") set(OPENSSL_DIR "C:/Qt/Tools/OpenSSL/Win_x64") set(MQTT_CPP_DIR "C:/paho-mqtt-cpp-1.1.0-win64") set(MQTT_C_DIR "C:/eclipse-paho-mqtt-c-win64-1.3.6") +set(CRYPTOPP_DIR "C:/cryptopp") list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5QuickCompiler") list(APPEND CMAKE_PREFIX_PATH "C:/Qt/5.15.1/msvc2019_64/lib/cmake/Qt5") @@ -80,14 +81,18 @@ endif() find_package(Qt5 COMPONENTS Network Svg Widgets Gui Quick QuickWidgets Qml REQUIRED) +if(NOT WIN32) + find_library(PAHO_MQTT3C paho-mqtt3c REQUIRED) find_library(PAHO_MQTT3A paho-mqtt3a REQUIRED) find_library(PAHO_MQTT3CS paho-mqtt3cs REQUIRED) find_library(PAHO_MQTT3AS paho-mqtt3as REQUIRED) find_library(PAHO_MQTTPP3 paho-mqttpp3 REQUIRED) - find_library(CRYPTOPP crypto++ REQUIRED) find_library(QWT_QT5 qwt-qt5 REQUIRED) + +endif() + find_library(MUONDETECTOR_LIB NAMES muondetector HINTS "${CMAKE_CURRENT_BINARY_DIR}/../lib/" REQUIRED) set(CMAKE_CXX_STANDARD 17) @@ -229,7 +234,10 @@ add_definitions(-DQWT_DLL) target_include_directories(muondetector-gui PUBLIC ${OPENSSL_DIR}/include/ + $ + $ $ + $ $ $ $ @@ -246,6 +254,7 @@ target_link_directories(muondetector-gui PUBLIC "${MQTT_C_DIR}/lib/" "${QWT_DIR}/lib/" "${OPENSSL_DIR}/lib/" + "${CRYPTOPP_DIR}/lib/" ) target_link_libraries(muondetector-gui @@ -347,15 +356,16 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/muondetector-gui.1.gz" DESTINATION "s install(FILES "${PROJECT_CONFIG_DIR}/copyright" DESTINATION "${CMAKE_INSTALL_DOCDIR}" COMPONENT gui) set(CPACK_GENERATOR "DEB") +set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) +set(CPACK_DEBIAN_PACKAGE_DEPENDS "libpaho-mqttpp | paho-mqtt-cpp, qml-module-qtpositioning (>=5), qml-module-qtlocation (>=5), qml-module-qtquick2 (>=5), qml-module-qtquick-layouts (>=5), qml-module-qtquick-controls2 (>=5), qml-module-qtquick-controls (>=5), qml-module-qtquick-templates2 (>=5)") set(CPACK_DEBIAN_PACKAGE_SECTION "net") set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/MuonPi/muondetector") -set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "It connects to muondetector-daemon via TCP. It is based on Qt and C++. -It lets you change the settings for the muondetector hardware and -uses qml for displaying the current position on the map if connected -the muondetector-daemon. -It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") +set(CPACK_DEBIAN_PACKAGE_DESCRIPTION " It connects to muondetector-daemon via TCP. It is based on Qt and C++. + It lets you change the settings for the muondetector hardware and + uses qml for displaying the current position on the map if connected + the muondetector-daemon. + It is licensed under the GNU Lesser General Public License version 3 (LGPL v3).") set(CPACK_DEBIAN_PACKAGE_MAINTAINER "MuonPi ") -set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>=2.28), libc++ (>=7), libqt5gui5 (>=5), libqt5widgets5 (>=5), libqt5core5a (>=5), libqt5quickwidgets5 (>=5.3), libqt5network5 (>=5), qml-module-qtpositioning (>=5), qml-module-qtlocation (>=5), qml-module-qtquick2 (>=5), qml-module-qtquick-layouts (>=5), qml-module-qtquick-controls2 (>=5), qml-module-qtquick-controls (>=5), qml-module-qtquick-templates2 (>=5), libqwt-qt5-6 (>=6.1.2)") endif() set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_CONFIG_DIR}/license") diff --git a/source/gui/config/changelog b/source/gui/config/changelog index c13672f5..29fc59ee 100644 --- a/source/gui/config/changelog +++ b/source/gui/config/changelog @@ -1,53 +1,59 @@ +muondetector-gui (2.0.1) ; urgency=low + + * Improved window resize functionality. + + -- MuonPi.org Fri, 29 Jan 2021 11:07:00 +0100 + muondetector-gui (2.0.0) ; urgency=low * Updated - -- Marvin Peter Wed, 16 Dec 2020 22:02:00 +0100 + -- MuonPi.org Wed, 16 Dec 2020 22:02:00 +0100 muondetector-gui (1.2.2) ; urgency=low * Updated - -- Marvin Peter Wed, 12 Aug 2020 01:00:00 +0200 + -- MuonPi.org Wed, 12 Aug 2020 01:00:00 +0200 muondetector-gui (1.2.1) ; urgency=low * Updated - -- Marvin Peter Mon, 20 Jul 2020 09:00:00 +0200 + -- MuonPi.org Mon, 20 Jul 2020 09:00:00 +0200 muondetector-gui (1.2.0) ; urgency=low * Updated - -- Marvin Peter Tue, 16 Jun 2020 22:00:00 +0200 + -- MuonPi.org Tue, 16 Jun 2020 22:00:00 +0200 muondetector-gui (1.1.2) ; urgency=low * Updated - -- Marvin Peter Mon, 27 Apr 2020 16:30:00 +0200 + -- MuonPi.org Mon, 27 Apr 2020 16:30:00 +0200 muondetector-gui (1.1.1) ; urgency=low * Updated - -- Marvin Peter Mon, 03 Mar 2020 15:00:00 +0100 + -- MuonPi.org Mon, 03 Mar 2020 15:00:00 +0100 muondetector-gui (1.1.0) ; urgency=low * Updated - -- Marvin Peter Thu, 22 Aug 2019 14:12:17 +0200 + -- MuonPi.org Thu, 22 Aug 2019 14:12:17 +0200 muondetector-gui (1.0.3) ; urgency=low * Updated - -- Marvin Peter Thu, 22 Aug 2019 14:12:17 +0200 + -- MuonPi.org Thu, 22 Aug 2019 14:12:17 +0200 muondetector-gui (1.0.1) ; urgency=low * Initial release. - -- Marvin Peter Fri, 26 Oct 2018 15:20:00 +0200 + -- MuonPi.org Fri, 26 Oct 2018 15:20:00 +0200 diff --git a/source/gui/config/license b/source/gui/config/license index 232c28ba..3ad6dab0 100644 --- a/source/gui/config/license +++ b/source/gui/config/license @@ -3,7 +3,7 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ #Source: https://github.com/MuonPi/muondetector Files: * -Copyright: 2020 Marvin Peter +Copyright: 2020 MuonPi.org License: GPL-3.0+ License: GPL-3.0+ diff --git a/source/gui/config/muondetector-gui.1 b/source/gui/config/muondetector-gui.1 index b518e730..782bea1d 100644 --- a/source/gui/config/muondetector-gui.1 +++ b/source/gui/config/muondetector-gui.1 @@ -1,5 +1,5 @@ .\" manpage for muondetector-gui -.\" Contact marvin.peter@physik.uni-giessen.de to correct errors or typos +.\" Contact developer@muonpi.org to correct errors or typos .TH "muondetector-gui" "1" "@PROJECT_DATE_STRING@" "v @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@" "muondetector-gui manpage" .SH "NAME" muondetector-gui - gui for muondetector-daemon @@ -29,7 +29,7 @@ Default .SH "BUGS" No known bugs. .SH "AUTHOR" -Marvin Peter +MuonPi.org .SH "COPYRIGHT" License: GPL-3.0+ .PP diff --git a/source/gui/include/parametermonitorform.h b/source/gui/include/parametermonitorform.h index f6b40270..51716595 100644 --- a/source/gui/include/parametermonitorform.h +++ b/source/gui/include/parametermonitorform.h @@ -49,6 +49,7 @@ public slots: void onIntCounterReceived(quint32 cnt); void onTimeMarkReceived(const UbxTimeMarkStruct& tm); void onPolarityReceived(bool pol1, bool pol2); + void onUiEnabledStateChange(bool connected); private slots: void on_dacSpinBox1_valueChanged(double arg1); diff --git a/source/gui/include/scanform.h b/source/gui/include/scanform.h index 7d035737..6e585630 100644 --- a/source/gui/include/scanform.h +++ b/source/gui/include/scanform.h @@ -32,6 +32,7 @@ class ScanForm : public QWidget void gpioInhibitChanged(bool inhibitState); public slots: void onTimeMarkReceived(const UbxTimeMarkStruct& tm); + void onUiEnabledStateChange(bool connected); private slots: void on_scanStartPushButton_clicked(); diff --git a/source/gui/src/calibform.cpp b/source/gui/src/calibform.cpp index 5960366a..ac2fde7e 100644 --- a/source/gui/src/calibform.cpp +++ b/source/gui/src/calibform.cpp @@ -331,7 +331,7 @@ void CalibForm::onUiEnabledStateChange(bool connected) { //measureBiasCalibGroupBox if (!connected) { - ui->calibItemTableWidget->setRowCount(0); + ui->calibItemTableWidget->setRowCount(0); fCalibList.clear(); ui->eepromValidLabel->setText("N/A"); ui->calibValidLabel->setText("N/A"); @@ -340,6 +340,8 @@ void CalibForm::onUiEnabledStateChange(bool connected) //ui->measureBiasCalibGroupBox->setEnabled(connected); //ui->biasCalibGroupBox->setEnabled(connected); ui->calibItemsGroupBox->setEnabled(connected); + ui->eepromGroupBox->setEnabled(connected); + ui->calibrationScanPushButton->setEnabled(connected); //ui->currentCalibGroupBox->setEnabled(connected); } diff --git a/source/gui/src/logplotswidget.cpp b/source/gui/src/logplotswidget.cpp index 427536be..310de986 100644 --- a/source/gui/src/logplotswidget.cpp +++ b/source/gui/src/logplotswidget.cpp @@ -24,6 +24,9 @@ LogPlotsWidget::LogPlotsWidget(QWidget *parent) : ui->logPlot->curve("curve1").setSymbol(sym); ui->logPlot->setAxisAutoScale(QwtPlot::xBottom, true); ui->logPlot->setAxisAutoScale(QwtPlot::yLeft, true); + + ui->logPlot->setMinimumHeight(100); + ui->logPlot->replot(); } diff --git a/source/gui/src/logplotswidget.ui b/source/gui/src/logplotswidget.ui index 3e796d39..d0bc7c4e 100644 --- a/source/gui/src/logplotswidget.ui +++ b/source/gui/src/logplotswidget.ui @@ -7,7 +7,7 @@ 0 0 478 - 462 + 505 @@ -16,6 +16,12 @@ + + + 0 + 0 + + Log Info @@ -24,6 +30,18 @@ + + + 0 + 0 + + + + + 110 + 0 + + Current Data File @@ -36,22 +54,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - @@ -75,6 +77,18 @@ + + + 0 + 0 + + + + + 110 + 0 + + Current Log File @@ -87,22 +101,6 @@ - - - - Qt::Horizontal - - - QSizePolicy::MinimumExpanding - - - - 40 - 20 - - - - @@ -126,6 +124,18 @@ + + + 0 + 0 + + + + + 110 + 0 + + Status @@ -182,6 +192,12 @@ + + + 0 + 0 + + Qt::Horizontal @@ -220,11 +236,17 @@ - + 0 0 + + + 0 + 80 + + 16777215 @@ -243,12 +265,12 @@ QAbstractItemView::SelectRows - - 80 - 70 + + 80 + true @@ -312,16 +334,28 @@ + + + 0 + 0 + + 200 - 200 + 80 + + + 0 + 0 + + diff --git a/source/gui/src/mainwindow.cpp b/source/gui/src/mainwindow.cpp index 4f40308c..f30052cd 100644 --- a/source/gui/src/mainwindow.cpp +++ b/source/gui/src/mainwindow.cpp @@ -114,6 +114,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->tabWidget->removeTab(0); Status *status = new Status(this); connect(this, &MainWindow::setUiEnabledStates, status, &Status::onUiEnabledStateChange); + connect(this, &MainWindow::gpioRates, status, &Status::onGpioRatesReceived); connect(status, &Status::resetRateClicked, this, [this](){ this->sendRequest(TCP_MSG_KEY::MSG_GPIO_RATE_RESET); } ); connect(this, &MainWindow::adcSampleReceived, status, &Status::onAdcSampleReceived); @@ -221,7 +222,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->tabWidget->addTab(histoTab,"Statistics"); ParameterMonitorForm *paramTab = new ParameterMonitorForm(this); - //connect(this, &MainWindow::setUiEnabledStates, paramTab, &ParameterMonitorForm::onUiEnabledStateChange); + connect(this, &MainWindow::setUiEnabledStates, paramTab, &ParameterMonitorForm::onUiEnabledStateChange); connect(this, &MainWindow::adcSampleReceived, paramTab, &ParameterMonitorForm::onAdcSampleReceived); connect(this, &MainWindow::adcTraceReceived, paramTab, &ParameterMonitorForm::onAdcTraceReceived); connect(this, &MainWindow::dacReadbackReceived, paramTab, &ParameterMonitorForm::onDacReadbackReceived); @@ -248,7 +249,7 @@ MainWindow::MainWindow(QWidget *parent) : ui->tabWidget->addTab(paramTab,"Parameters"); ScanForm *scanTab = new ScanForm(this); - //connect(this, &MainWindow::setUiEnabledStates, paramTab, &ParameterMonitorForm::onUiEnabledStateChange); + connect(this, &MainWindow::setUiEnabledStates, scanTab, &ScanForm::onUiEnabledStateChange); connect(this, &MainWindow::timeMarkReceived, scanTab, &ScanForm::onTimeMarkReceived); connect(scanTab, &ScanForm::setDacVoltage, this, &MainWindow::sendSetThresh); connect(scanTab, &ScanForm::gpioInhibitChanged, this, &MainWindow::gpioInhibit); @@ -260,7 +261,10 @@ MainWindow::MainWindow(QWidget *parent) : connect(this, &MainWindow::setUiEnabledStates, logTab, &LogPlotsWidget::onUiEnabledStateChange); connect(paramTab, &ParameterMonitorForm::biasVoltageCalculated, logTab, &LogPlotsWidget::onBiasVoltageCalculated); connect(paramTab, &ParameterMonitorForm::biasCurrentCalculated, logTab, &LogPlotsWidget::onBiasCurrentCalculated); - connect(this, &MainWindow::gpioRates, logTab, &LogPlotsWidget::onGpioRatesReceived); + + connect(this, &MainWindow::gpioRates, logTab, &LogPlotsWidget::onGpioRatesReceived, Qt::QueuedConnection); + + connect(this, &MainWindow::logInfoReceived, logTab, &LogPlotsWidget::onLogInfoReceived); ui->tabWidget->addTab(logTab, "Log"); @@ -276,6 +280,9 @@ MainWindow::MainWindow(QWidget *parent) : item->setEnabled(false); // initialise all ui elements that will be inactive at start uiSetDisconnectedState(); + +// printf("WindowSize %d %d\r\n",this->width(),this->height()); + } MainWindow::~MainWindow() diff --git a/source/gui/src/mainwindow.ui b/source/gui/src/mainwindow.ui index 57d46f55..41b6077e 100644 --- a/source/gui/src/mainwindow.ui +++ b/source/gui/src/mainwindow.ui @@ -10,7 +10,7 @@ 0 0 608 - 490 + 575 @@ -469,6 +469,12 @@ + + + 0 + 0 + + 16777215 diff --git a/source/gui/src/map.ui b/source/gui/src/map.ui index a7ca4ca1..042ef6c0 100644 --- a/source/gui/src/map.ui +++ b/source/gui/src/map.ui @@ -20,6 +20,18 @@ Form + + 8 + + + 8 + + + 8 + + + 8 + @@ -39,7 +51,7 @@ QQuickWidget QWidget -
QQuickWidget
+
QtQuickWidgets/QQuickWidget
diff --git a/source/gui/src/parametermonitorform.cpp b/source/gui/src/parametermonitorform.cpp index b51deb1f..f9a9bf6d 100644 --- a/source/gui/src/parametermonitorform.cpp +++ b/source/gui/src/parametermonitorform.cpp @@ -47,6 +47,7 @@ ParameterMonitorForm::ParameterMonitorForm(QWidget *parent) : connect(ui->pol1CheckBox, &QCheckBox::clicked, this, &ParameterMonitorForm::onPolarityCheckBoxClicked); connect(ui->pol2CheckBox, &QCheckBox::clicked, this, &ParameterMonitorForm::onPolarityCheckBoxClicked); + ui->adcTracePlot->setMinimumHeight(30); } void ParameterMonitorForm::on_timingSelectionComboBox_currentIndexChanged(int index) @@ -343,3 +344,7 @@ void ParameterMonitorForm::onPolarityCheckBoxClicked(bool /*checked*/){ emit polarityChanged(pol1, pol2); } +void ParameterMonitorForm::onUiEnabledStateChange(bool connected) +{ + this->setEnabled(connected); +} diff --git a/source/gui/src/parametermonitorform.ui b/source/gui/src/parametermonitorform.ui index 27142fcb..b5306524 100644 --- a/source/gui/src/parametermonitorform.ui +++ b/source/gui/src/parametermonitorform.ui @@ -128,7 +128,7 @@
- 11 + 10 @@ -216,7 +216,7 @@ - 11 + 10 @@ -304,7 +304,7 @@ - 11 + 10 @@ -392,7 +392,7 @@ - 11 + 10 @@ -514,7 +514,7 @@ - 11 + 10 @@ -572,7 +572,7 @@ - 11 + 10 @@ -691,7 +691,7 @@ - 11 + 10 @@ -784,6 +784,11 @@ 16777215 + + + 10 + + V @@ -945,24 +950,31 @@
- 10 + 9 + 50 + false Channel Settings - + 0 30 - 125 + 127 80 + + + 9 + + Ch 1 @@ -970,6 +982,11 @@ + + + 9 + + Ch 2 @@ -977,6 +994,11 @@ + + + 9 + + Preamp Bias @@ -1014,6 +1036,11 @@ Bias + + + 9 + + Polarity @@ -1100,7 +1127,7 @@ Bias - 10 + 9 diff --git a/source/gui/src/scanform.cpp b/source/gui/src/scanform.cpp index b9951c04..1acbf253 100644 --- a/source/gui/src/scanform.cpp +++ b/source/gui/src/scanform.cpp @@ -121,7 +121,7 @@ void ScanForm::on_scanStartPushButton_clicked() active=true; waitForFirst=true; scanData.clear(); - ui->scanProgressBar->setRange(0, (maxRange-minRange)/stepSize+0.5); + ui->scanProgressBar->setRange(0, abs(maxRange-minRange)/stepSize+0.5); ui->scanProgressBar->reset(); } @@ -159,3 +159,8 @@ void ScanForm::on_plotDifferentialCheckBox_toggled(bool checked) plotDifferential=checked; updateScanPlot(); } + +void ScanForm::onUiEnabledStateChange(bool connected) +{ + this->setEnabled(connected); +} diff --git a/source/gui/src/settings.ui b/source/gui/src/settings.ui index 7b221155..0802b62f 100644 --- a/source/gui/src/settings.ui +++ b/source/gui/src/settings.ui @@ -9,8 +9,8 @@ 0 0 - 660 - 618 + 734 + 600 @@ -29,7 +29,7 @@ true - + @@ -925,7 +925,7 @@ - + Qt::Vertical @@ -940,62 +940,29 @@ - - - Qt::Horizontal - - - - 40 - 20 - + + + Reset Ublox Chip - + - - - - - Save Config to Flash - - - - - - - Reset Ublox Chip - - - - + + + Save Config to Flash + +
- - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 331 - 5 - - - - - Qt::Horizontal - + QDialogButtonBox::Apply|QDialogButtonBox::Discard|QDialogButtonBox::RestoreDefaults diff --git a/source/gui/src/status.cpp b/source/gui/src/status.cpp index 375eb62d..e074dbdd 100644 --- a/source/gui/src/status.cpp +++ b/source/gui/src/status.cpp @@ -70,7 +70,7 @@ void Status::onGpioRatesReceived(quint8 whichrate, QVector rates){ bool foundK = false; // if foundK it has found an index k where the x values of the input points // are smaller or equal to the x values of the already existing points -> overlap for (int i = xorSamples.size()-1; i>=xorSamples.size()-1-rates.size(); i--){ - if (rates.at(k).x()<=xorSamples.at(i).x()){ + if (rates.at(k).x() <= xorSamples.at(i).x()){ foundK = true; } } @@ -81,10 +81,11 @@ void Status::onGpioRatesReceived(quint8 whichrate, QVector rates){ } } } + for (auto rate : rates){ xorSamples.append(rate); } - while (xorSamples.first().x()ratePlot->plotXorSamples(xorSamples); @@ -106,12 +107,15 @@ void Status::onGpioRatesReceived(quint8 whichrate, QVector rates){ } } } + for (auto rate : rates){ andSamples.append(rate); } - while (andSamples.first().x()0) && (andSamples.first().x() < (rates.last().x() - rateSecondsBuffered))){ andSamples.pop_front(); } + statusUi->ratePlot->plotAndSamples(andSamples); } } diff --git a/source/gui/src/status.ui b/source/gui/src/status.ui index 453fa243..5979402d 100644 --- a/source/gui/src/status.ui +++ b/source/gui/src/status.ui @@ -7,7 +7,7 @@ 0 0 595 - 520 + 438 @@ -55,6 +55,12 @@ 0 + + + 0 + 0 + + @@ -102,6 +108,12 @@ 0 + + + 0 + 0 + + @@ -153,7 +165,7 @@ true - + 0 0 @@ -176,6 +188,12 @@ + + + 0 + 0 + + QFrame::Box @@ -189,6 +207,12 @@ + + + 0 + 0 + + 0 @@ -258,6 +282,12 @@ + + + 0 + 0 + + 0 @@ -352,7 +382,7 @@ - + 0 0 @@ -501,6 +531,12 @@ + + + 0 + 0 + + 0 @@ -575,6 +611,12 @@ + + + 0 + 0 + + 9 @@ -601,6 +643,12 @@ + + + 0 + 0 + + QFrame::Box @@ -612,21 +660,14 @@ - - - - Qt::Vertical - - - - 20 - 46 - - - - + + + 0 + 0 + + QFrame::Box diff --git a/source/library/CMakeLists.txt b/source/library/CMakeLists.txt index 22b5491c..489bcd5c 100644 --- a/source/library/CMakeLists.txt +++ b/source/library/CMakeLists.txt @@ -78,12 +78,16 @@ endif() find_package(Qt5 COMPONENTS Network REQUIRED) +if(NOT WIN32) + find_library(PAHO_MQTT3C paho-mqtt3c REQUIRED) find_library(PAHO_MQTT3A paho-mqtt3a REQUIRED) find_library(PAHO_MQTT3CS paho-mqtt3cs REQUIRED) find_library(PAHO_MQTT3AS paho-mqtt3as REQUIRED) find_library(PAHO_MQTTPP3 paho-mqttpp3 REQUIRED) +endif() + add_compile_options( -Wall -O3 diff --git a/source/library/include/config.h b/source/library/include/config.h index 1bc770be..1ac8079a 100644 --- a/source/library/include/config.h +++ b/source/library/include/config.h @@ -15,7 +15,7 @@ constexpr struct Version { [[nodiscard]] auto string() const -> std::string; } - hardware { 2, 0, 0 }, + hardware { 3, 0, 0 }, software { CMake::Version::major, CMake::Version::minor, CMake::Version::patch }; } diff --git a/source/library/include/gpio_pin_definitions.h b/source/library/include/gpio_pin_definitions.h index 5a4e3ea8..c9b916f2 100644 --- a/source/library/include/gpio_pin_definitions.h +++ b/source/library/include/gpio_pin_definitions.h @@ -61,29 +61,6 @@ static const QMap GPIO_SIGNAL_MAP = { UNDEFINED_PIN, { "UNDEFINED_PIN", DIR_UNDEFINED} } }; -/* -static const QMap GPIO_PIN_NAMES = - { { UBIAS_EN, "UBIAS_EN" }, - { PREAMP_1, "PREAMP_1" }, - { PREAMP_2, "PREAMP_2" }, - { EVT_AND, "EVT_AND" }, - { EVT_XOR, "EVT_XOR" }, - { GAIN_HL, "GAIN_HL" }, - { ADC_READY, "ADC_READY"}, - { TIMEPULSE, "TIMEPULSE"}, - { TIME_MEAS_OUT,"TIME_MEAS_OUT" }, - { STATUS1, "STATUS1" }, - { STATUS2, "STATUS2" }, - { STATUS3, "STATUS3" }, - { PREAMP_FAULT, "PREAMP_FAULT" }, - { EXT_TRIGGER, "EXT_TRIGGER" }, - { TDC_INTB, "TDC_INTB" }, - { TDC_STATUS, "TDC_STATUS" }, - { IN_POL1, "IN_POL1" }, - { IN_POL2, "IN_POL2" }, - { UNDEFINED_PIN, "UNDEFINED_PIN" } - }; -*/ static const QVector TIMING_MUX_SIGNAL_NAMES = { @@ -96,7 +73,8 @@ enum class TIMING_MUX_SELECTION : uint8_t { DISCR1 = 2, DISCR2 = 3, TIMEPULSE = 5, - EXT = 7 + EXT = 7, + UNDEFINED = 255 }; #endif // GPIO_PIN_DEFINITIONS_H