BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SimulationOptionsItem.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Models/SimulationOptionsItem.h
6 //! @brief Defines class SimulationOptionsItem
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_MODELS_SIMULATIONOPTIONSITEM_H
16 #define BORNAGAIN_GUI_COREGUI_MODELS_SIMULATIONOPTIONSITEM_H
17 
19 #include <QMap>
20 
21 //! The SimulationOptionsItem class holds simulation status (run policy, number of threads,
22 //! integration flag). Used in SimulationView to define job settings. When job is started,
23 //! item is copied to the job as a child.
24 
25 class BA_CORE_API_ SimulationOptionsItem : public SessionItem {
26 public:
27  static const QString P_RUN_POLICY;
28  static const QString P_NTHREADS;
29  static const QString P_COMPUTATION_METHOD;
30  static const QString P_MC_POINTS;
31  static const QString P_FRESNEL_MATERIAL_METHOD;
32  static const QString P_INCLUDE_SPECULAR_PEAK;
33 
34  explicit SimulationOptionsItem();
35 
36  int getNumberOfThreads() const;
37  bool runImmediately() const;
38  bool runInBackground() const;
39 
40  void setRunPolicy(const QString& policy);
41 
42  void setComputationMethod(const QString& name);
43  QString getComputationMethod() const;
44 
45  int getNumberOfMonteCarloPoints() const;
46  void setNumberOfMonteCarloPoints(int npoints);
47 
48  void setFresnelMaterialMethod(const QString& name);
49  QString getFresnelMaterialMethod() const;
50 
51  void setIncludeSpecularPeak(const QString& name);
52  QString getIncludeSpecularPeak() const;
53 
54 private:
55  QString runPolicy() const;
56  QStringList getCPUUsageOptions();
57  QStringList getRunPolicyNames();
58  void updateComboItem(QString name, QStringList option_names);
59  QMap<QString, int> m_text_to_nthreads;
60 };
61 
62 #endif // BORNAGAIN_GUI_COREGUI_MODELS_SIMULATIONOPTIONSITEM_H
Defines class SessionItem.
The SimulationOptionsItem class holds simulation status (run policy, number of threads,...
QMap< QString, int > m_text_to_nthreads
static const QString P_RUN_POLICY
static const QString P_MC_POINTS
static const QString P_INCLUDE_SPECULAR_PEAK
static const QString P_NTHREADS
static const QString P_COMPUTATION_METHOD
static const QString P_FRESNEL_MATERIAL_METHOD
QString const & name(EShape k)
Definition: particles.cpp:21