diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp index b528b5e..009f972 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.cpp +++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp @@ -623,6 +623,7 @@ void CheckWindow::on_tableWidget_3_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn) { if(currentRow>=0&¤tRowsetWindowModality(Qt::ApplicationModal); checkWindow->show(); } + +void CheckWindow::on_pushButton_8_clicked() +{ + ConnectInfo& item = connectList[currConnectIdx]; + if(item.programInterface.id==""){ + BaseCommonApi baseApi; + qint64 id = baseApi.generateId(); + item.programInterface.id = QString::number(id); + item.programInterface.device_id = item.id; + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::InsertVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + } + else + { + QMessageBox::warning(this, "警告", "保存失败!"); + } + }else{ + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::UpdateVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + }else{ + QMessageBox::warning(this, "警告", "保存失败!"); + } + } +} diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp index b528b5e..009f972 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.cpp +++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp @@ -623,6 +623,7 @@ void CheckWindow::on_tableWidget_3_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn) { if(currentRow>=0&¤tRowsetWindowModality(Qt::ApplicationModal); checkWindow->show(); } + +void CheckWindow::on_pushButton_8_clicked() +{ + ConnectInfo& item = connectList[currConnectIdx]; + if(item.programInterface.id==""){ + BaseCommonApi baseApi; + qint64 id = baseApi.generateId(); + item.programInterface.id = QString::number(id); + item.programInterface.device_id = item.id; + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::InsertVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + } + else + { + QMessageBox::warning(this, "警告", "保存失败!"); + } + }else{ + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::UpdateVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + }else{ + QMessageBox::warning(this, "警告", "保存失败!"); + } + } +} diff --git a/softwareDirectory/AutoVerScheme/checkwindow.h b/softwareDirectory/AutoVerScheme/checkwindow.h index 99a9d96..987cd18 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.h +++ b/softwareDirectory/AutoVerScheme/checkwindow.h @@ -63,6 +63,8 @@ void on_pushButton_7_clicked(); + void on_pushButton_8_clicked(); + private: void getCheckDevice(bool bInit=true); void getCheckMethod(); @@ -97,6 +99,7 @@ int iEquipType=1; QMap unitTransList; QString standardId; + int currConnectIdx; }; #endif // CHECKWINDOW_H diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp index b528b5e..009f972 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.cpp +++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp @@ -623,6 +623,7 @@ void CheckWindow::on_tableWidget_3_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn) { if(currentRow>=0&¤tRowsetWindowModality(Qt::ApplicationModal); checkWindow->show(); } + +void CheckWindow::on_pushButton_8_clicked() +{ + ConnectInfo& item = connectList[currConnectIdx]; + if(item.programInterface.id==""){ + BaseCommonApi baseApi; + qint64 id = baseApi.generateId(); + item.programInterface.id = QString::number(id); + item.programInterface.device_id = item.id; + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::InsertVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + } + else + { + QMessageBox::warning(this, "警告", "保存失败!"); + } + }else{ + if(ui->radioButton_serial->isChecked()) + item.programInterface.communication_type = "SerialPort"; + else + item.programInterface.communication_type = "Visa"; + item.programInterface.serial_port = QString("%1;%2;%3;%4;%5").arg(ui->comboBox_port->currentText()).arg(ui->comboBox_baurt->currentText()).arg(ui->comboBox_check->currentText()) + .arg(ui->comboBox_data->currentText()).arg(ui->comboBox_stop->currentText()); + item.programInterface.visa = ui->comboBox_visa->currentText(); + if(BaseCommonApi::UpdateVerificationProgramConfigInterface(item.programInterface)){ + QMessageBox::information(this, "提示", "保存成功!"); + }else{ + QMessageBox::warning(this, "警告", "保存失败!"); + } + } +} diff --git a/softwareDirectory/AutoVerScheme/checkwindow.h b/softwareDirectory/AutoVerScheme/checkwindow.h index 99a9d96..987cd18 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.h +++ b/softwareDirectory/AutoVerScheme/checkwindow.h @@ -63,6 +63,8 @@ void on_pushButton_7_clicked(); + void on_pushButton_8_clicked(); + private: void getCheckDevice(bool bInit=true); void getCheckMethod(); @@ -97,6 +99,7 @@ int iEquipType=1; QMap unitTransList; QString standardId; + int currConnectIdx; }; #endif // CHECKWINDOW_H diff --git a/softwareDirectory/AutoVerScheme/checkwindow.ui b/softwareDirectory/AutoVerScheme/checkwindow.ui index e81b305..806eadb 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.ui +++ b/softwareDirectory/AutoVerScheme/checkwindow.ui @@ -1421,6 +1421,31 @@ + + + + + 120 + 36 + + + + + 12 + 75 + true + + + + color: rgb(255, 255, 255); +background-color: rgb(55, 83, 123); +border-radius:5px; + + + 保存 + + +