Skip to content

Commit

Permalink
use for cubeviz's export movie
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Nov 10, 2023
1 parent 55ecc15 commit 67825a2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions jdaviz/configs/default/plugins/export_plot/export_plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from jdaviz.core.custom_traitlets import FloatHandleEmpty, IntHandleEmpty
from jdaviz.core.events import AddDataMessage, SnackbarMessage
from jdaviz.core.registries import tray_registry
from jdaviz.core.template_mixin import PluginTemplateMixin, ViewerSelectMixin
from jdaviz.core.template_mixin import PluginTemplateMixin, ViewerSelectMixin, with_spinner
from jdaviz.core.user_api import PluginUserApi

try:
Expand Down Expand Up @@ -146,6 +146,7 @@ def vue_save_figure(self, filetype):
"""
self.save_figure(filetype=filetype)

@with_spinner('movie_recording')
def _save_movie(self, i_start, i_end, fps, filename, rm_temp_files):
# NOTE: All the stuff here has to be in the same thread but
# separate from main app thread to work.
Expand All @@ -161,8 +162,6 @@ def _save_movie(self, i_start, i_end, fps, filename, rm_temp_files):
i_step = 1 # Need n_frames check if we allow tweaking

try:
self.movie_recording = True

while i <= i_end:
if self.movie_interrupt:
break
Expand Down Expand Up @@ -190,7 +189,6 @@ def _save_movie(self, i_start, i_end, fps, filename, rm_temp_files):
if video:
video.release()
slice_plg._on_slider_updated({'new': orig_slice})
self.movie_recording = False

if rm_temp_files or self.movie_interrupt:
for cur_pngfile in temp_png_files:
Expand Down

0 comments on commit 67825a2

Please sign in to comment.