Skip to content

Commit

Permalink
Merge pull request #1070 from anarkiwi/pct
Browse files Browse the repository at this point in the history
percentage.
  • Loading branch information
anarkiwi authored Jan 4, 2024
2 parents 176e763 + bcecb94 commit 3a9f48e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gamutrf/grsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(
self.set_msg_handler(pmt.intern(cmd_port), self.handle_cmd)
self.need_tags = False
self.tags_sent = 0
logging.info("opened %s with %u samples", input_file, self.n_samples)

def complete(self):
return self.i >= self.n_samples
Expand All @@ -81,6 +82,7 @@ def add_tags(self):
sample_time = self.ctime + (
(self.tags_sent * self.nfft * self.tune_step_fft) / float(self.sample_rate)
)
logging.info("%.1f%%", self.i / self.n_samples * 100)
sample_sec = int(sample_time)
sample_fsec = sample_time - sample_sec
pmt_sample_time = pmt.make_tuple(
Expand All @@ -95,6 +97,7 @@ def add_tags(self):

def general_work(self, input_items, output_items):
if self.complete():
logging.info("100%%")
return -1
if self.need_tags:
self.add_tags()
Expand Down

0 comments on commit 3a9f48e

Please sign in to comment.