mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-07-25 05:24:26 +08:00
Merge branch 'ys_sla_time_estimation' into dev_250
This commit is contained in:
commit
867b1f99d6
@ -382,7 +382,8 @@ void fill_iniconf(ConfMap &m, const SLAPrint &print)
|
||||
m["layerHeight"] = get_cfg_value(cfg, "layer_height");
|
||||
m["expTime"] = get_cfg_value(cfg, "exposure_time");
|
||||
m["expTimeFirst"] = get_cfg_value(cfg, "initial_exposure_time");
|
||||
m["expUserProfile"] = get_cfg_value(cfg, "material_print_speed") == "slow" ? "1" : "0";
|
||||
const std::string mps = get_cfg_value(cfg, "material_print_speed");
|
||||
m["expUserProfile"] = mps == "slow" ? "1" : mps == "fast" ? "0" : "2";
|
||||
m["materialName"] = get_cfg_value(cfg, "sla_material_settings_id");
|
||||
m["printerModel"] = get_cfg_value(cfg, "printer_model");
|
||||
m["printerVariant"] = get_cfg_value(cfg, "printer_variant");
|
||||
|
@ -567,7 +567,7 @@ static std::vector<std::string> s_Preset_sla_printer_options {
|
||||
"display_width", "display_height", "display_pixels_x", "display_pixels_y",
|
||||
"display_mirror_x", "display_mirror_y",
|
||||
"display_orientation",
|
||||
"fast_tilt_time", "slow_tilt_time", "area_fill",
|
||||
"fast_tilt_time", "slow_tilt_time", "high_viscosity_tilt_time", "area_fill",
|
||||
"relative_correction",
|
||||
"relative_correction_x",
|
||||
"relative_correction_y",
|
||||
|
@ -168,8 +168,9 @@ static const t_config_enum_values s_keys_map_SLAPillarConnectionMode = {
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAPillarConnectionMode)
|
||||
|
||||
static const t_config_enum_values s_keys_map_SLAMaterialSpeed = {
|
||||
{"slow", slamsSlow},
|
||||
{"fast", slamsFast}
|
||||
{"slow", slamsSlow},
|
||||
{"fast", slamsFast},
|
||||
{"high_viscosity", slamsHighViscosity}
|
||||
};
|
||||
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SLAMaterialSpeed);
|
||||
|
||||
@ -3285,6 +3286,15 @@ void PrintConfigDef::init_sla_params()
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloat(8.));
|
||||
|
||||
def = this->add("high_viscosity_tilt_time", coFloat);
|
||||
def->label = L("High viscosity");
|
||||
def->full_label = L("High viscosity tilt");
|
||||
def->tooltip = L("Time of the super slow tilt");
|
||||
def->sidetext = L("s");
|
||||
def->min = 0;
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionFloat(10.));
|
||||
|
||||
def = this->add("area_fill", coFloat);
|
||||
def->label = L("Area fill");
|
||||
def->tooltip = L("The percentage of the bed area. \nIf the print area exceeds the specified value, \nthen a slow tilt will be used, otherwise - a fast tilt");
|
||||
@ -3892,8 +3902,10 @@ void PrintConfigDef::init_sla_params()
|
||||
def->enum_keys_map = &ConfigOptionEnum<SLAMaterialSpeed>::get_enum_values();
|
||||
def->enum_values.push_back("slow");
|
||||
def->enum_values.push_back("fast");
|
||||
def->enum_values.push_back("high_viscosity");
|
||||
def->enum_labels.push_back(L("Slow"));
|
||||
def->enum_labels.push_back(L("Fast"));
|
||||
def->enum_labels.push_back(L("High Viscosity"));
|
||||
def->mode = comAdvanced;
|
||||
def->set_default_value(new ConfigOptionEnum<SLAMaterialSpeed>(slamsFast));
|
||||
}
|
||||
|
@ -943,7 +943,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionFloat, hollowing_closing_distance))
|
||||
)
|
||||
|
||||
enum SLAMaterialSpeed { slamsSlow, slamsFast };
|
||||
enum SLAMaterialSpeed { slamsSlow, slamsFast, slamsHighViscosity };
|
||||
|
||||
PRINT_CONFIG_CLASS_DEFINE(
|
||||
SLAMaterialConfig,
|
||||
@ -985,6 +985,7 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||
((ConfigOptionFloat, gamma_correction))
|
||||
((ConfigOptionFloat, fast_tilt_time))
|
||||
((ConfigOptionFloat, slow_tilt_time))
|
||||
((ConfigOptionFloat, high_viscosity_tilt_time))
|
||||
((ConfigOptionFloat, area_fill))
|
||||
((ConfigOptionFloat, min_exposure_time))
|
||||
((ConfigOptionFloat, max_exposure_time))
|
||||
|
@ -810,6 +810,7 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt
|
||||
"material_correction_x",
|
||||
"material_correction_y",
|
||||
"material_correction_z",
|
||||
"material_print_speed",
|
||||
"relative_correction",
|
||||
"relative_correction_x",
|
||||
"relative_correction_y",
|
||||
@ -845,6 +846,7 @@ bool SLAPrint::invalidate_state_by_config_options(const std::vector<t_config_opt
|
||||
"output_filename_format",
|
||||
"fast_tilt_time",
|
||||
"slow_tilt_time",
|
||||
"high_viscosity_tilt_time",
|
||||
"area_fill",
|
||||
"bottle_cost",
|
||||
"bottle_volume",
|
||||
|
@ -889,10 +889,12 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
const double area_fill = printer_config.area_fill.getFloat()*0.01;// 0.5 (50%);
|
||||
const double fast_tilt = printer_config.fast_tilt_time.getFloat();// 5.0;
|
||||
const double slow_tilt = printer_config.slow_tilt_time.getFloat();// 8.0;
|
||||
const double hv_tilt = printer_config.high_viscosity_tilt_time.getFloat();// 10.0;
|
||||
|
||||
const double init_exp_time = material_config.initial_exposure_time.getFloat();
|
||||
const double exp_time = material_config.exposure_time.getFloat();
|
||||
|
||||
const double layer_height = m_print->m_default_object_config.layer_height.getFloat();
|
||||
const int fade_layers_cnt = m_print->m_default_object_config.faded_layers.getInt();// 10 // [3;20]
|
||||
|
||||
const auto width = scaled<double>(printer_config.display_width.getFloat());
|
||||
@ -918,7 +920,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
// Going to parallel:
|
||||
auto printlayerfn = [this,
|
||||
// functions and read only vars
|
||||
area_fill, display_area, exp_time, init_exp_time, fast_tilt, slow_tilt, delta_fade_time,
|
||||
area_fill, display_area, exp_time, init_exp_time, fast_tilt, slow_tilt, hv_tilt, material_config, delta_fade_time,
|
||||
|
||||
// write vars
|
||||
&mutex, &models_volume, &supports_volume, &estim_time, &slow_layers,
|
||||
@ -952,7 +954,7 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
layer.slices().end(),
|
||||
size_t(0),
|
||||
[](size_t a, const SliceRecord &sr) {
|
||||
return a + sr.get_slice(soModel).size();
|
||||
return a + sr.get_slice(soSupport).size();
|
||||
});
|
||||
|
||||
supports_polygons.reserve(c);
|
||||
@ -1001,7 +1003,9 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
// Calculation of the slow and fast layers to the future controlling those values on FW
|
||||
|
||||
const bool is_fast_layer = (layer_model_area + layer_support_area) <= display_area*area_fill;
|
||||
const double tilt_time = is_fast_layer ? fast_tilt : slow_tilt;
|
||||
const double tilt_time = material_config.material_print_speed == slamsSlow ? slow_tilt :
|
||||
material_config.material_print_speed == slamsHighViscosity ? hv_tilt :
|
||||
is_fast_layer ? fast_tilt : slow_tilt;
|
||||
|
||||
{ Lock lck(mutex);
|
||||
if (is_fast_layer)
|
||||
@ -1022,6 +1026,25 @@ void SLAPrint::Steps::merge_slices_and_eval_stats() {
|
||||
layer_times += exp_time;
|
||||
layer_times += tilt_time;
|
||||
|
||||
//// Per layer times (magical constants cuclulated from FW)
|
||||
|
||||
static double exposure_safe_delay_before{ 3.0 };
|
||||
static double exposure_high_viscosity_delay_before{ 3.5 };
|
||||
static double exposure_slow_move_delay_before{ 1.0 };
|
||||
|
||||
if (material_config.material_print_speed == slamsSlow)
|
||||
layer_times += exposure_safe_delay_before;
|
||||
else if (material_config.material_print_speed == slamsHighViscosity)
|
||||
layer_times += exposure_high_viscosity_delay_before;
|
||||
else if (!is_fast_layer)
|
||||
layer_times += exposure_slow_move_delay_before;
|
||||
|
||||
// Increase layer time for "magic constants" from FW
|
||||
layer_times += (
|
||||
l_height * 5 // tower move
|
||||
+ 120 / 1000 // Magical constant to compensate remaining computation delay in exposure thread
|
||||
);
|
||||
|
||||
layers_times.push_back(layer_times);
|
||||
estim_time += layer_times;
|
||||
}
|
||||
|
@ -2539,6 +2539,7 @@ void TabPrinter::build_sla()
|
||||
line = { L("Tilt time"), "" };
|
||||
line.append_option(optgroup->get_option("fast_tilt_time"));
|
||||
line.append_option(optgroup->get_option("slow_tilt_time"));
|
||||
line.append_option(optgroup->get_option("high_viscosity_tilt_time"));
|
||||
optgroup->append_line(line);
|
||||
optgroup->append_single_option_line("area_fill");
|
||||
|
||||
@ -3679,6 +3680,9 @@ void Tab::save_preset(std::string name /*= ""*/, bool detach)
|
||||
|
||||
// update preset comboboxes in DiffPresetDlg
|
||||
wxGetApp().mainframe->diff_dialog.update_presets(m_type);
|
||||
|
||||
if (detach)
|
||||
update_description_lines();
|
||||
}
|
||||
|
||||
// Called for a currently selected preset.
|
||||
|
Loading…
x
Reference in New Issue
Block a user