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
ab498e51
Commit
ab498e51
authored
Aug 26, 2020
by
Giacomo Strangolino
Browse files
first draft of the project
parent
987d00b5
Changes
5
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
ab498e51
# i0mapmon
README
This is i0mapmon README file.
DEPENDENCIES:
Qt version >= 5.0
Qwt version 6
cumbia version >= 1
SPECIAL REQUIREMENTS:
none
Tango devices used
------------------
TANGO HOST:
Needs 2: one can be specified as TANGO_HOST env var, the other on the command line
EXAMPLE start:
export TANGO_HOST=srv-tango-padres-01:20000
./bin/i0mapmon pfe_f02/diagnostics/fel_iom_pfe_f02.01 srv-tango-srf-01:20000/f/misc/beam_status_f
Building
--------
qmake
cuuimake -j9
Main customer
-------------
Michele Manfredda, Graziano
Errors & Troubleshooting
------------------------
If you experience problems, please contact:
Giacomo
<giacomo.strangolino@elettra.eu>
Thank you.
Sincrotrone Trieste s.c.p.a - ELETTRA Laboratory - Controls Group
Intensity map/FEL intensity monitor
\ No newline at end of file
i0mapmon.pro
View file @
ab498e51
...
...
@@ -5,7 +5,7 @@ include($${CUMBIA_ROOT}/include/quapps/quapps.pri)
#
CONFIG
+=
debug
|
release
DEFINES
+
=
QT_NO_DEBUG_OUTPUT
DEFINES
-
=
QT_NO_DEBUG_OUTPUT
#
RESOURCES
+=
...
...
src/i0mapmon.cpp
View file @
ab498e51
...
...
@@ -8,6 +8,9 @@
#include <quapps.h>
// cumbia
#include <quwatcher.h>
#include <qulineedit.h>
I0mapmon
::
I0mapmon
(
CumbiaPool
*
cumbia_pool
,
QWidget
*
parent
)
:
QWidget
(
parent
)
{
...
...
@@ -19,9 +22,73 @@ I0mapmon::I0mapmon(CumbiaPool *cumbia_pool, QWidget *parent) :
// mloader.modules() to get the list of loaded modules
// cumbia
m_fel0x
=
0
;
for
(
int
i
=
1
;
i
<
qApp
->
arguments
().
size
()
&&
m_fel0x
<
1
;
i
++
)
{
if
(
qApp
->
arguments
()[
i
].
contains
(
"f01"
))
m_fel0x
=
1
;
else
if
(
qApp
->
arguments
()[
i
].
contains
(
"f02"
))
m_fel0x
=
2
;
}
if
(
m_fel0x
<
1
)
ui
->
lTitle
->
setText
(
"Unknown operation mode FEL01 / FEL02 from command line args"
);
else
{
ui
->
lTitle
->
setText
(
ui
->
lTitle
->
text
()
+
QString
(
" FEL0%1"
).
arg
(
m_fel0x
));
// continue setup
QuWatcher
*
w
=
new
QuWatcher
(
this
,
cumbia_pool
,
m_ctrl_factory_pool
);
w
->
setSingleShot
(
true
);
w
->
setAutoDestroy
(
true
);
w
->
attach
(
this
,
SLOT
(
onNamesReady
(
QStringList
)));
w
->
setSource
(
"$1/name"
);
connect
(
ui
->
pbApplyWlens
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
applyWavelenX
()));
connect
(
ui
->
pbApplyWlenWei
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
applyWavelenX
()));
// qu-line edit for wavelen / wavelen weights
ui
->
quleWlens
->
setTarget
(
QString
(
"$2/FEL0%1_IOM_wavelengths"
).
arg
(
m_fel0x
));
ui
->
quleWlenWei
->
setTarget
(
QString
(
"$2/FEL0%1_IOM_wavelength_weights"
).
arg
(
m_fel0x
));
// label
ui
->
qulWlens
->
setSource
(
QString
(
"$2/FEL0%1_IOM_wavelengths"
).
arg
(
m_fel0x
));
ui
->
qulWlenWei
->
setSource
(
QString
(
"$2/FEL0%1_IOM_wavelength_weights"
).
arg
(
m_fel0x
));
// plot
ui
->
quSpectrumPlot
->
setYLowerBound
(
-
1.0
);
ui
->
quSpectrumPlot
->
setYUpperBound
(
1.0
);
// autoscale
ui
->
quSpectrumPlot
->
setYAxisAutoscaleEnabled
(
true
);
}
}
I0mapmon
::~
I0mapmon
()
{
delete
ui
;
}
void
I0mapmon
::
onNamesReady
(
const
QStringList
&
n
)
{
ui
->
qucbx
->
clear
();
ui
->
qucbx
->
insertItems
(
0
,
n
);
if
(
n
.
size
())
{
onXChanged
(
n
.
first
());
// X combo box
connect
(
ui
->
qucbx
,
SIGNAL
(
currentTextChanged
(
QString
)),
this
,
SLOT
(
onXChanged
(
QString
)));
}
}
void
I0mapmon
::
applyWavelenX
()
{
bool
ok
;
QString
tgt
,
txt
;
QVector
<
double
>
vals
;
sender
()
->
objectName
()
==
"pbApplyWlens"
?
txt
=
ui
->
quleWlens
->
text
()
:
txt
=
ui
->
quleWlenWei
->
text
();
foreach
(
const
QString
&
v
,
txt
.
split
(
QRegularExpression
(
",
\\
s*"
)))
if
(
v
.
toDouble
(
&
ok
)
&&
ok
)
vals
.
push_back
(
v
.
toDouble
());
sender
()
->
objectName
()
==
"pbApplyWlens"
?
tgt
=
QString
(
"$2/FEL0%1_IOM_wavelengths"
).
arg
(
m_fel0x
)
:
tgt
=
QString
(
"$2/FEL0%1_IOM_wavelength_weights"
).
arg
(
m_fel0x
);
qDebug
()
<<
__PRETTY_FUNCTION__
<<
"*WOULD WRITE ON* target"
<<
tgt
<<
"values"
<<
vals
;
}
void
I0mapmon
::
onXChanged
(
const
QString
&
x
)
{
ui
->
quSpectrumPlot
->
unsetSources
();
ui
->
quSpectrumPlot
->
clearPlot
();
ui
->
quSpectrumPlot
->
setSource
(
"$1/"
+
x
);
}
src/i0mapmon.h
View file @
ab498e51
...
...
@@ -21,6 +21,11 @@ public:
explicit
I0mapmon
(
CumbiaPool
*
cu_p
,
QWidget
*
parent
=
0
);
~
I0mapmon
();
private
slots
:
void
onNamesReady
(
const
QStringList
&
n
);
void
applyWavelenX
();
void
onXChanged
(
const
QString
&
x
);
private:
Ui
::
I0mapmon
*
ui
;
...
...
@@ -29,6 +34,8 @@ private:
QuLogImpl
m_log_impl
;
CuControlsFactoryPool
m_ctrl_factory_pool
;
// cumbia
int
m_fel0x
;
};
#endif // I0mapmon_H
src/i0mapmon.ui
View file @
ab498e51
<?xml version="1.0" encoding="UTF-8"?>
<ui
version=
"4.0"
>
<class>
I0mapmon
</class>
<widget class="QWidget" name="I0mapmon"
>
<property name="geometry"
>
<widget
class=
"QWidget"
name=
"I0mapmon"
>
<property
name=
"geometry"
>
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
400
</width>
<height>
300
</height>
<width>
776
</width>
<height>
563
</height>
</rect>
</property>
<property name="windowTitle"
>
<property
name=
"windowTitle"
>
<string>
I0mapmon
</string>
</property>
<layout
class=
"QGridLayout"
name=
"gridLayout"
>
<item
row=
"1"
column=
"0"
colspan=
"4"
>
<widget
class=
"QuSpectrumPlot"
name=
"quSpectrumPlot"
/>
</item>
<item
row=
"2"
column=
"0"
colspan=
"4"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
X:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QuComboBox"
name=
"qucbx"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
2
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_3"
>
<property
name=
"text"
>
<string>
Y:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QuComboBox"
name=
"qucby"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
2
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
N. Samples:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item>
<widget
class=
"QuInputOutput"
name=
"quInputOutput"
>
<property
name=
"sizePolicy"
>
<sizepolicy
hsizetype=
"Preferred"
vsizetype=
"Fixed"
>
<horstretch>
1
</horstretch>
<verstretch>
0
</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</item>
<item
row=
"3"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_4"
>
<property
name=
"text"
>
<string>
Wavelengths:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"3"
column=
"1"
>
<widget
class=
"QuLabel"
name=
"qulWlens"
/>
</item>
<item
row=
"3"
column=
"2"
>
<widget
class=
"QuLineEdit"
name=
"quleWlens"
/>
</item>
<item
row=
"3"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"pbApplyWlens"
>
<property
name=
"text"
>
<string>
APPLY
</string>
</property>
</widget>
</item>
<item
row=
"4"
column=
"0"
>
<widget
class=
"QLabel"
name=
"label_5"
>
<property
name=
"text"
>
<string>
Wavelen weights:
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
</set>
</property>
</widget>
</item>
<item
row=
"4"
column=
"1"
>
<widget
class=
"QuLabel"
name=
"qulWlenWei"
/>
</item>
<item
row=
"4"
column=
"2"
>
<widget
class=
"QuLineEdit"
name=
"quleWlenWei"
/>
</item>
<item
row=
"4"
column=
"3"
>
<widget
class=
"QPushButton"
name=
"pbApplyWlenWei"
>
<property
name=
"text"
>
<string>
APPLY
</string>
</property>
</widget>
</item>
<item
row=
"0"
column=
"0"
colspan=
"4"
>
<widget
class=
"QLabel"
name=
"lTitle"
>
<property
name=
"font"
>
<font>
<weight>
75
</weight>
<bold>
true
</bold>
</font>
</property>
<property
name=
"text"
>
<string>
Real time
</string>
</property>
<property
name=
"alignment"
>
<set>
Qt::AlignCenter
</set>
</property>
</widget>
</item>
</layout>
</widget>
<layoutDefault spacing="6" margin="11" />
<pixmapfunction></pixmapfunction>
<layoutdefault
spacing=
"6"
margin=
"11"
/>
<customwidgets>
<customwidget>
<class>
QuLabel
</class>
<extends>
QLabel
</extends>
<header>
qulabel.h
</header>
</customwidget>
<customwidget>
<class>
QuComboBox
</class>
<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>
<header>
quinputoutput.h
</header>
</customwidget>
<customwidget>
<class>
QuLineEdit
</class>
<extends>
QLineEdit
</extends>
<header>
qulineedit.h
</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>
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