From 46390dc9df18bb3215e3093096a9e8c1e6173ba7 Mon Sep 17 00:00:00 2001 From: "DESKTOP-7I8SUIC\\zhang" Date: Fri, 29 Aug 2025 08:26:13 +0800 Subject: [PATCH] fix relays bugs --- singlerelay.cpp | 3 ++- singlerelay.ui | 41 ----------------------------------------- 2 files changed, 2 insertions(+), 42 deletions(-) diff --git a/singlerelay.cpp b/singlerelay.cpp index 1cea32a..5bd7a89 100644 --- a/singlerelay.cpp +++ b/singlerelay.cpp @@ -45,7 +45,6 @@ SingleRelay::SingleRelay(int slot,int cardtype,QWidget *parent) btnGroup_slot->addButton(ui->pushButton_slot13); btnGroup_slot->addButton(ui->pushButton_slot14); btnGroup_slot->addButton(ui->pushButton_slot15); - btnGroup_slot->addButton(ui->pushButton_slot16); connect(btnGroup_slot, SIGNAL(buttonClicked(QAbstractButton *)), this, SLOT(OnButtonGroup(QAbstractButton *))); connect(ui->comboBox_relay_ch, QOverload::of(&QComboBox::currentIndexChanged), @@ -112,6 +111,8 @@ void SingleRelay::Init(){ std::shared_ptr ptr = std::dynamic_pointer_cast(cardbase_ptr); for (int var = 0; var < CHANNEL_COUNT; ++var) { std::shared_ptr variable_base = ptr->GetChannelPtr(var + 1); + if(variable_base == nullptr) + continue; QString item_data,item_str; if(variable_base->alert_high.enable){ item_str = QString("%1 (槽位 %2 通道 %3 警报高)").arg(ptr->base_config_[var].point_name).arg(ptr->base_config_[var].chan_id.mid(1,2)).arg(ptr->base_config_[var].chan_id.mid(4,2)); diff --git a/singlerelay.ui b/singlerelay.ui index 33997c7..525147a 100644 --- a/singlerelay.ui +++ b/singlerelay.ui @@ -524,28 +524,6 @@ - - - - - 30 - 0 - - - - - 30 - 16777215 - - - - 16 - - - Qt::AlignCenter - - - @@ -837,25 +815,6 @@ - - - - - 30 - 220 - - - - - 30 - 220 - - - - - - -