修改告警中,如果告警数值为0则不显示该条信息。不够严谨,需要确认解码
parent
f93959d19f
commit
2135b69ecc
|
@ -284,11 +284,15 @@ void CustomDisplayPanel::UpdateAlarm(OpenJson &json)
|
|||
m_pTableWidget->setUpdatesEnabled(false);
|
||||
for(size_t i=0; i<nodeTable.size(); i++)
|
||||
{
|
||||
m_pTableWidget->insertRow(0);
|
||||
auto& node = nodeTable[i];
|
||||
std::string value = node["value"].s();
|
||||
if (value == "0")
|
||||
continue;
|
||||
|
||||
std::string s = node["time"].s();
|
||||
std::string title = node["signal"].s();
|
||||
std::string value = node["value"].s();
|
||||
|
||||
m_pTableWidget->insertRow(0);
|
||||
|
||||
QTableWidgetItem *item0 = new QTableWidgetItem(QString::fromStdString(s));
|
||||
item0->setTextAlignment(Qt::AlignLeft | Qt::AlignVCenter); // 右对齐+垂直居中
|
||||
|
|
|
@ -73,7 +73,8 @@ MainWindow::~MainWindow()
|
|||
|
||||
void MainWindow::getConfiguration(QString iniFilePath)
|
||||
{
|
||||
m_pSettings = new QSettings(iniFilePath, QSettings::IniFormat);
|
||||
if (m_pSettings == nullptr)
|
||||
m_pSettings = new QSettings(iniFilePath, QSettings::IniFormat);
|
||||
|
||||
m_version = m_pSettings->value("version/ver").toString();
|
||||
m_modbus_type = m_pSettings->value("modbus/type").toInt();
|
||||
|
@ -210,7 +211,7 @@ bool MainWindow::InitializeUI()
|
|||
QGridLayout *mainLayout = new QGridLayout(centralWidget);
|
||||
|
||||
this->setStyleSheet("background-color: white;");
|
||||
//this->setProperty("canMove",true);
|
||||
this->setProperty("canMove",true);
|
||||
|
||||
//设置窗体透明
|
||||
this->setAttribute(Qt::WA_TranslucentBackground, true);
|
||||
|
|
Loading…
Reference in New Issue