Merge pull request #1 from bambulab/master

merge latest changes from upstream
This commit is contained in:
SoftFever 2022-07-23 21:57:20 +08:00 committed by GitHub
commit 06dec4d21a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 389 additions and 111 deletions

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -3225,7 +3225,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "" msgstr ""
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3238,6 +3240,11 @@ msgid ""
"sending the print job" "sending the print job"
msgstr "" msgstr ""
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "" msgstr ""

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3431,7 +3431,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3448,6 +3450,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3371,7 +3371,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3388,6 +3390,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3420,7 +3420,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3437,6 +3439,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3403,7 +3403,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3420,6 +3422,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3438,7 +3438,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3455,6 +3457,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"

View file

@ -2,7 +2,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Bambu Studio\n" "Project-Id-Version: Bambu Studio\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -3369,7 +3369,9 @@ msgstr ""
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "The printer is busy with another print job." msgstr "The printer is busy with another print job."
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
"The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr "" msgstr ""
msgid "" msgid ""
@ -3386,6 +3388,11 @@ msgstr ""
"Please click each filament above to specify its mapping AMS slot before " "Please click each filament above to specify its mapping AMS slot before "
"sending the print job" "sending the print job"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr ""
msgid "Preparing print job" msgid "Preparing print job"
msgstr "Preparing print job" msgstr "Preparing print job"
@ -5890,8 +5897,8 @@ msgid ""
"interface is Concentric" "interface is Concentric"
msgstr "" msgstr ""
"Linje mönster för support gränssnittsytan .Standardmönstret för olösligt " "Linje mönster för support gränssnittsytan .Standardmönstret för olösligt "
"(material) support gränssnittet är Räta medan standardmönstret för lösligt" "(material) support gränssnittet är Räta medan standardmönstret för "
"(material) stödgränssnittet är koncentriskt" "lösligt(material) stödgränssnittet är koncentriskt"
msgid "Base pattern spacing" msgid "Base pattern spacing"
msgstr "Basens mönster mellanrum" msgstr "Basens mönster mellanrum"

View file

@ -6,7 +6,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Slic3rPE\n" "Project-Id-Version: Slic3rPE\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-07-22 18:39+0800\n" "POT-Creation-Date: 2022-07-23 18:15+0800\n"
"PO-Revision-Date: 2022-07-22 13:28+0800\n" "PO-Revision-Date: 2022-07-22 13:28+0800\n"
"Last-Translator: Jiang Yue <maze1024@gmail.com>\n" "Last-Translator: Jiang Yue <maze1024@gmail.com>\n"
"Language-Team: \n" "Language-Team: \n"
@ -1228,8 +1228,8 @@ msgid ""
"Bambu Studio is based on PrusaSlicer by PrusaResearch and SuperSlicer by " "Bambu Studio is based on PrusaSlicer by PrusaResearch and SuperSlicer by "
"Merill(supermerill)." "Merill(supermerill)."
msgstr "" msgstr ""
"Bambu Studio是以PrusaResearch的PrusaSlicer和Merill的SuperSlicer" "Bambu Studio是以PrusaResearch的PrusaSlicer和Merillsupermerill"
"supermerill为基础的。" "SuperSlicer为基础的。"
msgid "PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci." msgid "PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci."
msgstr "MerillPrusasicle最初是以Alessandro Ranellucci为基础的Slic3r。" msgstr "MerillPrusasicle最初是以Alessandro Ranellucci为基础的Slic3r。"
@ -3309,8 +3309,12 @@ msgstr "打印机正在执行指令,请在其结束后重新发起打印"
msgid "The printer is busy on other print job" msgid "The printer is busy on other print job"
msgstr "打印机正在执行其他打印任务" msgstr "打印机正在执行其他打印任务"
msgid "Printer firmware does not support material = >ams slot mapping." msgid ""
msgstr "打印机固件不支持材料=>AMS槽位映射" "The filament index exceeds the AMS's slot count and cannot send the print "
"job."
msgstr ""
"打印机固件仅支持材料=>AMS槽位的顺序映射。材料编号超过AMS的槽位数量无法发送"
"打印任务。"
msgid "" msgid ""
"Filaments to AMS slots mappings have been established. You can click a " "Filaments to AMS slots mappings have been established. You can click a "
@ -3324,6 +3328,11 @@ msgid ""
"sending the print job" "sending the print job"
msgstr "请在发送打印前点击上方各个耗材丝指定其所对应的AMS槽位" msgstr "请在发送打印前点击上方各个耗材丝指定其所对应的AMS槽位"
msgid ""
"The printer firmware only supports sequential mapping of filament => AMS "
"slot."
msgstr "打印机固件版本仅支持材料=>AMS槽位的顺序映射。"
msgid "Preparing print job" msgid "Preparing print job"
msgstr "正在准备打印任务" msgstr "正在准备打印任务"
@ -6048,6 +6057,9 @@ msgstr "支撑:正在修补层%d的空洞"
msgid "Support: propagate branches at layer %d" msgid "Support: propagate branches at layer %d"
msgstr "支撑:正在生长层%d的树枝" msgstr "支撑:正在生长层%d的树枝"
#~ msgid "Printer firmware does not support material = >ams slot mapping."
#~ msgstr "打印机固件不支持材料=>AMS槽位映射"
#~ msgid "Creating" #~ msgid "Creating"
#~ msgstr "正在创建" #~ msgstr "正在创建"

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -993,6 +993,9 @@ void AppConfig::update_last_backup_dir(const std::string& dir)
std::string AppConfig::get_region() std::string AppConfig::get_region()
{ {
#if BBL_RELEASE_TO_PUBLIC
return this->get("region");
#else
std::string sel = get("iot_environment"); std::string sel = get("iot_environment");
std::string region; std::string region;
if (sel == ENV_DEV_HOST) if (sel == ENV_DEV_HOST)
@ -1004,12 +1007,15 @@ std::string AppConfig::get_region()
if (region.empty()) if (region.empty())
return this->get("region"); return this->get("region");
return region; return region;
#endif
} }
std::string AppConfig::get_country_code() std::string AppConfig::get_country_code()
{ {
std::string region = get_region(); std::string region = get_region();
#if !BBL_RELEASE_TO_PUBLIC
if (is_engineering_region()) { return region; } if (is_engineering_region()) { return region; }
#endif
if (region == "CHN" || region == "China") if (region == "CHN" || region == "China")
return "CN"; return "CN";
else if (region == "USA") else if (region == "USA")

View file

@ -62,7 +62,6 @@ void MaterialItem::on_selected()
m_selected = true; m_selected = true;
Refresh(); Refresh();
} }
} }
void MaterialItem::on_warning() void MaterialItem::on_warning()
@ -184,13 +183,19 @@ void MaterialItem::doRender(wxDC &dc)
SetMinSize(wxSize(FromDIP(220), -1)); SetMinSize(wxSize(FromDIP(220), -1));
SetMaxSize(wxSize(FromDIP(220), -1)); SetMaxSize(wxSize(FromDIP(220), -1));
Bind(wxEVT_PAINT, &AmsMapingPopup::paintEvent, this); Bind(wxEVT_PAINT, &AmsMapingPopup::paintEvent, this);
SetBackgroundColour(*wxWHITE);
#if __APPLE__
Bind(wxEVT_LEFT_DOWN, &AmsMapingPopup::on_left_down, this);
#endif
SetBackgroundColour(*wxWHITE);
m_sizer_main = new wxBoxSizer(wxVERTICAL); m_sizer_main = new wxBoxSizer(wxVERTICAL);
//m_sizer_main->Add(0, 0, 1, wxEXPAND, 0); //m_sizer_main->Add(0, 0, 1, wxEXPAND, 0);
SetSizer(m_sizer_main); SetSizer(m_sizer_main);
Layout(); Layout();
} }
@ -205,14 +210,30 @@ void AmsMapingPopup::set_tag_texture(std::string texture)
} }
bool AmsMapingPopup::is_match_material(int id, std::string material) bool AmsMapingPopup::is_match_material(std::string material)
{ {
return m_tag_material == material ? true : false; return m_tag_material == material ? true : false;
} }
void AmsMapingPopup::on_left_down(wxMouseEvent &evt)
{
auto pos = ClientToScreen(evt.GetPosition());
for (MappingItem *item : m_mapping_item_list) {
auto p_rect = item->ClientToScreen(wxPoint(0, 0));
auto left = item->GetSize();
if (pos.x > p_rect.x && pos.y > p_rect.y && pos.x < (p_rect.x + item->GetSize().x) && pos.y < (p_rect.y + item->GetSize().y)) {
if (item->m_tray_data.type == TrayType::NORMAL && !is_match_material(item->m_tray_data.name)) return;
item->send_event(m_current_filament_id);
Dismiss();
}
}
}
void AmsMapingPopup::update_ams_data(std::map<std::string, Ams*> amsList) void AmsMapingPopup::update_ams_data(std::map<std::string, Ams*> amsList)
{ {
m_mapping_item_list.clear();
if (m_amsmapping_sizer_list.size() > 0) { if (m_amsmapping_sizer_list.size() > 0) {
for (wxBoxSizer *bz : m_amsmapping_sizer_list) { bz->Clear(true); } for (wxBoxSizer *bz : m_amsmapping_sizer_list) { bz->Clear(true); }
m_amsmapping_sizer_list.clear(); m_amsmapping_sizer_list.clear();
@ -272,80 +293,63 @@ void AmsMapingPopup::add_ams_mapping(std::vector<TrayData> tray_data)
// set button // set button
Button *m_filament_name = new Button(this, "", wxEmptyString); MappingItem *m_filament_name = new MappingItem(this);
m_filament_name->SetSize(wxSize(FromDIP(38), FromDIP(20))); m_filament_name->SetSize(wxSize(FromDIP(38), FromDIP(20)));
m_filament_name->SetMinSize(wxSize(FromDIP(38), FromDIP(20))); m_filament_name->SetMinSize(wxSize(FromDIP(38), FromDIP(20)));
m_filament_name->SetMaxSize(wxSize(FromDIP(38), FromDIP(20))); m_filament_name->SetMaxSize(wxSize(FromDIP(38), FromDIP(20)));
m_filament_name->SetCornerRadius(5); //m_filament_name->SetCornerRadius(5);
m_filament_name->SetFont(::Label::Body_12); m_filament_name->SetFont(::Label::Body_12);
m_mapping_item_list.push_back(m_filament_name);
if (tray_data[i].type == NORMAL) { if (tray_data[i].type == NORMAL) {
m_filament_name->set_data(tray_data[i].colour, tray_data[i].name, tray_data[i]);
if (m_filament_name->GetTextExtent(tray_data[i].name).x > FromDIP(38)) { m_filament_name->Bind(wxEVT_LEFT_DOWN, [this, tray_data, i, m_filament_name](wxMouseEvent &e) {
m_filament_name->SetFont(::Label::Body_10); if (!is_match_material(tray_data[i].name)) return;
auto name = tray_data[i].name.substr(0, 3) + "." + tray_data[i].name.substr(tray_data[i].name.length() - 1); m_filament_name->send_event(m_current_filament_id);
m_filament_name->SetLabel(name);
} else {
m_filament_name->SetLabel(tray_data[i].name);
}
auto material_name_colour = tray_data[i].colour.GetLuminance() < 0.5 ? *wxWHITE : wxColour(0x26, 0x2E, 0x30);
m_filament_name->SetTextColor(material_name_colour);
m_filament_name->SetBackgroundColor(tray_data[i].colour);
if (tray_data[i].colour == *wxWHITE) {
m_filament_name->SetBorderColor(wxColour(0xAC, 0xAC, 0xAC));
} else {
m_filament_name->SetBorderColor(tray_data[i].colour);
}
m_filament_name->Bind(wxEVT_BUTTON, [this, tray_data, i](wxCommandEvent &e) {
if (!is_match_material(tray_data[i].id, tray_data[i].name)) return;
wxCommandEvent event(EVT_SET_FINISH_MAPPING);
event.SetInt(tray_data[i].id);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", tray_data[i].colour.Red(), tray_data[i].colour.Green(), tray_data[i].colour.Blue(), tray_data[i].id + 1, m_current_filament_id);
event.SetString(param);
event.SetEventObject(this->GetParent());
wxPostEvent(this->GetParent(), event);
Dismiss(); Dismiss();
/* wxCommandEvent event(EVT_SET_FINISH_MAPPING);
event.SetInt(tray_data[i].id);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", tray_data[i].colour.Red(), tray_data[i].colour.Green(), tray_data[i].colour.Blue(), tray_data[i].id + 1,
m_current_filament_id);
event.SetString(param);
event.SetEventObject(this->GetParent());
wxPostEvent(this->GetParent(), event);
Dismiss();*/
}); });
} }
// temp // temp
if (tray_data[i].type == EMPTY) { if (tray_data[i].type == EMPTY) {
m_filament_name->SetLabel("-"); m_filament_name->set_data(wxColour(0x6B, 0x6B, 0x6B), "-", tray_data[i]);
m_filament_name->SetTextColor(*wxWHITE); m_filament_name->Bind(wxEVT_LEFT_DOWN, [this, tray_data, i, m_filament_name](wxMouseEvent &e) {
m_filament_name->SetBackgroundColor(wxColour(0x6B, 0x6B, 0x6B)); m_filament_name->send_event(m_current_filament_id);
m_filament_name->SetBorderColor(wxColour(0x6B, 0x6B, 0x6B)); /* wxCommandEvent event(EVT_SET_FINISH_MAPPING);
m_filament_name->Bind(wxEVT_BUTTON, [this, tray_data, i](wxCommandEvent &e) { event.SetInt(tray_data[i].id);
wxCommandEvent event(EVT_SET_FINISH_MAPPING); wxString param = wxString::Format("%d|%d|%d|%02d|%d", 0x6B, 0x6B, 0x6B, tray_data[i].id + 1, m_current_filament_id);
event.SetInt(tray_data[i].id); event.SetString(param);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", 0x6B, 0x6B, 0x6B, tray_data[i].id + 1, m_current_filament_id); event.SetEventObject(this->GetParent());
event.SetString(param); wxPostEvent(this->GetParent(), event);*/
event.SetEventObject(this->GetParent());
wxPostEvent(this->GetParent(), event);
Dismiss(); Dismiss();
}); });
} }
// third party // third party
if (tray_data[i].type == THIRD) { if (tray_data[i].type == THIRD) {
m_filament_name->SetLabel("?"); m_filament_name->set_data(wxColour(0x6B, 0x6B, 0x6B), "?", tray_data[i]);
m_filament_name->SetTextColor(*wxWHITE); m_filament_name->Bind(wxEVT_LEFT_DOWN, [this, tray_data, i, m_filament_name](wxMouseEvent &e) {
m_filament_name->SetBackgroundColor(wxColour(0x6B, 0x6B, 0x6B)); m_filament_name->send_event(m_current_filament_id);
m_filament_name->SetBorderColor(wxColour(0x6B, 0x6B, 0x6B)); //wxCommandEvent event(EVT_SET_FINISH_MAPPING);
m_filament_name->Bind(wxEVT_BUTTON, [this, tray_data, i](wxCommandEvent &e) { //event.SetInt(tray_data[i].id);
wxCommandEvent event(EVT_SET_FINISH_MAPPING); //wxString param = wxString::Format("%d|%d|%d|%02d|%d", 0x6B, 0x6B, 0x6B, tray_data[i].id + 1, m_current_filament_id);
event.SetInt(tray_data[i].id); //event.SetString(param);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", 0x6B, 0x6B, 0x6B, tray_data[i].id + 1, m_current_filament_id); //event.SetEventObject(this->GetParent());
event.SetString(param); //wxPostEvent(this->GetParent(), event);
event.SetEventObject(this->GetParent());
wxPostEvent(this->GetParent(), event);
Dismiss(); Dismiss();
}); });
} }
sizer_mapping_item->Add(number, 0, wxALIGN_CENTER_HORIZONTAL, 0); sizer_mapping_item->Add(number, 0, wxALIGN_CENTER_HORIZONTAL, 0);
sizer_mapping_item->Add(m_filament_name, 0, wxALIGN_CENTER_HORIZONTAL, 0); sizer_mapping_item->Add(m_filament_name, 0, wxALIGN_CENTER_HORIZONTAL, 0);
sizer_mapping_list->Add(sizer_mapping_item, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, FromDIP(5)); sizer_mapping_list->Add(sizer_mapping_item, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, FromDIP(5));
@ -372,4 +376,106 @@ void AmsMapingPopup::paintEvent(wxPaintEvent &evt)
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0); dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
} }
MappingItem::MappingItem(wxWindow *parent)
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
{
#ifdef __WINDOWS__
SetDoubleBuffered(true);
#endif //__WINDOWS__
SetBackgroundColour(*wxWHITE);
Bind(wxEVT_PAINT, &MappingItem::paintEvent, this);
}
MappingItem::~MappingItem()
{
}
void MappingItem::send_event(int fliament_id)
{
wxCommandEvent event(EVT_SET_FINISH_MAPPING);
event.SetInt(m_tray_data.id);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", m_coloul.Red(), m_coloul.Green(), m_coloul.Blue(), m_tray_data.id + 1, fliament_id);
event.SetString(param);
event.SetEventObject(this->GetParent()->GetParent());
wxPostEvent(this->GetParent()->GetParent(), event);
/* wxCommandEvent event(EVT_SET_FINISH_MAPPING);
event.SetInt(tray_data[i].id);
wxString param = wxString::Format("%d|%d|%d|%02d|%d", tray_data[i].colour.Red(), tray_data[i].colour.Green(), tray_data[i].colour.Blue(), tray_data[i].id + 1,
m_current_filament_id);
event.SetString(param);
event.SetEventObject(this->GetParent());
wxPostEvent(this->GetParent(), event);*/
}
void MappingItem::msw_rescale()
{
}
void MappingItem::paintEvent(wxPaintEvent &evt)
{
wxPaintDC dc(this);
render(dc);
// PrepareDC(buffdc);
// PrepareDC(dc);
}
void MappingItem::render(wxDC &dc)
{
#ifdef __WXMSW__
wxSize size = GetSize();
wxMemoryDC memdc;
wxBitmap bmp(size.x, size.y);
memdc.SelectObject(bmp);
memdc.Blit({0, 0}, size, &dc, {0, 0});
{
wxGCDC dc2(memdc);
doRender(dc2);
}
memdc.SelectObject(wxNullBitmap);
dc.DrawBitmap(bmp, 0, 0);
#else
doRender(dc);
#endif
// materials name
dc.SetFont(::Label::Body_13);
auto txt_colour = m_coloul.GetLuminance() < 0.5 ? *wxWHITE : wxColour(0x26, 0x2E, 0x30);
dc.SetTextForeground(txt_colour);
if (dc.GetTextExtent(m_name).x > GetSize().x - 10) {
dc.SetFont(::Label::Body_10);
m_name = m_name.substr(0, 3) + "." + m_name.substr(m_name.length() - 1);
}
auto txt_size = dc.GetTextExtent(m_name);
dc.DrawText(m_name, wxPoint((GetSize().x - txt_size.x) / 2, (GetSize().y - txt_size.y) / 2));
}
void MappingItem::set_data(wxColour colour, wxString name, TrayData data)
{
m_tray_data = data;
if (m_coloul != colour || m_name != name) {
m_coloul = colour;
m_name = name;
Refresh();
}
}
void MappingItem::doRender(wxDC &dc)
{
dc.SetPen(m_coloul);
dc.SetBrush(wxBrush(m_coloul));
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y,5);
if (m_coloul == *wxWHITE) {
dc.SetPen(wxPen(wxColour(0xAC, 0xAC, 0xAC),1));
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 5);
}
}
}} // namespace Slic3r::GUI }} // namespace Slic3r::GUI

View file

@ -85,6 +85,24 @@ public:
void doRender(wxDC &dc); void doRender(wxDC &dc);
}; };
class MappingItem : public wxPanel
{
public:
MappingItem(wxWindow *parent);
~MappingItem();
void update_data(TrayData data);
void send_event(int fliament_id);
wxColour m_coloul;
wxString m_name;
TrayData m_tray_data;
void msw_rescale();
void paintEvent(wxPaintEvent &evt);
void render(wxDC &dc);
void set_data(wxColour colour, wxString name, TrayData data);
void doRender(wxDC &dc);
};
class AmsMapingPopup : public wxPopupTransientWindow class AmsMapingPopup : public wxPopupTransientWindow
{ {
@ -94,6 +112,7 @@ public:
std::vector<std::string> m_materials_list; std::vector<std::string> m_materials_list;
std::vector<wxBoxSizer*> m_amsmapping_sizer_list; std::vector<wxBoxSizer*> m_amsmapping_sizer_list;
std::vector<MappingItem*> m_mapping_item_list;
int m_current_filament_id; int m_current_filament_id;
std::string m_tag_material; std::string m_tag_material;
@ -105,7 +124,8 @@ public:
void add_ams_mapping(std::vector<TrayData> tray_data); void add_ams_mapping(std::vector<TrayData> tray_data);
void set_current_filament_id(int id){m_current_filament_id = id;}; void set_current_filament_id(int id){m_current_filament_id = id;};
int get_current_filament_id(){return m_current_filament_id;}; int get_current_filament_id(){return m_current_filament_id;};
bool is_match_material(int id, std::string material); bool is_match_material(std::string material);
void on_left_down(wxMouseEvent &evt);
virtual void OnDismiss() wxOVERRIDE; virtual void OnDismiss() wxOVERRIDE;
virtual bool ProcessLeftDown(wxMouseEvent &event) wxOVERRIDE; virtual bool ProcessLeftDown(wxMouseEvent &event) wxOVERRIDE;
void paintEvent(wxPaintEvent &evt); void paintEvent(wxPaintEvent &evt);

View file

@ -647,10 +647,10 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
for (int i = 0; i < filaments.size(); i++) { for (int i = 0; i < filaments.size(); i++) {
FilamentInfo info; FilamentInfo info;
info.id = filaments[i].id; info.id = filaments[i].id;
info.tray_id = -1; info.tray_id = filaments[i].id;
result.push_back(info); result.push_back(info);
} }
return 0; return 1;
} }
char buffer[256]; char buffer[256];
@ -791,14 +791,33 @@ int MachineObject::ams_filament_mapping(std::vector<FilamentInfo> filaments, std
bool MachineObject::is_valid_mapping_result(std::vector<FilamentInfo>& result) bool MachineObject::is_valid_mapping_result(std::vector<FilamentInfo>& result)
{ {
bool valid_ams_mapping_result = true; if (is_support_ams_mapping()) {
for (int i = 0; i < result.size(); i++) { bool valid_ams_mapping_result = true;
if (result[i].tray_id == -1) { for (int i = 0; i < result.size(); i++) {
valid_ams_mapping_result = false; if (result[i].tray_id == -1) {
break; valid_ams_mapping_result = false;
break;
}
} }
return valid_ams_mapping_result;
} else {
bool is_valid = true;
// invalid mapping result
if (result.empty()) return false;
for (int i = 0; i < result.size(); i++) {
// invalid mapping result
if (result[i].tray_id < 0)
return false;
else {
int ams_id = result[i].tray_id / 4;
if (amsList.find(std::to_string(ams_id)) == amsList.end()) {
return false;
}
}
}
return is_valid;
} }
return valid_ams_mapping_result; return true;
} }

View file

@ -1233,7 +1233,7 @@ int GUI_App::download_plugin(InstallProgressFn pro_fn, WasCancelledFn cancel_fn)
return result; return result;
} }
if (download_url.empty()) { if (download_url.empty()) {
BOOST_LOG_TRIVIAL(info) << "[download_plugin]: no availaible plugin found for this app version: " << SLIC3R_VERSION; BOOST_LOG_TRIVIAL(info) << "[download_plugin]: no availaible plugin found for this app version: " << SLIC3R_VERSION;
if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel); if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel);
@ -1310,12 +1310,14 @@ int GUI_App::install_plugin(InstallProgressFn pro_fn, WasCancelledFn cancel_fn)
mz_zip_archive archive; mz_zip_archive archive;
mz_zip_zero_struct(&archive); mz_zip_zero_struct(&archive);
if (!open_zip_reader(&archive, target_file_path)) { if (!open_zip_reader(&archive, target_file_path)) {
BOOST_LOG_TRIVIAL(error) << boost::format("install_plugin: %1%, open zip file failed")%__LINE__;
if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel); if (pro_fn) pro_fn(InstallStatusDownloadFailed, 0, cancel);
return InstallStatusUnzipFailed; return InstallStatusUnzipFailed;
} }
mz_uint num_entries = mz_zip_reader_get_num_files(&archive); mz_uint num_entries = mz_zip_reader_get_num_files(&archive);
mz_zip_archive_file_stat stat; mz_zip_archive_file_stat stat;
BOOST_LOG_TRIVIAL(error) << boost::format("install_plugin: %1%, got %2% files")%__LINE__ %num_entries;
for (mz_uint i = 0; i < num_entries; i++) { for (mz_uint i = 0; i < num_entries; i++) {
if (m_networking_cancel_update || cancel) { if (m_networking_cancel_update || cancel) {
BOOST_LOG_TRIVIAL(info) << boost::format("install_plugin: %1%, cancelled by user")%__LINE__; BOOST_LOG_TRIVIAL(info) << boost::format("install_plugin: %1%, cancelled by user")%__LINE__;
@ -1368,6 +1370,9 @@ int GUI_App::install_plugin(InstallProgressFn pro_fn, WasCancelledFn cancel_fn)
} }
} }
} }
else {
BOOST_LOG_TRIVIAL(error) << boost::format("install_plugin: %1%, mz_zip_reader_file_stat for file %2% failed")%__LINE__%i;
}
} }
close_zip_reader(&archive); close_zip_reader(&archive);
@ -1380,7 +1385,7 @@ int GUI_App::install_plugin(InstallProgressFn pro_fn, WasCancelledFn cancel_fn)
void GUI_App::restart_networking() void GUI_App::restart_networking()
{ {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format("enter, mainframe %1%")%mainframe; BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(" enter, mainframe %1%")%mainframe;
on_init_network(); on_init_network();
if(m_agent) { if(m_agent) {
init_networking_callbacks(); init_networking_callbacks();
@ -1402,7 +1407,7 @@ void GUI_App::restart_networking()
if (plater_) if (plater_)
plater_->get_notification_manager()->bbl_close_plugin_install_notification(); plater_->get_notification_manager()->bbl_close_plugin_install_notification();
} }
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format("exit, m_agent=%1%")%m_agent; BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(" exit, m_agent=%1%")%m_agent;
} }
int GUI_App::updating_bambu_networking() int GUI_App::updating_bambu_networking()
@ -1957,6 +1962,8 @@ bool GUI_App::on_init_inner()
// Suppress the '- default -' presets. // Suppress the '- default -' presets.
preset_bundle->set_default_suppressed(true); preset_bundle->set_default_suppressed(true);
Bind(EVT_USER_LOGIN, &GUI_App::on_user_login, this);
on_init_network(); on_init_network();
//BBS if load user preset failed //BBS if load user preset failed
@ -2058,7 +2065,7 @@ bool GUI_App::on_init_inner()
//#endif //__APPLE__ //#endif //__APPLE__
Bind(EVT_HTTP_ERROR, &GUI_App::on_http_error, this); Bind(EVT_HTTP_ERROR, &GUI_App::on_http_error, this);
Bind(EVT_USER_LOGIN, &GUI_App::on_user_login, this);
Bind(wxEVT_IDLE, [this](wxIdleEvent& event) Bind(wxEVT_IDLE, [this](wxIdleEvent& event)
{ {
@ -2121,7 +2128,15 @@ bool GUI_App::on_init_network()
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, load dll ok"; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, load dll ok";
if (check_networking_version()) { if (check_networking_version()) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, compatibility version"; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, compatibility version";
create_network_agent = true; auto bambu_source = Slic3r::NetworkAgent::get_bambu_source_entry();
if (!bambu_source) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": can not get bambu source module!";
if (app_config->get("installed_networking") == "1") {
m_networking_need_update = true;
}
}
else
create_network_agent = true;
} else { } else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, version dismatch, need upload network module"; BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": on_init_network, version dismatch, need upload network module";
if (app_config->get("installed_networking") == "1") { if (app_config->get("installed_networking") == "1") {
@ -2508,6 +2523,7 @@ void GUI_App::recreate_GUI(const wxString& msg_name)
dlg.Update(80, _L("Loading current presets") + dots); dlg.Update(80, _L("Loading current presets") + dots);
load_current_presets(); load_current_presets();
mainframe->Show(true); mainframe->Show(true);
mainframe->refresh_plugin_tips();
dlg.Update(90, _L("Loading a mode view") + dots); dlg.Update(90, _L("Loading a mode view") + dots);
@ -3586,7 +3602,7 @@ bool GUI_App::load_language(wxString language, bool initial)
// Get the active language from PrusaSlicer.ini, or empty string if the key does not exist. // Get the active language from PrusaSlicer.ini, or empty string if the key does not exist.
language = app_config->get("language"); language = app_config->get("language");
if (! language.empty()) if (! language.empty())
BOOST_LOG_TRIVIAL(trace) << boost::format("language provided by PrusaSlicer.ini: %1%") % language; BOOST_LOG_TRIVIAL(trace) << boost::format("language provided by PBambuStudio.conf: %1%") % language;
else { else {
// Get the system language. // Get the system language.
const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage()); const wxLanguage lang_system = wxLanguage(wxLocale::GetSystemLanguage());
@ -3697,6 +3713,32 @@ bool GUI_App::load_language(wxString language, bool initial)
} }
#endif #endif
if (! wxLocale::IsAvailable(language_info->Language)&&initial) {
language_info = wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH_UK);
app_config->set("language", language_info->CanonicalName.ToUTF8().data());
}
else if (initial) {
// bbs supported languages
//TODO: use a global one with Preference
wxLanguage supported_languages[] {wxLANGUAGE_ENGLISH, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_GERMAN, wxLANGUAGE_FRENCH, wxLANGUAGE_SPANISH, wxLANGUAGE_SWEDISH, wxLANGUAGE_DUTCH };
std::string cur_language = app_config->get("language");
if (cur_language != "") {
//cleanup the language wrongly set before
const wxLanguageInfo *langinfo = nullptr;
bool embedded_language = false;
for (auto index = 0; index < 7; index++) {
langinfo = wxLocale::GetLanguageInfo(supported_languages[index]);
std::string temp_lan = langinfo->CanonicalName.ToUTF8().data();
if (cur_language == temp_lan) {
embedded_language = true;
break;
}
}
if (!embedded_language)
app_config->erase("app", "language");
}
}
if (! wxLocale::IsAvailable(language_info->Language)) { if (! wxLocale::IsAvailable(language_info->Language)) {
// Loading the language dictionary failed. // Loading the language dictionary failed.
wxString message = "Switching Bambu Studio to language " + language_info->CanonicalName + " failed."; wxString message = "Switching Bambu Studio to language " + language_info->CanonicalName + " failed.";

View file

@ -397,16 +397,20 @@ void GLGizmoFdmSupports::on_render_input_window(float x, float y, float bottom_l
show_tooltip_information(caption_max, x, get_cur_y); show_tooltip_information(caption_max, x, get_cur_y);
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 5.0f)); ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(6.0f, 5.0f));
ImGui::SameLine(); ImGui::SameLine();
if (m_imgui->button(m_desc.at("perform_filter"))) {
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Reset selection", UndoRedo::SnapshotType::GizmoAction);
for (int i = 0; i < m_triangle_selectors.size(); i++) { // Perform button is for gap fill
TriangleSelectorPatch *ts_mm = dynamic_cast<TriangleSelectorPatch *>(m_triangle_selectors[i].get()); if (m_current_tool == ImGui::FragmentFilterIcon) {
ts_mm->update_selector_triangles(); if (m_imgui->button(m_desc.at("perform_filter"))) {
ts_mm->request_update_render_data(true); Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Reset selection", UndoRedo::SnapshotType::GizmoAction);
for (int i = 0; i < m_triangle_selectors.size(); i++) {
TriangleSelectorPatch* ts_mm = dynamic_cast<TriangleSelectorPatch*>(m_triangle_selectors[i].get());
ts_mm->update_selector_triangles();
ts_mm->request_update_render_data(true);
}
update_model_object();
m_parent.set_as_dirty();
} }
update_model_object();
m_parent.set_as_dirty();
} }
ImGui::SameLine(); ImGui::SameLine();

View file

@ -634,7 +634,6 @@ wxWindow* PreferencesDialog::create_general_page()
// bbs supported languages // bbs supported languages
wxLanguage supported_languages[]{wxLANGUAGE_ENGLISH, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_GERMAN, wxLANGUAGE_FRENCH, wxLANGUAGE_SPANISH, wxLANGUAGE_SWEDISH, wxLANGUAGE_DUTCH }; wxLanguage supported_languages[]{wxLANGUAGE_ENGLISH, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_GERMAN, wxLANGUAGE_FRENCH, wxLANGUAGE_SPANISH, wxLANGUAGE_SWEDISH, wxLANGUAGE_DUTCH };
auto translations = wxTranslations::Get()->GetAvailableTranslations(SLIC3R_APP_KEY); auto translations = wxTranslations::Get()->GetAvailableTranslations(SLIC3R_APP_KEY);
std::vector<const wxLanguageInfo *> language_infos; std::vector<const wxLanguageInfo *> language_infos;
language_infos.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH)); language_infos.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH));
@ -643,7 +642,7 @@ wxWindow* PreferencesDialog::create_general_page()
if (langinfo == nullptr) continue; if (langinfo == nullptr) continue;
for (auto si = 0; si < sizeof(supported_languages); si++) { for (auto si = 0; si < 7; si++) {
if (langinfo == wxLocale::GetLanguageInfo(supported_languages[si])) { if (langinfo == wxLocale::GetLanguageInfo(supported_languages[si])) {
language_infos.emplace_back(langinfo); language_infos.emplace_back(langinfo);
} }

View file

@ -1064,7 +1064,7 @@ void SelectMachineDialog::sync_ams_mapping_result(std::vector<FilamentInfo> &res
ams_col = AmsTray::decode_color(f->color); ams_col = AmsTray::decode_color(f->color);
} else { } else {
// default color // default color
ams_col = wxColour(0x6B, 0x6B, 0x6B); ams_col = wxColour(0xEE, 0xEE, 0xEE);
} }
m->set_ams_info(ams_col, ams_id); m->set_ams_info(ams_col, ams_id);
@ -1105,8 +1105,22 @@ bool SelectMachineDialog::do_ams_mapping(MachineObject *obj_)
sync_ams_mapping_result(m_ams_mapping_result); sync_ams_mapping_result(m_ams_mapping_result);
BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=" << ams_array; BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=" << ams_array;
} }
return obj_->is_valid_mapping_result(m_ams_mapping_result);
} else {
// do not support ams mapping try to use order mapping
bool is_valid = obj_->is_valid_mapping_result(m_ams_mapping_result);
if (!is_valid) {
// reset invalid result
for (int i = 0; i < m_ams_mapping_result.size(); i++) {
m_ams_mapping_result[i].tray_id = -1;
m_ams_mapping_result[i].distance = 99999;
}
}
sync_ams_mapping_result(m_ams_mapping_result);
return is_valid;
} }
return obj_->is_valid_mapping_result(m_ams_mapping_result);
return true;
} }
bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str) bool SelectMachineDialog::get_ams_mapping_result(std::string &mapping_array_str)
@ -1292,13 +1306,13 @@ void SelectMachineDialog::show_status(PrintDialogStatus status)
Enable_Send_Button(false); Enable_Send_Button(false);
Enable_Refresh_Button(true); Enable_Refresh_Button(true);
} else if (status == PrintDialogStatus::PrintStatusNeedUpgradingAms) { } else if (status == PrintDialogStatus::PrintStatusNeedUpgradingAms) {
wxString msg_text = _L("Printer firmware does not support material = >ams slot mapping."); wxString msg_text = _L("The filament index exceeds the AMS's slot count and cannot send the print job.");
update_print_status_msg(msg_text, true, true); update_print_status_msg(msg_text, true, false);
Enable_Send_Button(true); Enable_Send_Button(false);
Enable_Refresh_Button(true); Enable_Refresh_Button(true);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess){ } else if (status == PrintDialogStatus::PrintStatusAmsMappingSuccess){
wxString msg_text = _L("Filaments to AMS slots mappings have been established. You can click a filament above to change its mapping AMS slot"); wxString msg_text = _L("Filaments to AMS slots mappings have been established. You can click a filament above to change its mapping AMS slot");
update_print_status_msg(msg_text, true, false); update_print_status_msg(msg_text, false, false);
Enable_Send_Button(true); Enable_Send_Button(true);
Enable_Refresh_Button(true); Enable_Refresh_Button(true);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingInvalid) { } else if (status == PrintDialogStatus::PrintStatusAmsMappingInvalid) {
@ -1326,7 +1340,7 @@ void SelectMachineDialog::show_status(PrintDialogStatus status)
Enable_Send_Button(true); Enable_Send_Button(true);
Enable_Refresh_Button(true); Enable_Refresh_Button(true);
} else if (status == PrintDialogStatus::PrintStatusAmsMappingByOrder) { } else if (status == PrintDialogStatus::PrintStatusAmsMappingByOrder) {
wxString msg_text = _L("Printer firmware does not support material = >ams slot mapping."); wxString msg_text = _L("The printer firmware only supports sequential mapping of filament => AMS slot.");
update_print_status_msg(msg_text, false, false); update_print_status_msg(msg_text, false, false);
Enable_Send_Button(true); Enable_Send_Button(true);
Enable_Refresh_Button(true); Enable_Refresh_Button(true);
@ -1768,7 +1782,11 @@ void SelectMachineDialog::update_show_status()
} }
if (!obj_->is_support_ams_mapping()) { if (!obj_->is_support_ams_mapping()) {
show_status(PrintDialogStatus::PrintStatusNeedUpgradingAms); if (obj_->is_valid_mapping_result(m_ams_mapping_result)) {
show_status(PrintDialogStatus::PrintStatusAmsMappingByOrder);
} else {
show_status(PrintDialogStatus::PrintStatusNeedUpgradingAms);
}
return; return;
} }
@ -1950,6 +1968,10 @@ void SelectMachineDialog::set_default()
m_sizer_material->Add(item, 0, wxALL, FromDIP(4)); m_sizer_material->Add(item, 0, wxALL, FromDIP(4));
item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) { item->Bind(wxEVT_LEFT_UP, [this, item, materials, extruder](wxMouseEvent &e) {
});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
MaterialHash::iterator iter = m_materialList.begin(); MaterialHash::iterator iter = m_materialList.begin();
while (iter != m_materialList.end()) { while (iter != m_materialList.end()) {
int id = iter->first; int id = iter->first;
@ -1961,9 +1983,8 @@ void SelectMachineDialog::set_default()
m_current_filament_id = extruder; m_current_filament_id = extruder;
item->on_selected(); item->on_selected();
});
item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
auto mouse_pos = ClientToScreen(e.GetPosition()); auto mouse_pos = ClientToScreen(e.GetPosition());
wxPoint rect = item->ClientToScreen(wxPoint(0, 0)); wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
// update ams data // update ams data

View file

@ -7,4 +7,4 @@ set(SLIC3R_APP_KEY "BambuStudio")
if(NOT DEFINED BBL_RELEASE_TO_PUBLIC) if(NOT DEFINED BBL_RELEASE_TO_PUBLIC)
set(BBL_RELEASE_TO_PUBLIC "0") set(BBL_RELEASE_TO_PUBLIC "0")
endif() endif()
set(SLIC3R_VERSION "01.01.00.13") set(SLIC3R_VERSION "01.01.00.14")