2025-04-11T13:51:47
This commit is contained in:
parent
2c303d86a9
commit
db60cd0e17
@ -18,6 +18,8 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
,_analysisSettingWidget(new AnalysisSettingForm(this))
|
||||
,_contextMenu(new QMenu(this))
|
||||
,_specificHeatComparisonMethodForm(new SpecificHeatComparisonMethodForm(this))
|
||||
,_instrumentCoefficientForm(new InstrumentCoefficientForm(this))
|
||||
,_degreeOfCureForm(new DegreeOfCureForm(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
this->setToolTip(".....");
|
||||
@ -36,10 +38,16 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
ui->statusbar->addPermanentWidget(permenentLabel);
|
||||
//
|
||||
//
|
||||
_expertmentSettingForm->setWindowFlags(_expertmentSettingForm->windowFlags()| Qt::Dialog);
|
||||
_specificHeatComparisonMethodForm->setWindowFlags(_specificHeatComparisonMethodForm->windowFlags()| Qt::Dialog);
|
||||
_expertmentSettingForm->setWindowFlags(_expertmentSettingForm->windowFlags()|
|
||||
Qt::Dialog);
|
||||
_specificHeatComparisonMethodForm->setWindowFlags(
|
||||
_specificHeatComparisonMethodForm->windowFlags()| Qt::Dialog);
|
||||
|
||||
_realTimeDataForm->setWindowFlags(_realTimeDataForm->windowFlags()| Qt::Dialog);
|
||||
_realTimeDataForm->setWindowFlags(_realTimeDataForm->windowFlags()|
|
||||
Qt::Dialog);
|
||||
|
||||
_degreeOfCureForm->setWindowFlags(_degreeOfCureForm->windowFlags()|
|
||||
Qt::Dialog);
|
||||
|
||||
// _realTimeDataForm->show();
|
||||
setActionEnable(true);
|
||||
@ -223,7 +231,7 @@ void MainWindow::on_actionGlassTransition_triggered()
|
||||
|
||||
void MainWindow::on_actionOIT_triggered()
|
||||
{
|
||||
|
||||
QMessageBox::warning(this, "warnning", "on_actionOIT_triggered.");
|
||||
}
|
||||
|
||||
void MainWindow::on_actionSpecificHeatCompMethod_triggered()
|
||||
@ -233,32 +241,29 @@ void MainWindow::on_actionSpecificHeatCompMethod_triggered()
|
||||
|
||||
void MainWindow::on_actionDegreeOfCrystallinity_triggered()
|
||||
{
|
||||
|
||||
QMessageBox::warning(this, "warnning", "结晶度.");
|
||||
}
|
||||
|
||||
void MainWindow::on_actionInstrumentParameter_triggered()
|
||||
{
|
||||
|
||||
_instrumentCoefficientForm->show();
|
||||
}
|
||||
|
||||
void MainWindow::on_actionInitialMeltingPoint_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionFinalMeltingPoint_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOITAutoAnalysisParam_triggered()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_actionOITAutoAnalysisMode_triggered()
|
||||
{
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
void MainWindow::on_actionTimeAxisAnalysisPCTMode_triggered()
|
||||
@ -268,5 +273,6 @@ void MainWindow::on_actionTimeAxisAnalysisPCTMode_triggered()
|
||||
|
||||
void MainWindow::on_actionDegreeOfCuring_triggered()
|
||||
{
|
||||
|
||||
//
|
||||
_degreeOfCureForm->show();
|
||||
}
|
||||
|
@ -13,6 +13,9 @@
|
||||
#include "rightwidget.h"
|
||||
#include "analysissettingform.h"
|
||||
#include "specificheatcomparisonmethodform.h"
|
||||
#include "degreeofcrystallinityform.h"
|
||||
#include "instrumentcoefficientform.h"
|
||||
#include "degreeofcureform.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
@ -79,5 +82,8 @@ private:
|
||||
QMenu* _contextMenu;
|
||||
AnalysisSettingForm* _analysisSettingWidget;
|
||||
SpecificHeatComparisonMethodForm* _specificHeatComparisonMethodForm;
|
||||
DegreeOfCrystallinityForm * _degreeOfCrystallinityForm;
|
||||
InstrumentCoefficientForm* _instrumentCoefficientForm;
|
||||
DegreeOfCureForm *_degreeOfCureForm;
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
@ -45,15 +45,12 @@ CentralWidget::CentralWidget(QWidget *parent)
|
||||
_eventHandler->setEnable(true);
|
||||
|
||||
_customPlot->installEventFilter(_eventHandler);
|
||||
_customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
|
||||
// _customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom | QCP::iSelectPlottables);
|
||||
_customPlot->setInteractions( QCP::iRangeZoom | QCP::iSelectPlottables);
|
||||
|
||||
connect(_eventHandler,&EventHandler::sigSendLineXCoord,
|
||||
this,&CentralWidget::sigSendLineXCoord);
|
||||
|
||||
// connect(_customPlot, &QCustomPlot::selectionChangedByUser,
|
||||
// this, &CentralWidget::slotSelectionChanged);
|
||||
|
||||
|
||||
setEventHandlerEnable(false);
|
||||
//
|
||||
#if 0
|
||||
@ -143,9 +140,8 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName)
|
||||
{
|
||||
qDebug() << "slotRecvAnalysisFileName" << fileName;
|
||||
|
||||
//
|
||||
// clearData(ClearDataMode::All);
|
||||
//
|
||||
// todo.禁止重复文件添加。
|
||||
|
||||
_dataVtr.clear();
|
||||
FileManager::readExperimentFile(fileName, _dataVtr);
|
||||
|
||||
@ -208,6 +204,7 @@ void CentralWidget::slotRecvAnalysisFileName(const QString &fileName)
|
||||
_customPlot->replot();
|
||||
}
|
||||
|
||||
// discard
|
||||
void CentralWidget::slotSelectionChanged()
|
||||
{
|
||||
logde<<"selectedPlottables:"<< _customPlot->selectedPlottables().size();
|
||||
@ -598,12 +595,16 @@ void CentralWidget::clearData(const CentralWidget::ClearDataMode mode)
|
||||
{
|
||||
if(mode == ClearDataMode::All){
|
||||
// Clear the data of graph.
|
||||
#if 0
|
||||
if (_customPlot->graphCount() > 0 && _currentGraph)
|
||||
{
|
||||
_currentGraph->setData(QVector<double>(), QVector<double>());
|
||||
|
||||
for (int i = _customPlot->plottableCount() - 1; i >= 0; --i) {
|
||||
QCPAbstractPlottable* plottable = _customPlot->plottable(i);
|
||||
if (auto curve = dynamic_cast<QCPCurve*>(plottable)) {
|
||||
_customPlot->removePlottable(curve);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Clear data.
|
||||
Global::instance()->_curveDataVtr.clear();
|
||||
|
||||
// Set lines visiable false.
|
||||
_line1->setVisible(false);
|
||||
@ -624,6 +625,7 @@ void CentralWidget::clearData(const CentralWidget::ClearDataMode mode)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Delete items.
|
||||
QList<QCPAbstractItem *> itemsToKeep;
|
||||
itemsToKeep << _line1 << _line2;
|
||||
|
@ -12,3 +12,13 @@ DegreeOfCrystallinityForm::~DegreeOfCrystallinityForm()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void DegreeOfCrystallinityForm::on_pushButtonCalculate_clicked()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void DegreeOfCrystallinityForm::on_pushButtonQuit_clicked()
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,11 @@ public:
|
||||
explicit DegreeOfCrystallinityForm(QWidget *parent = nullptr);
|
||||
~DegreeOfCrystallinityForm();
|
||||
|
||||
private slots:
|
||||
void on_pushButtonCalculate_clicked();
|
||||
|
||||
void on_pushButtonQuit_clicked();
|
||||
|
||||
private:
|
||||
Ui::DegreeOfCrystallinityForm *ui;
|
||||
};
|
||||
|
@ -76,7 +76,7 @@ bool EventHandler::eventFilter(QObject *obj, QEvent *event)
|
||||
_draggingLine->point1->setCoords(x, _plot->yAxis->range().lower);
|
||||
_draggingLine->point2->setCoords(x, _plot->yAxis->range().upper);
|
||||
_plot->replot();
|
||||
updateSelectedRegion();
|
||||
// updateSelectedRegion();
|
||||
}
|
||||
}
|
||||
else if (event->type() == QEvent::MouseButtonPress)
|
||||
@ -226,6 +226,7 @@ void EventHandler::slotSample()
|
||||
|
||||
void EventHandler::updateSelectedRegion()
|
||||
{
|
||||
#if 0
|
||||
double x1 = _line1->point1->coords().x();
|
||||
double x2 = _line1->point1->coords().x();
|
||||
if (x1 > x2)
|
||||
@ -246,6 +247,7 @@ void EventHandler::updateSelectedRegion()
|
||||
int index2 = findClosestIndex(xData, x2);
|
||||
|
||||
// qDebug() << "Selected region: [" << xData[index1] << ", " << xData[index2] << "]";
|
||||
#endif
|
||||
}
|
||||
|
||||
int EventHandler::findClosestIndex(const QVector<double> &data, double target)
|
||||
|
@ -23,7 +23,7 @@ public:
|
||||
#endif
|
||||
~EventHandler();
|
||||
|
||||
void setGraph(QCPGraph* g){ _graph = g;}
|
||||
// void setGraph(QCPGraph* g){ _graph = g;}
|
||||
void setEnable(const bool flag){_enableFlag = flag;}
|
||||
enum Mode{
|
||||
Null,
|
||||
@ -52,7 +52,7 @@ private:
|
||||
QCustomPlot *_plot;
|
||||
QCPItemStraightLine *_line1,*_line2;
|
||||
QCPItemStraightLine *_draggingLine = nullptr;
|
||||
QCPGraph *_graph;
|
||||
// QCPGraph *_graph;
|
||||
QMenu* _menu;
|
||||
QAction* _specificHeatItemAction,*_baseLineAction,
|
||||
*_standardSampleAction,*_sampleAction;
|
||||
|
@ -126,7 +126,14 @@ void SpecificHeatComparisonMethodForm::on_pushButtonCalculate_clicked()
|
||||
float standardSampleWeight = ui->LineEditStandardSampleWeight->text().toFloat();
|
||||
float sampleWeight = ui->LineEditSampleWeight->text().toFloat();
|
||||
|
||||
// double cpTarget = cp *
|
||||
float k = ui->LineEditCorrectionCoefficient->text().toFloat();
|
||||
|
||||
// 蓝宝石比热容 * 标样质量 * (样品流值 - 基线流值)* 系数 /(样品质量 * (标样流值 - 基线流值))
|
||||
double cpTarget = cp * standardSampleWeight * ( samplePoint.y() - baseLinePoint.y()) * k /
|
||||
(sampleWeight *(standardSamplePoint.y() - baseLinePoint.y()));
|
||||
|
||||
ui->LineEditStandardSampleSpecificHeat->setText(QString::number(cp,'f',3));
|
||||
ui->LineEditSampleSpecificHeat->setText(QString::number(cpTarget,'f',3));
|
||||
}
|
||||
|
||||
void SpecificHeatComparisonMethodForm::on_pushButtonQuit_clicked()
|
||||
|
Loading…
Reference in New Issue
Block a user