Compare commits

...

5 Commits
main ... PyQt5

Author SHA1 Message Date
Jan
ccf49c8cfc MainCode/adalm1000_logger.py aktualisiert
Thread Management:

        Changed MeasurementThread to inherit from QThread instead of QObject

        Added proper thread cleanup in reconnect_device()

        Added checks for thread existence before attempting operations

    Error Handling:

        Added more robust error handling around thread operations

        Ensured proper cleanup of resources during reconnection attempts

        Added checks for thread running state before attempting to stop it

    Initialization:

        Explicitly initialized thread variables to None

        Added proper null checks before accessing thread methods

    Device Reconnection:

        Improved the reconnection flow with better cleanup

        Added status messages to keep user informed
(D)
2025-06-27 16:34:12 +02:00
Jan
ed99c29fa0 MainCode/adalm1000_logger.py aktualisiert
Initialization Order:

        Moved all attribute initializations to the start of __init__

        Specifically initialized self.test_phase = "Idle" before it's used

    UI Setup:

        Now safely sets the phase label text after self.test_phase is initialized

        Ensures all attributes exist before they're accessed

    Error Prevention:

        The QStandardPaths warning is still suppressed

        All UI elements are properly initialized before use
(D)
2025-06-27 16:28:40 +02:00
Jan
0b3177ead4 MainCode/adalm1000_logger.py aktualisiert
Initialization Order:

        Now initializes all data structures (time_data, voltage_data, etc.) in __init__ before they're used

        Initializes device after UI setup using QTimer.singleShot

    Error Handling:

        Properly handles the case when no ADALM1000 is detected

        Disables the start button until a device is connected

    Device Connection:

        Shows clear status messages about device connection state

        Provides a reconnect button for manual reconnection attempts

    Thread Safety:

        Ensures all data structures exist before any thread tries to access them
(D)
2025-06-27 16:24:00 +02:00
Jan
882f19945c MainCode/adalm1000_logger.py aktualisiert
Key changes made:

    Added os.environ['QT_LOGGING_RULES'] = 'qt.qpa.*=false' at the beginning to suppress the QStandardPaths warning.

    Added QGridLayout to the imports from PyQt5.QtWidgets.

    Fixed the display layout section to properly use QGridLayout.

    Made sure all necessary Qt classes are imported at the top of the file.
(D)
2025-06-27 16:18:35 +02:00
Jan
d2ab023fa8 MainCode/adalm1000_logger.py aktualisiert
Key Changes in the Migration:

    Threading Model:

        Replaced Tkinter's after() with Qt's signal/slot mechanism

        Created a proper QThread for continuous measurements

        Used Qt's built-in threading for better integration

    UI Structure:

        Replaced Tkinter widgets with Qt equivalents (QMainWindow, QWidget, QVBoxLayout, etc.)

        Used Qt's layout system instead of pack/grid

        Implemented styling with Qt's stylesheet system

    Event Handling:

        Replaced Tkinter's command callbacks with Qt's signal/slot connections

        Used pyqtSlot decorators for cleaner event handling

    Plotting:

        Switched to Qt's FigureCanvas backend for matplotlib

        Maintained the same plotting functionality but with Qt integration

    Error Handling:

        Replaced Tkinter messageboxes with Qt's QMessageBox

        Improved error handling with proper Qt signal propagation

    Cleanup:

        Implemented proper cleanup in closeEvent instead of protocol handlers

        Ensured proper thread termination on exit
(D)
2025-06-27 16:01:20 +02:00

File diff suppressed because it is too large Load Diff