diff --git a/MyTcpClient.cpp b/MyTcpClient.cpp index a102aff..c070f57 100644 --- a/MyTcpClient.cpp +++ b/MyTcpClient.cpp @@ -1,6 +1,8 @@ #include "MyTcpClient.h" #include +MyTcpClient* MyTcpClient::m_instance = nullptr; + MyTcpClient::MyTcpClient(QObject *parent) : QObject(parent), shouldReconnect(true) { socket = new QTcpSocket(this); @@ -21,7 +23,13 @@ MyTcpClient::~MyTcpClient() { socket->deleteLater(); } } - +MyTcpClient* MyTcpClient::instance() +{ + if (!m_instance) { + m_instance = new MyTcpClient(); + } + return m_instance; +} void MyTcpClient::connectToServer(const QString &host, quint16 port) { serverHost = host; serverPort = port; diff --git a/MyTcpClient.h b/MyTcpClient.h index 88e2bce..c42d4da 100644 --- a/MyTcpClient.h +++ b/MyTcpClient.h @@ -9,6 +9,7 @@ class MyTcpClient : public QObject { Q_OBJECT public: + static MyTcpClient* instance(); explicit MyTcpClient(QObject *parent = nullptr); ~MyTcpClient(); @@ -37,6 +38,7 @@ private: QString serverHost; quint16 serverPort; bool shouldReconnect; // 标记是否需要重连 + static MyTcpClient* m_instance; }; #endif // MYTCPCLIENT_H diff --git a/acceleration.cpp b/acceleration.cpp index 0d42b80..6f5dee4 100644 --- a/acceleration.cpp +++ b/acceleration.cpp @@ -21,9 +21,9 @@ Acceleration::Acceleration(int slot_no_,int channel_,bool active,QWidget *parent ui->label_active->setText("(启用)"); else ui->label_active->setText("(停用)"); - QString filePath_filter = QCoreApplication::applicationDirPath() + QString("\\config\\filter_%1_%2.json").arg(slot_no).arg(channel); + QString filePath_filter = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\filter_%2.json").arg(slot_no).arg(channel); readJsonFile(filePath_filter); - QString filePath_variables = QCoreApplication::applicationDirPath() + QString("\\config\\acceleration_variables_%1_%2.json").arg(slot_no).arg(channel); + QString filePath_variables = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\acceleration_variables_%2.json").arg(slot_no).arg(channel); readJsonFile(filePath_variables); Init(); } @@ -77,14 +77,12 @@ void Acceleration::readJsonFile(const QString &filePath) variables[i].checked = temp_obj["checked"].toBool(); variables[i].full_sacle_range = temp_obj["full_sacle_range"].toString(); variables[i].clamp_value = temp_obj["clamp_value"].toDouble(); - }else if(variables[i].type == "1x_phase_lag"){ - variables[i].clamp_value = temp_obj["clamp_value"].toDouble(); + variables[i].phase_lag = temp_obj["phase_lag"].toDouble(); }else if(variables[i].type == "2x_ampl"){ variables[i].checked = temp_obj["checked"].toBool(); variables[i].full_sacle_range = temp_obj["full_sacle_range"].toString(); variables[i].clamp_value = temp_obj["clamp_value"].toDouble(); - }else if(variables[i].type == "2x_phase_lag"){ - variables[i].clamp_value = temp_obj["clamp_value"].toDouble(); + variables[i].phase_lag = temp_obj["phase_lag"].toDouble(); } } QJsonObject delay_obj = json_obj["delay"].toObject(); @@ -98,7 +96,7 @@ void Acceleration::readJsonFile(const QString &filePath) alert_variables.timed_ok = json_obj["timed_ok"].toBool(); alert_variables.recorder_output = json_obj["recorder_output"].toString(); alert_variables.two_ma_clamp = json_obj["two_ma_clamp"].toBool(); - alert_variables.trip_mutiply = json_obj["trip_mutiply"].toDouble(); + alert_variables.trip_multiply = json_obj["trip_multiply"].toDouble(); alert_variables.comparision = json_obj["comparision"].toString(); alert_variables.comparision_percentage = json_obj["comparision_percentage"].toInt(); } @@ -132,12 +130,10 @@ void Acceleration::Init() }else if(variables[i].type == "1x_ampl"){ ui->comboBox_1x_value_range->setCurrentText(variables[i].full_sacle_range); ui->doubleSpinBox_1x_ampl_clamp->setValue(variables[i].clamp_value); - }else if(variables[i].type == "1x_phase_lag"){ ui->doubleSpinBox_1x_phase_lag_clamp->setValue(variables[i].clamp_value); }else if(variables[i].type == "2x_ampl"){ ui->comboBox_2x_value_range->setCurrentText(variables[i].full_sacle_range); ui->doubleSpinBox_2x_ampl_clamp->setValue(variables[i].clamp_value); - }else if(variables[i].type == "2x_phase_lag"){ ui->doubleSpinBox_2x_phase_lag_clamp->setValue(variables[i].clamp_value); } } @@ -151,7 +147,7 @@ void Acceleration::Init() ui->checkBox_timed_ok->setChecked(alert_variables.timed_ok); ui->comboBox_recorder_output->setCurrentText(alert_variables.recorder_output); ui->checkBox_two_ma_clamp->setChecked(alert_variables.two_ma_clamp); - ui->doubleSpinBox_trip_mutiply->setValue(alert_variables.trip_mutiply); + ui->doubleSpinBox_trip_multiply->setValue(alert_variables.trip_multiply); ui->comboBox_comparision->setCurrentText(alert_variables.comparision); ui->spinBox_comparision_percentage->setValue(alert_variables.comparision_percentage); } @@ -205,7 +201,7 @@ void Acceleration::on_pushButton_confirm_clicked() alert_variables.timed_ok = ui->checkBox_timed_ok->isChecked(); alert_variables.recorder_output = ui->comboBox_recorder_output->currentText(); alert_variables.two_ma_clamp = ui->checkBox_two_ma_clamp->isChecked(); - alert_variables.trip_mutiply = ui->doubleSpinBox_trip_mutiply->value(); + alert_variables.trip_multiply = ui->doubleSpinBox_trip_multiply->value(); alert_variables.comparision = ui->comboBox_comparision->currentText(); alert_variables.comparision_percentage = ui->spinBox_comparision_percentage->value(); @@ -246,13 +242,13 @@ void Acceleration::on_pushButton_confirm_clicked() variables_obj.insert("timed_ok",alert_variables.timed_ok); variables_obj.insert("recorder_output",alert_variables.recorder_output); variables_obj.insert("two_ma_clamp",alert_variables.two_ma_clamp); - variables_obj.insert("trip_mutiply",alert_variables.trip_mutiply); + variables_obj.insert("trip_multiply",alert_variables.trip_multiply); variables_obj.insert("comparision",alert_variables.comparision); variables_obj.insert("comparision_percentage",alert_variables.comparision_percentage); variables_obj.insert("slot",slot_no); variables_obj.insert("id",channel); QJsonDocument jsonDoc_filter(filter_obj); - QString filePath = QCoreApplication::applicationDirPath() + QString("\\config\\filter_%1_%2.json").arg(slot_no).arg(channel); + QString filePath = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\filter_%2.json").arg(slot_no).arg(channel); QFile file(filePath); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { qDebug() << "Cannot open file for writing:" << filePath; @@ -261,7 +257,7 @@ void Acceleration::on_pushButton_confirm_clicked() file.write(jsonDoc_filter.toJson()); file.close(); QJsonDocument jsonDoc_variables(variables_obj); - filePath = QCoreApplication::applicationDirPath() + QString("\\config\\acceleration_variables_%1_%2.json").arg(slot_no).arg(channel); + filePath = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\acceleration_variables_%2.json").arg(slot_no).arg(channel); file.setFileName(filePath); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { qDebug() << "Cannot open file for writing:" << filePath; @@ -271,3 +267,9 @@ void Acceleration::on_pushButton_confirm_clicked() file.close(); } + +void Acceleration::on_pushButton_set_default_clicked() +{ + +} + diff --git a/acceleration.h b/acceleration.h index 114957a..581c748 100644 --- a/acceleration.h +++ b/acceleration.h @@ -21,6 +21,8 @@ public: private slots: void on_pushButton_confirm_clicked(); + void on_pushButton_set_default_clicked(); + private: Ui::Acceleration *ui; diff --git a/acceleration.ui b/acceleration.ui index 7144d9f..36d6148 100644 --- a/acceleration.ui +++ b/acceleration.ui @@ -107,7 +107,7 @@ - 0 + 1 @@ -126,13 +126,6 @@ - - - - - - - 高通: @@ -224,13 +217,6 @@ - - - - - - - 低通: @@ -301,13 +287,6 @@ - - - - - - - 带通: @@ -713,8 +692,8 @@ 60 50 - 62 - 16 + 61 + 21 @@ -769,7 +748,7 @@ 60 20 61 - 16 + 21 @@ -830,7 +809,7 @@ 倍增 - + 460 @@ -1052,7 +1031,7 @@ - + 100 diff --git a/data_config.h b/data_config.h index d7be396..0c9f2fd 100644 --- a/data_config.h +++ b/data_config.h @@ -82,7 +82,7 @@ typedef struct{ bool timed_ok; QString recorder_output; bool two_ma_clamp; - float trip_mutiply; + float trip_multiply; QString comparision; int comparision_percentage; } Alert_Variables; diff --git a/doc/radial_vibration_variables.jsonc b/doc/radial_vibration_variables.jsonc index dd3a8c7..8fa7f4d 100644 --- a/doc/radial_vibration_variables.jsonc +++ b/doc/radial_vibration_variables.jsonc @@ -49,7 +49,7 @@ "danger_latching":true, "recorder_output":"direct", "two_ma_clamp":true, - "trip_mutiply":1.00, + "trip_multiply":1.00, "comparision":"direct", "comparision_percentage":5 } \ No newline at end of file diff --git a/keyphase.ui b/keyphase.ui index 5129b2e..c980506 100644 --- a/keyphase.ui +++ b/keyphase.ui @@ -7,7 +7,7 @@ 0 0 660 - 686 + 661 @@ -1601,13 +1601,13 @@ - + - 40 + 41 10 - 478 - 23 + 431 + 22 @@ -1619,18 +1619,9 @@ - - - true - - - - 0 - 0 - - + - 5 + 5 @@ -1655,9 +1646,9 @@ - + - 5-6 + 5-6 diff --git a/mainwindow.cpp b/mainwindow.cpp index 385b15f..fee0baf 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -109,31 +109,24 @@ MainWindow::~MainWindow() { delete ui; } - +void MainWindow::onDisConnected() +{ + statusBar()->showMessage("连接失败!正在重连……", 3000); // 显示3秒 +} +void MainWindow::onConnected() +{ + statusBar()->showMessage("连接成功!", 3000); // 显示3秒 +} void MainWindow::connectServer() { - + m_tcpClient = MyTcpClient::instance(); + // 监听信号 + connect(m_tcpClient, SIGNAL(dataReceived(const QByteArray&)), this, SLOT(readData(const QByteArray&))); + connect(m_tcpClient, SIGNAL(disconnected()), this, SLOT(onDisConnected())); + connect(m_tcpClient, SIGNAL(connected()), this, SLOT(onConnected())); // 连接服务器 - client.connectToServer(g_strServerIp, 10000); - //client.sendData("send_buf", 1); - // // 监听信号 - // QObject::connect(&client, &MyTcpClient::connected, []() { - // qDebug() << "Client connected!"; - // }); - - // // QObject::connect(&client, &MyTcpClient::dataReceived, [](const QByteArray &data) { - // // qDebug() << "Received from server:" << data; - // // }); - connect(&client, SIGNAL(dataReceived(const QByteArray&)), this, SLOT(readData(const QByteArray&))); - connect(&client, SIGNAL(disconnected()), this, SLOT(onDisConnected())); - // // QObject::connect(&client, &MyTcpClient::errorOccurred, [](const QString &error) { - // // qDebug() << "Error:" << error; - // // }); - // socket = new QTcpSocket(this); - // connect(socket, &QTcpSocket::connected, this, &MainWindow::onConnected); - // connect(socket, &QTcpSocket::readyRead, this, &MainWindow::readData); - // socket->connectToHost(g_strServerIp, 10000); + m_tcpClient->connectToServer(g_strServerIp, 10000); } @@ -204,29 +197,29 @@ void MainWindow::createMenu(const QString& rootTitle, QPushButton* parent ) // 创建主菜单 QMenu *mainMenu = new QMenu(rootTitle, parent); - // 创建第一层子菜单:/30 振电器模块 + // 创建第一层子菜单 QMenu *monitors = new QMenu("监视器", mainMenu); - QMenu *relays = new QMenu("/30 继电器模块", mainMenu); - QMenu *keyphasor = new QMenu("/25 键相模块", mainMenu); + QMenu *relays = new QMenu("/DOM810 继电器模块", mainMenu); + QMenu *keyphasor = new QMenu("/KPM834 键相模块", mainMenu); - // 创建第二层子菜单:/40 振动板卡 - QMenu *proximitor_menu = new QMenu("/40 振动板卡", monitors); - QMenu *rpm_menu = new QMenu("/50 转速板卡", monitors); + // 创建第二层子菜单:/HAM824 振动板卡 + QMenu *proximitor_menu = new QMenu("/HAM824 振动板卡", monitors); + QMenu *rpm_menu = new QMenu("/OPM844 转速板卡", monitors); - // 创建第三层子菜单:/40 单板卡、三冗余板卡 - QAction *proximitor_1 = proximitor_menu->addAction("/40 单板卡"); - QAction *proximitor_2 = proximitor_menu->addAction("/40 三冗余板卡"); + // 创建第三层子菜单:/HAM824 单板卡、三冗余板卡 + QAction *proximitor_1 = proximitor_menu->addAction("/HAM824 单板卡"); + QAction *proximitor_2 = proximitor_menu->addAction("/HAM824 三冗余板卡"); - QAction *rpm_1 = rpm_menu->addAction("/50 单板卡"); + QAction *rpm_1 = rpm_menu->addAction("/OPM844 单板卡"); - // 创建第二层子菜单:/25 键相模块 - QAction *keyphasor_1 = keyphasor->addAction("/25 单板卡"); - QAction *keyphasor_2 = keyphasor->addAction("/25 两板卡"); + // 创建第二层子菜单:/KPM834 键相模块 + QAction *keyphasor_1 = keyphasor->addAction("/KPM834 单板卡"); + QAction *keyphasor_2 = keyphasor->addAction("/KPM834 两板卡"); - // 创建第二层子菜单:/30 继电器模块 - QAction *relays_1 = relays->addAction("/30 单板卡"); - QAction *relays_2 = relays->addAction("/30 三冗余板卡"); + // 创建第二层子菜单:/DOM810 继电器模块 + QAction *relays_1 = relays->addAction("/DOM810 单板卡"); + QAction *relays_2 = relays->addAction("/DOM810 三冗余板卡"); // 将子菜单加入上一级菜单 monitors->addMenu(proximitor_menu); // 将第二层加入第一层 @@ -635,7 +628,7 @@ void MainWindow::sendUpgradePackage(int slot) }else{ chunkSize = totalBytes - bytesSent; } - qint64 bytesWritten = client.sendData(send_buf + bytesSent, chunkSize); + qint64 bytesWritten = m_tcpClient->sendData(send_buf + bytesSent, chunkSize); qDebug() << "bytesWritten" << bytesWritten << "bytesSent" << bytesSent ; if (bytesWritten == -1) { break; @@ -643,7 +636,7 @@ void MainWindow::sendUpgradePackage(int slot) bytesSent += bytesWritten; } qDebug() << "bytesSent" << bytesSent ; - client.waitForRead(); + m_tcpClient->waitForRead(); progressBar->reset(); progressBar->setVisible(true); QString upgrade_text = QStringLiteral("正在上传板卡 [ %1 ] …… %p%").arg(slot); @@ -667,14 +660,10 @@ void MainWindow::getVersion(int slot) memcpy(send_buf, (char*)&header, sizeof(PackageHead)); memcpy(send_buf + sizeof(PackageHead), (char*)&get_version_req, sizeof(GetVersionReq)); int length = sizeof(PackageHead) + sizeof(GetVersionReq); - qint64 bytesWritten = client.sendData(send_buf, length); - client.waitForRead(); + qint64 bytesWritten = m_tcpClient->sendData(send_buf, length); + m_tcpClient->waitForRead(); qDebug() << "bytesWritten: " << bytesWritten; } -void MainWindow::onDisConnected() -{ - statusBar()->showMessage("连接失败!", 30000); // 显示3秒 -} void MainWindow::readData(const QByteArray& data) { diff --git a/mainwindow.h b/mainwindow.h index 77da011..b64830d 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -39,10 +39,10 @@ private: QList list_label; QButtonGroup * btnGroup_slot = nullptr; + MyTcpClient* m_tcpClient; int slot_no = 0; QTcpSocket *socket; - MyTcpClient client; QProgressBar *progressBar; @@ -59,6 +59,7 @@ private: private slots: void onDisConnected(); + void onConnected(); void readData(const QByteArray&); void onMenuAction_relay(); void OnButtonGroup(QAbstractButton *); diff --git a/radial_vibration.cpp b/radial_vibration.cpp deleted file mode 100644 index 28eabc7..0000000 --- a/radial_vibration.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "Radial_vibration.h" -#include "ui_Radial_vibration.h" - -Radial_vibration::Radial_vibration(QWidget *parent) : - QWidget(parent), - ui(new Ui::Radial_vibration) -{ - ui->setupUi(this); -} - -Radial_vibration::~Radial_vibration() -{ - delete ui; -} diff --git a/radial_vibration.h b/radial_vibration.h deleted file mode 100644 index 37cbadd..0000000 --- a/radial_vibration.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef Radial_vibration_H -#define Radial_vibration_H - -#include - -namespace Ui { -class Radial_vibration; -} - -class Radial_vibration : public QWidget -{ - Q_OBJECT - -public: - explicit Radial_vibration(QWidget *parent = nullptr); - ~Radial_vibration(); - -private: - Ui::Radial_vibration *ui; -}; - -#endif // Radial_vibration_H diff --git a/radial_vibration.ui b/radial_vibration.ui deleted file mode 100644 index ae36ed0..0000000 --- a/radial_vibration.ui +++ /dev/null @@ -1,1192 +0,0 @@ - - - Radial_vibration - - - - 0 - 0 - 669 - 570 - - - - 位移配置 - - - - - 10 - 60 - 631 - 451 - - - - 0 - - - - 传感器和滤波配置 - - - - - 10 - 180 - 241 - 131 - - - - 传感器方向 - - - - - 40 - 50 - 61 - 22 - - - - - - - 130 - 50 - 89 - 16 - - - - - - - - - - 130 - 70 - 89 - 16 - - - - - - - - - - 40 - 30 - 54 - 12 - - - - 角度 - - - - - - - 10 - 30 - 349 - 116 - - - - 滤波 - - - - - - - - - - - - - - - 高通: - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - 3 - - - 3000 - - - - - - - - - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - 3 - - - 3000 - - - 3000 - - - - - - - 3 - 3000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - 低通: - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - - - - - - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - - - - 30 - 30000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - 带通: - - - - - - - - 60 - 0 - - - - 3 - - - 3000 - - - - - - - - - - - - - - - - 60 - 0 - - - - 3 - - - 3000 - - - 3000 - - - - - - - 3 - 3000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 特征值和警报配置 - - - - - 20 - 10 - 411 - 411 - - - - 特征值 - - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 20 - 80 - 81 - 16 - - - - 间隙 - - - - - - 20 - 110 - 81 - 16 - - - - 1倍频幅值 - - - - - - 20 - 180 - 81 - 16 - - - - 2倍频幅值 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 260 - 31 - 61 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 260 - 50 - 62 - 22 - - - - - - - 260 - 80 - 62 - 22 - - - - - - - 130 - 110 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 260 - 110 - 62 - 22 - - - - - - - 20 - 150 - 91 - 16 - - - - 1倍频相位 - - - - - - 20 - 210 - 91 - 16 - - - - 2倍频相位 - - - - - - 260 - 150 - 62 - 22 - - - - 0 - - - 100.000000000000000 - - - - - - 260 - 180 - 62 - 22 - - - - - - - 260 - 210 - 62 - 22 - - - - 0 - - - 100.000000000000000 - - - - - - 130 - 180 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 130 - 80 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 20 - 240 - 91 - 16 - - - - 非1倍频幅值 - - - - - - 130 - 240 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 260 - 240 - 62 - 22 - - - - - - - 130 - 270 - 111 - 22 - - - - - 0 - 500 um - - - - - - - 20 - 270 - 91 - 16 - - - - Smax 幅值 - - - - - - 260 - 270 - 62 - 22 - - - - - - - 10 - 300 - 221 - 101 - - - - 延时 - - - - - 20 - 20 - 54 - 12 - - - - 告警 - - - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 62 - 16 - - - - 1 - - - 1.000000000000000 - - - 99.900000000000006 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 16 - - - - 1 - - - - - - - - 470 - 20 - 131 - 16 - - - - 告警锁定 - - - - - - 470 - 40 - 131 - 16 - - - - 危险锁定 - - - - - - 460 - 220 - 121 - 16 - - - - 倍增 - - - - - - 460 - 240 - 62 - 16 - - - - 1.000000000000000 - - - - - - 460 - 260 - 141 - 16 - - - - 1.00 - 3.00 (步进0.25) - - - - - - 460 - 130 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 150 - 141 - 22 - - - - - None - - - - - 直接值 - - - - - 间隙 - - - - - 1倍频幅值 - - - - - 1倍频相位 - - - - - 2倍频幅值 - - - - - 2倍频相位 - - - - - 非1倍频幅值 - - - - - Smax幅值 - - - - - - - 460 - 180 - 91 - 16 - - - - 2 mA 默认值 - - - true - - - - - - 460 - 290 - 121 - 16 - - - - 比较 - - - - - - 530 - 360 - 54 - 12 - - - - % - - - - - - 460 - 310 - 141 - 22 - - - - - None - - - - - 直接值 - - - - - 间隙 - - - - - 1倍频幅值 - - - - - 1倍频相位 - - - - - 2倍频幅值 - - - - - 2倍频相位 - - - - - 非1倍频幅值 - - - - - Smax幅值 - - - - - - - 460 - 350 - 61 - 22 - - - - - - - - - 10 - 520 - 651 - 37 - - - - - - - - 100 - 35 - - - - 确定 - - - - - - - - 100 - 35 - - - - 设置为默认值 - - - - - - - - 100 - 35 - - - - 测点名称 - - - - - - - - 100 - 35 - - - - 取消 - - - - - - - - 100 - 35 - - - - 打印 - - - - - - - - 100 - 35 - - - - 帮助 - - - - - - - - - 21 - 10 - 105 - 17 - - - - - - - 通道: - - - - - - - 3 - - - - - - - (启用) - - - - - - - - - 341 - 10 - 63 - 17 - - - - - - - 槽位号: - - - - - - - 2 - - - - - - - - - diff --git a/seismic_monitor.cpp b/seismic_monitor.cpp index 290c88e..b571bb9 100644 --- a/seismic_monitor.cpp +++ b/seismic_monitor.cpp @@ -21,7 +21,7 @@ Seismic_monitor::Seismic_monitor(int slot,QWidget *parent) : QString slot_no_ = QString("%1").arg(slot_no); ui->label_slot_no->setText(slot_no_); - QString filePath = QCoreApplication::applicationDirPath() + QString("\\config\\seismic_monitor_slot_%1.json").arg(slot_no); + QString filePath = QCoreApplication::applicationDirPath() + QString("\\config\\%1\\seismic_monitor_slot.json").arg(slot_no); readJsonFile(filePath); Init(); } @@ -228,17 +228,16 @@ void Seismic_monitor::on_pushButton_config_1_clicked() acceleration->show(); }else if(seismic_monitor[i].channel_type == "proximeter"){ channel = 1; - Radial_vibration *radial_vibration = new Radial_vibration(); + Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,seismic_monitor[i].active); radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->show(); }else if(seismic_monitor[i].channel_type == "velocity"){ channel = 1; - Velocity *velocity = new Velocity(); + Velocity *velocity = new Velocity(slot_no,channel,seismic_monitor[i].active); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); } } - } } @@ -254,12 +253,12 @@ void Seismic_monitor::on_pushButton_config_3_clicked() acceleration->show(); }else if(seismic_monitor[i].channel_type == "proximeter"){ channel = 3; - Radial_vibration *radial_vibration = new Radial_vibration(); + Radial_vibration *radial_vibration = new Radial_vibration(slot_no,channel,seismic_monitor[i].active); radial_vibration->setWindowModality(Qt::ApplicationModal); radial_vibration->show(); }else if(seismic_monitor[i].channel_type == "velocity"){ channel = 3; - Velocity *velocity = new Velocity(); + Velocity *velocity = new Velocity(slot_no,channel,seismic_monitor[i].active); velocity->setWindowModality(Qt::ApplicationModal); velocity->show(); } diff --git a/velocity.cpp b/velocity.cpp deleted file mode 100644 index 545015c..0000000 --- a/velocity.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "Velocity.h" -#include "ui_Velocity.h" - -Velocity::Velocity(QWidget *parent) : - QWidget(parent), - ui(new Ui::Velocity) -{ - ui->setupUi(this); -} - -Velocity::~Velocity() -{ - delete ui; -} diff --git a/velocity.h b/velocity.h deleted file mode 100644 index 3f41ded..0000000 --- a/velocity.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef velocity_H -#define velocity_H - -#include - -namespace Ui { -class Velocity; -} - -class Velocity : public QWidget -{ - Q_OBJECT - -public: - explicit Velocity(QWidget *parent = nullptr); - ~Velocity(); - -private: - Ui::Velocity *ui; -}; - -#endif // velocity_H diff --git a/velocity.ui b/velocity.ui deleted file mode 100644 index 4cf83f3..0000000 --- a/velocity.ui +++ /dev/null @@ -1,1097 +0,0 @@ - - - Velocity - - - - 0 - 0 - 754 - 582 - - - - 速度配置 - - - - - 10 - 530 - 738 - 37 - - - - - - - - 100 - 35 - - - - 确定 - - - - - - - - 100 - 35 - - - - 设置为默认值 - - - - - - - - 100 - 35 - - - - 加载预定义模板 - - - - - - - - 100 - 35 - - - - 测点名称 - - - - - - - - 100 - 35 - - - - 取消 - - - - - - - - 100 - 35 - - - - 打印 - - - - - - - - 100 - 35 - - - - 帮助 - - - - - - - - - 10 - 90 - 621 - 401 - - - - 0 - - - - 滤波配置 - - - - - 10 - 10 - 349 - 116 - - - - 滤波 - - - - - - - - - - - - - - - 高通: - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - 3 - - - 3000 - - - - - - - - - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - 3 - - - 3000 - - - 3000 - - - - - - - 3 - 3000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - 低通: - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - - - - - - - - - - - - - 60 - 0 - - - - - 60 - 16777215 - - - - - - - - 30 - 30000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - - - 带通: - - - - - - - - 60 - 0 - - - - 3 - - - 3000 - - - - - - - - - - - - - - - - 60 - 0 - - - - 3 - - - 3000 - - - 3000 - - - - - - - 3 - 3000Hz - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - 特征值和警报配置 - - - - - 10 - 10 - 431 - 351 - - - - 特征值 - - - - - 20 - 50 - 54 - 12 - - - - 直接值 - - - - - - 10 - 80 - 81 - 16 - - - - 偏置电压 - - - - - - 20 - 110 - 71 - 16 - - - - 1倍频幅值 - - - - - - 20 - 180 - 71 - 16 - - - - 2倍频幅值 - - - - - - 141 - 31 - 48 - 16 - - - - 取值范围 - - - - - - 269 - 31 - 48 - 16 - - - - 默认值 - - - - - - 130 - 50 - 111 - 22 - - - - - 0 - 20 mm/s - - - - - - - 260 - 50 - 62 - 22 - - - - - - - 130 - 80 - 54 - 12 - - - - -24Vdc - - - - - - 260 - 80 - 62 - 22 - - - - 1 - - - - - - 130 - 110 - 111 - 22 - - - - - 0 - 20 mm/s - - - - - - - 260 - 110 - 62 - 22 - - - - - - - 20 - 150 - 91 - 16 - - - - 1倍频相位 - - - - - - 20 - 210 - 91 - 16 - - - - 2倍频相位 - - - - - - 260 - 150 - 62 - 22 - - - - 0 - - - - - - 260 - 180 - 62 - 22 - - - - - - - 260 - 210 - 62 - 22 - - - - 0 - - - - - - 130 - 180 - 111 - 22 - - - - - 0 - 20 mm/s - - - - - - - 20 - 250 - 71 - 16 - - - - 有效值 - - - - - - 130 - 250 - 71 - 16 - - - - 积分 - - - - - - 200 - 240 - 221 - 101 - - - - 延时 - - - - - 20 - 20 - 54 - 12 - - - - 告警 - - - - - - 20 - 50 - 54 - 12 - - - - 危险 - - - - - - 60 - 50 - 62 - 16 - - - - 1 - - - 1.000000000000000 - - - - - - 60 - 80 - 71 - 16 - - - - 100 ms - - - - - - 130 - 20 - 54 - 12 - - - - 1 - 60s - - - - - - 130 - 50 - 71 - 16 - - - - 1.0 - 60.0s - - - - - - 60 - 20 - 61 - 16 - - - - 1 - - - - - - - - 460 - 20 - 131 - 16 - - - - 告警锁定 - - - true - - - - - - 460 - 40 - 131 - 16 - - - - 危险锁定 - - - true - - - - - - 460 - 190 - 121 - 16 - - - - 倍增 - - - - - - 460 - 210 - 62 - 16 - - - - 1.000000000000000 - - - - - - 460 - 230 - 141 - 16 - - - - 1.00 - 3.00 (步进0.25) - - - - - - 460 - 110 - 54 - 12 - - - - 记录输出 - - - - - - 460 - 130 - 141 - 22 - - - - - None - - - - - 直接值 - - - - - 偏置电压 - - - - - 1倍频幅值 - - - - - 1倍频相位 - - - - - 2倍频幅值 - - - - - 2倍频相位 - - - - - - - 460 - 160 - 101 - 16 - - - - 2 mA 默认值 - - - true - - - - - - 460 - 80 - 141 - 16 - - - - Timed OK channel Defeat - - - - - - 460 - 60 - 131 - 16 - - - - 非正常锁定 - - - - - - 460 - 260 - 121 - 16 - - - - 比较 - - - - - - 460 - 280 - 141 - 22 - - - - - None - - - - - 直接值 - - - - - 偏置电压 - - - - - 1倍频幅值 - - - - - 1倍频相位 - - - - - 2倍频幅值 - - - - - 2倍频相位 - - - - - - - 460 - 320 - 61 - 22 - - - - - - - 530 - 330 - 54 - 12 - - - - % - - - - - - - - 21 - 10 - 105 - 17 - - - - - - - 通道: - - - - - - - 3 - - - - - - - (启用) - - - - - - - - - 341 - 10 - 63 - 17 - - - - - - - 槽位号: - - - - - - - 2 - - - - - - - - -