From bedcbb80bea4aa5a99f8bac041eaa9db9aa9f495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 26 Oct 2017 16:38:40 +0200 Subject: [PATCH] Set a minimum delay of 1s between snapshots Followup to #2067 --- src/octoprint/server/api/timelapse.py | 2 +- src/octoprint/templates/tabs/timelapse.jinja2 | 10 +++++----- src/octoprint/timelapse.py | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/octoprint/server/api/timelapse.py b/src/octoprint/server/api/timelapse.py index ae160c8a..1c4b5920 100644 --- a/src/octoprint/server/api/timelapse.py +++ b/src/octoprint/server/api/timelapse.py @@ -241,7 +241,7 @@ def setTimelapseConfig(): except ValueError: return make_response("Invalid value for minimum delay: %r" % data["minDelay"], 400) else: - if minDelay >= 0: + if minDelay > 0: config["options"]["minDelay"] = minDelay else: return make_response("Invalid value for minimum delay: %f" % minDelay, 400) diff --git a/src/octoprint/templates/tabs/timelapse.jinja2 b/src/octoprint/templates/tabs/timelapse.jinja2 index 5b86885e..82e6dc36 100644 --- a/src/octoprint/templates/tabs/timelapse.jinja2 +++ b/src/octoprint/templates/tabs/timelapse.jinja2 @@ -22,7 +22,7 @@
- + {{ _('sec') }}
{{ _('OctoPrint will rate limit snapshots to this minimum interval. This it to prevent against performance issues with vase mode/continous z prints.') }} @@ -33,7 +33,7 @@
- + {{ _('sec') }}
@@ -43,7 +43,7 @@
- + {{ _('fps') }}
@@ -53,7 +53,7 @@
- + {{ _('sec') }}
{{ _('OctoPrint will take additional pictures to add this many seconds to the end of your rendered timelapse.') }} @@ -73,7 +73,7 @@
- + {{ _('mm') }}
{{ _('Enter the retraction z-hop used in the firmware or the gcode file to trigger snapshots for the timelapse only if a real layer change happens. For this to work properly your retraction z-hop has to be different from your layerheight!') }} diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index dc1117b4..5b645853 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -301,11 +301,11 @@ def configure_timelapse(config=None, persist=False): elif "zchange" == type: retractionZHop = 0 - if "options" in config and "retractionZHop" in config["options"] and config["options"]["retractionZHop"] > 0: + if "options" in config and "retractionZHop" in config["options"] and config["options"]["retractionZHop"] >= 0: retractionZHop = config["options"]["retractionZHop"] minDelay = 5 - if "options" in config and "minDelay" in config["options"] and config["options"]["minDelay"] >= 0: + if "options" in config and "minDelay" in config["options"] and config["options"]["minDelay"] > 0: minDelay = config["options"]["minDelay"] current = ZTimelapse(post_roll=postRoll, retraction_zhop=retractionZHop, min_delay=minDelay, fps=fps)