2025-10-28T16:11:52
This commit is contained in:
parent
97a06a34ab
commit
8e3c534710
@ -453,7 +453,7 @@ void MainWindow::startExperimentByDeviceInfo() {
|
||||
// 实验开始,清除上一个实验所有数据。
|
||||
Global::clearExperimentData();
|
||||
}
|
||||
|
||||
// 停止实验
|
||||
void MainWindow::on_actionStop_triggered() {
|
||||
logde << " Stop experiment ...++++++++++++++++++";
|
||||
|
||||
@ -544,6 +544,11 @@ void MainWindow::slotSaveExperimentalDataMsgBox() {
|
||||
QMessageBox::information(this, "文件保存", str, QMessageBox::Yes);
|
||||
}
|
||||
|
||||
// 清除数据action恢复功能
|
||||
ui->actionClearAllData->setEnabled(true);
|
||||
// 分析menu恢复功能
|
||||
ui->menu_4->menuAction()->setEnabled(true);
|
||||
|
||||
#if 0
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(this, "数据保存提示", "是否保存实验数据?",
|
||||
@ -776,6 +781,7 @@ void MainWindow::on_actionSmoothness10_triggered() {
|
||||
smoothness(10);
|
||||
}
|
||||
|
||||
// 原始数据
|
||||
void MainWindow::on_actionOriginalData_triggered() {
|
||||
if (!Global::_curveExperimentDataVtr.empty()) {
|
||||
// 删除所有objectName为experiment的curve.
|
||||
@ -787,6 +793,10 @@ void MainWindow::on_actionOriginalData_triggered() {
|
||||
}
|
||||
} else {
|
||||
// 当前数据为文件分析数据时,需要把当前文件下的所有数据都进行平滑处理。
|
||||
if(_centralWidget->getCurrentCurve() == nullptr){
|
||||
return;
|
||||
}
|
||||
|
||||
QString selectedCurveObjectName = _centralWidget->getCurrentCurve()->objectName();
|
||||
_centralWidget->deleteCurveByObjectName(selectedCurveObjectName);
|
||||
|
||||
@ -801,7 +811,6 @@ void MainWindow::on_actionOriginalData_triggered() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
// process data.
|
||||
QVector<Global::ExperimentData> targetDataVtr;
|
||||
|
||||
@ -52,6 +52,7 @@ private slots:
|
||||
void on_actionConnectToDev_triggered();
|
||||
void on_actionNew_triggered();
|
||||
void on_actionStart_triggered();
|
||||
// 停止实验
|
||||
void on_actionStop_triggered();
|
||||
void on_actionReadOnly_triggered();
|
||||
void on_actionRealTimeWidget_triggered();
|
||||
@ -115,7 +116,7 @@ private slots:
|
||||
void on_actionSmoothness8_triggered();
|
||||
void on_actionSmoothness9_triggered();
|
||||
void on_actionSmoothness10_triggered();
|
||||
|
||||
// 原始数据
|
||||
void on_actionOriginalData_triggered();
|
||||
|
||||
private:
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
#include <limits>
|
||||
#include <qcustomplot.h>
|
||||
#include <QMessageBox>
|
||||
#include <qpoint.h>
|
||||
|
||||
#include "oitautoanalysis.h"
|
||||
#include "analysisoperationrecorder.h"
|
||||
@ -611,6 +612,15 @@ void CentralWidget::slotSelectionChangedByUser() {
|
||||
_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() {
|
||||
@ -1080,6 +1090,7 @@ void CentralWidget::setEventHandlerEnable(const bool flag) {
|
||||
}
|
||||
|
||||
QPointF CentralWidget::getTheCoordinatesOfTheTextBox(const QPointF point) {
|
||||
#if 0
|
||||
double xMax = _customPlot->xAxis->range().upper;
|
||||
double xMin = _customPlot->xAxis->range().lower;
|
||||
|
||||
@ -1092,6 +1103,22 @@ QPointF CentralWidget::getTheCoordinatesOfTheTextBox(const QPointF point) {
|
||||
double distance = (xMax - xMin) / ticks.size();
|
||||
|
||||
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) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user