mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
FIX:add interface line draft
jira:[STUDIO-13716][STUDIO-13717] Change-Id: Ib8a4d919ebfab85e07b80e60c80e9271013d05b9 (cherry picked from commit cf3c37abc2629165bfcdb1eee5b00567acde3c83)
This commit is contained in:
@@ -330,18 +330,22 @@ std::string MachineObject::get_printer_thumbnail_img_str() const
|
||||
std::string img_str = DevPrinterConfigUtil::get_printer_thumbnail_img(printer_type);
|
||||
std::string img_url;
|
||||
|
||||
if (!img_str.empty()) {
|
||||
img_url = Slic3r::resources_dir() + "\\printers\\image\\" + img_str;
|
||||
if (fs::exists(img_url + ".svg")) {
|
||||
if (!img_str.empty())
|
||||
{
|
||||
img_url = Slic3r::resources_dir() + "\\images\\" + img_str ;
|
||||
if (fs::exists(img_url + ".svg"))
|
||||
{
|
||||
return img_url;
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
img_url = img_str;
|
||||
}
|
||||
}
|
||||
else {
|
||||
}
|
||||
else
|
||||
{
|
||||
img_url = "printer_thumbnail";
|
||||
}
|
||||
}
|
||||
|
||||
return img_url;
|
||||
}
|
||||
@@ -4151,7 +4155,7 @@ int MachineObject::parse_json(std::string tunnel, std::string payload, bool key_
|
||||
}
|
||||
catch (...) { }
|
||||
}
|
||||
|
||||
|
||||
if (check_studio_cmd && j["upgrade"].contains("err_code")) {
|
||||
if (j["upgrade"]["err_code"].is_number()) {
|
||||
add_command_error_code_dlg(j["upgrade"]["err_code"].get<int>());
|
||||
|
||||
@@ -377,6 +377,8 @@ void MachineInfoPanel::createLaserWidgets(wxBoxSizer* main_left_sizer)
|
||||
main_left_sizer->Add(m_laser_line_above, 0, wxEXPAND | wxLEFT, FromDIP(40));
|
||||
|
||||
m_lazer_img = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize(FromDIP(200), FromDIP(200)));
|
||||
|
||||
|
||||
m_lazer_img->SetBitmap(m_img_laser.bmp());
|
||||
|
||||
wxBoxSizer* content_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
@@ -430,25 +432,29 @@ void MachineInfoPanel::msw_rescale()
|
||||
|
||||
void MachineInfoPanel::init_bitmaps()
|
||||
{
|
||||
m_img_printer = ScalableBitmap(this, "printer_thumbnail", 160);
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams", 160);
|
||||
m_img_ext = ScalableBitmap(this, "monitor_upgrade_ext", 160);
|
||||
if (wxGetApp().dark_mode()) {
|
||||
m_img_air_pump = ScalableBitmap(this, "air_pump_dark", 160);
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon_dark", 160);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
m_img_printer = ScalableBitmap(this, "printer_thumbnail_png", 160);
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams_png", 160);
|
||||
m_img_ext = ScalableBitmap(this, "monitor_upgrade_ext", 160);
|
||||
|
||||
m_img_air_pump = ScalableBitmap(this, "air_pump", 160);
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon", 160);
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon_png", 160);
|
||||
|
||||
m_img_laser = ScalableBitmap(this, "laser", 160);
|
||||
m_img_cutting = ScalableBitmap(this, "cut", 160);
|
||||
m_img_extinguish = ScalableBitmap(this, "extinguish", 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);
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "init_bitmaps failed to load resources: " << e.what();
|
||||
} catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "init_bitmaps failed to load resources: unknown error";
|
||||
}
|
||||
|
||||
m_img_laser = ScalableBitmap(this, "laser", 160);
|
||||
m_img_cutting = ScalableBitmap(this, "cut", 160);
|
||||
m_img_extinguish = ScalableBitmap(this, "extinguish", 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);
|
||||
}
|
||||
|
||||
void MachineInfoPanel::rescale_bitmaps()
|
||||
@@ -478,21 +484,25 @@ void MachineInfoPanel::update_printer_imgs(MachineObject* obj)
|
||||
{
|
||||
if (!obj) {return;}
|
||||
auto img = obj->get_printer_thumbnail_img_str();
|
||||
if (wxGetApp().dark_mode()) {
|
||||
img += "_dark";
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon_dark", 160);
|
||||
img += "_png";
|
||||
|
||||
try
|
||||
{
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon_png", 160);
|
||||
m_img_printer = ScalableBitmap(this, img, 160);
|
||||
m_printer_img->SetBitmap(m_img_printer.bmp());
|
||||
m_printer_img->Refresh();
|
||||
m_extra_ams_img->SetBitmap(m_img_extra_ams.bmp());
|
||||
m_extra_ams_img->Refresh();
|
||||
}
|
||||
else {
|
||||
m_img_extra_ams = ScalableBitmap(this, "extra_icon", 160);
|
||||
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "update_printer_imgs error : " << e.what();
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << "update_printer_imgs failed: unknown error";
|
||||
}
|
||||
|
||||
m_img_printer = ScalableBitmap(this, img, 160);
|
||||
m_printer_img->SetBitmap(m_img_printer.bmp());
|
||||
m_printer_img->Refresh();
|
||||
m_extra_ams_img->SetBitmap(m_img_extra_ams.bmp());
|
||||
m_extra_ams_img->Refresh();
|
||||
|
||||
}
|
||||
|
||||
void MachineInfoPanel::update(MachineObject* obj)
|
||||
@@ -1015,7 +1025,7 @@ void MachineInfoPanel::update_ams_ext(MachineObject *obj)
|
||||
|
||||
if (contain_four_slot) {
|
||||
if (m_img_monitor_ams.name() != "monitor_upgrade_ams") {
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams", 160);
|
||||
m_img_monitor_ams = ScalableBitmap(this, "monitor_upgrade_ams_png", 160);
|
||||
m_ams_img->SetBitmap(m_img_monitor_ams.bmp());
|
||||
}
|
||||
} else if (contain_one_slot) {
|
||||
@@ -1060,6 +1070,26 @@ void MachineInfoPanel::update_laszer(MachineObject* obj)
|
||||
if (obj && obj->laser_version_info.isValid())
|
||||
{
|
||||
m_laser_version->UpdateInfo(obj->laser_version_info);
|
||||
|
||||
std::string current_product_name = obj->laser_version_info.product_name.ToStdString();
|
||||
|
||||
if (m_last_laser_product_name != current_product_name) {
|
||||
std::string laser_image_name = "laser";
|
||||
|
||||
if (current_product_name.find("10W") != std::string::npos) {
|
||||
laser_image_name = "laser";
|
||||
} else if (current_product_name.find("40W") != std::string::npos) {
|
||||
laser_image_name = "laser_40";
|
||||
}
|
||||
|
||||
m_img_laser = ScalableBitmap(this, laser_image_name, 160);
|
||||
if (m_lazer_img) {
|
||||
m_lazer_img->SetBitmap(m_img_laser.bmp());
|
||||
m_lazer_img->Refresh();
|
||||
}
|
||||
|
||||
m_last_laser_product_name = current_product_name;
|
||||
}
|
||||
show_laszer(true);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -52,11 +52,11 @@ public:
|
||||
long style = wxTAB_TRAVERSAL,
|
||||
const wxString &name = wxEmptyString);
|
||||
~AmsPanel();
|
||||
|
||||
|
||||
void msw_rescale();
|
||||
};
|
||||
|
||||
class ExtraAmsPanel : public AmsPanel
|
||||
class ExtraAmsPanel : public AmsPanel
|
||||
{
|
||||
public:
|
||||
ExtraAmsPanel(wxWindow* parent,
|
||||
@@ -159,6 +159,8 @@ protected:
|
||||
int last_status = -1;
|
||||
std::string last_status_str = "";
|
||||
|
||||
std::string m_last_laser_product_name = "";
|
||||
|
||||
SecondaryCheckDialog* confirm_dlg = nullptr;
|
||||
|
||||
void upgrade_firmware_internal();
|
||||
|
||||
Reference in New Issue
Block a user