FIX: [6510] set nozzle temp incorrectly when popup AMS Setting
Change-Id: I898f0b94794a3d67017b1917ce196c4019f5eb4a
This commit is contained in:
parent
f9cbb9abb4
commit
eb9c334c27
|
@ -1829,7 +1829,7 @@ void PresetBundle::set_calibrate_printer(std::string name)
|
||||||
std::set<std::string> PresetBundle::get_printer_names_by_printer_type_and_nozzle(const std::string &printer_type, std::string nozzle_diameter_str)
|
std::set<std::string> PresetBundle::get_printer_names_by_printer_type_and_nozzle(const std::string &printer_type, std::string nozzle_diameter_str)
|
||||||
{
|
{
|
||||||
std::set<std::string> printer_names;
|
std::set<std::string> printer_names;
|
||||||
if ("0.0" == nozzle_diameter_str) {
|
if ("0.0" == nozzle_diameter_str || nozzle_diameter_str.empty()) {
|
||||||
nozzle_diameter_str = "0.4";
|
nozzle_diameter_str = "0.4";
|
||||||
}
|
}
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
|
@ -1848,6 +1848,10 @@ std::set<std::string> PresetBundle::get_printer_names_by_printer_type_and_nozzle
|
||||||
}
|
}
|
||||||
assert(printer_names.size() == 1);
|
assert(printer_names.size() == 1);
|
||||||
|
|
||||||
|
for (auto& printer_name : printer_names) {
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " printer name: " << printer_name;
|
||||||
|
}
|
||||||
|
|
||||||
return printer_names;
|
return printer_names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -954,12 +954,26 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
|
||||||
m_filament_type = "";
|
m_filament_type = "";
|
||||||
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
||||||
if (preset_bundle) {
|
if (preset_bundle) {
|
||||||
|
std::ostringstream stream;
|
||||||
|
if (obj)
|
||||||
|
stream << std::fixed << std::setprecision(1) << obj->nozzle_diameter;
|
||||||
|
std::string nozzle_diameter_str = stream.str();
|
||||||
|
std::set<std::string> printer_names = preset_bundle->get_printer_names_by_printer_type_and_nozzle(MachineObject::get_preset_printer_model_name(obj->printer_type),
|
||||||
|
nozzle_diameter_str);
|
||||||
for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
|
for (auto it = preset_bundle->filaments.begin(); it != preset_bundle->filaments.end(); it++) {
|
||||||
if (!m_comboBox_filament->GetValue().IsEmpty()) {
|
if (!m_comboBox_filament->GetValue().IsEmpty()) {
|
||||||
auto filament_item = map_filament_items[m_comboBox_filament->GetValue().ToStdString()];
|
auto filament_item = map_filament_items[m_comboBox_filament->GetValue().ToStdString()];
|
||||||
std::string filament_id = filament_item.filament_id;
|
std::string filament_id = filament_item.filament_id;
|
||||||
if (it->filament_id.compare(filament_id) == 0) {
|
if (it->filament_id.compare(filament_id) == 0) {
|
||||||
|
bool has_compatible_printer = false;
|
||||||
|
std::string preset_name = it->name;
|
||||||
|
for (std::string printer_name : printer_names) {
|
||||||
|
if (preset_name.find(printer_name) != std::string::npos) {
|
||||||
|
has_compatible_printer = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!it->is_system && !has_compatible_printer) continue;
|
||||||
// ) if nozzle_temperature_range is found
|
// ) if nozzle_temperature_range is found
|
||||||
ConfigOption* opt_min = it->config.option("nozzle_temperature_range_low");
|
ConfigOption* opt_min = it->config.option("nozzle_temperature_range_low");
|
||||||
if (opt_min) {
|
if (opt_min) {
|
||||||
|
|
Loading…
Reference in New Issue