Skip to content

Commit

Permalink
multiprocessing in 10 second chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
kbasaran committed Apr 2, 2024
1 parent 3b6867f commit 2aae425
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion generictools
Submodule generictools updated 1 files
+3 −5 signal_tools.py
7 changes: 5 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
from generictools.signal_tools import TestSignal, make_fade_window_n, calculate_3rd_octave_bands
from dataclasses import dataclass, fields
import logging
import multiprocessing

home_folder = os.path.expanduser("~")
logging.basicConfig(level=logging.DEBUG,
Expand Down Expand Up @@ -1624,6 +1625,7 @@ def play_clicked():
"signal_object": self.generated_signal,
"loop": play_in_loop_widget.checkState(),
"requested_voltages": requested_voltages,
"stop_after_min": stop_after_widget.value(),
}

self.player.ugs_play(stream_settings, play_kwargs)
Expand Down Expand Up @@ -1994,8 +1996,6 @@ def __init__(self, parent=None):
self.ax = fig.add_subplot(111)
fig.tight_layout()



@qtc.Slot(TestSignal)
def update_plot(self, generated_signal):
self.ax.cla()
Expand Down Expand Up @@ -2028,6 +2028,9 @@ def clear_plot(self):

def main():
global settings, app_definition
if os.name == "nt":
# bug: https://stackoverflow.com/questions/22644805/cx-freeze-creates-multiple-instances-of-program
multiprocessing.freeze_support()
logging.info("Starting application")
settings = Settings(app_definitions["app_name"])

Expand Down

0 comments on commit 2aae425

Please sign in to comment.