Extend Transport Optimizer

This commit is contained in:
2026-07-07 16:40:30 +02:00
parent 4670666421
commit 7a27fb85c4
3 changed files with 90 additions and 10 deletions
+14
View File
@@ -642,5 +642,19 @@
"endpoint": "/", "endpoint": "/",
"method": "GET", "method": "GET",
"status": 200 "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
} }
] ]
+3 -3
View File
@@ -1,6 +1,6 @@
{ {
"version": "0.4", "version": "v0.4-dev",
"branch": "develop/v0.4", "branch": "develop/v0.4",
"commit": "ffa3481", "commit": "4670666",
"timestamp": "2026-07-07T10:26:13Z" "timestamp": "2026-07-07T16:39:21+02:00"
} }
+73 -7
View File
@@ -48,6 +48,9 @@
.result-label { font-size: 12px; color: #1F5438; font-weight: 600; text-transform: uppercase; } .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-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 { 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 { 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.show { display: block; }
.forklift-check.fc-ok { background: #eafaf1; border: 1.5px solid #28a745; } .forklift-check.fc-ok { background: #eafaf1; border: 1.5px solid #28a745; }
@@ -572,6 +575,20 @@
<span class="unit-label">kg</span> <span class="unit-label">kg</span>
</div> </div>
</div> </div>
<div class="form-group">
<label>Max. Roll Weight</label>
<div class="input-with-unit">
<input type="number" id="d-max-weight" placeholder="kg" min="0" step="1">
<span class="unit-label">kg</span>
</div>
</div>
<div class="form-group">
<label>Minimum Product Length</label>
<div class="input-with-unit">
<input type="number" id="d-min-le" placeholder="m" min="0" step="0.1">
<span class="unit-label">m</span>
</div>
</div>
</div> </div>
</div> </div>
@@ -993,13 +1010,62 @@ document.getElementById('d-calc').addEventListener('click', () => {
resRange.textContent = ''; resRange.textContent = '';
document.getElementById('d-le').value = L_calc.toFixed(2); document.getElementById('d-le').value = L_calc.toFixed(2);
} else if (mode === 'target') { } 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 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'; if (!d || !t || !D_target || !wi || !aw || !maxWeight) {
resVal.textContent = L_calc.toFixed(2) + ' m'; alert('Please enter d, t, max. diameter, roll width, area weight, and max. roll weight.');
resRange.textContent = ''; return;
document.getElementById('d-le').value = L_calc.toFixed(2); }
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 = '<div>Minimum length not set</div>';
if (minLength > 0 && L_allowed < minLength) {
minStatus = '<div class="range-warning">Warning: maximum allowed length is below the minimum product length.</div>';
} else if (minLength > 0) {
minStatus = '<div class="range-ok">Minimum length OK</div>';
}
resRange.innerHTML =
'<div>Resulting diameter: ' + D_result.toFixed(1) + ' mm</div>' +
'<div>Resulting weight: ' + W_result.toFixed(1) + ' kg</div>' +
'<div>Minimum length: ' + minLengthText + '</div>' +
'<div>Difference: ' + diffText + '</div>' +
'<div>Limiting factor: ' + limitingFactor + '</div>' +
'<div>Utilization: Diameter ' + diameterUtil.toFixed(1) + '% | Weight ' + weightUtil.toFixed(1) + '%</div>' +
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; 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', () => { 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); const el = document.getElementById(id);
if (el) el.value = id === 'd-co' ? '150' : ''; if (el) el.value = id === 'd-co' ? '150' : '';
}); });