Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
uhd_spectrum
提交
168e8110
uhd_spectrum
项目概览
colorEagleStdio
/
uhd_spectrum
通知
18
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uhd_spectrum
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
168e8110
编写于
3月 20, 2021
作者:
M
manjaro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete unused interfaces
上级
334517de
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
154 deletion
+4
-154
specwidget.cpp
specwidget.cpp
+3
-111
specwidget.h
specwidget.h
+1
-43
未找到文件。
specwidget.cpp
浏览文件 @
168e8110
...
...
@@ -39,14 +39,7 @@ specWidget::specWidget(QWidget *parent) :
//连接
//connect (ui->plotter,&CPlotter::newDemodFreq,ui->freqCtrl,&CFreqCtrl::setFrequency);
connect
(
ui
->
plotter
,
&
CPlotter
::
newCenterFreq
,
this
,
&
specWidget
::
evt_newCenterFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newDemodFreq
,
this
,
&
specWidget
::
evt_newDemodFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newDemodFreq
,
this
,
&
specWidget
::
slot_newDemodFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newLowCutFreq
,
this
,
&
specWidget
::
evt_newLowCutFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newHighCutFreq
,
this
,
&
specWidget
::
evt_newHighCutFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newFilterFreq
,
this
,
&
specWidget
::
evt_newFilterFreq
);
connect
(
ui
->
plotter
,
&
CPlotter
::
pandapterRangeChanged
,
this
,
&
specWidget
::
evt_pandapterRangeChanged
);
connect
(
ui
->
plotter
,
&
CPlotter
::
newZoomLevel
,
this
,
&
specWidget
::
evt_newZoomLevel
);
connect
(
ui
->
freqCtrl
,
&
CFreqCtrl
::
newFrequency
,
this
,
&
specWidget
::
setCenterFreq
);
connect
(
watcher
,
&
stdout_watcher
::
evt_stdata
,
this
,
&
specWidget
::
slot_msg
,
Qt
::
QueuedConnection
);
loadSettings
();
...
...
@@ -83,44 +76,6 @@ void specWidget::slot_msg(QByteArray s, bool bStdErr)
QString
::
fromUtf8
(
s
));
}
void
specWidget
::
setNewFftData
(
const
double
*
rfftData
,
int
size
)
{
ui
->
plotter
->
setNewFftData
(
rfftData
,
size
);
}
void
specWidget
::
setNewFftDataWf
(
const
double
*
rfftData
,
const
double
*
rwfData
,
int
size
)
{
ui
->
plotter
->
setNewFftData
(
rfftData
,
rwfData
,
size
);
}
void
specWidget
::
setMaxPixmapSize
(
int
w
,
int
h
)
{
ui
->
plotter
->
setMaxPixmapSize
(
QSize
(
w
,
h
));
}
void
specWidget
::
setRunningState
(
bool
running
)
{
ui
->
plotter
->
setRunningState
(
running
);
}
void
specWidget
::
setClickResolution
(
int
clickres
)
{
ui
->
plotter
->
setClickResolution
(
clickres
);
}
void
specWidget
::
setFilterClickResolution
(
int
clickres
)
{
ui
->
plotter
->
setFilterClickResolution
(
clickres
);
}
void
specWidget
::
setFilterBoxEnabled
(
bool
enabled
)
{
ui
->
plotter
->
setFilterBoxEnabled
(
enabled
);
}
void
specWidget
::
setCenterLineEnabled
(
bool
enabled
)
{
ui
->
plotter
->
setCenterLineEnabled
(
enabled
);
}
void
specWidget
::
setTooltipsEnabled
(
bool
enabled
){
ui
->
plotter
->
setTooltipsEnabled
(
enabled
);
}
void
specWidget
::
setBookmarksEnabled
(
bool
enabled
){
ui
->
plotter
->
setBookmarksEnabled
(
enabled
);
}
void
specWidget
::
setCenterFreq
(
quint64
f
){
if
(
f
<=
0
)
return
;
...
...
@@ -130,75 +85,12 @@ void specWidget::setCenterFreq(quint64 f){
ui
->
doubleSpinBox_center
->
setValue
(
ui
->
freqCtrl
->
getFrequency
()
/
1e6
);
//ui->plotter->setCenterFreq(f);
}
void
specWidget
::
setFreqUnits
(
qint32
unit
){
ui
->
plotter
->
setFreqUnits
(
unit
);
}
void
specWidget
::
setDemodCenterFreq
(
quint64
f
){
ui
->
plotter
->
setDemodCenterFreq
(
f
);
}
void
specWidget
::
setFilterOffset
(
qint64
freq_hz
){
ui
->
plotter
->
setFilterOffset
(
freq_hz
);
}
qint64
specWidget
::
getFilterOffset
(
void
){
return
ui
->
plotter
->
getFilterOffset
();
}
int
specWidget
::
getFilterBw
(){
return
ui
->
plotter
->
getFilterBw
();
}
void
specWidget
::
setHiLowCutFrequencies
(
int
LowCut
,
int
HiCut
){
ui
->
plotter
->
setHiLowCutFrequencies
(
LowCut
,
HiCut
);
}
void
specWidget
::
getHiLowCutFrequencies
(
int
*
LowCut
,
int
*
HiCut
){
ui
->
plotter
->
getHiLowCutFrequencies
(
LowCut
,
HiCut
);
}
void
specWidget
::
setDemodRanges
(
int
FLowCmin
,
int
FLowCmax
,
int
FHiCmin
,
int
FHiCmax
,
bool
symetric
){
ui
->
plotter
->
setDemodRanges
(
FLowCmin
,
FLowCmax
,
FHiCmin
,
FHiCmax
,
symetric
);
}
void
specWidget
::
setSpanFreq
(
quint32
s
){
ui
->
plotter
->
setSpanFreq
(
s
);
}
void
specWidget
::
setMaxBandiwdth
(
int
m
){
ui
->
plotter
->
setMaxBandiwdth
(
m
);
}
void
specWidget
::
setHdivDelta
(
int
delta
){
ui
->
plotter
->
setHdivDelta
(
delta
);
}
void
specWidget
::
setVdivDelta
(
int
delta
){
ui
->
plotter
->
setVdivDelta
(
delta
);
}
void
specWidget
::
setFreqDigits
(
int
digits
){
ui
->
plotter
->
setFreqDigits
(
digits
);
}
void
specWidget
::
setSampleRate
(
double
rate
){
rate
=
set_rx_rate
(
rate
);
set_tx_rate
(
rate
);
ui
->
plotter
->
setSampleRate
(
rate
);
}
double
specWidget
::
getSampleRate
(
void
){
return
ui
->
plotter
->
getSampleRate
();
}
void
specWidget
::
setFftCenterFreq
(
qint64
f
){
ui
->
plotter
->
setFftCenterFreq
(
f
);
}
int
specWidget
::
getNearestPeak
(
QPoint
pt
){
return
ui
->
plotter
->
getNearestPeak
(
pt
);
}
void
specWidget
::
setWaterfallSpan
(
quint64
span_ms
){
ui
->
plotter
->
setWaterfallSpan
(
span_ms
);
}
quint64
specWidget
::
getWfTimeRes
(
void
){
return
ui
->
plotter
->
getWfTimeRes
();
}
void
specWidget
::
setFftRate
(
int
rate_hz
){
ui
->
plotter
->
setFftRate
(
rate_hz
);
}
void
specWidget
::
clearWaterfall
(
void
){
return
ui
->
plotter
->
clearWaterfall
();
}
bool
specWidget
::
saveWaterfall
(
const
QString
&
filename
)
{
return
ui
->
plotter
->
saveWaterfall
(
filename
);
}
void
specWidget
::
on_pushButton_reset_clicked
()
{
...
...
@@ -362,7 +254,7 @@ void specWidget::resetProgram()
return
;
int
updateIntelv
=
1000.0
/
ui
->
spinBox_fftUpdate
->
value
()
+
.5
;
//开始
setSampleRate
(
getSampleRate
());
setSampleRate
(
ui
->
plotter
->
getSampleRate
());
initRx
();
initTx
();
m_nTimerID
=
startTimer
(
updateIntelv
);
...
...
@@ -620,7 +512,7 @@ void specWidget::appendWavComplex(const double (* pWav)[2], const int count, dou
m_dFFTAmp
[(
i
+
m_nFFTSize
/
2
)
%
m_nFFTSize
]
=
5
*
log
(
m_pFFTOut
[
i
][
0
]
*
m_pFFTOut
[
i
][
0
]
+
m_pFFTOut
[
i
][
1
]
*
m_pFFTOut
[
i
][
1
])
/
log
(
10
)
-
minus
+
m_dManuAdd
;
}
setNewFftData
(
m_dFFTAmp
.
data
(),
m_nFFTSize
);
ui
->
plotter
->
setNewFftData
(
m_dFFTAmp
.
data
(),
m_nFFTSize
);
}
...
...
specwidget.h
浏览文件 @
168e8110
...
...
@@ -43,61 +43,19 @@ namespace Ui {
class
specWidget
:
public
QWidget
,
public
uhd_device
{
Q_OBJECT
Q_PROPERTY
(
qint64
sampleRate
READ
getSampleRate
WRITE
setSampleRate
);
public:
explicit
specWidget
(
QWidget
*
parent
=
nullptr
);
~
specWidget
();
void
setSampleRate
(
double
rate
);
double
getSampleRate
(
void
);
protected:
void
timerEvent
(
QTimerEvent
*
e
)
override
;
signals:
void
evt_newCenterFreq
(
qint64
f
);
void
evt_newDemodFreq
(
qint64
freq
,
qint64
delta
);
/* delta is the offset from the center */
void
evt_newLowCutFreq
(
int
f
);
void
evt_newHighCutFreq
(
int
f
);
void
evt_newFilterFreq
(
int
low
,
int
high
);
/* substitute for NewLow / NewHigh */
void
evt_pandapterRangeChanged
(
double
min
,
double
max
);
void
evt_newZoomLevel
(
double
level
);
void
evt_newCtrlFreq
(
qint64
);
public
slots
:
void
slot_newDemodFreq
(
qint64
freq
,
qint64
delta
);
/* delta is the offset from the center */
void
slot_msg
(
QByteArray
,
bool
);
public:
void
appendWavComplex
(
const
double
(
*
pWav
)[
2
],
const
int
count
,
double
voltage_ref
=
16384
);
public:
void
setNewFftData
(
const
double
*
rfftData
,
int
size
);
void
setNewFftDataWf
(
const
double
*
rfftData
,
const
double
*
rwfData
,
int
size
);
void
setMaxPixmapSize
(
int
w
,
int
h
);
void
setRunningState
(
bool
running
);
void
setClickResolution
(
int
clickres
);
void
setFilterClickResolution
(
int
clickres
);
void
setFilterBoxEnabled
(
bool
enabled
);
void
setCenterLineEnabled
(
bool
enabled
);
void
setTooltipsEnabled
(
bool
enabled
);
void
setBookmarksEnabled
(
bool
enabled
);
void
setCenterFreq
(
quint64
f
);
void
setFreqUnits
(
qint32
unit
);
void
setDemodCenterFreq
(
quint64
f
);
void
setFilterOffset
(
qint64
freq_hz
);
qint64
getFilterOffset
(
void
);
int
getFilterBw
();
void
setHiLowCutFrequencies
(
int
LowCut
,
int
HiCut
);
void
getHiLowCutFrequencies
(
int
*
LowCut
,
int
*
HiCut
);
void
setDemodRanges
(
int
FLowCmin
,
int
FLowCmax
,
int
FHiCmin
,
int
FHiCmax
,
bool
symetric
);
void
setSpanFreq
(
quint32
s
);
void
setMaxBandiwdth
(
int
m
);
void
setHdivDelta
(
int
delta
);
void
setVdivDelta
(
int
delta
);
void
setFreqDigits
(
int
digits
);
void
setFftCenterFreq
(
qint64
f
);
int
getNearestPeak
(
QPoint
pt
);
void
setWaterfallSpan
(
quint64
span_ms
);
quint64
getWfTimeRes
(
void
);
void
setFftRate
(
int
rate_hz
);
void
clearWaterfall
(
void
);
bool
saveWaterfall
(
const
QString
&
filename
);
void
setCenterFreq
(
quint64
f
);
private
slots
:
void
on_pushButton_reset_clicked
();
void
on_comboBox_fftSize_activated
(
int
index
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录