Kaynağa Gözat

When using M=1 nodes, there's no communication, so set min_ts based on other reported fields

Also move the layout configuration to the top of the file
Ian Goldberg 1 yıl önce
ebeveyn
işleme
a7720fbad8
1 değiştirilmiş dosya ile 13 ekleme ve 9 silme
  1. 13 9
      plot_traces

+ 13 - 9
plot_traces

@@ -8,6 +8,15 @@
 # Outputs trace.tex (and the files pdflatex builds, including the target
 # trace.pdf) into the log directory
 
+# Timescale (cm per second)
+timescale = .5
+
+# Nodescale (cm between nodes)
+nodescale = 1
+
+# Seconds between time label ticks
+time_tick = 2
+
 import glob
 import os
 import re
@@ -76,6 +85,8 @@ for nodelog in nodelogs:
                 elif typ == 'complete':
                     typ = 'F'
                 labels[node].append((tsf, typ))
+                if min_ts is None or min_ts > tsf:
+                    min_ts = tsf
                 if max_ts is None or max_ts < tsf:
                     max_ts = tsf
             elif matches := re.match(
@@ -102,6 +113,8 @@ for nodelog in nodelogs:
                 elif typ == 'End':
                     typ = 'W'
                 labels[node].append((tsf, typ))
+                if min_ts is None or min_ts > tsf:
+                    min_ts = tsf
                 if max_ts is None or max_ts < tsf:
                     max_ts = tsf
             elif matches := re.match(
@@ -159,15 +172,6 @@ for nodelog in nodelogs:
 
 # Write a latex file that draws the messages
 
-# Timescale (cm per second)
-timescale = 2
-
-# Nodescale (cm between nodes)
-nodescale = 1
-
-# Seconds between time label ticks
-time_tick = 1
-
 with open("trace.tex", "w") as tf:
     print(r'''\documentclass{article}
 \usepackage[paperwidth=%fcm,paperheight=%fcm,margin=1cm]{geometry}