From 249ff09f2a5ef90df3f4c165d07b6e036fbf19d5 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Fri, 29 Jun 2018 10:07:21 +0100 Subject: [PATCH] Synchronously decode as much of the telemetry stream as possible before launching the gui, so that errors can be emitted before creating the window. Copied from Perforce Change: 194303 --- mps/tool/monitor | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mps/tool/monitor b/mps/tool/monitor index 92d5fa9a701..e666b845afe 100755 --- a/mps/tool/monitor +++ b/mps/tool/monitor @@ -599,10 +599,14 @@ def main(): with open(args.telemetry, 'rb') as telemetry_file: event_queue = queue.Queue() + model = Model(event_queue) + decoder = telemetry_decoder(telemetry_file.read) + for batch in decoder(): + event_queue.put(batch) + model.update() stop = threading.Event() def decoder_thread(): - decoder = telemetry_decoder(telemetry_file.read) while not stop.isSet(): for batch in decoder(): if stop.isSet(): @@ -611,7 +615,6 @@ def main(): thread = threading.Thread(target=decoder_thread) thread.start() - model = Model(event_queue) qapp = QtWidgets.QApplication([]) app = ApplicationWindow(model, args.telemetry) app.show()