heat_transfer_gui.py
def update_simulation_time(self, simulation_state: str) -> None:
        """
        Keeping the user notified about the time the simulation is taking.
        Is being called everytime the simulation will emit it's state.
        Parameters:
            simulation_state (int) W

        Args:
            simulation_state  ... whether the simulation is running (1),
                                  is stopped(0) or has finished (2)
        """

        now = time.time()

        if simulation_state == 1:
            # Handle transition from paused to running
            if self.time_is_running is False:
                self.time_is_running = True
                self.time_spent_paused += now - self.simulation_paused_timestamp

            # Update the label to show latest time
            elapsed_time = now - self.simulation_started_timestamp - self.time_spent_paused
            self.update_time_label(elapsed_time)
        elif simulation_state == 0:
            # Handle transition from running to paused, otherwise do nothing
            if self.time_is_running is True:
                self.time_is_running = False
                self.simulation_paused_timestamp = now

                elapsed_time = now - self.simulation_started_timestamp - self.time_spent_paused
                self.update_time_label(elapsed_time)
        elif simulation_state == 2:
            # Handle the smoothing options after simulation has finished
            self.add_smoothing_options(self.verticalLayout_6)

        Keeping the user notified about the time the simulation is taking.
        Is being called everytime the simulation will emit it's state.
        Parameters:
            simulation_state (int) W

        Args:
            simulation_state  ... whether the simulation is running (1),
                                  is stopped(0) or has finished (2)
        
Keeping the user notified about the time the simulation is taking.
Is being called everytime the simulation will emit it's state.
Parameters:
simulation_state (int) W


Keeping the user notified about the time the simulation is taking . Is being called everytime the simulation will emit it ' s state . Parameters : simulation_state ( int ) W
def update_simulation_time(self, simulation_state: str) -> None:
        now = time.time()
        if simulation_state == 1:
            if self.time_is_running is False:
                self.time_is_running = True
                self.time_spent_paused += now - self.simulation_paused_timestamp
            elapsed_time = now - self.simulation_started_timestamp - self.time_spent_paused
            self.update_time_label(elapsed_time)
        elif simulation_state == 0:
            if self.time_is_running is True:
                self.time_is_running = False
                self.simulation_paused_timestamp = now
                elapsed_time = now - self.simulation_started_timestamp - self.time_spent_paused
                self.update_time_label(elapsed_time)
        elif simulation_state == 2:
            self.add_smoothing_options(self.verticalLayout_6)
def update_simulation_time ( self , simulation_state : str ) -> None : now = time . time ( ) if simulation_state == 1 : if self . time_is_running is False : self . time_is_running = True self . time_spent_paused += now - self . simulation_paused_timestamp elapsed_time = now - self . simulation_started_timestamp - self . time_spent_paused self . update_time_label ( elapsed_time ) elif simulation_state == 0 : if self . time_is_running is True : self . time_is_running = False self . simulation_paused_timestamp = now elapsed_time = now - self . simulation_started_timestamp - self . time_spent_paused self . update_time_label ( elapsed_time ) elif simulation_state == 2 : self . add_smoothing_options ( self . verticalLayout_6 )
Keeping the user notified about the time the simulation is taking.
Keeping the user notified about the time the simulation is taking .
"""
        Keeping the user notified about the time the simulation is taking.
        Is being called everytime the simulation will emit it's state.
        Parameters:
            simulation_state (int) W

        Args:
            simulation_state  ... whether the simulation is running (1),
                                  is stopped(0) or has finished (2)
        """ # Handle transition from paused to running # Update the label to show latest time # Handle transition from running to paused, otherwise do nothing # Handle the smoothing options after simulation has finished
self
simulation_state
str