diff --git a/access_log.json b/access_log.json index 2c39a17..802f232 100644 --- a/access_log.json +++ b/access_log.json @@ -642,5 +642,19 @@ "endpoint": "/", "method": "GET", "status": 200 + }, + { + "timestamp": "2026-07-07T16:34:58.280178", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 + }, + { + "timestamp": "2026-07-07T16:36:56.896657", + "username": "mtazl", + "endpoint": "/", + "method": "GET", + "status": 200 } ] \ No newline at end of file diff --git a/build_info.json b/build_info.json index 213cbe8..62b9140 100644 --- a/build_info.json +++ b/build_info.json @@ -1,6 +1,6 @@ { - "version": "0.4", + "version": "v0.4-dev", "branch": "develop/v0.4", - "commit": "ffa3481", - "timestamp": "2026-07-07T10:26:13Z" + "commit": "4670666", + "timestamp": "2026-07-07T16:39:21+02:00" } diff --git a/templates/roll_calculator.html b/templates/roll_calculator.html index e67b01c..9e1e1f1 100644 --- a/templates/roll_calculator.html +++ b/templates/roll_calculator.html @@ -48,6 +48,9 @@ .result-label { font-size: 12px; color: #1F5438; font-weight: 600; text-transform: uppercase; } .result-value { font-size: 28px; font-weight: 700; color: #1F5438; line-height: 1.2; } .result-range { font-size: 12px; color: #1F5438; margin-top: 4px; font-weight: 500; } + .result-range div { margin-top: 2px; } + .result-range .range-warning { color: #9a6700; font-weight: 700; } + .result-range .range-ok { color: #1F5438; font-weight: 700; } .forklift-check { border-radius: 7px; padding: 14px 16px; margin-top: 14px; font-size: 13px; line-height: 1.6; display: none; } .forklift-check.show { display: block; } .forklift-check.fc-ok { background: #eafaf1; border: 1.5px solid #28a745; } @@ -572,6 +575,20 @@ kg +
+ +
+ + kg +
+
+
+ +
+ + m +
+
@@ -993,13 +1010,62 @@ document.getElementById('d-calc').addEventListener('click', () => { resRange.textContent = ''; document.getElementById('d-le').value = L_calc.toFixed(2); } else if (mode === 'target') { - if (!d || !t) { alert('Please enter d and t.'); return; } + const wi = parseFloat(document.getElementById('d-wi').value) || 0; + const aw = parseFloat(document.getElementById('d-aw').value) || 0; + const maxWeight = parseFloat(document.getElementById('d-max-weight').value) || 0; + const minLength = parseFloat(document.getElementById('d-min-le').value) || 0; const D_target = D || 800; - const L_calc = (Math.PI / (4 * t)) * (D_target*D_target - d*d) / 1000; - resLabel.textContent = 'Length for Target Diameter ' + D_target + ' mm'; - resVal.textContent = L_calc.toFixed(2) + ' m'; - resRange.textContent = ''; - document.getElementById('d-le').value = L_calc.toFixed(2); + + if (!d || !t || !D_target || !wi || !aw || !maxWeight) { + alert('Please enter d, t, max. diameter, roll width, area weight, and max. roll weight.'); + return; + } + if (D_target <= d) { + alert('Target diameter must be larger than core diameter.'); + return; + } + + const L_diameter = (Math.PI / (4 * t)) * (D_target*D_target - d*d) / 1000; + const L_weight = maxWeight * 1000 / (aw * wi); + const L_allowed = Math.min(L_diameter, L_weight); + const D_result = Math.sqrt(d*d + (4*L_allowed*1000*t)/Math.PI); + const W_result = aw * L_allowed * wi / 1000; + const diameterUtil = D_result / D_target * 100; + const weightUtil = W_result / maxWeight * 100; + const lengthDiff = minLength > 0 ? L_allowed - minLength : null; + const epsilon = 0.0001; + let limitingFactor = 'Diameter + Weight'; + + if (L_diameter < L_weight - epsilon) { + limitingFactor = 'Diameter'; + } else if (L_weight < L_diameter - epsilon) { + limitingFactor = 'Weight'; + } + + resLabel.textContent = 'Maximum Allowed Product Length'; + resVal.textContent = L_allowed.toFixed(2) + ' m'; + + const minLengthText = minLength > 0 ? minLength.toFixed(2) + ' m' : 'not set'; + const diffText = lengthDiff !== null ? lengthDiff.toFixed(2) + ' m' : 'n/a'; + let minStatus = '
Minimum length not set
'; + if (minLength > 0 && L_allowed < minLength) { + minStatus = '
Warning: maximum allowed length is below the minimum product length.
'; + } else if (minLength > 0) { + minStatus = '
Minimum length OK
'; + } + + resRange.innerHTML = + '
Resulting diameter: ' + D_result.toFixed(1) + ' mm
' + + '
Resulting weight: ' + W_result.toFixed(1) + ' kg
' + + '
Minimum length: ' + minLengthText + '
' + + '
Difference: ' + diffText + '
' + + '
Limiting factor: ' + limitingFactor + '
' + + '
Utilization: Diameter ' + diameterUtil.toFixed(1) + '% | Weight ' + weightUtil.toFixed(1) + '%
' + + minStatus; + + document.getElementById('d-le').value = L_allowed.toFixed(2); + document.getElementById('d-di').value = D_result.toFixed(1); + document.getElementById('d-wo').value = W_result.toFixed(1); } const wi = parseFloat(document.getElementById('d-wi').value) || 0; @@ -1017,7 +1083,7 @@ document.getElementById('d-calc').addEventListener('click', () => { }); document.getElementById('d-reset').addEventListener('click', () => { - ['d-co', 'd-th', 'd-tol', 'd-le', 'd-di', 'd-wi', 'd-aw', 'd-wo'].forEach(id => { + ['d-co', 'd-th', 'd-tol', 'd-le', 'd-di', 'd-wi', 'd-aw', 'd-wo', 'd-max-weight', 'd-min-le'].forEach(id => { const el = document.getElementById(id); if (el) el.value = id === 'd-co' ? '150' : ''; });