Skip to content

Worker Receiver

Bases: QObject

A class representing a worker for receiving data.

Attributes:

Name Type Description
io IO

The IO module to handle CAN Bus communication

Source code in GUI.py
class WorkerReceiving(QObject):
    """
    A class representing a worker for receiving data.

    Attributes:
        io (IO): The IO module to handle CAN Bus communication
    """
    def __init__(self, io):
        """
        Initialize the WorkerReceiving.

        Args:
            io (IO): An instance of the IO class for input/output operations.
        """
        super().__init__()
        self.io = io
    def run(self):
        """
        Run the worker loop for receiving data.

        This method continuously calls the start_notifier method of the IO object to receive data.
        """
        while True:
            self.io.start_notifier()

__init__(io)

Initialize the WorkerReceiving.

Parameters:

Name Type Description Default
io IO

An instance of the IO class for input/output operations.

required
Source code in GUI.py
def __init__(self, io):
    """
    Initialize the WorkerReceiving.

    Args:
        io (IO): An instance of the IO class for input/output operations.
    """
    super().__init__()
    self.io = io

run()

Run the worker loop for receiving data.

This method continuously calls the start_notifier method of the IO object to receive data.

Source code in GUI.py
def run(self):
    """
    Run the worker loop for receiving data.

    This method continuously calls the start_notifier method of the IO object to receive data.
    """
    while True:
        self.io.start_notifier()