From d76ec6e50b3fd3e71efa6d2bdd3829cebb50d2e3 Mon Sep 17 00:00:00 2001 From: zhangsheng Date: Tue, 19 Nov 2024 11:29:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BB=A7=E7=94=B5=E5=99=A81,?= =?UTF-8?q?2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Configuration.cpp | 28 +++++++- Configuration.h | 4 ++ Configuration.ui | 168 +++++++++++++++++++++++++--------------------- 3 files changed, 124 insertions(+), 76 deletions(-) diff --git a/Configuration.cpp b/Configuration.cpp index 4bc5792..0dc7eed 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -31,10 +31,14 @@ CConfiguration::CConfiguration(QWidget *parent) : pHeader2->setSectionResizeMode(QHeaderView::ResizeToContents); pHeader2->setStretchLastSection(false); + ui->treeView_Available->setEditTriggers(QAbstractItemView::NoEditTriggers); ui->treeView_Relay->setEditTriggers(QAbstractItemView::NoEditTriggers); connect(ui->comboBox_WC,SIGNAL(currentTextChanged(const QString &)),this,SLOT(on_comboBox_WC_currentTextChanged2(const QString&))); + ui->label_4->setVisible(0); + ui->lineEdit_2->setVisible(0); + ui->label_10->setVisible(0); } CConfiguration::~CConfiguration() @@ -665,6 +669,12 @@ void CConfiguration::on_pushButton_confirm_clicked() }else if(ui->radioButton_10->isChecked()){ flag = 1; ConfiguraitonsObj = SelectChannel(12); + }else if(ui->radioButton_11->isChecked()){ + flag = 1; + ConfiguraitonsObj = SelectChannel(1); + }else if(ui->radioButton_12->isChecked()){ + flag = 1; + ConfiguraitonsObj = SelectChannel(2); } if(flag == -1){ @@ -705,7 +715,7 @@ void CConfiguration::on_pushButton_confirm_clicked() ConfiguraitonsObj2 = ConfiguraitonsObj; ConfiguraitonsObj["logicExpress"] = rootArray; ConfiguraitonsObj2["logicExpress"] = logicExpressArray2; - saveJsonToFile(ConfiguraitonsObj, "TreeViewToJSON.json"); + //saveJsonToFile(ConfiguraitonsObj, "TreeViewToJSON.json"); QString strTableName = " t_UnitConfiguration "; QVector vecUnitConfiguration = g_SqliteDB->GetUnitConfigurationInfo(strTableName); for (int i = 0; i < vecUnitConfiguration.size(); i++) { @@ -1427,3 +1437,19 @@ void CConfiguration::on_treeView_Available_pressed(const QModelIndex &index) } +void CConfiguration::on_radioButton_11_clicked() +{ + m_curentRLY = 1; + ui->label_3->setText(ui->radioButton_11->text()+":"); + ViewRelay(1); +} +void CConfiguration::on_radioButton_12_clicked() +{ + m_curentRLY = 2; + ui->label_3->setText(ui->radioButton_12->text()+":"); + ViewRelay(2); +} + + + + diff --git a/Configuration.h b/Configuration.h index 71628d8..f222510 100644 --- a/Configuration.h +++ b/Configuration.h @@ -58,6 +58,10 @@ private slots: void on_treeView_Available_pressed(const QModelIndex &index); + void on_radioButton_12_clicked(); + + void on_radioButton_11_clicked(); + private: Ui::CConfiguration *ui; diff --git a/Configuration.ui b/Configuration.ui index 0f8d184..291d846 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -7,7 +7,7 @@ 0 0 1052 - 640 + 659 @@ -112,6 +112,9 @@ color: rgb(27, 30, 35); 选择继电器 + + Qt::AlignCenter + @@ -122,89 +125,104 @@ color: rgb(27, 30, 35); 0 - + - - - 150 - 0 - - Qt::Horizontal - - - 继电器3 + + + 18 - - - - - - 继电器4 - - - - - - - 继电器5 - - - - - - - 继电器6 - - - - - - - 继电器7 - - - - - - - 继电器8 - - - - - - - 继电器9 - - - - - - - 继电器10 - - - - - - - 继电器11 - - - - - - - 继电器12 - - + + + + 继电器1 + + + + + + + 继电器2 + + + + + + + 继电器3 + + + + + + + 继电器4 + + + + + + + 继电器5 + + + + + + + 继电器6 + + + + + + + 继电器7 + + + + + + + 继电器8 + + + + + + + 继电器9 + + + + + + + 继电器10 + + + + + + + 继电器11 + + + + + + + 继电器12 + + + +