Fixed max dimensions and scan direction on serpentine pattern
This commit is contained in:
parent
9a49488760
commit
57399de03f
2 changed files with 9 additions and 5 deletions
|
|
@ -353,14 +353,14 @@ class AppGUI:
|
||||||
|
|
||||||
# Max Width
|
# Max Width
|
||||||
ttk.Label(inner2, text="Max W:").pack(side=tk.LEFT)
|
ttk.Label(inner2, text="Max W:").pack(side=tk.LEFT)
|
||||||
self.max_width_var = tk.IntVar(value=5000)
|
self.max_width_var = tk.IntVar(value=1000)
|
||||||
self.max_width_entry = ttk.Entry(inner2, textvariable=self.max_width_var, width=7)
|
self.max_width_entry = ttk.Entry(inner2, textvariable=self.max_width_var, width=7)
|
||||||
self.max_width_entry.pack(side=tk.LEFT, padx=(2, 5))
|
self.max_width_entry.pack(side=tk.LEFT, padx=(2, 5))
|
||||||
self.max_width_entry.bind('<Return>', lambda e: self._update_stitch_config())
|
self.max_width_entry.bind('<Return>', lambda e: self._update_stitch_config())
|
||||||
|
|
||||||
# Max Height
|
# Max Height
|
||||||
ttk.Label(inner2, text="Max H:").pack(side=tk.LEFT)
|
ttk.Label(inner2, text="Max H:").pack(side=tk.LEFT)
|
||||||
self.max_height_var = tk.IntVar(value=5000)
|
self.max_height_var = tk.IntVar(value=1000)
|
||||||
self.max_height_entry = ttk.Entry(inner2, textvariable=self.max_height_var, width=7)
|
self.max_height_entry = ttk.Entry(inner2, textvariable=self.max_height_var, width=7)
|
||||||
self.max_height_entry.pack(side=tk.LEFT, padx=(2, 5))
|
self.max_height_entry.pack(side=tk.LEFT, padx=(2, 5))
|
||||||
self.max_height_entry.bind('<Return>', lambda e: self._update_stitch_config())
|
self.max_height_entry.bind('<Return>', lambda e: self._update_stitch_config())
|
||||||
|
|
|
||||||
|
|
@ -507,10 +507,14 @@ class StitchingScanner:
|
||||||
stop_reason = 'timeout'
|
stop_reason = 'timeout'
|
||||||
break
|
break
|
||||||
|
|
||||||
if current_dim() >= max_dim:
|
if current_dim() >= max_dim and direction == ScanDirection.RIGHT:
|
||||||
self.log(f"Max dimension reached ({current_dim()}px)")
|
self.log(f"Max dimension reached ({current_dim()}px)")
|
||||||
stop_reason = 'max_dim'
|
stop_reason = 'max_dim'
|
||||||
break
|
break
|
||||||
|
if current_dim() <= 0 and direction == ScanDirection.LEFT:
|
||||||
|
self.log(f"Max dimension reached ({current_dim()}px)")
|
||||||
|
stop_reason = 'min_dim'
|
||||||
|
break
|
||||||
|
|
||||||
if abs(total_x) >= self.config.max_mosaic_width:
|
if abs(total_x) >= self.config.max_mosaic_width:
|
||||||
self.log(f"Max dimension reached ({self.config.max_mosaic_width}px)")
|
self.log(f"Max dimension reached ({self.config.max_mosaic_width}px)")
|
||||||
|
|
@ -519,8 +523,8 @@ class StitchingScanner:
|
||||||
elif direction == ScanDirection.LEFT:
|
elif direction == ScanDirection.LEFT:
|
||||||
self.state.current_x = 0
|
self.state.current_x = 0
|
||||||
self.log(f"Current X offset ({self.state.current_x}px)")
|
self.log(f"Current X offset ({self.state.current_x}px)")
|
||||||
stop_reason = 'max_dim'
|
# stop_reason = 'max_dim'
|
||||||
break
|
# break
|
||||||
# Pulse motor
|
# Pulse motor
|
||||||
self.motion.send_command(start_cmd)
|
self.motion.send_command(start_cmd)
|
||||||
time.sleep(self.config.movement_interval)
|
time.sleep(self.config.movement_interval)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue