From beb307ee8effd68e50182e2e2a8d27814157a745 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 6 Jun 2025 15:51:09 +0530
Subject: [PATCH 01/14] Changes done in Material_type_consists and Founation UI
---
build/lib/osbridgelcca/__init__.py | 0
src/osbridgelcca.egg-info/PKG-INFO | 21 +
src/osbridgelcca.egg-info/SOURCES.txt | 9 +
.../dependency_links.txt | 1 +
src/osbridgelcca.egg-info/requires.txt | 13 +
src/osbridgelcca.egg-info/top_level.txt | 1 +
.../backend/api/routes/user_data.py | 7 +
.../backend/api/routes/user_input.json | 121 ++
src/osbridgelcca/core/Material_test.py | 98 ++
src/osbridgelcca/core/cost_component.py | 18 +-
.../core/material_types_consts.py | 96 ++
src/osbridgelcca/core/ui-test.py | 141 +++
src/osbridgelcca/desktop_app/ui/Home.py | 1111 +++++++++++++++++
.../desktop_app/ui/ProjectDetails_ | 0
...jectDetails_BridgeANDTrafficData_Window.py | 486 +++++++
...rojectDetails_CarbonEmissionData_Window.py | 813 ++++++++++++
...tails_DemolitionANDRecyclingData_Window.py | 351 ++++++
.../ui/ProjectDetails_FinancialData_Window.py | 382 ++++++
.../ui/ProjectDetails_Foundation_Window.py | 597 +++++++++
...Details_MaintenanceANDRepairData_Window.py | 420 +++++++
.../ui/ProjectDetails_Miscellaneous_Window.py | 566 +++++++++
.../ui/ProjectDetails_SubStructure_Window.py | 548 ++++++++
.../ProjectDetails_SuperStructure_Window.py | 566 +++++++++
src/osbridgelcca/desktop_app/ui/README.md | 1 +
.../desktop_app/ui/Warning_Window.py | 48 +
.../desktop_app/ui/form_data_storage.py | 24 +
src/osbridgelcca/desktop_app/ui/something.py | 4 +
27 files changed, 6441 insertions(+), 2 deletions(-)
create mode 100644 build/lib/osbridgelcca/__init__.py
create mode 100644 src/osbridgelcca.egg-info/PKG-INFO
create mode 100644 src/osbridgelcca.egg-info/SOURCES.txt
create mode 100644 src/osbridgelcca.egg-info/dependency_links.txt
create mode 100644 src/osbridgelcca.egg-info/requires.txt
create mode 100644 src/osbridgelcca.egg-info/top_level.txt
create mode 100644 src/osbridgelcca/backend/api/routes/user_input.json
create mode 100644 src/osbridgelcca/core/Material_test.py
create mode 100644 src/osbridgelcca/core/material_types_consts.py
create mode 100644 src/osbridgelcca/core/ui-test.py
create mode 100644 src/osbridgelcca/desktop_app/ui/Home.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_BridgeANDTrafficData_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_CarbonEmissionData_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_DemolitionANDRecyclingData_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_FinancialData_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_MaintenanceANDRepairData_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_Miscellaneous_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_SubStructure_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/ProjectDetails_SuperStructure_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/README.md
create mode 100644 src/osbridgelcca/desktop_app/ui/Warning_Window.py
create mode 100644 src/osbridgelcca/desktop_app/ui/form_data_storage.py
create mode 100644 src/osbridgelcca/desktop_app/ui/something.py
diff --git a/build/lib/osbridgelcca/__init__.py b/build/lib/osbridgelcca/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/src/osbridgelcca.egg-info/PKG-INFO b/src/osbridgelcca.egg-info/PKG-INFO
new file mode 100644
index 0000000..d77a7c4
--- /dev/null
+++ b/src/osbridgelcca.egg-info/PKG-INFO
@@ -0,0 +1,21 @@
+Metadata-Version: 2.4
+Name: osbridgelcca
+Version: 0.1.0
+Summary: Life Cycle Cost Analysis for Bridges
+Author-email: Your Name
+License: MIT
+License-File: LICENSE
+Requires-Dist: django
+Requires-Dist: djangorestframework
+Requires-Dist: pyqt5
+Requires-Dist: plotly
+Requires-Dist: pylatex
+Requires-Dist: pytest
+Requires-Dist: matplotlib
+Requires-Dist: pandas
+Requires-Dist: numpy
+Requires-Dist: psycopg2-binary
+Requires-Dist: requests
+Requires-Dist: flask
+Requires-Dist: gunicorn
+Dynamic: license-file
diff --git a/src/osbridgelcca.egg-info/SOURCES.txt b/src/osbridgelcca.egg-info/SOURCES.txt
new file mode 100644
index 0000000..961eb5b
--- /dev/null
+++ b/src/osbridgelcca.egg-info/SOURCES.txt
@@ -0,0 +1,9 @@
+LICENSE
+README.md
+pyproject.toml
+src/osbridgelcca/__init__.py
+src/osbridgelcca.egg-info/PKG-INFO
+src/osbridgelcca.egg-info/SOURCES.txt
+src/osbridgelcca.egg-info/dependency_links.txt
+src/osbridgelcca.egg-info/requires.txt
+src/osbridgelcca.egg-info/top_level.txt
\ No newline at end of file
diff --git a/src/osbridgelcca.egg-info/dependency_links.txt b/src/osbridgelcca.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/osbridgelcca.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/src/osbridgelcca.egg-info/requires.txt b/src/osbridgelcca.egg-info/requires.txt
new file mode 100644
index 0000000..d0250d3
--- /dev/null
+++ b/src/osbridgelcca.egg-info/requires.txt
@@ -0,0 +1,13 @@
+django
+djangorestframework
+pyqt5
+plotly
+pylatex
+pytest
+matplotlib
+pandas
+numpy
+psycopg2-binary
+requests
+flask
+gunicorn
diff --git a/src/osbridgelcca.egg-info/top_level.txt b/src/osbridgelcca.egg-info/top_level.txt
new file mode 100644
index 0000000..7409575
--- /dev/null
+++ b/src/osbridgelcca.egg-info/top_level.txt
@@ -0,0 +1 @@
+osbridgelcca
diff --git a/src/osbridgelcca/backend/api/routes/user_data.py b/src/osbridgelcca/backend/api/routes/user_data.py
index 865e418..b4d42b4 100644
--- a/src/osbridgelcca/backend/api/routes/user_data.py
+++ b/src/osbridgelcca/backend/api/routes/user_data.py
@@ -1 +1,8 @@
+import json
+from pathlib import Path
+
# Placeholder for user data
+def save_user_input(data):
+ output_path = Path(__file__).parent / "user_input.json"
+ with open(output_path, "w", encoding="utf-8") as f:
+ json.dump(data, f, ensure_ascii=False, indent=4)
diff --git a/src/osbridgelcca/backend/api/routes/user_input.json b/src/osbridgelcca/backend/api/routes/user_input.json
new file mode 100644
index 0000000..06eb364
--- /dev/null
+++ b/src/osbridgelcca/backend/api/routes/user_input.json
@@ -0,0 +1,121 @@
+{
+ "concrete": {
+ "units": [
+ "cum",
+ "kg"
+ ],
+ "grades": {
+ "M15": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M20": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M25": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M30": {
+ "cum": 10.0,
+ "kg": 0.0
+ },
+ "M35": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M40": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M45": {
+ "cum": 0.0,
+ "kg": 0.0
+ },
+ "M50": {
+ "cum": 0.0,
+ "kg": 0.0
+ }
+ }
+ },
+ "steel": {
+ "units": [
+ "MT",
+ "kg"
+ ],
+ "grades": {
+ "E 165(Fe 290)": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 250(Fe 410W)A": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 250(Fe 410W)B": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 250(Fe 410)C": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 300(Fe 440)": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 350(Fe 490)": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 410(Fe 540)": {
+ "MT": 0.0,
+ "kg": 0.0
+ },
+ "E 450(Fe 570)D": {
+ "MT": 0.0,
+ "kg": 0.0
+ }
+ }
+ },
+ "mastic asphalt": {
+ "units": [
+ "sqm"
+ ],
+ "grades": {
+ "default": {
+ "sqm": 0.0
+ }
+ }
+ },
+ "paint": {
+ "units": [
+ "ltr"
+ ],
+ "grades": {
+ "white/yellow": {
+ "ltr": 0.0
+ },
+ "primer_epoxy": {
+ "ltr": 0.0
+ },
+ "oil": {
+ "ltr": 0.0
+ },
+ "alluminium": {
+ "ltr": 0.0
+ }
+ }
+ },
+ "paver blocks": {
+ "units": [
+ "sqm"
+ ],
+ "grades": {
+ "default": {
+ "sqm": 0.0
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/osbridgelcca/core/Material_test.py b/src/osbridgelcca/core/Material_test.py
new file mode 100644
index 0000000..feb8a20
--- /dev/null
+++ b/src/osbridgelcca/core/Material_test.py
@@ -0,0 +1,98 @@
+#Material Test
+
+import copy
+
+# Base template for material costs
+MATERIAL_COSTS_TEMPLATE = {
+ "concrete": {
+ "units": ["cum", "kg"],
+ "types": {
+ "M15": {"cum": 0.0, "kg": 0.0},
+ "M20": {"cum": 0.0, "kg": 0.0},
+ "M25": {"cum": 0.0, "kg": 0.0},
+ "M30": {"cum": 0.0, "kg": 0.0},
+ "M35": {"cum": 0.0, "kg": 0.0},
+ "M40": {"cum": 0.0, "kg": 0.0},
+ "M45": {"cum": 0.0, "kg": 0.0},
+ "M50": {"cum": 0.0, "kg": 0.0},
+ }
+ },
+ "steel": {
+ "units": ["MT", "kg"],
+ "types": {
+ "E 165(Fe 290)": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)A": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)B": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410)C": {"MT": 0.0, "kg": 0.0},
+ "E 300(Fe 440)": {"MT": 0.0, "kg": 0.0},
+ "E 350(Fe 490)": {"MT": 0.0, "kg": 0.0},
+ "E 410(Fe 540)": {"MT": 0.0, "kg": 0.0},
+ "E 450(Fe 570)D": {"MT": 0.0, "kg": 0.0},
+ }
+ },
+ "mastic asphalt": {
+ "units": ["sqm"],
+ "types": {
+ "default": {"sqm": 0.0}
+ }
+ },
+ "paint": {
+ "units": ["ltr"],
+ "types": {
+ "white/yellow": {"ltr": 0.0},
+ "primer_epoxy": {"ltr": 0.0},
+ "oil": {"ltr": 0.0},
+ "alluminium": {"ltr": 0.0}
+ }
+ },
+ "paver blocks": {
+ "units": ["sqm"],
+ "types": {
+ "default": {"sqm": 0.0}
+ }
+ },
+}
+
+
+def get_material_cost_template():
+ return copy.deepcopy(MATERIAL_COSTS_TEMPLATE)
+
+# Basic accessors
+def get_materials(material_costs):
+ return list(material_costs.keys())
+
+def get_submaterials(material_costs, material):
+ return list(material_costs.get(material, {}).get("types", {}).keys())
+
+def get_units(material_costs, material):
+ return material_costs.get(material, {}).get("units", [])
+
+def get_material_cost(material_costs, material, submaterial, unit):
+ return material_costs.get(material, {}).get("types", {}).get(submaterial, {}).get(unit, None)
+
+# Safe setter: returns True on success, False if invalid keys
+def set_material_cost(material_costs, material, submaterial, unit, cost):
+ types = material_costs.get(material, {}).get("types", {})
+ if submaterial in types and unit in types[submaterial]:
+ types[submaterial][unit] = cost
+ return True
+ return False
+
+# Validation helpers (good for UI input validation)
+def is_valid_material(material_costs, material):
+ return material in material_costs
+
+def is_valid_submaterial(material_costs, material, submaterial):
+ return submaterial in material_costs.get(material, {}).get("types", {})
+
+def is_valid_unit(material_costs, material, unit):
+ return unit in material_costs.get(material, {}).get("units", [])
+
+# UI-friendly utility: returns all (material, submaterial, unit) combinations
+def get_all_material_unit_combinations(material_costs):
+ combinations = []
+ for material, data in material_costs.items():
+ for sub, units in data.get("types", {}).items():
+ for unit in units:
+ combinations.append((material, sub, unit))
+ return combinations
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index c839b93..1c7cc83 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -30,6 +30,7 @@ class InitialConstructionCost(CostComponent):
def __init__(self, quantity, rate):
super().__init__(amount=quantity * rate, category="Economic", is_initial=True, is_recurring=False, present_worth_factor=1.00)
+
self.quantity = quantity
self.rate = rate
@@ -50,6 +51,7 @@ def calculate_cost(self):
return (self.material_quantity * self.carbon_emission_factor) * self.carbon_cost * self.present_worth_factor
+
class TimeCost(CostComponent):
"""Calculates economic losses due to construction delays."""
@@ -63,7 +65,7 @@ def __init__(self, construction_cost, interest_rate, time, investment_ratio):
def calculate_cost(self):
return self.construction_cost * self.interest_rate * self.time * self.investment_ratio * self.present_worth_factor
-
+
class RoadUserCost(CostComponent):
"""Evaluates economic impact on road users due to delays and detours."""
@@ -152,6 +154,18 @@ def calculate_cost(self):
return self.amount
+class ReconstructionCost(CostComponent):
+ """Accounts for partial or complete reconstruction of the bridge due to structural failures or obsolescence."""
+
+ def __init__(self, demolition_cost, reconstruction_cost, reconstruction_carbon_cost, reconstruction_time_cost, reconstruction_roaduser_cost, reconstruction_rerouting_carbon_cost, design_life, discount_rate):
+ pwf = 1 / ((1 + discount_rate) ** design_life)
+ cost = (demolition_cost + reconstruction_cost + reconstruction_carbon_cost + reconstruction_time_cost + reconstruction_roaduser_cost + reconstruction_rerouting_carbon_cost) * pwf
+ super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
+
+ def calculate_cost(self):
+ return self.amount
+
+
class DemolitionCost(CostComponent):
"""Costs incurred at the end of bridge life for demolition and disposal."""
@@ -173,4 +187,4 @@ def __init__(self, scrap_value, quantity, discount_rate, design_life):
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
def calculate_cost(self):
- return self.amount
+ return self.amount
\ No newline at end of file
diff --git a/src/osbridgelcca/core/material_types_consts.py b/src/osbridgelcca/core/material_types_consts.py
new file mode 100644
index 0000000..062a8c1
--- /dev/null
+++ b/src/osbridgelcca/core/material_types_consts.py
@@ -0,0 +1,96 @@
+import copy
+
+# Base template for material costs
+MATERIAL_COSTS_TEMPLATE = {
+ "concrete": {
+ "units": ["cum", "kg"],
+ "grades": {
+ "M15": {"cum": 0.0, "kg": 0.0},
+ "M20": {"cum": 0.0, "kg": 0.0},
+ "M25": {"cum": 0.0, "kg": 0.0},
+ "M30": {"cum": 0.0, "kg": 0.0},
+ "M35": {"cum": 0.0, "kg": 0.0},
+ "M40": {"cum": 0.0, "kg": 0.0},
+ "M45": {"cum": 0.0, "kg": 0.0},
+ "M50": {"cum": 0.0, "kg": 0.0},
+ }
+ },
+ "steel": {
+ "units": ["MT", "kg"],
+ "grades": {
+ "E 165(Fe 290)": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)A": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)B": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410)C": {"MT": 0.0, "kg": 0.0},
+ "E 300(Fe 440)": {"MT": 0.0, "kg": 0.0},
+ "E 350(Fe 490)": {"MT": 0.0, "kg": 0.0},
+ "E 410(Fe 540)": {"MT": 0.0, "kg": 0.0},
+ "E 450(Fe 570)D": {"MT": 0.0, "kg": 0.0},
+ }
+ },
+ "mastic asphalt": {
+ "units": ["sqm"],
+ "grades": {
+ "default": {"sqm": 0.0}
+ }
+ },
+ "paint": {
+ "units": ["ltr"],
+ "grades": {
+ "white/yellow": {"ltr": 0.0},
+ "primer_epoxy": {"ltr": 0.0},
+ "oil": {"ltr": 0.0},
+ "alluminium": {"ltr": 0.0}
+ }
+ },
+ "paver blocks": {
+ "units": ["sqm"],
+ "grades": {
+ "default": {"sqm": 0.0}
+ }
+ },
+}
+
+
+def get_material_cost_template():
+ return copy.deepcopy(MATERIAL_COSTS_TEMPLATE)
+
+
+def get_materials(material_costs):
+ return list(material_costs.keys())
+
+def get_grades(material_costs, material):
+ return list(material_costs.get(material, {}).get("grades", {}).keys())
+
+def get_units(material_costs, material):
+ return material_costs.get(material, {}).get("units", [])
+
+def get_material_cost(material_costs, material, grade, unit):
+ return material_costs.get(material, {}).get("grades", {}).get(grade, {}).get(unit, None)
+
+# returns True on success, False if invalid keys
+def set_material_cost(material_costs, material, grade, unit, cost):
+ grades = material_costs.get(material, {}).get("grades", {})
+ if grade in grades and unit in grades[grade]:
+ grades[grade][unit] = cost
+ return True
+ return False
+
+# Validation helpers
+def is_valid_material(material_costs, material):
+ return material in material_costs
+
+def is_valid_grade(material_costs, material, grade):
+ return grade in material_costs.get(material, {}).get("grades", {})
+
+def is_valid_unit(material_costs, material, unit):
+ return unit in material_costs.get(material, {}).get("units", [])
+
+# returns all (material, grade, unit) combinations
+def get_all_material_unit_combinations(material_costs):
+ combinations = []
+ for material, data in material_costs.items():
+ for grade, units in data.get("grades", {}).items():
+ for unit in units:
+ combinations.append((material, grade, unit))
+ return combinations
diff --git a/src/osbridgelcca/core/ui-test.py b/src/osbridgelcca/core/ui-test.py
new file mode 100644
index 0000000..421e5b2
--- /dev/null
+++ b/src/osbridgelcca/core/ui-test.py
@@ -0,0 +1,141 @@
+import sys
+import copy
+from PyQt5.QtWidgets import (
+ QApplication, QWidget, QVBoxLayout, QHBoxLayout, QPushButton,
+ QComboBox, QLineEdit, QLabel, QMessageBox, QScrollArea, QFrame
+)
+from osbridgelcca.core.material_types_consts import (
+ MATERIAL_COSTS_TEMPLATE,
+ get_materials, get_grades, get_units, set_material_cost
+)
+# Add import for saving user data
+from osbridgelcca.backend.api.routes.user_data import save_user_input
+
+print("Material Cost Editor UI Test")
+
+class MaterialRow(QWidget):
+
+ def __init__(self, material_costs):
+ super().__init__()
+ self.material_costs = material_costs
+
+ layout = QHBoxLayout()
+
+ # Material dropdown
+ self.material_cb = QComboBox()
+ self.material_cb.addItems(get_materials(self.material_costs))
+ self.material_cb.currentTextChanged.connect(self.update_grades)
+ layout.addWidget(QLabel("Material:"))
+ layout.addWidget(self.material_cb)
+
+ # Grade dropdown
+ self.grade_cb = QComboBox()
+ layout.addWidget(QLabel("Grade:"))
+ layout.addWidget(self.grade_cb)
+
+ # Unit dropdown
+ self.unit_cb = QComboBox()
+ layout.addWidget(QLabel("Unit:"))
+ layout.addWidget(self.unit_cb)
+
+ # Cost input
+ self.cost_input = QLineEdit()
+ self.cost_input.setPlaceholderText("Enter cost")
+ layout.addWidget(QLabel("Cost:"))
+ layout.addWidget(self.cost_input)
+
+ self.setLayout(layout)
+
+ # Connect grade change signal only once
+ self.grade_cb.currentTextChanged.connect(self.update_units)
+
+ # Initialize grades and units for the first material
+ initial_material = self.material_cb.currentText()
+ self.update_grades(initial_material)
+
+ def update_grades(self, material):
+ self.grade_cb.clear()
+ grades = get_grades(self.material_costs, material)
+ self.grade_cb.addItems(grades)
+ self.update_units()
+
+ def update_units(self):
+ material = self.material_cb.currentText()
+ self.unit_cb.clear()
+ units = get_units(self.material_costs, material)
+ self.unit_cb.addItems(units)
+
+
+class MaterialCostApp(QWidget):
+ def __init__(self):
+ super().__init__()
+ self.setWindowTitle("Material Cost Editor")
+
+ self.material_costs = copy.deepcopy(MATERIAL_COSTS_TEMPLATE)
+
+ self.layout = QVBoxLayout()
+
+ # Container for rows with scrollbar
+ self.scroll_area = QScrollArea()
+ self.scroll_area.setWidgetResizable(True)
+ self.rows_container = QFrame()
+ self.rows_layout = QVBoxLayout()
+ self.rows_container.setLayout(self.rows_layout)
+ self.scroll_area.setWidget(self.rows_container)
+
+ self.layout.addWidget(self.scroll_area)
+
+ # Add buttons
+ btn_layout = QHBoxLayout()
+ self.add_material_btn = QPushButton("Add Material")
+ self.add_material_btn.clicked.connect(self.add_material_row)
+ btn_layout.addWidget(self.add_material_btn)
+
+ self.save_btn = QPushButton("Save All")
+ self.save_btn.clicked.connect(self.save_all)
+ btn_layout.addWidget(self.save_btn)
+
+ self.layout.addLayout(btn_layout)
+
+ self.setLayout(self.layout)
+
+ # Add initial row
+ self.add_material_row()
+
+ def add_material_row(self):
+ row = MaterialRow(self.material_costs)
+ self.rows_layout.addWidget(row)
+
+ def save_all(self):
+ # Iterate over each row and save costs
+ for i in range(self.rows_layout.count()):
+ row = self.rows_layout.itemAt(i).widget()
+ material = row.material_cb.currentText()
+ grade = row.grade_cb.currentText()
+ unit = row.unit_cb.currentText()
+ cost_text = row.cost_input.text()
+
+ try:
+ cost = float(cost_text)
+ except ValueError:
+ QMessageBox.warning(self, "Invalid input",
+ f"Invalid cost value in row {i+1}: '{cost_text}'")
+ return
+
+ set_material_cost(self.material_costs, material, grade, unit, cost)
+
+ # Save to file
+ save_user_input(self.material_costs)
+
+ QMessageBox.information(self, "Success", "All costs saved successfully!")
+
+ # For demo, print the updated costs
+ print(self.material_costs)
+
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ window = MaterialCostApp()
+ window.resize(900, 400)
+ window.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/Home.py b/src/osbridgelcca/desktop_app/ui/Home.py
new file mode 100644
index 0000000..05e6b4b
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/Home.py
@@ -0,0 +1,1111 @@
+import sys
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout,
+ QHBoxLayout, QPushButton, QLabel, QFrame, QSplitter,
+ QToolBar, QAction, QGroupBox, QMenu, QLineEdit,
+ QComboBox, QSizePolicy, QMessageBox, QTextEdit, QScrollArea,
+ QTabWidget, QStackedWidget)
+from PyQt5.QtGui import QIcon, QFont
+from PyQt5.QtCore import Qt, QSize
+
+# Import all specific Project Details Dialog UIs
+from ProjectDetails_BridgeANDTrafficData_Window import Ui_BridgeTraffic_Dialog
+from ProjectDetails_Foundation_Window import Ui_Foundation_Dialog
+from ProjectDetails_CarbonEmissionData_Window import Ui_CarbonEmission_Dialog
+from ProjectDetails_DemolitionANDRecyclingData_Window import Ui_Demolition_Dialog
+from ProjectDetails_FinancialData_Window import Ui_FinancialData_Dialog
+from ProjectDetails_MaintenanceANDRepairData_Window import Ui_Maintenance_Dialog
+from ProjectDetails_Miscellaneous_Window import Ui_Miscellaneous_Dialog
+from ProjectDetails_SubStructure_Window import Ui_SubStructure_Dialog
+from ProjectDetails_SuperStructure_Window import Ui_SuperStructure_Dialog
+
+class MainWindow(QMainWindow): # Renamed to MainWindow, inheriting QMainWindow
+ def __init__(self):
+ super().__init__()
+ self.setWindowTitle(" - BICCA Studio 1.0.0")
+ self.setGeometry(100, 100, 1440, 1024)
+ self.setStyleSheet("background-color: rgb(255, 255, 255);")
+
+ # Initialize tutorial page counter
+ self.current_tutorial_page = 1
+ self.total_tutorial_pages = 4
+
+ # Tutorial content
+ self.tutorial_pages = [
+ {
+ "page_number": "1/4",
+ "title": "Welcome to\nBICCA Studio",
+ "content": """
+ BICCA Studio has a lot of features to offer. In the next few minutes, you'll learn how to use BICCA Studio efficiently, from setting up and managing projects, to navigating the user interface. This tutorial will guide you through essential features, including customization options, shortcuts, and export capabilities, ensuring a seamless workflow. Whether you're a beginner or an advanced user, this guide will help you unlock the full potential of BICCA Studio and enhance your productivity.
+ """
+ },
+ {
+ "page_number": "2/4",
+ "title": "Welcome to\nBICCA Studio",
+ "content": """
+ The Project General Information page is the foundation of your project setup, allowing you to input essential details for accurate documentation and streamlined management. Here, you will provide key information starting with the Company Name, which represents the organization behind the project. Next is the Project Title, a concise name that defines the scope of work. The Project Description further elaborates on the objectives and purpose of the project. Additionally, you will need to enter the Name of the Valuer responsible for the valuation, along with the Job Number for easy reference. The Client field identifies the primary stakeholder of the project, while the Country specifies the project's geographical location. Finally, the Base Year establishes a reference period for analysis and reports.
+ """
+ },
+ {
+ "page_number": "3/4",
+ "title": "Understanding\nInput Parameters",
+ "content": """
+ Input Parameters are crucial for accurate analysis and results. This section allows you to define various technical specifications, economic factors, and operational variables that will influence your project outcomes. You can specify factors such as time periods, growth rates, discount rates, and other numerical inputs that the software will use for calculations. Each parameter can be customized according to your specific requirements, ensuring that the analysis reflects real-world conditions accurately. The intuitive interface makes it easy to adjust these parameters as needed, and you can save different parameter sets for future use or comparisons.
+ """
+ },
+ {
+ "page_number": "4/4",
+ "title": "Working with\nOutputs",
+ "content": """
+ The Outputs section displays the results of your analysis based on the information and parameters you've entered. Here you can view comprehensive reports, charts, and visualizations that present your data in meaningful ways. You can customize the output format according to your preferences or your client's requirements. BICCA Studio allows you to export these outputs in various formats including PDF, Excel, or as image files for easy sharing and presentation. Additionally, you can compare different scenarios by adjusting your inputs and generating new outputs, providing valuable insights for decision-making processes.
+ """
+ }
+ ]
+
+ self.central_widget = QWidget()
+ self.setCentralWidget(self.central_widget)
+ self.main_layout = QVBoxLayout(self.central_widget)
+ self.main_layout.setContentsMargins(0, 0, 0, 0)
+ self.main_layout.setSpacing(0)
+
+ # --- CORRECTED ORDER: Create UI elements BEFORE retranslateUi ---
+ self.create_menu_bar()
+ self.create_toolbar()
+ self.create_window_tabs() # Custom tab buttons that control splitter visibility
+ self.create_content_area() # Contains the QSplitter for panels
+ self.create_status_bar() # Includes the persistent "Data" section
+
+ self.retranslateUi(self) # Call retranslateUi *after* all widgets are created
+
+ self.update_tutorial_content()
+
+ # Set initial visible panels and button states for the custom tabs
+ self.handle_tab_click("Tutorials", initial_load=True)
+ self.handle_tab_click("Project Details", initial_load=True)
+
+ # Connect QGroupBox toggled signals
+ self.generalInfoGroup.toggled['bool'].connect(lambda checked: self.toggle_general_info_group_content(self.generalInfoGroup, checked))
+ self.inputParamsGroup.toggled['bool'].connect(lambda checked: self.toggle_input_params_group_content(self.inputParamsGroup, checked))
+ self.outputsGroup.toggled['bool'].connect(lambda checked: self.toggle_outputs_group_content(self.outputsGroup, checked))
+
+ # Connect internal buttons to hide/show their respective sub-content
+ self.pushButton.clicked.connect(lambda: self.toggle_sub_buttons_visibility(self.gridLayout_3, self.pushButton))
+ self.pushButton_7.clicked.connect(lambda: self.toggle_sub_buttons_visibility(self.gridLayout_4, self.pushButton_7))
+
+ # Initially hide the collapsible sub-sections' content
+ self.gridLayout_3_widget.setVisible(False) # Hide the widget holding gridLayout_3
+ self.gridLayout_4_widget.setVisible(False) # Hide the widget holding gridLayout_4
+
+ # Manually trigger initial state for General Info, Input Params, Outputs groups
+ self.toggle_general_info_group_content(self.generalInfoGroup, self.generalInfoGroup.isChecked())
+ self.toggle_input_params_group_content(self.inputParamsGroup, self.inputParamsGroup.isChecked())
+ self.toggle_outputs_group_content(self.outputsGroup, self.outputsGroup.isChecked())
+
+
+ # Methods to open Project Details sub-windows
+ def openBridgeTrafficWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_BridgeTraffic_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openFoundationWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_Foundation_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openCarbonEmissionWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_CarbonEmission_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openDemolitionWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_Demolition_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openFinancialWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_FinancialData_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openMaintenanceWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_Maintenance_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openMiscellaneousWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_Miscellaneous_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openSubStructureWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_SubStructure_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def openSuperStructureWindow(self):
+ self.window = QtWidgets.QDialog(self)
+ self.ui = Ui_SuperStructure_Dialog()
+ self.ui.setupUi(self.window)
+ self.window.exec_()
+
+ def create_menu_bar(self):
+ menubar = self.menuBar()
+ menubar.setStyleSheet("""
+ QMenuBar {
+ background-color: white;
+ color: black;
+ border-bottom: 1px solid #e0e0e0;
+ }
+ QMenuBar::item {
+ background-color: transparent;
+ color: black;
+ padding: 5px 25px;
+ }
+ QMenuBar::item:selected {
+ background-color: #f0f0f0;
+ }
+ """)
+
+ # Assign menus to self. attributes BEFORE retranslateUi is called
+ self.menuFile = menubar.addMenu("File")
+ self.menuHome = menubar.addMenu("Home")
+ self.menuReports = menubar.addMenu("Reports")
+ self.menuHelp = menubar.addMenu("Help")
+
+ # Adding actions to the File menu (as per your original code)
+ self.actionNew = QAction("New", self)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Vector.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionNew.setIcon(icon2)
+ self.menuFile.addAction(self.actionNew)
+
+ self.actionOpen = QAction("Open", self)
+ icon3 = QtGui.QIcon()
+ icon3.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications/Qt/bin/../../../../../../../../../../Downloads/Vector (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionOpen.setIcon(icon3)
+ self.menuFile.addAction(self.actionOpen)
+
+ self.actionSave = QAction("Save", self)
+ icon4 = QtGui.QIcon()
+ icon4.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _save action floppy_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionSave.setIcon(icon4)
+ self.menuFile.addAction(self.actionSave)
+
+ self.actionSave_As = QAction("Save As...", self)
+ icon5 = QtGui.QIcon()
+ icon5.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _document save as template_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionSave_As.setIcon(icon5)
+ self.menuFile.addAction(self.actionSave_As)
+
+ self.actionCreate_a_Copy = QAction("Create a Copy", self)
+ icon6 = QtGui.QIcon()
+ icon6.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _file copy_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionCreate_a_Copy.setIcon(icon6)
+ self.menuFile.addAction(self.actionCreate_a_Copy)
+
+ self.actionPrint = QAction("Print", self)
+ icon7 = QtGui.QIcon()
+ icon7.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Vector (2).png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionPrint.setIcon(icon7)
+ self.menuFile.addAction(self.actionPrint)
+
+ self.actionRename = QAction("Rename", self)
+ icon8 = QtGui.QIcon()
+ icon8.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Vector (3).png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionRename.setIcon(icon8)
+ self.menuFile.addAction(self.actionRename)
+
+ self.actionExport = QAction("Export", self)
+ icon9 = QtGui.QIcon()
+ icon9.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Export.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionExport.setIcon(icon9)
+ self.menuFile.addAction(self.actionExport)
+
+ self.actionVersion_History = QAction("Version History", self)
+ icon10 = QtGui.QIcon()
+ icon10.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Vector (4).png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionVersion_History.setIcon(icon10)
+ self.menuFile.addAction(self.actionVersion_History)
+
+ self.actionInfo = QAction("Info", self)
+ icon11 = QtGui.QIcon()
+ icon11.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Alert Circle.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionInfo.setIcon(icon11)
+ self.menuFile.addAction(self.actionInfo)
+
+ # Adding actions to the Help menu
+ self.actionContact_Us = QAction("Contact Us", self)
+ icon12 = QtGui.QIcon()
+ icon12.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Contact.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionContact_Us.setIcon(icon12)
+ self.menuHelp.addAction(self.actionContact_Us)
+
+ self.actionFeedback = QAction("Feedback", self)
+ icon13 = QtGui.QIcon()
+ icon13.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _Person Feedback_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionFeedback.setIcon(icon13)
+ self.menuHelp.addAction(self.actionFeedback)
+
+ self.actionVideo_Tutorials = QAction("Video Tutorials", self)
+ icon14 = QtGui.QIcon()
+ icon14.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _youtube_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionVideo_Tutorials.setIcon(icon14)
+ self.menuHelp.addAction(self.actionVideo_Tutorials)
+
+ self.actionJoin_our_Community = QAction("Join our Community", self)
+ icon15 = QtGui.QIcon()
+ icon15.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/🦆 icon _People Community_.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.actionJoin_our_Community.setIcon(icon15)
+ self.menuHelp.addAction(self.actionJoin_our_Community)
+
+ def create_toolbar(self):
+ self.toolBar = QToolBar("Main Toolbar") # Assign toolbar to self.toolBar
+ self.toolBar.setMovable(False)
+ self.toolBar.setIconSize(QSize(20, 20))
+ self.toolBar.setStyleSheet("background-color: white; border-bottom: 1px solid #e0e0e0;")
+ self.addToolBar(Qt.TopToolBarArea, self.toolBar)
+
+ # Add the actions that should appear in the toolbar
+ self.toolBar.addAction(self.actionNew)
+ self.toolBar.addAction(self.actionOpen)
+ self.toolBar.addAction(self.actionSave)
+ self.toolBar.addSeparator()
+
+ def create_window_tabs(self):
+ window_tabs_container = QWidget()
+ window_tabs_container.setStyleSheet("background-color: white; border-bottom: 1px solid #e0e0e0;")
+ container_layout = QHBoxLayout(window_tabs_container)
+ container_layout.setContentsMargins(10, 0, 10, 0)
+ container_layout.setSpacing(0)
+
+ windows_label = QLabel("Windows:")
+ windows_label.setStyleSheet("font-weight: bold; margin-right: 5px;")
+ container_layout.addWidget(windows_label)
+
+ tabs = ["Tutorials", "Project Details", "Results", "Compare"]
+ self.tab_buttons = {}
+ for i, tab_name in enumerate(tabs):
+ tab_btn = QPushButton(tab_name)
+ tab_btn.setCheckable(True)
+ tab_btn.setAutoExclusive(False)
+ tab_btn.clicked.connect(lambda checked, name=tab_name: self.handle_tab_click(name))
+
+ tab_btn.setStyleSheet("""
+ QPushButton {
+ background-color: #f0f0f0;
+ border: 1px solid #cccccc;
+ border-bottom: none;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: #e8e8e8;
+ }
+ QPushButton:checked {
+ background-color: white;
+ border-bottom: 1px solid white;
+ }
+ """)
+ container_layout.addWidget(tab_btn)
+ self.tab_buttons[tab_name] = tab_btn
+
+ container_layout.addStretch(1)
+ window_tabs_container.setFixedHeight(40)
+ self.main_layout.addWidget(window_tabs_container)
+
+ def handle_tab_click(self, clicked_tab_name, initial_load=False):
+ """
+ Handles clicks on custom window tabs.
+ Toggles visibility of the corresponding panel in the splitter and updates tab styling.
+ """
+ clicked_button = self.tab_buttons.get(clicked_tab_name)
+ if not clicked_button:
+ return
+
+ panel_to_toggle = None
+ # Map tab names to actual panel widgets
+ # Note: Tutorials panel is directly shown/hidden by its button
+ # Project Details, Results, Compare are pages in the QStackedWidget
+ panel_map = {
+ "Tutorials": self.tutorials_panel,
+ "Project Details": self.project_panel,
+ "Results": self.results_panel,
+ "Compare": self.compare_panel
+ }
+
+ # Determine if we're toggling the static tutorial panel or a dynamic panel in the stack
+ if clicked_tab_name == "Tutorials":
+ panel_to_toggle = self.tutorials_panel
+ if initial_load:
+ panel_to_toggle.show()
+ clicked_button.setChecked(True)
+ else:
+ panel_to_toggle.setVisible(not panel_to_toggle.isVisible())
+ clicked_button.setChecked(panel_to_toggle.isVisible())
+ else:
+ # For Project Details, Results, Compare: show the specific panel in QStackedWidget
+ # and make sure the QStackedWidget itself is visible.
+ target_index = -1
+ if clicked_tab_name == "Project Details":
+ target_index = self.dynamic_content_stack.indexOf(self.project_panel)
+ elif clicked_tab_name == "Results":
+ target_index = self.dynamic_content_stack.indexOf(self.results_panel)
+ elif clicked_tab_name == "Compare":
+ target_index = self.dynamic_content_stack.indexOf(self.compare_panel)
+
+ if target_index != -1:
+ if initial_load:
+ self.dynamic_content_stack.setCurrentIndex(target_index)
+ self.dynamic_content_stack.show() # Ensure the stack itself is visible
+ clicked_button.setChecked(True)
+ else:
+ # Toggle logic for dynamic content panels:
+ # If the clicked tab's panel is ALREADY visible in the stack, hide the stack.
+ # Otherwise, show the clicked tab's panel in the stack.
+ if self.dynamic_content_stack.isVisible() and self.dynamic_content_stack.currentIndex() == target_index:
+ self.dynamic_content_stack.hide()
+ clicked_button.setChecked(False)
+ else:
+ self.dynamic_content_stack.setCurrentIndex(target_index)
+ self.dynamic_content_stack.show()
+ # Uncheck other dynamic content buttons when one is selected
+ for name, btn in self.tab_buttons.items():
+ if name in ["Project Details", "Results", "Compare"] and name != clicked_tab_name:
+ btn.setChecked(False)
+ btn.setStyleSheet("""
+ QPushButton {
+ background-color: #f0f0f0;
+ border: 1px solid #cccccc;
+ border-bottom: none;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: #e8e8e8;
+ }
+ """)
+ clicked_button.setChecked(True)
+ else:
+ return # Should not happen if panel_map is correct
+
+ # Update button stylesheets for all buttons
+ for name, btn in self.tab_buttons.items():
+ if btn.isChecked():
+ btn.setStyleSheet("""
+ QPushButton {
+ background-color: white;
+ border: 1px solid #cccccc;
+ border-bottom: 1px solid white;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: white;
+ }
+ """)
+ else:
+ btn.setStyleSheet("""
+ QPushButton {
+ background-color: #f0f0f0;
+ border: 1px solid #cccccc;
+ border-bottom: none;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: #e8e8e8;
+ }
+ """)
+ self.update_splitter_sizes()
+
+
+ def create_content_area(self):
+ self.content_splitter = QSplitter(Qt.Horizontal)
+ self.content_splitter.setStyleSheet("QSplitter::handle { background-color: #e0e0e0; }")
+ self.main_layout.addWidget(self.content_splitter)
+
+ # --- Left side: Static Tutorials panel ---
+ self.tutorials_panel = QWidget()
+ self.tutorials_panel.setFixedWidth(300) # Fixed width as per Figma design
+ self.tutorials_panel.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)
+ # It's initially shown by handle_tab_click("Tutorials", initial_load=True)
+
+ tutorials_layout = QVBoxLayout(self.tutorials_panel)
+ tutorials_layout.setContentsMargins(0, 0, 0, 0)
+ tutorials_layout.setSpacing(0)
+
+ # Tutorial header
+ tutorials_header = QWidget()
+ tutorials_header.setStyleSheet("background-color: rgb(240,230,230); border-bottom: 1px solid #e0e0e0;")
+ tutorials_header.setFixedHeight(40)
+ tutorials_header_layout = QHBoxLayout(tutorials_header)
+ tutorials_header_layout.setContentsMargins(5, 5, 5, 5)
+
+ self.tutorials_header_label = QLabel("Tutorials")
+ self.tutorials_header_label.setFont(QFont("Arial", 10, QFont.Bold))
+ close_btn = QPushButton("×")
+ close_btn.setFixedSize(20, 20)
+ close_btn.setStyleSheet("""
+ QPushButton {
+ border: 1px solid #cccccc;
+ border-radius: 3px;
+ background-color: white;
+ }
+ QPushButton:hover {
+ background-color: #f0f0f0;
+ }
+ """)
+ close_btn.clicked.connect(self.close_tutorials)
+
+ tutorials_header_layout.addWidget(self.tutorials_header_label)
+ tutorials_header_layout.addStretch()
+ tutorials_header_layout.addWidget(close_btn)
+ tutorials_layout.addWidget(tutorials_header)
+
+ # Tutorial Content Area with Scroll
+ self.tutorials_scroll_area = QScrollArea(self.tutorials_panel)
+ self.tutorials_scroll_area.setWidgetResizable(True)
+ self.tutorials_scroll_area.setStyleSheet("QScrollArea { border: none; } QWidget#tutorialScrollContent { background-color: #f9f0f0; border-right: 1px solid #e0e0e0;}")
+
+ self.tutorial_scroll_content = QWidget()
+ self.tutorial_scroll_content.setObjectName("tutorialScrollContent")
+ self.tutorials_content_layout = QVBoxLayout(self.tutorial_scroll_content)
+ self.tutorials_content_layout.setContentsMargins(15, 15, 15, 15)
+ self.tutorials_content_layout.setSpacing(10)
+
+ self.page_label = QLabel()
+ self.page_label.setAlignment(Qt.AlignRight | Qt.AlignTop)
+ self.page_label.setStyleSheet("font-weight: bold; padding: 5px; color: #888; background-color: transparent;")
+
+ self.welcome_label = QLabel()
+ self.welcome_label.setAlignment(Qt.AlignLeft | Qt.AlignTop)
+ self.welcome_label.setFont(QFont("Arial", 14, QFont.Bold))
+ self.welcome_label.setStyleSheet("padding: 10px 0px; background-color: transparent;")
+
+ self.description_label = QLabel()
+ self.description_label.setWordWrap(True)
+ self.description_label.setFont(QFont("Arial", 10))
+ self.description_label.setStyleSheet("padding: 10px 0px; background-color: transparent;")
+ self.description_label.setMinimumHeight(100)
+
+ self.tutorials_content_layout.addWidget(self.page_label)
+ self.tutorials_content_layout.addWidget(self.welcome_label)
+ self.tutorials_content_layout.addWidget(self.description_label)
+ self.tutorials_content_layout.addStretch()
+
+ self.tutorials_scroll_area.setWidget(self.tutorial_scroll_content)
+ tutorials_layout.addWidget(self.tutorials_scroll_area)
+
+ # Navigation buttons for tutorial
+ nav_buttons = QWidget()
+ nav_buttons.setStyleSheet("background-color: #f9f0f0; border-right: 1px solid #e0e0e0;")
+ nav_layout = QHBoxLayout(nav_buttons)
+ nav_layout.setContentsMargins(10, 5, 10, 5)
+ nav_layout.addStretch()
+
+ back_btn = QPushButton("Back")
+ back_btn.setStyleSheet("""
+ QPushButton {
+ background-color: #e0e0e0;
+ border: 1px solid #cccccc;
+ padding: 5px 15px;
+ border-radius: 3px;
+ }
+ QPushButton:hover {
+ background-color: #d0d0d0;
+ }
+ """)
+ back_btn.clicked.connect(self.tutorial_back)
+
+ next_btn = QPushButton("Next")
+ next_btn.setStyleSheet("""
+ QPushButton {
+ background-color: #e0e0e0;
+ border: 1px solid #cccccc;
+ padding: 5px 15px;
+ border-radius: 3px;
+ }
+ QPushButton:hover {
+ background-color: #d0d0d0;
+ }
+ """)
+ next_btn.clicked.connect(self.tutorial_next)
+
+ nav_layout.addWidget(back_btn)
+ nav_layout.addWidget(next_btn)
+ tutorials_layout.addWidget(nav_buttons)
+
+ # --- Right side: QStackedWidget to hold Project Details, Results, Compare ---
+ self.dynamic_content_stack = QStackedWidget()
+ self.dynamic_content_stack.setStyleSheet("background-color: white;")
+ self.dynamic_content_stack.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
+ # self.dynamic_content_stack.hide() # Initial visibility controlled by handle_tab_click
+
+ # --- Project Details panel ---
+ self.project_panel = QWidget()
+ project_layout = QVBoxLayout(self.project_panel)
+ project_layout.setContentsMargins(0, 0, 0, 0)
+
+ # Project header
+ project_header = QWidget()
+ project_header.setStyleSheet("background-color: #f0f0f0; border-bottom: 1px solid #e0e0e0;")
+ project_header.setFixedHeight(40)
+ project_header_layout = QHBoxLayout(project_header)
+ project_header_layout.setContentsMargins(5, 5, 5, 5)
+
+ self.project_header_label = QLabel("Project Details Window")
+ self.project_header_label.setFont(QFont("Arial", 10, QFont.Bold))
+ project_close_btn = QPushButton("×")
+ project_close_btn.setFixedSize(20, 20)
+ project_close_btn.setStyleSheet("""
+ QPushButton {
+ border: 1px solid #cccccc;
+ border-radius: 3px;
+ background-color: white;
+ }
+ QPushButton:hover {
+ background-color: #f0f0f0;
+ }
+ """)
+ project_close_btn.clicked.connect(self.close_project_details)
+
+ project_header_layout.addWidget(self.project_header_label)
+ project_header_layout.addStretch()
+ project_header_layout.addWidget(project_close_btn)
+ project_layout.addWidget(project_header)
+
+ # Content area for Project Details, with scroll
+ self.project_details_scroll_area = QScrollArea(self.project_panel)
+ self.project_details_scroll_area.setWidgetResizable(True)
+ self.project_details_scroll_area.setStyleSheet("QScrollArea { border: none; } QWidget#projectScrollContent { background-color: white; }")
+
+ self.project_details_content_widget = QWidget()
+ self.project_details_content_widget.setObjectName("projectScrollContent")
+ self.project_details_content_widget_layout = QVBoxLayout(self.project_details_content_widget)
+ self.project_details_content_widget_layout.setContentsMargins(10, 10, 10, 10)
+ self.project_details_content_widget_layout.setSpacing(10)
+
+ # --- General Information Section ---
+ self.generalInfoGroup = QtWidgets.QGroupBox("General Information", self.project_details_content_widget)
+ self.generalInfoGroup.setCheckable(True)
+ self.generalInfoGroup.setChecked(False)
+ self.generalInfoGroup.setStyleSheet("QGroupBox { background-color: rgb(240,230,230); border: 1px solid gray; border-radius: 5px; margin-top: 1ex; }"
+ "QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; padding: 0 3px; background-color: rgb(240,230,230); }"
+ "QGroupBox::indicator { width: 13px; height: 13px; }"
+ "QGroupBox::indicator:checked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled (1).png); }"
+ "QGroupBox::indicator:unchecked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png); }")
+
+ self.gridLayout_2 = QtWidgets.QFormLayout(self.generalInfoGroup)
+ self.gridLayout_2.setContentsMargins(10, 20, 10, 10)
+ self.gridLayout_2.setSpacing(10)
+
+ self.label_company_name = QtWidgets.QLabel("Company Name")
+ self.lineEdit_company_name = QtWidgets.QLineEdit()
+ self.lineEdit_company_name.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_company_name, self.lineEdit_company_name)
+
+ self.label_project_title = QtWidgets.QLabel("Project Title")
+ self.lineEdit_project_title = QtWidgets.QLineEdit()
+ self.lineEdit_project_title.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_project_title, self.lineEdit_project_title)
+
+ self.label_project_description = QtWidgets.QLabel("Project Description")
+ self.textEdit_project_description = QtWidgets.QTextEdit()
+ self.textEdit_project_description.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_project_description, self.textEdit_project_description)
+
+ self.label_valuer_name = QtWidgets.QLabel("Name of Valuer")
+ self.lineEdit_valuer_name = QtWidgets.QLineEdit()
+ self.lineEdit_valuer_name.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_valuer_name, self.lineEdit_valuer_name)
+
+ self.label_job_number = QtWidgets.QLabel("Job Number")
+ self.lineEdit_job_number = QtWidgets.QLineEdit()
+ self.lineEdit_job_number.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_job_number, self.lineEdit_job_number)
+
+ self.label_client = QtWidgets.QLabel("Client")
+ self.lineEdit_client = QtWidgets.QLineEdit()
+ self.lineEdit_client.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_client, self.lineEdit_client)
+
+ self.label_country = QtWidgets.QLabel("Country")
+ self.comboBox_country = QtWidgets.QComboBox()
+ # Set frame to True to encourage integrated dropdown
+ self.comboBox_country.setFrame(True)
+ # Add border style to make it visually clear it's a framed widget
+ self.comboBox_country.setStyleSheet("""
+ QComboBox {
+ background-color: #ffffff;
+ border: 1px solid #cccccc; /* Added border */
+ border-radius: 3px; /* Optional: adds slight rounding */
+ padding: 1px 0px 1px 3px; /* Adjust padding for text */
+ }
+ QComboBox::drop-down {
+ border-left: 1px solid #cccccc; /* Separator for the arrow button */
+ width: 20px; /* Width of the arrow button area */
+ }
+ QComboBox::down-arrow {
+ image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/arrow_down.png); /* Path to your down arrow icon if you have one */
+ /* If you don't have a custom arrow, remove this line or replace with a default one */
+ }
+ """)
+ countries = [
+ "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria",
+ "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan",
+ "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cabo Verde", "Cambodia",
+ "Cameroon", "Canada", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo (Kinshasa)",
+ "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czechia", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador",
+ "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Eswatini", "Ethiopia", "Fiji", "Finland", "France",
+ "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau",
+ "Guyana", "Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland",
+ "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Kuwait", "Kyrgyzstan",
+ "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Madagascar",
+ "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia",
+ "Moldova", "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal",
+ "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "North Korea", "North Macedonia", "Norway", "Oman", "Pakistan",
+ "Palau", "Palestine State", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar",
+ "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia",
+ "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa",
+ "South Korea", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname", "Sweden", "Switzerland", "Syria", "Taiwan",
+ "Tajikistan", "Tanzania", "Thailand", "Timor-Leste", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan",
+ "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Vatican City",
+ "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"
+ ]
+ self.comboBox_country.addItems(countries)
+
+ self.label_base_year = QtWidgets.QLabel("Base Year")
+ self.lineEdit_base_year = QtWidgets.QLineEdit()
+ self.lineEdit_base_year.setStyleSheet("background-color: #ffffff")
+ self.gridLayout_2.addRow(self.label_base_year, self.lineEdit_base_year)
+
+ self.project_details_content_widget_layout.addWidget(self.generalInfoGroup)
+
+
+ # --- Input Parameters Section ---
+ self.inputParamsGroup = QtWidgets.QGroupBox("Input Parameters", self.project_details_content_widget)
+ self.inputParamsGroup.setCheckable(True)
+ self.inputParamsGroup.setChecked(False)
+ self.inputParamsGroup.setStyleSheet("QGroupBox { background-color: rgb(240,230,230); border: 1px solid gray; border-radius: 5px; margin-top: 1ex; }"
+ "QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; padding: 0 3px; background-color: rgb(240,230,230); }"
+ "QGroupBox::indicator { width: 13px; height: 13px; }"
+ "QGroupBox::indicator:checked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled (1).png); }"
+ "QGroupBox::indicator:unchecked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png); }")
+
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.inputParamsGroup)
+ self.verticalLayout_3.setContentsMargins(10, 20, 10, 10)
+ self.verticalLayout_3.setSpacing(5)
+
+ self.pushButton = QtWidgets.QPushButton("Structure Works Data")
+ self.pushButton.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.pushButton.setCheckable(True)
+ self.pushButton.setChecked(False)
+ self.verticalLayout_3.addWidget(self.pushButton)
+
+ self.gridLayout_3_widget = QtWidgets.QWidget() # Container for Structure Works sub-buttons
+ self.gridLayout_3 = QtWidgets.QGridLayout(self.gridLayout_3_widget)
+ self.gridLayout_3.setContentsMargins(20, 0, 0, 0)
+
+ self.pushButton_2 = QtWidgets.QPushButton("Foundation", clicked=self.openFoundationWindow)
+ self.pushButton_2.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.gridLayout_3.addWidget(self.pushButton_2, 0, 0, 1, 1)
+
+ self.pushButton_3 = QtWidgets.QPushButton("Super-Structure", clicked=self.openSuperStructureWindow)
+ self.pushButton_3.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.gridLayout_3.addWidget(self.pushButton_3, 1, 0, 1, 1)
+
+ self.pushButton_4 = QtWidgets.QPushButton("Sub-Structure", clicked=self.openSubStructureWindow)
+ self.pushButton_4.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.gridLayout_3.addWidget(self.pushButton_4, 2, 0, 1, 1)
+
+ self.pushButton_5 = QtWidgets.QPushButton("Miscellaneous", clicked=self.openMiscellaneousWindow)
+ self.pushButton_5.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.gridLayout_3.addWidget(self.pushButton_5, 3, 0, 1, 1)
+ self.verticalLayout_3.addWidget(self.gridLayout_3_widget)
+
+
+ self.pushButton_6 = QtWidgets.QPushButton("Financial Data", clicked=self.openFinancialWindow)
+ self.verticalLayout_3.addWidget(self.pushButton_6)
+
+ self.pushButton_7 = QtWidgets.QPushButton("Carbon Emission Data")
+ self.pushButton_7.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.pushButton_7.setCheckable(True)
+ self.pushButton_7.setChecked(False)
+ self.verticalLayout_3.addWidget(self.pushButton_7)
+
+ self.gridLayout_4_widget = QtWidgets.QWidget() # Container for Carbon Emission sub-buttons
+ self.gridLayout_4 = QtWidgets.QGridLayout(self.gridLayout_4_widget)
+ self.gridLayout_4.setContentsMargins(20, 0, 0, 0)
+
+ self.pushButton_8 = QtWidgets.QPushButton("Carbon Emission Cost Data", clicked=self.openCarbonEmissionWindow)
+ self.pushButton_8.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+ self.gridLayout_4.addWidget(self.pushButton_8, 0, 0, 1, 1)
+ self.verticalLayout_3.addWidget(self.gridLayout_4_widget)
+
+ self.pushButton_9 = QtWidgets.QPushButton("Bridge and Traffic Data", clicked=self.openBridgeTrafficWindow)
+ self.verticalLayout_3.addWidget(self.pushButton_9)
+
+ self.pushButton_10 = QtWidgets.QPushButton("Maintenance and Repair", clicked=self.openMaintenanceWindow)
+ self.verticalLayout_3.addWidget(self.pushButton_10)
+
+ self.pushButton_11 = QtWidgets.QPushButton("Disposal and Recycling", clicked=self.openDemolitionWindow)
+ self.verticalLayout_3.addWidget(self.pushButton_11)
+
+ self.project_details_content_widget_layout.addWidget(self.inputParamsGroup)
+
+
+ # --- Outputs Section ---
+ self.outputsGroup = QtWidgets.QGroupBox("Outputs", self.project_details_content_widget)
+ self.outputsGroup.setCheckable(True)
+ self.outputsGroup.setChecked(False)
+ self.outputsGroup.setStyleSheet("QGroupBox { background-color: rgb(240,230,230); border: 1px solid gray; border-radius: 5px; margin-top: 1ex; }"
+ "QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; padding: 0 3px; background-color: rgb(240,230,230); }"
+ "QGroupBox::indicator { width: 13px; height: 13px; }"
+ "QGroupBox::indicator:checked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled (1).png); }"
+ "QGroupBox::indicator:unchecked { image: url(C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png); }")
+
+ self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.outputsGroup)
+ self.verticalLayout_4.setContentsMargins(10, 20, 10, 10)
+ self.label_10 = QtWidgets.QLabel("Output content goes here.")
+ self.verticalLayout_4.addWidget(self.label_10)
+
+ self.project_details_content_widget_layout.addWidget(self.outputsGroup)
+ self.project_details_content_widget_layout.addStretch(1)
+
+ self.project_details_scroll_area.setWidget(self.project_details_content_widget)
+ project_layout.addWidget(self.project_details_scroll_area)
+ self.dynamic_content_stack.addWidget(self.project_panel)
+
+
+ # --- Results Panel (Placeholder) ---
+ self.results_panel = QWidget()
+ results_layout = QVBoxLayout(self.results_panel)
+ results_layout.setContentsMargins(0, 0, 0, 0)
+ results_header = QWidget()
+ results_header.setStyleSheet("background-color: #f0f0f0; border-bottom: 1px solid #e0e0e0;")
+ results_header.setFixedHeight(40)
+ results_header_layout = QHBoxLayout(results_header)
+ results_header_layout.setContentsMargins(5, 5, 5, 5)
+ self.results_header_label = QLabel("Results")
+ self.results_header_label.setFont(QFont("Arial", 10, QFont.Bold))
+ results_header_layout.addWidget(self.results_header_label)
+ results_header_layout.addStretch()
+ results_layout.addWidget(results_header)
+ results_layout.addWidget(QLabel("Results content goes here.
This panel will display analytical results.
", self.results_panel))
+ self.dynamic_content_stack.addWidget(self.results_panel)
+
+
+ # --- Compare Panel (Placeholder) ---
+ self.compare_panel = QWidget()
+ compare_layout = QVBoxLayout(self.compare_panel)
+ compare_layout.setContentsMargins(0, 0, 0, 0)
+ compare_header = QWidget()
+ compare_header.setStyleSheet("background-color: #f0f0f0; border-bottom: 1px solid #e0e0e0;")
+ compare_header.setFixedHeight(40)
+ compare_header_layout = QHBoxLayout(compare_header)
+ compare_header_layout.setContentsMargins(5, 5, 5, 5)
+ self.compare_header_label = QLabel("Compare")
+ self.compare_header_label.setFont(QFont("Arial", 10, QFont.Bold))
+ compare_header_layout.addWidget(self.compare_header_label)
+ compare_header_layout.addStretch()
+ compare_layout.addWidget(compare_header)
+ compare_layout.addWidget(QLabel("Compare different scenarios here.
This panel will allow side-by-side comparisons.
", self.compare_panel))
+ self.dynamic_content_stack.addWidget(self.compare_panel)
+
+
+ # Add the static tutorial panel and the dynamic content stack to the main splitter
+ self.content_splitter.addWidget(self.tutorials_panel)
+ self.content_splitter.addWidget(self.dynamic_content_stack)
+
+ # Set initial sizes for the splitter: Tutorials fixed, rest for dynamic content
+ # These sizes will be adjusted by update_splitter_sizes based on panel visibility
+ # For initial setup, we want tutorials visible and project details visible.
+ # So Tutorials (300) and then the rest for the stacked widget.
+ self.content_splitter.setSizes([300, self.width() - 300])
+
+
+ def create_status_bar(self):
+ self.statusBar = self.statusBar() # Assign status_bar to self.statusBar
+ self.statusBar.setStyleSheet("background-color: #f0f0f0; border-top: 1px solid #e0e0e0;")
+
+ # --- "Data" section at the bottom ---
+ self.data_widget = QWidget()
+ self.data_layout = QHBoxLayout(self.data_widget)
+ self.data_layout.setContentsMargins(5, 0, 5, 0)
+ self.data_layout.setSpacing(5)
+
+ data_label = QLabel("Data")
+ data_label.setFont(QFont("Arial", 9, QFont.Bold))
+ self.data_layout.addWidget(data_label)
+
+ look_up_label = QLabel("Look up:")
+ self.data_layout.addWidget(look_up_label)
+ self.combo_box_lookup = QComboBox()
+ self.combo_box_lookup.addItems(["Carbon Data", "Maintenance Rate Data", "Recycling Data"])
+ self.combo_box_lookup.setStyleSheet("background-color: white; border: 1px solid #cccccc; padding: 2px;")
+ self.data_layout.addWidget(self.combo_box_lookup)
+
+ self.search_line_edit = QLineEdit()
+ self.search_line_edit.setPlaceholderText("Search...")
+ self.search_line_edit.setStyleSheet("background-color: white; border: 1px solid #cccccc; padding: 2px;")
+ self.data_layout.addWidget(self.search_line_edit)
+
+ search_button = QPushButton("Search")
+ search_button.setStyleSheet("""
+ QPushButton {
+ background-color: #e0e0e0;
+ border: 1px solid #cccccc;
+ padding: 3px 10px;
+ border-radius: 3px;
+ }
+ QPushButton:hover {
+ background-color: #d0d0d0;
+ }
+ """)
+ self.data_layout.addWidget(search_button)
+
+ self.data_layout.addStretch(1)
+
+ self.statusBar.addPermanentWidget(self.data_widget)
+
+
+ def update_tutorial_content(self):
+ page_data = self.tutorial_pages[self.current_tutorial_page - 1]
+
+ self.page_label.setText(page_data["page_number"])
+ self.welcome_label.setText(page_data["title"])
+ self.description_label.setText(page_data["content"])
+
+ def tutorial_next(self):
+ if self.current_tutorial_page < self.total_tutorial_pages:
+ self.current_tutorial_page += 1
+ self.update_tutorial_content()
+
+ def tutorial_back(self):
+ if self.current_tutorial_page > 1:
+ self.current_tutorial_page -= 1
+ self.update_tutorial_content()
+
+ def close_tutorials(self):
+ self.tutorials_panel.hide()
+ if "Tutorials" in self.tab_buttons:
+ self.tab_buttons["Tutorials"].setChecked(False)
+ self.tab_buttons["Tutorials"].setStyleSheet("""
+ QPushButton {
+ background-color: #f0f0f0;
+ border: 1px solid #cccccc;
+ border-bottom: none;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: #e8e8e8;
+ }
+ """)
+ self.update_splitter_sizes()
+
+ def close_project_details(self):
+ # This function should probably hide the current dynamic panel and potentially
+ # uncheck its associated custom tab button.
+ # For simplicity, if the Project Details panel's close button is clicked,
+ # it will hide the *entire* dynamic content stack and uncheck Project Details button.
+ self.dynamic_content_stack.hide()
+
+ if "Project Details" in self.tab_buttons:
+ self.tab_buttons["Project Details"].setChecked(False)
+ self.tab_buttons["Project Details"].setStyleSheet("""
+ QPushButton {
+ background-color: #f0f0f0;
+ border: 1px solid #cccccc;
+ border-bottom: none;
+ border-top-left-radius: 5px;
+ border-top-right-radius: 5px;
+ padding: 5px 15px;
+ margin: 0px 2px;
+ min-width: 80px;
+ }
+ QPushButton:hover {
+ background-color: #e8e8e8;
+ }
+ """)
+ self.update_splitter_sizes()
+
+
+ def update_splitter_sizes(self):
+ """Adjusts splitter sizes based on currently visible panels."""
+ sizes = [0, 0] # Initial sizes for tutorials_panel and dynamic_content_stack
+
+ if self.tutorials_panel.isVisible():
+ sizes[0] = self.tutorials_panel.width()
+
+ if self.dynamic_content_stack.isVisible():
+ sizes[1] = self.content_splitter.width() - sizes[0]
+
+ self.content_splitter.setSizes(sizes)
+
+
+ # --- Methods for Project Details Collapsible Groups ---
+ def toggle_general_info_group_content(self, group_box, checked):
+ widgets_to_toggle = [
+ self.label_company_name, self.lineEdit_company_name,
+ self.label_project_title, self.lineEdit_project_title,
+ self.label_project_description, self.textEdit_project_description,
+ self.label_valuer_name, self.lineEdit_valuer_name,
+ self.label_job_number, self.lineEdit_job_number,
+ self.label_client, self.lineEdit_client,
+ self.label_country, self.comboBox_country,
+ self.label_base_year, self.lineEdit_base_year
+ ]
+ for widget in widgets_to_toggle:
+ widget.setVisible(checked)
+ self.update_group_indicator_style(group_box, checked)
+
+ def toggle_input_params_group_content(self, group_box, checked):
+ self.pushButton.setVisible(checked)
+ self.pushButton_6.setVisible(checked)
+ self.pushButton_7.setVisible(checked)
+ self.pushButton_9.setVisible(checked)
+ self.pushButton_10.setVisible(checked)
+ self.pushButton_11.setVisible(checked)
+
+ if checked:
+ self.gridLayout_3_widget.setVisible(self.pushButton.isChecked())
+ self.gridLayout_4_widget.setVisible(self.pushButton_7.isChecked())
+ else:
+ self.gridLayout_3_widget.setVisible(False)
+ self.gridLayout_4_widget.setVisible(False)
+
+ self.update_group_indicator_style(group_box, checked)
+
+ def toggle_outputs_group_content(self, group_box, checked):
+ self.label_10.setVisible(checked)
+ self.update_group_indicator_style(group_box, checked)
+
+ def update_group_indicator_style(self, group_box, is_checked):
+ style = group_box.styleSheet()
+ if is_checked:
+ style = style.replace("indicator:unchecked", "indicator:checked")
+ else:
+ style = style.replace("indicator:checked", "indicator:unchecked")
+ group_box.setStyleSheet(style)
+
+ def toggle_sub_buttons_visibility(self, layout, toggle_button):
+ is_checked = toggle_button.isChecked()
+ layout.parentWidget().setVisible(is_checked) # Hide/show the container widget of the layout
+
+ if is_checked:
+ toggle_button.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled (1).png"))
+ else:
+ toggle_button.setIcon(QtGui.QIcon("C:/Users/saans/AppData/Local/Programs/Python/Python310/Lib/site-packages/qt5_applications/Qt/bin/../../../../../../../../../../Downloads/play_arrow_filled.png"))
+
+
+ def retranslateUi(self, MainWindow):
+ _translate = QtCore.QCoreApplication.translate
+ MainWindow.setWindowTitle(_translate("MainWindow", " - BICCA Studio 1.0.0"))
+
+ # Custom Tab button texts
+ self.tab_buttons["Tutorials"].setText(_translate("MainWindow", "Tutorials"))
+ self.tab_buttons["Project Details"].setText(_translate("MainWindow", "Project Details"))
+ self.tab_buttons["Results"].setText(_translate("MainWindow", "Results"))
+ self.tab_buttons["Compare"].setText(_translate("MainWindow", "Compare"))
+
+ # Headers for panels
+ self.tutorials_header_label.setText(_translate("MainWindow", "Tutorials"))
+ self.project_header_label.setText(_translate("MainWindow", "Project Details Window"))
+ self.results_header_label.setText(_translate("MainWindow", "Results"))
+ self.compare_header_label.setText(_translate("MainWindow", "Compare"))
+
+ # Group Box Titles
+ self.generalInfoGroup.setTitle(_translate("MainWindow", "General Information"))
+ self.inputParamsGroup.setTitle(_translate("MainWindow", "Input Parameters"))
+ self.outputsGroup.setTitle(_translate("MainWindow", "Outputs"))
+
+ # General Information Labels and Placeholders
+ self.label_company_name.setText(_translate("MainWindow", "Company Name"))
+ self.lineEdit_company_name.setPlaceholderText(_translate("MainWindow", "Enter Company Name"))
+ self.label_project_title.setText(_translate("MainWindow", "Project Title"))
+ self.lineEdit_project_title.setPlaceholderText(_translate("MainWindow", "Enter Project Title"))
+ self.label_project_description.setText(_translate("MainWindow", "Project Description"))
+ self.textEdit_project_description.setPlaceholderText(_translate("MainWindow", "Enter Project Description"))
+ self.label_valuer_name.setText(_translate("MainWindow", "Name of Valuer"))
+ self.lineEdit_valuer_name.setPlaceholderText(_translate("MainWindow", "Enter Valuer's Name"))
+ self.label_job_number.setText(_translate("MainWindow", "Job Number"))
+ self.lineEdit_job_number.setPlaceholderText(_translate("MainWindow", "Enter Job Number"))
+ self.label_client.setText(_translate("MainWindow", "Client"))
+ self.lineEdit_client.setPlaceholderText(_translate("MainWindow", "Enter Client Name"))
+ self.label_country.setText(_translate("MainWindow", "Country"))
+ self.label_base_year.setText(_translate("MainWindow", "Base Year"))
+ self.lineEdit_base_year.setPlaceholderText(_translate("MainWindow", "e.g., 2023"))
+
+ # Input Parameters Buttons
+ self.pushButton.setText(_translate("MainWindow", "Structure Works Data"))
+ self.pushButton_3.setText(_translate("MainWindow", "Super-Structure"))
+ self.pushButton_2.setText(_translate("MainWindow", "Foundation"))
+ self.pushButton_4.setText(_translate("MainWindow", "Sub-Structure"))
+ self.pushButton_5.setText(_translate("MainWindow", "Miscellaneous"))
+ self.pushButton_6.setText(_translate("MainWindow", "Financial Data"))
+ self.pushButton_7.setText(_translate("MainWindow", "Carbon Emission Data"))
+ self.pushButton_8.setText(_translate("MainWindow", "Carbon Emission Cost Data"))
+ self.pushButton_9.setText(_translate("MainWindow", "Bridge and Traffic Data"))
+ self.pushButton_10.setText(_translate("MainWindow", "Maintenance and Repair"))
+ self.pushButton_11.setText(_translate("MainWindow", "Disposal and Recycling"))
+
+ # Outputs Label
+ self.label_10.setText(_translate("MainWindow", "Output content goes here."))
+
+ # Menu and Toolbar actions
+ self.menuFile.setTitle(_translate("MainWindow", "File"))
+ self.menuHome.setTitle(_translate("MainWindow", "Home"))
+ self.menuReports.setTitle(_translate("MainWindow", "Reports"))
+ self.menuHelp.setTitle(_translate("MainWindow", "Help"))
+ self.toolBar.setWindowTitle(_translate("MainWindow", "toolBar"))
+ self.actionNew.setText(_translate("MainWindow", "New"))
+ self.actionOpen.setText(_translate("MainWindow", "Open"))
+ self.actionSave.setText(_translate("MainWindow", "Save"))
+ self.actionSave_As.setText(_translate("MainWindow", "Save As..."))
+ self.actionCreate_a_Copy.setText(_translate("MainWindow", "Create a Copy"))
+ self.actionPrint.setText(_translate("MainWindow", "Print"))
+ self.actionRename.setText(_translate("MainWindow", "Rename"))
+ self.actionExport.setText(_translate("MainWindow", "Export"))
+ self.actionVersion_History.setText(_translate("MainWindow", "Version History"))
+ self.actionInfo.setText(_translate("MainWindow", "Info"))
+ self.actionContact_Us.setText(_translate("MainWindow", "Contact Us"))
+ self.actionFeedback.setText(_translate("MainWindow", "Feedback"))
+ self.actionVideo_Tutorials.setText(_translate("MainWindow", "Video Tutorials"))
+ self.actionJoin_our_Community.setText(_translate("MainWindow", "Join our Community"))
+
+ # Data section retranslate
+ self.combo_box_lookup.setItemText(0, _translate("MainWindow", "Carbon Data"))
+ self.combo_box_lookup.setItemText(1, _translate("MainWindow", "Maintenance Rate Data"))
+ self.combo_box_lookup.setItemText(2, _translate("MainWindow", "Recycling Data"))
+
+
+if __name__ == "__main__":
+ app = QtWidgets.QApplication(sys.argv)
+ window = MainWindow()
+ window.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_
new file mode 100644
index 0000000..e69de29
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_BridgeANDTrafficData_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_BridgeANDTrafficData_Window.py
new file mode 100644
index 0000000..583f82a
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_BridgeANDTrafficData_Window.py
@@ -0,0 +1,486 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_Bridge&TrafficData_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_BridgeTraffic_Dialog(object):
+ def setupUi(self, BridgeTraffic_Dialog):
+ BridgeTraffic_Dialog.setObjectName("BridgeTraffic_Dialog")
+ BridgeTraffic_Dialog.resize(1440, 999)
+ BridgeTraffic_Dialog.setStyleSheet("background-color: #fafafa")
+ self.scrollArea = QtWidgets.QScrollArea(BridgeTraffic_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 50, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents_3 = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3")
+ self.label_16 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_16.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_16.setFont(font)
+ self.label_16.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_16.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_16.setObjectName("label_16")
+ self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents_3)
+ self.widget_3.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget_3.setStyleSheet("background-color: #fff9f9")
+ self.widget_3.setObjectName("widget_3")
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget_3)
+ self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.pushButton_34 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_34.setFont(font)
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_34.setIcon(icon)
+ self.pushButton_34.setCheckable(True)
+ self.pushButton_34.setAutoDefault(True)
+ self.pushButton_34.setObjectName("pushButton_34")
+ self.verticalLayout_3.addWidget(self.pushButton_34)
+ self.widget_7 = QtWidgets.QWidget(self.widget_3)
+ self.widget_7.setObjectName("widget_7")
+ self.formLayout_3 = QtWidgets.QFormLayout(self.widget_7)
+ self.formLayout_3.setObjectName("formLayout_3")
+ self.pushButton_35 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_35.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_35.setIcon(icon1)
+ self.pushButton_35.setObjectName("pushButton_35")
+ self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_35)
+ self.pushButton_36 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_36.setFont(font)
+ self.pushButton_36.setIcon(icon1)
+ self.pushButton_36.setObjectName("pushButton_36")
+ self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_36)
+ self.pushButton_37 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_37.setFont(font)
+ self.pushButton_37.setIcon(icon1)
+ self.pushButton_37.setObjectName("pushButton_37")
+ self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_37)
+ self.pushButton_38 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_38.setFont(font)
+ self.pushButton_38.setIcon(icon1)
+ self.pushButton_38.setObjectName("pushButton_38")
+ self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_38)
+ self.verticalLayout_3.addWidget(self.widget_7)
+ self.pushButton_39 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_39.setFont(font)
+ self.pushButton_39.setObjectName("pushButton_39")
+ self.verticalLayout_3.addWidget(self.pushButton_39)
+ self.pushButton_40 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_40.setFont(font)
+ self.pushButton_40.setIcon(icon)
+ self.pushButton_40.setCheckable(True)
+ self.pushButton_40.setObjectName("pushButton_40")
+ self.verticalLayout_3.addWidget(self.pushButton_40)
+ self.widget_10 = QtWidgets.QWidget(self.widget_3)
+ self.widget_10.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_10.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_10.setObjectName("widget_10")
+ self.pushButton_41 = QtWidgets.QPushButton(self.widget_10)
+ self.pushButton_41.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_41.setFont(font)
+ self.pushButton_41.setIcon(icon1)
+ self.pushButton_41.setObjectName("pushButton_41")
+ self.verticalLayout_3.addWidget(self.widget_10)
+ self.pushButton_42 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_42.setFont(font)
+ self.pushButton_42.setObjectName("pushButton_42")
+ self.verticalLayout_3.addWidget(self.pushButton_42)
+ self.pushButton_43 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_43.setFont(font)
+ self.pushButton_43.setObjectName("pushButton_43")
+ self.verticalLayout_3.addWidget(self.pushButton_43)
+ self.pushButton_12 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_12.setFont(font)
+ self.pushButton_12.setObjectName("pushButton_12")
+ self.verticalLayout_3.addWidget(self.pushButton_12)
+ self.label_17 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_17.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_17.setFont(font)
+ self.label_17.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_17.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_17.setObjectName("label_17")
+ self.textBrowser_3 = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents_3)
+ self.textBrowser_3.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser_3.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser_3.setObjectName("textBrowser_3")
+ self.verticalScrollBar_3 = QtWidgets.QScrollBar(self.scrollAreaWidgetContents_3)
+ self.verticalScrollBar_3.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar_3.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar_3.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar_3.setObjectName("verticalScrollBar_3")
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents_3)
+ self.widget_4 = QtWidgets.QWidget(BridgeTraffic_Dialog)
+ self.widget_4.setGeometry(QtCore.QRect(350, 45, 895, 561))
+ self.widget_4.setStyleSheet("background-color: #fff9f9")
+ self.widget_4.setObjectName("widget_4")
+ self.label_18 = QtWidgets.QLabel(self.widget_4)
+ self.label_18.setGeometry(QtCore.QRect(20, 20, 141, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_18.setFont(font)
+ self.label_18.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_18.setObjectName("label_18")
+ self.label_19 = QtWidgets.QLabel(self.widget_4)
+ self.label_19.setGeometry(QtCore.QRect(20, 80, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_19.setFont(font)
+ self.label_19.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_19.setObjectName("label_19")
+ self.label_20 = QtWidgets.QLabel(self.widget_4)
+ self.label_20.setGeometry(QtCore.QRect(20, 50, 201, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_20.setFont(font)
+ self.label_20.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_20.setObjectName("label_20")
+ self.label_29 = QtWidgets.QLabel(self.widget_4)
+ self.label_29.setGeometry(QtCore.QRect(20, 110, 151, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_29.setFont(font)
+ self.label_29.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_29.setObjectName("label_29")
+ self.label_30 = QtWidgets.QLabel(self.widget_4)
+ self.label_30.setGeometry(QtCore.QRect(20, 140, 221, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_30.setFont(font)
+ self.label_30.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_30.setObjectName("label_30")
+ self.comboBox_6 = QtWidgets.QComboBox(self.widget_4)
+ self.comboBox_6.setGeometry(QtCore.QRect(270, 80, 101, 22))
+ self.comboBox_6.setStyleSheet("background-color: #ffffff")
+ self.comboBox_6.setObjectName("comboBox_6")
+ self.comboBox_7 = QtWidgets.QComboBox(self.widget_4)
+ self.comboBox_7.setGeometry(QtCore.QRect(270, 20, 101, 22))
+ self.comboBox_7.setStyleSheet("background-color: #ffffff")
+ self.comboBox_7.setObjectName("comboBox_7")
+ self.lineEdit_9 = QtWidgets.QLineEdit(self.widget_4)
+ self.lineEdit_9.setGeometry(QtCore.QRect(270, 50, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_9.setFont(font)
+ self.lineEdit_9.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_9.setObjectName("lineEdit_9")
+ self.lineEdit_10 = QtWidgets.QLineEdit(self.widget_4)
+ self.lineEdit_10.setGeometry(QtCore.QRect(270, 110, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_10.setFont(font)
+ self.lineEdit_10.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_10.setObjectName("lineEdit_10")
+ self.buttonBox_4 = QtWidgets.QDialogButtonBox(self.widget_4)
+ self.buttonBox_4.setGeometry(QtCore.QRect(540, 520, 341, 32))
+ self.buttonBox_4.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox_4.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox_4.setObjectName("buttonBox_4")
+ self.label_31 = QtWidgets.QLabel(self.widget_4)
+ self.label_31.setGeometry(QtCore.QRect(390, 200, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_31.setFont(font)
+ self.label_31.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_31.setObjectName("label_31")
+ self.label_32 = QtWidgets.QLabel(self.widget_4)
+ self.label_32.setGeometry(QtCore.QRect(390, 50, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_32.setFont(font)
+ self.label_32.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_32.setObjectName("label_32")
+ self.label_33 = QtWidgets.QLabel(self.widget_4)
+ self.label_33.setGeometry(QtCore.QRect(390, 80, 61, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_33.setFont(font)
+ self.label_33.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_33.setObjectName("label_33")
+ self.label_34 = QtWidgets.QLabel(self.widget_4)
+ self.label_34.setGeometry(QtCore.QRect(390, 110, 61, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_34.setFont(font)
+ self.label_34.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_34.setObjectName("label_34")
+ self.textBrowser_4 = QtWidgets.QTextBrowser(self.widget_4)
+ self.textBrowser_4.setGeometry(QtCore.QRect(20, 180, 221, 61))
+ self.textBrowser_4.setObjectName("textBrowser_4")
+ self.label_35 = QtWidgets.QLabel(self.widget_4)
+ self.label_35.setGeometry(QtCore.QRect(20, 260, 221, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_35.setFont(font)
+ self.label_35.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_35.setObjectName("label_35")
+ self.comboBox_8 = QtWidgets.QComboBox(self.widget_4)
+ self.comboBox_8.setGeometry(QtCore.QRect(270, 140, 101, 22))
+ self.comboBox_8.setStyleSheet("background-color: #ffffff")
+ self.comboBox_8.setObjectName("comboBox_8")
+ self.comboBox_9 = QtWidgets.QComboBox(self.widget_4)
+ self.comboBox_9.setGeometry(QtCore.QRect(270, 200, 101, 22))
+ self.comboBox_9.setStyleSheet("background-color: #ffffff")
+ self.comboBox_9.setObjectName("comboBox_9")
+ self.widget_11 = QtWidgets.QWidget(self.widget_4)
+ self.widget_11.setGeometry(QtCore.QRect(270, 260, 330, 216))
+ self.widget_11.setStyleSheet("background-color: #ffffff")
+ self.widget_11.setObjectName("widget_11")
+ self.label_40 = QtWidgets.QLabel(self.widget_11)
+ self.label_40.setGeometry(QtCore.QRect(10, 170, 80, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_40.setFont(font)
+ self.label_40.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_40.setObjectName("label_40")
+ self.label_36 = QtWidgets.QLabel(self.widget_11)
+ self.label_36.setGeometry(QtCore.QRect(10, 10, 80, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_36.setFont(font)
+ self.label_36.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_36.setObjectName("label_36")
+ self.label_37 = QtWidgets.QLabel(self.widget_11)
+ self.label_37.setGeometry(QtCore.QRect(10, 50, 80, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_37.setFont(font)
+ self.label_37.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_37.setObjectName("label_37")
+ self.label_39 = QtWidgets.QLabel(self.widget_11)
+ self.label_39.setGeometry(QtCore.QRect(10, 90, 80, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_39.setFont(font)
+ self.label_39.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_39.setObjectName("label_39")
+ self.label_38 = QtWidgets.QLabel(self.widget_11)
+ self.label_38.setGeometry(QtCore.QRect(10, 130, 80, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_38.setFont(font)
+ self.label_38.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_38.setObjectName("label_38")
+ self.lineEdit_11 = QtWidgets.QLineEdit(self.widget_11)
+ self.lineEdit_11.setGeometry(QtCore.QRect(110, 10, 171, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_11.setFont(font)
+ self.lineEdit_11.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_11.setObjectName("lineEdit_11")
+ self.lineEdit_12 = QtWidgets.QLineEdit(self.widget_11)
+ self.lineEdit_12.setGeometry(QtCore.QRect(110, 50, 171, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_12.setFont(font)
+ self.lineEdit_12.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_12.setObjectName("lineEdit_12")
+ self.lineEdit_15 = QtWidgets.QLineEdit(self.widget_11)
+ self.lineEdit_15.setGeometry(QtCore.QRect(110, 90, 171, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_15.setFont(font)
+ self.lineEdit_15.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_15.setObjectName("lineEdit_15")
+ self.lineEdit_16 = QtWidgets.QLineEdit(self.widget_11)
+ self.lineEdit_16.setGeometry(QtCore.QRect(110, 130, 171, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_16.setFont(font)
+ self.lineEdit_16.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_16.setObjectName("lineEdit_16")
+ self.lineEdit_17 = QtWidgets.QLineEdit(self.widget_11)
+ self.lineEdit_17.setGeometry(QtCore.QRect(110, 170, 171, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_17.setFont(font)
+ self.lineEdit_17.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_17.setObjectName("lineEdit_17")
+ self.label_41 = QtWidgets.QLabel(self.widget_4)
+ self.label_41.setGeometry(QtCore.QRect(610, 350, 61, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_41.setFont(font)
+ self.label_41.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_41.setObjectName("label_41")
+ self.pushButton = QtWidgets.QPushButton(BridgeTraffic_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 20, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon2)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.pushButton_6 = QtWidgets.QPushButton(BridgeTraffic_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 20, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_6.setIcon(icon2)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+
+ # Add a Save and Close button
+ self.buttonBox = QtWidgets.QDialogButtonBox(BridgeTraffic_Dialog)
+ self.buttonBox.setGeometry(QtCore.QRect(540, 520, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close | QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+
+ # Connect the Close button to the custom close method
+ self.buttonBox.rejected.connect(self.show_warning)
+
+ # Connect the Save button to the save_data method (if implemented)
+ # self.buttonBox.accepted.connect(self.save_data)
+
+ self.retranslateUi(BridgeTraffic_Dialog)
+ self.buttonBox_4.accepted.connect(BridgeTraffic_Dialog.accept) # type: ignore
+ self.buttonBox_4.rejected.connect(BridgeTraffic_Dialog.reject) # type: ignore
+ self.pushButton_34.toggled['bool'].connect(self.widget_7.setVisible) # type: ignore
+ self.pushButton_40.toggled['bool'].connect(self.widget_10.setVisible) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(BridgeTraffic_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, BridgeTraffic_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ BridgeTraffic_Dialog.setWindowTitle(_translate("BridgeTraffic_Dialog", "Bridge and Traffic Data"))
+ self.label_16.setText(_translate("BridgeTraffic_Dialog", "Input Parameters"))
+ self.pushButton_34.setText(_translate("BridgeTraffic_Dialog", "Structure Works Data"))
+ self.pushButton_35.setText(_translate("BridgeTraffic_Dialog", "Foundation"))
+ self.pushButton_36.setText(_translate("BridgeTraffic_Dialog", "Super-Structure"))
+ self.pushButton_37.setText(_translate("BridgeTraffic_Dialog", "Sub-Structure"))
+ self.pushButton_38.setText(_translate("BridgeTraffic_Dialog", "Miscellaneous"))
+ self.pushButton_39.setText(_translate("BridgeTraffic_Dialog", "Financial Data"))
+ self.pushButton_40.setText(_translate("BridgeTraffic_Dialog", "Carbon Emission Data"))
+ self.pushButton_41.setText(_translate("BridgeTraffic_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_42.setText(_translate("BridgeTraffic_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_43.setText(_translate("BridgeTraffic_Dialog", "Maintenance and Repair"))
+ self.pushButton_12.setText(_translate("BridgeTraffic_Dialog", "Disposal and Recycling"))
+ self.label_17.setText(_translate("BridgeTraffic_Dialog", "Output"))
+ self.textBrowser_3.setHtml(_translate("BridgeTraffic_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+ self.label_18.setText(_translate("BridgeTraffic_Dialog", "Number of Lanes"))
+ self.label_19.setText(_translate("BridgeTraffic_Dialog", "Road Roughness"))
+ self.label_20.setText(_translate("BridgeTraffic_Dialog", "Additional Re-Route Distance"))
+ self.label_29.setText(_translate("BridgeTraffic_Dialog", "Road Rise and Fall (RF)"))
+ self.label_30.setText(_translate("BridgeTraffic_Dialog", "Type of Road"))
+ self.label_31.setText(_translate("BridgeTraffic_Dialog", "(%)"))
+ self.label_32.setText(_translate("BridgeTraffic_Dialog", "(km)"))
+ self.label_33.setText(_translate("BridgeTraffic_Dialog", "(mm/km)"))
+ self.label_34.setText(_translate("BridgeTraffic_Dialog", "(m/km)"))
+ self.textBrowser_4.setHtml(_translate("BridgeTraffic_Dialog", "\n"
+"\n"
+"Annual Increaase in Traffic if Re-Routing duration increases more than a year
"))
+ self.label_35.setText(_translate("BridgeTraffic_Dialog", "Composition of Various Vehicles"))
+ self.label_40.setText(_translate("BridgeTraffic_Dialog", "LCV:"))
+ self.label_36.setText(_translate("BridgeTraffic_Dialog", "Cars:"))
+ self.label_37.setText(_translate("BridgeTraffic_Dialog", "Buses:"))
+ self.label_39.setText(_translate("BridgeTraffic_Dialog", "HCV:"))
+ self.label_38.setText(_translate("BridgeTraffic_Dialog", "MCV:"))
+ self.label_41.setText(_translate("BridgeTraffic_Dialog", "(PCU/D)"))
+ self.pushButton.setText(_translate("BridgeTraffic_Dialog", "Project Details Window "))
+ self.pushButton_6.setText(_translate("BridgeTraffic_Dialog", "Bridge and Traffic Data "))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ BridgeTraffic_Dialog = QtWidgets.QDialog()
+ ui = Ui_BridgeTraffic_Dialog()
+ ui.setupUi(BridgeTraffic_Dialog)
+ BridgeTraffic_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_CarbonEmissionData_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_CarbonEmissionData_Window.py
new file mode 100644
index 0000000..816b055
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_CarbonEmissionData_Window.py
@@ -0,0 +1,813 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_CarbonEmissionData_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_CarbonEmission_Dialog(object):
+ def setupUi(self, CarbonEmission_Dialog):
+ CarbonEmission_Dialog.setObjectName("CarbonEmission_Dialog")
+ CarbonEmission_Dialog.resize(1440, 1000)
+ self.buttonBox = QtWidgets.QDialogButtonBox(CarbonEmission_Dialog)
+ self.buttonBox.setGeometry(QtCore.QRect(540, 690, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close | QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+ self.label = QtWidgets.QLabel(CarbonEmission_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 60, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton = QtWidgets.QPushButton(CarbonEmission_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 35, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.widget_2 = QtWidgets.QWidget(CarbonEmission_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 60, 778, 708))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_56 = QtWidgets.QLabel(self.widget_2)
+ self.label_56.setGeometry(QtCore.QRect(20, 10, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_56.setFont(font)
+ self.label_56.setObjectName("label_56")
+ self.comboBox_19 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_19.setGeometry(QtCore.QRect(140, 10, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_19.setFont(font)
+ self.comboBox_19.setStyleSheet("background-color: #ffffff")
+ self.comboBox_19.setObjectName("comboBox_19")
+ self.comboBox_19.addItem("")
+ self.comboBox_19.addItem("")
+ self.label_57 = QtWidgets.QLabel(self.widget_2)
+ self.label_57.setGeometry(QtCore.QRect(20, 70, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_57.setFont(font)
+ self.label_57.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_57.setObjectName("label_57")
+ self.label_58 = QtWidgets.QLabel(self.widget_2)
+ self.label_58.setGeometry(QtCore.QRect(601, 70, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_58.setFont(font)
+ self.label_58.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_58.setObjectName("label_58")
+ self.label_59 = QtWidgets.QLabel(self.widget_2)
+ self.label_59.setGeometry(QtCore.QRect(191, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_59.setFont(font)
+ self.label_59.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_59.setObjectName("label_59")
+ self.label_60 = QtWidgets.QLabel(self.widget_2)
+ self.label_60.setGeometry(QtCore.QRect(311, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_60.setFont(font)
+ self.label_60.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_60.setObjectName("label_60")
+ self.label_61 = QtWidgets.QLabel(self.widget_2)
+ self.label_61.setGeometry(QtCore.QRect(440, 70, 151, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_61.setFont(font)
+ self.label_61.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_61.setObjectName("label_61")
+ self.comboBox_20 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_20.setGeometry(QtCore.QRect(30, 100, 140, 22))
+ self.comboBox_20.setStyleSheet("background-color: #ffffff")
+ self.comboBox_20.setObjectName("comboBox_20")
+ self.comboBox_20.addItem("")
+ self.comboBox_20.addItem("")
+ self.comboBox_21 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_21.setGeometry(QtCore.QRect(30, 130, 140, 22))
+ self.comboBox_21.setStyleSheet("background-color: #ffffff")
+ self.comboBox_21.setObjectName("comboBox_21")
+ self.comboBox_21.addItem("")
+ self.comboBox_21.addItem("")
+ self.lineEdit_37 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_37.setGeometry(QtCore.QRect(210, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_37.setFont(font)
+ self.lineEdit_37.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_37.setObjectName("lineEdit_37")
+ self.lineEdit_38 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_38.setGeometry(QtCore.QRect(210, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_38.setFont(font)
+ self.lineEdit_38.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_38.setObjectName("lineEdit_38")
+ self.label_62 = QtWidgets.QLabel(self.widget_2)
+ self.label_62.setGeometry(QtCore.QRect(340, 100, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_62.setFont(font)
+ self.label_62.setStyleSheet("background-color: #ffffff")
+ self.label_62.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_62.setObjectName("label_62")
+ self.label_63 = QtWidgets.QLabel(self.widget_2)
+ self.label_63.setGeometry(QtCore.QRect(340, 130, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_63.setFont(font)
+ self.label_63.setStyleSheet("background-color: #ffffff")
+ self.label_63.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_63.setObjectName("label_63")
+ self.lineEdit_39 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_39.setGeometry(QtCore.QRect(450, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_39.setFont(font)
+ self.lineEdit_39.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_39.setObjectName("lineEdit_39")
+ self.lineEdit_40 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_40.setGeometry(QtCore.QRect(450, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_40.setFont(font)
+ self.lineEdit_40.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_40.setObjectName("lineEdit_40")
+ self.lineEdit_41 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_41.setGeometry(QtCore.QRect(610, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_41.setFont(font)
+ self.lineEdit_41.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_41.setObjectName("lineEdit_41")
+ self.lineEdit_42 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_42.setGeometry(QtCore.QRect(610, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_42.setFont(font)
+ self.lineEdit_42.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_42.setObjectName("lineEdit_42")
+ self.pushButton_13 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_13.setGeometry(QtCore.QRect(300, 200, 190, 23))
+ self.pushButton_13.setStyleSheet("background-color: #ffffff")
+ self.pushButton_13.setObjectName("pushButton_13")
+ self.pushButton_49 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_49.setGeometry(QtCore.QRect(310, 440, 190, 23))
+ self.pushButton_49.setStyleSheet("background-color: #ffffff")
+ self.pushButton_49.setObjectName("pushButton_49")
+ self.buttonBox_5 = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox_5.setGeometry(QtCore.QRect(430, 670, 341, 32))
+ self.buttonBox_5.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox_5.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox_5.setCenterButtons(False)
+ self.buttonBox_5.setObjectName("buttonBox_5")
+ self.line_7 = QtWidgets.QFrame(self.widget_2)
+ self.line_7.setGeometry(QtCore.QRect(10, 230, 761, 16))
+ self.line_7.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_7.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_7.setLineWidth(2)
+ self.line_7.setMidLineWidth(2)
+ self.line_7.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_7.setObjectName("line_7")
+ self.line_8 = QtWidgets.QFrame(self.widget_2)
+ self.line_8.setGeometry(QtCore.QRect(10, 470, 761, 16))
+ self.line_8.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_8.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_8.setLineWidth(2)
+ self.line_8.setMidLineWidth(2)
+ self.line_8.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_8.setObjectName("line_8")
+ self.label_74 = QtWidgets.QLabel(self.widget_2)
+ self.label_74.setGeometry(QtCore.QRect(540, 100, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_74.setFont(font)
+ self.label_74.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_74.setObjectName("label_74")
+ self.label_75 = QtWidgets.QLabel(self.widget_2)
+ self.label_75.setGeometry(QtCore.QRect(540, 130, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_75.setFont(font)
+ self.label_75.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_75.setObjectName("label_75")
+ self.label_76 = QtWidgets.QLabel(self.widget_2)
+ self.label_76.setGeometry(QtCore.QRect(700, 100, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_76.setFont(font)
+ self.label_76.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_76.setObjectName("label_76")
+ self.label_77 = QtWidgets.QLabel(self.widget_2)
+ self.label_77.setGeometry(QtCore.QRect(700, 130, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_77.setFont(font)
+ self.label_77.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_77.setObjectName("label_77")
+ self.label_78 = QtWidgets.QLabel(self.widget_2)
+ self.label_78.setGeometry(QtCore.QRect(539, 340, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_78.setFont(font)
+ self.label_78.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_78.setObjectName("label_78")
+ self.label_79 = QtWidgets.QLabel(self.widget_2)
+ self.label_79.setGeometry(QtCore.QRect(699, 370, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_79.setFont(font)
+ self.label_79.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_79.setObjectName("label_79")
+ self.label_64 = QtWidgets.QLabel(self.widget_2)
+ self.label_64.setGeometry(QtCore.QRect(339, 340, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_64.setFont(font)
+ self.label_64.setStyleSheet("background-color: #ffffff")
+ self.label_64.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_64.setObjectName("label_64")
+ self.label_65 = QtWidgets.QLabel(self.widget_2)
+ self.label_65.setGeometry(QtCore.QRect(339, 370, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_65.setFont(font)
+ self.label_65.setStyleSheet("background-color: #ffffff")
+ self.label_65.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_65.setObjectName("label_65")
+ self.lineEdit_43 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_43.setGeometry(QtCore.QRect(609, 370, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_43.setFont(font)
+ self.lineEdit_43.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_43.setObjectName("lineEdit_43")
+ self.lineEdit_44 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_44.setGeometry(QtCore.QRect(209, 370, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_44.setFont(font)
+ self.lineEdit_44.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_44.setObjectName("lineEdit_44")
+ self.label_80 = QtWidgets.QLabel(self.widget_2)
+ self.label_80.setGeometry(QtCore.QRect(699, 340, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_80.setFont(font)
+ self.label_80.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_80.setObjectName("label_80")
+ self.label_66 = QtWidgets.QLabel(self.widget_2)
+ self.label_66.setGeometry(QtCore.QRect(19, 250, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_66.setFont(font)
+ self.label_66.setObjectName("label_66")
+ self.lineEdit_45 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_45.setGeometry(QtCore.QRect(449, 370, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_45.setFont(font)
+ self.lineEdit_45.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_45.setObjectName("lineEdit_45")
+ self.label_67 = QtWidgets.QLabel(self.widget_2)
+ self.label_67.setGeometry(QtCore.QRect(19, 310, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_67.setFont(font)
+ self.label_67.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_67.setObjectName("label_67")
+ self.label_81 = QtWidgets.QLabel(self.widget_2)
+ self.label_81.setGeometry(QtCore.QRect(539, 370, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_81.setFont(font)
+ self.label_81.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_81.setObjectName("label_81")
+ self.label_68 = QtWidgets.QLabel(self.widget_2)
+ self.label_68.setGeometry(QtCore.QRect(600, 310, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_68.setFont(font)
+ self.label_68.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_68.setObjectName("label_68")
+ self.label_69 = QtWidgets.QLabel(self.widget_2)
+ self.label_69.setGeometry(QtCore.QRect(190, 310, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_69.setFont(font)
+ self.label_69.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_69.setObjectName("label_69")
+ self.comboBox_22 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_22.setGeometry(QtCore.QRect(29, 340, 140, 22))
+ self.comboBox_22.setStyleSheet("background-color: #ffffff")
+ self.comboBox_22.setObjectName("comboBox_22")
+ self.comboBox_22.addItem("")
+ self.comboBox_22.addItem("")
+ self.label_70 = QtWidgets.QLabel(self.widget_2)
+ self.label_70.setGeometry(QtCore.QRect(439, 310, 151, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_70.setFont(font)
+ self.label_70.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_70.setObjectName("label_70")
+ self.lineEdit_46 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_46.setGeometry(QtCore.QRect(449, 340, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_46.setFont(font)
+ self.lineEdit_46.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_46.setObjectName("lineEdit_46")
+ self.comboBox_23 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_23.setGeometry(QtCore.QRect(29, 370, 140, 22))
+ self.comboBox_23.setStyleSheet("background-color: #ffffff")
+ self.comboBox_23.setObjectName("comboBox_23")
+ self.comboBox_23.addItem("")
+ self.comboBox_23.addItem("")
+ self.comboBox_24 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_24.setGeometry(QtCore.QRect(139, 250, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_24.setFont(font)
+ self.comboBox_24.setStyleSheet("background-color: #ffffff")
+ self.comboBox_24.setObjectName("comboBox_24")
+ self.comboBox_24.addItem("")
+ self.comboBox_24.addItem("")
+ self.lineEdit_47 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_47.setGeometry(QtCore.QRect(609, 340, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_47.setFont(font)
+ self.lineEdit_47.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_47.setObjectName("lineEdit_47")
+ self.lineEdit_48 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_48.setGeometry(QtCore.QRect(209, 340, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_48.setFont(font)
+ self.lineEdit_48.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_48.setObjectName("lineEdit_48")
+ self.label_71 = QtWidgets.QLabel(self.widget_2)
+ self.label_71.setGeometry(QtCore.QRect(310, 310, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_71.setFont(font)
+ self.label_71.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_71.setObjectName("label_71")
+ self.label_82 = QtWidgets.QLabel(self.widget_2)
+ self.label_82.setGeometry(QtCore.QRect(539, 580, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_82.setFont(font)
+ self.label_82.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_82.setObjectName("label_82")
+ self.label_83 = QtWidgets.QLabel(self.widget_2)
+ self.label_83.setGeometry(QtCore.QRect(699, 610, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_83.setFont(font)
+ self.label_83.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_83.setObjectName("label_83")
+ self.label_84 = QtWidgets.QLabel(self.widget_2)
+ self.label_84.setGeometry(QtCore.QRect(339, 580, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_84.setFont(font)
+ self.label_84.setStyleSheet("background-color: #ffffff")
+ self.label_84.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_84.setObjectName("label_84")
+ self.label_85 = QtWidgets.QLabel(self.widget_2)
+ self.label_85.setGeometry(QtCore.QRect(339, 610, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_85.setFont(font)
+ self.label_85.setStyleSheet("background-color: #ffffff")
+ self.label_85.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_85.setObjectName("label_85")
+ self.lineEdit_49 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_49.setGeometry(QtCore.QRect(609, 610, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_49.setFont(font)
+ self.lineEdit_49.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_49.setObjectName("lineEdit_49")
+ self.lineEdit_50 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_50.setGeometry(QtCore.QRect(209, 610, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_50.setFont(font)
+ self.lineEdit_50.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_50.setObjectName("lineEdit_50")
+ self.label_86 = QtWidgets.QLabel(self.widget_2)
+ self.label_86.setGeometry(QtCore.QRect(699, 580, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_86.setFont(font)
+ self.label_86.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_86.setObjectName("label_86")
+ self.label_87 = QtWidgets.QLabel(self.widget_2)
+ self.label_87.setGeometry(QtCore.QRect(19, 490, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_87.setFont(font)
+ self.label_87.setObjectName("label_87")
+ self.lineEdit_51 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_51.setGeometry(QtCore.QRect(449, 610, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_51.setFont(font)
+ self.lineEdit_51.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_51.setObjectName("lineEdit_51")
+ self.label_88 = QtWidgets.QLabel(self.widget_2)
+ self.label_88.setGeometry(QtCore.QRect(19, 550, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_88.setFont(font)
+ self.label_88.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_88.setObjectName("label_88")
+ self.label_89 = QtWidgets.QLabel(self.widget_2)
+ self.label_89.setGeometry(QtCore.QRect(539, 610, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_89.setFont(font)
+ self.label_89.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_89.setObjectName("label_89")
+ self.label_90 = QtWidgets.QLabel(self.widget_2)
+ self.label_90.setGeometry(QtCore.QRect(600, 550, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_90.setFont(font)
+ self.label_90.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_90.setObjectName("label_90")
+ self.label_91 = QtWidgets.QLabel(self.widget_2)
+ self.label_91.setGeometry(QtCore.QRect(190, 550, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_91.setFont(font)
+ self.label_91.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_91.setObjectName("label_91")
+ self.comboBox_25 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_25.setGeometry(QtCore.QRect(29, 580, 140, 22))
+ self.comboBox_25.setStyleSheet("background-color: #ffffff")
+ self.comboBox_25.setObjectName("comboBox_25")
+ self.comboBox_25.addItem("")
+ self.comboBox_25.addItem("")
+ self.label_92 = QtWidgets.QLabel(self.widget_2)
+ self.label_92.setGeometry(QtCore.QRect(439, 550, 151, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_92.setFont(font)
+ self.label_92.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_92.setObjectName("label_92")
+ self.lineEdit_52 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_52.setGeometry(QtCore.QRect(449, 580, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_52.setFont(font)
+ self.lineEdit_52.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_52.setObjectName("lineEdit_52")
+ self.comboBox_26 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_26.setGeometry(QtCore.QRect(29, 610, 140, 22))
+ self.comboBox_26.setStyleSheet("background-color: #ffffff")
+ self.comboBox_26.setObjectName("comboBox_26")
+ self.comboBox_26.addItem("")
+ self.comboBox_26.addItem("")
+ self.comboBox_27 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_27.setGeometry(QtCore.QRect(139, 490, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_27.setFont(font)
+ self.comboBox_27.setStyleSheet("background-color: #ffffff")
+ self.comboBox_27.setObjectName("comboBox_27")
+ self.comboBox_27.addItem("")
+ self.comboBox_27.addItem("")
+ self.lineEdit_53 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_53.setGeometry(QtCore.QRect(609, 580, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_53.setFont(font)
+ self.lineEdit_53.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_53.setObjectName("lineEdit_53")
+ self.lineEdit_54 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_54.setGeometry(QtCore.QRect(209, 580, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_54.setFont(font)
+ self.lineEdit_54.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_54.setObjectName("lineEdit_54")
+ self.label_93 = QtWidgets.QLabel(self.widget_2)
+ self.label_93.setGeometry(QtCore.QRect(310, 550, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_93.setFont(font)
+ self.label_93.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_93.setObjectName("label_93")
+ self.pushButton_50 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_50.setGeometry(QtCore.QRect(310, 670, 190, 23))
+ self.pushButton_50.setStyleSheet("background-color: #ffffff")
+ self.pushButton_50.setObjectName("pushButton_50")
+ self.scrollArea = QtWidgets.QScrollArea(CarbonEmission_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 65, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents_4 = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents_4.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents_4.setObjectName("scrollAreaWidgetContents_4")
+ self.label_72 = QtWidgets.QLabel(self.scrollAreaWidgetContents_4)
+ self.label_72.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_72.setFont(font)
+ self.label_72.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_72.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_72.setObjectName("label_72")
+ self.widget_11 = QtWidgets.QWidget(self.scrollAreaWidgetContents_4)
+ self.widget_11.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget_11.setStyleSheet("background-color: #fff9f9")
+ self.widget_11.setObjectName("widget_11")
+ self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.widget_11)
+ self.verticalLayout_4.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout_4.setObjectName("verticalLayout_4")
+ self.pushButton_51 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_51.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_51.setIcon(icon1)
+ self.pushButton_51.setCheckable(True)
+ self.pushButton_51.setAutoDefault(True)
+ self.pushButton_51.setObjectName("pushButton_51")
+ self.verticalLayout_4.addWidget(self.pushButton_51)
+ self.widget_12 = QtWidgets.QWidget(self.widget_11)
+ self.widget_12.setObjectName("widget_12")
+ self.formLayout_4 = QtWidgets.QFormLayout(self.widget_12)
+ self.formLayout_4.setObjectName("formLayout_4")
+ self.pushButton_52 = QtWidgets.QPushButton(self.widget_12)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_52.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_52.setIcon(icon2)
+ self.pushButton_52.setObjectName("pushButton_52")
+ self.formLayout_4.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_52)
+ self.pushButton_53 = QtWidgets.QPushButton(self.widget_12)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_53.setFont(font)
+ self.pushButton_53.setIcon(icon2)
+ self.pushButton_53.setObjectName("pushButton_53")
+ self.formLayout_4.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_53)
+ self.pushButton_54 = QtWidgets.QPushButton(self.widget_12)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_54.setFont(font)
+ self.pushButton_54.setIcon(icon2)
+ self.pushButton_54.setObjectName("pushButton_54")
+ self.formLayout_4.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_54)
+ self.pushButton_55 = QtWidgets.QPushButton(self.widget_12)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_55.setFont(font)
+ self.pushButton_55.setIcon(icon2)
+ self.pushButton_55.setObjectName("pushButton_55")
+ self.formLayout_4.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_55)
+ self.verticalLayout_4.addWidget(self.widget_12)
+ self.pushButton_56 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_56.setFont(font)
+ self.pushButton_56.setObjectName("pushButton_56")
+ self.verticalLayout_4.addWidget(self.pushButton_56)
+ self.pushButton_57 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_57.setFont(font)
+ self.pushButton_57.setIcon(icon1)
+ self.pushButton_57.setCheckable(True)
+ self.pushButton_57.setObjectName("pushButton_57")
+ self.verticalLayout_4.addWidget(self.pushButton_57)
+ self.widget_13 = QtWidgets.QWidget(self.widget_11)
+ self.widget_13.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_13.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_13.setObjectName("widget_13")
+ self.pushButton_58 = QtWidgets.QPushButton(self.widget_13)
+ self.pushButton_58.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_58.setFont(font)
+ self.pushButton_58.setIcon(icon2)
+ self.pushButton_58.setObjectName("pushButton_58")
+ self.verticalLayout_4.addWidget(self.widget_13)
+ self.pushButton_59 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_59.setFont(font)
+ self.pushButton_59.setObjectName("pushButton_59")
+ self.verticalLayout_4.addWidget(self.pushButton_59)
+ self.pushButton_60 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_60.setFont(font)
+ self.pushButton_60.setObjectName("pushButton_60")
+ self.verticalLayout_4.addWidget(self.pushButton_60)
+ self.pushButton_61 = QtWidgets.QPushButton(self.widget_11)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_61.setFont(font)
+ self.pushButton_61.setObjectName("pushButton_61")
+ self.verticalLayout_4.addWidget(self.pushButton_61)
+ self.label_73 = QtWidgets.QLabel(self.scrollAreaWidgetContents_4)
+ self.label_73.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_73.setFont(font)
+ self.label_73.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_73.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_73.setObjectName("label_73")
+ self.textBrowser_4 = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents_4)
+ self.textBrowser_4.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser_4.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser_4.setObjectName("textBrowser_4")
+ self.verticalScrollBar_4 = QtWidgets.QScrollBar(self.scrollAreaWidgetContents_4)
+ self.verticalScrollBar_4.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar_4.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar_4.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar_4.setObjectName("verticalScrollBar_4")
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents_4)
+ self.pushButton_62 = QtWidgets.QPushButton(CarbonEmission_Dialog)
+ self.pushButton_62.setGeometry(QtCore.QRect(350, 35, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_62.setFont(font)
+ self.pushButton_62.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_62.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_62.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_62.setIcon(icon)
+ self.pushButton_62.setAutoRepeat(False)
+ self.pushButton_62.setObjectName("pushButton_62")
+
+ self.retranslateUi(CarbonEmission_Dialog)
+ self.buttonBox_5.accepted.connect(CarbonEmission_Dialog.accept) # type: ignore
+ self.buttonBox_5.rejected.connect(CarbonEmission_Dialog.reject) # type: ignore
+ self.pushButton_51.toggled['bool'].connect(self.widget_2.setVisible) # type: ignore
+ # Corrected line: Changed self.widget_8 to self.widget_2 based on the traceback suggestion and available widgets
+ self.pushButton_57.toggled['bool'].connect(self.widget_2.setVisible) # type: ignore
+ self.buttonBox.rejected.connect(self.show_warning) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(CarbonEmission_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, CarbonEmission_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ CarbonEmission_Dialog.setWindowTitle(_translate("CarbonEmission_Dialog", "Carbon Emission Data"))
+ self.pushButton.setText(_translate("CarbonEmission_Dialog", "Project Details Window "))
+ self.label_56.setText(_translate("CarbonEmission_Dialog", "Componenet:"))
+ self.comboBox_19.setItemText(0, _translate("CarbonEmission_Dialog", "Earthwork"))
+ self.comboBox_19.setItemText(1, _translate("CarbonEmission_Dialog", "RCC in Foundation"))
+ self.label_57.setText(_translate("CarbonEmission_Dialog", "Material Type and Grade"))
+ self.label_58.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Factor"))
+ self.label_59.setText(_translate("CarbonEmission_Dialog", "Quantity"))
+ self.label_60.setText(_translate("CarbonEmission_Dialog", "Unit"))
+ self.label_61.setText(_translate("CarbonEmission_Dialog", "Emboided Carbon Energy"))
+ self.comboBox_20.setItemText(0, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.comboBox_20.setItemText(1, _translate("CarbonEmission_Dialog", "Steel"))
+ self.comboBox_21.setItemText(0, _translate("CarbonEmission_Dialog", "Steel"))
+ self.comboBox_21.setItemText(1, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.label_62.setText(_translate("CarbonEmission_Dialog", "m3
"))
+ self.label_63.setText(_translate("CarbonEmission_Dialog", "kg"))
+ self.pushButton_13.setText(_translate("CarbonEmission_Dialog", "+ Add Material"))
+ self.pushButton_49.setText(_translate("CarbonEmission_Dialog", "+ Add Material"))
+ self.label_74.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_75.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_76.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_77.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_78.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_79.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_64.setText(_translate("CarbonEmission_Dialog", "m3
"))
+ self.label_65.setText(_translate("CarbonEmission_Dialog", "kg"))
+ self.label_80.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_66.setText(_translate("CarbonEmission_Dialog", "Componenet:"))
+ self.lineEdit_45.setText(_translate("CarbonEmission_Dialog", ""))
+ self.label_67.setText(_translate("CarbonEmission_Dialog", "Material Type and Grade"))
+ self.label_81.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_68.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Factor"))
+ self.label_69.setText(_translate("CarbonEmission_Dialog", "Quantity"))
+ self.comboBox_22.setItemText(0, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.comboBox_22.setItemText(1, _translate("CarbonEmission_Dialog", "Steel"))
+ self.label_70.setText(_translate("CarbonEmission_Dialog", "Emboided Carbon Energy"))
+ self.comboBox_23.setItemText(0, _translate("CarbonEmission_Dialog", "Steel"))
+ self.comboBox_23.setItemText(1, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.comboBox_24.setItemText(0, _translate("CarbonEmission_Dialog", "Earthwork"))
+ self.comboBox_24.setItemText(1, _translate("CarbonEmission_Dialog", "RCC in Foundation"))
+ self.label_71.setText(_translate("CarbonEmission_Dialog", "Unit"))
+ self.label_82.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_83.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_84.setText(_translate("CarbonEmission_Dialog", "m3
"))
+ self.label_85.setText(_translate("CarbonEmission_Dialog", "kg"))
+ self.label_86.setText(_translate("CarbonEmission_Dialog", "kg C02e/kg"))
+ self.label_87.setText(_translate("CarbonEmission_Dialog", "Componenet:"))
+ self.label_88.setText(_translate("CarbonEmission_Dialog", "Material Type and Grade"))
+ self.label_89.setText(_translate("CarbonEmission_Dialog", "(MJ/kg)"))
+ self.label_90.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Factor"))
+ self.label_91.setText(_translate("CarbonEmission_Dialog", "Quantity"))
+ self.comboBox_25.setItemText(0, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.comboBox_25.setItemText(1, _translate("CarbonEmission_Dialog", "Steel"))
+ self.label_92.setText(_translate("CarbonEmission_Dialog", "Emboided Carbon Energy"))
+ self.comboBox_26.setItemText(0, _translate("CarbonEmission_Dialog", "Steel"))
+ self.comboBox_26.setItemText(1, _translate("CarbonEmission_Dialog", "Concrete"))
+ self.comboBox_27.setItemText(0, _translate("CarbonEmission_Dialog", "Earthwork"))
+ self.comboBox_27.setItemText(1, _translate("CarbonEmission_Dialog", "RCC in Foundation"))
+ self.label_93.setText(_translate("CarbonEmission_Dialog", "Unit"))
+ self.pushButton_50.setText(_translate("CarbonEmission_Dialog", "+ Add Material"))
+ self.label_72.setText(_translate("CarbonEmission_Dialog", "Input Parameters"))
+ self.pushButton_51.setText(_translate("CarbonEmission_Dialog", "Structure Works Data"))
+ self.pushButton_52.setText(_translate("CarbonEmission_Dialog", "Foundation"))
+ self.pushButton_53.setText(_translate("CarbonEmission_Dialog", "Super-Structure"))
+ self.pushButton_54.setText(_translate("CarbonEmission_Dialog", "Sub-Structure"))
+ self.pushButton_55.setText(_translate("CarbonEmission_Dialog", "Miscellaneous"))
+ self.pushButton_56.setText(_translate("CarbonEmission_Dialog", "Financial Data"))
+ self.pushButton_57.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Data"))
+ self.pushButton_58.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_59.setText(_translate("CarbonEmission_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_60.setText(_translate("CarbonEmission_Dialog", "Maintenance and Repair"))
+ self.pushButton_61.setText(_translate("CarbonEmission_Dialog", "Disposal and Recycling"))
+ self.label_73.setText(_translate("CarbonEmission_Dialog", "Output"))
+ self.textBrowser_4.setHtml(_translate("CarbonEmission_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+ self.pushButton_62.setText(_translate("CarbonEmission_Dialog", "Carbon Emission Data "))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ CarbonEmission_Dialog = QtWidgets.QDialog()
+ ui = Ui_CarbonEmission_Dialog()
+ ui.setupUi(CarbonEmission_Dialog)
+ CarbonEmission_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_DemolitionANDRecyclingData_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_DemolitionANDRecyclingData_Window.py
new file mode 100644
index 0000000..0e6119d
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_DemolitionANDRecyclingData_Window.py
@@ -0,0 +1,351 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_Demolition&RecyclingData_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_Demolition_Dialog(object):
+ def setupUi(self, Demolition_Dialog):
+ Demolition_Dialog.setObjectName("Demolition_Dialog")
+ Demolition_Dialog.resize(1440, 1000)
+ Demolition_Dialog.setStyleSheet("background-color: #fafafa")
+ self.pushButton_6 = QtWidgets.QPushButton(Demolition_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 30, 261, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+ self.label = QtWidgets.QLabel(Demolition_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 55, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.widget_2 = QtWidgets.QWidget(Demolition_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 55, 692, 205))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_7 = QtWidgets.QLabel(self.widget_2)
+ self.label_7.setGeometry(QtCore.QRect(20, 110, 231, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_7.setFont(font)
+ self.label_7.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_7.setObjectName("label_7")
+ self.label_8 = QtWidgets.QLabel(self.widget_2)
+ self.label_8.setGeometry(QtCore.QRect(20, 140, 221, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_8.setFont(font)
+ self.label_8.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_8.setObjectName("label_8")
+ self.lineEdit_5 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_5.setGeometry(QtCore.QRect(290, 30, 121, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_5.setFont(font)
+ self.lineEdit_5.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_5.setObjectName("lineEdit_5")
+ self.lineEdit_6 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_6.setGeometry(QtCore.QRect(290, 110, 121, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_6.setFont(font)
+ self.lineEdit_6.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_6.setText("")
+ self.lineEdit_6.setObjectName("lineEdit_6")
+ self.buttonBox_2 = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox_2.setGeometry(QtCore.QRect(340, 170, 341, 32))
+ self.buttonBox_2.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox_2.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox_2.setObjectName("buttonBox_2")
+ self.lineEdit_13 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_13.setGeometry(QtCore.QRect(290, 140, 121, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_13.setFont(font)
+ self.lineEdit_13.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_13.setObjectName("lineEdit_13")
+ self.label_21 = QtWidgets.QLabel(self.widget_2)
+ self.label_21.setGeometry(QtCore.QRect(420, 30, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_21.setFont(font)
+ self.label_21.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_21.setObjectName("label_21")
+ self.label_23 = QtWidgets.QLabel(self.widget_2)
+ self.label_23.setGeometry(QtCore.QRect(420, 110, 71, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_23.setFont(font)
+ self.label_23.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_23.setObjectName("label_23")
+ self.textBrowser_2 = QtWidgets.QTextBrowser(self.widget_2)
+ self.textBrowser_2.setGeometry(QtCore.QRect(20, 20, 256, 51))
+ self.textBrowser_2.setObjectName("textBrowser_2")
+ self.label_22 = QtWidgets.QLabel(self.widget_2)
+ self.label_22.setGeometry(QtCore.QRect(420, 140, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_22.setFont(font)
+ self.label_22.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_22.setObjectName("label_22")
+ self.pushButton = QtWidgets.QPushButton(Demolition_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 30, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.scrollArea = QtWidgets.QScrollArea(Demolition_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 60, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
+ self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_2.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_2.setFont(font)
+ self.label_2.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_2.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_2.setObjectName("label_2")
+ self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
+ self.widget.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget.setStyleSheet("background-color: #fff9f9")
+ self.widget.setObjectName("widget")
+ self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
+ self.verticalLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_15.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_15.setIcon(icon1)
+ self.pushButton_15.setCheckable(True)
+ self.pushButton_15.setAutoDefault(True)
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.verticalLayout.addWidget(self.pushButton_15)
+ self.widget_5 = QtWidgets.QWidget(self.widget)
+ self.widget_5.setObjectName("widget_5")
+ self.formLayout = QtWidgets.QFormLayout(self.widget_5)
+ self.formLayout.setObjectName("formLayout")
+ self.pushButton_20 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_20.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_20.setIcon(icon2)
+ self.pushButton_20.setObjectName("pushButton_20")
+ self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_20)
+ self.pushButton_21 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_21.setFont(font)
+ self.pushButton_21.setIcon(icon2)
+ self.pushButton_21.setObjectName("pushButton_21")
+ self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_21)
+ self.pushButton_22 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_22.setFont(font)
+ self.pushButton_22.setIcon(icon2)
+ self.pushButton_22.setObjectName("pushButton_22")
+ self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_22)
+ self.pushButton_23 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_23.setFont(font)
+ self.pushButton_23.setIcon(icon2)
+ self.pushButton_23.setObjectName("pushButton_23")
+ self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_23)
+ self.verticalLayout.addWidget(self.widget_5)
+ self.pushButton_19 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_19.setFont(font)
+ self.pushButton_19.setObjectName("pushButton_19")
+ self.verticalLayout.addWidget(self.pushButton_19)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setIcon(icon1)
+ self.pushButton_16.setCheckable(True)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout.addWidget(self.pushButton_16)
+ self.widget_8 = QtWidgets.QWidget(self.widget)
+ self.widget_8.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_8.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_8.setObjectName("widget_8")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_8)
+ self.pushButton_14.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_14.setFont(font)
+ self.pushButton_14.setIcon(icon2)
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.verticalLayout.addWidget(self.widget_8)
+ self.pushButton_17 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_17.setFont(font)
+ self.pushButton_17.setObjectName("pushButton_17")
+ self.verticalLayout.addWidget(self.pushButton_17)
+ self.pushButton_18 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_18.setFont(font)
+ self.pushButton_18.setObjectName("pushButton_18")
+ self.verticalLayout.addWidget(self.pushButton_18)
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_10.setFont(font)
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.verticalLayout.addWidget(self.pushButton_10)
+ self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_3.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_3.setFont(font)
+ self.label_3.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_3.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_3.setObjectName("label_3")
+ self.textBrowser = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents)
+ self.textBrowser.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser.setObjectName("textBrowser")
+ self.verticalScrollBar = QtWidgets.QScrollBar(self.scrollAreaWidgetContents)
+ self.verticalScrollBar.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar.setObjectName("verticalScrollBar")
+ self.widget.raise_()
+ self.label_2.raise_()
+ self.label_3.raise_()
+ self.textBrowser.raise_()
+ self.verticalScrollBar.raise_()
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents)
+
+ self.retranslateUi(Demolition_Dialog)
+ self.buttonBox_2.accepted.connect(Demolition_Dialog.accept) # type: ignore
+ self.buttonBox_2.rejected.connect(self.show_warning) # type: ignore
+ self.pushButton_15.toggled['bool'].connect(self.widget_5.setVisible) # type: ignore
+ self.pushButton_16.toggled['bool'].connect(self.widget_8.setVisible) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(Demolition_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, Demolition_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Demolition_Dialog.setWindowTitle(_translate("Demolition_Dialog", "Demolition and Recycling Data"))
+ self.pushButton_6.setText(_translate("Demolition_Dialog", "Demolition and Recycling Data "))
+ self.label_7.setText(_translate("Demolition_Dialog", "Scrap Value of Structural Steel"))
+ self.label_8.setText(_translate("Demolition_Dialog", "Structural Steel Scrap"))
+ self.label_21.setText(_translate("Demolition_Dialog", "(%)"))
+ self.label_23.setText(_translate("Demolition_Dialog", "(INR/MT)"))
+ self.textBrowser_2.setHtml(_translate("Demolition_Dialog", "\n"
+"\n"
+"Demolition Cost rate as percentage to total construction cost
"))
+ self.label_22.setText(_translate("Demolition_Dialog", "(%)"))
+ self.pushButton.setText(_translate("Demolition_Dialog", "Project Details Window "))
+ self.label_2.setText(_translate("Demolition_Dialog", "Input Parameters"))
+ self.pushButton_15.setText(_translate("Demolition_Dialog", "Structure Works Data"))
+ self.pushButton_20.setText(_translate("Demolition_Dialog", "Foundation"))
+ self.pushButton_21.setText(_translate("Demolition_Dialog", "Super-Structure"))
+ self.pushButton_22.setText(_translate("Demolition_Dialog", "Sub-Structure"))
+ self.pushButton_23.setText(_translate("Demolition_Dialog", "Miscellaneous"))
+ self.pushButton_19.setText(_translate("Demolition_Dialog", "Financial Data"))
+ self.pushButton_16.setText(_translate("Demolition_Dialog", "Carbon Emission Data"))
+ self.pushButton_14.setText(_translate("Demolition_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_17.setText(_translate("Demolition_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_18.setText(_translate("Demolition_Dialog", "Maintenance and Repair"))
+ self.pushButton_10.setText(_translate("Demolition_Dialog", "Disposal and Recycling"))
+ self.label_3.setText(_translate("Demolition_Dialog", "Output"))
+ self.textBrowser.setHtml(_translate("Demolition_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ Demolition_Dialog = QtWidgets.QDialog()
+ ui = Ui_Demolition_Dialog()
+ ui.setupUi(Demolition_Dialog)
+ Demolition_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_FinancialData_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_FinancialData_Window.py
new file mode 100644
index 0000000..d333163
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_FinancialData_Window.py
@@ -0,0 +1,382 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_FinancialData_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing and do.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_FinancialData_Dialog(object):
+ def setupUi(self, FinancialData_Dialog):
+ FinancialData_Dialog.setObjectName("FinancialData_Dialog")
+ FinancialData_Dialog.resize(1440, 1000)
+ FinancialData_Dialog.setStyleSheet("background-color:#FAFAFA")
+ self.label = QtWidgets.QLabel(FinancialData_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 65, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton = QtWidgets.QPushButton(FinancialData_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 40, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.widget_2 = QtWidgets.QWidget(FinancialData_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 65, 736, 249))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_4 = QtWidgets.QLabel(self.widget_2)
+ self.label_4.setGeometry(QtCore.QRect(20, 20, 141, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_4.setFont(font)
+ self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_4.setObjectName("label_4")
+ self.label_5 = QtWidgets.QLabel(self.widget_2)
+ self.label_5.setGeometry(QtCore.QRect(20, 80, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_5.setFont(font)
+ self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_5.setObjectName("label_5")
+ self.label_6 = QtWidgets.QLabel(self.widget_2)
+ self.label_6.setGeometry(QtCore.QRect(20, 50, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_6.setFont(font)
+ self.label_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_6.setObjectName("label_6")
+ self.label_7 = QtWidgets.QLabel(self.widget_2)
+ self.label_7.setGeometry(QtCore.QRect(20, 110, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_7.setFont(font)
+ self.label_7.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_7.setObjectName("label_7")
+ self.label_8 = QtWidgets.QLabel(self.widget_2)
+ self.label_8.setGeometry(QtCore.QRect(20, 140, 221, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_8.setFont(font)
+ self.label_8.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_8.setObjectName("label_8")
+ self.comboBox_2 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_2.setGeometry(QtCore.QRect(270, 80, 101, 22))
+ self.comboBox_2.setStyleSheet("background-color: #ffffff")
+ self.comboBox_2.setObjectName("comboBox_2")
+ self.comboBox_3 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_3.setGeometry(QtCore.QRect(270, 50, 101, 22))
+ self.comboBox_3.setStyleSheet("background-color: #ffffff")
+ self.comboBox_3.setObjectName("comboBox_3")
+ self.lineEdit_5 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_5.setGeometry(QtCore.QRect(270, 20, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_5.setFont(font)
+ self.lineEdit_5.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_5.setObjectName("lineEdit_5")
+ self.lineEdit_6 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_6.setGeometry(QtCore.QRect(270, 110, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_6.setFont(font)
+ self.lineEdit_6.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_6.setObjectName("lineEdit_6")
+ self.buttonBox_2 = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox_2.setGeometry(QtCore.QRect(380, 210, 341, 32))
+ self.buttonBox_2.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox_2.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox_2.setObjectName("buttonBox_2")
+ self.lineEdit_13 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_13.setGeometry(QtCore.QRect(270, 140, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_13.setFont(font)
+ self.lineEdit_13.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_13.setObjectName("lineEdit_13")
+ self.label_21 = QtWidgets.QLabel(self.widget_2)
+ self.label_21.setGeometry(QtCore.QRect(390, 20, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_21.setFont(font)
+ self.label_21.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_21.setObjectName("label_21")
+ self.label_22 = QtWidgets.QLabel(self.widget_2)
+ self.label_22.setGeometry(QtCore.QRect(390, 50, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_22.setFont(font)
+ self.label_22.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_22.setObjectName("label_22")
+ self.label_23 = QtWidgets.QLabel(self.widget_2)
+ self.label_23.setGeometry(QtCore.QRect(390, 110, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_23.setFont(font)
+ self.label_23.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_23.setObjectName("label_23")
+ self.label_24 = QtWidgets.QLabel(self.widget_2)
+ self.label_24.setGeometry(QtCore.QRect(390, 140, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_24.setFont(font)
+ self.label_24.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_24.setObjectName("label_24")
+ self.scrollArea = QtWidgets.QScrollArea(FinancialData_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 70, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
+ self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_2.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_2.setFont(font)
+ self.label_2.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_2.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_2.setObjectName("label_2")
+ self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
+ self.widget.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget.setStyleSheet("background-color: #fff9f9")
+ self.widget.setObjectName("widget")
+ self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
+ self.verticalLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_15.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_15.setIcon(icon1)
+ self.pushButton_15.setCheckable(True)
+ self.pushButton_15.setAutoDefault(True)
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.verticalLayout.addWidget(self.pushButton_15)
+ self.widget_5 = QtWidgets.QWidget(self.widget)
+ self.widget_5.setObjectName("widget_5")
+ self.formLayout = QtWidgets.QFormLayout(self.widget_5)
+ self.formLayout.setObjectName("formLayout")
+ self.pushButton_20 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_20.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_20.setIcon(icon2)
+ self.pushButton_20.setObjectName("pushButton_20")
+ self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_20)
+ self.pushButton_21 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_21.setFont(font)
+ self.pushButton_21.setIcon(icon2)
+ self.pushButton_21.setObjectName("pushButton_21")
+ self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_21)
+ self.pushButton_22 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_22.setFont(font)
+ self.pushButton_22.setIcon(icon2)
+ self.pushButton_22.setObjectName("pushButton_22")
+ self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_22)
+ self.pushButton_23 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_23.setFont(font)
+ self.pushButton_23.setIcon(icon2)
+ self.pushButton_23.setObjectName("pushButton_23")
+ self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_23)
+ self.verticalLayout.addWidget(self.widget_5)
+ self.pushButton_19 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_19.setFont(font)
+ self.pushButton_19.setObjectName("pushButton_19")
+ self.verticalLayout.addWidget(self.pushButton_19)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setIcon(icon1)
+ self.pushButton_16.setCheckable(True)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout.addWidget(self.pushButton_16)
+ self.widget_8 = QtWidgets.QWidget(self.widget)
+ self.widget_8.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_8.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_8.setObjectName("widget_8")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_8)
+ self.pushButton_14.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_14.setFont(font)
+ self.pushButton_14.setIcon(icon2)
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.verticalLayout.addWidget(self.widget_8)
+ self.pushButton_17 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_17.setFont(font)
+ self.pushButton_17.setObjectName("pushButton_17")
+ self.verticalLayout.addWidget(self.pushButton_17)
+ self.pushButton_18 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_18.setFont(font)
+ self.pushButton_18.setObjectName("pushButton_18")
+ self.verticalLayout.addWidget(self.pushButton_18)
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_10.setFont(font)
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.verticalLayout.addWidget(self.pushButton_10)
+ self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_3.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_3.setFont(font)
+ self.label_3.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_3.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_3.setObjectName("label_3")
+ self.textBrowser = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents)
+ self.textBrowser.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser.setObjectName("textBrowser")
+ self.verticalScrollBar = QtWidgets.QScrollBar(self.scrollAreaWidgetContents)
+ self.verticalScrollBar.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar.setObjectName("verticalScrollBar")
+ self.widget.raise_()
+ self.label_2.raise_()
+ self.label_3.raise_()
+ self.textBrowser.raise_()
+ self.verticalScrollBar.raise_()
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents)
+ self.pushButton_6 = QtWidgets.QPushButton(FinancialData_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 40, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+
+ self.retranslateUi(FinancialData_Dialog)
+ self.buttonBox_2.accepted.connect(FinancialData_Dialog.accept) # type: ignore
+ self.buttonBox_2.rejected.connect(self.show_warning) # type: ignore
+ self.pushButton_15.toggled['bool'].connect(self.widget_5.setVisible) # type: ignore
+ self.pushButton_16.toggled['bool'].connect(self.widget_8.setVisible) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(FinancialData_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, FinancialData_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ FinancialData_Dialog.setWindowTitle(_translate("FinancialData_Dialog", "Dialog"))
+ self.pushButton.setText(_translate("FinancialData_Dialog", "Project Details Window "))
+ self.label_4.setText(_translate("FinancialData_Dialog", "Real Discount Rate"))
+ self.label_5.setText(_translate("FinancialData_Dialog", "Investment Ratio"))
+ self.label_6.setText(_translate("FinancialData_Dialog", "Interest Rate"))
+ self.label_7.setText(_translate("FinancialData_Dialog", "Duration of Study "))
+ self.label_8.setText(_translate("FinancialData_Dialog", "Time for construction of Base Project"))
+ self.label_21.setText(_translate("FinancialData_Dialog", "(%)"))
+ self.label_22.setText(_translate("FinancialData_Dialog", "(%)"))
+ self.label_23.setText(_translate("FinancialData_Dialog", "(years)"))
+ self.label_24.setText(_translate("FinancialData_Dialog", "(years)"))
+ self.label_2.setText(_translate("FinancialData_Dialog", "Input Parameters"))
+ self.pushButton_15.setText(_translate("FinancialData_Dialog", "Structure Works Data"))
+ self.pushButton_20.setText(_translate("FinancialData_Dialog", "Foundation"))
+ self.pushButton_21.setText(_translate("FinancialData_Dialog", "Super-Structure"))
+ self.pushButton_22.setText(_translate("FinancialData_Dialog", "Sub-Structure"))
+ self.pushButton_23.setText(_translate("FinancialData_Dialog", "Miscellaneous"))
+ self.pushButton_19.setText(_translate("FinancialData_Dialog", "Financial Data"))
+ self.pushButton_16.setText(_translate("FinancialData_Dialog", "Carbon Emission Data"))
+ self.pushButton_14.setText(_translate("FinancialData_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_17.setText(_translate("FinancialData_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_18.setText(_translate("FinancialData_Dialog", "Maintenance and Repair"))
+ self.pushButton_10.setText(_translate("FinancialData_Dialog", "Disposal and Recycling"))
+ self.label_3.setText(_translate("FinancialData_Dialog", "Output"))
+ self.textBrowser.setHtml(_translate("FinancialData_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+ self.pushButton_6.setText(_translate("FinancialData_Dialog", "Financial Data "))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ FinancialData_Dialog = QtWidgets.QDialog()
+ ui = Ui_FinancialData_Dialog()
+ ui.setupUi(FinancialData_Dialog)
+ FinancialData_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
new file mode 100644
index 0000000..f17f02b
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
@@ -0,0 +1,597 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_Foundation_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from form_data_storage import save_form_data
+from PyQt5.QtWidgets import QMessageBox
+
+class Ui_Foundation_Dialog(object):
+ def setupUi(self, Foundation_Dialog):
+ Foundation_Dialog.setObjectName("Foundation_Dialog")
+ Foundation_Dialog.resize(1440, 1000)
+ Foundation_Dialog.setAutoFillBackground(False)
+ Foundation_Dialog.setStyleSheet("background-color:#FAFAFA")
+ self.label = QtWidgets.QLabel(Foundation_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 50, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton = QtWidgets.QPushButton(Foundation_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 25, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.scrollArea = QtWidgets.QScrollArea(Foundation_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 55, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
+ self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_2.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_2.setFont(font)
+ self.label_2.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_2.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_2.setObjectName("label_2")
+ self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
+ self.widget.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget.setStyleSheet("background-color: #fff9f9")
+ self.widget.setObjectName("widget")
+ self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
+ self.verticalLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_15.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_15.setIcon(icon1)
+ self.pushButton_15.setCheckable(True)
+ self.pushButton_15.setAutoDefault(True)
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.verticalLayout.addWidget(self.pushButton_15)
+ self.widget_5 = QtWidgets.QWidget(self.widget)
+ self.widget_5.setObjectName("widget_5")
+ self.formLayout = QtWidgets.QFormLayout(self.widget_5)
+ self.formLayout.setObjectName("formLayout")
+ self.pushButton_20 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_20.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_20.setIcon(icon2)
+ self.pushButton_20.setObjectName("pushButton_20")
+ self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_20)
+ self.pushButton_21 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_21.setFont(font)
+ self.pushButton_21.setIcon(icon2)
+ self.pushButton_21.setObjectName("pushButton_21")
+ self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_21)
+ self.pushButton_22 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_22.setFont(font)
+ self.pushButton_22.setIcon(icon2)
+ self.pushButton_22.setObjectName("pushButton_22")
+ self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_22)
+ self.pushButton_23 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_23.setFont(font)
+ self.pushButton_23.setIcon(icon2)
+ self.pushButton_23.setObjectName("pushButton_23")
+ self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_23)
+ self.verticalLayout.addWidget(self.widget_5)
+ self.pushButton_19 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_19.setFont(font)
+ self.pushButton_19.setObjectName("pushButton_19")
+ self.verticalLayout.addWidget(self.pushButton_19)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setIcon(icon1)
+ self.pushButton_16.setCheckable(True)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout.addWidget(self.pushButton_16)
+ self.widget_8 = QtWidgets.QWidget(self.widget)
+ self.widget_8.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_8.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_8.setObjectName("widget_8")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_8)
+ self.pushButton_14.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_14.setFont(font)
+ self.pushButton_14.setIcon(icon2)
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.verticalLayout.addWidget(self.widget_8)
+ self.pushButton_17 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_17.setFont(font)
+ self.pushButton_17.setObjectName("pushButton_17")
+ self.verticalLayout.addWidget(self.pushButton_17)
+ self.pushButton_18 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_18.setFont(font)
+ self.pushButton_18.setObjectName("pushButton_18")
+ self.verticalLayout.addWidget(self.pushButton_18)
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_10.setFont(font)
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.verticalLayout.addWidget(self.pushButton_10)
+ self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_3.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_3.setFont(font)
+ self.label_3.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_3.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_3.setObjectName("label_3")
+ self.textBrowser = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents)
+ self.textBrowser.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser.setObjectName("textBrowser")
+ self.verticalScrollBar = QtWidgets.QScrollBar(self.scrollAreaWidgetContents)
+ self.verticalScrollBar.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar.setObjectName("verticalScrollBar")
+ self.widget.raise_()
+ self.label_2.raise_()
+ self.label_3.raise_()
+ self.textBrowser.raise_()
+ self.verticalScrollBar.raise_()
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents)
+ self.widget_2 = QtWidgets.QWidget(Foundation_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 50, 778, 624))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_4 = QtWidgets.QLabel(self.widget_2)
+ self.label_4.setGeometry(QtCore.QRect(20, 10, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_4.setFont(font)
+ self.label_4.setObjectName("label_4")
+ self.comboBox = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox.setGeometry(QtCore.QRect(140, 10, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox.setFont(font)
+ self.comboBox.setStyleSheet("background-color: #ffffff")
+ self.comboBox.setObjectName("comboBox")
+ self.comboBox.addItem("")
+ self.comboBox.addItem("")
+ self.pushButton_2 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_2.setGeometry(QtCore.QRect(350, 10, 190, 23))
+ self.pushButton_2.setStyleSheet("background-color: #ffffff")
+ self.pushButton_2.setObjectName("pushButton_2")
+ self.label_5 = QtWidgets.QLabel(self.widget_2)
+ self.label_5.setGeometry(QtCore.QRect(20, 70, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_5.setFont(font)
+ self.label_5.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_5.setObjectName("label_5")
+ self.label_6 = QtWidgets.QLabel(self.widget_2)
+ self.label_6.setGeometry(QtCore.QRect(551, 70, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_6.setFont(font)
+ self.label_6.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_6.setObjectName("label_6")
+ self.label_7 = QtWidgets.QLabel(self.widget_2)
+ self.label_7.setGeometry(QtCore.QRect(191, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_7.setFont(font)
+ self.label_7.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_7.setObjectName("label_7")
+ self.label_8 = QtWidgets.QLabel(self.widget_2)
+ self.label_8.setGeometry(QtCore.QRect(311, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_8.setFont(font)
+ self.label_8.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_8.setObjectName("label_8")
+ self.label_9 = QtWidgets.QLabel(self.widget_2)
+ self.label_9.setGeometry(QtCore.QRect(431, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_9.setFont(font)
+ self.label_9.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_9.setObjectName("label_9")
+ self.comboBox_2 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_2.setGeometry(QtCore.QRect(30, 100, 140, 22))
+ self.comboBox_2.setStyleSheet("background-color: #ffffff")
+ self.comboBox_2.setObjectName("comboBox_2")
+ self.comboBox_3 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_3.setGeometry(QtCore.QRect(30, 130, 140, 22))
+ self.comboBox_3.setStyleSheet("background-color: #ffffff")
+ self.comboBox_3.setObjectName("comboBox_3")
+ self.lineEdit = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit.setGeometry(QtCore.QRect(210, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit.setFont(font)
+ self.lineEdit.setStyleSheet("background-color: #ffffff")
+ self.lineEdit.setObjectName("lineEdit")
+ self.lineEdit_2 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_2.setGeometry(QtCore.QRect(210, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_2.setFont(font)
+ self.lineEdit_2.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_2.setObjectName("lineEdit_2")
+ self.label_10 = QtWidgets.QLabel(self.widget_2)
+ self.label_10.setGeometry(QtCore.QRect(340, 100, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_10.setFont(font)
+ self.label_10.setStyleSheet("background-color: #ffffff")
+ self.label_10.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_10.setObjectName("label_10")
+ self.label_11 = QtWidgets.QLabel(self.widget_2)
+ self.label_11.setGeometry(QtCore.QRect(340, 130, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_11.setFont(font)
+ self.label_11.setStyleSheet("background-color: #ffffff")
+ self.label_11.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_11.setObjectName("label_11")
+ self.lineEdit_3 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_3.setGeometry(QtCore.QRect(450, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_3.setFont(font)
+ self.lineEdit_3.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_3.setObjectName("lineEdit_3")
+ self.lineEdit_4 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_4.setGeometry(QtCore.QRect(450, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_4.setFont(font)
+ self.lineEdit_4.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_4.setObjectName("lineEdit_4")
+ self.lineEdit_5 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_5.setGeometry(QtCore.QRect(570, 100, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_5.setFont(font)
+ self.lineEdit_5.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_5.setObjectName("lineEdit_5")
+ self.lineEdit_6 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_6.setGeometry(QtCore.QRect(570, 130, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_6.setFont(font)
+ self.lineEdit_6.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_6.setObjectName("lineEdit_6")
+ self.pushButton_3 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_3.setGeometry(QtCore.QRect(300, 200, 190, 23))
+ self.pushButton_3.setStyleSheet("background-color: #ffffff")
+ self.pushButton_3.setObjectName("pushButton_3")
+ self.label_12 = QtWidgets.QLabel(self.widget_2)
+ self.label_12.setGeometry(QtCore.QRect(30, 330, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_12.setFont(font)
+ self.label_12.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_12.setObjectName("label_12")
+ self.comboBox_4 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_4.setGeometry(QtCore.QRect(150, 270, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_4.setFont(font)
+ self.comboBox_4.setStyleSheet("background-color: #ffffff")
+ self.comboBox_4.setObjectName("comboBox_4")
+ self.comboBox_4.addItem("")
+ self.comboBox_4.addItem("")
+ self.label_13 = QtWidgets.QLabel(self.widget_2)
+ self.label_13.setGeometry(QtCore.QRect(441, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_13.setFont(font)
+ self.label_13.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_13.setObjectName("label_13")
+ self.label_14 = QtWidgets.QLabel(self.widget_2)
+ self.label_14.setGeometry(QtCore.QRect(350, 390, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_14.setFont(font)
+ self.label_14.setStyleSheet("background-color: #ffffff")
+ self.label_14.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_14.setObjectName("label_14")
+ self.label_15 = QtWidgets.QLabel(self.widget_2)
+ self.label_15.setGeometry(QtCore.QRect(561, 330, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_15.setFont(font)
+ self.label_15.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_15.setObjectName("label_15")
+ self.label_16 = QtWidgets.QLabel(self.widget_2)
+ self.label_16.setGeometry(QtCore.QRect(350, 360, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_16.setFont(font)
+ self.label_16.setStyleSheet("background-color: #ffffff")
+ self.label_16.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_16.setObjectName("label_16")
+ self.label_17 = QtWidgets.QLabel(self.widget_2)
+ self.label_17.setGeometry(QtCore.QRect(321, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_17.setFont(font)
+ self.label_17.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_17.setObjectName("label_17")
+ self.lineEdit_7 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_7.setGeometry(QtCore.QRect(220, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_7.setFont(font)
+ self.lineEdit_7.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_7.setObjectName("lineEdit_7")
+ self.lineEdit_8 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_8.setGeometry(QtCore.QRect(580, 360, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_8.setFont(font)
+ self.lineEdit_8.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_8.setObjectName("lineEdit_8")
+ self.label_18 = QtWidgets.QLabel(self.widget_2)
+ self.label_18.setGeometry(QtCore.QRect(201, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_18.setFont(font)
+ self.label_18.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_18.setObjectName("label_18")
+ self.pushButton_4 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_4.setGeometry(QtCore.QRect(310, 460, 190, 23))
+ self.pushButton_4.setStyleSheet("background-color: #ffffff")
+ self.pushButton_4.setObjectName("pushButton_4")
+ self.lineEdit_9 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_9.setGeometry(QtCore.QRect(220, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_9.setFont(font)
+ self.lineEdit_9.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_9.setObjectName("lineEdit_9")
+ self.lineEdit_10 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_10.setGeometry(QtCore.QRect(460, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_10.setFont(font)
+ self.lineEdit_10.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_10.setObjectName("lineEdit_10")
+ self.lineEdit_11 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_11.setGeometry(QtCore.QRect(460, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_11.setFont(font)
+ self.lineEdit_11.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_11.setObjectName("lineEdit_11")
+ self.pushButton_5 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_5.setGeometry(QtCore.QRect(360, 270, 190, 23))
+ self.pushButton_5.setStyleSheet("background-color: #ffffff")
+ self.pushButton_5.setObjectName("pushButton_5")
+ self.label_19 = QtWidgets.QLabel(self.widget_2)
+ self.label_19.setGeometry(QtCore.QRect(30, 270, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_19.setFont(font)
+ self.label_19.setObjectName("label_19")
+ self.lineEdit_12 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_12.setGeometry(QtCore.QRect(580, 390, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_12.setFont(font)
+ self.lineEdit_12.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_12.setObjectName("lineEdit_12")
+ self.comboBox_5 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_5.setGeometry(QtCore.QRect(40, 360, 140, 22))
+ self.comboBox_5.setStyleSheet("background-color: #ffffff")
+ self.comboBox_5.setObjectName("comboBox_5")
+ self.comboBox_5.addItem("")
+ self.comboBox_5.addItem("")
+ self.comboBox_6 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_6.setGeometry(QtCore.QRect(40, 390, 140, 22))
+ self.comboBox_6.setStyleSheet("background-color: #ffffff")
+ self.comboBox_6.setObjectName("comboBox_6")
+ self.comboBox_6.addItem("")
+ self.comboBox_6.addItem("")
+ self.buttonBox = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox.setGeometry(QtCore.QRect(420, 580, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setCenterButtons(False)
+ self.buttonBox.setObjectName("buttonBox")
+ self.line = QtWidgets.QFrame(self.widget_2)
+ self.line.setGeometry(QtCore.QRect(10, 250, 761, 16))
+ self.line.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line.setLineWidth(2)
+ self.line.setMidLineWidth(2)
+ self.line.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line.setObjectName("line")
+ self.line_2 = QtWidgets.QFrame(self.widget_2)
+ self.line_2.setGeometry(QtCore.QRect(10, 500, 761, 16))
+ self.line_2.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_2.setLineWidth(2)
+ self.line_2.setMidLineWidth(2)
+ self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_2.setObjectName("line_2")
+ self.pushButton_6 = QtWidgets.QPushButton(Foundation_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 25, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+
+ self.retranslateUi(Foundation_Dialog)
+ self.buttonBox.accepted.connect(Foundation_Dialog.accept) # type: ignore
+ self.buttonBox.accepted.connect(self.save_data)
+ self.buttonBox.rejected.connect(self.show_warning) # type: ignore
+ self.pushButton_15.toggled['bool'].connect(self.widget_5.setVisible) # type: ignore
+ self.pushButton_16.toggled['bool'].connect(self.widget_8.setVisible) # type: ignore
+
+ QtCore.QMetaObject.connectSlotsByName(Foundation_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def save_data(self):
+ """
+ Collect form data and save it to the global dictionary.
+ """
+ data = {
+ "component": self.comboBox.currentText(),
+ "sub_component": self.comboBox_2.currentText(),
+ "quantity": self.lineEdit.text(),
+ "unit": self.label_10.text(),
+ "rate": self.lineEdit_3.text(),
+ "material_type": self.comboBox_4.currentText(),
+ }
+ save_form_data("Foundation_Dialog", data)
+
+ def retranslateUi(self, Foundation_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Foundation_Dialog.setWindowTitle(_translate("Foundation_Dialog", "Dialog"))
+ self.pushButton.setText(_translate("Foundation_Dialog", "Project Details Window "))
+ self.label_2.setText(_translate("Foundation_Dialog", "Input Parameters"))
+ self.pushButton_15.setText(_translate("Foundation_Dialog", "Structure Works Data"))
+ self.pushButton_20.setText(_translate("Foundation_Dialog", "Foundation"))
+ self.pushButton_21.setText(_translate("Foundation_Dialog", "Super-Structure"))
+ self.pushButton_22.setText(_translate("Foundation_Dialog", "Sub-Structure"))
+ self.pushButton_23.setText(_translate("Foundation_Dialog", "Miscellaneous"))
+ self.pushButton_19.setText(_translate("Foundation_Dialog", "Financial Data"))
+ self.pushButton_16.setText(_translate("Foundation_Dialog", "Carbon Emission Data"))
+ self.pushButton_14.setText(_translate("Foundation_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_17.setText(_translate("Foundation_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_18.setText(_translate("Foundation_Dialog", "Maintenance and Repair"))
+ self.pushButton_10.setText(_translate("Foundation_Dialog", "Disposal and Recycling"))
+ self.label_3.setText(_translate("Foundation_Dialog", "Output"))
+ self.textBrowser.setHtml(_translate("Foundation_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+ self.label_4.setText(_translate("Foundation_Dialog", "Componenets:"))
+ self.comboBox.setItemText(0, _translate("Foundation_Dialog", "Earthwork"))
+ self.comboBox.setItemText(1, _translate("Foundation_Dialog", "Foundations"))
+ self.comboBox.addItem(_translate("Foundation_Dialog", "Foundation Protection"))
+ self.pushButton_2.setText(_translate("Foundation_Dialog", "+ Add Sub-Component"))
+ self.label_5.setText(_translate("Foundation_Dialog", "Type of Material"))
+ self.label_6.setText(_translate("Foundation_Dialog", "Rate Data Source"))
+ self.label_7.setText(_translate("Foundation_Dialog", "Quantity"))
+ self.label_8.setText(_translate("Foundation_Dialog", "Unit"))
+ self.label_9.setText(_translate("Foundation_Dialog", "Rate"))
+ self.label_10.setText(_translate("Foundation_Dialog", "
m3
"))
+ self.label_11.setText(_translate("Foundation_Dialog", "kg"))
+ self.pushButton_3.setText(_translate("Foundation_Dialog", "+ Add Material"))
+ self.label_12.setText(_translate("Foundation_Dialog", "Type of Material"))
+ self.comboBox_4.setItemText(0, _translate("Foundation_Dialog", "Earthwork"))
+ self.comboBox_4.addItem(_translate("Foundation_Dialog", "Foundations"))
+ self.comboBox_4.setItemText(1, _translate("Foundation_Dialog", "Foundation Protections"))
+ self.label_13.setText(_translate("Foundation_Dialog", "Rate"))
+ self.label_14.setText(_translate("Foundation_Dialog", "kg"))
+ self.label_15.setText(_translate("Foundation_Dialog", "Rate Data Source"))
+ self.label_16.setText(_translate("Foundation_Dialog", "m3
"))
+ self.label_17.setText(_translate("Foundation_Dialog", "Unit"))
+ self.label_18.setText(_translate("Foundation_Dialog", "Quantity"))
+ self.pushButton_4.setText(_translate("Foundation_Dialog", "+ Add Material"))
+ self.pushButton_5.setText(_translate("Foundation_Dialog", "+ Add Sub-Component"))
+ self.label_19.setText(_translate("Foundation_Dialog", "Componenets:"))
+ self.comboBox_5.setItemText(0, _translate("Foundation_Dialog", "Concrete"))
+ self.comboBox_5.setItemText(1, _translate("Foundation_Dialog", "Steel"))
+ self.comboBox_6.setItemText(0, _translate("Foundation_Dialog", "Steel"))
+ self.comboBox_6.setItemText(1, _translate("Foundation_Dialog", "Concrete"))
+ self.pushButton_6.setText(_translate("Foundation_Dialog", "Foundation"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ Foundation_Dialog = QtWidgets.QDialog()
+ ui = Ui_Foundation_Dialog()
+ ui.setupUi(Foundation_Dialog)
+ Foundation_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_MaintenanceANDRepairData_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_MaintenanceANDRepairData_Window.py
new file mode 100644
index 0000000..5b4d907
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_MaintenanceANDRepairData_Window.py
@@ -0,0 +1,420 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_Maintenance&RepairData_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_Maintenance_Dialog(object):
+ def setupUi(self, Maintenance_Dialog):
+ Maintenance_Dialog.setObjectName("Maintenance_Dialog")
+ Maintenance_Dialog.resize(1440, 1000)
+ Maintenance_Dialog.setStyleSheet("background-color: #fafafa")
+ self.pushButton_6 = QtWidgets.QPushButton(Maintenance_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 35, 261, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+ self.label = QtWidgets.QLabel(Maintenance_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 60, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.widget_2 = QtWidgets.QWidget(Maintenance_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 60, 784, 304))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_4 = QtWidgets.QLabel(self.widget_2)
+ self.label_4.setGeometry(QtCore.QRect(20, 240, 201, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_4.setFont(font)
+ self.label_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_4.setObjectName("label_4")
+ self.label_5 = QtWidgets.QLabel(self.widget_2)
+ self.label_5.setGeometry(QtCore.QRect(600, 60, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_5.setFont(font)
+ self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_5.setObjectName("label_5")
+ self.label_6 = QtWidgets.QLabel(self.widget_2)
+ self.label_6.setGeometry(QtCore.QRect(600, 30, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_6.setFont(font)
+ self.label_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_6.setObjectName("label_6")
+ self.label_7 = QtWidgets.QLabel(self.widget_2)
+ self.label_7.setGeometry(QtCore.QRect(600, 90, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_7.setFont(font)
+ self.label_7.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_7.setObjectName("label_7")
+ self.label_8 = QtWidgets.QLabel(self.widget_2)
+ self.label_8.setGeometry(QtCore.QRect(20, 200, 221, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_8.setFont(font)
+ self.label_8.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_8.setObjectName("label_8")
+ self.lineEdit_5 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_5.setGeometry(QtCore.QRect(270, 30, 181, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_5.setFont(font)
+ self.lineEdit_5.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_5.setObjectName("lineEdit_5")
+ self.buttonBox_2 = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox_2.setGeometry(QtCore.QRect(440, 270, 341, 32))
+ self.buttonBox_2.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox_2.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox_2.setObjectName("buttonBox_2")
+ self.label_21 = QtWidgets.QLabel(self.widget_2)
+ self.label_21.setGeometry(QtCore.QRect(470, 30, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_21.setFont(font)
+ self.label_21.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_21.setObjectName("label_21")
+ self.label_22 = QtWidgets.QLabel(self.widget_2)
+ self.label_22.setGeometry(QtCore.QRect(470, 90, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_22.setFont(font)
+ self.label_22.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_22.setObjectName("label_22")
+ self.label_23 = QtWidgets.QLabel(self.widget_2)
+ self.label_23.setGeometry(QtCore.QRect(470, 200, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_23.setFont(font)
+ self.label_23.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_23.setObjectName("label_23")
+ self.label_24 = QtWidgets.QLabel(self.widget_2)
+ self.label_24.setGeometry(QtCore.QRect(470, 240, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_24.setFont(font)
+ self.label_24.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_24.setObjectName("label_24")
+ self.textBrowser_2 = QtWidgets.QTextBrowser(self.widget_2)
+ self.textBrowser_2.setGeometry(QtCore.QRect(20, 10, 231, 51))
+ self.textBrowser_2.setObjectName("textBrowser_2")
+ self.textBrowser_3 = QtWidgets.QTextBrowser(self.widget_2)
+ self.textBrowser_3.setGeometry(QtCore.QRect(20, 70, 231, 51))
+ self.textBrowser_3.setObjectName("textBrowser_3")
+ self.textBrowser_4 = QtWidgets.QTextBrowser(self.widget_2)
+ self.textBrowser_4.setGeometry(QtCore.QRect(20, 130, 231, 51))
+ self.textBrowser_4.setObjectName("textBrowser_4")
+ self.lineEdit_7 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_7.setGeometry(QtCore.QRect(270, 90, 181, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_7.setFont(font)
+ self.lineEdit_7.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_7.setObjectName("lineEdit_7")
+ self.lineEdit_8 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_8.setGeometry(QtCore.QRect(270, 150, 181, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_8.setFont(font)
+ self.lineEdit_8.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_8.setObjectName("lineEdit_8")
+ self.lineEdit_9 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_9.setGeometry(QtCore.QRect(270, 200, 181, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_9.setFont(font)
+ self.lineEdit_9.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_9.setObjectName("lineEdit_9")
+ self.lineEdit_10 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_10.setGeometry(QtCore.QRect(270, 240, 181, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_10.setFont(font)
+ self.lineEdit_10.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_10.setObjectName("lineEdit_10")
+ self.label_25 = QtWidgets.QLabel(self.widget_2)
+ self.label_25.setGeometry(QtCore.QRect(470, 150, 51, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_25.setFont(font)
+ self.label_25.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
+ self.label_25.setObjectName("label_25")
+ self.pushButton = QtWidgets.QPushButton(Maintenance_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 35, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.scrollArea = QtWidgets.QScrollArea(Maintenance_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 65, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
+ self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_2.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_2.setFont(font)
+ self.label_2.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_2.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_2.setObjectName("label_2")
+ self.widget = QtWidgets.QWidget(self.scrollAreaWidgetContents)
+ self.widget.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget.setStyleSheet("background-color: #fff9f9")
+ self.widget.setObjectName("widget")
+ self.verticalLayout = QtWidgets.QVBoxLayout(self.widget)
+ self.verticalLayout.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout.setObjectName("verticalLayout")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_15.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_15.setIcon(icon1)
+ self.pushButton_15.setCheckable(True)
+ self.pushButton_15.setAutoDefault(True)
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.verticalLayout.addWidget(self.pushButton_15)
+ self.widget_5 = QtWidgets.QWidget(self.widget)
+ self.widget_5.setObjectName("widget_5")
+ self.formLayout = QtWidgets.QFormLayout(self.widget_5)
+ self.formLayout.setObjectName("formLayout")
+ self.pushButton_20 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_20.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_20.setIcon(icon2)
+ self.pushButton_20.setObjectName("pushButton_20")
+ self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_20)
+ self.pushButton_21 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_21.setFont(font)
+ self.pushButton_21.setIcon(icon2)
+ self.pushButton_21.setObjectName("pushButton_21")
+ self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_21)
+ self.pushButton_22 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_22.setFont(font)
+ self.pushButton_22.setIcon(icon2)
+ self.pushButton_22.setObjectName("pushButton_22")
+ self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_22)
+ self.pushButton_23 = QtWidgets.QPushButton(self.widget_5)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_23.setFont(font)
+ self.pushButton_23.setIcon(icon2)
+ self.pushButton_23.setObjectName("pushButton_23")
+ self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_23)
+ self.verticalLayout.addWidget(self.widget_5)
+ self.pushButton_19 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_19.setFont(font)
+ self.pushButton_19.setObjectName("pushButton_19")
+ self.verticalLayout.addWidget(self.pushButton_19)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setIcon(icon1)
+ self.pushButton_16.setCheckable(True)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout.addWidget(self.pushButton_16)
+ self.widget_8 = QtWidgets.QWidget(self.widget)
+ self.widget_8.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_8.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_8.setObjectName("widget_8")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_8)
+ self.pushButton_14.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_14.setFont(font)
+ self.pushButton_14.setIcon(icon2)
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.verticalLayout.addWidget(self.widget_8)
+ self.pushButton_17 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_17.setFont(font)
+ self.pushButton_17.setObjectName("pushButton_17")
+ self.verticalLayout.addWidget(self.pushButton_17)
+ self.pushButton_18 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_18.setFont(font)
+ self.pushButton_18.setObjectName("pushButton_18")
+ self.verticalLayout.addWidget(self.pushButton_18)
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_10.setFont(font)
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.verticalLayout.addWidget(self.pushButton_10)
+ self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents)
+ self.label_3.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_3.setFont(font)
+ self.label_3.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_3.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_3.setObjectName("label_3")
+ self.textBrowser = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents)
+ self.textBrowser.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser.setObjectName("textBrowser")
+ self.verticalScrollBar = QtWidgets.QScrollBar(self.scrollAreaWidgetContents)
+ self.verticalScrollBar.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar.setObjectName("verticalScrollBar")
+ self.widget.raise_()
+ self.label_2.raise_()
+ self.label_3.raise_()
+ self.textBrowser.raise_()
+ self.verticalScrollBar.raise_()
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents)
+
+ self.retranslateUi(Maintenance_Dialog)
+ self.buttonBox_2.accepted.connect(Maintenance_Dialog.accept) # type: ignore
+ self.buttonBox_2.rejected.connect(self.show_warning) # type: ignore
+ self.pushButton_15.toggled['bool'].connect(self.widget_5.setVisible) # type: ignore
+ self.pushButton_16.toggled['bool'].connect(self.widget_8.setVisible) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(Maintenance_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, Maintenance_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Maintenance_Dialog.setWindowTitle(_translate("Maintenance_Dialog", "Maintenance and Repair Data"))
+ self.pushButton_6.setText(_translate("Maintenance_Dialog", "Maintenance and Repair Data "))
+ self.label_4.setText(_translate("Maintenance_Dialog", "Frequency of Routine Inspection"))
+ self.label_5.setText(_translate("Maintenance_Dialog", "Investment Ratio"))
+ self.label_6.setText(_translate("Maintenance_Dialog", "Interest Rate"))
+ self.label_7.setText(_translate("Maintenance_Dialog", "Duration of Study "))
+ self.label_8.setText(_translate("Maintenance_Dialog", "Frequency of Periodic Maintenance"))
+ self.label_21.setText(_translate("Maintenance_Dialog", "(%)"))
+ self.label_22.setText(_translate("Maintenance_Dialog", "(%)"))
+ self.label_23.setText(_translate("Maintenance_Dialog", "(years)"))
+ self.label_24.setText(_translate("Maintenance_Dialog", "(years)"))
+ self.textBrowser_2.setHtml(_translate("Maintenance_Dialog", "\n"
+"\n"
+"Periodic Maintenance Cost rate as percentage to total construction cost
"))
+ self.textBrowser_3.setHtml(_translate("Maintenance_Dialog", "\n"
+"\n"
+"Annual Routine Inspection cost rate as percentage of total construction cost
"))
+ self.textBrowser_4.setHtml(_translate("Maintenance_Dialog", "\n"
+"\n"
+"Repair and Rehabilitation cost rate as
percentage of total construction cost
"))
+ self.label_25.setText(_translate("Maintenance_Dialog", "(%)"))
+ self.pushButton.setText(_translate("Maintenance_Dialog", "Project Details Window "))
+ self.label_2.setText(_translate("Maintenance_Dialog", "Input Parameters"))
+ self.pushButton_15.setText(_translate("Maintenance_Dialog", "Structure Works Data"))
+ self.pushButton_20.setText(_translate("Maintenance_Dialog", "Foundation"))
+ self.pushButton_21.setText(_translate("Maintenance_Dialog", "Super-Structure"))
+ self.pushButton_22.setText(_translate("Maintenance_Dialog", "Sub-Structure"))
+ self.pushButton_23.setText(_translate("Maintenance_Dialog", "Miscellaneous"))
+ self.pushButton_19.setText(_translate("Maintenance_Dialog", "Financial Data"))
+ self.pushButton_16.setText(_translate("Maintenance_Dialog", "Carbon Emission Data"))
+ self.pushButton_14.setText(_translate("Maintenance_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_17.setText(_translate("Maintenance_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_18.setText(_translate("Maintenance_Dialog", "Maintenance and Repair"))
+ self.pushButton_10.setText(_translate("Maintenance_Dialog", "Disposal and Recycling"))
+ self.label_3.setText(_translate("Maintenance_Dialog", "Output"))
+ self.textBrowser.setHtml(_translate("Maintenance_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ Maintenance_Dialog = QtWidgets.QDialog()
+ ui = Ui_Maintenance_Dialog()
+ ui.setupUi(Maintenance_Dialog)
+ Maintenance_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_Miscellaneous_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Miscellaneous_Window.py
new file mode 100644
index 0000000..8be13e0
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Miscellaneous_Window.py
@@ -0,0 +1,566 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_Miscellaneous_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_Miscellaneous_Dialog(object):
+ def setupUi(self, Miscellaneous_Dialog):
+ Miscellaneous_Dialog.setObjectName("Miscellaneous_Dialog")
+ Miscellaneous_Dialog.resize(1440, 1000)
+ Miscellaneous_Dialog.setStyleSheet("background-color:#FAFAFA")
+ self.pushButton = QtWidgets.QPushButton(Miscellaneous_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.widget_2 = QtWidgets.QWidget(Miscellaneous_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 35, 778, 624))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_38 = QtWidgets.QLabel(self.widget_2)
+ self.label_38.setGeometry(QtCore.QRect(20, 10, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_38.setFont(font)
+ self.label_38.setObjectName("label_38")
+ self.comboBox_13 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_13.setGeometry(QtCore.QRect(140, 10, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_13.setFont(font)
+ self.comboBox_13.setStyleSheet("background-color: #ffffff")
+ self.comboBox_13.setObjectName("comboBox_13")
+ self.comboBox_13.addItem("")
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_10.setGeometry(QtCore.QRect(350, 10, 190, 23))
+ self.pushButton_10.setStyleSheet("background-color: #ffffff")
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.label_39 = QtWidgets.QLabel(self.widget_2)
+ self.label_39.setGeometry(QtCore.QRect(20, 70, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_39.setFont(font)
+ self.label_39.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_39.setObjectName("label_39")
+ self.label_40 = QtWidgets.QLabel(self.widget_2)
+ self.label_40.setGeometry(QtCore.QRect(551, 70, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_40.setFont(font)
+ self.label_40.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_40.setObjectName("label_40")
+ self.label_41 = QtWidgets.QLabel(self.widget_2)
+ self.label_41.setGeometry(QtCore.QRect(191, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_41.setFont(font)
+ self.label_41.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_41.setObjectName("label_41")
+ self.label_42 = QtWidgets.QLabel(self.widget_2)
+ self.label_42.setGeometry(QtCore.QRect(311, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_42.setFont(font)
+ self.label_42.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_42.setObjectName("label_42")
+ self.label_43 = QtWidgets.QLabel(self.widget_2)
+ self.label_43.setGeometry(QtCore.QRect(431, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_43.setFont(font)
+ self.label_43.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_43.setObjectName("label_43")
+ self.comboBox_14 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_14.setGeometry(QtCore.QRect(30, 100, 140, 22))
+ self.comboBox_14.setStyleSheet("background-color: #ffffff")
+ self.comboBox_14.setObjectName("comboBox_14")
+ self.comboBox_15 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_15.setGeometry(QtCore.QRect(30, 130, 140, 22))
+ self.comboBox_15.setStyleSheet("background-color: #ffffff")
+ self.comboBox_15.setObjectName("comboBox_15")
+ self.lineEdit_25 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_25.setGeometry(QtCore.QRect(210, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_25.setFont(font)
+ self.lineEdit_25.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_25.setObjectName("lineEdit_25")
+ self.lineEdit_26 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_26.setGeometry(QtCore.QRect(210, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_26.setFont(font)
+ self.lineEdit_26.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_26.setObjectName("lineEdit_26")
+ self.label_44 = QtWidgets.QLabel(self.widget_2)
+ self.label_44.setGeometry(QtCore.QRect(340, 100, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_44.setFont(font)
+ self.label_44.setStyleSheet("background-color: #ffffff")
+ self.label_44.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_44.setObjectName("label_44")
+ self.label_45 = QtWidgets.QLabel(self.widget_2)
+ self.label_45.setGeometry(QtCore.QRect(340, 130, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_45.setFont(font)
+ self.label_45.setStyleSheet("background-color: #ffffff")
+ self.label_45.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_45.setObjectName("label_45")
+ self.lineEdit_27 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_27.setGeometry(QtCore.QRect(450, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_27.setFont(font)
+ self.lineEdit_27.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_27.setObjectName("lineEdit_27")
+ self.lineEdit_28 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_28.setGeometry(QtCore.QRect(450, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_28.setFont(font)
+ self.lineEdit_28.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_28.setObjectName("lineEdit_28")
+ self.lineEdit_29 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_29.setGeometry(QtCore.QRect(570, 100, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_29.setFont(font)
+ self.lineEdit_29.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_29.setObjectName("lineEdit_29")
+ self.lineEdit_30 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_30.setGeometry(QtCore.QRect(570, 130, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_30.setFont(font)
+ self.lineEdit_30.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_30.setObjectName("lineEdit_30")
+ self.pushButton_13 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_13.setGeometry(QtCore.QRect(300, 200, 190, 23))
+ self.pushButton_13.setStyleSheet("background-color: #ffffff")
+ self.pushButton_13.setObjectName("pushButton_13")
+ self.label_46 = QtWidgets.QLabel(self.widget_2)
+ self.label_46.setGeometry(QtCore.QRect(30, 330, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_46.setFont(font)
+ self.label_46.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_46.setObjectName("label_46")
+ self.comboBox_16 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_16.setGeometry(QtCore.QRect(150, 270, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_16.setFont(font)
+ self.comboBox_16.setStyleSheet("background-color: #ffffff")
+ self.comboBox_16.setObjectName("comboBox_16")
+ self.comboBox_16.addItem("")
+ self.label_47 = QtWidgets.QLabel(self.widget_2)
+ self.label_47.setGeometry(QtCore.QRect(441, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_47.setFont(font)
+ self.label_47.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_47.setObjectName("label_47")
+ self.label_48 = QtWidgets.QLabel(self.widget_2)
+ self.label_48.setGeometry(QtCore.QRect(350, 390, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_48.setFont(font)
+ self.label_48.setStyleSheet("background-color: #ffffff")
+ self.label_48.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_48.setObjectName("label_48")
+ self.label_49 = QtWidgets.QLabel(self.widget_2)
+ self.label_49.setGeometry(QtCore.QRect(561, 330, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_49.setFont(font)
+ self.label_49.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_49.setObjectName("label_49")
+ self.label_50 = QtWidgets.QLabel(self.widget_2)
+ self.label_50.setGeometry(QtCore.QRect(350, 360, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_50.setFont(font)
+ self.label_50.setStyleSheet("background-color: #ffffff")
+ self.label_50.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_50.setObjectName("label_50")
+ self.label_51 = QtWidgets.QLabel(self.widget_2)
+ self.label_51.setGeometry(QtCore.QRect(321, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_51.setFont(font)
+ self.label_51.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_51.setObjectName("label_51")
+ self.lineEdit_31 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_31.setGeometry(QtCore.QRect(220, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_31.setFont(font)
+ self.lineEdit_31.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_31.setObjectName("lineEdit_31")
+ self.lineEdit_32 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_32.setGeometry(QtCore.QRect(580, 360, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_32.setFont(font)
+ self.lineEdit_32.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_32.setObjectName("lineEdit_32")
+ self.label_52 = QtWidgets.QLabel(self.widget_2)
+ self.label_52.setGeometry(QtCore.QRect(201, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_52.setFont(font)
+ self.label_52.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_52.setObjectName("label_52")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_14.setGeometry(QtCore.QRect(310, 460, 190, 23))
+ self.pushButton_14.setStyleSheet("background-color: #ffffff")
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.lineEdit_33 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_33.setGeometry(QtCore.QRect(220, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_33.setFont(font)
+ self.lineEdit_33.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_33.setObjectName("lineEdit_33")
+ self.lineEdit_34 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_34.setGeometry(QtCore.QRect(460, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_34.setFont(font)
+ self.lineEdit_34.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_34.setObjectName("lineEdit_34")
+ self.lineEdit_35 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_35.setGeometry(QtCore.QRect(460, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_35.setFont(font)
+ self.lineEdit_35.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_35.setObjectName("lineEdit_35")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_15.setGeometry(QtCore.QRect(360, 270, 190, 23))
+ self.pushButton_15.setStyleSheet("background-color: #ffffff")
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.label_53 = QtWidgets.QLabel(self.widget_2)
+ self.label_53.setGeometry(QtCore.QRect(30, 270, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_53.setFont(font)
+ self.label_53.setObjectName("label_53")
+ self.lineEdit_36 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_36.setGeometry(QtCore.QRect(580, 390, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_36.setFont(font)
+ self.lineEdit_36.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_36.setObjectName("lineEdit_36")
+ self.comboBox_17 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_17.setGeometry(QtCore.QRect(40, 360, 140, 22))
+ self.comboBox_17.setStyleSheet("background-color: #ffffff")
+ self.comboBox_17.setObjectName("comboBox_17")
+ self.comboBox_17.addItem("")
+ self.comboBox_17.addItem("")
+ self.comboBox_18 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_18.setGeometry(QtCore.QRect(40, 390, 140, 22))
+ self.comboBox_18.setStyleSheet("background-color: #ffffff")
+ self.comboBox_18.setObjectName("comboBox_18")
+ self.comboBox_18.addItem("")
+ self.comboBox_18.addItem("")
+ self.line_5 = QtWidgets.QFrame(self.widget_2)
+ self.line_5.setGeometry(QtCore.QRect(10, 250, 761, 16))
+ self.line_5.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_5.setLineWidth(2)
+ self.line_5.setMidLineWidth(2)
+ self.line_5.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_5.setObjectName("line_5")
+ self.line_6 = QtWidgets.QFrame(self.widget_2)
+ self.line_6.setGeometry(QtCore.QRect(10, 500, 761, 16))
+ self.line_6.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_6.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_6.setLineWidth(2)
+ self.line_6.setMidLineWidth(2)
+ self.line_6.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_6.setObjectName("line_6")
+ self.buttonBox = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox.setGeometry(QtCore.QRect(430, 590, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+ self.label = QtWidgets.QLabel(Miscellaneous_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 35, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton_6 = QtWidgets.QPushButton(Miscellaneous_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+ self.scrollArea = QtWidgets.QScrollArea(Miscellaneous_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 40, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents_3 = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3")
+ self.label_54 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_54.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_54.setFont(font)
+ self.label_54.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_54.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_54.setObjectName("label_54")
+ self.widget_4 = QtWidgets.QWidget(self.scrollAreaWidgetContents_3)
+ self.widget_4.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget_4.setStyleSheet("background-color: #fff9f9")
+ self.widget_4.setObjectName("widget_4")
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget_4)
+ self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.pushButton_34 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_34.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_34.setIcon(icon1)
+ self.pushButton_34.setCheckable(True)
+ self.pushButton_34.setAutoDefault(True)
+ self.pushButton_34.setObjectName("pushButton_34")
+ self.verticalLayout_3.addWidget(self.pushButton_34)
+ self.widget_7 = QtWidgets.QWidget(self.widget_4)
+ self.widget_7.setObjectName("widget_7")
+ self.formLayout_3 = QtWidgets.QFormLayout(self.widget_7)
+ self.formLayout_3.setObjectName("formLayout_3")
+ self.pushButton_35 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_35.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_35.setIcon(icon2)
+ self.pushButton_35.setObjectName("pushButton_35")
+ self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_35)
+ self.pushButton_36 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_36.setFont(font)
+ self.pushButton_36.setIcon(icon2)
+ self.pushButton_36.setObjectName("pushButton_36")
+ self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_36)
+ self.pushButton_37 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_37.setFont(font)
+ self.pushButton_37.setIcon(icon2)
+ self.pushButton_37.setObjectName("pushButton_37")
+ self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_37)
+ self.pushButton_38 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_38.setFont(font)
+ self.pushButton_38.setIcon(icon2)
+ self.pushButton_38.setObjectName("pushButton_38")
+ self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_38)
+ self.verticalLayout_3.addWidget(self.widget_7)
+ self.pushButton_39 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_39.setFont(font)
+ self.pushButton_39.setObjectName("pushButton_39")
+ self.verticalLayout_3.addWidget(self.pushButton_39)
+ self.pushButton_40 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_40.setFont(font)
+ self.pushButton_40.setIcon(icon1)
+ self.pushButton_40.setCheckable(True)
+ self.pushButton_40.setObjectName("pushButton_40")
+ self.verticalLayout_3.addWidget(self.pushButton_40)
+ self.widget_10 = QtWidgets.QWidget(self.widget_4)
+ self.widget_10.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_10.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_10.setObjectName("widget_10")
+ self.pushButton_41 = QtWidgets.QPushButton(self.widget_10)
+ self.pushButton_41.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_41.setFont(font)
+ self.pushButton_41.setIcon(icon2)
+ self.pushButton_41.setObjectName("pushButton_41")
+ self.verticalLayout_3.addWidget(self.widget_10)
+ self.pushButton_42 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_42.setFont(font)
+ self.pushButton_42.setObjectName("pushButton_42")
+ self.verticalLayout_3.addWidget(self.pushButton_42)
+ self.pushButton_43 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_43.setFont(font)
+ self.pushButton_43.setObjectName("pushButton_43")
+ self.verticalLayout_3.addWidget(self.pushButton_43)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout_3.addWidget(self.pushButton_16)
+ self.label_55 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_55.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_55.setFont(font)
+ self.label_55.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_55.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_55.setObjectName("label_55")
+ self.textBrowser_3 = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents_3)
+ self.textBrowser_3.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser_3.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser_3.setObjectName("textBrowser_3")
+ self.verticalScrollBar_3 = QtWidgets.QScrollBar(self.scrollAreaWidgetContents_3)
+ self.verticalScrollBar_3.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar_3.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar_3.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar_3.setObjectName("verticalScrollBar_3")
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents_3)
+
+ self.retranslateUi(Miscellaneous_Dialog)
+ self.buttonBox.accepted.connect(Miscellaneous_Dialog.accept) # type: ignore
+ self.buttonBox.rejected.connect(self.show_warning) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(Miscellaneous_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, Miscellaneous_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Miscellaneous_Dialog.setWindowTitle(_translate("Miscellaneous_Dialog", "Dialog"))
+ self.pushButton.setText(_translate("Miscellaneous_Dialog", "Project Details Window "))
+ self.label_38.setText(_translate("Miscellaneous_Dialog", "Componenets:"))
+ self.comboBox_13.setItemText(0, _translate("Miscellaneous_Dialog", "Expansion Joint"))
+ self.pushButton_10.setText(_translate("Miscellaneous_Dialog", "+ Add Sub-Component"))
+ self.label_39.setText(_translate("Miscellaneous_Dialog", "Material Type and Grade"))
+ self.label_40.setText(_translate("Miscellaneous_Dialog", "Rate Data Source"))
+ self.label_41.setText(_translate("Miscellaneous_Dialog", "Quantity"))
+ self.label_42.setText(_translate("Miscellaneous_Dialog", "Unit"))
+ self.label_43.setText(_translate("Miscellaneous_Dialog", "Rate"))
+ self.label_44.setText(_translate("Miscellaneous_Dialog", "m3
"))
+ self.label_45.setText(_translate("Miscellaneous_Dialog", "kg"))
+ self.pushButton_13.setText(_translate("Miscellaneous_Dialog", "+ Add Material"))
+ self.label_46.setText(_translate("Miscellaneous_Dialog", "Material Type and Grade"))
+ self.comboBox_16.setItemText(0, _translate("Miscellaneous_Dialog", "Bearing"))
+ self.label_47.setText(_translate("Miscellaneous_Dialog", "Rate"))
+ self.label_48.setText(_translate("Miscellaneous_Dialog", "kg"))
+ self.label_49.setText(_translate("Miscellaneous_Dialog", "Rate Data Source"))
+ self.label_50.setText(_translate("Miscellaneous_Dialog", "m3
"))
+ self.label_51.setText(_translate("Miscellaneous_Dialog", "Unit"))
+ self.label_52.setText(_translate("Miscellaneous_Dialog", "Quantity"))
+ self.pushButton_14.setText(_translate("Miscellaneous_Dialog", "+ Add Material"))
+ self.pushButton_15.setText(_translate("Miscellaneous_Dialog", "+ Add Sub-Component"))
+ self.label_53.setText(_translate("Miscellaneous_Dialog", "Componenets:"))
+ self.comboBox_17.setItemText(0, _translate("Miscellaneous_Dialog", "Concrete"))
+ self.comboBox_17.setItemText(1, _translate("Miscellaneous_Dialog", "Steel"))
+ self.comboBox_18.setItemText(0, _translate("Miscellaneous_Dialog", "Steel"))
+ self.comboBox_18.setItemText(1, _translate("Miscellaneous_Dialog", "Concrete"))
+ self.pushButton_6.setText(_translate("Miscellaneous_Dialog", "Miscellaneous "))
+ self.label_54.setText(_translate("Miscellaneous_Dialog", "Input Parameters"))
+ self.pushButton_34.setText(_translate("Miscellaneous_Dialog", "Structure Works Data"))
+ self.pushButton_35.setText(_translate("Miscellaneous_Dialog", "Foundation"))
+ self.pushButton_36.setText(_translate("Miscellaneous_Dialog", "Super-Structure"))
+ self.pushButton_37.setText(_translate("Miscellaneous_Dialog", "Sub-Structure"))
+ self.pushButton_38.setText(_translate("Miscellaneous_Dialog", "Miscellaneous"))
+ self.pushButton_39.setText(_translate("Miscellaneous_Dialog", "Financial Data"))
+ self.pushButton_40.setText(_translate("Miscellaneous_Dialog", "Carbon Emission Data"))
+ self.pushButton_41.setText(_translate("Miscellaneous_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_42.setText(_translate("Miscellaneous_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_43.setText(_translate("Miscellaneous_Dialog", "Maintenance and Repair"))
+ self.pushButton_16.setText(_translate("Miscellaneous_Dialog", "Disposal and Recycling"))
+ self.label_55.setText(_translate("Miscellaneous_Dialog", "Output"))
+ self.textBrowser_3.setHtml(_translate("Miscellaneous_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ Miscellaneous_Dialog = QtWidgets.QDialog()
+ ui = Ui_Miscellaneous_Dialog()
+ ui.setupUi(Miscellaneous_Dialog)
+ Miscellaneous_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_SubStructure_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_SubStructure_Window.py
new file mode 100644
index 0000000..7b71937
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_SubStructure_Window.py
@@ -0,0 +1,548 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_SubStructure_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+from Warning_Window import Ui_Warning_Dialog
+
+class Ui_SubStructure_Dialog(object):
+ def setupUi(self, SubStructure_Dialog):
+ SubStructure_Dialog.setObjectName("SubStructure_Dialog")
+ SubStructure_Dialog.resize(1440, 1000)
+ SubStructure_Dialog.setStyleSheet("background-color:#FAFAFA")
+ self.label = QtWidgets.QLabel(SubStructure_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 35, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton = QtWidgets.QPushButton(SubStructure_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+ self.widget_2 = QtWidgets.QWidget(SubStructure_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 35, 778, 624))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_38 = QtWidgets.QLabel(self.widget_2)
+ self.label_38.setGeometry(QtCore.QRect(20, 10, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_38.setFont(font)
+ self.label_38.setObjectName("label_38")
+ self.comboBox_13 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_13.setGeometry(QtCore.QRect(140, 10, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_13.setFont(font)
+ self.comboBox_13.setStyleSheet("background-color: #ffffff")
+ self.comboBox_13.setObjectName("comboBox_13")
+ self.comboBox_13.addItem("")
+ self.pushButton_10 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_10.setGeometry(QtCore.QRect(350, 10, 190, 23))
+ self.pushButton_10.setStyleSheet("background-color: #ffffff")
+ self.pushButton_10.setObjectName("pushButton_10")
+ self.label_39 = QtWidgets.QLabel(self.widget_2)
+ self.label_39.setGeometry(QtCore.QRect(20, 70, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_39.setFont(font)
+ self.label_39.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_39.setObjectName("label_39")
+ self.label_40 = QtWidgets.QLabel(self.widget_2)
+ self.label_40.setGeometry(QtCore.QRect(551, 70, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_40.setFont(font)
+ self.label_40.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_40.setObjectName("label_40")
+ self.label_41 = QtWidgets.QLabel(self.widget_2)
+ self.label_41.setGeometry(QtCore.QRect(191, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_41.setFont(font)
+ self.label_41.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_41.setObjectName("label_41")
+ self.label_42 = QtWidgets.QLabel(self.widget_2)
+ self.label_42.setGeometry(QtCore.QRect(311, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_42.setFont(font)
+ self.label_42.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_42.setObjectName("label_42")
+ self.label_43 = QtWidgets.QLabel(self.widget_2)
+ self.label_43.setGeometry(QtCore.QRect(431, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_43.setFont(font)
+ self.label_43.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_43.setObjectName("label_43")
+ self.comboBox_14 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_14.setGeometry(QtCore.QRect(30, 100, 140, 22))
+ self.comboBox_14.setStyleSheet("background-color: #ffffff")
+ self.comboBox_14.setObjectName("comboBox_14")
+ self.comboBox_15 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_15.setGeometry(QtCore.QRect(30, 130, 140, 22))
+ self.comboBox_15.setStyleSheet("background-color: #ffffff")
+ self.comboBox_15.setObjectName("comboBox_15")
+ self.lineEdit_25 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_25.setGeometry(QtCore.QRect(210, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_25.setFont(font)
+ self.lineEdit_25.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_25.setObjectName("lineEdit_25")
+ self.lineEdit_26 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_26.setGeometry(QtCore.QRect(210, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_26.setFont(font)
+ self.lineEdit_26.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_26.setObjectName("lineEdit_26")
+ self.label_44 = QtWidgets.QLabel(self.widget_2)
+ self.label_44.setGeometry(QtCore.QRect(340, 100, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_44.setFont(font)
+ self.label_44.setStyleSheet("background-color: #ffffff")
+ self.label_44.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_44.setObjectName("label_44")
+ self.label_45 = QtWidgets.QLabel(self.widget_2)
+ self.label_45.setGeometry(QtCore.QRect(340, 130, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_45.setFont(font)
+ self.label_45.setStyleSheet("background-color: #ffffff")
+ self.label_45.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_45.setObjectName("label_45")
+ self.lineEdit_27 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_27.setGeometry(QtCore.QRect(450, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_27.setFont(font)
+ self.lineEdit_27.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_27.setObjectName("lineEdit_27")
+ self.lineEdit_28 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_28.setGeometry(QtCore.QRect(450, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_28.setFont(font)
+ self.lineEdit_28.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_28.setObjectName("lineEdit_28")
+ self.lineEdit_29 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_29.setGeometry(QtCore.QRect(570, 100, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_29.setFont(font)
+ self.lineEdit_29.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_29.setObjectName("lineEdit_29")
+ self.lineEdit_30 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_30.setGeometry(QtCore.QRect(570, 130, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_30.setFont(font)
+ self.lineEdit_30.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_30.setObjectName("lineEdit_30")
+ self.pushButton_13 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_13.setGeometry(QtCore.QRect(300, 200, 190, 23))
+ self.pushButton_13.setStyleSheet("background-color: #ffffff")
+ self.pushButton_13.setObjectName("pushButton_13")
+ self.label_46 = QtWidgets.QLabel(self.widget_2)
+ self.label_46.setGeometry(QtCore.QRect(30, 330, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_46.setFont(font)
+ self.label_46.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_46.setObjectName("label_46")
+ self.comboBox_16 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_16.setGeometry(QtCore.QRect(150, 270, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_16.setFont(font)
+ self.comboBox_16.setStyleSheet("background-color: #ffffff")
+ self.comboBox_16.setObjectName("comboBox_16")
+ self.comboBox_16.addItem("")
+ self.label_47 = QtWidgets.QLabel(self.widget_2)
+ self.label_47.setGeometry(QtCore.QRect(441, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_47.setFont(font)
+ self.label_47.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_47.setObjectName("label_47")
+ self.label_48 = QtWidgets.QLabel(self.widget_2)
+ self.label_48.setGeometry(QtCore.QRect(350, 390, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_48.setFont(font)
+ self.label_48.setStyleSheet("background-color: #ffffff")
+ self.label_48.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_48.setObjectName("label_48")
+ self.label_49 = QtWidgets.QLabel(self.widget_2)
+ self.label_49.setGeometry(QtCore.QRect(561, 330, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_49.setFont(font)
+ self.label_49.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_49.setObjectName("label_49")
+ self.label_50 = QtWidgets.QLabel(self.widget_2)
+ self.label_50.setGeometry(QtCore.QRect(350, 360, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_50.setFont(font)
+ self.label_50.setStyleSheet("background-color: #ffffff")
+ self.label_50.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_50.setObjectName("label_50")
+ self.label_51 = QtWidgets.QLabel(self.widget_2)
+ self.label_51.setGeometry(QtCore.QRect(321, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_51.setFont(font)
+ self.label_51.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_51.setObjectName("label_51")
+ self.lineEdit_31 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_31.setGeometry(QtCore.QRect(220, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_31.setFont(font)
+ self.lineEdit_31.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_31.setObjectName("lineEdit_31")
+ self.lineEdit_32 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_32.setGeometry(QtCore.QRect(580, 360, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_32.setFont(font)
+ self.lineEdit_32.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_32.setObjectName("lineEdit_32")
+ self.label_52 = QtWidgets.QLabel(self.widget_2)
+ self.label_52.setGeometry(QtCore.QRect(201, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_52.setFont(font)
+ self.label_52.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_52.setObjectName("label_52")
+ self.pushButton_14 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_14.setGeometry(QtCore.QRect(310, 460, 190, 23))
+ self.pushButton_14.setStyleSheet("background-color: #ffffff")
+ self.pushButton_14.setObjectName("pushButton_14")
+ self.pushButton_15 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_15.setGeometry(QtCore.QRect(360, 270, 190, 23))
+ self.pushButton_15.setStyleSheet("background-color: #ffffff")
+ self.pushButton_15.setObjectName("pushButton_15")
+ self.label_53 = QtWidgets.QLabel(self.widget_2)
+ self.label_53.setGeometry(QtCore.QRect(30, 270, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_53.setFont(font)
+ self.label_53.setObjectName("label_53")
+ self.lineEdit_36 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_36.setGeometry(QtCore.QRect(580, 390, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_36.setFont(font)
+ self.lineEdit_36.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_36.setObjectName("lineEdit_36")
+ self.comboBox_17 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_17.setGeometry(QtCore.QRect(40, 360, 140, 22))
+ self.comboBox_17.setStyleSheet("background-color: #ffffff")
+ self.comboBox_17.setObjectName("comboBox_17")
+ self.comboBox_17.addItem("")
+ self.comboBox_17.addItem("")
+ self.comboBox_18 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_18.setGeometry(QtCore.QRect(40, 390, 140, 22))
+ self.comboBox_18.setStyleSheet("background-color: #ffffff")
+ self.comboBox_18.setObjectName("comboBox_18")
+ self.comboBox_18.addItem("")
+ self.comboBox_18.addItem("")
+ self.line_5 = QtWidgets.QFrame(self.widget_2)
+ self.line_5.setGeometry(QtCore.QRect(10, 250, 761, 16))
+ self.line_5.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_5.setLineWidth(2)
+ self.line_5.setMidLineWidth(2)
+ self.line_5.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_5.setObjectName("line_5")
+ self.line_6 = QtWidgets.QFrame(self.widget_2)
+ self.line_6.setGeometry(QtCore.QRect(10, 500, 761, 16))
+ self.line_6.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_6.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_6.setLineWidth(2)
+ self.line_6.setMidLineWidth(2)
+ self.line_6.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_6.setObjectName("line_6")
+ self.buttonBox = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox.setGeometry(QtCore.QRect(430, 590, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+ self.pushButton_6 = QtWidgets.QPushButton(SubStructure_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+ self.scrollArea = QtWidgets.QScrollArea(SubStructure_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 40, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents_3 = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents_3.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents_3.setObjectName("scrollAreaWidgetContents_3")
+ self.label_54 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_54.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_54.setFont(font)
+ self.label_54.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_54.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_54.setObjectName("label_54")
+ self.widget_4 = QtWidgets.QWidget(self.scrollAreaWidgetContents_3)
+ self.widget_4.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget_4.setStyleSheet("background-color: #fff9f9")
+ self.widget_4.setObjectName("widget_4")
+ self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget_4)
+ self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout_3.setObjectName("verticalLayout_3")
+ self.pushButton_34 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_34.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_34.setIcon(icon1)
+ self.pushButton_34.setCheckable(True)
+ self.pushButton_34.setAutoDefault(True)
+ self.pushButton_34.setObjectName("pushButton_34")
+ self.verticalLayout_3.addWidget(self.pushButton_34)
+ self.widget_7 = QtWidgets.QWidget(self.widget_4)
+ self.widget_7.setObjectName("widget_7")
+ self.formLayout_3 = QtWidgets.QFormLayout(self.widget_7)
+ self.formLayout_3.setObjectName("formLayout_3")
+ self.pushButton_35 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_35.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_35.setIcon(icon2)
+ self.pushButton_35.setObjectName("pushButton_35")
+ self.formLayout_3.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_35)
+ self.pushButton_36 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_36.setFont(font)
+ self.pushButton_36.setIcon(icon2)
+ self.pushButton_36.setObjectName("pushButton_36")
+ self.formLayout_3.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_36)
+ self.pushButton_37 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_37.setFont(font)
+ self.pushButton_37.setIcon(icon2)
+ self.pushButton_37.setObjectName("pushButton_37")
+ self.formLayout_3.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_37)
+ self.pushButton_38 = QtWidgets.QPushButton(self.widget_7)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_38.setFont(font)
+ self.pushButton_38.setIcon(icon2)
+ self.pushButton_38.setObjectName("pushButton_38")
+ self.formLayout_3.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_38)
+ self.verticalLayout_3.addWidget(self.widget_7)
+ self.pushButton_39 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_39.setFont(font)
+ self.pushButton_39.setObjectName("pushButton_39")
+ self.verticalLayout_3.addWidget(self.pushButton_39)
+ self.pushButton_40 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_40.setFont(font)
+ self.pushButton_40.setIcon(icon1)
+ self.pushButton_40.setCheckable(True)
+ self.pushButton_40.setObjectName("pushButton_40")
+ self.verticalLayout_3.addWidget(self.pushButton_40)
+ self.widget_10 = QtWidgets.QWidget(self.widget_4)
+ self.widget_10.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_10.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_10.setObjectName("widget_10")
+ self.pushButton_41 = QtWidgets.QPushButton(self.widget_10)
+ self.pushButton_41.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_41.setFont(font)
+ self.pushButton_41.setIcon(icon2)
+ self.pushButton_41.setObjectName("pushButton_41")
+ self.verticalLayout_3.addWidget(self.widget_10)
+ self.pushButton_42 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_42.setFont(font)
+ self.pushButton_42.setObjectName("pushButton_42")
+ self.verticalLayout_3.addWidget(self.pushButton_42)
+ self.pushButton_43 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_43.setFont(font)
+ self.pushButton_43.setObjectName("pushButton_43")
+ self.verticalLayout_3.addWidget(self.pushButton_43)
+ self.pushButton_16 = QtWidgets.QPushButton(self.widget_4)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_16.setFont(font)
+ self.pushButton_16.setObjectName("pushButton_16")
+ self.verticalLayout_3.addWidget(self.pushButton_16)
+ self.label_55 = QtWidgets.QLabel(self.scrollAreaWidgetContents_3)
+ self.label_55.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_55.setFont(font)
+ self.label_55.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_55.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_55.setObjectName("label_55")
+ self.textBrowser_3 = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents_3)
+ self.textBrowser_3.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser_3.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser_3.setObjectName("textBrowser_3")
+ self.verticalScrollBar_3 = QtWidgets.QScrollBar(self.scrollAreaWidgetContents_3)
+ self.verticalScrollBar_3.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar_3.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar_3.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar_3.setObjectName("verticalScrollBar_3")
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents_3)
+
+ self.retranslateUi(SubStructure_Dialog)
+ self.buttonBox.accepted.connect(SubStructure_Dialog.accept) # type: ignore# type: ignore
+ self.buttonBox.rejected.connect(self.show_warning) # type: ignore
+ self.buttonBox.rejected.connect(SubStructure_Dialog.reject)
+ QtCore.QMetaObject.connectSlotsByName(SubStructure_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ self.buttonBox.rejected.connect(SubStructure_Dialog.reject) # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, SubStructure_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ SubStructure_Dialog.setWindowTitle(_translate("SubStructure_Dialog", "Sub-Structure Dialog"))
+ self.pushButton.setText(_translate("SubStructure_Dialog", "Project Details Window "))
+ self.label_38.setText(_translate("SubStructure_Dialog", "Componenets:"))
+ self.comboBox_13.setItemText(0, _translate("SubStructure_Dialog", "Piers"))
+ self.comboBox_13.addItem("")
+ self.comboBox_13.setItemText(1, _translate("SubStructure_Dialog", "Pier Caps"))
+ self.pushButton_10.setText(_translate("SubStructure_Dialog", "+ Add Sub-Component"))
+ self.label_39.setText(_translate("SubStructure_Dialog", "Material Type and Grade"))
+ self.label_40.setText(_translate("SubStructure_Dialog", "Rate Data Source"))
+ self.label_41.setText(_translate("SubStructure_Dialog", "Quantity"))
+ self.label_42.setText(_translate("SubStructure_Dialog", "Unit"))
+ self.label_43.setText(_translate("SubStructure_Dialog", "Rate"))
+ self.label_44.setText(_translate("SubStructure_Dialog", "m3
"))
+ self.label_45.setText(_translate("SubStructure_Dialog", "kg"))
+ self.pushButton_13.setText(_translate("SubStructure_Dialog", "+ Add Material"))
+ self.label_46.setText(_translate("SubStructure_Dialog", "Material Type and Grade"))
+ self.comboBox_16.setItemText(0, _translate("SubStructure_Dialog", "Abutment"))
+ self.label_47.setText(_translate("SubStructure_Dialog", "Rate"))
+ self.label_48.setText(_translate("SubStructure_Dialog", "kg"))
+ self.label_49.setText(_translate("SubStructure_Dialog", "Rate Data Source"))
+ self.label_50.setText(_translate("SubStructure_Dialog", "m3
"))
+ self.label_51.setText(_translate("SubStructure_Dialog", "Unit"))
+ self.label_52.setText(_translate("SubStructure_Dialog", "Quantity"))
+ self.pushButton_14.setText(_translate("SubStructure_Dialog", "+ Add Material"))
+ self.pushButton_15.setText(_translate("SubStructure_Dialog", "+ Add Sub-Component"))
+ self.label_53.setText(_translate("SubStructure_Dialog", "Componenets:"))
+ self.comboBox_17.setItemText(0, _translate("SubStructure_Dialog", "Concrete"))
+ self.comboBox_17.setItemText(1, _translate("SubStructure_Dialog", "Steel"))
+ self.comboBox_18.setItemText(0, _translate("SubStructure_Dialog", "Steel"))
+ self.comboBox_18.setItemText(1, _translate("SubStructure_Dialog", "Concrete"))
+ self.pushButton_6.setText(_translate("SubStructure_Dialog", "Sub-Structure "))
+ self.label_54.setText(_translate("SubStructure_Dialog", "Input Parameters"))
+ self.pushButton_34.setText(_translate("SubStructure_Dialog", "Structure Works Data"))
+ self.pushButton_35.setText(_translate("SubStructure_Dialog", "Foundation"))
+ self.pushButton_36.setText(_translate("SubStructure_Dialog", "Super-Structure"))
+ self.pushButton_37.setText(_translate("SubStructure_Dialog", "Sub-Structure"))
+ self.pushButton_38.setText(_translate("SubStructure_Dialog", "Miscellaneous"))
+ self.pushButton_39.setText(_translate("SubStructure_Dialog", "Financial Data"))
+ self.pushButton_40.setText(_translate("SubStructure_Dialog", "Carbon Emission Data"))
+ self.pushButton_41.setText(_translate("SubStructure_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_42.setText(_translate("SubStructure_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_43.setText(_translate("SubStructure_Dialog", "Maintenance and Repair"))
+ self.pushButton_16.setText(_translate("SubStructure_Dialog", "Disposal and Recycling"))
+ self.label_55.setText(_translate("SubStructure_Dialog", "Output"))
+ self.textBrowser_3.setHtml(_translate("SubStructure_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ SubStructure_Dialog = QtWidgets.QDialog()
+ ui = Ui_SubStructure_Dialog()
+ ui.setupUi(SubStructure_Dialog)
+ SubStructure_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_SuperStructure_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_SuperStructure_Window.py
new file mode 100644
index 0000000..22ec97b
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_SuperStructure_Window.py
@@ -0,0 +1,566 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\ProjectDetails_SuperStructure_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+from PyQt5.QtWidgets import QMessageBox
+
+
+class Ui_SuperStructure_Dialog(object):
+ def setupUi(self, SuperStructure_Dialog):
+ SuperStructure_Dialog.setObjectName("SuperStructure_Dialog")
+ SuperStructure_Dialog.resize(1440, 1000)
+ SuperStructure_Dialog.setStyleSheet("background-color:#FAFAFA")
+ self.label = QtWidgets.QLabel(SuperStructure_Dialog)
+ self.label.setGeometry(QtCore.QRect(10, 35, 244, 691))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label.setFont(font)
+ self.label.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label.setText("")
+ self.label.setObjectName("label")
+ self.pushButton_6 = QtWidgets.QPushButton(SuperStructure_Dialog)
+ self.pushButton_6.setGeometry(QtCore.QRect(350, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(True)
+ font.setWeight(75)
+ self.pushButton_6.setFont(font)
+ self.pushButton_6.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton_6.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton_6.setStyleSheet("background-color: rgb(240,230,230)")
+ icon = QtGui.QIcon()
+ icon.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/Dismiss.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_6.setIcon(icon)
+ self.pushButton_6.setAutoRepeat(False)
+ self.pushButton_6.setObjectName("pushButton_6")
+ self.widget_2 = QtWidgets.QWidget(SuperStructure_Dialog)
+ self.widget_2.setGeometry(QtCore.QRect(350, 35, 778, 624))
+ self.widget_2.setStyleSheet("background-color: #fff9f9")
+ self.widget_2.setObjectName("widget_2")
+ self.label_20 = QtWidgets.QLabel(self.widget_2)
+ self.label_20.setGeometry(QtCore.QRect(20, 10, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_20.setFont(font)
+ self.label_20.setObjectName("label_20")
+ self.comboBox_7 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_7.setGeometry(QtCore.QRect(140, 10, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_7.setFont(font)
+ self.comboBox_7.setStyleSheet("background-color: #ffffff")
+ self.comboBox_7.setObjectName("comboBox_7")
+ self.comboBox_7.addItem("")
+ self.pushButton_7 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_7.setGeometry(QtCore.QRect(350, 10, 190, 23))
+ self.pushButton_7.setStyleSheet("background-color: #ffffff")
+ self.pushButton_7.setObjectName("pushButton_7")
+ self.label_21 = QtWidgets.QLabel(self.widget_2)
+ self.label_21.setGeometry(QtCore.QRect(20, 70, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_21.setFont(font)
+ self.label_21.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_21.setObjectName("label_21")
+ self.label_22 = QtWidgets.QLabel(self.widget_2)
+ self.label_22.setGeometry(QtCore.QRect(551, 70, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_22.setFont(font)
+ self.label_22.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_22.setObjectName("label_22")
+ self.label_23 = QtWidgets.QLabel(self.widget_2)
+ self.label_23.setGeometry(QtCore.QRect(191, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_23.setFont(font)
+ self.label_23.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_23.setObjectName("label_23")
+ self.label_24 = QtWidgets.QLabel(self.widget_2)
+ self.label_24.setGeometry(QtCore.QRect(311, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_24.setFont(font)
+ self.label_24.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_24.setObjectName("label_24")
+ self.label_25 = QtWidgets.QLabel(self.widget_2)
+ self.label_25.setGeometry(QtCore.QRect(431, 70, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_25.setFont(font)
+ self.label_25.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_25.setObjectName("label_25")
+ self.comboBox_8 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_8.setGeometry(QtCore.QRect(30, 100, 140, 22))
+ self.comboBox_8.setStyleSheet("background-color: #ffffff")
+ self.comboBox_8.setObjectName("comboBox_8")
+ self.comboBox_9 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_9.setGeometry(QtCore.QRect(30, 130, 140, 22))
+ self.comboBox_9.setStyleSheet("background-color: #ffffff")
+ self.comboBox_9.setObjectName("comboBox_9")
+ self.lineEdit_13 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_13.setGeometry(QtCore.QRect(210, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_13.setFont(font)
+ self.lineEdit_13.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_13.setObjectName("lineEdit_13")
+ self.lineEdit_14 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_14.setGeometry(QtCore.QRect(210, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_14.setFont(font)
+ self.lineEdit_14.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_14.setObjectName("lineEdit_14")
+ self.label_26 = QtWidgets.QLabel(self.widget_2)
+ self.label_26.setGeometry(QtCore.QRect(340, 100, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_26.setFont(font)
+ self.label_26.setStyleSheet("background-color: #ffffff")
+ self.label_26.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_26.setObjectName("label_26")
+ self.label_27 = QtWidgets.QLabel(self.widget_2)
+ self.label_27.setGeometry(QtCore.QRect(340, 130, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_27.setFont(font)
+ self.label_27.setStyleSheet("background-color: #ffffff")
+ self.label_27.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_27.setObjectName("label_27")
+ self.lineEdit_15 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_15.setGeometry(QtCore.QRect(450, 100, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_15.setFont(font)
+ self.lineEdit_15.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_15.setObjectName("lineEdit_15")
+ self.lineEdit_16 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_16.setGeometry(QtCore.QRect(450, 130, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_16.setFont(font)
+ self.lineEdit_16.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_16.setObjectName("lineEdit_16")
+ self.lineEdit_17 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_17.setGeometry(QtCore.QRect(570, 100, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_17.setFont(font)
+ self.lineEdit_17.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_17.setObjectName("lineEdit_17")
+ self.lineEdit_18 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_18.setGeometry(QtCore.QRect(570, 130, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_18.setFont(font)
+ self.lineEdit_18.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_18.setObjectName("lineEdit_18")
+ self.pushButton_8 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_8.setGeometry(QtCore.QRect(300, 200, 190, 23))
+ self.pushButton_8.setStyleSheet("background-color: #ffffff")
+ self.pushButton_8.setObjectName("pushButton_8")
+ self.label_28 = QtWidgets.QLabel(self.widget_2)
+ self.label_28.setGeometry(QtCore.QRect(30, 330, 161, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_28.setFont(font)
+ self.label_28.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_28.setObjectName("label_28")
+ self.comboBox_10 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_10.setGeometry(QtCore.QRect(150, 270, 190, 22))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.comboBox_10.setFont(font)
+ self.comboBox_10.setStyleSheet("background-color: #ffffff")
+ self.comboBox_10.setObjectName("comboBox_10")
+ self.comboBox_10.addItem("")
+ self.label_29 = QtWidgets.QLabel(self.widget_2)
+ self.label_29.setGeometry(QtCore.QRect(441, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_29.setFont(font)
+ self.label_29.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_29.setObjectName("label_29")
+ self.label_30 = QtWidgets.QLabel(self.widget_2)
+ self.label_30.setGeometry(QtCore.QRect(350, 390, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_30.setFont(font)
+ self.label_30.setStyleSheet("background-color: #ffffff")
+ self.label_30.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_30.setObjectName("label_30")
+ self.label_31 = QtWidgets.QLabel(self.widget_2)
+ self.label_31.setGeometry(QtCore.QRect(561, 330, 140, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_31.setFont(font)
+ self.label_31.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_31.setObjectName("label_31")
+ self.label_32 = QtWidgets.QLabel(self.widget_2)
+ self.label_32.setGeometry(QtCore.QRect(350, 360, 51, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_32.setFont(font)
+ self.label_32.setStyleSheet("background-color: #ffffff")
+ self.label_32.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_32.setObjectName("label_32")
+ self.label_33 = QtWidgets.QLabel(self.widget_2)
+ self.label_33.setGeometry(QtCore.QRect(321, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_33.setFont(font)
+ self.label_33.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_33.setObjectName("label_33")
+ self.lineEdit_19 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_19.setGeometry(QtCore.QRect(220, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_19.setFont(font)
+ self.lineEdit_19.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_19.setObjectName("lineEdit_19")
+ self.lineEdit_20 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_20.setGeometry(QtCore.QRect(580, 360, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_20.setFont(font)
+ self.lineEdit_20.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_20.setObjectName("lineEdit_20")
+ self.label_34 = QtWidgets.QLabel(self.widget_2)
+ self.label_34.setGeometry(QtCore.QRect(201, 330, 110, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_34.setFont(font)
+ self.label_34.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_34.setObjectName("label_34")
+ self.pushButton_9 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_9.setGeometry(QtCore.QRect(310, 460, 190, 23))
+ self.pushButton_9.setStyleSheet("background-color: #ffffff")
+ self.pushButton_9.setObjectName("pushButton_9")
+ self.lineEdit_21 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_21.setGeometry(QtCore.QRect(220, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_21.setFont(font)
+ self.lineEdit_21.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_21.setObjectName("lineEdit_21")
+ self.lineEdit_22 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_22.setGeometry(QtCore.QRect(460, 360, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_22.setFont(font)
+ self.lineEdit_22.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_22.setObjectName("lineEdit_22")
+ self.lineEdit_23 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_23.setGeometry(QtCore.QRect(460, 390, 81, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_23.setFont(font)
+ self.lineEdit_23.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_23.setObjectName("lineEdit_23")
+ self.pushButton_11 = QtWidgets.QPushButton(self.widget_2)
+ self.pushButton_11.setGeometry(QtCore.QRect(360, 270, 190, 23))
+ self.pushButton_11.setStyleSheet("background-color: #ffffff")
+ self.pushButton_11.setObjectName("pushButton_11")
+ self.label_35 = QtWidgets.QLabel(self.widget_2)
+ self.label_35.setGeometry(QtCore.QRect(30, 270, 91, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_35.setFont(font)
+ self.label_35.setObjectName("label_35")
+ self.lineEdit_24 = QtWidgets.QLineEdit(self.widget_2)
+ self.lineEdit_24.setGeometry(QtCore.QRect(580, 390, 101, 20))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.lineEdit_24.setFont(font)
+ self.lineEdit_24.setStyleSheet("background-color: #ffffff")
+ self.lineEdit_24.setObjectName("lineEdit_24")
+ self.comboBox_11 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_11.setGeometry(QtCore.QRect(40, 360, 140, 22))
+ self.comboBox_11.setStyleSheet("background-color: #ffffff")
+ self.comboBox_11.setObjectName("comboBox_11")
+ self.comboBox_11.addItem("")
+ self.comboBox_11.addItem("")
+ self.comboBox_12 = QtWidgets.QComboBox(self.widget_2)
+ self.comboBox_12.setGeometry(QtCore.QRect(40, 390, 140, 22))
+ self.comboBox_12.setStyleSheet("background-color: #ffffff")
+ self.comboBox_12.setObjectName("comboBox_12")
+ self.comboBox_12.addItem("")
+ self.comboBox_12.addItem("")
+ self.line_3 = QtWidgets.QFrame(self.widget_2)
+ self.line_3.setGeometry(QtCore.QRect(10, 250, 761, 16))
+ self.line_3.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_3.setLineWidth(2)
+ self.line_3.setMidLineWidth(2)
+ self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_3.setObjectName("line_3")
+ self.line_4 = QtWidgets.QFrame(self.widget_2)
+ self.line_4.setGeometry(QtCore.QRect(10, 500, 761, 16))
+ self.line_4.setContextMenuPolicy(QtCore.Qt.DefaultContextMenu)
+ self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
+ self.line_4.setLineWidth(2)
+ self.line_4.setMidLineWidth(2)
+ self.line_4.setFrameShape(QtWidgets.QFrame.HLine)
+ self.line_4.setObjectName("line_4")
+ self.buttonBox = QtWidgets.QDialogButtonBox(self.widget_2)
+ self.buttonBox.setGeometry(QtCore.QRect(430, 580, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Close|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+ self.scrollArea = QtWidgets.QScrollArea(SuperStructure_Dialog)
+ self.scrollArea.setGeometry(QtCore.QRect(10, 40, 241, 681))
+ self.scrollArea.setAutoFillBackground(False)
+ self.scrollArea.setStyleSheet("background-color: #fff9f9")
+ self.scrollArea.setWidgetResizable(True)
+ self.scrollArea.setObjectName("scrollArea")
+ self.scrollAreaWidgetContents_2 = QtWidgets.QWidget()
+ self.scrollAreaWidgetContents_2.setGeometry(QtCore.QRect(0, 0, 239, 679))
+ self.scrollAreaWidgetContents_2.setObjectName("scrollAreaWidgetContents_2")
+ self.label_36 = QtWidgets.QLabel(self.scrollAreaWidgetContents_2)
+ self.label_36.setGeometry(QtCore.QRect(0, 0, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_36.setFont(font)
+ self.label_36.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_36.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_36.setObjectName("label_36")
+ self.widget_3 = QtWidgets.QWidget(self.scrollAreaWidgetContents_2)
+ self.widget_3.setGeometry(QtCore.QRect(0, 30, 221, 357))
+ self.widget_3.setStyleSheet("background-color: #fff9f9")
+ self.widget_3.setObjectName("widget_3")
+ self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widget_3)
+ self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
+ self.verticalLayout_2.setObjectName("verticalLayout_2")
+ self.pushButton_24 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_24.setFont(font)
+ icon1 = QtGui.QIcon()
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ icon1.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled (1).png"), QtGui.QIcon.Normal, QtGui.QIcon.On)
+ self.pushButton_24.setIcon(icon1)
+ self.pushButton_24.setCheckable(True)
+ self.pushButton_24.setAutoDefault(True)
+ self.pushButton_24.setObjectName("pushButton_24")
+ self.verticalLayout_2.addWidget(self.pushButton_24)
+ self.widget_6 = QtWidgets.QWidget(self.widget_3)
+ self.widget_6.setObjectName("widget_6")
+ self.formLayout_2 = QtWidgets.QFormLayout(self.widget_6)
+ self.formLayout_2.setObjectName("formLayout_2")
+ self.pushButton_25 = QtWidgets.QPushButton(self.widget_6)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_25.setFont(font)
+ icon2 = QtGui.QIcon()
+ icon2.addPixmap(QtGui.QPixmap("C:\\Users\\saans\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\qt5_applications\\Qt\\bin\\../../../../../../../../../../Downloads/play_arrow_filled.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
+ self.pushButton_25.setIcon(icon2)
+ self.pushButton_25.setObjectName("pushButton_25")
+ self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.pushButton_25)
+ self.pushButton_26 = QtWidgets.QPushButton(self.widget_6)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_26.setFont(font)
+ self.pushButton_26.setIcon(icon2)
+ self.pushButton_26.setObjectName("pushButton_26")
+ self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.pushButton_26)
+ self.pushButton_27 = QtWidgets.QPushButton(self.widget_6)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_27.setFont(font)
+ self.pushButton_27.setIcon(icon2)
+ self.pushButton_27.setObjectName("pushButton_27")
+ self.formLayout_2.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.pushButton_27)
+ self.pushButton_28 = QtWidgets.QPushButton(self.widget_6)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_28.setFont(font)
+ self.pushButton_28.setIcon(icon2)
+ self.pushButton_28.setObjectName("pushButton_28")
+ self.formLayout_2.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.pushButton_28)
+ self.verticalLayout_2.addWidget(self.widget_6)
+ self.pushButton_29 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_29.setFont(font)
+ self.pushButton_29.setObjectName("pushButton_29")
+ self.verticalLayout_2.addWidget(self.pushButton_29)
+ self.pushButton_30 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_30.setFont(font)
+ self.pushButton_30.setIcon(icon1)
+ self.pushButton_30.setCheckable(True)
+ self.pushButton_30.setObjectName("pushButton_30")
+ self.verticalLayout_2.addWidget(self.pushButton_30)
+ self.widget_9 = QtWidgets.QWidget(self.widget_3)
+ self.widget_9.setMinimumSize(QtCore.QSize(203, 21))
+ self.widget_9.setMaximumSize(QtCore.QSize(281, 21))
+ self.widget_9.setObjectName("widget_9")
+ self.pushButton_31 = QtWidgets.QPushButton(self.widget_9)
+ self.pushButton_31.setGeometry(QtCore.QRect(20, 0, 183, 21))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ font.setBold(False)
+ font.setWeight(50)
+ self.pushButton_31.setFont(font)
+ self.pushButton_31.setIcon(icon2)
+ self.pushButton_31.setObjectName("pushButton_31")
+ self.verticalLayout_2.addWidget(self.widget_9)
+ self.pushButton_32 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_32.setFont(font)
+ self.pushButton_32.setObjectName("pushButton_32")
+ self.verticalLayout_2.addWidget(self.pushButton_32)
+ self.pushButton_33 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_33.setFont(font)
+ self.pushButton_33.setObjectName("pushButton_33")
+ self.verticalLayout_2.addWidget(self.pushButton_33)
+ self.pushButton_12 = QtWidgets.QPushButton(self.widget_3)
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton_12.setFont(font)
+ self.pushButton_12.setObjectName("pushButton_12")
+ self.verticalLayout_2.addWidget(self.pushButton_12)
+ self.label_37 = QtWidgets.QLabel(self.scrollAreaWidgetContents_2)
+ self.label_37.setGeometry(QtCore.QRect(0, 387, 221, 31))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.label_37.setFont(font)
+ self.label_37.setStyleSheet("background-color: rgb(240,230,230)")
+ self.label_37.setAlignment(QtCore.Qt.AlignCenter)
+ self.label_37.setObjectName("label_37")
+ self.textBrowser_2 = QtWidgets.QTextBrowser(self.scrollAreaWidgetContents_2)
+ self.textBrowser_2.setGeometry(QtCore.QRect(0, 418, 221, 221))
+ self.textBrowser_2.setStyleSheet("background-color: #fff9f9")
+ self.textBrowser_2.setObjectName("textBrowser_2")
+ self.verticalScrollBar_2 = QtWidgets.QScrollBar(self.scrollAreaWidgetContents_2)
+ self.verticalScrollBar_2.setGeometry(QtCore.QRect(220, 0, 16, 641))
+ self.verticalScrollBar_2.setStyleSheet("background-color: #F0F0F0")
+ self.verticalScrollBar_2.setOrientation(QtCore.Qt.Vertical)
+ self.verticalScrollBar_2.setObjectName("verticalScrollBar_2")
+ self.scrollArea.setWidget(self.scrollAreaWidgetContents_2)
+ self.pushButton = QtWidgets.QPushButton(SuperStructure_Dialog)
+ self.pushButton.setGeometry(QtCore.QRect(10, 10, 188, 25))
+ font = QtGui.QFont()
+ font.setPointSize(10)
+ self.pushButton.setFont(font)
+ self.pushButton.setFocusPolicy(QtCore.Qt.StrongFocus)
+ self.pushButton.setLayoutDirection(QtCore.Qt.RightToLeft)
+ self.pushButton.setStyleSheet("background-color: rgb(240,230,230)")
+ self.pushButton.setIcon(icon)
+ self.pushButton.setAutoRepeat(False)
+ self.pushButton.setObjectName("pushButton")
+
+ self.retranslateUi(SuperStructure_Dialog)
+ self.buttonBox.accepted.connect(SuperStructure_Dialog.accept) # type: ignore
+ self.buttonBox.rejected.connect(self.show_warning) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(SuperStructure_Dialog)
+
+ def show_warning(self):
+ """
+ Show a warning window when the Close button is pressed.
+ """
+ warning_box = QMessageBox()
+ warning_box.setIcon(QMessageBox.Warning)
+ warning_box.setWindowTitle("Confirm Close")
+ warning_box.setText("Are you sure you want to close without saving?")
+ warning_box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
+ warning_box.setDefaultButton(QMessageBox.No)
+
+ # Check the user's response
+ response = warning_box.exec_()
+ if response == QMessageBox.Yes:
+ QtWidgets.QApplication.quit() # Close the application
+ else:
+ pass # Do nothing, return to the dialog
+
+ def retranslateUi(self, SuperStructure_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ SuperStructure_Dialog.setWindowTitle(_translate("SuperStructure_Dialog", "Dialog"))
+ self.pushButton_6.setText(_translate("SuperStructure_Dialog", "Super-Structure "))
+ self.label_20.setText(_translate("SuperStructure_Dialog", "Componenets:"))
+ self.comboBox_7.setItemText(0, _translate("SuperStructure_Dialog", "Deck"))
+ self.pushButton_7.setText(_translate("SuperStructure_Dialog", "+ Add Sub-Component"))
+ self.label_21.setText(_translate("SuperStructure_Dialog", "Material Type and Grade"))
+ self.label_22.setText(_translate("SuperStructure_Dialog", "Rate Data Source"))
+ self.label_23.setText(_translate("SuperStructure_Dialog", "Quantity"))
+ self.label_24.setText(_translate("SuperStructure_Dialog", "Unit"))
+ self.label_25.setText(_translate("SuperStructure_Dialog", "Rate"))
+ self.label_26.setText(_translate("SuperStructure_Dialog", "m3
"))
+ self.label_27.setText(_translate("SuperStructure_Dialog", "kg"))
+ self.pushButton_8.setText(_translate("SuperStructure_Dialog", "+ Add Material"))
+ self.label_28.setText(_translate("SuperStructure_Dialog", "Material Type and Grade"))
+ self.comboBox_10.setItemText(0, _translate("SuperStructure_Dialog", "Cables"))
+ self.label_29.setText(_translate("SuperStructure_Dialog", "Rate"))
+ self.label_30.setText(_translate("SuperStructure_Dialog", "kg"))
+ self.label_31.setText(_translate("SuperStructure_Dialog", "Rate Data Source"))
+ self.label_32.setText(_translate("SuperStructure_Dialog", "m3
"))
+ self.label_33.setText(_translate("SuperStructure_Dialog", "Unit"))
+ self.label_34.setText(_translate("SuperStructure_Dialog", "Quantity"))
+ self.pushButton_9.setText(_translate("SuperStructure_Dialog", "+ Add Material"))
+ self.pushButton_11.setText(_translate("SuperStructure_Dialog", "+ Add Sub-Component"))
+ self.label_35.setText(_translate("SuperStructure_Dialog", "Componenets:"))
+ self.comboBox_11.setItemText(0, _translate("SuperStructure_Dialog", "Concrete"))
+ self.comboBox_11.setItemText(1, _translate("SuperStructure_Dialog", "Steel"))
+ self.comboBox_12.setItemText(0, _translate("SuperStructure_Dialog", "Steel"))
+ self.comboBox_12.setItemText(1, _translate("SuperStructure_Dialog", "Concrete"))
+ self.label_36.setText(_translate("SuperStructure_Dialog", "Input Parameters"))
+ self.pushButton_24.setText(_translate("SuperStructure_Dialog", "Structure Works Data"))
+ self.pushButton_25.setText(_translate("SuperStructure_Dialog", "Foundation"))
+ self.pushButton_26.setText(_translate("SuperStructure_Dialog", "Super-Structure"))
+ self.pushButton_27.setText(_translate("SuperStructure_Dialog", "Sub-Structure"))
+ self.pushButton_28.setText(_translate("SuperStructure_Dialog", "Miscellaneous"))
+ self.pushButton_29.setText(_translate("SuperStructure_Dialog", "Financial Data"))
+ self.pushButton_30.setText(_translate("SuperStructure_Dialog", "Carbon Emission Data"))
+ self.pushButton_31.setText(_translate("SuperStructure_Dialog", "Carbon Emission Cost Data"))
+ self.pushButton_32.setText(_translate("SuperStructure_Dialog", "Bridge and Traffic Data"))
+ self.pushButton_33.setText(_translate("SuperStructure_Dialog", "Maintenance and Repair"))
+ self.pushButton_12.setText(_translate("SuperStructure_Dialog", "Disposal and Recycling"))
+ self.label_37.setText(_translate("SuperStructure_Dialog", "Output"))
+ self.textBrowser_2.setHtml(_translate("SuperStructure_Dialog", "\n"
+"\n"
+"Initial Construction Cost
\n"
+"Initial Carbon emission Cost
\n"
+"Time Cost
\n"
+"Road User Cost
\n"
+"Carbon Emission due to Re-Routing
\n"
+"Periodic Maintenance Costs
\n"
+"Maintenance Emission Costs
\n"
+"Routine Inspectection Costs
\n"
+"Repair & Rehabilitation Costs
\n"
+"Reconstruction Costs
\n"
+"Demolition & Disposal Cost
\n"
+"Recycling Cost
\n"
+"Total Life-Cycle Cost
"))
+ self.pushButton.setText(_translate("SuperStructure_Dialog", "Project Details Window "))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ SuperStructure_Dialog = QtWidgets.QDialog()
+ ui = Ui_SuperStructure_Dialog()
+ ui.setupUi(SuperStructure_Dialog)
+ SuperStructure_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/README.md b/src/osbridgelcca/desktop_app/ui/README.md
new file mode 100644
index 0000000..89a73e9
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/README.md
@@ -0,0 +1 @@
+# Osdag_UI
\ No newline at end of file
diff --git a/src/osbridgelcca/desktop_app/ui/Warning_Window.py b/src/osbridgelcca/desktop_app/ui/Warning_Window.py
new file mode 100644
index 0000000..a28fc1b
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/Warning_Window.py
@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'C:\Users\saans\AppData\Local\Programs\Python\Python310\Lib\site-packages\qt5_applications\Qt\bin\Warning_Window.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again. Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_Warning_Dialog(object):
+ def setupUi(self, Warning_Dialog):
+ Warning_Dialog.setObjectName("Warning_Dialog")
+ Warning_Dialog.resize(394, 151)
+ self.buttonBox = QtWidgets.QDialogButtonBox(Warning_Dialog)
+ self.buttonBox.setGeometry(QtCore.QRect(30, 100, 341, 32))
+ self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
+ self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Discard|QtWidgets.QDialogButtonBox.Save)
+ self.buttonBox.setObjectName("buttonBox")
+ self.label = QtWidgets.QLabel(Warning_Dialog)
+ self.label.setGeometry(QtCore.QRect(20, 10, 301, 61))
+ font = QtGui.QFont()
+ font.setPointSize(14)
+ self.label.setFont(font)
+ self.label.setObjectName("label")
+
+ self.retranslateUi(Warning_Dialog)
+ self.buttonBox.accepted.connect(Warning_Dialog.accept) # type: ignore
+ self.buttonBox.rejected.connect(Warning_Dialog.reject) # type: ignore
+ QtCore.QMetaObject.connectSlotsByName(Warning_Dialog)
+
+ def retranslateUi(self, Warning_Dialog):
+ _translate = QtCore.QCoreApplication.translate
+ Warning_Dialog.setWindowTitle(_translate("Warning_Dialog", "Dialog"))
+ self.label.setText(_translate("Warning_Dialog", "Are sure to exit without saving?"))
+
+
+if __name__ == "__main__":
+ import sys
+ app = QtWidgets.QApplication(sys.argv)
+ Warning_Dialog = QtWidgets.QDialog()
+ ui = Ui_Warning_Dialog()
+ ui.setupUi(Warning_Dialog)
+ Warning_Dialog.show()
+ sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/form_data_storage.py b/src/osbridgelcca/desktop_app/ui/form_data_storage.py
new file mode 100644
index 0000000..5312e38
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/form_data_storage.py
@@ -0,0 +1,24 @@
+# Global dictionary to store form data
+form_data = {}
+
+def save_form_data(window_name, data):
+ """
+ Save form data to the global dictionary.
+
+ Args:
+ window_name (str): The name of the window/dialog.
+ data (dict): The data to save.
+ """
+ form_data[window_name] = data
+
+def get_form_data(window_name):
+ """
+ Retrieve form data for a specific window.
+
+ Args:
+ window_name (str): The name of the window/dialog.
+
+ Returns:
+ dict: The saved data for the window, or an empty dictionary if not found.
+ """
+ return form_data.get(window_name, {})
\ No newline at end of file
diff --git a/src/osbridgelcca/desktop_app/ui/something.py b/src/osbridgelcca/desktop_app/ui/something.py
new file mode 100644
index 0000000..e1fc216
--- /dev/null
+++ b/src/osbridgelcca/desktop_app/ui/something.py
@@ -0,0 +1,4 @@
+from form_data_storage import get_form_data
+
+foundation_data = get_form_data("Miscellaneous_Dialog")
+print(foundation_data)
\ No newline at end of file
From c83da016d0d52178450d06b960e158a1a530bd67 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 16 Jun 2025 13:20:05 +0530
Subject: [PATCH 02/14] 16-05 Changes to Cost component and addition of cost
defaults file
---
src/osbridgelcca/core/cost_component.py | 295 ++++++++++++++++--
src/osbridgelcca/core/cost_defaults.py | 94 ++++++
src/osbridgelcca/core/ui-test.py | 141 ---------
.../ui/ProjectDetails_Foundation_Window.py | 46 ++-
4 files changed, 400 insertions(+), 176 deletions(-)
create mode 100644 src/osbridgelcca/core/cost_defaults.py
delete mode 100644 src/osbridgelcca/core/ui-test.py
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 1c7cc83..d811d19 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -1,4 +1,24 @@
from abc import ABC, abstractmethod
+from .cost_defaults import (
+ get_carbon_emission_factor,
+ get_social_cost_of_carbon,
+ get_coefficient_carbon_emissions_concrete,
+ get_carbon_emission_factor_per_km,
+ get_coefficient_embodied_energy_hysd_steel,
+ get_coefficient_carbon_emissions_structural_steel,
+ get_periodic_maintenance_cost_rate, # eg (default)
+ get_annual_routine_inspection_cost_rate, # eg (default)
+ get_repair_and_rehabilitation_cost_rate, # eg (default)
+ get_periodic_maintenance_frequency_years,
+ get_routine_inspection_frequency_years,
+ get_demolition_cost_rate,
+ get_scrap_value_structural_steel,
+ get_structural_steel_scrap_rate
+)
+from .material_types_consts import (
+ get_material_cost_template, get_materials, get_grades, get_units,
+ is_valid_material, is_valid_grade, is_valid_unit
+)
class CostComponent(ABC):
"""Abstract Base Class for different cost components in Life Cycle Cost Analysis."""
@@ -42,7 +62,8 @@ class InitialCarbonEmissionCost(CostComponent):
"""Calculates initial carbon emissions from material production and transport."""
def __init__(self, material_quantity, carbon_emission_factor, carbon_cost):
- super().__init__(amount=(material_quantity * carbon_emission_factor) * carbon_cost, category="Environmental", is_initial=True, is_recurring=False, present_worth_factor=1.00)
+ amount = (material_quantity * carbon_emission_factor) * carbon_cost
+ super().__init__(amount=amount, category="Environmental", is_initial=True, is_recurring=False, present_worth_factor=1.00)
self.material_quantity = material_quantity
self.carbon_emission_factor = carbon_emission_factor
self.carbon_cost = carbon_cost
@@ -99,7 +120,9 @@ def calculate_cost(self):
class PeriodicMaintenanceCost(CostComponent):
"""Includes expenses for routine maintenance activities."""
- def __init__(self, maintenance_cost_rate, construction_cost, discount_rate, period, design_life):
+ def __init__(self, maintenance_cost_rate, construction_cost, discount_rate=0, period=None, design_life=1):
+ if period is None:
+ period = get_periodic_maintenance_frequency_years()
pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
cost = maintenance_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -116,7 +139,7 @@ def calculate_cost(self):
class PeriodicMaintenanceCarbonCost(CostComponent):
"""Calculates emissions from maintenance activities."""
- def __init__(self, material_quantity, carbon_emission_factor, carbon_cost, discount_rate, period, design_life):
+ def __init__(self, material_quantity, carbon_emission_factor, carbon_cost, discount_rate=0.0, period=1, design_life=1):
pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
cost = material_quantity * carbon_emission_factor * carbon_cost * pwf
super().__init__(amount=cost, category="Environmental", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -131,12 +154,17 @@ def calculate_cost(self):
class RoutineInspectionCost(CostComponent):
"""Annual cost of inspections for structural integrity."""
- def __init__(self, quantity, rate, discount_rate, design_life):
- pwf = sum(1 / ((1 + discount_rate) ** i) for i in range(1, design_life + 1))
+ def __init__(self, quantity, rate, discount_rate=0, design_life=1, period=None):
+ if period is None:
+ period = get_routine_inspection_frequency_years()
+ pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
cost = quantity * rate * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
self.quantity = quantity
self.rate = rate
+ self.period = period
+ self.discount_rate = discount_rate
+ self.design_life = design_life
def calculate_cost(self):
return self.quantity * self.rate * self.present_worth_factor
@@ -145,7 +173,9 @@ def calculate_cost(self):
class RepairAndRehabilitationCost(CostComponent):
"""Covers major structural repairs and retrofitting."""
- def __init__(self, repair_cost_rate, construction_cost, discount_rate, period, design_life):
+ def __init__(self, repair_cost_rate, construction_cost=0, discount_rate=0, period=None, design_life=1):
+ if period is None:
+ period = get_periodic_maintenance_frequency_years()
pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
cost = repair_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -154,37 +184,264 @@ def calculate_cost(self):
return self.amount
-class ReconstructionCost(CostComponent):
- """Accounts for partial or complete reconstruction of the bridge due to structural failures or obsolescence."""
+class DemolitionCost(CostComponent):
+ """Costs incurred at the end of bridge life for demolition and disposal."""
- def __init__(self, demolition_cost, reconstruction_cost, reconstruction_carbon_cost, reconstruction_time_cost, reconstruction_roaduser_cost, reconstruction_rerouting_carbon_cost, design_life, discount_rate):
+ def __init__(self, demolition_rate, construction_cost=0, discount_rate=0, design_life=1):
pwf = 1 / ((1 + discount_rate) ** design_life)
- cost = (demolition_cost + reconstruction_cost + reconstruction_carbon_cost + reconstruction_time_cost + reconstruction_roaduser_cost + reconstruction_rerouting_carbon_cost) * pwf
+ cost = demolition_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
+ self.demolition_rate = demolition_rate
+ self.construction_cost = construction_cost
+ self.discount_rate = discount_rate
+ self.design_life = design_life
def calculate_cost(self):
return self.amount
-class DemolitionCost(CostComponent):
- """Costs incurred at the end of bridge life for demolition and disposal."""
+class RecyclingCost(CostComponent):
+ """Accounts for material salvage and repurposing costs."""
- def __init__(self, demolition_rate, construction_cost, discount_rate, design_life):
+ def __init__(self, scrap_value, quantity=0, scrap_rate=None, discount_rate=0, design_life=1):
+ if scrap_rate is None:
+ scrap_rate = get_structural_steel_scrap_rate()
pwf = 1 / ((1 + discount_rate) ** design_life)
- cost = demolition_rate * construction_cost * pwf
+ cost = scrap_value * quantity * scrap_rate * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
+ self.scrap_value = scrap_value
+ self.quantity = quantity
+ self.scrap_rate = scrap_rate
+ self.discount_rate = discount_rate
+ self.design_life = design_life
def calculate_cost(self):
return self.amount
-class RecyclingCost(CostComponent):
- """Accounts for material salvage and repurposing costs."""
+class ReconstructionCost(CostComponent):
+ """Accounts for partial or complete reconstruction of the bridge due to structural failures or obsolescence."""
- def __init__(self, scrap_value, quantity, discount_rate, design_life):
+ def __init__(self, demolition_cost, reconstruction_cost, reconstruction_carbon_cost, reconstruction_time_cost, reconstruction_roaduser_cost, reconstruction_rerouting_carbon_cost, design_life, discount_rate):
pwf = 1 / ((1 + discount_rate) ** design_life)
- cost = scrap_value * quantity * pwf
+ cost = (demolition_cost + reconstruction_cost + reconstruction_carbon_cost + reconstruction_time_cost + reconstruction_roaduser_cost + reconstruction_rerouting_carbon_cost) * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
def calculate_cost(self):
- return self.amount
\ No newline at end of file
+ return self.amount
+
+
+#COST CALULATIONS
+
+# For Initial Construction Cost Calculation
+
+
+if __name__ == "__main__":
+ from .cost_defaults import get_annual_routine_inspection_cost_rate
+
+ material_costs = get_material_cost_template()
+
+ # user inputs will be here, for eg:
+ user_materials = [
+ {"material": "concrete", "grade": "M25", "unit": "cum", "quantity": 100, "rate": 600}, # eg (quantity: cum, rate: INR/cum)
+ {"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 10, "rate": 50000}, # eg (quantity: MT, rate: INR/MT)
+ {"material": "mastic asphalt", "grade": "default", "unit": "sqm", "quantity": 200, "rate": 300}, # eg (quantity: sqm, rate: INR/sqm)
+
+ ]
+
+ # 1. Initial Construction Cost Calculation
+ total_initial_construction_cost = 0
+ for item in user_materials:
+ component = InitialConstructionCost(
+ quantity=item["quantity"],
+ rate=item["rate"]
+ )
+ total_initial_construction_cost += component.calculate_cost()
+ print("Total Initial Construction Cost:", total_initial_construction_cost) # INR
+
+ # 2. Initial Carbon Emission Cost Calculation (Concrete + Steel)
+ total_concrete_kg = 0
+ for item in user_materials:
+ if item["material"] == "concrete":
+ qty = item["quantity"]
+ unit = item["unit"].lower()
+ if unit == "cum":
+ qty = qty * 2549.25 # eg (density: kg/cum)
+ # If already in kg, use as is
+ total_concrete_kg += qty
+ concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)") # eg (default, kgCO2e/kg)
+ total_steel_kg = 0
+ for item in user_materials:
+ if item["material"] == "steel":
+ qty = item["quantity"]
+ unit = item["unit"].lower()
+ if unit == "mt":
+ qty = qty * 1000 # eg (1 MT = 1000 kg)
+ # If already in kg, use as is
+ total_steel_kg += qty
+ steel_emission_factor = get_carbon_emission_factor("Rebar") # eg (default, kgCO2e/kg)
+ carbon_cost = get_social_cost_of_carbon() # eg (default, INR/kg)
+ total_carbon_emission_cost = (
+ (total_concrete_kg * concrete_emission_factor) + (total_steel_kg * steel_emission_factor)
+ ) * carbon_cost
+ print("Total Initial Carbon Emission Cost:", total_carbon_emission_cost) # INR
+
+ # 3. Time Cost Calculation
+ interest_rate = 0.08 # eg (fraction)
+ time = 2 # eg (years)
+ investment_ratio = 0.5 # eg (fraction)
+ time_cost_component = TimeCost(
+ construction_cost=total_initial_construction_cost,
+ interest_rate=interest_rate,
+ time=time,
+ investment_ratio=investment_ratio
+ )
+ print("Time Cost:", time_cost_component.calculate_cost()) # INR
+
+ # 4. Road User Cost Calculation
+ vehicles_affected = 10000 # eg (number)
+ vehicle_operation_cost = 15 # eg (INR/vehicle/day)
+ construction_time_days = time * 365 # eg (days)
+ road_user_cost_component = RoadUserCost(
+ vehicles_affected=vehicles_affected,
+ vehicle_operation_cost=vehicle_operation_cost,
+ construction_time=construction_time_days
+ )
+ print("Road User Cost:", road_user_cost_component.calculate_cost()) # INR
+
+ # 5. Additional Carbon Emission Cost Calculation
+ reroute_distance = 5 # eg (km)
+ co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
+ additional_carbon_emission_component = AdditionalCarbonEmissionCost(
+ vehicles_affected=vehicles_affected,
+ reroute_distance=reroute_distance,
+ co2_emission_per_km=co2_emission_per_km,
+ carbon_cost=carbon_cost
+ )
+ print("Additional Carbon Emission Cost:", additional_carbon_emission_component.calculate_cost()) # INR
+
+ # 6. Periodic Maintenance Cost Calculation
+ maintenance_cost_rate = get_periodic_maintenance_cost_rate() # eg (default, fraction)
+ period = get_periodic_maintenance_frequency_years() # eg (default, years)
+ discount_rate = 0.05 # eg (fraction)
+ design_life = 50 # eg (years)
+ periodic_maintenance_component = PeriodicMaintenanceCost(
+ maintenance_cost_rate=maintenance_cost_rate,
+ construction_cost=total_initial_construction_cost,
+ discount_rate=discount_rate,
+ period=period,
+ design_life=design_life
+ )
+ print("Periodic Maintenance Cost:", periodic_maintenance_component.calculate_cost()) # INR
+
+ # 7. Periodic Maintenance Carbon Emission Cost Calculation
+ maintenance_concrete_kg = total_concrete_kg
+ maintenance_steel_kg = total_steel_kg
+ maintenance_concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)") # eg (default, kgCO2e/kg)
+ maintenance_steel_emission_factor = get_carbon_emission_factor("Rebar") # eg (default, kgCO2e/kg)
+ maintenance_carbon_cost = get_social_cost_of_carbon() # eg (default, INR/kg)
+ maintenance_discount_rate = 0.05 # eg (fraction)
+ maintenance_period = get_periodic_maintenance_frequency_years() # eg (default, years)
+ maintenance_design_life = 50 # eg (years)
+ pwf = sum(1 / ((1 + maintenance_discount_rate) ** (i * maintenance_period)) for i in range(1, int(maintenance_design_life / maintenance_period) + 1))
+ periodic_maintenance_carbon_cost = (
+ (maintenance_concrete_kg * maintenance_concrete_emission_factor) +
+ (maintenance_steel_kg * maintenance_steel_emission_factor)
+ ) * maintenance_carbon_cost * pwf
+ print("Periodic Maintenance Carbon Emission Cost:", periodic_maintenance_carbon_cost) # INR
+
+ # 8. Annual Routine Inspection Cost Calculation
+ inspection_rate = get_annual_routine_inspection_cost_rate() # eg (default, fraction)
+ inspection_discount_rate = 0.05 # eg (fraction)
+ inspection_design_life = 50 # eg (years)
+ inspection_period = 1 # eg (annual)
+ total_routine_inspection_cost = 0
+ for item in user_materials:
+ inspection_component = RoutineInspectionCost(
+ quantity=item["quantity"],
+ rate=inspection_rate,
+ discount_rate=inspection_discount_rate,
+ design_life=inspection_design_life,
+ period=inspection_period
+ )
+ cost = inspection_component.calculate_cost()
+ total_routine_inspection_cost += cost
+ print("Total Routine Inspection Cost:", total_routine_inspection_cost) # INR
+
+ # 9. Repair and Rehabilitation Cost Calculation
+ repair_cost_rate = get_repair_and_rehabilitation_cost_rate() # eg (default, fraction)
+ repair_period = get_periodic_maintenance_frequency_years() # eg (default, years)
+ repair_component = RepairAndRehabilitationCost(
+ repair_cost_rate=repair_cost_rate,
+ construction_cost=total_initial_construction_cost,
+ discount_rate=discount_rate,
+ period=repair_period,
+ design_life=design_life
+ )
+ print("Repair and Rehabilitation Cost:", repair_component.calculate_cost()) # INR
+
+ # 10. Demolition and Disposal Cost Calculation
+ demolition_rate = get_demolition_cost_rate() # eg (default, fraction)
+ demolition_discount_rate = 0.05 # eg (fraction)
+ demolition_design_life = 50 # eg (years)
+ demolition_component = DemolitionCost(
+ demolition_rate=demolition_rate,
+ construction_cost=total_initial_construction_cost,
+ discount_rate=demolition_discount_rate,
+ design_life=demolition_design_life
+ )
+ print("Demolition and Disposal Cost:", demolition_component.calculate_cost()) # INR
+
+ # 11. Recycling Cost Calculation
+ scrap_value = get_scrap_value_structural_steel() # eg (default, INR/MT)
+ scrap_rate = get_structural_steel_scrap_rate() # eg (default, fraction)
+ recycling_discount_rate = 0.05 # eg (fraction)
+ recycling_design_life = 50 # eg (years)
+ total_steel_quantity_kg = 0
+ for item in user_materials:
+ if item["material"] == "steel":
+ qty = item["quantity"]
+ unit = item["unit"].lower()
+ if unit == "mt":
+ qty = qty * 1000 # eg (1 MT = 1000 kg)
+ total_steel_quantity_kg += qty
+ recycling_component = RecyclingCost(
+ scrap_value=scrap_value,
+ quantity=total_steel_quantity_kg,
+ scrap_rate=scrap_rate,
+ discount_rate=recycling_discount_rate,
+ design_life=recycling_design_life
+ )
+ print("Recycling Cost:", recycling_component.calculate_cost()) # INR
+
+ # 12. Reconstruction Cost Calculation
+ demolition_cost = demolition_component.calculate_cost() # eg (INR, use previously calculated demolition cost)
+ reconstruction_cost = total_initial_construction_cost # eg (INR)
+ reconstruction_carbon_cost = total_carbon_emission_cost # eg (INR)
+ reconstruction_time_cost = time_cost_component.calculate_cost() # eg (INR)
+ reconstruction_roaduser_cost = road_user_cost_component.calculate_cost() # eg (INR)
+ reconstruction_rerouting_carbon_cost = additional_carbon_emission_component.calculate_cost() # eg (INR)
+ reconstruction_design_life = 50 # eg (years)
+ reconstruction_discount_rate = 0.05 # eg (fraction)
+ reconstruction_component = ReconstructionCost(
+ demolition_cost=demolition_cost,
+ reconstruction_cost=reconstruction_cost,
+ reconstruction_carbon_cost=reconstruction_carbon_cost,
+ reconstruction_time_cost=reconstruction_time_cost,
+ reconstruction_roaduser_cost=reconstruction_roaduser_cost,
+ reconstruction_rerouting_carbon_cost=reconstruction_rerouting_carbon_cost,
+ design_life=reconstruction_design_life,
+ discount_rate=reconstruction_discount_rate
+ )
+ print("Reconstruction Cost:", reconstruction_component.calculate_cost()) # INR
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/osbridgelcca/core/cost_defaults.py b/src/osbridgelcca/core/cost_defaults.py
new file mode 100644
index 0000000..1584643
--- /dev/null
+++ b/src/osbridgelcca/core/cost_defaults.py
@@ -0,0 +1,94 @@
+# cost_defaults.py
+"""
+Default constants for cost and environmental calculations in LCCA.
+"""
+
+# Carbon emission factors for common construction materials
+CARBON_EMISSION_FACTORS = {
+ "Structural Steel": 2.5,
+ "Rebar": 2.6,
+ "Concrete (M25)": 0.084,
+}
+
+def get_carbon_emission_factor(material_name):
+ """
+ Returns the carbon emission factor for a given material name.
+ :param material_name: str
+ :return: float or None if not found
+ """
+ return CARBON_EMISSION_FACTORS.get(material_name)
+
+# GHG Global Warming Potential (GWP) equivalency factors
+GHG_EQUIVALENCY_FACTORS = {
+ "Carbon Dioxide (CO2)": 1,
+ "Methane (CH4)": 25,
+ "Nitrogen Trifluoride (NF3)": 17200,
+}
+
+def get_ghg_equivalency_factor(ghg_name):
+ """
+ Returns the GWP equivalency factor for a given greenhouse gas name.
+ :param ghg_name: str
+ :return: int or None if not found
+ """
+ return GHG_EQUIVALENCY_FACTORS.get(ghg_name)
+
+# Environmental and economic coefficients
+COEFFICIENT_CARBON_EMISSIONS_CONCRETE = 0.0840 # kgCO2e/kg
+CARBON_EMISSION_FACTOR_PER_KM = 0.1213 # kgCO2e/km
+SOCIAL_COST_OF_CARBON = 6.3936 # INR/kg
+COEFFICIENT_EMBODIED_ENERGY_HYSD_STEEL = 30 # MJ/kg
+COEFFICIENT_CARBON_EMISSIONS_STRUCTURAL_STEEL = 2.6000 # kgCO2e/kg
+
+def get_coefficient_carbon_emissions_concrete():
+ return COEFFICIENT_CARBON_EMISSIONS_CONCRETE
+
+def get_carbon_emission_factor_per_km():
+ return CARBON_EMISSION_FACTOR_PER_KM
+
+def get_social_cost_of_carbon():
+ return SOCIAL_COST_OF_CARBON
+
+def get_coefficient_embodied_energy_hysd_steel():
+ return COEFFICIENT_EMBODIED_ENERGY_HYSD_STEEL
+
+def get_coefficient_carbon_emissions_structural_steel():
+ return COEFFICIENT_CARBON_EMISSIONS_STRUCTURAL_STEEL
+
+# Maintenance, inspection, and repair cost rates and frequencies
+
+PERIODIC_MAINTENANCE_COST_RATE = 0.0055 # 0.55% as a decimal
+ANNUAL_ROUTINE_INSPECTION_COST_RATE = 0.01 # 1% as a decimal
+REPAIR_AND_REHABILITATION_COST_RATE = 0.10 # 10% as a decimal
+PERIODIC_MAINTENANCE_FREQUENCY_YEARS = 5
+ROUTINE_INSPECTION_FREQUENCY_YEARS = 1
+
+def get_periodic_maintenance_cost_rate():
+ return PERIODIC_MAINTENANCE_COST_RATE
+
+def get_annual_routine_inspection_cost_rate():
+ return ANNUAL_ROUTINE_INSPECTION_COST_RATE
+
+def get_repair_and_rehabilitation_cost_rate():
+ return REPAIR_AND_REHABILITATION_COST_RATE
+
+def get_periodic_maintenance_frequency_years():
+ return PERIODIC_MAINTENANCE_FREQUENCY_YEARS
+
+def get_routine_inspection_frequency_years():
+ return ROUTINE_INSPECTION_FREQUENCY_YEARS
+
+# Demolition and recycling recommended values
+DEMOLITION_COST_RATE = 0.10 # 10% as a decimal
+SCRAP_VALUE_STRUCTURAL_STEEL = 50000 # INR/MT
+STRUCTURAL_STEEL_SCRAP_RATE = 0.98 # 98% as a decimal
+
+def get_demolition_cost_rate():
+ return DEMOLITION_COST_RATE
+
+def get_scrap_value_structural_steel():
+ return SCRAP_VALUE_STRUCTURAL_STEEL
+
+def get_structural_steel_scrap_rate():
+ return STRUCTURAL_STEEL_SCRAP_RATE
+
diff --git a/src/osbridgelcca/core/ui-test.py b/src/osbridgelcca/core/ui-test.py
deleted file mode 100644
index 421e5b2..0000000
--- a/src/osbridgelcca/core/ui-test.py
+++ /dev/null
@@ -1,141 +0,0 @@
-import sys
-import copy
-from PyQt5.QtWidgets import (
- QApplication, QWidget, QVBoxLayout, QHBoxLayout, QPushButton,
- QComboBox, QLineEdit, QLabel, QMessageBox, QScrollArea, QFrame
-)
-from osbridgelcca.core.material_types_consts import (
- MATERIAL_COSTS_TEMPLATE,
- get_materials, get_grades, get_units, set_material_cost
-)
-# Add import for saving user data
-from osbridgelcca.backend.api.routes.user_data import save_user_input
-
-print("Material Cost Editor UI Test")
-
-class MaterialRow(QWidget):
-
- def __init__(self, material_costs):
- super().__init__()
- self.material_costs = material_costs
-
- layout = QHBoxLayout()
-
- # Material dropdown
- self.material_cb = QComboBox()
- self.material_cb.addItems(get_materials(self.material_costs))
- self.material_cb.currentTextChanged.connect(self.update_grades)
- layout.addWidget(QLabel("Material:"))
- layout.addWidget(self.material_cb)
-
- # Grade dropdown
- self.grade_cb = QComboBox()
- layout.addWidget(QLabel("Grade:"))
- layout.addWidget(self.grade_cb)
-
- # Unit dropdown
- self.unit_cb = QComboBox()
- layout.addWidget(QLabel("Unit:"))
- layout.addWidget(self.unit_cb)
-
- # Cost input
- self.cost_input = QLineEdit()
- self.cost_input.setPlaceholderText("Enter cost")
- layout.addWidget(QLabel("Cost:"))
- layout.addWidget(self.cost_input)
-
- self.setLayout(layout)
-
- # Connect grade change signal only once
- self.grade_cb.currentTextChanged.connect(self.update_units)
-
- # Initialize grades and units for the first material
- initial_material = self.material_cb.currentText()
- self.update_grades(initial_material)
-
- def update_grades(self, material):
- self.grade_cb.clear()
- grades = get_grades(self.material_costs, material)
- self.grade_cb.addItems(grades)
- self.update_units()
-
- def update_units(self):
- material = self.material_cb.currentText()
- self.unit_cb.clear()
- units = get_units(self.material_costs, material)
- self.unit_cb.addItems(units)
-
-
-class MaterialCostApp(QWidget):
- def __init__(self):
- super().__init__()
- self.setWindowTitle("Material Cost Editor")
-
- self.material_costs = copy.deepcopy(MATERIAL_COSTS_TEMPLATE)
-
- self.layout = QVBoxLayout()
-
- # Container for rows with scrollbar
- self.scroll_area = QScrollArea()
- self.scroll_area.setWidgetResizable(True)
- self.rows_container = QFrame()
- self.rows_layout = QVBoxLayout()
- self.rows_container.setLayout(self.rows_layout)
- self.scroll_area.setWidget(self.rows_container)
-
- self.layout.addWidget(self.scroll_area)
-
- # Add buttons
- btn_layout = QHBoxLayout()
- self.add_material_btn = QPushButton("Add Material")
- self.add_material_btn.clicked.connect(self.add_material_row)
- btn_layout.addWidget(self.add_material_btn)
-
- self.save_btn = QPushButton("Save All")
- self.save_btn.clicked.connect(self.save_all)
- btn_layout.addWidget(self.save_btn)
-
- self.layout.addLayout(btn_layout)
-
- self.setLayout(self.layout)
-
- # Add initial row
- self.add_material_row()
-
- def add_material_row(self):
- row = MaterialRow(self.material_costs)
- self.rows_layout.addWidget(row)
-
- def save_all(self):
- # Iterate over each row and save costs
- for i in range(self.rows_layout.count()):
- row = self.rows_layout.itemAt(i).widget()
- material = row.material_cb.currentText()
- grade = row.grade_cb.currentText()
- unit = row.unit_cb.currentText()
- cost_text = row.cost_input.text()
-
- try:
- cost = float(cost_text)
- except ValueError:
- QMessageBox.warning(self, "Invalid input",
- f"Invalid cost value in row {i+1}: '{cost_text}'")
- return
-
- set_material_cost(self.material_costs, material, grade, unit, cost)
-
- # Save to file
- save_user_input(self.material_costs)
-
- QMessageBox.information(self, "Success", "All costs saved successfully!")
-
- # For demo, print the updated costs
- print(self.material_costs)
-
-
-if __name__ == "__main__":
- app = QApplication(sys.argv)
- window = MaterialCostApp()
- window.resize(900, 400)
- window.show()
- sys.exit(app.exec_())
diff --git a/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
index f17f02b..dffcf3b 100644
--- a/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
+++ b/src/osbridgelcca/desktop_app/ui/ProjectDetails_Foundation_Window.py
@@ -9,8 +9,9 @@
from PyQt5 import QtCore, QtGui, QtWidgets
-from form_data_storage import save_form_data
+from .form_data_storage import save_form_data
from PyQt5.QtWidgets import QMessageBox
+from ...core import material_types_consts # Fixed relative import
class Ui_Foundation_Dialog(object):
def setupUi(self, Foundation_Dialog):
@@ -249,6 +250,9 @@ def setupUi(self, Foundation_Dialog):
self.comboBox_2.setGeometry(QtCore.QRect(30, 100, 140, 22))
self.comboBox_2.setStyleSheet("background-color: #ffffff")
self.comboBox_2.setObjectName("comboBox_2")
+ # Populate Type of Material dropdown with materials from material_types_consts
+ self.material_costs = material_types_consts.get_material_cost_template()
+ self.comboBox_2.addItems(material_types_consts.get_materials(self.material_costs))
self.comboBox_3 = QtWidgets.QComboBox(self.widget_2)
self.comboBox_3.setGeometry(QtCore.QRect(30, 130, 140, 22))
self.comboBox_3.setStyleSheet("background-color: #ffffff")
@@ -266,15 +270,20 @@ def setupUi(self, Foundation_Dialog):
font.setPointSize(10)
self.lineEdit_2.setFont(font)
self.lineEdit_2.setStyleSheet("background-color: #ffffff")
- self.lineEdit_2.setObjectName("lineEdit_2")
- self.label_10 = QtWidgets.QLabel(self.widget_2)
- self.label_10.setGeometry(QtCore.QRect(340, 100, 51, 20))
- font = QtGui.QFont()
- font.setPointSize(10)
- self.label_10.setFont(font)
- self.label_10.setStyleSheet("background-color: #ffffff")
- self.label_10.setAlignment(QtCore.Qt.AlignCenter)
- self.label_10.setObjectName("label_10")
+ self.lineEdit_2.setObjectName("lineEdit_2") # Add Unit dropdown for first section (replace label_10)
+ self.unitComboBox = QtWidgets.QComboBox(self.widget_2)
+ self.unitComboBox.setGeometry(QtCore.QRect(340, 100, 80, 22))
+ self.unitComboBox.setStyleSheet("background-color: #ffffff")
+ self.unitComboBox.setObjectName("unitComboBox")
+ # Populate with units for the initial material
+ initial_material = self.comboBox_2.currentText()
+ self.unitComboBox.addItems(material_types_consts.get_units(self.material_costs, initial_material))
+ # Update units when comboBox_2 changes
+ self.comboBox_2.currentIndexChanged.connect(self._update_unit_dropdown)
+ # Remove label_10 (unit QLabel for first section) if it exists
+ if hasattr(self, 'label_10') and self.label_10 is not None:
+ self.label_10.deleteLater()
+ self.label_10 = None
self.label_11 = QtWidgets.QLabel(self.widget_2)
self.label_11.setGeometry(QtCore.QRect(340, 130, 51, 20))
font = QtGui.QFont()
@@ -514,12 +523,17 @@ def save_data(self):
"component": self.comboBox.currentText(),
"sub_component": self.comboBox_2.currentText(),
"quantity": self.lineEdit.text(),
- "unit": self.label_10.text(),
+ "unit": self.unitComboBox.currentText(),
"rate": self.lineEdit_3.text(),
"material_type": self.comboBox_4.currentText(),
}
save_form_data("Foundation_Dialog", data)
+ def _update_unit_dropdown(self):
+ material = self.comboBox_2.currentText()
+ self.unitComboBox.clear()
+ self.unitComboBox.addItems(material_types_consts.get_units(self.material_costs, material))
+
def retranslateUi(self, Foundation_Dialog):
_translate = QtCore.QCoreApplication.translate
Foundation_Dialog.setWindowTitle(_translate("Foundation_Dialog", "Dialog"))
@@ -540,7 +554,7 @@ def retranslateUi(self, Foundation_Dialog):
self.textBrowser.setHtml(_translate("Foundation_Dialog", "\n"
"\n"
+"\n"
"Initial Construction Cost
\n"
"Initial Carbon emission Cost
\n"
"Time Cost
\n"
@@ -564,13 +578,13 @@ def retranslateUi(self, Foundation_Dialog):
self.label_7.setText(_translate("Foundation_Dialog", "Quantity"))
self.label_8.setText(_translate("Foundation_Dialog", "Unit"))
self.label_9.setText(_translate("Foundation_Dialog", "Rate"))
- self.label_10.setText(_translate("Foundation_Dialog", "m3
"))
+ # self.label_10.setText(_translate("Foundation_Dialog", "m3
"))
self.label_11.setText(_translate("Foundation_Dialog", "kg"))
self.pushButton_3.setText(_translate("Foundation_Dialog", "+ Add Material"))
self.label_12.setText(_translate("Foundation_Dialog", "Type of Material"))
- self.comboBox_4.setItemText(0, _translate("Foundation_Dialog", "Earthwork"))
- self.comboBox_4.addItem(_translate("Foundation_Dialog", "Foundations"))
- self.comboBox_4.setItemText(1, _translate("Foundation_Dialog", "Foundation Protections"))
+ self.comboBox_4.setItemText(0, _translate("Foundation_Dialog", "Foundations"))
+ self.comboBox_4.setItemText(1, _translate("Foundation_Dialog", "Foundation Protection"))
+ self.comboBox_4.addItem(_translate("Foundation_Dialog", "Excavation"))
self.label_13.setText(_translate("Foundation_Dialog", "Rate"))
self.label_14.setText(_translate("Foundation_Dialog", "kg"))
self.label_15.setText(_translate("Foundation_Dialog", "Rate Data Source"))
From cbc1598c0609c654cf44b9f6a612cc64eeb582f9 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 16 Jun 2025 13:21:23 +0530
Subject: [PATCH 03/14] Cost compnents new values
---
src/osbridgelcca/core/cost_component.py | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index d811d19..c0d5899 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -243,10 +243,9 @@ def calculate_cost(self):
# user inputs will be here, for eg:
user_materials = [
- {"material": "concrete", "grade": "M25", "unit": "cum", "quantity": 100, "rate": 600}, # eg (quantity: cum, rate: INR/cum)
- {"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 10, "rate": 50000}, # eg (quantity: MT, rate: INR/MT)
- {"material": "mastic asphalt", "grade": "default", "unit": "sqm", "quantity": 200, "rate": 300}, # eg (quantity: sqm, rate: INR/sqm)
-
+ {"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994}, # eg (quantity: cum, rate: INR/cum)
+ {"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565}, # eg (quantity: MT, rate: INR/MT)
+ {"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100}, # eg (quantity: sqm, rate: INR/sqm)
]
# 1. Initial Construction Cost Calculation
@@ -287,8 +286,8 @@ def calculate_cost(self):
print("Total Initial Carbon Emission Cost:", total_carbon_emission_cost) # INR
# 3. Time Cost Calculation
- interest_rate = 0.08 # eg (fraction)
- time = 2 # eg (years)
+ interest_rate = 0.1 # eg (fraction)
+ time = 0.75 # eg (years)
investment_ratio = 0.5 # eg (fraction)
time_cost_component = TimeCost(
construction_cost=total_initial_construction_cost,
@@ -299,8 +298,8 @@ def calculate_cost(self):
print("Time Cost:", time_cost_component.calculate_cost()) # INR
# 4. Road User Cost Calculation
- vehicles_affected = 10000 # eg (number)
- vehicle_operation_cost = 15 # eg (INR/vehicle/day)
+ vehicles_affected = 1500 # eg (number)
+ vehicle_operation_cost = 6.62 # eg (INR/vehicle/day)
construction_time_days = time * 365 # eg (days)
road_user_cost_component = RoadUserCost(
vehicles_affected=vehicles_affected,
@@ -310,7 +309,7 @@ def calculate_cost(self):
print("Road User Cost:", road_user_cost_component.calculate_cost()) # INR
# 5. Additional Carbon Emission Cost Calculation
- reroute_distance = 5 # eg (km)
+ reroute_distance = 2 # eg (km)
co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
additional_carbon_emission_component = AdditionalCarbonEmissionCost(
vehicles_affected=vehicles_affected,
From 9b8f1469f411f4a09094a2dc04a8ee347cd38b00 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 16 Jun 2025 13:29:06 +0530
Subject: [PATCH 04/14] removal of ui test
---
src/osbridgelcca/core/ui-test.py | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 src/osbridgelcca/core/ui-test.py
diff --git a/src/osbridgelcca/core/ui-test.py b/src/osbridgelcca/core/ui-test.py
new file mode 100644
index 0000000..e69de29
From e1bd215fc37229735ee337edb364bdefa0ebb261 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 16 Jun 2025 15:03:54 +0530
Subject: [PATCH 05/14] new 1
---
src/osbridgelcca/core/cost_component.py | 67 +++++++++++++------
src/osbridgelcca/core/cost_defaults.py | 36 ++++++++++
.../core/material_types_consts.py | 19 ++++++
3 files changed, 102 insertions(+), 20 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index c0d5899..1cb51aa 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -245,7 +245,7 @@ def calculate_cost(self):
user_materials = [
{"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994}, # eg (quantity: cum, rate: INR/cum)
{"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565}, # eg (quantity: MT, rate: INR/MT)
- {"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100}, # eg (quantity: sqm, rate: INR/sqm)
+ {"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100}, # eg (quantity: MT, rate: INR/MT)
]
# 1. Initial Construction Cost Calculation
@@ -273,8 +273,8 @@ def calculate_cost(self):
for item in user_materials:
if item["material"] == "steel":
qty = item["quantity"]
- unit = item["unit"].lower()
- if unit == "mt":
+ unit = item["unit"].upper()
+ if unit == "MT":
qty = qty * 1000 # eg (1 MT = 1000 kg)
# If already in kg, use as is
total_steel_kg += qty
@@ -298,21 +298,45 @@ def calculate_cost(self):
print("Time Cost:", time_cost_component.calculate_cost()) # INR
# 4. Road User Cost Calculation
- vehicles_affected = 1500 # eg (number)
- vehicle_operation_cost = 6.62 # eg (INR/vehicle/day)
+ # User defines vehicle types, lane type, roughness, and RF
+ from osbridgelcca.core.cost_defaults import get_vehicle_types, get_lane_types, get_roughness_values, get_rf_values
+
+ # Example user input (can be replaced by actual UI/db input)
+ user_vehicle_data = [
+ {"type": "Small Car", "count": 500, "operation_cost": 5.5},
+ {"type": "Bus", "count": 100, "operation_cost": 15.0},
+ # ... add more as needed
+ ]
+ lane_type = "Two Lane" # user input
+ roughness = 3000 # user input
+ rf = 10 # user input
+
+ # If user does not define vehicle types, default to Big Car
+ if not user_vehicle_data:
+ user_vehicle_data = [{"type": "Big Car", "count": 1, "operation_cost": 6.62}]
+
+ # Sum total road user cost for all vehicle types
+ total_road_user_cost = 0
+ total_vehicles_affected = 0
+ for v in user_vehicle_data:
+ total_road_user_cost += v["count"] * v["operation_cost"]
+ total_vehicles_affected += v["count"]
+
construction_time_days = time * 365 # eg (days)
+ total_road_user_cost *= construction_time_days
+
road_user_cost_component = RoadUserCost(
- vehicles_affected=vehicles_affected,
- vehicle_operation_cost=vehicle_operation_cost,
+ vehicles_affected=total_vehicles_affected, # user-defined count
+ vehicle_operation_cost=total_road_user_cost / construction_time_days if construction_time_days else 0,
construction_time=construction_time_days
)
- print("Road User Cost:", road_user_cost_component.calculate_cost()) # INR
+ print("Road User Cost (all vehicle types):", road_user_cost_component.calculate_cost()) # INR
# 5. Additional Carbon Emission Cost Calculation
reroute_distance = 2 # eg (km)
co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
additional_carbon_emission_component = AdditionalCarbonEmissionCost(
- vehicles_affected=vehicles_affected,
+ vehicles_affected=total_vehicles_affected,
reroute_distance=reroute_distance,
co2_emission_per_km=co2_emission_per_km,
carbon_cost=carbon_cost
@@ -396,22 +420,25 @@ def calculate_cost(self):
scrap_rate = get_structural_steel_scrap_rate() # eg (default, fraction)
recycling_discount_rate = 0.05 # eg (fraction)
recycling_design_life = 50 # eg (years)
- total_steel_quantity_kg = 0
- for item in user_materials:
- if item["material"] == "steel":
- qty = item["quantity"]
- unit = item["unit"].lower()
- if unit == "mt":
- qty = qty * 1000 # eg (1 MT = 1000 kg)
- total_steel_quantity_kg += qty
+
+ # For demonstration, assuming user provides both quantity and unit
+ user_input_steel_quantity = 15 # eg (user input, 15 MT)
+ user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
+
+ # Convert all user input to kg
+ if user_input_steel_unit.upper() == "MT":
+ user_input_steel_quantity_kg = user_input_steel_quantity * 1000 # 1 MT = 1000 kg
+ else:
+ user_input_steel_quantity_kg = user_input_steel_quantity # already in kg
+
recycling_component = RecyclingCost(
scrap_value=scrap_value,
- quantity=total_steel_quantity_kg,
+ quantity=user_input_steel_quantity_kg,
scrap_rate=scrap_rate,
discount_rate=recycling_discount_rate,
design_life=recycling_design_life
)
- print("Recycling Cost:", recycling_component.calculate_cost()) # INR
+ print("Recycling Cost (user-input steel only):", recycling_component.calculate_cost()) # INR
# 12. Reconstruction Cost Calculation
demolition_cost = demolition_component.calculate_cost() # eg (INR, use previously calculated demolition cost)
@@ -436,7 +463,7 @@ def calculate_cost(self):
-
+
diff --git a/src/osbridgelcca/core/cost_defaults.py b/src/osbridgelcca/core/cost_defaults.py
index 1584643..57bc77b 100644
--- a/src/osbridgelcca/core/cost_defaults.py
+++ b/src/osbridgelcca/core/cost_defaults.py
@@ -92,3 +92,39 @@ def get_scrap_value_structural_steel():
def get_structural_steel_scrap_rate():
return STRUCTURAL_STEEL_SCRAP_RATE
+# Road User Cost Components
+VEHICLE_TYPES = [
+ "Small Car",
+ "Big Car",
+ "Two Wheeler",
+ "Bus",
+ "LCV",
+ "MCV",
+ "HCV"
+]
+
+LANE_TYPES = [
+ "Single Lane",
+ "Intermediate Lane",
+ "Two Lane",
+ "Three Lane",
+ "Four Lane"
+]
+
+ROUGHNESS_VALUES = [2000, 3000, 4000, 6000]
+
+RF_VALUES = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
+
+
+def get_vehicle_types():
+ return VEHICLE_TYPES
+
+def get_lane_types():
+ return LANE_TYPES
+
+def get_roughness_values():
+ return ROUGHNESS_VALUES
+
+def get_rf_values():
+ return RF_VALUES
+
diff --git a/src/osbridgelcca/core/material_types_consts.py b/src/osbridgelcca/core/material_types_consts.py
index 062a8c1..54cbe15 100644
--- a/src/osbridgelcca/core/material_types_consts.py
+++ b/src/osbridgelcca/core/material_types_consts.py
@@ -49,6 +49,25 @@
"default": {"sqm": 0.0}
}
},
+ "prestressing tendons": {
+ "units": ["MT", "kg"],
+ "grades": {
+ "E 165(Fe 290)": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)A": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410W)B": {"MT": 0.0, "kg": 0.0},
+ "E 250(Fe 410)C": {"MT": 0.0, "kg": 0.0},
+ "E 300(Fe 440)": {"MT": 0.0, "kg": 0.0},
+ "E 350(Fe 490)": {"MT": 0.0, "kg": 0.0},
+ "E 410(Fe 540)": {"MT": 0.0, "kg": 0.0},
+ "E 450(Fe 570)D": {"MT": 0.0, "kg": 0.0},
+ }
+ },
+ "other": {
+ "units": ["MT", "kg", "cum", "sqm", "ltr"], # All supported units
+ "grades": {
+ "default": {unit: 0.0 for unit in ["MT", "kg", "cum", "sqm", "ltr"]}
+ }
+ },
}
From 06ae133b86d031b0a1bb49ae53363d6c661e0945 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 16 Jun 2025 15:31:42 +0530
Subject: [PATCH 06/14] 12
---
src/osbridgelcca/core/cost_component.py | 2 +-
.../core/material_types_consts.py | 37 +++++++++++++++++++
2 files changed, 38 insertions(+), 1 deletion(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 1cb51aa..149fab9 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -299,7 +299,7 @@ def calculate_cost(self):
# 4. Road User Cost Calculation
# User defines vehicle types, lane type, roughness, and RF
- from osbridgelcca.core.cost_defaults import get_vehicle_types, get_lane_types, get_roughness_values, get_rf_values
+ from osbridgelcca.core.material_types_consts import get_vehicle_types, get_lane_types, get_roughness_values, get_rf_values
# Example user input (can be replaced by actual UI/db input)
user_vehicle_data = [
diff --git a/src/osbridgelcca/core/material_types_consts.py b/src/osbridgelcca/core/material_types_consts.py
index 54cbe15..ee7e56f 100644
--- a/src/osbridgelcca/core/material_types_consts.py
+++ b/src/osbridgelcca/core/material_types_consts.py
@@ -113,3 +113,40 @@ def get_all_material_unit_combinations(material_costs):
for unit in units:
combinations.append((material, grade, unit))
return combinations
+
+
+# Road User Cost Components
+VEHICLE_TYPES = [
+ "Small Car",
+ "Big Car",
+ "Two Wheeler",
+ "Bus",
+ "LCV",
+ "MCV",
+ "HCV"
+]
+
+LANE_TYPES = [
+ "Single Lane",
+ "Intermediate Lane",
+ "Two Lane",
+ "Three Lane",
+ "Four Lane"
+]
+
+ROUGHNESS_VALUES = [2000, 3000, 4000, 6000]
+
+RF_VALUES = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
+
+
+def get_vehicle_types():
+ return VEHICLE_TYPES
+
+def get_lane_types():
+ return LANE_TYPES
+
+def get_roughness_values():
+ return ROUGHNESS_VALUES
+
+def get_rf_values():
+ return RF_VALUES
From 4a60e9d8eafd3165968fd9ec08605e3d00c461a7 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Tue, 17 Jun 2025 13:14:11 +0530
Subject: [PATCH 07/14] remove of unwanter files like ui test etc
---
src/osbridgelcca/core/Material_test.py | 98 --------------------------
src/osbridgelcca/core/cost_defaults.py | 36 ----------
src/osbridgelcca/core/ui-test.py | 0
3 files changed, 134 deletions(-)
delete mode 100644 src/osbridgelcca/core/Material_test.py
delete mode 100644 src/osbridgelcca/core/ui-test.py
diff --git a/src/osbridgelcca/core/Material_test.py b/src/osbridgelcca/core/Material_test.py
deleted file mode 100644
index feb8a20..0000000
--- a/src/osbridgelcca/core/Material_test.py
+++ /dev/null
@@ -1,98 +0,0 @@
-#Material Test
-
-import copy
-
-# Base template for material costs
-MATERIAL_COSTS_TEMPLATE = {
- "concrete": {
- "units": ["cum", "kg"],
- "types": {
- "M15": {"cum": 0.0, "kg": 0.0},
- "M20": {"cum": 0.0, "kg": 0.0},
- "M25": {"cum": 0.0, "kg": 0.0},
- "M30": {"cum": 0.0, "kg": 0.0},
- "M35": {"cum": 0.0, "kg": 0.0},
- "M40": {"cum": 0.0, "kg": 0.0},
- "M45": {"cum": 0.0, "kg": 0.0},
- "M50": {"cum": 0.0, "kg": 0.0},
- }
- },
- "steel": {
- "units": ["MT", "kg"],
- "types": {
- "E 165(Fe 290)": {"MT": 0.0, "kg": 0.0},
- "E 250(Fe 410W)A": {"MT": 0.0, "kg": 0.0},
- "E 250(Fe 410W)B": {"MT": 0.0, "kg": 0.0},
- "E 250(Fe 410)C": {"MT": 0.0, "kg": 0.0},
- "E 300(Fe 440)": {"MT": 0.0, "kg": 0.0},
- "E 350(Fe 490)": {"MT": 0.0, "kg": 0.0},
- "E 410(Fe 540)": {"MT": 0.0, "kg": 0.0},
- "E 450(Fe 570)D": {"MT": 0.0, "kg": 0.0},
- }
- },
- "mastic asphalt": {
- "units": ["sqm"],
- "types": {
- "default": {"sqm": 0.0}
- }
- },
- "paint": {
- "units": ["ltr"],
- "types": {
- "white/yellow": {"ltr": 0.0},
- "primer_epoxy": {"ltr": 0.0},
- "oil": {"ltr": 0.0},
- "alluminium": {"ltr": 0.0}
- }
- },
- "paver blocks": {
- "units": ["sqm"],
- "types": {
- "default": {"sqm": 0.0}
- }
- },
-}
-
-
-def get_material_cost_template():
- return copy.deepcopy(MATERIAL_COSTS_TEMPLATE)
-
-# Basic accessors
-def get_materials(material_costs):
- return list(material_costs.keys())
-
-def get_submaterials(material_costs, material):
- return list(material_costs.get(material, {}).get("types", {}).keys())
-
-def get_units(material_costs, material):
- return material_costs.get(material, {}).get("units", [])
-
-def get_material_cost(material_costs, material, submaterial, unit):
- return material_costs.get(material, {}).get("types", {}).get(submaterial, {}).get(unit, None)
-
-# Safe setter: returns True on success, False if invalid keys
-def set_material_cost(material_costs, material, submaterial, unit, cost):
- types = material_costs.get(material, {}).get("types", {})
- if submaterial in types and unit in types[submaterial]:
- types[submaterial][unit] = cost
- return True
- return False
-
-# Validation helpers (good for UI input validation)
-def is_valid_material(material_costs, material):
- return material in material_costs
-
-def is_valid_submaterial(material_costs, material, submaterial):
- return submaterial in material_costs.get(material, {}).get("types", {})
-
-def is_valid_unit(material_costs, material, unit):
- return unit in material_costs.get(material, {}).get("units", [])
-
-# UI-friendly utility: returns all (material, submaterial, unit) combinations
-def get_all_material_unit_combinations(material_costs):
- combinations = []
- for material, data in material_costs.items():
- for sub, units in data.get("types", {}).items():
- for unit in units:
- combinations.append((material, sub, unit))
- return combinations
diff --git a/src/osbridgelcca/core/cost_defaults.py b/src/osbridgelcca/core/cost_defaults.py
index 57bc77b..1584643 100644
--- a/src/osbridgelcca/core/cost_defaults.py
+++ b/src/osbridgelcca/core/cost_defaults.py
@@ -92,39 +92,3 @@ def get_scrap_value_structural_steel():
def get_structural_steel_scrap_rate():
return STRUCTURAL_STEEL_SCRAP_RATE
-# Road User Cost Components
-VEHICLE_TYPES = [
- "Small Car",
- "Big Car",
- "Two Wheeler",
- "Bus",
- "LCV",
- "MCV",
- "HCV"
-]
-
-LANE_TYPES = [
- "Single Lane",
- "Intermediate Lane",
- "Two Lane",
- "Three Lane",
- "Four Lane"
-]
-
-ROUGHNESS_VALUES = [2000, 3000, 4000, 6000]
-
-RF_VALUES = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
-
-
-def get_vehicle_types():
- return VEHICLE_TYPES
-
-def get_lane_types():
- return LANE_TYPES
-
-def get_roughness_values():
- return ROUGHNESS_VALUES
-
-def get_rf_values():
- return RF_VALUES
-
diff --git a/src/osbridgelcca/core/ui-test.py b/src/osbridgelcca/core/ui-test.py
deleted file mode 100644
index e69de29..0000000
From 15cdd34cfd6ee1b07a0c6f1533eb6148abf084c5 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 13:17:20 +0530
Subject: [PATCH 08/14] Added the Road cost db file in the database folder and
connected it in cost_component
---
src/osbridgelcca/core/cost_component.py | 107 +++++++++++-------
.../core/material_types_consts.py | 24 ++--
2 files changed, 80 insertions(+), 51 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 149fab9..8a3eb9e 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -19,6 +19,9 @@
get_material_cost_template, get_materials, get_grades, get_units,
is_valid_material, is_valid_grade, is_valid_unit
)
+import os
+import sqlite3
+from typing import Optional
class CostComponent(ABC):
"""Abstract Base Class for different cost components in Life Cycle Cost Analysis."""
@@ -233,7 +236,6 @@ def calculate_cost(self):
#COST CALULATIONS
-# For Initial Construction Cost Calculation
if __name__ == "__main__":
@@ -298,46 +300,73 @@ def calculate_cost(self):
print("Time Cost:", time_cost_component.calculate_cost()) # INR
# 4. Road User Cost Calculation
- # User defines vehicle types, lane type, roughness, and RF
- from osbridgelcca.core.material_types_consts import get_vehicle_types, get_lane_types, get_roughness_values, get_rf_values
-
- # Example user input (can be replaced by actual UI/db input)
- user_vehicle_data = [
- {"type": "Small Car", "count": 500, "operation_cost": 5.5},
- {"type": "Bus", "count": 100, "operation_cost": 15.0},
- # ... add more as needed
- ]
- lane_type = "Two Lane" # user input
- roughness = 3000 # user input
- rf = 10 # user input
- # If user does not define vehicle types, default to Big Car
- if not user_vehicle_data:
- user_vehicle_data = [{"type": "Big Car", "count": 1, "operation_cost": 6.62}]
+ # Example user input for road user cost calculation
+ road_user_inputs = {
+ "Lane_Type": "Single Lane Roads",
+ "Roughness": 2000,
+ "RF": 0,
+ "Vehicles": [
+ {"Vehicle_Type": "Small Cars", "Count": 1},
+ {"Vehicle_Type": "HCV", "Count": 1},
+ {"Vehicle_Type": "Buses", "Count": 1},
+ ]
+ }
+
+ total_vehicles_affected = sum(v["Count"] for v in road_user_inputs["Vehicles"])
+
+ import sqlite3
+ import os
+ # Use a relative path for the database
+ db_path = os.path.join(os.path.dirname(__file__), '..', 'data', 'databases', 'IRC_Road_Costs.db')
+ db_path = os.path.abspath(db_path)
- # Sum total road user cost for all vehicle types
total_road_user_cost = 0
- total_vehicles_affected = 0
- for v in user_vehicle_data:
- total_road_user_cost += v["count"] * v["operation_cost"]
- total_vehicles_affected += v["count"]
-
- construction_time_days = time * 365 # eg (days)
- total_road_user_cost *= construction_time_days
-
- road_user_cost_component = RoadUserCost(
- vehicles_affected=total_vehicles_affected, # user-defined count
- vehicle_operation_cost=total_road_user_cost / construction_time_days if construction_time_days else 0,
- construction_time=construction_time_days
- )
- print("Road User Cost (all vehicle types):", road_user_cost_component.calculate_cost()) # INR
+ construction_time = 1 # Example: 1 year, can be user input
+
+ with sqlite3.connect(db_path) as conn:
+ cursor = conn.cursor()
+ # Get the name of the only table in the database
+ cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
+ table_name = cursor.fetchone()[0]
+ for vehicle in road_user_inputs["Vehicles"]:
+ vehicle_type = vehicle["Vehicle_Type"]
+ count = vehicle["Count"]
+ lane_type = road_user_inputs["Lane_Type"]
+ roughness = road_user_inputs["Roughness"]
+ rf = road_user_inputs["RF"]
+ cursor.execute(f'''
+ SELECT Grand_Cost FROM {table_name} WHERE
+ Vehicle_Type = ? AND Lane_Type = ? AND Roughness = ? AND RF = ?
+ ''', (vehicle_type, lane_type, roughness, rf))
+ result = cursor.fetchone()
+ if result:
+ grand_cost = result[0]
+ # Multiply Grand_Cost by Count (from user input, not from DB)
+ road_user_cost_component = RoadUserCost(
+ vehicles_affected=count,
+ vehicle_operation_cost=grand_cost,
+ construction_time=construction_time
+ )
+ total_road_user_cost += road_user_cost_component.calculate_cost()
+ else:
+ print(f"No Grand_Cost found for {vehicle_type}, {lane_type}, {roughness}, {rf}")
+ print("Total Road User Cost:", total_road_user_cost) # INR
+
# 5. Additional Carbon Emission Cost Calculation
reroute_distance = 2 # eg (km)
co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
+
+ # For Additional Carbon Emission Cost calculation, define separate user inputs:
+ additional_carbon_inputs = {
+ "vehicles_affected": 10000, # Example value, replace with actual user input
+ "reroute_distance": 2, # Example value, replace with actual user input
+ # Add more fields as needed
+ }
additional_carbon_emission_component = AdditionalCarbonEmissionCost(
- vehicles_affected=total_vehicles_affected,
- reroute_distance=reroute_distance,
+ vehicles_affected=additional_carbon_inputs["vehicles_affected"],
+ reroute_distance=additional_carbon_inputs["reroute_distance"],
co2_emission_per_km=co2_emission_per_km,
carbon_cost=carbon_cost
)
@@ -422,18 +451,18 @@ def calculate_cost(self):
recycling_design_life = 50 # eg (years)
# For demonstration, assuming user provides both quantity and unit
- user_input_steel_quantity = 15 # eg (user input, 15 MT)
+ user_input_steel_quantity = 15 # eg (user input, 15 MT or 15000 kg)
user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
- # Convert all user input to kg
- if user_input_steel_unit.upper() == "MT":
- user_input_steel_quantity_kg = user_input_steel_quantity * 1000 # 1 MT = 1000 kg
+ # Always store quantity in MT for calculation
+ if user_input_steel_unit.lower() == "kg":
+ user_input_steel_quantity_mt = user_input_steel_quantity / 1000 # convert kg to MT
else:
- user_input_steel_quantity_kg = user_input_steel_quantity # already in kg
+ user_input_steel_quantity_mt = user_input_steel_quantity # already in MT
recycling_component = RecyclingCost(
scrap_value=scrap_value,
- quantity=user_input_steel_quantity_kg,
+ quantity=user_input_steel_quantity_mt, # always in MT
scrap_rate=scrap_rate,
discount_rate=recycling_discount_rate,
design_life=recycling_design_life
diff --git a/src/osbridgelcca/core/material_types_consts.py b/src/osbridgelcca/core/material_types_consts.py
index ee7e56f..e3a5e71 100644
--- a/src/osbridgelcca/core/material_types_consts.py
+++ b/src/osbridgelcca/core/material_types_consts.py
@@ -117,24 +117,24 @@ def get_all_material_unit_combinations(material_costs):
# Road User Cost Components
VEHICLE_TYPES = [
- "Small Car",
- "Big Car",
- "Two Wheeler",
- "Bus",
+ "Small Cars",
+ "Big Cars",
+ "Two Wheelers",
+ "Buses",
"LCV",
- "MCV",
- "HCV"
+ "HCV",
+ "MCV"
]
LANE_TYPES = [
- "Single Lane",
- "Intermediate Lane",
- "Two Lane",
- "Three Lane",
- "Four Lane"
+ "Single Lane Roads",
+ "Intermediate Lane Roads",
+ "Two Lane Roads",
+ "Four Lane Divided Roads",
+ "Four Lane Divided Expressways Roads"
]
-ROUGHNESS_VALUES = [2000, 3000, 4000, 6000]
+ROUGHNESS_VALUES = [2000, 3000, 4000, 5000, 6000, 7000, 8000]
RF_VALUES = [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50]
From 2424a849c9346a06f424137e5043283bdac84829 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 13:25:35 +0530
Subject: [PATCH 09/14] in .gitgnore_Allowed GIt to consider .db files
---
.gitignore | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gitignore b/.gitignore
index 6dcf019..205d08e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,7 +23,7 @@ logs/
app_crash.log
# Database files
-data/databases/*.db
+#data/databases/*.db (ALlowed git to consider .db files)
data/databases/*.sqlite3
# Flask and Django
From c30012fca5efe40619442d7e086bc8104083a642 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 13:27:26 +0530
Subject: [PATCH 10/14] Add IRC_Road_Costs.db to repository
---
.../data/databases/IRC_Road_Costs.db | Bin 0 -> 106496 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 src/osbridgelcca/data/databases/IRC_Road_Costs.db
diff --git a/src/osbridgelcca/data/databases/IRC_Road_Costs.db b/src/osbridgelcca/data/databases/IRC_Road_Costs.db
new file mode 100644
index 0000000000000000000000000000000000000000..0ac78f9fa7c676fa23be978aa643bc91b5287f3c
GIT binary patch
literal 106496
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
literal 0
HcmV?d00001
From 838c4336fd97e9079dd56306d016ff8f930e5f2e Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 23:16:49 +0530
Subject: [PATCH 11/14] Changes in cost_component,py (calculations updated)
Carbon emission formula needs changes
---
src/osbridgelcca/core/cost_component.py | 169 ++++++++++++------------
src/osbridgelcca/core/cost_defaults.py | 4 +
2 files changed, 89 insertions(+), 84 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 8a3eb9e..761bdbe 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -13,7 +13,8 @@
get_routine_inspection_frequency_years,
get_demolition_cost_rate,
get_scrap_value_structural_steel,
- get_structural_steel_scrap_rate
+ get_structural_steel_scrap_rate,
+ get_repair_and_rehabilitation_frequency_years
)
from .material_types_consts import (
get_material_cost_template, get_materials, get_grades, get_units,
@@ -126,7 +127,7 @@ class PeriodicMaintenanceCost(CostComponent):
def __init__(self, maintenance_cost_rate, construction_cost, discount_rate=0, period=None, design_life=1):
if period is None:
period = get_periodic_maintenance_frequency_years()
- pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
+ pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
cost = maintenance_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
self.maintenance_cost_rate = maintenance_cost_rate
@@ -143,7 +144,7 @@ class PeriodicMaintenanceCarbonCost(CostComponent):
"""Calculates emissions from maintenance activities."""
def __init__(self, material_quantity, carbon_emission_factor, carbon_cost, discount_rate=0.0, period=1, design_life=1):
- pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
+ pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
cost = material_quantity * carbon_emission_factor * carbon_cost * pwf
super().__init__(amount=cost, category="Environmental", is_initial=False, is_recurring=True, present_worth_factor=pwf)
self.material_quantity = material_quantity
@@ -160,7 +161,7 @@ class RoutineInspectionCost(CostComponent):
def __init__(self, quantity, rate, discount_rate=0, design_life=1, period=None):
if period is None:
period = get_routine_inspection_frequency_years()
- pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
+ pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
cost = quantity * rate * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
self.quantity = quantity
@@ -178,8 +179,8 @@ class RepairAndRehabilitationCost(CostComponent):
def __init__(self, repair_cost_rate, construction_cost=0, discount_rate=0, period=None, design_life=1):
if period is None:
- period = get_periodic_maintenance_frequency_years()
- pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period) + 1))
+ period = get_repair_and_rehabilitation_frequency_years()
+ pwf = 1 / ((1 + discount_rate) ** (period))
cost = repair_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -241,14 +242,37 @@ def calculate_cost(self):
if __name__ == "__main__":
from .cost_defaults import get_annual_routine_inspection_cost_rate
+ # === USER INPUTS (specific to project/material/vehicles) ===
material_costs = get_material_cost_template()
-
- # user inputs will be here, for eg:
user_materials = [
- {"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994}, # eg (quantity: cum, rate: INR/cum)
- {"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565}, # eg (quantity: MT, rate: INR/MT)
- {"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100}, # eg (quantity: MT, rate: INR/MT)
+ {"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994},
+ {"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565},
+ {"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100},
]
+ road_user_inputs = {
+ "Lane_Type": "Single Lane Roads",
+ "Roughness": 2000,
+ "RF": 5,
+ "reroute_distance": 1, # New factor added (in km, example value)
+ "Vehicles": [
+ {"Vehicle_Type": "Small Cars", "Count": 1000},
+ {"Vehicle_Type": "Big Cars", "Count": 2000},
+ {"Vehicle_Type": "Two Wheelers", "Count": 4000},
+ ]
+ }
+ user_input_steel_quantity = 0 # eg (user input, 15 MT or 15000 kg)
+ user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
+ analysis_period = 50 # years (default, replace with user input as needed)
+
+ # === SHARED INPUTS (define once and use everywhere) ===
+ analysis_period = 50 # years (default, replace with user input as needed)
+ design_life = 50 # years
+ discount_rate = 0.0425 # fraction
+ construction_time = 0.75 # years
+ reroute_distance = 1 # km
+ interest_rate = 0.1 # fraction
+ investment_ratio = 0.5 # fraction
+
# 1. Initial Construction Cost Calculation
total_initial_construction_cost = 0
@@ -288,13 +312,10 @@ def calculate_cost(self):
print("Total Initial Carbon Emission Cost:", total_carbon_emission_cost) # INR
# 3. Time Cost Calculation
- interest_rate = 0.1 # eg (fraction)
- time = 0.75 # eg (years)
- investment_ratio = 0.5 # eg (fraction)
time_cost_component = TimeCost(
construction_cost=total_initial_construction_cost,
interest_rate=interest_rate,
- time=time,
+ time=construction_time,
investment_ratio=investment_ratio
)
print("Time Cost:", time_cost_component.calculate_cost()) # INR
@@ -302,17 +323,6 @@ def calculate_cost(self):
# 4. Road User Cost Calculation
# Example user input for road user cost calculation
- road_user_inputs = {
- "Lane_Type": "Single Lane Roads",
- "Roughness": 2000,
- "RF": 0,
- "Vehicles": [
- {"Vehicle_Type": "Small Cars", "Count": 1},
- {"Vehicle_Type": "HCV", "Count": 1},
- {"Vehicle_Type": "Buses", "Count": 1},
- ]
- }
-
total_vehicles_affected = sum(v["Count"] for v in road_user_inputs["Vehicles"])
import sqlite3
@@ -322,11 +332,9 @@ def calculate_cost(self):
db_path = os.path.abspath(db_path)
total_road_user_cost = 0
- construction_time = 1 # Example: 1 year, can be user input
-
+ # construction_time and reroute_distance are now shared variables
with sqlite3.connect(db_path) as conn:
cursor = conn.cursor()
- # Get the name of the only table in the database
cursor.execute("SELECT name FROM sqlite_master WHERE type='table';")
table_name = cursor.fetchone()[0]
for vehicle in road_user_inputs["Vehicles"]:
@@ -342,11 +350,11 @@ def calculate_cost(self):
result = cursor.fetchone()
if result:
grand_cost = result[0]
- # Multiply Grand_Cost by Count (from user input, not from DB)
+ ct = construction_time * reroute_distance
road_user_cost_component = RoadUserCost(
vehicles_affected=count,
vehicle_operation_cost=grand_cost,
- construction_time=construction_time
+ construction_time=ct
)
total_road_user_cost += road_user_cost_component.calculate_cost()
else:
@@ -355,14 +363,12 @@ def calculate_cost(self):
# 5. Additional Carbon Emission Cost Calculation
- reroute_distance = 2 # eg (km)
co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
-
- # For Additional Carbon Emission Cost calculation, define separate user inputs:
+ # Use the sum of all vehicle counts from road_user_inputs as vehicles_affected
+ vehicles_affected = sum(v["Count"] for v in road_user_inputs["Vehicles"])
additional_carbon_inputs = {
- "vehicles_affected": 10000, # Example value, replace with actual user input
- "reroute_distance": 2, # Example value, replace with actual user input
- # Add more fields as needed
+ "vehicles_affected": vehicles_affected, # Use total vehicles from road user calculation
+ "reroute_distance": reroute_distance, # Use shared variable
}
additional_carbon_emission_component = AdditionalCarbonEmissionCost(
vehicles_affected=additional_carbon_inputs["vehicles_affected"],
@@ -375,8 +381,6 @@ def calculate_cost(self):
# 6. Periodic Maintenance Cost Calculation
maintenance_cost_rate = get_periodic_maintenance_cost_rate() # eg (default, fraction)
period = get_periodic_maintenance_frequency_years() # eg (default, years)
- discount_rate = 0.05 # eg (fraction)
- design_life = 50 # eg (years)
periodic_maintenance_component = PeriodicMaintenanceCost(
maintenance_cost_rate=maintenance_cost_rate,
construction_cost=total_initial_construction_cost,
@@ -387,15 +391,16 @@ def calculate_cost(self):
print("Periodic Maintenance Cost:", periodic_maintenance_component.calculate_cost()) # INR
# 7. Periodic Maintenance Carbon Emission Cost Calculation
+ # Define required variables before calculation
maintenance_concrete_kg = total_concrete_kg
maintenance_steel_kg = total_steel_kg
- maintenance_concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)") # eg (default, kgCO2e/kg)
- maintenance_steel_emission_factor = get_carbon_emission_factor("Rebar") # eg (default, kgCO2e/kg)
- maintenance_carbon_cost = get_social_cost_of_carbon() # eg (default, INR/kg)
- maintenance_discount_rate = 0.05 # eg (fraction)
- maintenance_period = get_periodic_maintenance_frequency_years() # eg (default, years)
- maintenance_design_life = 50 # eg (years)
- pwf = sum(1 / ((1 + maintenance_discount_rate) ** (i * maintenance_period)) for i in range(1, int(maintenance_design_life / maintenance_period) + 1))
+ maintenance_concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)")
+ maintenance_steel_emission_factor = get_carbon_emission_factor("Rebar")
+ maintenance_carbon_cost = get_social_cost_of_carbon()
+ maintenance_discount_rate = discount_rate
+ maintenance_period = get_periodic_maintenance_frequency_years()
+ maintenance_design_life = design_life
+ pwf = sum(1 / ((1 + maintenance_discount_rate) ** (i * maintenance_period)) for i in range(1, int(maintenance_design_life / maintenance_period)))
periodic_maintenance_carbon_cost = (
(maintenance_concrete_kg * maintenance_concrete_emission_factor) +
(maintenance_steel_kg * maintenance_steel_emission_factor)
@@ -404,9 +409,8 @@ def calculate_cost(self):
# 8. Annual Routine Inspection Cost Calculation
inspection_rate = get_annual_routine_inspection_cost_rate() # eg (default, fraction)
- inspection_discount_rate = 0.05 # eg (fraction)
- inspection_design_life = 50 # eg (years)
- inspection_period = 1 # eg (annual)
+ inspection_discount_rate = discount_rate
+ inspection_design_life = design_life
total_routine_inspection_cost = 0
for item in user_materials:
inspection_component = RoutineInspectionCost(
@@ -414,7 +418,7 @@ def calculate_cost(self):
rate=inspection_rate,
discount_rate=inspection_discount_rate,
design_life=inspection_design_life,
- period=inspection_period
+ period=1 # always annual
)
cost = inspection_component.calculate_cost()
total_routine_inspection_cost += cost
@@ -422,7 +426,7 @@ def calculate_cost(self):
# 9. Repair and Rehabilitation Cost Calculation
repair_cost_rate = get_repair_and_rehabilitation_cost_rate() # eg (default, fraction)
- repair_period = get_periodic_maintenance_frequency_years() # eg (default, years)
+ repair_period = get_repair_and_rehabilitation_frequency_years() # eg (default, years)
repair_component = RepairAndRehabilitationCost(
repair_cost_rate=repair_cost_rate,
construction_cost=total_initial_construction_cost,
@@ -434,8 +438,8 @@ def calculate_cost(self):
# 10. Demolition and Disposal Cost Calculation
demolition_rate = get_demolition_cost_rate() # eg (default, fraction)
- demolition_discount_rate = 0.05 # eg (fraction)
- demolition_design_life = 50 # eg (years)
+ demolition_discount_rate = discount_rate
+ demolition_design_life = design_life
demolition_component = DemolitionCost(
demolition_rate=demolition_rate,
construction_cost=total_initial_construction_cost,
@@ -447,48 +451,45 @@ def calculate_cost(self):
# 11. Recycling Cost Calculation
scrap_value = get_scrap_value_structural_steel() # eg (default, INR/MT)
scrap_rate = get_structural_steel_scrap_rate() # eg (default, fraction)
- recycling_discount_rate = 0.05 # eg (fraction)
- recycling_design_life = 50 # eg (years)
-
- # For demonstration, assuming user provides both quantity and unit
- user_input_steel_quantity = 15 # eg (user input, 15 MT or 15000 kg)
+ recycling_design_life = design_life
+ user_input_steel_quantity = 0 # eg (user input, 15 MT or 15000 kg)
user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
-
- # Always store quantity in MT for calculation
if user_input_steel_unit.lower() == "kg":
- user_input_steel_quantity_mt = user_input_steel_quantity / 1000 # convert kg to MT
+ user_input_steel_quantity_mt = user_input_steel_quantity / 1000
else:
- user_input_steel_quantity_mt = user_input_steel_quantity # already in MT
-
+ user_input_steel_quantity_mt = user_input_steel_quantity
recycling_component = RecyclingCost(
scrap_value=scrap_value,
- quantity=user_input_steel_quantity_mt, # always in MT
+ quantity=user_input_steel_quantity_mt,
scrap_rate=scrap_rate,
- discount_rate=recycling_discount_rate,
+ discount_rate=discount_rate,
design_life=recycling_design_life
)
print("Recycling Cost (user-input steel only):", recycling_component.calculate_cost()) # INR
# 12. Reconstruction Cost Calculation
- demolition_cost = demolition_component.calculate_cost() # eg (INR, use previously calculated demolition cost)
- reconstruction_cost = total_initial_construction_cost # eg (INR)
- reconstruction_carbon_cost = total_carbon_emission_cost # eg (INR)
- reconstruction_time_cost = time_cost_component.calculate_cost() # eg (INR)
- reconstruction_roaduser_cost = road_user_cost_component.calculate_cost() # eg (INR)
- reconstruction_rerouting_carbon_cost = additional_carbon_emission_component.calculate_cost() # eg (INR)
- reconstruction_design_life = 50 # eg (years)
- reconstruction_discount_rate = 0.05 # eg (fraction)
- reconstruction_component = ReconstructionCost(
- demolition_cost=demolition_cost,
- reconstruction_cost=reconstruction_cost,
- reconstruction_carbon_cost=reconstruction_carbon_cost,
- reconstruction_time_cost=reconstruction_time_cost,
- reconstruction_roaduser_cost=reconstruction_roaduser_cost,
- reconstruction_rerouting_carbon_cost=reconstruction_rerouting_carbon_cost,
- design_life=reconstruction_design_life,
- discount_rate=reconstruction_discount_rate
- )
- print("Reconstruction Cost:", reconstruction_component.calculate_cost()) # INR
+ demolition_cost = demolition_component.calculate_cost()
+ reconstruction_cost = total_initial_construction_cost
+ reconstruction_carbon_cost = total_carbon_emission_cost
+ reconstruction_time_cost = time_cost_component.calculate_cost()
+ reconstruction_roaduser_cost = road_user_cost_component.calculate_cost()
+ reconstruction_rerouting_carbon_cost = additional_carbon_emission_component.calculate_cost()
+ reconstruction_design_life = design_life
+ # Only calculate reconstruction cost if analysis_period > design_life
+ if analysis_period > design_life:
+ reconstruction_component = ReconstructionCost(
+ demolition_cost=demolition_cost,
+ reconstruction_cost=reconstruction_cost,
+ reconstruction_carbon_cost=reconstruction_carbon_cost,
+ reconstruction_time_cost=reconstruction_time_cost,
+ reconstruction_roaduser_cost=reconstruction_roaduser_cost,
+ reconstruction_rerouting_carbon_cost=reconstruction_rerouting_carbon_cost,
+ design_life=reconstruction_design_life,
+ discount_rate=discount_rate
+ )
+ print("Reconstruction Cost:", reconstruction_component.calculate_cost()) # INR
+ else:
+ print("Reconstruction Cost:", 0) # INR
diff --git a/src/osbridgelcca/core/cost_defaults.py b/src/osbridgelcca/core/cost_defaults.py
index 1584643..d0aeeec 100644
--- a/src/osbridgelcca/core/cost_defaults.py
+++ b/src/osbridgelcca/core/cost_defaults.py
@@ -62,6 +62,7 @@ def get_coefficient_carbon_emissions_structural_steel():
REPAIR_AND_REHABILITATION_COST_RATE = 0.10 # 10% as a decimal
PERIODIC_MAINTENANCE_FREQUENCY_YEARS = 5
ROUTINE_INSPECTION_FREQUENCY_YEARS = 1
+REPAIR_AND_REHABILITATION_FREQUENCY_YEARS = 30
def get_periodic_maintenance_cost_rate():
return PERIODIC_MAINTENANCE_COST_RATE
@@ -78,6 +79,9 @@ def get_periodic_maintenance_frequency_years():
def get_routine_inspection_frequency_years():
return ROUTINE_INSPECTION_FREQUENCY_YEARS
+def get_repair_and_rehabilitation_frequency_years():
+ return REPAIR_AND_REHABILITATION_FREQUENCY_YEARS
+
# Demolition and recycling recommended values
DEMOLITION_COST_RATE = 0.10 # 10% as a decimal
SCRAP_VALUE_STRUCTURAL_STEEL = 50000 # INR/MT
From 4bd0e3840d797b92d9077065d4ebbea75ce308a2 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 23:21:08 +0530
Subject: [PATCH 12/14] Updated Calculations in core
---
src/osbridgelcca/core/cost_component.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 761bdbe..0bd840d 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -243,6 +243,7 @@ def calculate_cost(self):
from .cost_defaults import get_annual_routine_inspection_cost_rate
# === USER INPUTS (specific to project/material/vehicles) ===
+
material_costs = get_material_cost_template()
user_materials = [
{"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994},
@@ -260,11 +261,15 @@ def calculate_cost(self):
{"Vehicle_Type": "Two Wheelers", "Count": 4000},
]
}
+
+ # Inputs for calculating Recycling Cost
+
user_input_steel_quantity = 0 # eg (user input, 15 MT or 15000 kg)
user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
- analysis_period = 50 # years (default, replace with user input as needed)
+
# === SHARED INPUTS (define once and use everywhere) ===
+
analysis_period = 50 # years (default, replace with user input as needed)
design_life = 50 # years
discount_rate = 0.0425 # fraction
From 102e02fae4855739259d61edcd76c4382dcbb218 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Fri, 20 Jun 2025 23:24:44 +0530
Subject: [PATCH 13/14] Cost Calculations updated in core
---
src/osbridgelcca/core/cost_component.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 0bd840d..612a3b4 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -240,16 +240,18 @@ def calculate_cost(self):
if __name__ == "__main__":
- from .cost_defaults import get_annual_routine_inspection_cost_rate
# === USER INPUTS (specific to project/material/vehicles) ===
-
+
material_costs = get_material_cost_template()
user_materials = [
{"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994},
{"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565},
{"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100},
]
+
+ # Inputs for calculating Road User Cost
+
road_user_inputs = {
"Lane_Type": "Single Lane Roads",
"Roughness": 2000,
From b65cdfc117e22ba6f2e2cec8293eb2ef5fa3bf38 Mon Sep 17 00:00:00 2001
From: Atharva Dhavale
Date: Mon, 23 Jun 2025 18:33:14 +0530
Subject: [PATCH 14/14] Final Changes in the cost_component ready for UI
---
src/osbridgelcca/core/cost_component.py | 251 +++++++++++++-----------
src/osbridgelcca/core/cost_defaults.py | 8 +
2 files changed, 142 insertions(+), 117 deletions(-)
diff --git a/src/osbridgelcca/core/cost_component.py b/src/osbridgelcca/core/cost_component.py
index 612a3b4..2ff049b 100644
--- a/src/osbridgelcca/core/cost_component.py
+++ b/src/osbridgelcca/core/cost_component.py
@@ -1,28 +1,8 @@
from abc import ABC, abstractmethod
-from .cost_defaults import (
- get_carbon_emission_factor,
- get_social_cost_of_carbon,
- get_coefficient_carbon_emissions_concrete,
- get_carbon_emission_factor_per_km,
- get_coefficient_embodied_energy_hysd_steel,
- get_coefficient_carbon_emissions_structural_steel,
- get_periodic_maintenance_cost_rate, # eg (default)
- get_annual_routine_inspection_cost_rate, # eg (default)
- get_repair_and_rehabilitation_cost_rate, # eg (default)
- get_periodic_maintenance_frequency_years,
- get_routine_inspection_frequency_years,
- get_demolition_cost_rate,
- get_scrap_value_structural_steel,
- get_structural_steel_scrap_rate,
- get_repair_and_rehabilitation_frequency_years
-)
-from .material_types_consts import (
- get_material_cost_template, get_materials, get_grades, get_units,
- is_valid_material, is_valid_grade, is_valid_unit
-)
import os
import sqlite3
-from typing import Optional
+from typing import Optional, List, Dict, Any
+from dataclasses import dataclass, field
class CostComponent(ABC):
"""Abstract Base Class for different cost components in Life Cycle Cost Analysis."""
@@ -124,9 +104,7 @@ def calculate_cost(self):
class PeriodicMaintenanceCost(CostComponent):
"""Includes expenses for routine maintenance activities."""
- def __init__(self, maintenance_cost_rate, construction_cost, discount_rate=0, period=None, design_life=1):
- if period is None:
- period = get_periodic_maintenance_frequency_years()
+ def __init__(self, maintenance_cost_rate, construction_cost, discount_rate=0, period=1, design_life=1):
pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
cost = maintenance_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -143,7 +121,7 @@ def calculate_cost(self):
class PeriodicMaintenanceCarbonCost(CostComponent):
"""Calculates emissions from maintenance activities."""
- def __init__(self, material_quantity, carbon_emission_factor, carbon_cost, discount_rate=0.0, period=1, design_life=1):
+ def __init__(self, material_quantity, carbon_emission_factor, carbon_cost, discount_rate, period, design_life):
pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
cost = material_quantity * carbon_emission_factor * carbon_cost * pwf
super().__init__(amount=cost, category="Environmental", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -158,28 +136,24 @@ def calculate_cost(self):
class RoutineInspectionCost(CostComponent):
"""Annual cost of inspections for structural integrity."""
- def __init__(self, quantity, rate, discount_rate=0, design_life=1, period=None):
- if period is None:
- period = get_routine_inspection_frequency_years()
- pwf = sum(1 / ((1 + discount_rate) ** (i * period)) for i in range(1, int(design_life / period)))
- cost = quantity * rate * pwf
+ def __init__(self, inspection_cost_rate, construction_cost, discount_rate=0, design_life=1, period=1):
+ pwf = ((1 + discount_rate) ** (design_life - 1)) / (discount_rate * (1 + discount_rate) ** design_life)
+ cost = inspection_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
- self.quantity = quantity
- self.rate = rate
+ self.inspection_cost_rate = inspection_cost_rate
+ self.construction_cost = construction_cost
self.period = period
self.discount_rate = discount_rate
self.design_life = design_life
def calculate_cost(self):
- return self.quantity * self.rate * self.present_worth_factor
+ return self.inspection_cost_rate * self.construction_cost * self.present_worth_factor
class RepairAndRehabilitationCost(CostComponent):
"""Covers major structural repairs and retrofitting."""
- def __init__(self, repair_cost_rate, construction_cost=0, discount_rate=0, period=None, design_life=1):
- if period is None:
- period = get_repair_and_rehabilitation_frequency_years()
+ def __init__(self, repair_cost_rate, construction_cost=0, discount_rate=0, period=1, design_life=1):
pwf = 1 / ((1 + discount_rate) ** (period))
cost = repair_cost_rate * construction_cost * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=True, present_worth_factor=pwf)
@@ -207,9 +181,7 @@ def calculate_cost(self):
class RecyclingCost(CostComponent):
"""Accounts for material salvage and repurposing costs."""
- def __init__(self, scrap_value, quantity=0, scrap_rate=None, discount_rate=0, design_life=1):
- if scrap_rate is None:
- scrap_rate = get_structural_steel_scrap_rate()
+ def __init__(self, scrap_value, quantity=0, scrap_rate=1.0, discount_rate=0, design_life=1):
pwf = 1 / ((1 + discount_rate) ** design_life)
cost = scrap_value * quantity * scrap_rate * pwf
super().__init__(amount=cost, category="Economic", is_initial=False, is_recurring=False, present_worth_factor=pwf)
@@ -235,51 +207,86 @@ def calculate_cost(self):
return self.amount
-#COST CALULATIONS
-
-if __name__ == "__main__":
- # === USER INPUTS (specific to project/material/vehicles) ===
-
- material_costs = get_material_cost_template()
- user_materials = [
+@dataclass
+class UserInputs:
+ user_materials: List[Dict[str, Any]] = field(default_factory=lambda: [
{"material": "concrete", "grade": "M40", "unit": "cum", "quantity": 214, "rate": 11994},
{"material": "steel", "grade": "E 250(Fe 410W)A", "unit": "MT", "quantity": 27.99, "rate": 91565},
{"material": "steel", "grade": "E 300(Fe 440)", "unit": "MT", "quantity": 5.69, "rate": 185100},
- ]
-
- # Inputs for calculating Road User Cost
-
- road_user_inputs = {
+ ])
+ road_user_inputs: Dict[str, Any] = field(default_factory=lambda: {
"Lane_Type": "Single Lane Roads",
"Roughness": 2000,
"RF": 5,
- "reroute_distance": 1, # New factor added (in km, example value)
+ "reroute_distance": 1,
"Vehicles": [
{"Vehicle_Type": "Small Cars", "Count": 1000},
{"Vehicle_Type": "Big Cars", "Count": 2000},
{"Vehicle_Type": "Two Wheelers", "Count": 4000},
]
- }
+ })
+ user_input_steel_quantity: float = 0.0
+ user_input_steel_unit: str = "MT"
+ analysis_period: float = 50.0
+ design_life: float = 50.0
+ discount_rate: float = 0.0425
+ construction_time: float = 0.75
+ reroute_distance: float = 1.0
+ interest_rate: float = 0.1
+ investment_ratio: float = 0.5
+ concrete_emission_factor: float = 0.084
+ concrete_co2_emission_factor: float = 0.487032864540167
+ steel_emission_factor: float = 2.6
+ co2_emission_per_km: float = 0.1213
+ carbon_cost: float = 6.3936
+ maintenance_cost_rate: float = 0.0055
+ maintenance_period: float = 5.0
+ inspection_rate: float = 0.01
+ inspection_period: float = 1.0
+ repair_cost_rate: float = 0.10
+ repair_period: float = 30.0
+ demolition_rate: float = 0.10
+ scrap_value: float = 50000.0
+ scrap_rate: float = 0.98
- # Inputs for calculating Recycling Cost
- user_input_steel_quantity = 0 # eg (user input, 15 MT or 15000 kg)
- user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
-
- # === SHARED INPUTS (define once and use everywhere) ===
+#COST CALULATIONS
- analysis_period = 50 # years (default, replace with user input as needed)
- design_life = 50 # years
- discount_rate = 0.0425 # fraction
- construction_time = 0.75 # years
- reroute_distance = 1 # km
- interest_rate = 0.1 # fraction
- investment_ratio = 0.5 # fraction
-
+
+
+if __name__ == "__main__":
+
+ # === USER INPUTS (all overridable parameters grouped) ===
+ inputs = UserInputs()
+ user_materials = inputs.user_materials
+ road_user_inputs = inputs.road_user_inputs
+ user_input_steel_quantity = inputs.user_input_steel_quantity
+ user_input_steel_unit = inputs.user_input_steel_unit
+ analysis_period = inputs.analysis_period
+ design_life = inputs.design_life
+ discount_rate = inputs.discount_rate
+ construction_time = inputs.construction_time
+ reroute_distance = inputs.reroute_distance
+ interest_rate = inputs.interest_rate
+ investment_ratio = inputs.investment_ratio
+ concrete_emission_factor = inputs.concrete_emission_factor
+ concrete_co2_emission_factor = inputs.concrete_co2_emission_factor
+ steel_emission_factor = inputs.steel_emission_factor
+ co2_emission_per_km = inputs.co2_emission_per_km
+ carbon_cost = inputs.carbon_cost
+ maintenance_cost_rate = inputs.maintenance_cost_rate
+ maintenance_period = inputs.maintenance_period
+ inspection_rate = inputs.inspection_rate
+ inspection_period = inputs.inspection_period
+ repair_cost_rate = inputs.repair_cost_rate
+ repair_period = inputs.repair_period
+ demolition_rate = inputs.demolition_rate
+ scrap_value = inputs.scrap_value
+ scrap_rate = inputs.scrap_rate
# 1. Initial Construction Cost Calculation
total_initial_construction_cost = 0
@@ -298,21 +305,16 @@ def calculate_cost(self):
qty = item["quantity"]
unit = item["unit"].lower()
if unit == "cum":
- qty = qty * 2549.25 # eg (density: kg/cum)
- # If already in kg, use as is
+ qty = qty * 2549.25 # density: kg/cum
total_concrete_kg += qty
- concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)") # eg (default, kgCO2e/kg)
total_steel_kg = 0
for item in user_materials:
if item["material"] == "steel":
qty = item["quantity"]
unit = item["unit"].upper()
if unit == "MT":
- qty = qty * 1000 # eg (1 MT = 1000 kg)
- # If already in kg, use as is
+ qty = qty * 1000 # 1 MT = 1000 kg
total_steel_kg += qty
- steel_emission_factor = get_carbon_emission_factor("Rebar") # eg (default, kgCO2e/kg)
- carbon_cost = get_social_cost_of_carbon() # eg (default, INR/kg)
total_carbon_emission_cost = (
(total_concrete_kg * concrete_emission_factor) + (total_steel_kg * steel_emission_factor)
) * carbon_cost
@@ -329,11 +331,8 @@ def calculate_cost(self):
# 4. Road User Cost Calculation
- # Example user input for road user cost calculation
total_vehicles_affected = sum(v["Count"] for v in road_user_inputs["Vehicles"])
- import sqlite3
- import os
# Use a relative path for the database
db_path = os.path.join(os.path.dirname(__file__), '..', 'data', 'databases', 'IRC_Road_Costs.db')
db_path = os.path.abspath(db_path)
@@ -370,12 +369,10 @@ def calculate_cost(self):
# 5. Additional Carbon Emission Cost Calculation
- co2_emission_per_km = get_carbon_emission_factor_per_km() # eg (default, kgCO2e/km)
- # Use the sum of all vehicle counts from road_user_inputs as vehicles_affected
vehicles_affected = sum(v["Count"] for v in road_user_inputs["Vehicles"])
additional_carbon_inputs = {
- "vehicles_affected": vehicles_affected, # Use total vehicles from road user calculation
- "reroute_distance": reroute_distance, # Use shared variable
+ "vehicles_affected": vehicles_affected,
+ "reroute_distance": reroute_distance,
}
additional_carbon_emission_component = AdditionalCarbonEmissionCost(
vehicles_affected=additional_carbon_inputs["vehicles_affected"],
@@ -386,8 +383,7 @@ def calculate_cost(self):
print("Additional Carbon Emission Cost:", additional_carbon_emission_component.calculate_cost()) # INR
# 6. Periodic Maintenance Cost Calculation
- maintenance_cost_rate = get_periodic_maintenance_cost_rate() # eg (default, fraction)
- period = get_periodic_maintenance_frequency_years() # eg (default, years)
+ period = maintenance_period
periodic_maintenance_component = PeriodicMaintenanceCost(
maintenance_cost_rate=maintenance_cost_rate,
construction_cost=total_initial_construction_cost,
@@ -397,43 +393,46 @@ def calculate_cost(self):
)
print("Periodic Maintenance Cost:", periodic_maintenance_component.calculate_cost()) # INR
- # 7. Periodic Maintenance Carbon Emission Cost Calculation
- # Define required variables before calculation
- maintenance_concrete_kg = total_concrete_kg
- maintenance_steel_kg = total_steel_kg
- maintenance_concrete_emission_factor = get_carbon_emission_factor("Concrete (M25)")
- maintenance_steel_emission_factor = get_carbon_emission_factor("Rebar")
- maintenance_carbon_cost = get_social_cost_of_carbon()
+ # 7. Periodic Maintenance Carbon Emission Cost Calculation (Concrete only)
+ maintenance_concrete_kg = 0
+ for item in user_materials:
+ if item["material"].lower() == "concrete":
+ qty = item["quantity"]
+ unit = item["unit"].lower()
+ if unit == "cum":
+ qty = qty * 2549.25 # density: kg/cum
+ # If already in kg, use as is
+ maintenance_concrete_kg += qty
+ maintenance_concrete_emission_factor = concrete_co2_emission_factor
+ maintenance_carbon_cost = carbon_cost
maintenance_discount_rate = discount_rate
- maintenance_period = get_periodic_maintenance_frequency_years()
+ maintenance_period = period
maintenance_design_life = design_life
- pwf = sum(1 / ((1 + maintenance_discount_rate) ** (i * maintenance_period)) for i in range(1, int(maintenance_design_life / maintenance_period)))
- periodic_maintenance_carbon_cost = (
- (maintenance_concrete_kg * maintenance_concrete_emission_factor) +
- (maintenance_steel_kg * maintenance_steel_emission_factor)
- ) * maintenance_carbon_cost * pwf
- print("Periodic Maintenance Carbon Emission Cost:", periodic_maintenance_carbon_cost) # INR
+ periodic_maintenance_concrete_carbon_component = PeriodicMaintenanceCarbonCost(
+ material_quantity=maintenance_concrete_kg,
+ carbon_emission_factor=maintenance_concrete_emission_factor,
+ carbon_cost=maintenance_carbon_cost,
+ discount_rate=maintenance_discount_rate,
+ period=maintenance_period,
+ design_life=maintenance_design_life
+ )
+ print("Periodic Maintenance Carbon Emission Cost (Concrete only):", periodic_maintenance_concrete_carbon_component.calculate_cost()) # INR
# 8. Annual Routine Inspection Cost Calculation
- inspection_rate = get_annual_routine_inspection_cost_rate() # eg (default, fraction)
inspection_discount_rate = discount_rate
inspection_design_life = design_life
- total_routine_inspection_cost = 0
- for item in user_materials:
- inspection_component = RoutineInspectionCost(
- quantity=item["quantity"],
- rate=inspection_rate,
- discount_rate=inspection_discount_rate,
- design_life=inspection_design_life,
- period=1 # always annual
- )
- cost = inspection_component.calculate_cost()
- total_routine_inspection_cost += cost
+ inspection_component = RoutineInspectionCost(
+ inspection_cost_rate=inspection_rate, # Use inspection_rate as inspection cost rate
+ construction_cost=total_initial_construction_cost, # Always use total_initial_construction_cost
+ discount_rate=inspection_discount_rate,
+ design_life=inspection_design_life,
+ period=inspection_period # always annual
+ )
+ total_routine_inspection_cost = inspection_component.calculate_cost()
print("Total Routine Inspection Cost:", total_routine_inspection_cost) # INR
# 9. Repair and Rehabilitation Cost Calculation
- repair_cost_rate = get_repair_and_rehabilitation_cost_rate() # eg (default, fraction)
- repair_period = get_repair_and_rehabilitation_frequency_years() # eg (default, years)
+ repair_period = repair_period
repair_component = RepairAndRehabilitationCost(
repair_cost_rate=repair_cost_rate,
construction_cost=total_initial_construction_cost,
@@ -444,7 +443,6 @@ def calculate_cost(self):
print("Repair and Rehabilitation Cost:", repair_component.calculate_cost()) # INR
# 10. Demolition and Disposal Cost Calculation
- demolition_rate = get_demolition_cost_rate() # eg (default, fraction)
demolition_discount_rate = discount_rate
demolition_design_life = design_life
demolition_component = DemolitionCost(
@@ -456,8 +454,6 @@ def calculate_cost(self):
print("Demolition and Disposal Cost:", demolition_component.calculate_cost()) # INR
# 11. Recycling Cost Calculation
- scrap_value = get_scrap_value_structural_steel() # eg (default, INR/MT)
- scrap_rate = get_structural_steel_scrap_rate() # eg (default, fraction)
recycling_design_life = design_life
user_input_steel_quantity = 0 # eg (user input, 15 MT or 15000 kg)
user_input_steel_unit = "MT" # eg (user input, can be 'MT' or 'kg')
@@ -482,7 +478,7 @@ def calculate_cost(self):
reconstruction_roaduser_cost = road_user_cost_component.calculate_cost()
reconstruction_rerouting_carbon_cost = additional_carbon_emission_component.calculate_cost()
reconstruction_design_life = design_life
- # Only calculate reconstruction cost if analysis_period > design_life
+ reconstruction_result = 0
if analysis_period > design_life:
reconstruction_component = ReconstructionCost(
demolition_cost=demolition_cost,
@@ -494,9 +490,30 @@ def calculate_cost(self):
design_life=reconstruction_design_life,
discount_rate=discount_rate
)
- print("Reconstruction Cost:", reconstruction_component.calculate_cost()) # INR
+ reconstruction_result = reconstruction_component.calculate_cost()
else:
- print("Reconstruction Cost:", 0) # INR
+ reconstruction_result = 0
+ print("Reconstruction Cost:", reconstruction_result) # INR
+
+
+
+
+
+ # --- To be connected to UI ---
+ results = {
+ "Total Initial Construction Cost": total_initial_construction_cost,
+ "Total Initial Carbon Emission Cost": total_carbon_emission_cost,
+ "Time Cost": time_cost_component.calculate_cost(),
+ "Total Road User Cost": total_road_user_cost,
+ "Additional Carbon Emission Cost": additional_carbon_emission_component.calculate_cost(),
+ "Periodic Maintenance Cost": periodic_maintenance_component.calculate_cost(),
+ "Periodic Maintenance Carbon Emission Cost": periodic_maintenance_concrete_carbon_component.calculate_cost(),
+ "Total Routine Inspection Cost": total_routine_inspection_cost,
+ "Repair and Rehabilitation Cost": repair_component.calculate_cost(),
+ "Demolition and Disposal Cost": demolition_component.calculate_cost(),
+ "Recycling Cost": recycling_component.calculate_cost(),
+ "Reconstruction Cost": reconstruction_result
+ }
diff --git a/src/osbridgelcca/core/cost_defaults.py b/src/osbridgelcca/core/cost_defaults.py
index d0aeeec..301bfcb 100644
--- a/src/osbridgelcca/core/cost_defaults.py
+++ b/src/osbridgelcca/core/cost_defaults.py
@@ -39,6 +39,7 @@ def get_ghg_equivalency_factor(ghg_name):
SOCIAL_COST_OF_CARBON = 6.3936 # INR/kg
COEFFICIENT_EMBODIED_ENERGY_HYSD_STEEL = 30 # MJ/kg
COEFFICIENT_CARBON_EMISSIONS_STRUCTURAL_STEEL = 2.6000 # kgCO2e/kg
+CONCRETE_CO2_EMISSION_FACTOR = 0.487032864540167 # kgCO2e/unit (custom value for UI consistency)
def get_coefficient_carbon_emissions_concrete():
return COEFFICIENT_CARBON_EMISSIONS_CONCRETE
@@ -55,6 +56,13 @@ def get_coefficient_embodied_energy_hysd_steel():
def get_coefficient_carbon_emissions_structural_steel():
return COEFFICIENT_CARBON_EMISSIONS_STRUCTURAL_STEEL
+def get_concrete_co2_emission_factor():
+ """
+ Returns the CO2 emission factor for concrete (custom value for UI consistency).
+ :return: float
+ """
+ return CONCRETE_CO2_EMISSION_FACTOR
+
# Maintenance, inspection, and repair cost rates and frequencies
PERIODIC_MAINTENANCE_COST_RATE = 0.0055 # 0.55% as a decimal