mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
ENH:optimize image config for different printers
jira:[STUDIO-4051] Change-Id: Ibfcbc4c571a5c47eff95891e6f9079c3432e76a9
This commit is contained in:
@@ -192,8 +192,8 @@ void AMSSetting::create()
|
||||
wxPanel* m_panel_img = new wxPanel(m_panel_body, wxID_ANY, wxDefaultPosition, wxDefaultSize);
|
||||
m_panel_img->SetBackgroundColour(AMS_SETTING_GREY200);
|
||||
wxBoxSizer *m_sizer_img = new wxBoxSizer(wxVERTICAL);
|
||||
auto img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize);
|
||||
m_sizer_img->Add(img, 0, wxALIGN_CENTER | wxTOP, 26);
|
||||
m_am_img = new wxStaticBitmap(m_panel_img, wxID_ANY, create_scaled_bitmap("ams_icon", nullptr, 126), wxDefaultPosition, wxDefaultSize);
|
||||
m_sizer_img->Add(m_am_img, 0, wxALIGN_CENTER | wxTOP, 26);
|
||||
m_sizer_img->Add(0, 0, 0, wxTOP, 18);
|
||||
m_panel_img->SetSizer(m_sizer_img);
|
||||
m_panel_img->Layout();
|
||||
@@ -262,6 +262,11 @@ void AMSSetting::update_insert_material_read_mode(bool selected)
|
||||
Fit();
|
||||
}
|
||||
|
||||
void AMSSetting::update_ams_img(std::string ams_icon_str)
|
||||
{
|
||||
m_am_img->SetBitmap(create_scaled_bitmap(ams_icon_str, nullptr, 126));
|
||||
}
|
||||
|
||||
void AMSSetting::update_starting_read_mode(bool selected)
|
||||
{
|
||||
m_checkbox_starting_auto_read->SetValue(selected);
|
||||
|
||||
@@ -27,7 +27,8 @@ public:
|
||||
~AMSSetting();
|
||||
void create();
|
||||
|
||||
void update_insert_material_read_mode(bool selected);
|
||||
void update_insert_material_read_mode(bool selected);
|
||||
void update_ams_img(std::string ams_icon_str);
|
||||
void update_starting_read_mode(bool selected);
|
||||
void update_remain_mode(bool selected);
|
||||
void update_switch_filament(bool selected);
|
||||
@@ -40,6 +41,7 @@ public:
|
||||
wxStaticText *append_text(wxString text);
|
||||
MachineObject *obj{nullptr};
|
||||
bool ams_support_remain{false};
|
||||
wxStaticBitmap* m_am_img;
|
||||
int ams_id { 0 };
|
||||
|
||||
protected:
|
||||
|
||||
@@ -117,14 +117,28 @@ void ConnectPrinterDialog::init_bitmap()
|
||||
{
|
||||
AppConfig *config = get_app_config();
|
||||
std::string language = config->get("language");
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_cn", nullptr, 190);
|
||||
|
||||
if (m_obj) {
|
||||
std::string img_str = DeviceManager::get_printer_diagram_img(m_obj->printer_type);
|
||||
if(img_str.empty()){img_str = "input_access_code_x1"; }
|
||||
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap(img_str+"_cn", nullptr, 190);
|
||||
}
|
||||
else {
|
||||
m_diagram_bmp = create_scaled_bitmap(img_str+"_en", nullptr, 190);
|
||||
}
|
||||
}
|
||||
else{
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_en", nullptr, 190);
|
||||
if (language == "zh_CN") {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_x1_cn", nullptr, 190);
|
||||
}
|
||||
else {
|
||||
m_diagram_bmp = create_scaled_bitmap("input_access_code_x1_en", nullptr, 190);
|
||||
}
|
||||
}
|
||||
m_diagram_img = m_diagram_bmp.ConvertToImage();
|
||||
m_diagram_img.Rescale(FromDIP(340), FromDIP(190));
|
||||
m_diagram_img.Rescale(FromDIP(340), FromDIP(190));
|
||||
}
|
||||
|
||||
void ConnectPrinterDialog::set_machine_object(MachineObject* obj)
|
||||
|
||||
@@ -5162,6 +5162,18 @@ std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||
{
|
||||
return get_string_from_config(type_str, "printer_thumbnail_image");
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_diagram_img(std::string type_str)
|
||||
{
|
||||
return get_string_from_config(type_str, "printer_connect_help_image");
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_ams_img(std::string type_str)
|
||||
{
|
||||
return get_string_from_config(type_str, "printer_use_ams_image");
|
||||
}
|
||||
|
||||
|
||||
bool DeviceManager::is_function_supported(std::string type_str, std::string function_name)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
||||
@@ -942,6 +942,8 @@ public:
|
||||
static std::string parse_printer_type(std::string type_str);
|
||||
static std::string get_printer_display_name(std::string type_str);
|
||||
static std::string get_printer_thumbnail_img(std::string type_str);
|
||||
static std::string get_printer_diagram_img(std::string type_str);
|
||||
static std::string get_printer_ams_img(std::string type_str);
|
||||
static PrinterArch get_printer_arch(std::string type_str);
|
||||
static std::string get_ftp_folder(std::string type_str);
|
||||
static bool is_function_supported(std::string type_str, std::string function_name);
|
||||
|
||||
@@ -1080,9 +1080,9 @@ InputIpAddressDialog::InputIpAddressDialog(wxWindow* parent)
|
||||
m_tip3->SetMinSize(wxSize(FromDIP(352), -1));
|
||||
m_tip3->SetMaxSize(wxSize(FromDIP(352), -1));
|
||||
|
||||
m_img_help1 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("input_accesscode_help1", this, 198), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(198)), 0);
|
||||
m_img_help1 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("lan_mode_help_x1", this, 198), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(198)), 0);
|
||||
|
||||
m_img_help2 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("input_accesscode_help2", this, 118), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(118)), 0);
|
||||
m_img_help2 = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("input_access_code_p1p_en", this, 118), wxDefaultPosition, wxSize(FromDIP(352), FromDIP(118)), 0);
|
||||
|
||||
m_img_help1->Hide();
|
||||
m_img_help2->Hide();
|
||||
|
||||
@@ -3130,6 +3130,7 @@ void StatusPanel::on_ams_setting_click(SimpleEvent &event)
|
||||
if (obj) {
|
||||
m_ams_setting_dlg->update_insert_material_read_mode(obj->ams_insert_flag);
|
||||
m_ams_setting_dlg->update_starting_read_mode(obj->ams_power_on_flag);
|
||||
m_ams_setting_dlg->update_ams_img(DeviceManager::get_printer_ams_img(obj->printer_type));
|
||||
std::string ams_id = m_ams_control->GetCurentShowAms();
|
||||
if (obj->amsList.size() == 0) {
|
||||
/* wxString txt = _L("AMS settings are not supported for external spool");
|
||||
|
||||
@@ -309,7 +309,7 @@ void MachineInfoPanel::init_bitmaps()
|
||||
m_img_printer = ScalableBitmap(this, "printer_thumbnail", 160);
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams", 200);
|
||||
m_img_ext = ScalableBitmap(this, "monitor_upgrade_ext", 200);
|
||||
m_img_extra_ams = ScalableBitmap(this, "monitor_upgrade_ams", 200);
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon", 160);
|
||||
upgrade_green_icon = ScalableBitmap(this, "monitor_upgrade_online", 5);
|
||||
upgrade_gray_icon = ScalableBitmap(this, "monitor_upgrade_offline", 5);
|
||||
upgrade_yellow_icon = ScalableBitmap(this, "monitor_upgrade_busy", 5);
|
||||
|
||||
Reference in New Issue
Block a user