gui_calculation_thread.py
This document contains all the code related to calculating the solution to the different aims in the GUI.
- class ScenarioGUI.gui_classes.gui_calculation_thread.CalcProblem(d_s: DataStorage, item: QtW.QListWidgetItem, parent=None, *, data_2_results_function: Callable[[DataStorage], tuple[object, partial[[], None]] | tuple[object, Callable[[], None]]])
Bases:
QThreadclass to calculate the problem in an external thread
This function initialises the calculation class.
- Parameters
- d_sDataStorage
DataStorage object with all the date to perform the calculation for
- idxint
Index of the current calculation thread
- parent
Parent class of the calculation problem
- data_2_results_functionCallable
function to create the results class and a function to be called in the thread
- run() None
This function contains the actual code to run the different calculations. For each aim in the GUI, a new if statement is used. Here, one can put all the code needed to run the simulation/calculation with the all the functionalities of GHEtool. This function should return the DataStorage as a signal.
- Returns
- None
- ScenarioGUI.gui_classes.gui_calculation_thread.calculate(data_2_results_function: Callable[[DataStorage], tuple[object, Callable]], d_s: DataStorage, queue: mp.Queue, stop_event: mp.Event) None
This function contains the actual code to run the different calculations. For each aim in the GUI, a new if statement is used. Here, one can put all the code needed to run the simulation/calculation with the all the functionalities. This function should return the DataStorage as a signal.
- Returns
- None