ENH:update image for plate type
jira: none Change-Id: I590bf9d6596ccf5cd6e06844fb3ed247fa526ba6 (cherry picked from commit 6be306e548be9129d6cf1c34242910be02a70ed8)
|
Before Width: | Height: | Size: 2 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 5.7 KiB |
BIN
resources/images/bed_cool_supertack_mini.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 11 KiB |
BIN
resources/images/bed_high_templ_mini.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
resources/images/bed_high_templ_o.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 19 KiB |
BIN
resources/images/bed_pei_mini.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
resources/images/bed_pei_o.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 59 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 64 KiB |
BIN
resources/images/big_bed_cool_supertack_mini.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 121 KiB |
BIN
resources/images/big_bed_high_templ_mini.png
Normal file
|
After Width: | Height: | Size: 130 KiB |
BIN
resources/images/big_bed_high_templ_o.png
Normal file
|
After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 246 KiB |
BIN
resources/images/big_bed_pei_mini.png
Normal file
|
After Width: | Height: | Size: 227 KiB |
BIN
resources/images/big_bed_pei_o.png
Normal file
|
After Width: | Height: | Size: 172 KiB |
|
|
@ -6,6 +6,8 @@
|
|||
"bed_model": "bbl-3dp-A1M.stl",
|
||||
"bed_texture": "bbl-3dp-logo.svg",
|
||||
"default_bed_type": "Textured PEI Plate",
|
||||
"image_bed_type": "mini",
|
||||
"not_support_bed_type":"Cool Plate;Engineering Plate",
|
||||
"family": "BBL-3DP",
|
||||
"machine_tech": "FFF",
|
||||
"model_id": "N1",
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
"bed_model": "bbl-3dp-H2D.stl",
|
||||
"bed_texture": "bbl-3dp-logo.svg",
|
||||
"default_bed_type": "Textured PEI Plate",
|
||||
"image_bed_type": "o",
|
||||
"not_support_bed_type":"Cool Plate;Engineering Plate;Bambu Cool Plate SuperTack",
|
||||
"family": "BBL-3DP",
|
||||
"machine_tech": "FFF",
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@
|
|||
#define BBL_JSON_KEY_FAMILY "family"
|
||||
#define BBL_JSON_KEY_BED_MODEL "bed_model"
|
||||
#define BBL_JSON_KEY_BED_TEXTURE "bed_texture"
|
||||
#define BBL_JSON_KEY_IMAGE_BED_TYPE "image_bed_type"
|
||||
#define BBL_JSON_KEY_HOTEND_MODEL "hotend_model"
|
||||
#define BBL_JSON_KEY_DEFAULT_MATERIALS "default_materials"
|
||||
#define BBL_JSON_KEY_NOT_SUPPORT_BED_TYPE "not_support_bed_type"
|
||||
|
|
@ -118,8 +119,8 @@ public:
|
|||
// Vendor & Printer Model specific print bed model & texture.
|
||||
std::string bed_model;
|
||||
std::string bed_texture;
|
||||
std::string image_bed_type;
|
||||
std::string hotend_model;
|
||||
|
||||
PrinterVariant* variant(const std::string &name) {
|
||||
for (auto &v : this->variants)
|
||||
if (v.name == name)
|
||||
|
|
|
|||
|
|
@ -3299,6 +3299,8 @@ std::pair<PresetsConfigSubstitutions, size_t> PresetBundle::load_vendor_configs_
|
|||
else if (boost::iequals(it.key(), BBL_JSON_KEY_BED_MODEL)) {
|
||||
//get bed model
|
||||
model.bed_model = it.value();
|
||||
} else if (boost::iequals(it.key(), BBL_JSON_KEY_IMAGE_BED_TYPE)) {
|
||||
model.image_bed_type = it.value();
|
||||
}
|
||||
else if (boost::iequals(it.key(), BBL_JSON_KEY_BED_TEXTURE)) {
|
||||
//get bed texture
|
||||
|
|
|
|||
|
|
@ -20,18 +20,17 @@ namespace Slic3r { namespace GUI {
|
|||
ImageDPIFrame::ImageDPIFrame()
|
||||
: DPIFrame(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, "", wxDefaultPosition, wxDefaultSize, !wxCAPTION | !wxCLOSE_BOX | wxBORDER_NONE)
|
||||
{
|
||||
m_image_px = 260;
|
||||
m_image_px = 280;
|
||||
int width = 270;
|
||||
//SetTransparent(0);
|
||||
SetMinSize(wxSize(FromDIP(width), -1));
|
||||
SetMaxSize(wxSize(FromDIP(width), -1));
|
||||
|
||||
SetBackgroundColour(wxColour(242, 242, 242, 255));
|
||||
m_sizer_main = new wxBoxSizer(wxVERTICAL);
|
||||
auto image_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
auto imgsize = FromDIP(width);
|
||||
m_bitmap = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("printer_preview_C13", this, m_image_px), wxDefaultPosition, wxSize(imgsize, imgsize * 0.94), 0);
|
||||
image_sizer->Add(m_bitmap, 0, wxALIGN_CENTER | wxALL, FromDIP(0));
|
||||
|
||||
m_sizer_main->Add(image_sizer, FromDIP(0), wxALIGN_CENTER, FromDIP(0));
|
||||
|
||||
Bind(wxEVT_CLOSE_WINDOW, [this](auto &e) {
|
||||
|
|
|
|||
|
|
@ -1557,12 +1557,11 @@ Sidebar::Sidebar(Plater *parent)
|
|||
reset_bed_type_combox_choices();
|
||||
|
||||
p->combo_printer_bed->Bind(wxEVT_COMBOBOX, [this](auto &e) {
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[select_bed_type], this, isDual ? 48 : 32));
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, isDual ? 48 : 32));
|
||||
if (p->big_bed_image_popup) {
|
||||
p->big_bed_image_popup->set_bitmap(
|
||||
create_scaled_bitmap("big_" + bed_type_thumbnails[select_bed_type], p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
}
|
||||
e.Skip(); // fix bug:Event spreads to sidebar
|
||||
});
|
||||
|
|
@ -1573,9 +1572,8 @@ Sidebar::Sidebar(Plater *parent)
|
|||
wxPoint temp_pos(pos.x + rect.GetWidth(), pos.y);
|
||||
if (p->big_bed_image_popup == nullptr) {
|
||||
p->big_bed_image_popup = new ImageDPIFrame();
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
p->big_bed_image_popup->set_bitmap(
|
||||
create_scaled_bitmap("big_" + bed_type_thumbnails[select_bed_type], p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->big_bed_image_popup->set_bitmap(create_scaled_bitmap("big_" + image_path, p->big_bed_image_popup, p->big_bed_image_popup->get_image_px()));
|
||||
}
|
||||
p->big_bed_image_popup->SetCanFocus(false);
|
||||
p->big_bed_image_popup->SetPosition(temp_pos);
|
||||
|
|
@ -2199,15 +2197,14 @@ void Sidebar::update_presets(Preset::Type preset_type)
|
|||
|
||||
bool is_dual_extruder = nozzle_diameter->size() == 2;
|
||||
p->layout_printer(isBBL, is_dual_extruder);
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
if (is_dual_extruder) {
|
||||
AMSCountPopupWindow::UpdateAMSCount(0, p->left_extruder);
|
||||
AMSCountPopupWindow::UpdateAMSCount(1, p->right_extruder);
|
||||
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[select_bed_type], this, 48));
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 48));
|
||||
} else {
|
||||
AMSCountPopupWindow::UpdateAMSCount(0, p->single_extruder);
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[select_bed_type], this, 32));
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, 32));
|
||||
}
|
||||
|
||||
if (GUI::wxGetApp().plater())
|
||||
|
|
@ -2268,6 +2265,14 @@ BedType Sidebar::get_cur_select_bed_type() {
|
|||
return select_bed_type;
|
||||
}
|
||||
|
||||
std::string Sidebar::get_cur_select_bed_image()
|
||||
{
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
auto series_suffix_str = m_cur_image_bed_type.empty() ? "" : ("_" + m_cur_image_bed_type);
|
||||
auto image_path = bed_type_thumbnails[select_bed_type] + series_suffix_str;
|
||||
return image_path;
|
||||
}
|
||||
|
||||
void Sidebar::set_bed_type_accord_combox(BedType bed_type) {
|
||||
for (size_t i = 0; i < m_cur_combox_bed_types.size(); i++) {
|
||||
if (m_cur_combox_bed_types[i] == bed_type) {
|
||||
|
|
@ -2275,7 +2280,11 @@ void Sidebar::set_bed_type_accord_combox(BedType bed_type) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
p->combo_printer_bed->SelectAndNotify(0);
|
||||
use_default_bed_type();
|
||||
//re save preferred bed type
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
std::string bed_type_name = print_config_def.get("curr_bed_type")->enum_values[int(select_bed_type) - 1];
|
||||
save_bed_type_to_config(bed_type_name);
|
||||
}
|
||||
|
||||
bool Sidebar::reset_bed_type_combox_choices() {
|
||||
|
|
@ -2301,6 +2310,9 @@ bool Sidebar::reset_bed_type_combox_choices() {
|
|||
m_cur_combox_bed_types.clear();
|
||||
if (pm &&bed_type_def && bed_type_def->enum_keys_map) {
|
||||
int index = 0;
|
||||
if (m_cur_image_bed_type != pm->image_bed_type) {
|
||||
m_cur_image_bed_type = pm->image_bed_type;
|
||||
}
|
||||
for (auto item : bed_type_def->enum_labels) {
|
||||
index++;
|
||||
bool find = std::find(pm->not_support_bed_types.begin(), pm->not_support_bed_types.end(), item) != pm->not_support_bed_types.end();
|
||||
|
|
@ -2312,6 +2324,7 @@ bool Sidebar::reset_bed_type_combox_choices() {
|
|||
}
|
||||
}
|
||||
else {
|
||||
m_cur_image_bed_type = "";
|
||||
int index = 0;
|
||||
for (auto item : bed_type_def->enum_labels) {
|
||||
index++;
|
||||
|
|
@ -2344,9 +2357,10 @@ void Sidebar::msw_rescale()
|
|||
p->m_printer_setting->msw_rescale();
|
||||
p->btn_edit_printer->msw_rescale();
|
||||
p->image_printer->SetSize(PRINTER_THUMBNAIL_SIZE);
|
||||
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
|
||||
auto select_bed_type = get_cur_select_bed_type();
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(bed_type_thumbnails[select_bed_type], this, 48));
|
||||
bool isDual = static_cast<wxBoxSizer *>(p->panel_printer_preset->GetSizer())->GetOrientation() == wxVERTICAL;
|
||||
auto image_path = get_cur_select_bed_image();
|
||||
p->image_printer_bed->SetBitmap(create_scaled_bitmap(image_path, this, isDual ? 48 : 32));
|
||||
|
||||
p->m_filament_icon->msw_rescale();
|
||||
p->m_bpButton_add_filament->msw_rescale();
|
||||
p->m_bpButton_del_filament->msw_rescale();
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ class Sidebar : public wxPanel
|
|||
std::shared_ptr<SyncNozzleAndAmsDialog> m_sna_dialog{nullptr};
|
||||
std::shared_ptr<FinishSyncAmsDialog> m_fna_dialog{nullptr};
|
||||
std::vector<BedType> m_cur_combox_bed_types;
|
||||
std::string m_cur_image_bed_type;
|
||||
int m_last_combo_bedtype_count{0};
|
||||
bool m_begin_sync_printer_status{false};
|
||||
std::shared_ptr<SyncAmsInfoDialog> m_sync_dlg{nullptr};
|
||||
|
|
@ -160,6 +161,7 @@ public:
|
|||
//BBS
|
||||
void update_presets_from_to(Slic3r::Preset::Type preset_type, std::string from, std::string to);
|
||||
BedType get_cur_select_bed_type();
|
||||
std::string get_cur_select_bed_image();
|
||||
void set_bed_type_accord_combox(BedType bed_type);
|
||||
bool reset_bed_type_combox_choices();
|
||||
void change_top_border_for_mode_sizer(bool increase_border);
|
||||
|
|
|
|||