mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 19:01:02 +00:00
feat(gui): per-filament nozzle volume selection and persistence
- FilamentMapDialog's manual page understands volume types: a mixed (Hybrid) extruder shows separate Standard / High Flow drop zones with live sub-nozzle counts, a validation timer with an inline error + "set nozzle count" suggestion, and composes a per-filament volume map on OK (persisted to the plate or globally) - switching an extruder's Flow type rewrites the affected plate map entries; plate maps stay sized across filament add/delete/count changes (values keep their filament, no index shift) - CLI: manual mapping on multi-nozzle printers synthesizes the volume map from extruder flow types when absent; nozzle-manual mode requires explicit maps; computed maps land on the plate so exported projects carry filament_volume_maps - filament_nozzle_map joins the project options (selection seeding + filament-count resizing) - pot entries for the new dialog strings All 19 reference fixtures byte-identical; slicing an exported Hybrid project reproduces its g-code byte-for-byte with the volume map round-tripped through model_settings.config.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "GUI.hpp"
|
||||
#include "GUI_Utils.hpp"
|
||||
#include "Widgets/Label.hpp"
|
||||
|
||||
#include <wx/simplebook.h>
|
||||
#include <wx/dialog.h>
|
||||
@@ -13,17 +14,20 @@
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
wxDECLARE_EVENT(wxEVT_DRAG_DROP_COMPLETED, wxCommandEvent);
|
||||
|
||||
wxColor Hex2Color(const std::string& str);
|
||||
|
||||
class ColorPanel;
|
||||
class DragDropPanel : public wxPanel
|
||||
{
|
||||
public:
|
||||
DragDropPanel(wxWindow *parent, const wxString &label, bool is_auto);
|
||||
DragDropPanel(wxWindow *parent, const wxString &label, bool is_auto, bool has_title = true, bool is_sub = false);
|
||||
|
||||
void AddColorBlock(const wxColour &color, const std::string &type, int filament_id, bool update_ui = true);
|
||||
void RemoveColorBlock(ColorPanel *panel, bool update_ui = true);
|
||||
void DoDragDrop(ColorPanel *panel, const wxColour &color, const std::string &type, int filament_id);
|
||||
void UpdateLabel(const wxString &label);
|
||||
|
||||
std::vector<int> GetAllFilaments() const;
|
||||
|
||||
@@ -35,9 +39,12 @@ public:
|
||||
private:
|
||||
wxBoxSizer *m_sizer;
|
||||
wxGridSizer *m_grid_item_sizer;
|
||||
Label *m_title_label = nullptr;
|
||||
bool m_is_auto;
|
||||
|
||||
std::vector<ColorPanel *> m_filament_blocks;
|
||||
|
||||
void NotifyDragDropCompleted();
|
||||
private:
|
||||
bool m_is_draging = false;
|
||||
};
|
||||
@@ -64,6 +71,49 @@ private:
|
||||
int m_filament_id;
|
||||
|
||||
};
|
||||
|
||||
// Drop zone for one extruder that can split into two sub-zones (High Flow / Standard)
|
||||
// when the extruder mixes nozzle volume types (Hybrid flow), and collapses back to a
|
||||
// single unified zone otherwise.
|
||||
class SeparatedDragDropPanel : public wxPanel
|
||||
{
|
||||
public:
|
||||
SeparatedDragDropPanel(wxWindow *parent, const wxString &label, bool use_separation = false);
|
||||
|
||||
void AddColorBlock(const wxColour &color, const std::string &type, int filament_id, bool is_high_flow = false, bool update_ui = true);
|
||||
void RemoveColorBlock(ColorPanel *panel, bool update_ui = true);
|
||||
|
||||
std::vector<int> GetAllFilaments() const;
|
||||
std::vector<int> GetHighFlowFilaments() const;
|
||||
std::vector<int> GetStandardFilaments() const;
|
||||
std::vector<int> GetTPUHighFlowFilaments() const;
|
||||
|
||||
std::vector<ColorPanel *> get_filament_blocks() const;
|
||||
std::vector<ColorPanel *> get_high_flow_blocks() const;
|
||||
std::vector<ColorPanel *> get_standard_blocks() const;
|
||||
|
||||
void SetUseSeparation(bool use_separation);
|
||||
bool IsUseSeparation() const { return m_use_separation; }
|
||||
void ClearAllBlocks();
|
||||
void UpdateLabel(const wxString &label);
|
||||
|
||||
private:
|
||||
void UpdateLayout();
|
||||
|
||||
wxBoxSizer *m_main_sizer;
|
||||
wxPanel *m_content_panel;
|
||||
wxBoxSizer *m_content_sizer;
|
||||
wxPanel *m_separator = nullptr;
|
||||
Label *m_label;
|
||||
|
||||
DragDropPanel *m_high_flow_panel;
|
||||
DragDropPanel *m_standard_panel;
|
||||
|
||||
DragDropPanel *m_unified_panel;
|
||||
|
||||
bool m_use_separation;
|
||||
};
|
||||
|
||||
}} // namespace Slic3r::GUI
|
||||
|
||||
#endif /* slic3r_DragDropPanel_hpp_ */
|
||||
|
||||
Reference in New Issue
Block a user