Fixed reporting of duration needed for capturing timelapse postroll
Needs to be calculated differently for time based and z-triggered. Capture interval
was not taken properly into account.
(cherry picked from commit 9284ff4)
This commit is contained in:
parent
918ffa2557
commit
abf073340f
2 changed files with 20 additions and 6 deletions
|
|
@ -195,15 +195,23 @@ function DataUpdater(allViewModels) {
|
|||
hide: false
|
||||
});
|
||||
} else if (type == "PostRollStart") {
|
||||
if (payload.postroll_duration > 60) {
|
||||
format = {duration: _.sprintf(gettext("%(minutes)d min"), {minutes: payload.postroll_duration / 60})};
|
||||
var title = gettext("Capturing timelapse postroll");
|
||||
|
||||
var text;
|
||||
if (!payload.postroll_duration) {
|
||||
text = _.sprintf(gettext("Now capturing timelapse post roll, this will take only a moment..."), format);
|
||||
} else {
|
||||
format = {duration: _.sprintf(gettext("%(seconds)d sec"), {seconds: payload.postroll_duration})};
|
||||
if (payload.postroll_duration > 60) {
|
||||
format = {duration: _.sprintf(gettext("%(minutes)d min"), {minutes: payload.postroll_duration / 60})};
|
||||
} else {
|
||||
format = {duration: _.sprintf(gettext("%(seconds)d sec"), {seconds: payload.postroll_duration})};
|
||||
}
|
||||
text = _.sprintf(gettext("Now capturing timelapse post roll, this will take approximately %(duration)s..."), format);
|
||||
}
|
||||
|
||||
new PNotify({
|
||||
title: gettext("Capturing timelapse postroll"),
|
||||
text: _.sprintf(gettext("Now capturing timelapse post roll, this will take approximately %(duration)s..."), format)
|
||||
title: title,
|
||||
text: text
|
||||
});
|
||||
} else if (type == "SlicingStarted") {
|
||||
gcodeUploadProgress.addClass("progress-striped").addClass("active");
|
||||
|
|
|
|||
|
|
@ -233,7 +233,7 @@ class Timelapse(object):
|
|||
return f
|
||||
|
||||
if self._post_roll > 0:
|
||||
eventManager().fire(Events.POSTROLL_START, dict(postroll_duration=self.post_roll * self.fps, postroll_length=self.post_roll, postroll_fps=self.fps))
|
||||
eventManager().fire(Events.POSTROLL_START, dict(postroll_duration=self.calculate_post_roll(), postroll_length=self.post_roll, postroll_fps=self.fps))
|
||||
self._post_roll_start = time.time()
|
||||
if doCreateMovie:
|
||||
self._on_post_roll_done = getWaitForCaptures(resetAndCreate)
|
||||
|
|
@ -247,6 +247,9 @@ class Timelapse(object):
|
|||
else:
|
||||
resetImageNumber()
|
||||
|
||||
def calculate_post_roll(self):
|
||||
return None
|
||||
|
||||
def process_post_roll(self):
|
||||
self.post_roll_finished()
|
||||
|
||||
|
|
@ -470,6 +473,9 @@ class TimedTimelapse(Timelapse):
|
|||
self._postroll_captures = self.post_roll * self.fps
|
||||
Timelapse.on_print_done(self, event, payload)
|
||||
|
||||
def calculate_post_roll(self):
|
||||
return self.post_roll * self.fps * self.interval
|
||||
|
||||
def process_post_roll(self):
|
||||
pass
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue