Commit 19e4e284 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

added acmd.h,cpp

parent 1fcb0bb9
...@@ -191,7 +191,7 @@ void AlarmTreeWidget::refresh(const CuData &v) { ...@@ -191,7 +191,7 @@ void AlarmTreeWidget::refresh(const CuData &v) {
/* save current scroll bar value */ /* save current scroll bar value */
scrollBarPos = verticalScrollBar()->value(); scrollBarPos = verticalScrollBar()->value();
/* instead of GROUP information, show DEVICE */ /* instead of GROUP information, show DEVICE */
fields[DEVICE] = src; fields[DEVICE] = src.section('/', 0, src.count('/') - 1);
item = mItemHash.value(fields.at(AlarmTreeWidgetItem::Alarm)); item = mItemHash.value(fields.at(AlarmTreeWidgetItem::Alarm));
if(!item) /* create a new item */ { if(!item) /* create a new item */ {
......
...@@ -87,7 +87,7 @@ void AlarmTreeWidgetItem::update(const QStringList &fields) ...@@ -87,7 +87,7 @@ void AlarmTreeWidgetItem::update(const QStringList &fields)
setText(i, field); setText(i, field);
if(colorField.contains("ALARM")) { if(colorField.contains("ALARM")) {
if(levelField == "medium") if(levelField == "medium")
setBackground(i, KRED); setBackground(i, QColor(Qt::red));
else if(levelField == "high") { else if(levelField == "high") {
setBackground(i, QBrush(EColor(Elettra::violet))); setBackground(i, QBrush(EColor(Elettra::violet)));
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
#include <QMultiMap> #include <QMultiMap>
#include <AlarmTreeWidget.h> #include <AlarmTreeWidget.h>
#include <AlarmTreeWidgetItem.h>
#include <quwriter.h> #include <quwriter.h>
Acmd::Acmd() { Acmd::Acmd() {
...@@ -15,9 +16,9 @@ void Acmd::ack(const QTreeWidget *tw, bool all, CumbiaPool *cup, const CuControl ...@@ -15,9 +16,9 @@ void Acmd::ack(const QTreeWidget *tw, bool all, CumbiaPool *cup, const CuControl
QuWriter *w = new QuWriter(nullptr, cup, fpoo); QuWriter *w = new QuWriter(nullptr, cup, fpoo);
const QStringList &alarms = map.values(dev); const QStringList &alarms = map.values(dev);
w->setAutoDestroy(true); w->setAutoDestroy(true);
w->setTarget(QString("%1->Ack(%2)").arg(dev).arg(alarms.join(','))); w->setTarget(QString("%1->Ack").arg(dev));
printf("AckCmd.ack: executing %s (%s)\n", qstoc(w->target()), qstoc(alarms.join(","))); printf("AckCmd.ack: executing %s (%s)\n", qstoc(w->target()), qstoc(alarms.join(",")));
w->execute(); w->execute(alarms);
/* stop new */ /* stop new */
QuWriter *stopNewWriter = new QuWriter(nullptr, cup, fpoo); QuWriter *stopNewWriter = new QuWriter(nullptr, cup, fpoo);
...@@ -47,6 +48,6 @@ QMultiMap<QString, QString> Acmd::m_getDevAlarmMap(const QTreeWidget *tw, bool a ...@@ -47,6 +48,6 @@ QMultiMap<QString, QString> Acmd::m_getDevAlarmMap(const QTreeWidget *tw, bool a
if(!all) if(!all)
selected = tw->selectedItems(); selected = tw->selectedItems();
foreach(QTreeWidgetItem *si, selected) foreach(QTreeWidgetItem *si, selected)
map.insert(si->text(AlarmTreeWidget::DEVICE), si->text(AlarmTreeWidget::ALARM)); map.insert(si->data(AlarmTreeWidgetItem::Device, Qt::UserRole).toString(), si->text(AlarmTreeWidget::ALARM));
return map; return map;
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment