Skip to content

Commit 8a0bc66

Browse files
Implement production and maintenance logic functions
Added functions for production logic, maintenance checks, and fault interpretation. Signed-off-by: abdurhamanmohammeda-a11y <abdurhamanmohammeda@gmail.com>
1 parent c39cf62 commit 8a0bc66

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

index.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,47 @@ <h1>🛠 Abdurhaman Mechatronics</h1>
5454
</header>
5555

5656
<img src="Maashinii.jpg" alt="SBM Machine" onerror="this.src='https://via.placeholder.com/800x400/161b22/39FF14?text=Check+Image+Name';">
57+
// Software Function 1: Production Logic
58+
function calculateTPH() {
59+
let feed = document.getElementById('feedRate').value;
60+
let density = document.getElementById('density').value || 2.6;
61+
if (feed) {
62+
let tph = feed * density;
63+
document.getElementById('tphResult').innerText = "Output: " + tph.toFixed(1) + " Tons/Hour";
64+
} else {
65+
alert("Please enter feed rate.");
66+
}
67+
}
68+
69+
// Software Function 2: Maintenance Logic (Predictive)
70+
function checkMaintenance() {
71+
let hours = document.getElementById('workHours').value;
72+
let result = document.getElementById('maintResult');
73+
74+
if (hours >= 200) {
75+
result.style.color = "red";
76+
result.innerText = "⚠️ IMMEDIATE: Replace Main Bearings & Check Belt Tension!";
77+
} else if (hours >= 50) {
78+
result.style.color = "orange";
79+
result.innerText = "⚡ CAUTION: Add Grease (EP2) to Eccentric Shaft.";
80+
} else {
81+
result.style.color = "var(--primary)";
82+
result.innerText = "✅ System OK. Keep monitoring.";
83+
}
84+
}
85+
86+
// Diagnostics Bal'ifame (E01-E10)
87+
function interpretFault() {
88+
const faults = {
89+
"E01": "Phase Failure: Power supply issue.",
90+
"E02": "Overheating: Check lubrication or cooling fan.",
91+
"E05": "Jamming: Uncrushable material detected in chamber.",
92+
"E08": "Low Oil: Hydraulic pressure critical.",
93+
"E10": "Toggle Fracture: Safety toggle plate broken."
94+
};
95+
let code = prompt("Enter Code (E01, E02, E05, E08, E10):").toUpperCase();
96+
alert(faults[code] || "Consult Abdurhaman for manual diagnosis.");
97+
}
5798

5899
<div class="card">
59100
<h2>🩺 Diagnostics</h2>

0 commit comments

Comments
 (0)