mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 13:47:59 -06:00
ENH: CLI: disable wipetower when all filaments mapped to one
JIRA: STUDIO-4899 Change-Id: I8dc8883fc5a70089d3e21dc82faf04f12532092a (cherry picked from commit 7e21f8ef84e7d96ed2668cd8a4f67e6376e96c74)
This commit is contained in:
parent
b552a3c534
commit
6f8f0b1b7a
2 changed files with 54 additions and 1 deletions
|
@ -683,7 +683,7 @@ int CLI::run(int argc, char **argv)
|
|||
PlateDataPtrs plate_data_src;
|
||||
int arrange_option;
|
||||
int plate_to_slice = 0, filament_count = 0, duplicate_count = 0, real_duplicate_count = 0;
|
||||
bool first_file = true, is_bbl_3mf = false, need_arrange = true, has_thumbnails = false, up_config_to_date = false, normative_check = true, duplicate_single_object = false, use_first_fila_as_default = false, minimum_save = false;
|
||||
bool first_file = true, is_bbl_3mf = false, need_arrange = true, has_thumbnails = false, up_config_to_date = false, normative_check = true, duplicate_single_object = false, use_first_fila_as_default = false, minimum_save = false, enable_timelapse = false;
|
||||
Semver file_version;
|
||||
std::map<size_t, bool> orients_requirement;
|
||||
std::vector<Preset*> project_presets;
|
||||
|
@ -716,6 +716,10 @@ int CLI::run(int argc, char **argv)
|
|||
if (min_save_option)
|
||||
minimum_save = min_save_option->value;
|
||||
|
||||
ConfigOptionBool* enable_timelapse_option = m_config.option<ConfigOptionBool>("enable_timelapse");
|
||||
if (enable_timelapse_option)
|
||||
enable_timelapse = enable_timelapse_option->value;
|
||||
|
||||
ConfigOptionString* pipe_option = m_config.option<ConfigOptionString>("pipe");
|
||||
if (pipe_option) {
|
||||
pipe_name = pipe_option->value;
|
||||
|
@ -1220,6 +1224,8 @@ int CLI::run(int argc, char **argv)
|
|||
//load filaments files
|
||||
int load_filament_count = load_filaments.size();
|
||||
std::vector<int> load_filaments_index;
|
||||
std::set<std::string> load_filaments_set;
|
||||
bool disable_wipe_tower_after_mapping = false;
|
||||
std::vector<DynamicPrintConfig> load_filaments_config;
|
||||
std::vector<std::string> load_filaments_id;
|
||||
std::vector<std::string> load_filaments_name, load_filaments_inherit;
|
||||
|
@ -1302,6 +1308,8 @@ int CLI::run(int argc, char **argv)
|
|||
load_filaments_config.push_back(std::move(config));
|
||||
load_filaments_index.push_back(current_index);
|
||||
|
||||
load_filaments_set.emplace(config_name);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("loaded filament %1% from file %2%, type %3%, name %4%, inherits %5%")%(index+1) %file %config_from %config_name % inherits;
|
||||
}
|
||||
else {
|
||||
|
@ -1312,6 +1320,8 @@ int CLI::run(int argc, char **argv)
|
|||
load_filaments_config.push_back(default_load_fila_config);
|
||||
load_filaments_index.push_back(current_index);
|
||||
load_filaments_inherit.push_back(default_filament_inherit);
|
||||
|
||||
load_filaments_set.emplace(default_load_fila_name);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
@ -1320,6 +1330,12 @@ int CLI::run(int argc, char **argv)
|
|||
if (filament_count == 0)
|
||||
filament_count = load_filament_count;
|
||||
|
||||
if ((load_filament_count > 0) && (load_filaments_set.size() == 1))
|
||||
{
|
||||
disable_wipe_tower_after_mapping = true;
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("map all the filaments to the same one, load_filament_count %1%")%load_filament_count;
|
||||
}
|
||||
|
||||
//load system config if needed
|
||||
bool fetch_compatible_values = false, fetch_upward_values = false;
|
||||
if (is_bbl_3mf && up_config_to_date) {
|
||||
|
@ -2278,6 +2294,38 @@ int CLI::run(int argc, char **argv)
|
|||
BOOST_LOG_TRIVIAL(info) << boost::format("instance %1% transform {%2%,%3%,%4%} at %5%:%6%")% model_object->name % instance_offset.x() % instance_offset.y() %instance_offset.z() % __FUNCTION__ % __LINE__<< std::endl;
|
||||
}*/
|
||||
|
||||
if (disable_wipe_tower_after_mapping) {
|
||||
auto timelapse_type_opt = m_print_config.option("timelapse_type");
|
||||
if (enable_timelapse && timelapse_type_opt && (timelapse_type_opt->getInt() == TimelapseType::tlSmooth))
|
||||
{
|
||||
disable_wipe_tower_after_mapping = false;
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("%1%: disable_wipe_tower_after_mapping: set back to false due to smooth timelapse!")%__LINE__;
|
||||
}
|
||||
else {
|
||||
ConfigOptionBool* enable_wipe_op = m_print_config.option<ConfigOptionBool>("enable_prime_tower", true);
|
||||
enable_wipe_op->value = false;
|
||||
BOOST_LOG_TRIVIAL(warning) << boost::format("%1%: disable_wipe_tower_after_mapping: disable prime tower for only one filament!")%__LINE__;
|
||||
|
||||
std::string diff_settings = different_settings[0];
|
||||
|
||||
if (diff_settings.empty())
|
||||
different_settings[0] = "enable_prime_tower";
|
||||
else {
|
||||
std::vector<std::string> different_keys;
|
||||
Slic3r::unescape_strings_cstyle(diff_settings, different_keys);
|
||||
bool need_insert = true;
|
||||
for (int index = 0; index < different_keys.size(); index++) {
|
||||
if (different_keys[index] == "enable_prime_tower") {
|
||||
need_insert = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (need_insert)
|
||||
different_settings[0] = diff_settings + ";enable_prime_tower";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Loop through transform options.
|
||||
bool user_center_specified = false;
|
||||
Points beds = get_bed_shape(m_print_config);
|
||||
|
|
|
@ -5456,6 +5456,11 @@ CLIMiscConfigDef::CLIMiscConfigDef()
|
|||
def->cli_params = "level";
|
||||
def->set_default_value(new ConfigOptionInt(1));
|
||||
|
||||
def = this->add("enable_timelapse", coBool);
|
||||
def->label = L("Enable timeplapse for print");
|
||||
def->tooltip = L("If enabled, this slicing will be considered using timelapse");
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
#if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(SLIC3R_GUI)
|
||||
/*def = this->add("sw_renderer", coBool);
|
||||
def->label = L("Render with a software renderer");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue