Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ionosonde
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nick Hoang
ionosonde
Commits
5bcbe09b
Commit
5bcbe09b
authored
3 years ago
by
Peje Nilsson
Browse files
Options
Downloads
Patches
Plain Diff
Fix exiting gracefully
parent
214a5f68
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rx_uhd.py
+8
-3
8 additions, 3 deletions
rx_uhd.py
with
8 additions
and
3 deletions
rx_uhd.py
+
8
−
3
View file @
5bcbe09b
...
...
@@ -29,13 +29,13 @@ import signal
from
datetime
import
datetime
,
timedelta
import
traceback
Exit
=
False
# Used to signal an orderly exit
Want
Exit
=
False
# Used to signal an orderly exit
def
orderlyExit
(
signalNumber
,
frame
):
global
Exit
global
Want
Exit
# Signal that we want to exit after current sweep
Exit
=
True
Want
Exit
=
True
def
tune_at
(
u
,
t0
,
f0
=
4e6
):
...
...
@@ -108,6 +108,8 @@ def receive_continuous(u, t0, t_now, ic, log, sample_rate=1000000.0):
New receive script, which processes data incoming from the usrp
one packet at a time.
"""
global
WantExit
s
=
ic
.
s
gps_mon
=
gl
.
gpsdo_monitor
(
u
,
log
,
exit_on_lost_lock
=
False
)
# sweep timing and frequencies
...
...
@@ -177,6 +179,7 @@ def receive_continuous(u, t0, t_now, ic, log, sample_rate=1000000.0):
tune_at
(
u
,
t0
+
s
.
freq_dur
,
f0
=
s
.
freq
(
1
))
locked
=
True
Exit
=
False
try
:
while
locked
and
not
Exit
:
num_rx_samps
=
rx_stream
.
recv
(
recv_buffer
,
md
,
timeout
=
timeout
)
...
...
@@ -246,6 +249,8 @@ def receive_continuous(u, t0, t_now, ic, log, sample_rate=1000000.0):
datetime
.
fromtimestamp
(
cycle_t0
).
strftime
(
"
%FT%T.%f
"
)[:
-
3
]
)
)
Exit
=
WantExit
# we've got a full freq step
next_sample
+=
n_per_freq
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment