mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2026-01-02 13:00:28 -07:00
FIX: the encoding of filament check_ams_filament_valid
jira: [STUDIO-12251] Change-Id: Idc3d23dce67d3e835f15c47984fdd68041371d61 (cherry picked from commit 42b15b4d41a099c5f1aca9dd59ac592aafba0b43)
This commit is contained in:
parent
2d69d58ce9
commit
4b6b3cc7bd
5 changed files with 46 additions and 48 deletions
|
|
@ -555,7 +555,7 @@ void AMSMaterialsSetting::on_select_ok(wxCommandEvent &event)
|
|||
if (wxGetApp().app_config->get("skip_ams_blacklist_check") != "true") {
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
wxString info;
|
||||
std::string filamnt_type;
|
||||
std::string filamnt_name;
|
||||
it->get_filament_type(filamnt_type);
|
||||
|
|
@ -1456,7 +1456,7 @@ void ColorPicker::doRender(wxDC& dc)
|
|||
}
|
||||
|
||||
if (m_show_full) {
|
||||
dc.SetPen(wxPen(wxColour(0x6B6B6B)));
|
||||
dc.SetPen(wxPen(wxColour("#6B6B6B")));
|
||||
dc.SetBrush(*wxTRANSPARENT_BRUSH);
|
||||
dc.DrawCircle(size.x / 2, size.y / 2, radius);
|
||||
|
||||
|
|
@ -1519,30 +1519,30 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
|
|||
:PopupWindow(parent, wxBORDER_NONE)
|
||||
{
|
||||
m_def_colors.clear();
|
||||
m_def_colors.push_back(wxColour(0xFFFFFF));
|
||||
m_def_colors.push_back(wxColour(0xfff144));
|
||||
m_def_colors.push_back(wxColour(0xDCF478));
|
||||
m_def_colors.push_back(wxColour(0x0ACC38));
|
||||
m_def_colors.push_back(wxColour(0x057748));
|
||||
m_def_colors.push_back(wxColour(0x0d6284));
|
||||
m_def_colors.push_back(wxColour(0x0EE2A0));
|
||||
m_def_colors.push_back(wxColour(0x76D9F4));
|
||||
m_def_colors.push_back(wxColour(0x46a8f9));
|
||||
m_def_colors.push_back(wxColour(0x2850E0));
|
||||
m_def_colors.push_back(wxColour(0x443089));
|
||||
m_def_colors.push_back(wxColour(0xA03CF7));
|
||||
m_def_colors.push_back(wxColour(0xF330F9));
|
||||
m_def_colors.push_back(wxColour(0xD4B1DD));
|
||||
m_def_colors.push_back(wxColour(0xf95d73));
|
||||
m_def_colors.push_back(wxColour(0xf72323));
|
||||
m_def_colors.push_back(wxColour(0x7c4b00));
|
||||
m_def_colors.push_back(wxColour(0xf98c36));
|
||||
m_def_colors.push_back(wxColour(0xfcecd6));
|
||||
m_def_colors.push_back(wxColour(0xD3C5A3));
|
||||
m_def_colors.push_back(wxColour(0xAF7933));
|
||||
m_def_colors.push_back(wxColour(0x898989));
|
||||
m_def_colors.push_back(wxColour(0xBCBCBC));
|
||||
m_def_colors.push_back(wxColour(0x161616));
|
||||
m_def_colors.push_back(wxColour("#FFFFFF"));
|
||||
m_def_colors.push_back(wxColour("#fff144"));
|
||||
m_def_colors.push_back(wxColour("#DCF478"));
|
||||
m_def_colors.push_back(wxColour("#0ACC38"));
|
||||
m_def_colors.push_back(wxColour("#057748"));
|
||||
m_def_colors.push_back(wxColour("#0d6284"));
|
||||
m_def_colors.push_back(wxColour("#0EE2A0"));
|
||||
m_def_colors.push_back(wxColour("#76D9F4"));
|
||||
m_def_colors.push_back(wxColour("#46a8f9"));
|
||||
m_def_colors.push_back(wxColour("#2850E0"));
|
||||
m_def_colors.push_back(wxColour("#443089"));
|
||||
m_def_colors.push_back(wxColour("#A03CF7"));
|
||||
m_def_colors.push_back(wxColour("#F330F9"));
|
||||
m_def_colors.push_back(wxColour("#D4B1DD"));
|
||||
m_def_colors.push_back(wxColour("#f95d73"));
|
||||
m_def_colors.push_back(wxColour("#f72323"));
|
||||
m_def_colors.push_back(wxColour("#7c4b00"));
|
||||
m_def_colors.push_back(wxColour("#f98c36"));
|
||||
m_def_colors.push_back(wxColour("#fcecd6"));
|
||||
m_def_colors.push_back(wxColour("#D3C5A3"));
|
||||
m_def_colors.push_back(wxColour("#AF7933"));
|
||||
m_def_colors.push_back(wxColour("#898989"));
|
||||
m_def_colors.push_back(wxColour("#BCBCBC"));
|
||||
m_def_colors.push_back(wxColour("#161616"));
|
||||
|
||||
|
||||
SetBackgroundColour(wxColour(*wxWHITE));
|
||||
|
|
@ -1557,7 +1557,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
|
|||
m_title_ams->SetBackgroundColour(wxColour(238, 238, 238));
|
||||
m_sizer_ams->Add(m_title_ams, 0, wxALL, 5);
|
||||
auto ams_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
|
||||
ams_line->SetBackgroundColour(wxColour(0xCECECE));
|
||||
ams_line->SetBackgroundColour(wxColour("#CECECE"));
|
||||
ams_line->SetMinSize(wxSize(-1, 1));
|
||||
ams_line->SetMaxSize(wxSize(-1, 1));
|
||||
m_sizer_ams->Add(ams_line, 1, wxALIGN_CENTER, 0);
|
||||
|
|
@ -1604,7 +1604,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
|
|||
auto other_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
|
||||
other_line->SetMinSize(wxSize(-1, 1));
|
||||
other_line->SetMaxSize(wxSize(-1, 1));
|
||||
other_line->SetBackgroundColour(wxColour(0xCECECE));
|
||||
other_line->SetBackgroundColour(wxColour("#CECECE"));
|
||||
m_sizer_other->Add(other_line, 1, wxALIGN_CENTER, 0);
|
||||
|
||||
//custom color
|
||||
|
|
@ -1613,7 +1613,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
|
|||
m_title_custom->SetFont(::Label::Body_14);
|
||||
m_title_custom->SetBackgroundColour(wxColour(238, 238, 238));
|
||||
auto custom_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
|
||||
custom_line->SetBackgroundColour(wxColour(0xCECECE));
|
||||
custom_line->SetBackgroundColour(wxColour("#CECECE"));
|
||||
custom_line->SetMinSize(wxSize(-1, 1));
|
||||
custom_line->SetMaxSize(wxSize(-1, 1));
|
||||
m_sizer_custom->Add(m_title_custom, 0, wxALL, 5);
|
||||
|
|
|
|||
|
|
@ -1448,7 +1448,7 @@ bool CalibrationPresetPage::is_filament_in_blacklist(int tray_id, Preset* preset
|
|||
if (wxGetApp().app_config->get("skip_ams_blacklist_check") != "true") {
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
wxString info;
|
||||
std::string filamnt_type;
|
||||
preset->get_filament_type(filamnt_type);
|
||||
|
||||
|
|
@ -1459,7 +1459,7 @@ bool CalibrationPresetPage::is_filament_in_blacklist(int tray_id, Preset* preset
|
|||
}
|
||||
|
||||
if (in_blacklist) {
|
||||
error_tips = info;
|
||||
error_tips = info.ToUTF8().data();
|
||||
if (action == "prohibition") {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ PrinterArch get_printer_arch_by_str(std::string arch_str)
|
|||
return PrinterArch::ARCH_CORE_XY;
|
||||
}
|
||||
|
||||
void check_filaments_for_vt_slot(const std::string &tag_vendor, const std::string &tag_type, int ams_id, bool &in_blacklist, std::string &ac, std::string &info)
|
||||
void check_filaments_for_vt_slot(const std::string &tag_vendor, const std::string &tag_type, int ams_id, bool &in_blacklist, std::string &ac, wxString &info)
|
||||
{
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev)
|
||||
|
|
@ -301,12 +301,12 @@ void check_filaments_for_vt_slot(const std::string &tag_vendor, const std::strin
|
|||
wxString info_str = wxString::Format(_L("TPU is not supported by %s extruder for this printer."), extruder_name);
|
||||
|
||||
ac = "prohibition";
|
||||
info = info_str.ToUTF8().data();
|
||||
info = info_str;
|
||||
in_blacklist = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool check_filaments_printable(const std::string &tag_vendor, const std::string &tag_type, const std::string& filament_id, int ams_id, bool &in_blacklist, std::string &ac, std::string &info)
|
||||
bool check_filaments_printable(const std::string &tag_vendor, const std::string &tag_type, const std::string& filament_id, int ams_id, bool &in_blacklist, std::string &ac, wxString &info)
|
||||
{
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev) {
|
||||
|
|
@ -7882,7 +7882,7 @@ void check_filaments_for_ams_slot(std::string model_id,
|
|||
std::string tag_name,
|
||||
bool& in_blacklist,
|
||||
std::string& ac,
|
||||
std::string& info)
|
||||
wxString& info)
|
||||
{
|
||||
if (tag_name.empty())
|
||||
{
|
||||
|
|
@ -7949,7 +7949,7 @@ void check_filaments_for_ams_slot(std::string model_id,
|
|||
|
||||
in_blacklist = true;
|
||||
ac = action;
|
||||
info = blacklist_prompt[description].ToStdString();
|
||||
info = blacklist_prompt[description];
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -7966,7 +7966,7 @@ void DeviceManager::check_filaments_in_blacklist(std::string model_id,
|
|||
std::string tag_name,
|
||||
bool &in_blacklist,
|
||||
std::string &ac,
|
||||
std::string &info)
|
||||
wxString &info)
|
||||
{
|
||||
if (ams_id < 0 || slot_id < 0) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1508,7 +1508,7 @@ public:
|
|||
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||
static std::vector<std::string> get_unsupport_auto_cali_filaments(std::string type_str);
|
||||
static void check_filaments_in_blacklist(std::string model_id, std::string tag_vendor, std::string tag_type, const std::string& filament_id, int ams_id, int slot_id, std::string tag_name, bool &in_blacklist, std::string &ac, std::string &info);
|
||||
static void check_filaments_in_blacklist(std::string model_id, std::string tag_vendor, std::string tag_type, const std::string& filament_id, int ams_id, int slot_id, std::string tag_name, bool &in_blacklist, std::string &ac, wxString &info);
|
||||
static boost::bimaps::bimap<std::string, std::string> get_all_model_id_with_name();
|
||||
static std::string load_gcode(std::string type_str, std::string gcode_file);
|
||||
static bool is_virtual_slot(int ams_id);
|
||||
|
|
|
|||
|
|
@ -352,7 +352,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
/*filament area*/
|
||||
/*1 extruder*/
|
||||
m_filament_panel = new StaticBox(m_scroll_area);
|
||||
m_filament_panel->SetBackgroundColour(wxColour(0xF8F8F8));
|
||||
m_filament_panel->SetBackgroundColour(wxColour("#F8F8F8"));
|
||||
m_filament_panel->SetBorderWidth(0);
|
||||
m_filament_panel->SetMinSize(wxSize(FromDIP(637), -1));
|
||||
m_filament_panel->SetMaxSize(wxSize(FromDIP(637), -1));
|
||||
|
|
@ -368,7 +368,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
m_sizer_filament_2extruder = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_filament_left_panel = new StaticBox(m_scroll_area);
|
||||
m_filament_left_panel->SetBackgroundColour(wxColour(0xF8F8F8));
|
||||
m_filament_left_panel->SetBackgroundColour(wxColour("#F8F8F8"));
|
||||
m_filament_left_panel->SetBorderWidth(0);
|
||||
m_filament_left_panel->SetMinSize(wxSize(FromDIP(315), -1));
|
||||
m_filament_left_panel->SetMaxSize(wxSize(FromDIP(315), -1));
|
||||
|
|
@ -377,7 +377,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
auto left_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto left_recommend_title1 = new Label(m_filament_left_panel, _L("Left Nozzle"));
|
||||
left_recommend_title1->SetFont(::Label::Head_13);
|
||||
left_recommend_title1->SetBackgroundColour(wxColour(0xF8F8F8));
|
||||
left_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
|
||||
left_recommend_title_sizer->Add(left_recommend_title1, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
m_sizer_ams_mapping_left = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
|
||||
|
|
@ -388,7 +388,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
|
||||
m_filament_right_panel = new StaticBox(m_scroll_area);
|
||||
m_filament_right_panel->SetBorderWidth(0);
|
||||
m_filament_right_panel->SetBackgroundColour(wxColour(0xf8f8f8));
|
||||
m_filament_right_panel->SetBackgroundColour(wxColour("#F8F8F8"));
|
||||
m_filament_right_panel->SetMinSize(wxSize(FromDIP(315), -1));
|
||||
m_filament_right_panel->SetMaxSize(wxSize(FromDIP(315), -1));
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ SelectMachineDialog::SelectMachineDialog(Plater *plater)
|
|||
auto right_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto right_recommend_title1 = new Label(m_filament_right_panel, _L("Right Nozzle"));
|
||||
right_recommend_title1->SetFont(::Label::Head_13);
|
||||
right_recommend_title1->SetBackgroundColour(wxColour(0xF8F8F8));
|
||||
right_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
|
||||
right_recommend_title_sizer->Add(right_recommend_title1, 0, wxALIGN_CENTER, 0);
|
||||
|
||||
m_sizer_ams_mapping_right = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
|
||||
|
|
@ -2044,8 +2044,7 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
|||
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
|
||||
wxString info;
|
||||
DeviceManager::check_filaments_in_blacklist(obj_->printer_type, filament_brand, filament_type, m_ams_mapping_result[i].filament_id, ams_id, slot_id, "", in_blacklist,
|
||||
action, info);
|
||||
|
||||
|
|
@ -3484,8 +3483,7 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
|||
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
|
||||
wxString info;
|
||||
DeviceManager::check_filaments_in_blacklist(obj_->printer_type, filament_brand, filament_type, m_ams_mapping_result[i].filament_id, ams_id, slot_id, "", in_blacklist,
|
||||
action, info);
|
||||
if (in_blacklist) {
|
||||
|
|
@ -5234,7 +5232,7 @@ void PrinterInfoBox::Create()
|
|||
auto printer_staticbox = new StaticBox(this);
|
||||
printer_staticbox->SetMinSize(wxSize(FromDIP(338), FromDIP(68)));
|
||||
printer_staticbox->SetMaxSize(wxSize(FromDIP(338), FromDIP(68)));
|
||||
printer_staticbox->SetBorderColor(wxColour(0xCECECE));
|
||||
printer_staticbox->SetBorderColor(wxColour("#CECECE"));
|
||||
|
||||
m_comboBox_printer = new ComboBox(printer_staticbox, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, 0, nullptr, wxCB_READONLY);
|
||||
m_comboBox_printer->SetBorderWidth(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue