From e2543192e90a43a26444a27ccc3b49276a944b2c Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 5 Feb 2026 00:17:19 +0100 Subject: fix: Correct sequence end time calculation in Gantt charts Fixes bug where all sequences appeared to run until demo end time instead of their actual end times in Gantt chart visualizations. Issue: - Both ASCII and HTML Gantt generators initialized seq_end to max_time - This caused all sequences to display full demo duration - Example: SEQ@0s showed (0-36s) instead of actual (0-2s) Fix: - Initialize seq_end to seq_start instead of max_time - Calculate actual end from effects or explicit [end_time] - Sequences now show correct duration in visualizations Before: SEQ@0s [pri=0] (0-36s) # Wrong - shows full demo duration SEQ@2s [pri=0] (2-36s) # Wrong After: SEQ@0s [pri=0] (0-2s) # Correct - shows actual sequence duration SEQ@2s [pri=0] (2-5s) # Correct This makes Gantt charts much more accurate for understanding actual sequence overlap and timing relationships. --- tools/seq_compiler.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/seq_compiler.cc b/tools/seq_compiler.cc index 7ac921f..b61e895 100644 --- a/tools/seq_compiler.cc +++ b/tools/seq_compiler.cc @@ -87,7 +87,7 @@ void generate_gantt_chart(const std::string& output_file, // Draw sequences and effects for (const auto& seq : sequences) { float seq_start = std::stof(seq.start_time); - float seq_end = max_time; // Default: runs until end + float seq_end = seq_start; // Start at sequence start // Check if sequence has explicit end time if (seq.end_time != "-1.0") { @@ -250,7 +250,7 @@ void generate_gantt_html(const std::string& output_file, int y_offset = margin_top; for (const auto& seq : sequences) { float seq_start = std::stof(seq.start_time); - float seq_end = max_time; + float seq_end = seq_start; // Start at sequence start if (seq.end_time != "-1.0") { seq_end = seq_start + std::stof(seq.end_time); -- cgit v1.2.3