Skip to content

Commit

Permalink
Use colspan=2 for the per-axle cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwf-rr committed Apr 30, 2024
1 parent 1c55709 commit f8b5b15
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Source/RunActivity/Viewer3D/WebServices/Web/HUD/index.js
Expand Up @@ -86,8 +86,9 @@ function ApiHeadUpDisplay() {
DebugWidthTofix = ['primitives','Camera'],
// Force information
ForceColSpanTo15 = ['Wind Speed'],
ForceColSpanTo4 = ['(Simple adhesion model)','Dynamic brake'],
ForceColSpanTo3 = ['Axle out force','Loco Adhesion','Wagon Adhesion'],
ForceColSpanTo4 = ['(Advanced adhesion model)', '(Simple adhesion model)'],
ForceColSpanTo3 = ['Wheel slip (Thres)', 'Conditions', 'Axle drive force', 'Axle brake force', 'Number of substeps', 'Wheel Adh. (Max)',
'Axle out force', 'Comp Axle out force', 'Wheel speed (Slip)', 'Wheel ang. pos.', 'Loco Adhesion', 'Wagon Adhesion'],
// Brake information
BrakeColSpanTo2 = ['PlayerLoco','Brake Sys Vol'];

Expand All @@ -96,6 +97,7 @@ function ApiHeadUpDisplay() {
var colspanmax = false,
colspan10 = false,
colspan3 = false,
colspan2 = false,
fixwidth = false,
locomotivetype = false;

Expand Down Expand Up @@ -126,6 +128,10 @@ function ApiHeadUpDisplay() {
locomotivetype = true;
Str += "<td colspan='2' >" + obj.extraTable.values[next] + "</td>";
}
else if (colspan2)
{
Str += "<td class='td_nowrap' colspan='2' >" + obj.extraTable.values[next] + "</td>";
}
else if (colspan3 || BrakeColSpanTo2.indexOf(obj.extraTable.values[next]) !== -1){
Str += "<td colspan='3' >" + obj.extraTable.values[next] + "</td>";
}
Expand All @@ -144,6 +150,7 @@ function ApiHeadUpDisplay() {
}
else if (ForceColSpanTo3.indexOf(obj.extraTable.values[next]) !== -1 ){
Str += "<td colspan='3' >" + obj.extraTable.values[next] + "</td>";
colspan2 = true; // data cells in these row span two columns
}
else {
// Apply colspan if required after first col
Expand Down

0 comments on commit f8b5b15

Please sign in to comment.