BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Handles all thread activity for running job simulation in the background. More...
Public Slots | |
void | onInterruptRequest () |
Processes interrupt request by setting corresponding flag. More... | |
void | requestSimulation (const multislice_t &multislice, const std::vector< double > &qvalues, double intensity) |
Performs simulation request. More... | |
Signals | |
void | progressChanged (int value) |
void | simulationCompleted () |
Public Member Functions | |
JobManager (QObject *parent=nullptr) | |
~JobManager () override | |
SimulationResult | simulationResult () |
Returns vector representing results of a simulation. More... | |
Private Member Functions | |
void | wait_and_run () |
Performs concequent simulations for given simulation parameter. More... | |
Private Attributes | |
bool | m_interruptRequest {false} |
std::atomic< bool > | m_isRunning |
ModelView::threadsafe_stack< SimulationInput > | m_requestedInputValues |
std::thread | m_simThread |
ModelView::threadsafe_stack< SimulationResult > | m_simulationResult |
Handles all thread activity for running job simulation in the background.
Definition at line 27 of file jobmanager.h.
gui2::JobManager::JobManager | ( | QObject * | parent = nullptr | ) |
Definition at line 20 of file jobmanager.cpp.
References m_simThread, and wait_and_run().
|
override |
Definition at line 26 of file jobmanager.cpp.
References m_isRunning, m_requestedInputValues, and m_simThread.
|
slot |
Processes interrupt request by setting corresponding flag.
Definition at line 59 of file jobmanager.cpp.
References m_interruptRequest.
Referenced by gui2::QuickSimController::onInterruptRequest().
|
signal |
Referenced by gui2::QuickSimController::setup_jobmanager_connections(), and wait_and_run().
|
slot |
Performs simulation request.
Given multislice will be stored in a stack of values to trigger a waiting thread.
Definition at line 45 of file jobmanager.cpp.
References gui2::SimulationInput::intensity, m_requestedInputValues, gui2::SimulationInput::qvalues, and gui2::SimulationInput::slice_data.
Referenced by gui2::QuickSimController::submit_specular_simulation().
|
signal |
Referenced by gui2::QuickSimController::setup_jobmanager_connections(), and wait_and_run().
SimulationResult gui2::JobManager::simulationResult | ( | ) |
Returns vector representing results of a simulation.
Definition at line 36 of file jobmanager.cpp.
References m_simulationResult.
Referenced by gui2::QuickSimController::onSimulationCompleted().
|
private |
Performs concequent simulations for given simulation parameter.
Waits for simulation input parameter to appear in a stack, starts new simulation as soon as input data is ready. Method is intended for execution in a thread.
Definition at line 68 of file jobmanager.cpp.
References m_interruptRequest, m_isRunning, m_requestedInputValues, m_simulationResult, progressChanged(), gui2::SpecularToySimulation::runSimulation(), gui2::SpecularToySimulation::setProgressCallback(), simulationCompleted(), and gui2::SpecularToySimulation::simulationResult().
Referenced by JobManager().
|
private |
Definition at line 52 of file jobmanager.h.
Referenced by onInterruptRequest(), and wait_and_run().
|
private |
Definition at line 51 of file jobmanager.h.
Referenced by ~JobManager(), and wait_and_run().
|
private |
Definition at line 49 of file jobmanager.h.
Referenced by ~JobManager(), requestSimulation(), and wait_and_run().
|
private |
Definition at line 48 of file jobmanager.h.
Referenced by JobManager(), and ~JobManager().
|
private |
Definition at line 50 of file jobmanager.h.
Referenced by simulationResult(), and wait_and_run().