diff --git a/resources/images/monitor_extruder.png b/resources/images/monitor_extruder.png deleted file mode 100644 index 9376c3d827..0000000000 Binary files a/resources/images/monitor_extruder.png and /dev/null differ diff --git a/resources/images/monitor_extruder.svg b/resources/images/monitor_extruder.svg deleted file mode 100644 index a0c52687c1..0000000000 --- a/resources/images/monitor_extruder.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/images/monitor_extruder_empty_load.png b/resources/images/monitor_extruder_empty_load.png new file mode 100644 index 0000000000..3428f33dc3 Binary files /dev/null and b/resources/images/monitor_extruder_empty_load.png differ diff --git a/resources/images/monitor_extruder_empty_unload.png b/resources/images/monitor_extruder_empty_unload.png new file mode 100644 index 0000000000..c65c49e28f Binary files /dev/null and b/resources/images/monitor_extruder_empty_unload.png differ diff --git a/resources/images/monitor_extruder_filled_load.png b/resources/images/monitor_extruder_filled_load.png new file mode 100644 index 0000000000..afac9053ce Binary files /dev/null and b/resources/images/monitor_extruder_filled_load.png differ diff --git a/resources/images/monitor_extruder_filled_unload.png b/resources/images/monitor_extruder_filled_unload.png new file mode 100644 index 0000000000..51f83a0ee0 Binary files /dev/null and b/resources/images/monitor_extruder_filled_unload.png differ diff --git a/resources/images/monitor_extruder_load.png b/resources/images/monitor_extruder_load.png deleted file mode 100644 index 27f4f3c610..0000000000 Binary files a/resources/images/monitor_extruder_load.png and /dev/null differ diff --git a/resources/images/monitor_extruder_load.svg b/resources/images/monitor_extruder_load.svg deleted file mode 100644 index 789ddc36c1..0000000000 --- a/resources/images/monitor_extruder_load.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index b1aec64ff2..ed980e4cdd 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -1443,6 +1443,7 @@ int MachineObject::command_axis_control(std::string axis, double unit, double va } else if (axis.compare("E") == 0) { sprintf(cmd, "M83 \nG0 %s%0.1f F%d\n", axis.c_str(), value * unit, speed); + extruder_axis_status = (value >= 0.0f)? LOAD : UNLOAD; } else { return -1; @@ -1634,6 +1635,7 @@ void MachineObject::reset() print_status = ""; last_mc_print_stage = -1; m_new_ver_list_exist = false; + extruder_axis_status = LOAD; subtask_ = nullptr; diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 732c20431f..6ce1ad6445 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -310,6 +310,13 @@ public: UpgradingFinished = 3 }; + enum ExtruderAxisStatus { + LOAD = 0, + UNLOAD =1, + STATUS_NUMS = 2 + }; + enum ExtruderAxisStatus extruder_axis_status = LOAD; + class ModuleVersionInfo { public: diff --git a/src/slic3r/GUI/StatusPanel.cpp b/src/slic3r/GUI/StatusPanel.cpp index 20ae76446f..7f40da2050 100644 --- a/src/slic3r/GUI/StatusPanel.cpp +++ b/src/slic3r/GUI/StatusPanel.cpp @@ -179,8 +179,10 @@ void StatusBasePanel::init_bitmaps() m_thumbnail_placeholder = ScalableBitmap(this, "monitor_placeholder", 120); m_thumbnail_sdcard = ScalableBitmap(this, "monitor_sdcard_thumbnail", 120); //m_bitmap_camera = create_scaled_bitmap("monitor_camera", nullptr, 18); - m_bitmap_extruder = *cache.load_png("monitor_extruder", FromDIP(28), FromDIP(70), false, false); - m_bitmap_extruder_load = *cache.load_png("monitor_extruder_load", FromDIP(28), FromDIP(70), false, false); + m_bitmap_extruder_empty_load = *cache.load_png("monitor_extruder_empty_load", FromDIP(28), FromDIP(70), false, false); + m_bitmap_extruder_filled_load = *cache.load_png("monitor_extruder_filled_load", FromDIP(28), FromDIP(70), false, false); + m_bitmap_extruder_empty_unload = *cache.load_png("monitor_extruder_empty_unload", FromDIP(28), FromDIP(70), false, false); + m_bitmap_extruder_filled_unload = *cache.load_png("monitor_extruder_filled_unload", FromDIP(28), FromDIP(70), false, false); m_bitmap_sdcard_state_on = create_scaled_bitmap("sdcard_state_on", nullptr, 20); m_bitmap_sdcard_state_off = create_scaled_bitmap("sdcard_state_off", nullptr, 20); } @@ -916,7 +918,7 @@ wxBoxSizer *StatusBasePanel::create_extruder_control(wxWindow *parent) bSizer_e_ctrl->Add(m_bpButton_e_10, 0, wxALIGN_CENTER_HORIZONTAL, 0); bSizer_e_ctrl->Add(0, FromDIP(7), 0, 0, 0); - m_bitmap_extruder_img = new wxStaticBitmap(panel, wxID_ANY, m_bitmap_extruder, wxDefaultPosition, wxDefaultSize, 0); + m_bitmap_extruder_img = new wxStaticBitmap(panel, wxID_ANY, m_bitmap_extruder_empty_load, wxDefaultPosition, wxDefaultSize, 0); m_bitmap_extruder_img->SetMinSize(EXTRUDER_IMAGE_SIZE); bSizer_e_ctrl->Add(m_bitmap_extruder_img, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP | wxBOTTOM, FromDIP(5)); @@ -1311,13 +1313,6 @@ void StatusPanel::update(MachineObject *obj) update_temp_ctrl(obj); update_misc_ctrl(obj); - if (obj && obj->is_filament_at_extruder()) { - m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder_load); - } - else { - m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder); - } - // BBS hide tasklist info // update_tasklist(obj); update_ams(obj); @@ -1550,6 +1545,9 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj) } } + // update extruder icon + update_extruder_status(obj); + // nozzle fan if (m_switch_nozzle_fan_timeout > 0) m_switch_nozzle_fan_timeout--; @@ -1582,6 +1580,23 @@ void StatusPanel::update_misc_ctrl(MachineObject *obj) } } +void StatusPanel::update_extruder_status(MachineObject* obj) +{ + if (!obj) return; + if (obj->is_filament_at_extruder()) { + if (obj->extruder_axis_status == MachineObject::ExtruderAxisStatus::LOAD) + m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder_filled_load); + else + m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder_filled_unload); + } + else { + if (obj->extruder_axis_status == MachineObject::ExtruderAxisStatus::LOAD) + m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder_empty_load); + else + m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder_empty_unload); + } +} + void StatusPanel::update_ams(MachineObject *obj) { // update obj in sub dlg @@ -2619,7 +2634,7 @@ void StatusPanel::msw_rescale() m_bpButton_xy->SetMinSize(AXIS_MIN_SIZE); m_bpButton_xy->SetSize(AXIS_MIN_SIZE); m_temp_extruder_line->SetSize(wxSize(FromDIP(1), -1)); - m_bitmap_extruder_img->SetBitmap(m_bitmap_extruder); + update_extruder_status(obj); m_bitmap_extruder_img->SetMinSize(EXTRUDER_IMAGE_SIZE); for (Button *btn : m_buttons) { btn->Rescale(); } diff --git a/src/slic3r/GUI/StatusPanel.hpp b/src/slic3r/GUI/StatusPanel.hpp index af182c7854..6f47d40708 100644 --- a/src/slic3r/GUI/StatusPanel.hpp +++ b/src/slic3r/GUI/StatusPanel.hpp @@ -80,8 +80,10 @@ protected: ScalableBitmap m_bitmap_fan_off; ScalableBitmap m_bitmap_use_time; ScalableBitmap m_bitmap_use_weight; - wxBitmap m_bitmap_extruder; - wxBitmap m_bitmap_extruder_load; + wxBitmap m_bitmap_extruder_empty_load; + wxBitmap m_bitmap_extruder_filled_load; + wxBitmap m_bitmap_extruder_empty_unload; + wxBitmap m_bitmap_extruder_filled_unload; CameraRecordingStatus m_state_recording{CameraRecordingStatus::RECORDING_NONE}; CameraTimelapseStatus m_state_timelapse{CameraTimelapseStatus::TIMELAPSE_NONE}; @@ -340,6 +342,7 @@ protected: void update_temp_ctrl(MachineObject *obj); void update_misc_ctrl(MachineObject *obj); void update_ams(MachineObject* obj); + void update_extruder_status(MachineObject* obj); void update_cali(MachineObject* obj); void reset_printing_values();