Commit 51470851 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

fixed fqdn in historical view

parent bfa89448
......@@ -57,9 +57,9 @@ void AlarmTreeWidget::refresh(const CuData &v) {
// error: err flag is true and message is not of type "cannot extract data..."
// only AlarmType adds an entry for each error
if (err && m_type == AlarmType) {
data << m_gen_error_item(v);
if(!m_src_err_map.contains(src))
m_src_err_map.insert(src, SrvErrNew|SrvErrUnack); // true: new
data << m_gen_error_item(v);
}
else {
if(m_src_err_map.contains(src)) {
......
......@@ -19,7 +19,7 @@ void Acmd::ack(const QTreeWidget *tw, bool all, CumbiaPool *cup, const CuControl
foreach(const QString& dev, map.uniqueKeys()) {
QuWriter *w = new QuWriter(nullptr, cup, fpoo);
const QStringList &alarms = map.values(dev);
if(alarms.size() != 1 || alarms[0].count('/') != 3) { // exclude "Alarm server error"
if(alarms.size() != 1 || alarms[0].count('/') == 0) { // exclude "Alarm server error"
w->setAutoDestroy(true);
w->setTarget(QString("%1->Ack").arg(dev));
w->execute(alarms);
......@@ -43,7 +43,7 @@ void Acmd::silence(const QTreeWidget *tw, bool all, CumbiaPool *cup, const CuCon
foreach(const QString& dev, map.uniqueKeys()) {
QuWriter *w = new QuWriter(nullptr, cup, fpoo);
const QStringList &alarms = map.values(dev);
if(alarms.size() != 1 || alarms[0].count('/') != 3) { // exclude "Alarm server error"
if(alarms.size() != 1 || alarms[0].count('/') == 0) { // exclude "Alarm server error"
w->setAutoDestroy(true);
w->setTarget(dev + "->Silence");
w->execute(alarms);
......@@ -60,7 +60,7 @@ void Acmd::enable(const QTreeWidget *tw, CumbiaPool *cup, const CuControlsFactor
foreach(const QString& dev, map.uniqueKeys()) {
QuWriter *w = new QuWriter(nullptr, cup, fpoo);
const QStringList &alarms = map.values(dev);
if(alarms.size() != 1 || alarms[0].count('/') != 3) { // exclude "Alarm server error"
if(alarms.size() != 1 || alarms[0].count('/') == 0) { // exclude "Alarm server error"
w->setAutoDestroy(true);
w->setTarget(dev + "->Enable");
w->execute(alarms);
......@@ -77,7 +77,7 @@ void Acmd::stop_new(const QTreeWidget *tw, bool all, CumbiaPool *cup, const CuCo
foreach(const QString& dev, map.uniqueKeys()) { // exclude "Alarm server error"
QuWriter *w = new QuWriter(nullptr, cup, fpoo);
const QStringList &alarms = map.values(dev);
if(alarms.size() != 1 || alarms[0].count('/') != 3) {
if(alarms.size() != 1 || alarms[0].count('/') == 0) {
w->setAutoDestroy(true);
w->setTarget(dev + "->StopNew");
w->execute(alarms);
......
......@@ -43,7 +43,8 @@ QVariant MySqlModel::data(const QModelIndex &index, int role) const
QString s = value.toString();
QRegularExpressionMatch ma = re.match(s);
if(ma.capturedTexts().size() > 2) {
s = "[" + ma.capturedTexts().at(1).section('.', 0, 0) + "] " + ma.capturedTexts()[2];
QString s = ma.capturedTexts().at(1);
s.contains('.') ? s = "[" + s.section('.', 0, 0) + "] " + ma.capturedTexts()[2] : s = s;
return s;
}
}
......
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