Adding new sla material parameters: (initial) exposition min/max

This commit is contained in:
tamasmeszaros 2019-08-20 15:49:32 +02:00
parent 448d773da0
commit 7c94db0634
5 changed files with 111 additions and 1 deletions

View file

@ -2412,6 +2412,22 @@ void PrintConfigDef::init_sla_params()
def->mode = comExpert;
def->set_default_value(new ConfigOptionInt(10));
def = this->add("exposure_time_min", coFloat);
def->label = L("Minimum exposure time");
def->tooltip = L("Minimum exposure time");
def->sidetext = L("s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("exposure_time_max", coFloat);
def->label = L("Maximum exposure time");
def->tooltip = L("Maximum exposure time");
def->sidetext = L("s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(100));
def = this->add("exposure_time", coFloat);
def->label = L("Exposure time");
def->tooltip = L("Exposure time");
@ -2419,6 +2435,22 @@ void PrintConfigDef::init_sla_params()
def->min = 0;
def->set_default_value(new ConfigOptionFloat(10));
def = this->add("initial_exposure_time_min", coFloat);
def->label = L("Minimum initial exposure time");
def->tooltip = L("Minimum initial exposure time");
def->sidetext = L("s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(0));
def = this->add("initial_exposure_time_max", coFloat);
def->label = L("Maximum initial exposure time");
def->tooltip = L("Maximum initial exposure time");
def->sidetext = L("s");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloat(150));
def = this->add("initial_exposure_time", coFloat);
def->label = L("Initial exposure time");
def->tooltip = L("Initial exposure time");

View file

@ -1098,14 +1098,22 @@ class SLAMaterialConfig : public StaticPrintConfig
STATIC_PRINT_CONFIG_CACHE(SLAMaterialConfig)
public:
ConfigOptionFloat initial_layer_height;
ConfigOptionFloat exposure_time_min;
ConfigOptionFloat exposure_time_max;
ConfigOptionFloat exposure_time;
ConfigOptionFloat initial_exposure_time_min;
ConfigOptionFloat initial_exposure_time_max;
ConfigOptionFloat initial_exposure_time;
ConfigOptionFloats material_correction;
protected:
void initialize(StaticCacheBase &cache, const char *base_ptr)
{
OPT_PTR(initial_layer_height);
OPT_PTR(exposure_time_min);
OPT_PTR(exposure_time_max);
OPT_PTR(exposure_time);
OPT_PTR(initial_exposure_time_min);
OPT_PTR(initial_exposure_time_max);
OPT_PTR(initial_exposure_time);
OPT_PTR(material_correction);
}

View file

@ -692,6 +692,20 @@ std::string SLAPrint::validate() const
}
}
double expt_max = m_material_config.exposure_time_max.getFloat();
double expt_min = m_material_config.exposure_time_min.getFloat();
double expt_cur = m_material_config.exposure_time.getFloat();
if (expt_cur < expt_min || expt_cur > expt_max)
return L("Exposition time is out of predefined bounds.");
double iexpt_max = m_material_config.initial_exposure_time_max.getFloat();
double iexpt_min = m_material_config.initial_exposure_time_min.getFloat();
double iexpt_cur = m_material_config.initial_exposure_time.getFloat();
if (iexpt_cur < iexpt_min || iexpt_cur > iexpt_max)
return L("Initial exposition time is out of predefined bounds.");
return "";
}
@ -1586,7 +1600,11 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt
// Cache the plenty of parameters, which influence the final rasterization only,
// or they are only notes not influencing the rasterization step.
static std::unordered_set<std::string> steps_rasterize = {
"exposure_time_min",
"exposure_time_max",
"exposure_time",
"initial_exposure_time_min",
"initial_exposure_time_max",
"initial_exposure_time",
"display_width",
"display_height",