Skip to content

Commit

Permalink
Multiple segments working
Browse files Browse the repository at this point in the history
  • Loading branch information
erikkaashoek committed May 19, 2020
1 parent 309834d commit 5f6b47b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions NanoVNASaver/SweepWorker.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def run(self):
if self.app.sweepStartInput.text() == "" or self.app.sweepEndInput.text() == "":
logger.debug("First sweep - standard range")
# We should handle the first startup by reading frequencies?
sweep_from = 1000000
sweep_to = 800000000
sweep_from = 100000
sweep_to = 350000000
else:
sweep_from = RFTools.parseFrequency(self.app.sweepStartInput.text())
sweep_to = RFTools.parseFrequency(self.app.sweepEndInput.text())
Expand All @@ -97,7 +97,7 @@ def run(self):
return

span = sweep_to - sweep_from
stepsize = int(span / (100 + (self.noSweeps-1)*290))
stepsize = int(span / (290 + (self.noSweeps-1)*290))

# Setup complete

Expand All @@ -112,7 +112,7 @@ def run(self):
logger.debug("Stopping sweeping as signalled")
break
start = sweep_from + i * 290 * stepsize
freq, val11, val21 = self.readAveragedSegment(start, start + 100 * stepsize, self.averages)
freq, val11, val21 = self.readAveragedSegment(start, start + 290 * stepsize, self.averages)

frequencies += freq
values += val11
Expand All @@ -130,7 +130,7 @@ def run(self):
break
start = sweep_from + i*290*stepsize
try:
freq, val11, val21 = self.readSegment(start, start+100*stepsize)
freq, val11, val21 = self.readSegment(start, start+290*stepsize)

frequencies += freq
values += val11
Expand Down Expand Up @@ -159,7 +159,7 @@ def run(self):
break
start = sweep_from + i * 290 * stepsize
try:
_, values, values21 = self.readSegment(start, start + 100 * stepsize)
_, values, values21 = self.readSegment(start, start + 290 * stepsize)
logger.debug("Updating acquired data")
self.updateData(values, values21, i)
except NanoVNAValueException as e:
Expand Down

0 comments on commit 5f6b47b

Please sign in to comment.