From 76f58e05ece3d57fda463c8ef0da18658244bfc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Wed, 24 May 2017 12:26:14 +0200 Subject: [PATCH] Better fix for #1821 Instead of disabling capturing of postroll by default (which we actually don't want and doing so was a mistake thanks to misremembering the meaning of the variable in question), we now properly reset the default value for that check box (which wasn't properly set only due to a very stupid typo). --- .../static/js/app/viewmodels/timelapse.js | 26 ++++++++----------- src/octoprint/timelapse.py | 2 +- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/octoprint/static/js/app/viewmodels/timelapse.js b/src/octoprint/static/js/app/viewmodels/timelapse.js index f6a96c68..e85447ee 100644 --- a/src/octoprint/static/js/app/viewmodels/timelapse.js +++ b/src/octoprint/static/js/app/viewmodels/timelapse.js @@ -10,7 +10,7 @@ $(function() { self.defaultPostRoll = 0; self.defaultInterval = 10; self.defaultRetractionZHop = 0; - self.defaultCapturePostroll = true; + self.defaultCapturePostRoll = true; self.timelapseType = ko.observable(undefined); self.timelapseTimedInterval = ko.observable(self.defaultInterval); @@ -159,18 +159,20 @@ $(function() { // timelapse config self.timelapseType(config.type); - if (config.type == "timed") { - if (config.interval != undefined && config.interval > 0) { - self.timelapseTimedInterval(config.interval); - } + if (config.type == "timed" && config.interval != undefined && config.interval > 0) { + self.timelapseTimedInterval(config.interval); } else { self.timelapseTimedInterval(self.defaultInterval); } - if (config.type == "zchange") { - if (config.retractionZHop != undefined && config.retractionZHop > 0) { - self.timelapseRetractionZHop(config.retractionZHop); - } + if (config.type == "timed" && config.capturePostRoll != undefined){ + self.timelapseCapturePostRoll(config.capturePostRoll); + } else { + self.timelapseCapturePostRoll(self.defaultCapturePostRoll); + } + + if (config.type == "zchange" && config.retractionZHop != undefined && config.retractionZHop > 0) { + self.timelapseRetractionZHop(config.retractionZHop); } else { self.timelapseRetractionZHop(self.defaultRetractionZHop); } @@ -187,12 +189,6 @@ $(function() { self.timelapseFps(self.defaultFps); } - if (config.capturePostRoll != undefined){ - self.timelapseCapturePostRoll(config.capturePostRoll); - } else { - self.timelapseCapturePostRoll(self.defaultCapturePostRoll); - } - self.persist(false); self.isDirty(false); }; diff --git a/src/octoprint/timelapse.py b/src/octoprint/timelapse.py index 63642e94..58de381f 100644 --- a/src/octoprint/timelapse.py +++ b/src/octoprint/timelapse.py @@ -307,7 +307,7 @@ def configure_timelapse(config=None, persist=False): if "options" in config and "interval" in config["options"] and config["options"]["interval"] > 0: interval = config["options"]["interval"] - capture_post_roll = False + capture_post_roll = True if "options" in config and "capturePostRoll" in config["options"] and isinstance(config["options"]["capturePostRoll"], bool): capture_post_roll = config["options"]["capturePostRoll"]