Skip to content

Commit d990c87

Browse files
committed
Make sure we can display graphs
1 parent 500fbca commit d990c87

4 files changed

Lines changed: 17 additions & 5 deletions

File tree

include/QualityControl/SpyMainFrame.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <TGTextEntry.h>
1919
#include <TGCanvas.h>
2020
#include <TGComboBox.h>
21+
#include "QualityControl/Quality.h"
2122

2223
namespace AliceO2 {
2324
namespace QualityControl {
@@ -44,7 +45,7 @@ class SpyMainFrame: public TGMainFrame
4445

4546
void closeWindow();
4647
void menuHandler(Int_t id);
47-
void updateList(std::string name, std::string taskName = "");
48+
void updateList(std::string name/*, AliceO2::QualityControl::Core::Quality quality*/, std::string taskName = "");
4849
/**
4950
* \param listName The name as it appears in the list and that might be different from obj->GetName()
5051
*/

src/Checker.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void Checker::check(MonitorObject *mo)
189189
CheckInterface *checkInstance = instantiateCheck(check.name, check.className);
190190
Quality q = checkInstance->check(mo);
191191

192-
mLogger << " result of the check : " << q.getName() << AliceO2::InfoLogger::InfoLogger::endm;
192+
mLogger << " result of the check " << check.name << ": " << q.getName() << AliceO2::InfoLogger::InfoLogger::endm;
193193

194194
checkInstance->beautify(mo, q);
195195
}

src/SpyDevice.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
#include <FairMQDevice.h>
99
#include <TMessage.h>
1010
#include "QualityControl/SpyDevice.h"
11+
#include "QualityControl/MonitorObject.h"
1112
#include <TSystem.h>
1213
#include <chrono>
1314
#include <thread>
1415
#include <boost/algorithm/string.hpp>
1516

1617
using namespace std;
18+
using namespace AliceO2::QualityControl::Core;
1719

1820
namespace AliceO2 {
1921
namespace QualityControl {
@@ -57,12 +59,14 @@ void SpyDevice::Run()
5759
if (tobj) {
5860
// TODO once the bug in ROOt that removes spaces in strings passed in signal slot is fixed we can use the normal name.
5961
string objectName = tobj->GetName();
62+
MonitorObject *mo = dynamic_cast<MonitorObject*>(tobj);
63+
Quality q = mo ? mo->getQuality() : Quality::Null;
6064
boost::erase_all(objectName, " ");
6165
if (mCache.count(objectName) && mCache[objectName]) {
6266
delete mCache[objectName];
6367
}
6468
mCache[objectName] = tobj;
65-
mFrame->updateList(objectName);
69+
mFrame->updateList(objectName/*, q*/); // TODO give quality to show in the gui
6670
} else {
6771
cerr << "not a tobject !" << endl;
6872
}

src/SpyMainFrame.cxx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <QualityControl/DatabaseFactory.h>
1616
#include <Configuration/Configuration.h>
1717
#include <Configuration/ConfigurationFactory.h>
18+
#include <TGraph.h>
1819

1920
using namespace std;
2021
using namespace AliceO2::QualityControl::Repository;
@@ -202,7 +203,13 @@ void SpyMainFrame::displayObject(TObject *obj)
202203
delete mDrawnObject;
203204
gPad->Clear();
204205
}
205-
mDrawnObject = obj->DrawClone();
206+
207+
string drawOptions = "";
208+
if (((AliceO2::QualityControl::Core::MonitorObject *) obj)->getObject()->IsA() == TGraph::Class()) {
209+
drawOptions = "ALP";
210+
}
211+
212+
mDrawnObject = obj->DrawClone(drawOptions.c_str());
206213
gPad->Modified();
207214
gPad->Update();
208215
gSystem->ProcessEvents();
@@ -220,7 +227,7 @@ void SpyMainFrame::displayObject(const char *objectName)
220227
}
221228
}
222229

223-
void SpyMainFrame::updateList(string name, string taskName)
230+
void SpyMainFrame::updateList(string name, /*AliceO2::QualityControl::Core::Quality quality, */string taskName)
224231
{
225232
if (mMapButtons.count(name) == 0) { // object unknown yet
226233
auto *button = new TGTextButton(mObjectsListFrame, name.c_str());

0 commit comments

Comments
 (0)