Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gof2master
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
gof2master
Commits
745ae09f
Commit
745ae09f
authored
1 year ago
by
Giacomo Strangolino
Browse files
Options
Downloads
Patches
Plain Diff
test device tango test
parent
54001894
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gof2master.cpp
+26
-8
26 additions, 8 deletions
src/gof2master.cpp
with
26 additions
and
8 deletions
src/gof2master.cpp
+
26
−
8
View file @
745ae09f
...
...
@@ -36,15 +36,17 @@ Gof2master::Gof2master(CumbiaPool *cumbia_pool, QWidget *parent) :
QVBoxLayout
*
mainlo
=
new
QVBoxLayout
(
this
);
QGraphicsView
*
gv
=
new
QGraphicsView
(
this
);
QGraphicsScene
*
sce
=
new
QGraphicsScene
(
this
);
sce
->
setSceneRect
(
0
,
0
,
600
,
600
);
gv
->
setScene
(
sce
);
mainlo
->
addWidget
(
gv
);
// gv->installEventFilter(new MouseWheelViewScaler(this));
const
int
distrib_r
=
60
;
int
period
=
100
,
i
;
// p.value("i").toInt();
int
period
=
100
,
i
=
0
;
// p.value("i").toInt();
// const QStringList &srcs {"hor_orbit_err", "ver_orbit_err", "hor_corr_set", "ver_corr_set" };
const
QStringList
&
srcs
{
"double_spectrum_ro"
,
"long_spectrum_ro"
,
"short_spectrum_ro"
};
QVector
<
QColor
>
cc
{
"yellow"
,
"blue"
,
"green"
,
"violet"
,
"orange"
,
"pink"
};
const
QStringList
&
srcs
{
"double_spectrum_ro"
,
"long_spectrum_ro"
};
// const QStringList &srcs {"wave" };
QVector
<
QColor
>
cc
{
"yellow"
,
"white"
,
"green"
,
"violet"
,
"orange"
,
"pink"
};
const
double
wi
=
sce
->
width
(),
he
=
sce
->
height
();
foreach
(
const
QString
&
s
,
srcs
)
{
QuWatcher
*
w
=
new
QuWatcher
(
this
,
cu_pool
,
m_ctrl_factory_pool
);
...
...
@@ -58,7 +60,7 @@ Gof2master::Gof2master(CumbiaPool *cumbia_pool, QWidget *parent) :
float
yp
=
he
/
2.0
*
(
i
/
2
);
i
++
;
QuCircularPlotI
*
ni
=
new
QuCircularPlotI
(
nullptr
,
QSize
(
300
,
300
));
QuCircularPlotI
*
ni
=
new
QuCircularPlotI
(
nullptr
,
QSize
(
wi
/
2.1
,
he
/
2.1
));
QuCircularPlotEngine
*
pie
=
ni
->
engine
();
qucircularplot_attributes
&
a
=
pie
->
a
;
...
...
@@ -72,7 +74,8 @@ Gof2master::Gof2master(CumbiaPool *cumbia_pool, QWidget *parent) :
sce
->
addItem
(
ni
);
ni
->
setPos
(
xp
,
yp
);
QuCircularPlotCurve
*
crv
=
pie
->
addCurve
(
w
->
source
());
printf
(
"\e[1;32m created curve %s\e[0m
\n
"
,
qstoc
(
crv
->
source
()));
printf
(
"\e[1;32m created curve %s\e[0m scene %fx%f i %d x pos %f y pos %f item w %f h %f
\n
"
,
qstoc
(
crv
->
source
()),
wi
,
he
,
i
,
xp
,
yp
,
ni
->
boundingRect
().
width
(),
ni
->
boundingRect
().
height
());
QPen
pe
=
crv
->
pen
();
pe
.
setColor
(
cc
.
at
(
i
%
cc
.
size
()));
// set all but one of the two plots' background to black
...
...
@@ -109,12 +112,24 @@ Gof2master::~Gof2master()
delete
ui
;
}
void
Gof2master
::
onNewData
(
const
CuData
&
da
)
{
pretty_pri
(
"\e[1;33m%s\e[0m"
,
datos
(
da
));
void
Gof2master
::
onNewData
(
const
CuData
&
da
)
{
bool
err
=
da
.
B
(
CuDType
::
Err
);
// da.B("err")
QuString
src
=
da
.
s
(
CuDType
::
Src
);
// da.s("src")
QString
s
=
src
.
section
(
'/'
,
-
1
);
if
(
da
.
s
(
CuDType
::
Type
)
==
"property"
)
{
double
m
,
M
;
m
=
da
.
D
(
CuDType
::
Min
);
M
=
da
.
D
(
CuDType
::
Max
);
pretty_pri
(
"m: %f M: %f"
,
m
,
M
);
if
(
M
>
m
)
{
pretty_pri
(
"setting min/max: m: %f M: %f"
,
m
,
M
);
m_get_plot
(
s
)
->
engine
()
->
setYLowerBound
(
m
);
m_get_plot
(
s
)
->
engine
()
->
setYUpperBound
(
M
);
qucircularplot_attributes
&
a
=
m_get_plot
(
s
)
->
engine
()
->
a
;
a
.
axes
.
x
.
baseline
=
(
M
-
m
)
/
2.0
;
}
}
// pretty_pri("\e[1;33m%s\e[0m", datos(da));
std
::
vector
<
double
>
v
;
QVector
<
double
>
y
;
if
(
da
.
containsKey
(
CuDType
::
Value
))
{
// da.containsKey("value")
...
...
@@ -132,6 +147,9 @@ void Gof2master::onNewData(const CuData &da)
}
if
(
err
)
perr
(
"read error: %s -> %s"
,
da
.
s
(
CuDType
::
Src
).
c_str
(),
da
.
s
(
CuDType
::
Message
).
c_str
());
// da.s("src"), da.s("msg")
pretty_pri
(
"data %s: %s [%f - %f]"
,
qstoc
(
src
),
da
.
s
(
CuDType
::
Value
).
c_str
(),
m_get_plot
(
s
)
->
engine
()
->
yLowerBound
(),
m_get_plot
(
s
)
->
engine
()
->
yUpperBound
());
}
void
Gof2master
::
zoomMoved
(
double
dx
,
double
dy
)
{
...
...
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