ENH: refine the logic of filament map dialog

1. Always change the map and mode in plate if plate mode is not default
2. Always add pop up before slice
3. Fix the mapping issue in gcode viewer

jira: studio-9523,studio-9519,studio-9513,studio-9479

Signed-off-by: xun.zhang <xun.zhang@bambulab.com>
Change-Id: I0d7d5daf081951ea2d49e06565762ac24064e77c
(cherry picked from commit afaa48520e16b6808f05e511ac1cfe91acadc84b)
This commit is contained in:
xun.zhang
2025-01-08 21:14:10 +08:00
committed by Noisyfox
parent 522a8b63d1
commit 897a78ce9a
12 changed files with 262 additions and 160 deletions

View File

@@ -2,19 +2,19 @@
#define FILAMENT_GROUP_HOVER_HPP
#include "Widgets/PopupWindow.hpp"
#include "Widgets/CheckBox.hpp"
#include "Widgets/Label.hpp"
namespace Slic3r { namespace GUI {
bool is_pop_up_required();
FilamentMapMode get_prefered_map_mode();
class PartPlate;
class Plater;
class FilamentGroupPopup : public PopupWindow
{
public:
FilamentGroupPopup(wxWindow *parent);
void tryPopup(bool connect_status);
void tryPopup(Plater* plater,PartPlate* plate,bool skip_plate_sync);
void tryClose();
FilamentMapMode GetSelectedMode() const { return m_mode; }
@@ -27,30 +27,36 @@ private:
void OnLeaveWindow(wxMouseEvent &);
void OnEnterWindow(wxMouseEvent &);
void OnTimer(wxTimerEvent &event);
void OnRemindBtn(wxCommandEvent &event);
void Dismiss();
void Init();
void UpdateButtonStatus(int hover_idx = -1);
void DrawRoundedCorner(int radius);
private:
FilamentMapMode GetFilamentMapMode() const;
void SetFilamentMapMode(const FilamentMapMode mode);
private:
enum ButtonType { btForFlush, btForMatch, btManual, btCount };
const std::vector<FilamentMapMode> mode_list = {fmmAutoForFlush, fmmAutoForMatch, fmmManual};
FilamentMapMode m_mode;
bool m_connected{ false };
wxTimer *m_timer;
bool m_active{ false };
bool m_sync_plate{ false };
FilamentMapMode m_mode;
wxTimer *m_timer;
std::vector<wxBitmapButton *> radio_btns;
std::vector<Label *> button_labels;
std::vector<Label *> button_desps;
std::vector<Label *> detail_infos;
wxStaticText *wiki_link;
CheckBox* remind_checkbox;
PartPlate* partplate_ref{ nullptr };
Plater* plater_ref{ nullptr };
};
}} // namespace Slic3r::GUI
#endif