2025-10-28T16:11:52
This commit is contained in:
parent
97a06a34ab
commit
8e3c534710
@ -453,7 +453,7 @@ void MainWindow::startExperimentByDeviceInfo() {
|
|||||||
// 实验开始,清除上一个实验所有数据。
|
// 实验开始,清除上一个实验所有数据。
|
||||||
Global::clearExperimentData();
|
Global::clearExperimentData();
|
||||||
}
|
}
|
||||||
|
// 停止实验
|
||||||
void MainWindow::on_actionStop_triggered() {
|
void MainWindow::on_actionStop_triggered() {
|
||||||
logde << " Stop experiment ...++++++++++++++++++";
|
logde << " Stop experiment ...++++++++++++++++++";
|
||||||
|
|
||||||
@ -544,6 +544,11 @@ void MainWindow::slotSaveExperimentalDataMsgBox() {
|
|||||||
QMessageBox::information(this, "文件保存", str, QMessageBox::Yes);
|
QMessageBox::information(this, "文件保存", str, QMessageBox::Yes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 清除数据action恢复功能
|
||||||
|
ui->actionClearAllData->setEnabled(true);
|
||||||
|
// 分析menu恢复功能
|
||||||
|
ui->menu_4->menuAction()->setEnabled(true);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
QMessageBox::StandardButton reply;
|
QMessageBox::StandardButton reply;
|
||||||
reply = QMessageBox::question(this, "数据保存提示", "是否保存实验数据?",
|
reply = QMessageBox::question(this, "数据保存提示", "是否保存实验数据?",
|
||||||
@ -691,17 +696,17 @@ void MainWindow::on_actionEnthalpyCorrectionSelection_triggered() {
|
|||||||
void MainWindow::on_actionPrintPreview_triggered() {
|
void MainWindow::on_actionPrintPreview_triggered() {
|
||||||
logde << "print preview...";
|
logde << "print preview...";
|
||||||
|
|
||||||
if(Global::_curveFileDataVtr.empty()){
|
if (Global::_curveFileDataVtr.empty()) {
|
||||||
showMesgBox("请先打开数据。");
|
showMesgBox("请先打开数据。");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_printPreviewForm->setPixmap(_centralWidget->getPixMap());
|
_printPreviewForm->setPixmap(_centralWidget->getPixMap());
|
||||||
// _printPreviewForm->_customPrintPreviewDialog->showMaximized();
|
// _printPreviewForm->_customPrintPreviewDialog->showMaximized();
|
||||||
// _printPreviewForm->setOrientation();
|
// _printPreviewForm->setOrientation();
|
||||||
|
|
||||||
_printPreviewForm->_customPrintPreviewDialog->exec();
|
_printPreviewForm->_customPrintPreviewDialog->exec();
|
||||||
_printPreviewForm->_customPrintPreviewDialog->update(); // 可选,强制刷新
|
_printPreviewForm->_customPrintPreviewDialog->update(); // 可选,强制刷新
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionOnsetTemperaturePoint_triggered() {
|
void MainWindow::on_actionOnsetTemperaturePoint_triggered() {
|
||||||
@ -776,6 +781,7 @@ void MainWindow::on_actionSmoothness10_triggered() {
|
|||||||
smoothness(10);
|
smoothness(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 原始数据
|
||||||
void MainWindow::on_actionOriginalData_triggered() {
|
void MainWindow::on_actionOriginalData_triggered() {
|
||||||
if (!Global::_curveExperimentDataVtr.empty()) {
|
if (!Global::_curveExperimentDataVtr.empty()) {
|
||||||
// 删除所有objectName为experiment的curve.
|
// 删除所有objectName为experiment的curve.
|
||||||
@ -787,6 +793,10 @@ void MainWindow::on_actionOriginalData_triggered() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 当前数据为文件分析数据时,需要把当前文件下的所有数据都进行平滑处理。
|
// 当前数据为文件分析数据时,需要把当前文件下的所有数据都进行平滑处理。
|
||||||
|
if(_centralWidget->getCurrentCurve() == nullptr){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString selectedCurveObjectName = _centralWidget->getCurrentCurve()->objectName();
|
QString selectedCurveObjectName = _centralWidget->getCurrentCurve()->objectName();
|
||||||
_centralWidget->deleteCurveByObjectName(selectedCurveObjectName);
|
_centralWidget->deleteCurveByObjectName(selectedCurveObjectName);
|
||||||
|
|
||||||
@ -801,7 +811,6 @@ void MainWindow::on_actionOriginalData_triggered() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// process data.
|
// process data.
|
||||||
QVector<Global::ExperimentData> targetDataVtr;
|
QVector<Global::ExperimentData> targetDataVtr;
|
||||||
|
|||||||
@ -52,6 +52,7 @@ private slots:
|
|||||||
void on_actionConnectToDev_triggered();
|
void on_actionConnectToDev_triggered();
|
||||||
void on_actionNew_triggered();
|
void on_actionNew_triggered();
|
||||||
void on_actionStart_triggered();
|
void on_actionStart_triggered();
|
||||||
|
// 停止实验
|
||||||
void on_actionStop_triggered();
|
void on_actionStop_triggered();
|
||||||
void on_actionReadOnly_triggered();
|
void on_actionReadOnly_triggered();
|
||||||
void on_actionRealTimeWidget_triggered();
|
void on_actionRealTimeWidget_triggered();
|
||||||
@ -115,7 +116,7 @@ private slots:
|
|||||||
void on_actionSmoothness8_triggered();
|
void on_actionSmoothness8_triggered();
|
||||||
void on_actionSmoothness9_triggered();
|
void on_actionSmoothness9_triggered();
|
||||||
void on_actionSmoothness10_triggered();
|
void on_actionSmoothness10_triggered();
|
||||||
|
// 原始数据
|
||||||
void on_actionOriginalData_triggered();
|
void on_actionOriginalData_triggered();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <qcustomplot.h>
|
#include <qcustomplot.h>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <qpoint.h>
|
||||||
|
|
||||||
#include "oitautoanalysis.h"
|
#include "oitautoanalysis.h"
|
||||||
#include "analysisoperationrecorder.h"
|
#include "analysisoperationrecorder.h"
|
||||||
@ -351,7 +352,7 @@ void CentralWidget::slotRecvCommonData(const CommonData &cd) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void CentralWidget::slotRecvAnalysisFileName(const QString &filePath) {
|
void CentralWidget::slotRecvAnalysisFileName(const QString &filePath) {
|
||||||
logde<<"slotRecvAnalysisFileName, filePath:" << filePath.toStdString();
|
logde << "slotRecvAnalysisFileName, filePath:" << filePath.toStdString();
|
||||||
|
|
||||||
if (_analysisFilePathVtr.contains(filePath)) {
|
if (_analysisFilePathVtr.contains(filePath)) {
|
||||||
return;
|
return;
|
||||||
@ -370,11 +371,11 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &filePath) {
|
|||||||
for (int i = Global::_curveFileDataVtr.size() - 1; i >= 0; --i) {
|
for (int i = Global::_curveFileDataVtr.size() - 1; i >= 0; --i) {
|
||||||
if (Global::_curveFileDataVtr[i].filePath == filePath) {
|
if (Global::_curveFileDataVtr[i].filePath == filePath) {
|
||||||
// 已经存在该文件数据,直接返回
|
// 已经存在该文件数据,直接返回
|
||||||
logde<<"file exist...return.";
|
logde << "file exist...return.";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Global::_curveFileDataVtr.push_back(cfd);
|
Global::_curveFileDataVtr.push_back(cfd);
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -611,6 +612,15 @@ void CentralWidget::slotSelectionChangedByUser() {
|
|||||||
_currentCurve = curve; // 更新当前选中的曲线
|
_currentCurve = curve; // 更新当前选中的曲线
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 输出xy轴最值
|
||||||
|
auto *ax = _customPlot->xAxis;
|
||||||
|
auto *ay = _customPlot->yAxis;
|
||||||
|
double xMin = ax->range().lower;
|
||||||
|
double xMax = ax->range().upper;
|
||||||
|
double yMin = ay->range().lower;
|
||||||
|
double yMax = ay->range().upper;
|
||||||
|
|
||||||
|
logde << "min/max:" << xMin << "," << xMax << "," << yMin << "," << yMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CentralWidget::uiLoadXlsxFileData() {
|
void CentralWidget::uiLoadXlsxFileData() {
|
||||||
@ -1080,6 +1090,7 @@ void CentralWidget::setEventHandlerEnable(const bool flag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPointF CentralWidget::getTheCoordinatesOfTheTextBox(const QPointF point) {
|
QPointF CentralWidget::getTheCoordinatesOfTheTextBox(const QPointF point) {
|
||||||
|
#if 0
|
||||||
double xMax = _customPlot->xAxis->range().upper;
|
double xMax = _customPlot->xAxis->range().upper;
|
||||||
double xMin = _customPlot->xAxis->range().lower;
|
double xMin = _customPlot->xAxis->range().lower;
|
||||||
|
|
||||||
@ -1092,6 +1103,22 @@ QPointF CentralWidget::getTheCoordinatesOfTheTextBox(const QPointF point) {
|
|||||||
double distance = (xMax - xMin) / ticks.size();
|
double distance = (xMax - xMin) / ticks.size();
|
||||||
|
|
||||||
return QPointF(point.x() + distance, point.y());
|
return QPointF(point.x() + distance, point.y());
|
||||||
|
#endif
|
||||||
|
// 输出xy轴最值
|
||||||
|
auto *ax = _customPlot->xAxis;
|
||||||
|
auto *ay = _customPlot->yAxis;
|
||||||
|
double xMin = ax->range().lower;
|
||||||
|
double xMax = ax->range().upper;
|
||||||
|
double yMin = ay->range().lower;
|
||||||
|
double yMax = ay->range().upper;
|
||||||
|
|
||||||
|
logde << "min/max:" << xMin << "," << xMax << "," << yMin << "," << yMax;
|
||||||
|
|
||||||
|
double xDistance = (xMax - xMin);
|
||||||
|
double yDistance = (yMax - yMin);
|
||||||
|
|
||||||
|
return QPointF(xMin + xDistance / 5 * 4,
|
||||||
|
yMin + yDistance / 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CentralWidget::drawText(const QPointF point, const QString text, const QString objectName) {
|
void CentralWidget::drawText(const QPointF point, const QString text, const QString objectName) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user