Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
su
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dmeiss2s
su
Commits
2de6ec84
Commit
2de6ec84
authored
9 years ago
by
Daniel Meißner
Committed by
Daniel Meißner
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
let's make file capturing happening
parent
b86f2851
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+11
-0
11 additions, 0 deletions
README.md
lib/gr/file_sink.py
+14
-12
14 additions, 12 deletions
lib/gr/file_sink.py
lib/gui/gui.py
+6
-0
6 additions, 0 deletions
lib/gui/gui.py
with
31 additions
and
12 deletions
README.md
+
11
−
0
View file @
2de6ec84
# SU aka Spectrum Usage
## Usage
### Environment variables
There are environment variables available to define configuration
parameters during start:
```
SU_DUMP_FILE_PATH=/home/user/su/dump_file.iq
```
## Requirements
### Software
...
...
This diff is collapsed.
Click to expand it.
lib/gr/file_sink.py
+
14
−
12
View file @
2de6ec84
# -*- coding: utf-8 -*-
import
os
import
logging
import
osmosdr
...
...
@@ -26,7 +27,7 @@ class FileSink(gr.top_block):
):
gr
.
top_block
.
__init__
(
self
,
"
file_sink_block
"
)
self
.
file_path
=
dump_file
self
.
file_path
=
str
(
dump_file
)
self
.
samp_rate
=
samp_rate
self
.
freq
=
freq
self
.
capture_time
=
capture_time
...
...
@@ -45,10 +46,11 @@ class FileSink(gr.top_block):
"""
Capture samples to dump file.
"""
tb
=
top_block
()
tb
.
start
()
tb
.
stop
()
tb
.
wait
()
logging
.
info
(
"
Start
'
%s
'
capture.
"
%
self
.
file_path
)
self
.
start
()
self
.
wait
()
logging
.
info
(
"
Capture
'
%s
'
done.
"
%
self
.
file_path
)
def
get_file_path
(
self
):
return
self
.
file_path
...
...
@@ -86,13 +88,13 @@ class FileSink(gr.top_block):
# configure additional blocks
self
.
blocks_head_0
=
blocks
.
head
(
gr
.
sizeof_gr_complex
*
1
,
\
int
(
self
.
samp_rate
)
*
self
.
capture_time
)
self
.
blocks_file_meta_sink_0
=
blocks
.
file_meta_sink
(
gr
.
sizeof_gr_complex
*
1
,
\
self
.
file_path
,
\
self
.
samp_rate
,
\
1
,
\
blocks
.
GR_FILE_FLOAT
,
\
True
,
1000000
,
""
,
False
)
self
.
blocks_file_meta_sink_0
=
blocks
.
file_meta_sink
(
\
gr
.
sizeof_gr_complex
*
1
,
\
self
.
file_path
,
\
self
.
samp_rate
,
\
1
,
\
blocks
.
GR_FILE_FLOAT
,
\
True
,
1000000
,
""
,
False
)
self
.
blocks_file_meta_sink_0
.
set_unbuffered
(
False
)
# connect blocks
self
.
connect
((
self
.
blocks_head_0
,
0
),
(
self
.
blocks_file_meta_sink_0
,
0
))
...
...
This diff is collapsed.
Click to expand it.
lib/gui/gui.py
+
6
−
0
View file @
2de6ec84
...
...
@@ -5,6 +5,7 @@ import os
import
logging
import
datetime
import
re
import
threading
from
PyQt5
import
QtCore
,
QtGui
,
QtWidgets
,
uic
...
...
@@ -81,6 +82,8 @@ class SuGui(QtWidgets.QMainWindow):
options
[
'
device
'
]
)
file_sink
.
capture
()
def
stop_button
(
self
):
...
...
@@ -231,6 +234,9 @@ class SuGui(QtWidgets.QMainWindow):
return
{
radio_button
:
value
}
def
_set_default_dump_file_path
(
self
):
"""
Set default dump file path.
"""
if
"
SU_DUMP_FILE_PATH
"
in
os
.
environ
:
self
.
lineEdit_dump_file
.
setText
(
os
.
environ
[
'
SU_DUMP_FILE_PATH
'
])
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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