kamal45's picture
Update app.py
40e5a63 verified
import streamlit as st
def get_maintenance_plan(service_hours):
maintenance_tasks = []
# Daily Maintenance
maintenance_tasks.append("Daily Maintenance Tasks:\n- Check cooling system coolant level.\n- Check electrical connections.\n- Perform a 'walk-around inspection.'")
# Weekly Maintenance
if service_hours >= 50:
maintenance_tasks.append("Weekly Maintenance:\n- Inspect the generator.\n- Inspect the instrument panel.\n- Drain water and sediment from the fuel tank.")
# Every 250 Service Hours
if service_hours >= 250:
maintenance_tasks.append("Every 250 Service Hours:\n- Obtain a Level 1 coolant sample.")
# Initial 500 Hours
if service_hours >= 500:
maintenance_tasks.append("Initial 500 Hours (New, Refilled, or Converted Systems):\n- Obtain a Level 2 coolant sample.")
# Every 500 Service Hours
if service_hours >= 500:
maintenance_tasks.append("Every 500 Service Hours:\n- Inspect/Adjust/Replace alternator belt.\n- Replace the fuel system secondary filter.")
# Every 500 Service Hours or 1 Year
if service_hours >= 500:
maintenance_tasks.append("Every 500 Service Hours or 1 Year:\n- Check battery electrolyte level.\n- Replace the air cleaner element (single element).\n- Replace engine crankcase breather.\n- Obtain engine oil sample.\n- Change engine oil and filter.\n- Replace the fuel system primary filter (water separator).\n- Inspect/Replace hoses and clamps.")
# Every 1000 Service Hours
if service_hours >= 1000:
maintenance_tasks.append("Every 1000 Service Hours:\n- Inspect/Adjust engine valve lash.")
# Every 1000 Service Hours or 1 Year
if service_hours >= 1000:
maintenance_tasks.append("Every 1000 Service Hours or 1 Year:\n- Check the rotating rectifier.")
# Every 2000 Service Hours
if service_hours >= 2000:
maintenance_tasks.append("Every 2000 Service Hours:\n- Inspect the alternator.")
# Every 2000 Service Hours or 6 Months
if service_hours >= 2000:
maintenance_tasks.append("Every 2000 Service Hours or 6 Months:\n- Inspect engine mounts.\n- Inspect the starting motor.\n- Inspect the turbocharger.")
# Every 3000 Service Hours
if service_hours >= 3000:
maintenance_tasks.append("Every 3000 Service Hours:\n- Test/Exchange fuel injection nozzles.\n- Inspect the water pump.")
# Every 3000 Service Hours or 2 Years
if service_hours >= 3000:
maintenance_tasks.append("Every 3000 Service Hours or 2 Years:\n- Replace the cooling system water temperature regulator.")
# Every 6000 Service Hours or 3 Years
if service_hours >= 6000:
maintenance_tasks.append("Every 6000 Service Hours or 3 Years:\n- Add cooling system coolant extender (ELC).")
# Every 12,000 Service Hours or 6 Years
if service_hours >= 12000:
maintenance_tasks.append("Every 12,000 Service Hours or 6 Years:\n- Change the cooling system coolant (ELC).")
return maintenance_tasks
# Streamlit app
st.title("Diesel Generator Maintenance Planner")
st.subheader("For a 120 kW Diesel Generator")
# Input field for service hours
service_hours = st.number_input("Enter the total service hours of the generator:", min_value=0, step=1)
# Button to calculate maintenance plan
if st.button("Get Maintenance Plan"):
maintenance_plan = get_maintenance_plan(service_hours)
st.write("### Maintenance Tasks")
for task in maintenance_plan:
st.write(f"- {task}")
st.write("\n---\n")
st.write("This application provides maintenance recommendations based on service intervals for a 120 kW diesel generator.")