Skip to content

Commit c5a143c

Browse files
committed
Check if recording file exists before recording
1 parent 598e691 commit c5a143c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

microscope/plugins/record_plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ def _set_record(self, start):
282282
self.current_filepath = Path(self.filename.parent) / Path(
283283
f'{self.filename.stem}_{self.start_time.strftime("%b-%d-%Y_%H%M%S")}.{self.file_extension}'
284284
)
285+
if self.current_filepath.exists():
286+
print("Already recording")
287+
return
285288
print(f"Writing to {self.current_filepath}")
286289
# self.out = cv.VideoWriter(str(self.current_filepath), self.fourcc, 5.0, (self.width,self.height))
287290
self.video_recorder_thread.start(

0 commit comments

Comments
 (0)