Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gofbpm
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
cs
gui
gofbpm
Commits
cc6d9bda
Commit
cc6d9bda
authored
7 months ago
by
Giacomo Strangolino
Browse files
Options
Downloads
Patches
Plain Diff
opengl option - removed prints
parent
4bdc155b
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/gofbpm.cpp
+16
-7
16 additions, 7 deletions
src/gofbpm.cpp
src/gofbpmplot.cpp
+14
-4
14 additions, 4 deletions
src/gofbpmplot.cpp
src/gofbpmplot.h
+1
-1
1 addition, 1 deletion
src/gofbpmplot.h
with
31 additions
and
12 deletions
src/gofbpm.cpp
+
16
−
7
View file @
cc6d9bda
...
@@ -44,7 +44,8 @@
...
@@ -44,7 +44,8 @@
#define TAB_TBT 4
#define TAB_TBT 4
#include
<QApplication>
#include
<QApplication>
#include
<QSplashScreen>
#include
<QCommandLineOption>
#include
<QCommandLineParser>
#include
<qulabelbase.h>
#include
<qulabelbase.h>
#include
<quplotoptions.h>
#include
<quplotoptions.h>
#include
<quwatcher.h>
#include
<quwatcher.h>
...
@@ -56,6 +57,14 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
...
@@ -56,6 +57,14 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
CuModuleLoader
mloader
(
a
->
cumbiaPool
(),
a
->
fpool
(),
&
m_log_impl
);
CuModuleLoader
mloader
(
a
->
cumbiaPool
(),
a
->
fpool
(),
&
m_log_impl
);
ui
=
new
Ui
::
bpm
;
ui
=
new
Ui
::
bpm
;
ui
->
setupUi
(
this
);
ui
->
setupUi
(
this
);
QCommandLineParser
pa
;
QCommandLineOption
ogl
(
QStringList
()
<<
"o"
<<
"opengl"
,
"plots with OpenGL canvas"
);
pa
.
addHelpOption
();
pa
.
addOption
(
ogl
);
pa
.
parse
(
a
->
arguments
());
bool
opengl
=
pa
.
isSet
(
ogl
);
printf
(
"gofbpm: opengl mode: %s\e[0m
\n
"
,
opengl
?
"\e[1;32mYES"
:
"\e[1;34mNO"
);
cu_pool
=
a
->
cumbiaPool
();
cu_pool
=
a
->
cumbiaPool
();
m_ctrl_factory_pool
=
*
a
->
fpool
();
m_ctrl_factory_pool
=
*
a
->
fpool
();
// mloader.modules() to get the list of loaded modules
// mloader.modules() to get the list of loaded modules
...
@@ -63,7 +72,7 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
...
@@ -63,7 +72,7 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
QVBoxLayout
*
slowlo
=
new
QVBoxLayout
(
ui
->
wSlow
);
QVBoxLayout
*
slowlo
=
new
QVBoxLayout
(
ui
->
wSlow
);
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pX"
<<
"pY"
<<
"pSum"
)
{
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pX"
<<
"pY"
<<
"pSum"
)
{
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wSlow
,
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wSlow
,
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
n
);
p
->
setObjectName
(
n
);
slowlo
->
addWidget
(
p
);
slowlo
->
addWidget
(
p
);
}
}
...
@@ -71,14 +80,14 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
...
@@ -71,14 +80,14 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
// QVBoxLayout *fastlo = new QVBoxLayout(ui->tabWidget->widget(Fast));
// QVBoxLayout *fastlo = new QVBoxLayout(ui->tabWidget->widget(Fast));
QLayout
*
fastlo
=
ui
->
tabWidget
->
widget
(
Fast
)
->
layout
();
QLayout
*
fastlo
=
ui
->
tabWidget
->
widget
(
Fast
)
->
layout
();
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pXFast"
<<
"pYFast"
<<
"pSumFast"
)
{
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pXFast"
<<
"pYFast"
<<
"pSumFast"
)
{
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
tabWidget
->
widget
(
Fast
),
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
tabWidget
->
widget
(
Fast
),
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
n
);
p
->
setObjectName
(
n
);
fastlo
->
addWidget
(
p
);
fastlo
->
addWidget
(
p
);
}
}
QVBoxLayout
*
fftlo
=
new
QVBoxLayout
(
ui
->
wFFT
);
QVBoxLayout
*
fftlo
=
new
QVBoxLayout
(
ui
->
wFFT
);
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pFFTX"
<<
"pFFTY"
<<
"pFFTSum"
)
{
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pFFTX"
<<
"pFFTY"
<<
"pFFTSum"
)
{
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wFFT
,
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wFFT
,
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
n
);
p
->
setObjectName
(
n
);
fftlo
->
addWidget
(
p
);
fftlo
->
addWidget
(
p
);
}
}
...
@@ -86,20 +95,20 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
...
@@ -86,20 +95,20 @@ gofbpm::gofbpm(QWidget *parent) : QWidget(parent) {
// QVBoxLayout *evtlo = new QVBoxLayout(ui->tabWidget->widget(Event));
// QVBoxLayout *evtlo = new QVBoxLayout(ui->tabWidget->widget(Event));
QLayout
*
evtlo
=
ui
->
tabWidget
->
widget
(
Event
)
->
layout
();
QLayout
*
evtlo
=
ui
->
tabWidget
->
widget
(
Event
)
->
layout
();
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pEventH"
<<
"pEventV"
<<
"pEventSum"
)
{
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pEventH"
<<
"pEventV"
<<
"pEventSum"
)
{
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
tabWidget
->
widget
(
Event
),
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
tabWidget
->
widget
(
Event
),
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
n
);
p
->
setObjectName
(
n
);
evtlo
->
addWidget
(
p
);
evtlo
->
addWidget
(
p
);
}
}
QVBoxLayout
*
evtfftlo
=
new
QVBoxLayout
(
ui
->
wEventFFT
);
QVBoxLayout
*
evtfftlo
=
new
QVBoxLayout
(
ui
->
wEventFFT
);
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pEventFFTH"
<<
"pEventFFTV"
<<
"pEventFFTSum"
)
{
foreach
(
const
QString
&
n
,
QStringList
()
<<
"pEventFFTH"
<<
"pEventFFTV"
<<
"pEventFFTSum"
)
{
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wEventFFT
,
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wEventFFT
,
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
n
);
p
->
setObjectName
(
n
);
evtfftlo
->
addWidget
(
p
);
evtfftlo
->
addWidget
(
p
);
}
}
QVBoxLayout
*
rawlo
=
new
QVBoxLayout
(
ui
->
wRAW
);
QVBoxLayout
*
rawlo
=
new
QVBoxLayout
(
ui
->
wRAW
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wRAW
,
cu_pool
,
m_ctrl_factory_pool
);
GofBpmPlot
*
p
=
new
GofBpmPlot
(
ui
->
wRAW
,
cu_pool
,
m_ctrl_factory_pool
,
opengl
);
p
->
setObjectName
(
"pTBTX"
);
p
->
setObjectName
(
"pTBTX"
);
rawlo
->
addWidget
(
p
);
rawlo
->
addWidget
(
p
);
...
...
This diff is collapsed.
Click to expand it.
src/gofbpmplot.cpp
+
14
−
4
View file @
cc6d9bda
...
@@ -9,11 +9,21 @@
...
@@ -9,11 +9,21 @@
#include
<quplotdataconnector.h>
#include
<quplotdataconnector.h>
#include
<quplotoptions.h>
#include
<quplotoptions.h>
#include
<quaxiseventfilter.h>
#include
<quaxiseventfilter.h>
#include
<qwt_plot_grid.h>
#include
<QMenu>
#include
<QMenu>
#include
<QwtPlotOpenGLCanvas>
GofBpmPlot
::
GofBpmPlot
(
QWidget
*
parent
,
CumbiaPool
*
cu_pool
,
const
CuControlsFactoryPool
&
fp
)
GofBpmPlot
::
GofBpmPlot
(
QWidget
*
parent
,
CumbiaPool
*
cu_pool
,
const
CuControlsFactoryPool
&
fp
,
bool
opengl
)
:
QuArrayPlot
(
parent
),
m_fftsiz
(
-
1
),
m_freq
(
-
1.0
),
:
QuArrayPlot
(
parent
,
opengl
),
m_fftsiz
(
-
1
),
m_freq
(
-
1.0
),
m_regenerate_x
(
true
),
m_update_y_scale
(
true
),
m_period
(
100
)
{
m_regenerate_x
(
true
),
m_update_y_scale
(
true
),
m_period
(
100
)
{
QwtPlotGrid
*
grid
=
static_cast
<
QwtPlotGrid
*>
(
itemList
(
QwtPlotGrid
::
Rtti_PlotGrid
).
first
());
grid
->
setPen
(
QColor
(
Qt
::
lightGray
),
0.0
);
QPalette
p
=
axisWidget
(
QwtPlot
::
xBottom
)
->
palette
();
p
.
setColor
(
QPalette
::
WindowText
,
Qt
::
darkGray
);
for
(
int
id
=
0
;
id
<
QwtPlot
::
axisCnt
;
id
++
)
{
axisWidget
(
id
)
->
setPalette
(
p
);
}
QuAxisEventFilter
*
af
=
new
QuAxisEventFilter
(
this
);
QuAxisEventFilter
*
af
=
new
QuAxisEventFilter
(
this
);
connect
(
af
,
SIGNAL
(
doubleClicked
()),
this
,
SLOT
(
updateYScale
()));
connect
(
af
,
SIGNAL
(
doubleClicked
()),
this
,
SLOT
(
updateYScale
()));
connect
(
af
,
SIGNAL
(
contextMenuRequest
()),
this
,
SLOT
(
axisContextMenuRequest
()));
connect
(
af
,
SIGNAL
(
contextMenuRequest
()),
this
,
SLOT
(
axisContextMenuRequest
()));
...
@@ -38,7 +48,8 @@ void GofBpmPlot::unsetSources() {
...
@@ -38,7 +48,8 @@ void GofBpmPlot::unsetSources() {
void
GofBpmPlot
::
setOptions
(
const
CuData
&
o
)
{
void
GofBpmPlot
::
setOptions
(
const
CuData
&
o
)
{
m_conn
->
getContext
()
->
setOptions
(
o
);
m_conn
->
getContext
()
->
setOptions
(
o
);
m_conn
->
getContext
()
->
sendData
(
o
);
if
(
m_conn
->
getContext
()
->
readers
().
size
()
>
0
)
// prevent link not initialized error msg
m_conn
->
getContext
()
->
sendData
(
o
);
}
}
void
GofBpmPlot
::
updateYScale
()
{
void
GofBpmPlot
::
updateYScale
()
{
...
@@ -63,7 +74,6 @@ void GofBpmPlot::fftSizChanged(const CuData &v) {
...
@@ -63,7 +74,6 @@ void GofBpmPlot::fftSizChanged(const CuData &v) {
void
GofBpmPlot
::
fastFreqChanged
(
float
f
)
{
void
GofBpmPlot
::
fastFreqChanged
(
float
f
)
{
if
(
m_freq
!=
f
)
{
if
(
m_freq
!=
f
)
{
printf
(
"x scale changed \e[1;32m from %f to %f\e[0m -- fft siz is %ld
\n
"
,
m_freq
,
f
,
m_fftsiz
);
m_freq
=
f
;
m_freq
=
f
;
m_regenerate_x
=
m_fftsiz
>
0
;
m_regenerate_x
=
m_fftsiz
>
0
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/gofbpmplot.h
+
1
−
1
View file @
cc6d9bda
...
@@ -13,7 +13,7 @@ class GofBpmPlot : public QuArrayPlot // ## added by qumbiaprojectwizard
...
@@ -13,7 +13,7 @@ class GofBpmPlot : public QuArrayPlot // ## added by qumbiaprojectwizard
{
{
Q_OBJECT
Q_OBJECT
public:
public:
GofBpmPlot
(
QWidget
*
parent
,
CumbiaPool
*
cu_pool
,
const
CuControlsFactoryPool
&
fp
);
GofBpmPlot
(
QWidget
*
parent
,
CumbiaPool
*
cu_pool
,
const
CuControlsFactoryPool
&
fp
,
bool
opengl
);
public
slots
:
public
slots
:
void
configure
(
QwtPlot
*
p
,
const
CuData
&
da
);
void
configure
(
QwtPlot
*
p
,
const
CuData
&
da
);
...
...
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