Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cs
gui
i0mapmon
Commits
58e74052
Commit
58e74052
authored
Sep 03, 2020
by
Giacomo Strangolino
Browse files
progress
parent
34e7cd22
Changes
6
Hide whitespace changes
Inline
Side-by-side
i0mapmon.pro
View file @
58e74052
...
...
@@ -11,10 +11,12 @@ DEFINES -= QT_NO_DEBUG_OUTPUT
SOURCES
+=
src
/
main
.
cpp
\
src
/
checkablecomboboxmodel
.
cpp
\
src
/
i0mapmon
.
cpp
src
/
i0mapmon
.
cpp
\
src
/
i0mmonplot
.
cpp
HEADERS
+=
src
/
i0mapmon
.
h
\
src
/
checkablecomboboxmodel
.
h
src
/
checkablecomboboxmodel
.
h
\
src
/
i0mmonplot
.
h
#
cuuimake
runs
uic
#
FORMS
=
src
/
i0mapmon
.
ui
...
...
src/i0mapmon.cpp
View file @
58e74052
...
...
@@ -59,12 +59,12 @@ I0mapmon::I0mapmon(CumbiaPool *cumbia_pool, QWidget *parent) :
connect
(
ui
->
qulWlens
,
SIGNAL
(
newData
(
CuData
)),
this
,
SLOT
(
onWlensChanged
(
CuData
)));
// plot
ui
->
quSpectrumP
lot
->
setYLowerBound
(
-
1.0
);
ui
->
quSpectrumP
lot
->
setYUpperBound
(
1.0
);
ui
->
quSpectrumP
lot
->
setXLowerBound
(
-
1.0
);
ui
->
quSpectrumP
lot
->
setXUpperBound
(
1.0
);
ui
->
p
lot
->
setYLowerBound
(
-
1.0
);
ui
->
p
lot
->
setYUpperBound
(
1.0
);
ui
->
p
lot
->
setXLowerBound
(
-
1.0
);
ui
->
p
lot
->
setXUpperBound
(
1.0
);
// autoscale
ui
->
quSpectrumP
lot
->
setYAxisAutoscaleEnabled
(
true
);
ui
->
p
lot
->
setYAxisAutoscaleEnabled
(
true
);
m_setup_x_list
();
...
...
@@ -79,6 +79,7 @@ I0mapmon::~I0mapmon()
}
void
I0mapmon
::
onNamesReady
(
const
QStringList
&
n
)
{
qDebug
()
<<
__PRETTY_FUNCTION__
<<
n
;
ui
->
qucby
->
clear
();
ui
->
qucby
->
insertItems
(
0
,
n
);
if
(
n
.
size
())
{
...
...
@@ -101,9 +102,7 @@ void I0mapmon::applyWavelenX() {
}
void
I0mapmon
::
onYChanged
(
const
QString
&
y
)
{
ui
->
quSpectrumPlot
->
unsetSources
();
ui
->
quSpectrumPlot
->
clearPlot
();
ui
->
quSpectrumPlot
->
setSource
(
"$1/"
+
y
);
}
void
I0mapmon
::
onWlensChanged
(
const
CuData
&
da
)
{
...
...
@@ -126,6 +125,7 @@ void I0mapmon::onWlenSelectionChanged(const QString& , bool ) {
wlens
.
append
(
it
->
text
());
}
ui
->
quleWlens
->
setText
(
wlens
.
join
(
","
));
ui
->
qucblambda
->
setItemText
(
0
,
ui
->
quleWlens
->
text
());
}
void
I0mapmon
::
m_setup_x_list
()
{
...
...
@@ -140,20 +140,28 @@ void I0mapmon::m_setup_x_list() {
// "LDM Photodiode (Beamline Transmission)" pos/diagnostics/pico_pos.01 None GetId
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"PM2a Ni Photocurrent (a.u.)"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/photo_current_pos.01
/
GetArea3"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/photo_current_pos.01
->
GetArea3"
,
Qt
::
UserRole
+
1
);
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"PM2a Ca Photocurrent (a.u.)"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/photo_current_pos.01
/
GetArea2"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/photo_current_pos.01
->
GetArea2"
,
Qt
::
UserRole
+
1
);
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"PM2a OLD Photocurrent"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"srv-tf-srf:20000/ec-tf-esa-01/v1720/1000000
/
GetArea4"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"srv-tf-srf:20000/ec-tf-esa-01/v1720/1000000
->
GetArea4"
,
Qt
::
UserRole
+
1
);
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"PRESTO Intensity"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/pesp/ccd-pesp_pos.01/Intensity"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/pesp/ccd-pesp_pos.01/Intensity"
,
Qt
::
UserRole
+
1
);
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"DPI Photodiode (Beamline Transmission)"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/pico_pos.01/GetIc"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/pico_pos.01/GetIc"
,
Qt
::
UserRole
+
1
);
ui
->
qucbx
->
insertItem
(
ui
->
qucbx
->
count
(),
"LDM Photodiode (Beamline Transmission)"
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/pico_pos.01/GetId"
,
CheckableComboBoxModel
::
SrcRole
);
ui
->
qucbx
->
setItemData
(
ui
->
qucbx
->
count
()
-
1
,
"pos/diagnostics/pico_pos.01/GetId"
,
Qt
::
UserRole
+
1
);
}
QList
<
int
>
I0mapmon
::
m_selected_wlens
()
const
{
QList
<
int
>
idxs
;
for
(
int
i
=
0
;
i
<
m_cb_model
->
rowCount
();
i
++
)
if
(
m_cb_model
->
item
(
i
)
->
data
(
Qt
::
CheckStateRole
).
toBool
())
idxs
<<
i
;
return
idxs
;
}
void
I0mapmon
::
m_plot_reconf
()
{
qDebug
()
<<
__PRETTY_FUNCTION__
<<
"reconfiguring plot with X "
<<
ui
->
qucbx
->
currentText
()
<<
ui
->
qucby
->
currentText
()
<<
ui
->
quleWlens
->
text
();
const
QString
&
srcx
=
ui
->
qucbx
->
itemData
(
ui
->
qucbx
->
currentIndex
(),
Qt
::
UserRole
+
1
).
toString
();
const
QString
&
devy
=
ui
->
quionSamples
->
source
().
section
(
'/'
,
0
,
2
);
ui
->
plot
->
setSources
(
srcx
,
devy
+
'/'
+
ui
->
qucby
->
currentText
(),
m_selected_wlens
(),
ui
->
quionSamples
->
findChild
<
QuLabel
*>
()
->
text
().
toInt
());
}
src/i0mapmon.h
View file @
58e74052
...
...
@@ -48,6 +48,8 @@ private:
// methods
void
m_setup_x_list
();
constexpr
QList
<
int
>
m_selected_wlens
()
const
;
};
#endif // I0mapmon_H
src/i0mapmon.ui
View file @
58e74052
...
...
@@ -46,6 +46,12 @@
</item>
<item
row=
"0"
column=
"1"
colspan=
"5"
>
<widget
class=
"QLabel"
name=
"lTitle"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
0
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
...
...
@@ -153,19 +159,29 @@
</widget>
</item>
<item>
<widget
class=
"QuInputOutput"
name=
"qu
InputOutput
"
>
<widget
class=
"QuInputOutput"
name=
"qu
ionSamples
"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
1
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
<property
name=
"source"
>
<string>
$1/numAverage
</string>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"1"
column=
"0"
colspan=
"6"
>
<widget
class=
"QuSpectrumPlot"
name=
"quSpectrumPlot"
/>
<widget
class=
"I0MMonPlot"
name=
"plot"
native=
"true"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Preferred"
>
<horstretch>
0
</horstretch>
<verstretch>
1
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
...
...
@@ -181,11 +197,6 @@
<extends>
QComboBox
</extends>
<header>
qucombobox.h
</header>
</customwidget>
<customwidget>
<class>
QuSpectrumPlot
</class>
<extends>
QFrame
</extends>
<header>
quspectrumplot.h
</header>
</customwidget>
<customwidget>
<class>
QuInputOutput
</class>
<extends>
QFrame
</extends>
...
...
@@ -196,6 +207,12 @@
<extends>
QLineEdit
</extends>
<header>
qulineedit.h
</header>
</customwidget>
<customwidget>
<class>
I0MMonPlot
</class>
<extends>
QWidget
</extends>
<header>
i0mmonplot.h
</header>
<container>
1
</container>
</customwidget>
</customwidgets>
<resources/>
<connections/>
...
...
src/i0mmonplot.cpp
0 → 100644
View file @
58e74052
#include "i0mmonplot.h"
#include <cumbiapool.h>
#include <cucontrolsfactorypool.h>
#include <quplotcurve.h>
#include <cupluginloader.h>
#include <qumultireaderplugininterface.h>
#include <cumacros.h>
#include <QtDebug>
#ifdef QUMBIA_TANGO_CONTROLS_VERSION
#include <cutreader.h>
#endif
I0MMonPlot
::
I0MMonPlot
(
QWidget
*
parent
,
CumbiaPool
*
cup
,
const
CuControlsFactoryPool
&
fpoo
)
:
QuPlotBase
(
parent
)
{
m_ctrl_fpool
=
fpoo
;
m_cu_poo
=
cup
;
CuPluginLoader
plo
;
QObject
*
plugin_qob
;
m_multiread_plu_i
=
plo
.
get
<
QuMultiReaderPluginInterface
>
(
"libcumbia-multiread-plugin.so"
,
&
plugin_qob
);
if
(
!
m_multiread_plu_i
)
perr
(
"I0MMonPlot: failed to load plugin
\"
libcumbia-multiread-plugin.so
\"
"
);
else
{
int
mode
=
0
;
#ifdef QUMBIA_TANGO_CONTROLS_VERSION
mode
=
CuTReader
::
Manual
;
#endif
m_multiread_plu_i
->
init
(
cup
,
fpoo
,
mode
);
// 0 sync mode
connect
(
m_multiread_plu_i
->
get_qobject
(),
SIGNAL
(
onSeqReadComplete
(
const
QList
<
CuData
>
&
)),
this
,
SLOT
(
onDataReady
(
const
QList
<
CuData
>
&
)));
}
}
bool
I0MMonPlot
::
pluginLoaded
()
const
{
return
m_multiread_plu_i
!=
nullptr
;
}
void
I0MMonPlot
::
onDataReady
(
const
QList
<
CuData
>
&
dl
)
{
foreach
(
const
CuData
&
d
,
dl
)
printf
(
"- %s
\n
"
,
datos
(
d
));
}
void
I0MMonPlot
::
setSources
(
const
QString
&
x
,
const
QString
&
y
,
QList
<
int
>
lambda_idxs
,
int
nsamples
)
{
qDebug
()
<<
__PRETTY_FUNCTION__
<<
x
<<
y
<<
lambda_idxs
;
QuPlotBase
::
clearPlot
();
QuPlotCurve
*
c
=
new
QuPlotCurve
(
y
);
if
(
m_multiread_plu_i
)
{
m_multiread_plu_i
->
insertSource
(
x
,
0
);
m_multiread_plu_i
->
insertSource
(
y
,
1
);
}
}
src/i0mmonplot.h
0 → 100644
View file @
58e74052
#ifndef I0MMONPLOT_H
#define I0MMONPLOT_H
#include <cucontrolsfactorypool.h>
#include <quplot_base.h>
#include <cudata.h>
#include <QString>
class
CumbiaPool
;
class
QuMultiReaderPluginInterface
;
class
I0MMonPlot
:
public
QuPlotBase
{
Q_OBJECT
public:
explicit
I0MMonPlot
(
QWidget
*
parent
,
CumbiaPool
*
cup
,
const
CuControlsFactoryPool
&
fpoo
);
bool
pluginLoaded
()
const
;
signals:
public
slots
:
void
onDataReady
(
const
QList
<
CuData
>
&
dl
);
void
setSources
(
const
QString
&
x
,
const
QString
&
y
,
QList
<
int
>
lambda_idxs
,
int
nsamples
);
private:
CumbiaPool
*
m_cu_poo
;
CuControlsFactoryPool
m_ctrl_fpool
;
QuMultiReaderPluginInterface
*
m_multiread_plu_i
;
};
#endif // I0MMONPLOT_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment