fixed divide by zero error

This commit is contained in:
Adam Saudagar 2021-05-03 00:09:33 +05:30
parent bfb498d1c9
commit aa207dae02
2 changed files with 8 additions and 5 deletions

View File

@ -89,7 +89,7 @@ class FullAuto(IEngine):
if self.window.crop is None:
log_raise("FishyQR not found")
if not self.calibrator.all_callibrated():
if not self.calibrator.all_calibrated():
log_raise("you need to calibrate first")
self.fisher.toggle_start()
@ -131,8 +131,8 @@ class FullAuto(IEngine):
logging.error("set target first")
return
if not self.calibrator.all_callibrated():
logging.error("you need to callibrate first")
if not self.calibrator.all_calibrated():
logging.error("you need to calibrate first")
return
current = self.get_coods()

View File

@ -62,8 +62,11 @@ class Calibrator(IMode):
# endregion
def all_callibrated(self):
return self.move_factor is not None and self.rot_factor is not None
def all_calibrated(self):
return self.move_factor is not None and \
self.rot_factor is not None and \
self.move_factor != 0 and \
self.rot_factor != 0
def toggle_show(self):
self.engine.show_crop = not self.engine.show_crop