From 49bc95feb0c8569c24a010953d320a9c5b2d63b1 Mon Sep 17 00:00:00 2001 From: Jonas Schumacher Date: Sun, 13 Nov 2022 16:07:53 +0100 Subject: [PATCH] Discriminate between interactive and non-interactive mode --- src/examples/julia/producerConsumer.jl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/examples/julia/producerConsumer.jl b/src/examples/julia/producerConsumer.jl index 26b861e5..c8ddcf77 100644 --- a/src/examples/julia/producerConsumer.jl +++ b/src/examples/julia/producerConsumer.jl @@ -133,4 +133,17 @@ consumer = @tspawnat 3 begin end masterTrigger!(rp, false) serverMode!(rp, CONFIGURATION) +end + +if isinteractive() + @info "You can now access the data via the variable `buffer`." +else + # Wait for the consumer since otherwise Julia just terminates in non-interactive mode. + wait(consumer) + + figure(1) + clf() + # Frame dimensions are [samples, chan, periods, frames] + plot(vec(buffer[:, 1, :, :])) + savefig("images/producerConsumer.png") end \ No newline at end of file