Commit 44f6ce87 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files

support for server down

parent 65295324
......@@ -147,13 +147,13 @@ void AlarmTreeWidget::refresh(const CuData &v) {
double d = static_cast<int>(v["timestamp_us"].toDouble());
QString ts = QDateTime::fromSecsSinceEpoch(d).toString("HH:mm:ss");
ts += QString("+%1").arg(d - static_cast<int>(d));
QuString src(v, "src");
QString src = QuString(v, "src");
bool err = v["err"].toBool();
QStringList data = QuStringList(v, "value");
setToolTip(QuString(v, "msg"));
/* remove the filter */
if (err) {
src = QuString(v, "device");
src = src.section('/', 0, src.count('/') - 1);
data = m_gen_error_item(v);
perr("%s: %s\n", qstoc(src), qstoc(toolTip()));
}
......@@ -309,7 +309,9 @@ void AlarmTreeWidget::m_insert_item(const QString& src, const QStringList &list,
QStringList AlarmTreeWidget::m_gen_error_item(const CuData &da) const {
QStringList l;
QDateTime dt = QDateTime::currentDateTime();
l << dt.toString() << "-" << QuString(da, "device") << "ERROR" << "NACK" << "1" << "high" << "-1" << "gr_handler" << QuString(da, "msg");
QString dev = QuString(da, "src");
dev = dev.section('/', 0, dev.count('/') - 1);
l << dt.toString() << "-" << dev << "ERROR" << "NACK" << "1" << "high" << "-1" << "gr_handler" << QuString(da, "msg");
return l;
}
......
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