musredit 1.0.0
Loading...
Searching...
No Matches
PFitOutputHandler.h
Go to the documentation of this file.
1/****************************************************************************
2
3 PFitOutputHandler.h
4
5 Author: Andreas Suter
6 e-mail: andreas.suter@psi.ch
7
8*****************************************************************************/
9
10/***************************************************************************
11 * Copyright (C) 2010-2026 by Andreas Suter *
12 * andreas.suter@psi.ch *
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29
45
46#ifndef _PFITOUTPUTHANDLER_H_
47#define _PFITOUTPUTHANDLER_H_
48
49#include <QObject>
50#include <QProcess>
51#include <QDialog>
52#include <QVBoxLayout>
53#include <QPlainTextEdit>
54#include <QPushButton>
55#include <QMessageBox>
56#include <QVector>
57
58#include <cstdlib>
59#include <memory>
60
61//---------------------------------------------------------------------------------------
97class PFitOutputHandler : public QDialog
98{
99 Q_OBJECT
100
101 public:
102 PFitOutputHandler(QString workingDirectory, QVector<QString> &cmd);
103 virtual ~PFitOutputHandler();
104
105 private slots:
109 virtual void readFromStdOut();
110
114 virtual void readFromStdErr();
115
119 virtual void quitButtonPressed();
120
126 virtual void processDone(int exitCode, QProcess::ExitStatus exitStatus);
127
128 private:
133 qint64 fProcPID;
134 std::unique_ptr<QProcess> fProc;
136
141 std::unique_ptr<QVBoxLayout> fVbox;
142 std::unique_ptr<QPlainTextEdit> fOutput;
143 std::unique_ptr<QPushButton> fQuitButton;
145};
146
147#endif // _PFITOUTPUTHANDLER_H_
virtual ~PFitOutputHandler()
Destructor - ensures the musrfit process is terminated.
qint64 fProcPID
Process ID of the running musrfit process.
virtual void processDone(int exitCode, QProcess::ExitStatus exitStatus)
Slot called when the musrfit process finishes.
PFitOutputHandler(QString workingDirectory, QVector< QString > &cmd)
Constructs the fit output handler dialog and starts the musrfit process.
virtual void readFromStdOut()
Slot to read and display standard output from musrfit.
std::unique_ptr< QPlainTextEdit > fOutput
Read-only text widget displaying musrfit output (max 1000 lines).
std::unique_ptr< QProcess > fProc
QProcess object managing the musrfit execution.
std::unique_ptr< QVBoxLayout > fVbox
Vertical layout manager for dialog widgets.
virtual void readFromStdErr()
Slot to read and display standard error from musrfit.
std::unique_ptr< QPushButton > fQuitButton
Button showing "Fitting..." during fit, "Done" after completion.
virtual void quitButtonPressed()
Slot called when the Quit/Done button is pressed.