21 QStringList getRunPolicyTooltips()
24 result.append(
"Start simulation immediately, switch to Jobs view automatically when completed");
25 result.append(
"Start simulation immediately, do not switch to Jobs view when completed");
29 const QString tooltip_runpolicy =
"Defines run policy for the simulation";
30 const QString tooltip_nthreads =
"Defines number of threads to use for the simulation.";
31 const QString tooltip_computation =
32 "Defines computation method (analytical or Monte-Carlo integration)";
33 const QString tooltip_ambientmaterial =
34 "Define if the material used for Fresnel calculations should be the ambient layer "
35 "material or the average material of the layer and the particles it contains";
36 const QString tooltip_specularpeak =
37 "Defines if the specular peak should be included in the simulation result";
46 "Material for Fresnel calculations";
62 computationMethod <<
"Analytical"
63 <<
"Monte-Carlo Integration";
69 averageLayerMaterials <<
"Ambient Layer Material"
70 <<
"Average Layer Material";
75 includeSpecularPeak <<
"No"
84 if (combo.
getValue() ==
"Analytical") {
181 int nthreads =
static_cast<int>(std::thread::hardware_concurrency());
182 for (
int i = nthreads; i > 0; i--) {
185 str = QString(
"Max (%1 threads)").arg(QString::number(i));
187 str = QString(
"%1 thread").arg(QString::number(i));
189 str = QString(
"%1 threads").arg(QString::number(i));
200 result <<
"Immediately"
208 if (combo.
getValues().size() != option_names.size()) {
210 auto selected_value = combo.
getValue();
212 new_combo << option_names;
213 if (new_combo.
getValues().contains(selected_value))
215 p_item->setValue(new_combo.
variant());
Defines class ComboProperty.
Defines class SimulationOptionsItem.
Custom property to define list of string values with multiple selections.
QStringList getValues() const
QVariant variant() const
Constructs variant enclosing given ComboProperty.
void setValue(const QString &name)
void setToolTips(const QStringList &tooltips)
void setOnPropertyChange(std::function< void(QString)> f, const void *caller=0)
bool isTag(const QString &name) const
Returns true if tag is available.
SessionItem * addProperty(const QString &name, const QVariant &variant)
Add new property item and register new tag.
QVariant getItemValue(const QString &tag) const
Directly access value of item under given tag.
ModelMapper * mapper()
Returns the current model mapper of this item. Creates new one if necessary.
void setItemValue(const QString &tag, const QVariant &variant)
Directly set value of item under given tag.
SessionItem & setToolTip(const QString &tooltip)
void setEnabled(bool enabled)
SessionItem * getItem(const QString &tag="", int row=0) const
Returns item in given row of given tag.
QString getIncludeSpecularPeak() const
int getNumberOfThreads() const
bool runImmediately() const
QMap< QString, int > m_text_to_nthreads
void setFresnelMaterialMethod(const QString &name)
QStringList getCPUUsageOptions()
returns list with number of threads to select
int getNumberOfMonteCarloPoints() const
void setIncludeSpecularPeak(const QString &name)
static const QString P_RUN_POLICY
static const QString P_MC_POINTS
void setNumberOfMonteCarloPoints(int npoints)
void setComputationMethod(const QString &name)
void setRunPolicy(const QString &policy)
static const QString P_INCLUDE_SPECULAR_PEAK
void updateComboItem(QString name, QStringList option_names)
QString getFresnelMaterialMethod() const
QString runPolicy() const
static const QString P_NTHREADS
QString getComputationMethod() const
static const QString P_COMPUTATION_METHOD
static const QString P_FRESNEL_MATERIAL_METHOD
bool runInBackground() const
QStringList getRunPolicyNames()
QString const & name(EShape k)