From d40678de70e2cdccab821085d6f4f651bbfbb0b5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 16 Aug 2023 15:50:58 +0100 Subject: [PATCH] MasterTrack: Emit just one revolution of flux if data is index aligned --- src/greaseweazle/track.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/greaseweazle/track.py b/src/greaseweazle/track.py index 77341e74..cc05f54b 100644 --- a/src/greaseweazle/track.py +++ b/src/greaseweazle/track.py @@ -272,8 +272,12 @@ def _flux(self, for_writeout, cue_at_index) -> Union[Flux, WriteoutFlux]: terminate_at_index = splice_at_index) # Package up Flux. - flux_list = flux_list + [flux_ticks+flux_list[0]] + flux_list[1:] - flux = Flux([ticks_to_index]*2, flux_list, + index_list = [ticks_to_index] + if not splice_at_index: + # Emit two revolutions if track data crosses the index. + flux_list = flux_list + [flux_ticks+flux_list[0]] + flux_list[1:] + index_list *= 2 + flux = Flux(index_list, flux_list, sample_freq = ticks_to_index / self.time_per_rev, index_cued = True) flux.splice = sum(bit_ticks[:self.splice])