|
musredit 1.0.0
|
Dialog for executing and displaying dump_header command output. More...
#include <PDumpOutputHandler.h>


Public Member Functions | |
| PDumpOutputHandler (QVector< QString > &cmd) | |
| Constructs the dump output handler dialog and starts the command. | |
| virtual | ~PDumpOutputHandler () |
| Destructor - ensures the dump_header process is terminated. | |
Private Slots | |
| virtual void | readFromStdOut () |
| Slot to read and display standard output from the process. | |
| virtual void | readFromStdErr () |
| Slot to read and display standard error from the process. | |
| virtual void | quitButtonPressed () |
| Slot called when the Quit button is pressed. | |
Private Attributes | |
Process Management | |
Members for managing the external process. | |
| qint64 | fProcPID |
| Process ID of the running dump_header command. | |
| std::unique_ptr< QProcess > | fProc |
| QProcess object managing the dump_header execution. | |
UI Components | |
Dialog user interface elements. | |
| std::unique_ptr< QVBoxLayout > | fVbox |
| Vertical layout manager for dialog widgets. | |
| std::unique_ptr< QTextEdit > | fOutput |
| Read-only text widget displaying command output. | |
| std::unique_ptr< QPushButton > | fQuitButton |
| Button to close dialog and terminate process. | |
Dialog for executing and displaying dump_header command output.
This class provides a modal dialog that executes the dump_header external command and displays its output in real-time. The dump_header tool is part of the musrfit suite and extracts header information from muon spin rotation/relaxation data files.
Definition at line 92 of file PDumpOutputHandler.h.
| PDumpOutputHandler::PDumpOutputHandler | ( | QVector< QString > & | cmd | ) |
Constructs the dump output handler dialog and starts the command.
Initializes the dialog UI and starts the dump_header process. The constructor performs the following steps:
| cmd | Command vector where cmd[0] is the executable path and subsequent elements are command-line arguments. |
Definition at line 71 of file PDumpOutputHandler.cpp.
|
virtual |
Destructor - ensures the dump_header process is terminated.
Performs cleanup by ensuring the child process is properly terminated. The termination sequence is:
This multi-stage approach ensures the process doesn't become orphaned, even if it doesn't respond to normal termination signals.
Definition at line 136 of file PDumpOutputHandler.cpp.
|
privatevirtualslot |
Slot called when the Quit button is pressed.
Handles user request to close the dialog. If the dump_header process is still running, attempts to terminate it gracefully using QProcess::terminate(). If graceful termination fails within the timeout period, forcefully kills the process using QProcess::kill().
After ensuring the process is stopped, accepts the dialog (closes it with QDialog::Accepted result).
Definition at line 201 of file PDumpOutputHandler.cpp.
|
privatevirtualslot |
Slot to read and display standard error from the process.
Slot to capture and display standard error from the process.
Reads all available data from the process's standard error stream and appends it to the text display widget. This slot is connected to the QProcess::readyReadStandardError signal and may be called multiple times as error output arrives in chunks.
Error output is displayed alongside normal output in the same text widget, allowing users to see errors in context with regular output.
Definition at line 182 of file PDumpOutputHandler.cpp.
|
privatevirtualslot |
Slot to read and display standard output from the process.
Slot to capture and display standard output from the process.
Reads all available data from the process's standard output stream and appends it to the text display widget. This slot is connected to the QProcess::readyReadStandardOutput signal and may be called multiple times as output arrives in chunks.
Definition at line 163 of file PDumpOutputHandler.cpp.
|
private |
Read-only text widget displaying command output.
Definition at line 130 of file PDumpOutputHandler.h.
|
private |
QProcess object managing the dump_header execution.
Definition at line 122 of file PDumpOutputHandler.h.
|
private |
Process ID of the running dump_header command.
Definition at line 121 of file PDumpOutputHandler.h.
|
private |
Button to close dialog and terminate process.
Definition at line 131 of file PDumpOutputHandler.h.
|
private |
Vertical layout manager for dialog widgets.
Definition at line 129 of file PDumpOutputHandler.h.