Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Corryvreckan
Corryvreckan
Commits
f5f278fd
Commit
f5f278fd
authored
Nov 09, 2018
by
Simon Spannagel
Browse files
OnlineMon: improve updating behavior
parent
a7e33f33
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/modules/OnlineMonitor/OnlineMonitor.cpp
View file @
f5f278fd
...
...
@@ -8,7 +8,7 @@ using namespace std;
OnlineMonitor
::
OnlineMonitor
(
Configuration
config
,
std
::
vector
<
std
::
shared_ptr
<
Detector
>>
detectors
)
:
Module
(
std
::
move
(
config
),
std
::
move
(
detectors
))
{
canvasTitle
=
m_config
.
get
<
std
::
string
>
(
"canvasTitle"
,
"Corryvreckan Testbeam Monitor"
);
updateNumber
=
m_config
.
get
<
int
>
(
"update"
,
5
00
);
updateNumber
=
m_config
.
get
<
int
>
(
"update"
,
2
00
);
// Set up overview plots:
canvas_overview
=
m_config
.
getMatrix
<
std
::
string
>
(
"Overview"
,
...
...
@@ -109,32 +109,20 @@ void OnlineMonitor::initialise() {
eventNumber
=
0
;
}
StatusCode
OnlineMonitor
::
run
(
std
::
shared_ptr
<
Clipboard
>
clipboard
)
{
StatusCode
OnlineMonitor
::
run
(
std
::
shared_ptr
<
Clipboard
>
)
{
// Draw all histograms
if
(
eventNumber
%
updateNumber
==
0
)
{
gui
->
canvas
->
GetCanvas
()
->
Paint
();
gui
->
canvas
->
GetCanvas
()
->
Update
();
gui
->
Update
();
eventNumber
++
;
}
gSystem
->
ProcessEvents
();
// Get the tracks from the clipboard
Tracks
*
tracks
=
reinterpret_cast
<
Tracks
*>
(
clipboard
->
get
(
"tracks"
));
if
(
tracks
==
nullptr
)
{
return
Success
;
}
// Otherwise increase the event number
// Increase the event number
eventNumber
++
;
return
Success
;
}
void
OnlineMonitor
::
finalise
()
{
LOG
(
DEBUG
)
<<
"Analysed "
<<
eventNumber
<<
" events"
;
}
void
OnlineMonitor
::
AddCanvas
(
std
::
string
canvas_title
,
Matrix
<
std
::
string
>
canvas_plots
)
{
std
::
string
canvas_name
=
canvas_title
+
"Canvas"
;
...
...
src/modules/OnlineMonitor/OnlineMonitor.h
View file @
f5f278fd
...
...
@@ -34,7 +34,6 @@ namespace corryvreckan {
// Functions
void
initialise
();
StatusCode
run
(
std
::
shared_ptr
<
Clipboard
>
clipboard
);
void
finalise
();
// Application to allow display persistancy
TApplication
*
app
;
...
...
src/objects/GuiDisplay.hpp
View file @
f5f278fd
...
...
@@ -82,6 +82,11 @@ namespace corryvreckan {
// Exit the monitoring
inline
void
Exit
()
{
raise
(
SIGINT
);
}
inline
void
Update
()
{
canvas
->
GetCanvas
()
->
Paint
();
canvas
->
GetCanvas
()
->
Update
();
}
// ROOT I/O class definition - update version number when you change this class!
ClassDef
(
GuiDisplay
,
2
)
};
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment