瀏覽代碼

fix pause time between patterns

Tuan Nguyen 1 年之前
父節點
當前提交
a26b976ef6
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      app.py

+ 7 - 2
app.py

@@ -220,8 +220,8 @@ def run_theta_rho_files(
             # Run the main pattern
             print(f"Running pattern {idx + 1} of {len(file_paths)}: {path}")
             run_theta_rho_file(path)
-
-            if clear_pattern and idx < len(file_paths) - 1:
+            
+            if idx < len(file_paths) -1:
                 if stop_requested:
                     print("Execution stopped before running the next clear pattern.")
                     return
@@ -230,6 +230,11 @@ def run_theta_rho_files(
                     print(f"Pausing for {pause_time} seconds...")
                     time.sleep(pause_time)
 
+            if clear_pattern:
+                if stop_requested:
+                    print("Execution stopped before running the next clear pattern.")
+                    return
+
                 # Determine the clear pattern to run
                 clear_file_path = get_clear_pattern_file(clear_pattern)
                 print(f"Running clear pattern: {clear_file_path}")