diff --git a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp index 596525d546..2fdce0b90c 100644 --- a/src/slic3r/GUI/BaseTransparentDPIFrame.cpp +++ b/src/slic3r/GUI/BaseTransparentDPIFrame.cpp @@ -106,6 +106,10 @@ BaseTransparentDPIFrame::BaseTransparentDPIFrame( } }); Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { + auto x = e.GetX(); + auto y = e.GetY(); + auto size = this->GetClientSize(); + if (x >= 0 && y >= 0 && x <= size.x && y <= size.y) { return; } if (m_enter_window_valid) { m_refresh_timer->Start(ANIMATION_REFRESH_INTERVAL); } diff --git a/src/slic3r/GUI/BaseTransparentDPIFrame.hpp b/src/slic3r/GUI/BaseTransparentDPIFrame.hpp index 7e37c83144..b919545bb5 100644 --- a/src/slic3r/GUI/BaseTransparentDPIFrame.hpp +++ b/src/slic3r/GUI/BaseTransparentDPIFrame.hpp @@ -48,7 +48,7 @@ protected: DisappearanceMode m_timed_disappearance_mode; float m_timer_count = 0; wxTimer * m_refresh_timer{nullptr}; - int m_disappearance_second = 1500; // unit ms: mean 5s + int m_disappearance_second = 2500; //ANIMATION_REFRESH_INTERVAL 20 unit ms: m_disappearance_second * ANIMATION_REFRESH_INTERVAL bool m_move_to_target_gradual_disappearance = false; wxPoint m_target_pos; diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index d6073f8374..150589d687 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -3161,7 +3161,8 @@ void GCodeViewer::load_shells(const Print& print, bool initialized, bool force_p const Vec3d z_offset = slicing_parameters.object_print_z_min * Vec3d::UnitZ(); for (size_t i = current_volumes_count; i < m_shells.volumes.volumes.size(); ++i) { GLVolume* v = m_shells.volumes.volumes[i]; - v->set_volume_offset(v->get_volume_offset() + z_offset); + auto offset = v->get_instance_transformation().get_matrix_no_offset().inverse() * z_offset; + v->set_volume_offset(v->get_volume_offset() + offset); } } @@ -4406,7 +4407,7 @@ void GCodeViewer::render_legend_color_arr_recommen(float window_padding) ImGui::GetWindowDrawList()->AddLine(lineStart, lineEnd, HyperColor); // click behavior if (ImGui::IsMouseHoveringRect(ImGui::GetItemRectMin(), ImGui::GetItemRectMax(), true)) { - if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { + if (ImGui::IsMouseClicked(ImGuiMouseButton_Left)) { Plater *plater = wxGetApp().plater(); wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG); evt.SetEventObject(plater); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 1208b7d957..58e6b36363 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2791,6 +2791,20 @@ void Sidebar::sync_ams_list(bool is_from_big_sync_btn) p->plater->pop_warning_and_go_to_device_page(printer_name, Plater::PrinterWarningType::NOT_CONNECTED, _L("Sync printer information")); return; } + bool exist_at_list_one_filament =false; + for (auto &cur : list) { + auto temp_config = cur.second; + auto filament_type = temp_config.opt_string("filament_type", 0u); + auto filament_color = temp_config.opt_string("filament_colour", 0u); + if (!filament_type.empty() || temp_config.opt_bool("filament_exist", 0u)) { + exist_at_list_one_filament = true; + break; + } + } + if (!exist_at_list_one_filament) { + p->plater->pop_warning_and_go_to_device_page("", Plater::PrinterWarningType::EMPTY_FILAMENT, _L("Sync printer information")); + return; + } if (!wxGetApp().plater()->is_same_printer_for_connected_and_selected()) { return; } @@ -15325,6 +15339,10 @@ void Plater::pop_warning_and_go_to_device_page(wxString printer_name, PrinterWar } else if (type == PrinterWarningType::INCONSISTENT) { content = wxString::Format(_L("The currently connected printer on the device page is not an %s. Please switch to an %s before syncing."), printer_name, printer_name); + } else if (type == PrinterWarningType::UNINSTALL_FILAMENT) { + content = _L("There are no filaments on the printer. Please load the filaments on the printer first."); + } else if (type == PrinterWarningType::EMPTY_FILAMENT) { + content = _L("The filaments on the printer are all unknown types. Please go to the printer screen or software device page to set the filament type."); } MessageDialog dlg(this, content, title, wxOK | wxFORWARD | wxICON_WARNING, _L("Device Page")); auto result = dlg.ShowModal(); diff --git a/src/slic3r/GUI/Plater.hpp b/src/slic3r/GUI/Plater.hpp index d339cac456..6d86617ee6 100644 --- a/src/slic3r/GUI/Plater.hpp +++ b/src/slic3r/GUI/Plater.hpp @@ -542,6 +542,8 @@ public: enum class PrinterWarningType { NOT_CONNECTED, INCONSISTENT, + UNINSTALL_FILAMENT, + EMPTY_FILAMENT }; void pop_warning_and_go_to_device_page(wxString printer_name, PrinterWarningType type, const wxString &title); bool check_printer_initialized(MachineObject *obj, bool only_warning = false); diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index 032b28f3bd..2d259eb43e 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -4058,6 +4058,8 @@ void SelectMachineDialog::unify_deal_thumbnail_data(ThumbnailData &input_data, T change_default_normal(-1, wxColour()); final_deal_edge_pixels_data(m_preview_thumbnail_data); set_default_normal(m_preview_thumbnail_data); + } else { + set_default_normal(input_data); } } diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index b42bbc1f7e..eca88f0371 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -405,8 +405,10 @@ void SyncAmsInfoDialog::update_map_when_change_map_mode() m_cur_colors_in_thumbnail[i] = result; } else { - //todo:give warning - m_cur_colors_in_thumbnail[i] = m_cur_colors_in_thumbnail[0]; + if (!m_cur_colors_in_thumbnail.empty()) { + // todo:give warning + m_cur_colors_in_thumbnail[i] = m_cur_colors_in_thumbnail[0]; + } } } } @@ -4293,6 +4295,9 @@ void SyncAmsInfoDialog::unify_deal_thumbnail_data(ThumbnailData &input_data, Thu final_deal_edge_pixels_data(m_preview_thumbnail_data); set_default_normal(m_preview_thumbnail_data); } + else { + set_default_normal(input_data); + } } void SyncAmsInfoDialog::change_default_normal(int old_filament_id, wxColour temp_ams_color)