Cizz22 5 months ago
parent e615d19038
commit 18deae293a

@ -16,4 +16,4 @@ COLLECTOR_CREDENTIAL_PASSWORD=postgres
COLLECTOR_NAME=digital_twin
WINDOWS_AEROS_BASE_URL=http://192.168.1.87:8800
WINDOWS_AEROS_BASE_URL=http://192.168.1.102:8800

@ -306,6 +306,10 @@ async def update_equipment_for_simulation(*, db_session: DbSession, project_name
for eq in nodes_data:
try:
# Check if eq already exists in results
if eq["equipmentName"] in results.keys():
continue
reliabiility = reliability_data.get(eq["equipmentName"], {})
if custom_input and eq["equipmentName"] in custom_input:

@ -39,12 +39,14 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
detail=f"File type not allowed. Allowed: {ALLOWED_EXTENSIONS}"
)
print("read file")
# Read and check file size
content = await file.read()
if len(content) > MAX_FILE_SIZE:
raise HTTPException(
status_code=400,
detail="File too large. Max size: 100MB"
detail="File too large. Max size: 100Mb"
)
@ -67,6 +69,7 @@ async def import_aro_project(*, db_session: DbSession, aeros_project_in: AerosPr
"file": (file.filename, content, file.content_type or "application/octet-stream")
}
print("fetch")
response = await client.post(
f"{WINDOWS_AEROS_BASE_URL}/api/aeros/upload-file",
files=files

@ -226,7 +226,6 @@ async def save_simulation_result(
})
if not node:
if result["nodeType"] != "RegularNode" and result["nodeType"] != "Schematic":
continue
@ -492,17 +491,20 @@ async def get_simulation_with_calc_result(
if schematic_name:
query = query.join(
AerosNode, AerosNode.id == AerosSimulationCalcResult.aeros_node_id
).filter(AerosNode.structure_name.contains(schematic_name))
if schematic_name == "WTP":
query = query.join(
AerosNode, AerosNode.id == AerosSimulationCalcResult.aeros_node_id
).filter(AerosNode.structure_name.contains(schematic_name))
else:
query = query.join(
AerosNode, AerosNode.id == AerosSimulationCalcResult.aeros_node_id
).filter(AerosNode.structure_name.contains(schematic_name))
query = query.options(
selectinload(AerosSimulationCalcResult.aeros_node).options(
selectinload(AerosNode.equipment)
))
simulation = await db_session.execute(query)
return simulation.scalars().all()

@ -74,7 +74,7 @@ MAXIMO_BASE_URL = config("MAXIMO_BASE_URL", default="http://example.com")
MAXIMO_API_KEY = config("MAXIMO_API_KEY", default="keys")
AUTH_SERVICE_API = config("AUTH_SERVICE_API", default="http://192.168.1.82:8000/auth")
AEROS_BASE_URL = config("AEROS_BASE_URL", default="http://192.168.1.87")
WINDOWS_AEROS_BASE_URL = config("WINDOWS_AEROS_BASE_URL", default="http://192.168.1.87:8800")
AEROS_BASE_URL = config("AEROS_BASE_URL", default="http://192.168.1.102")
WINDOWS_AEROS_BASE_URL = config("WINDOWS_AEROS_BASE_URL", default="http://192.168.1.102:8800")
DEFAULT_PROJECT_NAME = config("DEFAULT_PROJECT_NAME", default="RBD TJB")

@ -44,14 +44,25 @@ async def get_model_data(*, db_session: DbSession, simulation_id: Optional[UUID]
EAF = (main_calc_data.availability - (main_calc_data.total_cm_downtime / total_time) - (main_calc_data.total_oh_downtime / total_time)) * 100
powerplant_reliability = {
"COAL HANDLING (CHS)": 98,
"Boiler": 98,
"Plant Control": 98,
"SPS": 98,
"Turbine": 98,
"Generator": 98,
"FGD (SUP)": 98,
"Condensate Water": 98,
"Feedwater System": 98,
"FGD (SUP)": 98,
"Cooling Water": 98,
"SCR": 98,
"Ash Handling": 98,
"Air Flue Gas": 98,
"Boiler": 98,
"SAC-IAC": 98,
"KLH": 98,
"CL": 98,
"Desalination": 98,
"FGD": 98,
"CHS": 98,
"SSB": 98,
"WTP": 98,
}
return {"id": str(simulation.id), "availability": availability, "EFOR": EFOR, "EAF": EAF, "powerplant_reliability": powerplant_reliability}

Loading…
Cancel
Save