ENH: CLI: refine downward_check logic
1. if downward check failed, we should remove it from upward_compatible 2. add A1 into downward_check list jira: no-jira Change-Id: I8969b4f2b908044f6881ff7710f7f02576b4363a
This commit is contained in:
parent
3b2943e20b
commit
81ffc1a71c
|
@ -75,80 +75,100 @@
|
|||
"Bambu Lab X1": {
|
||||
"downward_check": {
|
||||
"Bambu Lab X1 0.2 nozzle": [
|
||||
"Bambu Lab A1 mini 0.2 nozzle"
|
||||
"Bambu Lab A1 mini 0.2 nozzle",
|
||||
"Bambu Lab A1 0.2 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 0.4 nozzle": [
|
||||
"Bambu Lab A1 mini 0.4 nozzle"
|
||||
"Bambu Lab A1 mini 0.4 nozzle",
|
||||
"Bambu Lab A1 0.4 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 0.6 nozzle": [
|
||||
"Bambu Lab A1 mini 0.6 nozzle"
|
||||
"Bambu Lab A1 mini 0.6 nozzle",
|
||||
"Bambu Lab A1 0.6 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 0.8 nozzle": [
|
||||
"Bambu Lab A1 mini 0.8 nozzle"
|
||||
"Bambu Lab A1 mini 0.8 nozzle",
|
||||
"Bambu Lab A1 0.8 nozzle"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Bambu Lab X1 Carbon": {
|
||||
"downward_check": {
|
||||
"Bambu Lab X1 Carbon 0.2 nozzle": [
|
||||
"Bambu Lab A1 mini 0.2 nozzle"
|
||||
"Bambu Lab A1 mini 0.2 nozzle",
|
||||
"Bambu Lab A1 0.2 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 Carbon 0.4 nozzle": [
|
||||
"Bambu Lab A1 mini 0.4 nozzle"
|
||||
"Bambu Lab A1 mini 0.4 nozzle",
|
||||
"Bambu Lab A1 0.4 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 Carbon 0.6 nozzle": [
|
||||
"Bambu Lab A1 mini 0.6 nozzle"
|
||||
"Bambu Lab A1 mini 0.6 nozzle",
|
||||
"Bambu Lab A1 0.6 nozzle"
|
||||
],
|
||||
"Bambu Lab X1 Carbon 0.8 nozzle": [
|
||||
"Bambu Lab A1 mini 0.8 nozzle"
|
||||
"Bambu Lab A1 mini 0.8 nozzle",
|
||||
"Bambu Lab A1 0.8 nozzle"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Bambu Lab X1E": {
|
||||
"downward_check": {
|
||||
"Bambu Lab X1E 0.2 nozzle": [
|
||||
"Bambu Lab A1 mini 0.2 nozzle"
|
||||
"Bambu Lab A1 mini 0.2 nozzle",
|
||||
"Bambu Lab A1 0.2 nozzle"
|
||||
],
|
||||
"Bambu Lab X1E 0.4 nozzle": [
|
||||
"Bambu Lab A1 mini 0.4 nozzle"
|
||||
"Bambu Lab A1 mini 0.4 nozzle",
|
||||
"Bambu Lab A1 0.4 nozzle"
|
||||
],
|
||||
"Bambu Lab X1E 0.6 nozzle": [
|
||||
"Bambu Lab A1 mini 0.6 nozzle"
|
||||
"Bambu Lab A1 mini 0.6 nozzle",
|
||||
"Bambu Lab A1 0.6 nozzle"
|
||||
],
|
||||
"Bambu Lab X1E 0.8 nozzle": [
|
||||
"Bambu Lab A1 mini 0.8 nozzle"
|
||||
"Bambu Lab A1 mini 0.8 nozzle",
|
||||
"Bambu Lab A1 0.8 nozzle"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Bambu Lab P1P": {
|
||||
"downward_check": {
|
||||
"Bambu Lab P1P 0.2 nozzle": [
|
||||
"Bambu Lab A1 mini 0.2 nozzle"
|
||||
"Bambu Lab A1 mini 0.2 nozzle",
|
||||
"Bambu Lab A1 0.2 nozzle"
|
||||
],
|
||||
"Bambu Lab P1P 0.4 nozzle": [
|
||||
"Bambu Lab A1 mini 0.4 nozzle"
|
||||
"Bambu Lab A1 mini 0.4 nozzle",
|
||||
"Bambu Lab A1 0.4 nozzle"
|
||||
],
|
||||
"Bambu Lab P1P 0.6 nozzle": [
|
||||
"Bambu Lab A1 mini 0.6 nozzle"
|
||||
"Bambu Lab A1 mini 0.6 nozzle",
|
||||
"Bambu Lab A1 0.6 nozzle"
|
||||
],
|
||||
"Bambu Lab P1P 0.8 nozzle": [
|
||||
"Bambu Lab A1 mini 0.8 nozzle"
|
||||
"Bambu Lab A1 mini 0.8 nozzle",
|
||||
"Bambu Lab A1 0.8 nozzle"
|
||||
]
|
||||
}
|
||||
},
|
||||
"Bambu Lab P1S": {
|
||||
"downward_check": {
|
||||
"Bambu Lab P1S 0.2 nozzle": [
|
||||
"Bambu Lab A1 mini 0.2 nozzle"
|
||||
"Bambu Lab A1 mini 0.2 nozzle",
|
||||
"Bambu Lab A1 0.2 nozzle"
|
||||
],
|
||||
"Bambu Lab P1S 0.4 nozzle": [
|
||||
"Bambu Lab A1 mini 0.4 nozzle"
|
||||
"Bambu Lab A1 mini 0.4 nozzle",
|
||||
"Bambu Lab A1 0.4 nozzle"
|
||||
],
|
||||
"Bambu Lab P1S 0.6 nozzle": [
|
||||
"Bambu Lab A1 mini 0.6 nozzle"
|
||||
"Bambu Lab A1 mini 0.6 nozzle",
|
||||
"Bambu Lab A1 0.6 nozzle"
|
||||
],
|
||||
"Bambu Lab P1S 0.8 nozzle": [
|
||||
"Bambu Lab A1 mini 0.8 nozzle"
|
||||
"Bambu Lab A1 mini 0.8 nozzle",
|
||||
"Bambu Lab A1 0.8 nozzle"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1288,6 +1288,7 @@ int CLI::run(int argc, char **argv)
|
|||
const std::vector<std::string> &uptodate_filaments = m_config.option<ConfigOptionStrings>("uptodate_filaments", true)->values;
|
||||
std::vector<std::string> downward_settings = m_config.option<ConfigOptionStrings>("downward_settings", true)->values;
|
||||
std::vector<std::string> downward_compatible_machines;
|
||||
std::set<std::string> downward_uncompatible_machines;
|
||||
//BBS: always use ForwardCompatibilitySubstitutionRule::Enable
|
||||
//const ForwardCompatibilitySubstitutionRule config_substitution_rule = m_config.option<ConfigOptionEnum<ForwardCompatibilitySubstitutionRule>>("config_compatibility", true)->value;
|
||||
const ForwardCompatibilitySubstitutionRule config_substitution_rule = ForwardCompatibilitySubstitutionRule::Enable;
|
||||
|
@ -3659,19 +3660,29 @@ int CLI::run(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (failed_count < downward_check_size)
|
||||
|
||||
for (int index2 = 0; index2 < downward_check_size; index2 ++)
|
||||
{
|
||||
//has success ones
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: downward_check_size %1%, failed_count %2%")%downward_check_size %failed_count;
|
||||
for (int index2 = 0; index2 < downward_check_size; index2 ++)
|
||||
{
|
||||
if (downward_check_status[index2])
|
||||
continue;
|
||||
printer_plate_info_t& plate_info = downward_check_printers[index2];
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: found compatible printer %1%")%plate_info.printer_name;
|
||||
downward_compatible_machines.push_back(plate_info.printer_name);
|
||||
printer_plate_info_t& plate_info = downward_check_printers[index2];
|
||||
if (downward_check_status[index2]) {
|
||||
downward_uncompatible_machines.emplace(plate_info.printer_name);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: found uncompatible printer %1%")%plate_info.printer_name;
|
||||
}
|
||||
else {
|
||||
downward_compatible_machines.push_back(plate_info.printer_name);
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: found compatible printer %1%")%plate_info.printer_name;
|
||||
}
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: downward_check_size %1%, failed_count %2%")%downward_check_size %failed_count;
|
||||
sliced_info.downward_machines = downward_compatible_machines;
|
||||
|
||||
for(std::vector<std::string>::iterator it = sliced_info.upward_machines.begin(); it != sliced_info.upward_machines.end();){
|
||||
if(downward_uncompatible_machines.find(*it) != downward_uncompatible_machines.end()){
|
||||
BOOST_LOG_TRIVIAL(info) << boost::format("downward_check: remove %1% from upward compatible printers")%*it;
|
||||
it = sliced_info.upward_machines.erase(it);
|
||||
} else {
|
||||
it ++;
|
||||
}
|
||||
sliced_info.downward_machines = downward_compatible_machines;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue