Tuan Nguyen 11 місяців тому
батько
коміт
26bc9220b0

+ 4 - 4
dune_weaver_flask/modules/core/pattern_manager.py

@@ -216,8 +216,9 @@ def run_theta_rho_file(file_path, schedule_hours=None):
                 
                 
                 if i != 0:
                 if i != 0:
                     pbar.update(1)
                     pbar.update(1)
-                    estimated_remaining_time = pbar.format_dict['elapsed'] / i * total_coordinates
-                    state.execution_progress = (i, total_coordinates, estimated_remaining_time)
+                    estimated_remaining_time = (total_coordinates - i) / pbar.format_dict['rate'] if pbar.format_dict['rate'] and total_coordinates else 0
+                    elapsed_time = pbar.format_dict['elapsed']
+                    state.execution_progress = (i, total_coordinates, estimated_remaining_time, elapsed_time)
 
 
         serial_manager.check_idle()
         serial_manager.check_idle()
 
 
@@ -239,7 +240,6 @@ def run_theta_rho_files(file_paths, pause_time=0, clear_pattern=None, run_mode="
     while True:
     while True:
         for idx, path in enumerate(file_paths):
         for idx, path in enumerate(file_paths):
             logger.info(f"Upcoming pattern: {path}")
             logger.info(f"Upcoming pattern: {path}")
-            logger.info(idx)
             current_playing_index = idx
             current_playing_index = idx
             schedule_checker(schedule_hours)
             schedule_checker(schedule_hours)
             if state.stop_requested:
             if state.stop_requested:
@@ -264,7 +264,7 @@ def run_theta_rho_files(file_paths, pause_time=0, clear_pattern=None, run_mode="
                     logger.info("Execution stopped before running the next clear pattern")
                     logger.info("Execution stopped before running the next clear pattern")
                     return
                     return
                 if pause_time > 0:
                 if pause_time > 0:
-                    logger.debug(f"Pausing for {pause_time} seconds")
+                    logger.info(f"Pausing for {pause_time} seconds")
                     time.sleep(pause_time)
                     time.sleep(pause_time)
 
 
         if run_mode == "indefinite":
         if run_mode == "indefinite":

+ 1 - 1
dune_weaver_flask/static/js/main.js

@@ -1495,7 +1495,7 @@ async function updateCurrentlyPlaying() {
             if (execution_progress) {
             if (execution_progress) {
                 const progressPercentage = (execution_progress[0] / execution_progress[1]) * 100;
                 const progressPercentage = (execution_progress[0] / execution_progress[1]) * 100;
                 progressBar.value = progressPercentage;
                 progressBar.value = progressPercentage;
-                progressText.textContent = `${Math.round(progressPercentage)}% (${formatSecondsToHMS(execution_progress[2])})`;
+                progressText.textContent = `${Math.round(progressPercentage)}% (Elapsed: ${formatSecondsToHMS(execution_progress[3])} | Remaining: ${formatSecondsToHMS(execution_progress[2])})`;
             } else {
             } else {
                 progressBar.value = 0;
                 progressBar.value = 0;
                 progressText.textContent = '0%';
                 progressText.textContent = '0%';