EnergySystemTab package

Das EnergySystemTab-Paket enthält die GUI-Komponenten für die Konfiguration und Verwaltung von Energiesystemen in der DistrictHeatingSim-Anwendung.

Energy System Main Tab Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Main tab for managing energy system design, including technology definitions, cost calculations, and results display.

class districtheatingsim.gui.EnergySystemTab._01_energy_system_main_tab.EnergySystemTab(folder_manager, data_manager, config_manager, parent=None)[source]

Bases: QWidget

Main tab for defining and managing energy mix design for heat generation projects.

Signal data_added:

Signal emitted when new data is added.

data_added

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(folder_manager, data_manager, config_manager, parent=None)[source]

Initialize the EnergySystemTab.

Parameters:
  • folder_manager (object) – Folder manager instance.

  • data_manager (object) – Data manager instance.

  • config_manager (object) – Configuration manager instance.

  • parent (QWidget) – Parent widget.

initDialogs()[source]

Initialize dialogs for economic parameters.

updateDefaultPath(new_base_path)[source]

Update project default path.

Parameters:

new_base_path (str) – New base path for the project.

initUI()[source]

Initialize user interface components.

createMainScrollArea()[source]

Create main scroll area for the tab.

createMenu()[source]

Create menu bar for the tab.

createAction(title, method)[source]

Create a menu action.

Parameters:
  • title (str) – Action title.

  • method (function) – Method to be called when triggered.

Returns:

Created action.

Return type:

QAction

createTabs()[source]

Create tab widget and its sub-tabs.

createProgressBar()[source]

Create progress bar for calculation progress.

createMainLayout()[source]

Create main layout for the tab.

Returns:

Main layout.

Return type:

QVBoxLayout

setupParameters()[source]

Set up economic parameters.

updateEconomicParameters()[source]

Update economic parameters from dialog.

openEconomicParametersDialog()[source]

Open economic parameters dialog.

validateInputs()[source]

Validate inputs for calculation.

Returns:

True if inputs are valid, False otherwise.

Return type:

bool

preprocessData()[source]

Preprocess data before calculation.

calculate_energy_system(optimize=False, weights=None)[source]

Start calculation process.

Parameters:
  • optimize (bool) – Whether to optimize the calculation.

  • weights (dict) – Weights for optimization.

start_optimization()[source]

Open optimization dialog and start optimization process.

on_calculation_done(result)[source]

Handle calculation completion.

Parameters:

result (dict) – Calculation results.

on_calculation_error(error_message)[source]

Handle calculation errors.

Parameters:

error_message (str) – Error message.

process_data()[source]
sensitivity(gas_range, electricity_range, wood_range, weights=None)[source]

Perform sensitivity analysis over a range of prices.

Parameters:
  • gas_range (tuple) – Range of gas prices (lower, upper, num_points).

  • electricity_range (tuple) – Range of electricity prices (lower, upper, num_points).

  • wood_range (tuple) – Range of wood prices (lower, upper, num_points).

  • weights (dict) – Weights for optimization.

generate_values(price_range)[source]

Generate values within a specified range.

Parameters:

price_range (tuple) – Price range (lower, upper, num_points).

Returns:

Generated values within the range.

Return type:

list

calculate_sensitivity(gas_price, electricity_price, wood_price, weights)[source]

Calculate energy mix for given prices and weights.

Parameters:
  • gas_price (float) – Gas price.

  • electricity_price (float) – Electricity price.

  • wood_price (float) – Wood price.

  • weights (dict) – Weights for optimization.

Returns:

Calculation results.

Return type:

dict

show_sankey()[source]

Show Sankey diagram of energy flows.

save_heat_generation_results_to_csv(show_dialog=True)[source]

Save heat generation results to CSV file.

Parameters:

show_dialog (bool) – Whether to show dialogs.

save_results_JSON(show_dialog=True)[source]

Save results and technology objects to JSON file.

Parameters:

show_dialog (bool) – Whether to show dialogs.

load_results_JSON(show_dialog=True)[source]

Load EnergySystem object and results from JSON file.

Parameters:

show_dialog (bool) – Whether to show success/error dialogs.

Energy System Dialogs Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Dialogs for the Energy System Tab, including economic parameters input, cost calculation, and weight settings for optimization.

class districtheatingsim.gui.EnergySystemTab._02_energy_system_dialogs.EconomicParametersDialog(parent=None)[source]

Bases: QDialog

Dialog for inputting economic parameters.

__init__(parent=None)[source]

Initialize the EconomicParametersDialog.

Parameters:

parent (QWidget) – Parent widget.

initUI()[source]

Initialize user interface components.

loadValues(values)[source]

Load values into input fields.

Parameters:

values (dict) – Dictionary containing values to load.

getValues()[source]

Get values from input fields.

Returns:

Dictionary containing input values.

Return type:

dict

updateValues(new_values)[source]

Update default values and reload them into input fields.

Parameters:

new_values (dict) – Dictionary containing new values.

connectSignals()[source]

Connect input field signals to validation method.

validateInput()[source]

Validate input fields and update plot if valid.

showErrorMessage(message)[source]

Show error message dialog.

Parameters:

message (str) – Message to display.

plotPriceDevelopment()[source]

Plot price development of energy carriers over time.

class districtheatingsim.gui.EnergySystemTab._02_energy_system_dialogs.KostenBerechnungDialog(parent=None, label=None, value=None, type=None)[source]

Bases: QDialog

Dialog for calculating costs based on a geoJSON file.

__init__(parent=None, label=None, value=None, type=None)[source]

Initialize the KostenBerechnungDialog.

Parameters:
  • parent (QWidget) – Parent widget.

  • label (str) – Label for specific cost input field.

  • value (str) – Default value for specific cost input field.

  • type (str) – Type of cost calculation.

initUI()[source]

Initialize user interface components.

onAccept()[source]

Read unified GeoJSON file and calculate total cost based on input values.

class districtheatingsim.gui.EnergySystemTab._02_energy_system_dialogs.WeightDialog[source]

Bases: QDialog

Dialog for setting weights for optimization.

__init__()[source]

Initialize the WeightDialog.

get_weights()[source]

Get weights from input fields.

Returns:

Dictionary with weights for heat generation costs, CO2 emissions, and primary energy factor.

Return type:

dict

Technology Tab Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Managing and displaying technologies in district heating simulation, including add, edit, remove, and schematic visualization.

class districtheatingsim.gui.EnergySystemTab._03_technology_tab.CustomListWidget(parent=None)[source]

Bases: QListWidget

Custom list widget with drag-drop functionality for technology ordering.

__init__(parent=None)[source]
dropEvent(event)[source]

Handle drop event to update technology object order.

Parameters:

event (QDropEvent) – Drop event.

class districtheatingsim.gui.EnergySystemTab._03_technology_tab.TechnologyTab(data_manager, config_manager, parent=None)[source]

Bases: QWidget

Tab for managing and displaying heat generation technologies.

Signal data_added:

Signal that emits data as an object.

global_counters = {'Abwärmepumpe': 0, 'AqvaHeat': 0, 'BHKW': 0, 'Biomassekessel': 0, 'Flusswärmepumpe': 0, 'Gaskessel': 0, 'Geothermie': 0, 'Holzgas-BHKW': 0, 'Power-to-Heat': 0, 'Saisonaler Wärmespeicher': 0, 'Solarthermie': 0}
data_added

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(data_manager, config_manager, parent=None)[source]

Initialize the TechnologyTab.

Parameters:
  • data_manager (object) – Data manager instance.

  • config_manager (object) – Configuration manager instance.

  • parent (QWidget) – Parent widget.

initFileInputs()[source]

Initialize file input widgets.

updateDefaultPath(new_base_path)[source]

Update default path for file inputs.

Parameters:

new_base_path (str) – New base path.

initUI()[source]

Initialize UI components.

createMainScrollArea()[source]

Create main scroll area.

setupFileInputs()[source]

Set up file input widgets and layout.

addLabel(text)[source]

Add label to main layout.

Parameters:

text (str) – Label text.

on_selectFileButton_clicked()[source]

Handle select file button click event.

setupScaleFactor()[source]

Set up scale factor input widgets and layout.

addHorizontalLayout(*widgets)[source]

Add horizontal layout with given widgets to main layout.

Parameters:

widgets (tuple) – Widgets to add to horizontal layout.

addButtonLayout()[source]

Add button layout for managing technologies.

setupTechnologySelection()[source]

Set up technology selection widgets and layout.

createTechnology(tech_type, inputs)[source]

Create technology object based on type and inputs.

Parameters:
  • tech_type (str) – Technology type.

  • inputs (dict) – Technology inputs.

Returns:

Created technology object.

Return type:

Technology

addTech(tech_type, tech_data)[source]

Add new technology to list.

Parameters:
  • tech_type (str) – Technology type.

  • tech_data (dict) – Technology data.

editTech(item)[source]

Edit selected technology.

Parameters:

item (QListWidgetItem) – Selected item to edit.

removeSelectedTech()[source]

Remove selected technology object and update counters and object names.

rebuildScene()[source]

Rebuild entire scene by adding all remaining technologies.

updateTechNames(tech_type)[source]

Update names and labels of remaining objects of a technology class.

Parameters:

tech_type (str) – Technology type.

removeTech()[source]

Remove all technologies from list.

updateTechList()[source]

Update technology list display.

updateTechObjectsOrder()[source]

Update order of technology objects based on list display.

formatTechForDisplay(tech)[source]

Delegate formatting of display text to technology object.

Parameters:

tech (Technology) – Technology object.

Returns:

Formatted string for display.

Return type:

str

createMainLayout()[source]

Create main layout for TechnologyTab.

Returns:

Main layout.

Return type:

QVBoxLayout

setupPlotAndSchematic()[source]

Set up plot area and schematic scene area.

createPlotCanvas()[source]

Create plot canvas for displaying graphs.

loadFileAndPlot()[source]

Load file and plot data, display message if file unavailable or has issues.

plotData(data)[source]

Plot data on canvas with modern styling and hour-based x-axis.

Parameters:

data (DataFrame) – Data to plot.

showInfoMessageOnPlot(message)[source]

Display information message on plot canvas with modern styling.

Parameters:

message (str) – Message to display.

addTechToScene(tech)[source]

Add technology to SchematicScene and store reference in tech object.

Parameters:

tech (object) – Technology object.

Technology Input Dialogs Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Dialogs for inputting technology-specific data in Energy System Tab.

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.TechInputDialog(tech_type, tech_data=None)[source]

Bases: QDialog

Dialog for inputting technology-specific data based on technology type.

__init__(tech_type, tech_data=None)[source]

Initialize TechInputDialog with technology type and data.

Parameters:
  • tech_type (str) – Technology type.

  • tech_data (dict) – Technology data.

initUI()[source]

Initializes the user interface for the dialog.

accept()[source]

Accept dialog and retrieve input data from specific technology dialog.

getInputs()[source]

Retrieves the input data from the dialog.

Returns:

The input data

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.SolarThermalDialog(tech_data=None)[source]

Bases: QWidget

A dialog for inputting data specific to solar thermal technology.

tech_data

The data for the solar thermal technology.

Type:

dict

__init__(tech_data=None)[source]

Initializes the SolarThermalDialog with the given data.

Parameters:

tech_data (dict or None) – The data for the solar thermal technology

initUI()[source]

Initializes the user interface for the dialog.

updateVisualization()[source]

Updates the visualization of the collector orientation.

getInputs()[source]

Retrieves the input data from the dialog.

Returns:

The input data

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.BiomassBoilerDialog(tech_data=None)[source]

Bases: QDialog

A dialog for inputting data specific to biomass boiler technology.

tech_data

The data for the biomass boiler technology.

Type:

dict

__init__(tech_data=None)[source]

Initializes the BiomassBoilerDialog with the given data.

Parameters:

tech_data (dict or None) – The data for the biomass boiler technology

initUI()[source]

Initializes the user interface for the dialog.

toggleSpeicherInputs()[source]

Toggles the visibility of the storage input fields based on the state of the storage active checkbox.

getInputs()[source]

Retrieves the input data from the dialog.

Returns:

The input data

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.GasBoilerDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring gas boiler parameters.

tech_data

Dictionary containing initial values for the gas boiler parameters.

Type:

dict

PowerFactorGKInput

Input field for the dimensioning factor of the gas boiler.

Type:

QLineEdit

effGKInput

Input field for the efficiency of the gas boiler.

Type:

QLineEdit

spezcostGKInput

Input field for the specific investment costs.

Type:

QLineEdit

__init__(tech_data=None)[source]

Initializes the GasBoilerDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the gas boiler parameters

initUI()[source]

Initializes the user interface components.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.PowerToHeatDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring Power-to-Heat parameters.

tech_data

Dictionary containing initial values for the Power-to-Heat parameters.

Type:

dict

PowerFactorGKInput

Input field for the dimensioning factor of the Power-to-Heat.

Type:

QLineEdit

effGKInput

Input field for the efficiency of the Power-to-Heat.

Type:

QLineEdit

spezcostGKInput

Input field for the specific investment costs.

Type:

QLineEdit

__init__(tech_data=None)[source]

Initializes the PowerToHeatDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the Power-to-Heat parameters

initUI()[source]

Initializes the user interface components.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.CHPDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring combined heat and power (CHP) parameters.

tech_data

Dictionary containing initial values for the CHP parameters.

Type:

dict

Various QLineEdit and QCheckBox widgets for different CHP parameters.
__init__(tech_data=None)[source]

Initializes the CHPDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the CHP parameters

initUI()[source]

Initializes the user interface components.

toggleSpeicherInputs()[source]

Toggles the visibility of the storage inputs based on the state of the storage active checkbox.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.HolzgasCHPDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring Holzgas-CHP (combined heat and power) parameters.

tech_data

Dictionary containing initial values for the Holzgas-CHP parameters.

Type:

dict

Various QLineEdit and QCheckBox widgets for different Holzgas-CHP parameters.
__init__(tech_data=None)[source]

Initializes the HolzgasCHPDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the Holzgas-CHP parameters

initUI()[source]

Initializes the user interface components.

toggleSpeicherInputs()[source]

Toggles the visibility of the storage inputs based on the state of the storage active checkbox.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.GeothermalDialog(tech_data=None)[source]

Bases: QWidget

A QWidget subclass for configuring geothermal parameters.

tech_data

Dictionary containing initial values for the geothermal parameters.

Type:

dict

areaGInput

Input field for the area of the borehole field.

Type:

QLineEdit

depthInput

Input field for the depth of the boreholes.

Type:

QLineEdit

tempGInput

Input field for the source temperature.

Type:

QLineEdit

distholeInput

Input field for the distance between boreholes.

Type:

QLineEdit

costdethInput

Input field for the specific drilling costs.

Type:

QLineEdit

spezPInput

Input field for the specific extraction performance.

Type:

QLineEdit

VBHInput

Input field for the full load hours of the borehole field.

Type:

QLineEdit

WPGcostInput

Input field for the specific investment costs of the heat pump.

Type:

QLineEdit

figure

Matplotlib figure for plotting the borehole configuration.

Type:

Figure

ax

Matplotlib axes for plotting.

Type:

Axes

canvas

Canvas to display the Matplotlib figure.

Type:

FigureCanvas

__init__(tech_data=None)[source]

Initializes the GeothermalDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the geothermal parameters

initUI()[source]

Initializes the user interface components.

updateVisualization()[source]

Updates the 3D visualization of the borehole configuration.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.WasteHeatPumpDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring waste heat pump parameters.

tech_data

Dictionary containing initial values for the waste heat pump parameters.

Type:

dict

PWHInput

Input field for the cooling capacity of waste heat.

Type:

QLineEdit

TWHInput

Input field for the temperature of waste heat.

Type:

QLineEdit

WHcostInput

Input field for the specific investment costs of waste heat utilization.

Type:

QLineEdit

WPWHcostInput

Input field for the specific investment costs of the heat pump.

Type:

QLineEdit

__init__(tech_data=None)[source]

Initializes the WasteHeatPumpDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the waste heat pump parameters

initUI()[source]

Initializes the user interface components.

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.RiverHeatPumpDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring river heat pump parameters.

tech_data

Dictionary containing initial values for the river heat pump parameters.

Type:

dict

PFWInput

Input field for the thermal capacity of the heat pump.

Type:

QLineEdit

TFWInput

Input field for the river temperature.

Type:

QLineEdit

DTFWInput

Input field for the permissible deviation of the heat pump’s supply temperature from the network supply temperature.

Type:

QLineEdit

RHcostInput

Input field for the specific investment costs of river heat utilization.

Type:

QLineEdit

WPRHcostInput

Input field for the specific investment costs of the heat pump.

Type:

QLineEdit

csvButton

Button to open and load a CSV file containing river temperatures.

Type:

QPushButton

canvas

Canvas to display the Matplotlib figure.

Type:

FigureCanvas

__init__(tech_data=None)[source]

Initializes the RiverHeatPumpDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the river heat pump parameters

initUI()[source]

Initializes the user interface components.

openCSV()[source]

Opens a file dialog to select a CSV file and loads its content.

loadCSV(filename)[source]

Loads temperature data from a CSV file.

Parameters:

filename (str) – The path to the CSV file

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.AqvaHeatDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring AqvaHeat parameters.

tech_data

Dictionary containing initial values for the river heat pump parameters.

Type:

dict

PFWInput

Input field for the thermal capacity of the heat pump.

Type:

QLineEdit

TFWInput

Input field for the river temperature.

Type:

QLineEdit

DTFWInput

Input field for the permissible deviation of the heat pump’s supply temperature from the network supply temperature.

Type:

QLineEdit

RHcostInput

Input field for the specific investment costs of river heat utilization.

Type:

QLineEdit

WPRHcostInput

Input field for the specific investment costs of the heat pump.

Type:

QLineEdit

csvButton

Button to open and load a CSV file containing river temperatures.

Type:

QPushButton

canvas

Canvas to display the Matplotlib figure.

Type:

FigureCanvas

__init__(tech_data=None)[source]

Initializes the RiverHeatPumpDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the river heat pump parameters

initUI()[source]

Initializes the user interface components.

openCSV()[source]

Opens a file dialog to select a CSV file and loads its content.

loadCSV(filename)[source]

Loads temperature data from a CSV file.

Parameters:

filename (str) – The path to the CSV file

getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

class districtheatingsim.gui.EnergySystemTab._04_technology_dialogs.TemperatureStratifiedThermalStorageDialog(tech_data=None)[source]

Bases: QDialog

A QDialog subclass for configuring temperature stratified thermal storage parameters.

Attributes:

__init__(tech_data=None)[source]

Initializes the TemperatureStratifiedThermalStorageDialog.

Parameters:

tech_data (dict or None) – Dictionary containing initial values for the temperature stratified thermal storage parameters

initUI()[source]
getInputs()[source]

Retrieves the input values from the user interface.

Returns:

A dictionary containing the input values

Return type:

dict

Cost Tab Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Displaying and managing cost-related data for heat generation project components.

class districtheatingsim.gui.EnergySystemTab._05_cost_tab.CostTab(folder_manager, config_manager, parent=None)[source]

Bases: QWidget

Tab for displaying and managing cost-related data for heat generation project components.

Signal data_added:

Signal emitted when new data is added.

data_added

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(folder_manager, config_manager, parent=None)[source]

Initializes the CostTab instance.

Parameters:
  • folder_manager (object) – Reference to the folder manager instance

  • config_manager (object) – Reference to the config manager instance

  • parent (QWidget or None) – Reference to the parent widget

updateDefaultPath(new_base_path)[source]

Updates the default path for the project.

Parameters:

new_base_path (str) – The new base path for the project

initData()[source]

Initializes the data as a pandas DataFrame with an index name and calculates the Annuität.

Returns:

DataFrame with infrastructure costs and calculated annuity values

Return type:

pd.DataFrame

initUI()[source]

Initializes the user interface components for the CostTab.

createMainScrollArea()[source]

Creates the main scroll area for the tab and sets it to take full width and height.

createMainLayout()[source]

Creates the main layout for the tab with adjusted spacing and margins for better alignment.

Returns:

The main layout for the tab

Return type:

QVBoxLayout

addLabel(text)[source]

Adds a label to the main layout.

Parameters:

text (str) – The text for the label

setupInfrastructureCostsTable()[source]

Sets up the infrastructure costs table.

updateInfrastructureTable()[source]

Updates the infrastructure costs table with data from the DataFrame. Ensures proper formatting and correct handling of indices.

format_cost(value)[source]

Formats the cost value in European style with spaces as thousand separators.

Parameters:

value (float) – The cost value

Returns:

Formatted cost string

Return type:

str

updateDataFromTable(item)[source]

Updates the DataFrame with values from the QTableWidget and recalculates Annuität.

Parameters:

item (QTableWidgetItem) – The changed table item

addRow()[source]

Adds a new row to the table and DataFrame, with default values and calculated Annuität. The new row is added above the summary row.

removeRow()[source]

Removes the selected row from the table and DataFrame.

openHeaderContextMenu(position)[source]

Opens the context menu for the vertical header.

Parameters:

position (QPoint) – The position where the context menu should be opened

renameHeader(row)[source]

Renames the header item at the specified row.

Parameters:

row (int) – The row index of the header item to rename

calc_annuität(A0, TN, f_Inst, f_W_Insp, Bedienaufwand)[source]

Calculates the annuity for a given set of parameters.

Parameters:
  • A0 (float) – Initial investment cost

  • TN (int) – Lifetime of the investment

  • f_Inst (float) – Installation factor

  • f_W_Insp (float) – Maintenance and inspection factor

  • Bedienaufwand (float) – Operating effort

Returns:

The calculated annuity

Return type:

float

updateSummaryRow()[source]

Recalculates the summary row and appends it to the DataFrame.

updateTableValue(row, column, value)[source]

Updates the value in the specified table cell.

Parameters:
  • row (int) – The row index

  • column (int) – The column index

  • value (Any) – The value to set

berechneWaermenetzKosten()[source]

Opens the dialog to calculate the cost of the heating network and updates the table.

berechneHausanschlussKosten()[source]

Opens the dialog to calculate the cost of house connection stations and updates the table.

setupTechDataTable()[source]
updateTechDataTable(tech_objects)[source]

Updates the technology data table with the given technology objects.

Parameters:

tech_objects (list) – List of technology objects

addSummaryTechCosts()[source]

Adds a summary row for the technology costs.

updateSumLabel()[source]

Updates the label displaying the total costs using the summary row from the DataFrame.

setupCostCompositionChart()[source]

Sets up two separate figures for the bar chart and pie chart.

addFigure()[source]

Creates and returns a new figure and its canvas.

Returns:

The figure and canvas

Return type:

tuple

plotCostComposition()[source]

Plots the cost composition with two separate figures: a bar chart and a pie chart. Clears the diagrams before replotting.

adjustTableSize(table)[source]

Adjusts the size of the table to fit its contents.

Parameters:

table (QTableWidget) – The table to adjust

totalCostLabel()[source]

Returns the total cost label.

Returns:

The total cost label

Return type:

QLabel

Calculate Energy System Thread Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Thread for calculating heat generation mix in district heating simulation, running calculations in a separate thread.

class districtheatingsim.gui.EnergySystemTab._06_calculate_energy_system_thread.CalculateEnergySystemThread(energy_system, optimize, weights)[source]

Bases: QThread

Thread for calculating heat generation mix.

Signal calculation_done:

Emitted when calculation is done.

Signal calculation_error:

Emitted when error occurs during calculation.

calculation_done

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

calculation_error

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(energy_system, optimize, weights)[source]

Initialize the CalculateEnergySystemThread.

Parameters:
  • energy_system (object) – Energy system to calculate.

  • optimize (bool) – Whether to optimize the mix.

  • weights (dict) – Weights for optimization criteria.

run()[source]

Run heat generation mix calculation.

Results Tab Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Displaying results of energy system calculations with diagrams and tables, including stack plots, pie charts, and result tables.

class districtheatingsim.gui.EnergySystemTab._07_results_tab.ResultsTab(data_manager, parent=None)[source]

Bases: QWidget

A QWidget subclass representing the ResultsTab.

data_added

A signal that emits data as an object.

Type:

pyqtSignal

data_manager

An instance of the DataManager class for managing data.

Type:

DataManager

parent

The parent widget.

Type:

QWidget

results

A dictionary to store results.

Type:

dict

selected_variables

A list of selected variables for plotting.

Type:

list

data_added

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(data_manager, parent=None)[source]

Initializes the ResultsTab.

Parameters:
  • data_manager (DataManager) – The data manager

  • parent (QWidget or None) – The parent widget

updateDefaultPath(new_base_path)[source]

Updates the default base path.

Parameters:

new_base_path (str) – The new base path

initUI()[source]

Initializes the UI components of the ResultsTab.

setupDiagrams()[source]

Sets up the collapsible diagrams for the ResultsTab.

setupCollapsibleResultsSections()[source]

Sets up the collapsible sections for displaying results tables.

addLabel(text)[source]

Adds a label to the layout.

Parameters:

text (str) – The text for the label

setupResultsTable()[source]

Sets up the results table with additional columns for operational hours and starts.

setupAdditionalResultsTable()[source]

Sets up the additional results table.

adjustTableSize(table)[source]

Adjusts the size of the table to fit its contents.

Parameters:

table (QTableWidget) – The table to adjust

updateResults(energy_system)[source]

Updates the results in the ResultsTab.

Parameters:

energy_system (EnergySystem) – The energy system instance containing results

showResultsInTable()[source]

Displays the results in the results table, including calculated operational metrics. Resets the table rows before populating to avoid leftover rows from previous calculations.

showAdditionalResultsTable()[source]

Displays the additional results in the additional results table.

plotResults()[source]

Plots the results in the diagrams.

updateSelectedVariables()[source]

Updates the selected variables and re-plots the diagram.

updatePieChart()[source]

Updates the pie chart with results from the EnergySystem.

Sensitivity Tab Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Performing sensitivity analysis on heat generation costs based on varying parameters, with 3D visualization.

class districtheatingsim.gui.EnergySystemTab._08_sensitivity_tab.SensitivityTab(data_manager, parent=None)[source]

Bases: QWidget

A QWidget subclass representing the SensitivityTab.

data_added

A signal that emits data as an object.

Type:

pyqtSignal

data_manager

An instance of the DataManager class for managing data.

Type:

DataManager

parent

The parent widget.

Type:

QWidget

results

A dictionary to store results.

Type:

dict

data_added

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(data_manager, parent=None)[source]

Initializes the SensitivityTab.

Parameters:
  • data_manager (DataManager) – The data manager

  • parent (QWidget or None) – The parent widget

updateDefaultPath(new_base_path)[source]

Updates the default base path.

Parameters:

new_base_path (str) – The new base path

initUI()[source]

Initializes the UI components of the SensitivityTab.

createInputFields()[source]

Creates the input fields for sensitivity analysis ranges.

createRangeInputField(label_text, unit_text, ll=10, ul=50, nP=5)[source]

Creates a range input field for sensitivity analysis.

Parameters:
  • label_text (str) – The text for the label

  • unit_text (str) – The text for the unit label

  • ll (int or float) – The lower limit

  • ul (int or float) – The upper limit

  • nP (int) – The number of points

Returns:

The layout containing the input fields

Return type:

QVBoxLayout

createPlotArea()[source]

Creates the plot area for displaying graphs.

start_sensitivity_analysis()[source]

Starts the sensitivity analysis based on the input ranges.

parse_range(layout)[source]

Parses the range input fields and returns the range values.

Parameters:

layout (QVBoxLayout) – The layout containing the input fields

Returns:

The lower limit, upper limit, and number of points if valid, otherwise None

Return type:

tuple or None

plotSensitivity(results)[source]

Plots the sensitivity analysis results.

Parameters:

results (list) – The results of the sensitivity analysis

plotSensitivitySurface(results)[source]

Plots the sensitivity analysis results as a surface plot.

Parameters:

results (list) – The results of the sensitivity analysis

Sankey Dialog Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Displaying Sankey diagram using Plotly to visualize energy flows in district heating systems.

class districtheatingsim.gui.EnergySystemTab._09_sankey_dialog.SankeyDialog(results=None, parent=None)[source]

Bases: QDialog

Dialog to display a Sankey diagram using Plotly in a QWebEngineView.

__init__(results=None, parent=None)[source]
initUI()[source]

Initialize the Sankey dialog UI and display the Plotly diagram.

plotSankey()[source]

Generate and display a Sankey diagram using Plotly based on results data.

closeEvent(event)[source]

Clean up the temporary HTML file when the dialog is closed.

Parameters:

event (QCloseEvent) – The close event

Energy System Tab Utilities Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Utility classes for Energy System Tab, including collapsible sections, checkable combo boxes, and custom JSON encoding.

class districtheatingsim.gui.EnergySystemTab._10_utilities.CheckableComboBox(parent=None)[source]

Bases: QComboBox

Combo box that allows multiple items to be checked.

__init__(parent=None)[source]

Initialize the CheckableComboBox.

Parameters:

parent (QWidget) – Parent widget.

handleItemPressed(index)[source]

Handle item pressed event to toggle check state.

Parameters:

index (QModelIndex) – Index of the pressed item.

updateText()[source]

Update displayed text to show checked items.

addItem(text, data=None)[source]

Add item to combo box.

Parameters:
  • text (str) – Item text.

  • data (Any) – Associated data.

addItems(texts)[source]

Add multiple items to combo box.

Parameters:

texts (list) – List of item texts to add.

setItemChecked(text, checked=True)[source]

Set check state of an item.

Parameters:
  • text (str) – Item text.

  • checked (bool) – Check state.

clear()[source]

Clear all items from combo box.

checkedItems()[source]

Get list of checked items.

Returns:

List of checked items.

Return type:

list

class districtheatingsim.gui.EnergySystemTab._10_utilities.CollapsibleHeader(title, content_widget)[source]

Bases: QWidget

__init__(title, content_widget)[source]
toggle_content()[source]
sizeHint(self) QSize[source]
class districtheatingsim.gui.EnergySystemTab._10_utilities.CustomJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

Custom JSON Encoder for handling numpy arrays, pandas DataFrames, and custom objects.

default(obj)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return super().default(o)

Generator Schematic Module

author:

Dipl.-Ing. (FH) Jonas Pfeiffer

Custom QGraphicsScene and QGraphicsView for generator schematic editor with custom items and connections.

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.CustomGraphicsView(scene)[source]

Bases: QGraphicsView

__init__(scene)[source]
fit_to_scene()[source]

Fits the entire scene into the view, considering the current window size.

resizeEvent(event)[source]

Ensures the scene fits into the view whenever the window is resized.

Parameters:

event (QResizeEvent) – The resize event

wheelEvent(event)[source]

Handles zooming with mouse wheel.

Parameters:

event (QWheelEvent) – The wheel event

mousePressEvent(event)[source]

Activates panning on middle mouse button press.

Parameters:

event (QMouseEvent) – The mouse press event

mouseReleaseEvent(event)[source]

Deactivates panning when middle mouse button is released.

Parameters:

event (QMouseEvent) – The mouse release event

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.CustomGraphicsScene(x, y, width, height, parent=None)[source]

Bases: QGraphicsScene

mouse_position_changed

int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Type:

pyqtSignal(*types, name

Type:

str = …, revision

__init__(x, y, width, height, parent=None)[source]
mouseMoveEvent(event)[source]

Handles mouse move events in the scene.

Parameters:

event (QMouseEvent) – The mouse move event

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.SchematicScene(width, height, parent=None)[source]

Bases: CustomGraphicsScene

GRID_SIZE = 1
GENERATOR_SPACING = 100
GENERATOR_SPACING_STORAGE = 100
LINE_Y_OFFSET_GENERATOR = 100
GENERATOR_X_START = 20
LINE_THICKNESS = 3
FLOW_LINE_COLOR = 7
RETURN_LINE_COLOR = 9
TEXT_FONT = <PyQt6.QtGui.QFont object>
OBJECTS = {'Aqva Heat Pump': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'Biomass Boiler': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -20.0, 50.0, 40.0), 'shape': 'rect'}, 'CHP': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-30.0, -15.0, 60.0, 30.0), 'shape': 'rect'}, 'Consumer': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-30.0, -15.0, 60.0, 30.0), 'shape': 'rect'}, 'Gas Boiler': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'Geothermal Heat Pump': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'Power-to-Heat': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'River Heat Pump': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'Seasonal Thermal Storage': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-30.0, -20.0, 60.0, 40.0), 'shape': 'trapezoid'}, 'Solar': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-20.0, -20.0, 40.0, 40.0), 'shape': 'circle'}, 'Storage': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-20.0, -40.0, 40.0, 80.0), 'shape': 'rect'}, 'Waste Heat Pump': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-25.0, -25.0, 50.0, 50.0), 'shape': 'rect'}, 'Wood-CHP': {'color': <PyQt6.QtGui.QColor object>, 'counter': 0, 'geometry': PyQt6.QtCore.QRectF(-30.0, -20.0, 60.0, 40.0), 'shape': 'rect'}}
__init__(width, height, parent=None)[source]
update_scene_size()[source]

Updates the scene size dynamically based on the positions of all items.

update_selected_item()[source]

Updates the selected object when the selection in the scene changes.

snap_to_grid(position)[source]

Snaps the given position to the nearest grid point.

Parameters:

position (QPointF) – The position to snap

Returns:

The snapped position

Return type:

QPointF

create_parallel_lines()[source]

Creates or updates the parallel Vorlauf (red) and Rücklauf (blue) lines and adds labels.

update_parallel_labels(start_x, end_x)[source]

Updates the labels for the Vorlauf and Rücklauf lines dynamically.

Parameters:
  • start_x (float) – The start x-coordinate

  • end_x (float) – The end x-coordinate

update_pipes_connected_to_lines()[source]

Updates pipes that are connected to the parallel lines.

add_generator(item_type, item_name, connect_to_lines=True)[source]

Adds a generator at a fixed position and optionally connects it to the parallel lines.

Parameters:
  • item_type (str) – Type of the generator (e.g., ‘CHP’, ‘Solar’)

  • item_name (str) – Unique name for the generator (e.g., ‘BHKW_1’)

  • connect_to_lines (bool) – Whether to connect to the parallel lines

Returns:

The created generator component

Return type:

ComponentItem

add_storage(position, item_type='Storage', item_name='Speicher')[source]

Helper function to create and add a storage unit with custom geometry.

Parameters:
  • position (QPointF) – The position for the storage

  • item_type (str) – Type of storage

  • item_name (str) – Name of the storage

Returns:

The created storage component

Return type:

ComponentItem

add_generator_with_storage(item_name, name)[source]

Adds a generator and a storage unit, connecting them and the storage to the consumer.

Parameters:
  • item_name (str) – Type of the generator

  • name (str) – Unique name for the generator

Returns:

The created generator component

Return type:

ComponentItem

add_consumer_net(item_type, item_name='Wärmenetz', connect_to_lines=False)[source]

Adds the consumer (network).

Parameters:
  • item_type (str) – Type of consumer

  • item_name (str) – Name of the consumer

  • connect_to_lines (bool) – Whether to connect to lines

add_seasonal_storage(item_type='Saisonaler Wärmespeicher', item_name='Speicher', connect_to_lines=True)[source]

Adds a seasonal storage unit at a fixed position and optionally connects it to the parallel lines.

Parameters:
  • item_type (str) – Type of seasonal storage

  • item_name (str) – Name of the storage

  • connect_to_lines (bool) – Whether to connect to the parallel lines

Returns:

The created storage component

Return type:

ComponentItem

check_label_collision(new_label_rect)[source]

Checks if a new label would collide with existing component labels.

Parameters:

new_label_rect (QRectF) – Rectangle of the new label

Returns:

True if collision detected, False otherwise

Return type:

bool

find_optimal_label_position(item, label)[source]

Finds optimal position for label to avoid collisions.

Parameters:
  • item (ComponentItem) – The component item

  • label (QGraphicsTextItem) – The label to position

Returns:

The optimal position

Return type:

QPointF

update_all_label_positions()[source]

Updates positions of all component labels to avoid collisions.

update_label(item, new_text)[source]

Updates the label of a given item with new text.

Parameters:
  • item (ComponentItem) – The component item

  • new_text (str) – The new label text

connect_generator_to_storage(generator, storage)[source]

Connects two items (generator, storage, or consumer) using their connection points.

Parameters:
connect_items_to_lines(component, is_storage=False)[source]

Connects a component to the parallel Vorlauf (red) and Rücklauf (blue) lines.

Parameters:
  • component (ComponentItem) – The component to connect

  • is_storage (bool) – Whether the component is a storage unit

add_component(item_name, name, storage=False)[source]

Adds a component (generator or storage) to the scene.

Parameters:
  • item_name (str) – Type of the component (e.g., ‘CHP’, ‘Solar’)

  • name (str) – Unique name for the component (e.g., ‘BHKW_1’)

  • storage (bool) – If True, add a storage with the component

delete_selected()[source]

Deletes the selected component, ensuring that connected generators and storage are deleted together.

delete_all()[source]

Deletes all components, pipes, and resets all counters except for the consumer and its connections.

is_connected_to_consumer(item)[source]

Helper method to check if a pipe is connected to the consumer.

Parameters:

item (Pipe) – The item to check

Returns:

True if connected to consumer, False otherwise

Return type:

bool

find_linked_generator(storage)[source]

Finds the generator linked to the given storage unit.

Parameters:

storage (ComponentItem) – The storage component

Returns:

The linked generator or None

Return type:

ComponentItem or None

find_linked_storage(generator)[source]

Finds the storage unit linked to the given generator.

Parameters:

generator (ComponentItem) – The generator component

Returns:

The linked storage or None

Return type:

ComponentItem or None

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.ComponentItem(position, item_type, item_name, color, geometry, flow_line_color=GlobalColor.red, return_line_color=GlobalColor.blue)[source]

Bases: QGraphicsItem

__init__(position, item_type, item_name, color, geometry, flow_line_color=GlobalColor.red, return_line_color=GlobalColor.blue)[source]

Creates a general visual representation of a component.

Parameters:
  • position (QPointF) – The position of the component

  • item_type (str) – Type of component

  • item_name (str) – Name of the component

  • color (QColor) – Color of the component

  • geometry (QRectF) – Geometry of the component

  • flow_line_color (Qt.GlobalColor) – Color for flow line

  • return_line_color (Qt.GlobalColor) – Color for return line

boundingRect()[source]

Return the predefined geometry passed in during creation

paint(painter, option, widget=None)[source]

Draw the item with the specified shape and color.

create_connection_points()[source]

Create connection points (ports) for the item based on the shape.

create_connection_point(x_offset, y_offset, direction, color)[source]

Helper method to create a connection point at a relative position based on the bounding rectangle.

itemChange(change, value)[source]

Update connected pipes, label, and background when the component moves.

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.ConnectionPoint(parent, x_offset, y_offset, direction, color)[source]

Bases: QGraphicsLineItem

__init__(parent, x_offset, y_offset, direction, color)[source]

Create a connection point as a short line extending from the parent item.

update_position()[source]

Update the position of the connection point relative to the parent item and its extension line

get_end_point()[source]

Return the end point of the connection line (for pipe connections).

class districtheatingsim.gui.EnergySystemTab._11_generator_schematic.Pipe(point1, point2, color, line_thickness)[source]

Bases: QGraphicsPathItem

__init__(point1, point2, color, line_thickness)[source]

Create a flexible pipe (supply/return) between component and parallel lines

update_path()[source]

Update the pipe path to connect components to parallel lines with vertical and horizontal segments only.

check_collision(point)[source]

Check if the given point collides with any item (generator, consumer, storage)

Module contents