simplyprint: fix layer detect divide by zero

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2024-04-03 10:44:04 -04:00
parent a3e4dac5fb
commit 99b97afc7d
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 3 additions and 3 deletions

View File

@ -1289,9 +1289,9 @@ class LayerDetect:
def start(self, metadata: Dict[str, Any]) -> None:
self.reset()
lh: Optional[float] = metadata.get("layer_height")
flh: Optional[float] = metadata.get("first_layer_height", lh)
if lh is not None and flh is not None:
lh: float = metadata.get("layer_height", 0)
flh: float = metadata.get("first_layer_height", lh)
if lh > 0.000001 and flh > 0.000001:
self._active = True
self._layer_height = lh
self._fl_height = flh