ENH: filament actions and dual extruder filaments

Change-Id: I12a83f29c96887fc910976ac8e025c4f1508d945
(cherry picked from commit 0065ea986fc41132df43cca6704c8c98318e6b71)
This commit is contained in:
chunmao.guo 2024-06-26 15:20:47 +08:00 committed by Noisyfox
parent 4861fc7e6b
commit 2fe654587b
6 changed files with 98 additions and 44 deletions

View file

@ -398,10 +398,15 @@ void PresetComboBox::add_ams_filaments(std::string selected, bool alias_name)
{
bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
if (is_bbl_vendor_preset && !m_preset_bundle->filament_ams_list.empty()) {
set_label_marker(Append(separator(L("AMS filaments")), wxNullBitmap));
bool dual_extruder = (--m_preset_bundle->filament_ams_list.end())->first & 0x10000;
set_label_marker(Append(separator(dual_extruder ? L("Left filaments") : L("AMS filaments")), wxNullBitmap));
m_first_ams_filament = GetCount();
auto &filaments = m_collection->get_presets();
for (auto &entry : m_preset_bundle->filament_ams_list) {
if (dual_extruder && (entry.first & 0x10000)) {
dual_extruder = false;
set_label_marker(Append(separator(L("Right filaments")), wxNullBitmap));
}
auto & tray = entry.second;
std::string filament_id = tray.opt_string("filament_id", 0u);
if (filament_id.empty()) continue;