2018-04-20 10:58:07 +00:00
|
|
|
#ifndef slic3r_Tab_hpp_
|
|
|
|
#define slic3r_Tab_hpp_
|
|
|
|
|
2017-12-05 14:54:01 +00:00
|
|
|
// The "Expert" tab at the right of the main tabbed window.
|
|
|
|
//
|
|
|
|
// This file implements following packages:
|
|
|
|
// Slic3r::GUI::Tab;
|
|
|
|
// Slic3r::GUI::Tab::Print;
|
|
|
|
// Slic3r::GUI::Tab::Filament;
|
|
|
|
// Slic3r::GUI::Tab::Printer;
|
|
|
|
// Slic3r::GUI::Tab::Page
|
|
|
|
// - Option page: For example, the Slic3r::GUI::Tab::Print has option pages "Layers and perimeters", "Infill", "Skirt and brim" ...
|
|
|
|
// Slic3r::GUI::SavePresetWindow
|
|
|
|
// - Dialog to select a new preset name to store the configuration.
|
|
|
|
// Slic3r::GUI::Tab::Preset;
|
|
|
|
// - Single preset item: name, file is default or external.
|
|
|
|
|
|
|
|
#include <wx/panel.h>
|
|
|
|
#include <wx/notebook.h>
|
|
|
|
#include <wx/scrolwin.h>
|
|
|
|
#include <wx/sizer.h>
|
|
|
|
#include <wx/bmpcbox.h>
|
|
|
|
#include <wx/bmpbuttn.h>
|
|
|
|
#include <wx/treectrl.h>
|
|
|
|
#include <wx/imaglist.h>
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
2017-12-13 13:45:10 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2018-01-25 12:46:04 +00:00
|
|
|
#include "BedShapeDialog.hpp"
|
2019-05-09 17:24:21 +00:00
|
|
|
#include "ButtonsDescription.hpp"
|
2018-10-03 14:27:02 +00:00
|
|
|
#include "Event.hpp"
|
2019-04-13 21:46:52 +00:00
|
|
|
#include "wxExtensions.hpp"
|
2019-08-22 11:19:01 +00:00
|
|
|
#include "ConfigManipulation.hpp"
|
2017-12-05 14:54:01 +00:00
|
|
|
|
|
|
|
namespace Slic3r {
|
|
|
|
namespace GUI {
|
|
|
|
|
2019-04-13 21:46:52 +00:00
|
|
|
|
2017-12-05 14:54:01 +00:00
|
|
|
// Single Tab page containing a{ vsizer } of{ optgroups }
|
|
|
|
// package Slic3r::GUI::Tab::Page;
|
2017-12-13 13:45:10 +00:00
|
|
|
using ConfigOptionsGroupShp = std::shared_ptr<ConfigOptionsGroup>;
|
2018-01-05 14:11:33 +00:00
|
|
|
class Page : public wxScrolledWindow
|
2017-12-05 14:54:01 +00:00
|
|
|
{
|
2017-12-26 22:04:54 +00:00
|
|
|
wxWindow* m_parent;
|
|
|
|
wxString m_title;
|
|
|
|
size_t m_iconID;
|
|
|
|
wxBoxSizer* m_vsizer;
|
2018-10-21 21:09:24 +00:00
|
|
|
bool m_show = true;
|
2017-12-05 14:54:01 +00:00
|
|
|
public:
|
2019-04-24 23:45:00 +00:00
|
|
|
Page(wxWindow* parent, const wxString title, const int iconID, const std::vector<ScalableBitmap>& mode_bmp_cache) :
|
2017-12-26 22:04:54 +00:00
|
|
|
m_parent(parent),
|
|
|
|
m_title(title),
|
2019-04-13 21:46:52 +00:00
|
|
|
m_iconID(iconID),
|
|
|
|
m_mode_bitmap_cache(mode_bmp_cache)
|
2017-12-05 14:54:01 +00:00
|
|
|
{
|
2017-12-26 22:04:54 +00:00
|
|
|
Create(m_parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
|
|
|
|
m_vsizer = new wxBoxSizer(wxVERTICAL);
|
2018-10-01 13:09:31 +00:00
|
|
|
m_item_color = &wxGetApp().get_label_clr_default();
|
2017-12-26 22:04:54 +00:00
|
|
|
SetSizer(m_vsizer);
|
2017-12-05 14:54:01 +00:00
|
|
|
}
|
2018-10-31 11:56:08 +00:00
|
|
|
~Page() {}
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2018-03-22 08:37:42 +00:00
|
|
|
bool m_is_modified_values{ false };
|
|
|
|
bool m_is_nonsys_values{ true };
|
|
|
|
|
2019-03-18 11:48:39 +00:00
|
|
|
// Delayed layout after resizing the main window.
|
|
|
|
bool layout_valid = false;
|
2019-04-24 23:45:00 +00:00
|
|
|
const std::vector<ScalableBitmap>& m_mode_bitmap_cache;
|
2019-03-18 11:48:39 +00:00
|
|
|
|
2017-12-13 13:45:10 +00:00
|
|
|
public:
|
2018-02-07 16:13:52 +00:00
|
|
|
std::vector <ConfigOptionsGroupShp> m_optgroups;
|
2017-12-26 22:04:54 +00:00
|
|
|
DynamicPrintConfig* m_config;
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2017-12-26 22:04:54 +00:00
|
|
|
wxBoxSizer* vsizer() const { return m_vsizer; }
|
|
|
|
wxWindow* parent() const { return m_parent; }
|
|
|
|
wxString title() const { return m_title; }
|
|
|
|
size_t iconID() const { return m_iconID; }
|
|
|
|
void set_config(DynamicPrintConfig* config_in) { m_config = config_in; }
|
2018-01-11 09:33:17 +00:00
|
|
|
void reload_config();
|
2018-10-19 11:55:29 +00:00
|
|
|
void update_visibility(ConfigOptionMode mode);
|
2019-04-24 23:45:00 +00:00
|
|
|
void msw_rescale();
|
2018-04-13 10:35:04 +00:00
|
|
|
Field* get_field(const t_config_option_key& opt_key, int opt_index = -1) const;
|
|
|
|
bool set_value(const t_config_option_key& opt_key, const boost::any& value);
|
|
|
|
ConfigOptionsGroupShp new_optgroup(const wxString& title, int noncommon_label_width = -1);
|
2018-04-18 11:32:21 +00:00
|
|
|
|
|
|
|
bool set_item_colour(const wxColour *clr) {
|
|
|
|
if (m_item_color != clr) {
|
|
|
|
m_item_color = clr;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
const wxColour get_item_colour() {
|
|
|
|
return *m_item_color;
|
|
|
|
}
|
2018-10-21 21:09:24 +00:00
|
|
|
bool get_show() const { return m_show; }
|
2018-04-18 11:32:21 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// Color of TreeCtrlItem. The wxColour will be updated only if the new wxColour pointer differs from the currently rendered one.
|
|
|
|
const wxColour* m_item_color;
|
2017-12-05 14:54:01 +00:00
|
|
|
};
|
|
|
|
|
2018-10-03 14:27:02 +00:00
|
|
|
|
|
|
|
wxDECLARE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent);
|
|
|
|
wxDECLARE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent);
|
|
|
|
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2018-01-05 14:11:33 +00:00
|
|
|
using PageShp = std::shared_ptr<Page>;
|
|
|
|
class Tab: public wxPanel
|
2017-12-05 14:54:01 +00:00
|
|
|
{
|
2017-12-26 22:04:54 +00:00
|
|
|
wxNotebook* m_parent;
|
2018-06-28 16:30:22 +00:00
|
|
|
#ifdef __WXOSX__
|
|
|
|
wxPanel* m_tmp_panel;
|
|
|
|
int m_size_move = -1;
|
|
|
|
#endif // __WXOSX__
|
2017-12-05 14:54:01 +00:00
|
|
|
protected:
|
2018-10-09 10:41:05 +00:00
|
|
|
Preset::Type m_type;
|
2018-01-25 20:44:22 +00:00
|
|
|
std::string m_name;
|
2017-12-26 22:04:54 +00:00
|
|
|
const wxString m_title;
|
2020-01-31 15:50:11 +00:00
|
|
|
PresetBitmapComboBox* m_presets_choice;
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableButton* m_btn_save_preset;
|
|
|
|
ScalableButton* m_btn_delete_preset;
|
|
|
|
ScalableButton* m_btn_hide_incompatible_presets;
|
2017-12-26 22:04:54 +00:00
|
|
|
wxBoxSizer* m_hsizer;
|
|
|
|
wxBoxSizer* m_left_sizer;
|
|
|
|
wxTreeCtrl* m_treectrl;
|
|
|
|
wxImageList* m_icons;
|
2018-12-04 16:56:49 +00:00
|
|
|
|
2019-04-24 23:45:00 +00:00
|
|
|
ModeSizer* m_mode_sizer;
|
2019-01-10 10:05:58 +00:00
|
|
|
|
2018-12-04 16:56:49 +00:00
|
|
|
struct PresetDependencies {
|
|
|
|
Preset::Type type = Preset::TYPE_INVALID;
|
|
|
|
wxCheckBox *checkbox = nullptr;
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableButton *btn = nullptr;
|
2018-12-04 16:56:49 +00:00
|
|
|
std::string key_list; // "compatible_printers"
|
|
|
|
std::string key_condition;
|
|
|
|
std::string dialog_title;
|
|
|
|
std::string dialog_label;
|
|
|
|
};
|
|
|
|
PresetDependencies m_compatible_printers;
|
|
|
|
PresetDependencies m_compatible_prints;
|
|
|
|
|
2019-07-01 12:56:28 +00:00
|
|
|
/* Indicates, that default preset or preset inherited from default is selected
|
|
|
|
* This value is used for a options color updating
|
|
|
|
* (use green color only for options, which values are equal to system values)
|
|
|
|
*/
|
|
|
|
bool m_is_default_preset {false};
|
|
|
|
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableButton* m_undo_btn;
|
|
|
|
ScalableButton* m_undo_to_sys_btn;
|
|
|
|
ScalableButton* m_question_btn;
|
2017-12-26 22:04:54 +00:00
|
|
|
|
2018-04-16 09:03:08 +00:00
|
|
|
// Cached bitmaps.
|
|
|
|
// A "flag" icon to be displayned next to the preset name in the Tab's combo box.
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableBitmap m_bmp_show_incompatible_presets;
|
|
|
|
ScalableBitmap m_bmp_hide_incompatible_presets;
|
2018-04-16 09:03:08 +00:00
|
|
|
// Bitmaps to be shown on the "Revert to system" aka "Lock to system" button next to each input field.
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableBitmap m_bmp_value_lock;
|
|
|
|
ScalableBitmap m_bmp_value_unlock;
|
|
|
|
ScalableBitmap m_bmp_white_bullet;
|
2018-04-16 09:03:08 +00:00
|
|
|
// The following bitmap points to either m_bmp_value_unlock or m_bmp_white_bullet, depending on whether the current preset has a parent preset.
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableBitmap *m_bmp_non_system;
|
2018-04-16 09:03:08 +00:00
|
|
|
// Bitmaps to be shown on the "Undo user changes" button next to each input field.
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableBitmap m_bmp_value_revert;
|
2019-04-13 21:46:52 +00:00
|
|
|
|
2019-04-24 23:45:00 +00:00
|
|
|
std::vector<ScalableButton*> m_scaled_buttons = {};
|
|
|
|
std::vector<ScalableBitmap*> m_scaled_bitmaps = {};
|
|
|
|
std::vector<ScalableBitmap> m_scaled_icons_list = {};
|
|
|
|
std::vector<ScalableBitmap> m_mode_bitmap_cache = {};
|
2018-04-16 09:03:08 +00:00
|
|
|
|
2018-04-17 08:15:48 +00:00
|
|
|
// Colors for ui "decoration"
|
|
|
|
wxColour m_sys_label_clr;
|
|
|
|
wxColour m_modified_label_clr;
|
|
|
|
wxColour m_default_text_clr;
|
|
|
|
|
2018-04-24 12:11:23 +00:00
|
|
|
// Tooltip text for reset buttons (for whole options group)
|
|
|
|
wxString m_ttg_value_lock;
|
|
|
|
wxString m_ttg_value_unlock;
|
|
|
|
wxString m_ttg_white_bullet_ns;
|
|
|
|
// The following text points to either m_ttg_value_unlock or m_ttg_white_bullet_ns, depending on whether the current preset has a parent preset.
|
|
|
|
wxString *m_ttg_non_system;
|
|
|
|
// Tooltip text to be shown on the "Undo user changes" button next to each input field.
|
|
|
|
wxString m_ttg_white_bullet;
|
|
|
|
wxString m_ttg_value_revert;
|
|
|
|
|
|
|
|
// Tooltip text for reset buttons (for each option in group)
|
2018-04-24 10:12:15 +00:00
|
|
|
wxString m_tt_value_lock;
|
|
|
|
wxString m_tt_value_unlock;
|
2018-04-24 12:11:23 +00:00
|
|
|
// The following text points to either m_tt_value_unlock or m_ttg_white_bullet_ns, depending on whether the current preset has a parent preset.
|
2018-04-24 10:12:15 +00:00
|
|
|
wxString *m_tt_non_system;
|
2018-04-24 12:11:23 +00:00
|
|
|
// Tooltip text to be shown on the "Undo user changes" button next to each input field.
|
2018-04-24 10:12:15 +00:00
|
|
|
wxString m_tt_white_bullet;
|
|
|
|
wxString m_tt_value_revert;
|
|
|
|
|
2017-12-26 22:04:54 +00:00
|
|
|
int m_icon_count;
|
2018-03-21 21:21:37 +00:00
|
|
|
std::map<std::string, size_t> m_icon_index; // Map from an icon file name to its index
|
|
|
|
std::vector<PageShp> m_pages;
|
2017-12-26 22:04:54 +00:00
|
|
|
bool m_disable_tree_sel_changed_event;
|
2018-01-16 15:28:01 +00:00
|
|
|
bool m_show_incompatible_presets;
|
|
|
|
|
2020-03-06 16:41:00 +00:00
|
|
|
std::vector<Preset::Type> m_dependent_tabs;
|
2018-04-18 11:32:21 +00:00
|
|
|
enum OptStatus { osSystemValue = 1, osInitValue = 2 };
|
|
|
|
std::map<std::string, int> m_options_list;
|
2018-06-28 18:13:01 +00:00
|
|
|
int m_opt_status_value = 0;
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2019-05-09 17:24:21 +00:00
|
|
|
std::vector<ButtonsDescription::Entry> m_icon_descriptions = {};
|
2018-04-20 10:58:07 +00:00
|
|
|
|
2018-03-22 08:37:42 +00:00
|
|
|
bool m_is_modified_values{ false };
|
|
|
|
bool m_is_nonsys_values{ true };
|
2018-04-16 11:43:01 +00:00
|
|
|
bool m_postpone_update_ui {false};
|
2018-03-22 08:37:42 +00:00
|
|
|
|
2018-04-19 10:08:59 +00:00
|
|
|
size_t m_selected_preset_item{ 0 };
|
|
|
|
|
2018-11-16 10:14:56 +00:00
|
|
|
void set_type();
|
2018-10-09 10:41:05 +00:00
|
|
|
|
2019-02-04 11:07:15 +00:00
|
|
|
int m_em_unit;
|
2019-03-07 15:36:39 +00:00
|
|
|
// To avoid actions with no-completed Tab
|
Various changes in handling of profile compatiblilities
and the "show incompatible profiles" option.
It was not able to select the incompatible Print profile, which is
possible now.
(see Cannot select incompatible printer profile #3715)
When the Printer profile derived from the Prusa3D system profile was
active or a system Prusa3D profile was active, and when the Print profile
with the removed "inherits" field was active (or any other profile
derived from the "-- default --" profile was active), then the filament
selector offered just the profiles with the removed "inherits" field
(or any other profile derived from the "-- default--") profile.
This behavior has been now changed, so that in this scenario the Filament selector
will offer the Prusa3D vendor profiles compatible with the active Print
and Printer profile as well as the user profiles.
Slicer was also changed to keep an incompatible preset selected
at its respective tab if its respective "Red flag" is enabled.
For example, if an incompatible Print preset is selected and a Printer
profile is switched to another one which is not compatible with the active
Print preset that was red already, the active Print preset is
not switched if the Print "Red flag" is active. However, if the Print profile
was compatible before the Printer profile is switched and now the Print
profile becomes incompatible, another compatible Print profile is selected.
A likely bug in wxWidgets was worked around when switching a Print preset
on Plater, if the last item in the Print preset was active and incompatible,
and another Print preset was selected by the user. On Windows, an CBN_EDITCHANGE
is sent just after combo box selection change event and the CBN_EDITCHANGE
holds an index of the combo box item, which will be removed by the 1st event,
therefore leading to an assert in wxWidgets on CBN_EDITCHANGE. The workaround
is to disable processing of CBN_EDITCHANGE on Windows for the Plater
preset selection combo boxes.
2020-02-27 10:44:01 +00:00
|
|
|
bool m_completed { false };
|
2019-08-14 15:05:26 +00:00
|
|
|
ConfigOptionMode m_mode = comExpert; // to correct first Tab update_visibility() set mode to Expert
|
2019-02-20 15:09:18 +00:00
|
|
|
|
2017-12-13 13:45:10 +00:00
|
|
|
public:
|
2017-12-26 22:04:54 +00:00
|
|
|
PresetBundle* m_preset_bundle;
|
2018-02-27 08:51:14 +00:00
|
|
|
bool m_show_btn_incompatible_presets = false;
|
2018-01-05 14:11:33 +00:00
|
|
|
PresetCollection* m_presets;
|
2018-01-12 16:16:59 +00:00
|
|
|
DynamicPrintConfig* m_config;
|
2018-03-22 10:46:15 +00:00
|
|
|
ogStaticText* m_parent_preset_description_line;
|
2020-03-04 12:47:35 +00:00
|
|
|
ScalableButton* m_detach_preset_btn = nullptr;
|
2020-03-04 19:58:14 +00:00
|
|
|
|
|
|
|
// map of option name -> wxStaticText (colored label, associated with option)
|
|
|
|
// Used for options which don't have corresponded field
|
|
|
|
std::map<std::string, wxStaticText*> m_colored_Labels;
|
|
|
|
|
2019-02-22 08:38:56 +00:00
|
|
|
// Counter for the updating (because of an update() function can have a recursive behavior):
|
|
|
|
// 1. increase value from the very beginning of an update() function
|
|
|
|
// 2. decrease value at the end of an update() function
|
2019-12-03 03:48:01 +00:00
|
|
|
// 3. propagate changed configuration to the Plater when (m_update_cnt == 0) only
|
2019-02-22 08:38:56 +00:00
|
|
|
int m_update_cnt = 0;
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2017-12-05 14:54:01 +00:00
|
|
|
public:
|
2019-05-10 13:10:17 +00:00
|
|
|
// Tab(wxNotebook* parent, const wxString& title, const char* name);
|
|
|
|
Tab(wxNotebook* parent, const wxString& title, Preset::Type type);
|
|
|
|
~Tab() {}
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2017-12-26 22:04:54 +00:00
|
|
|
wxWindow* parent() const { return m_parent; }
|
|
|
|
wxString title() const { return m_title; }
|
2019-05-10 13:10:17 +00:00
|
|
|
// std::string name() const { return m_name; }
|
|
|
|
std::string name() const { return m_presets->name(); }
|
2018-10-09 10:41:05 +00:00
|
|
|
Preset::Type type() const { return m_type; }
|
Various changes in handling of profile compatiblilities
and the "show incompatible profiles" option.
It was not able to select the incompatible Print profile, which is
possible now.
(see Cannot select incompatible printer profile #3715)
When the Printer profile derived from the Prusa3D system profile was
active or a system Prusa3D profile was active, and when the Print profile
with the removed "inherits" field was active (or any other profile
derived from the "-- default --" profile was active), then the filament
selector offered just the profiles with the removed "inherits" field
(or any other profile derived from the "-- default--") profile.
This behavior has been now changed, so that in this scenario the Filament selector
will offer the Prusa3D vendor profiles compatible with the active Print
and Printer profile as well as the user profiles.
Slicer was also changed to keep an incompatible preset selected
at its respective tab if its respective "Red flag" is enabled.
For example, if an incompatible Print preset is selected and a Printer
profile is switched to another one which is not compatible with the active
Print preset that was red already, the active Print preset is
not switched if the Print "Red flag" is active. However, if the Print profile
was compatible before the Printer profile is switched and now the Print
profile becomes incompatible, another compatible Print profile is selected.
A likely bug in wxWidgets was worked around when switching a Print preset
on Plater, if the last item in the Print preset was active and incompatible,
and another Print preset was selected by the user. On Windows, an CBN_EDITCHANGE
is sent just after combo box selection change event and the CBN_EDITCHANGE
holds an index of the combo box item, which will be removed by the 1st event,
therefore leading to an assert in wxWidgets on CBN_EDITCHANGE. The workaround
is to disable processing of CBN_EDITCHANGE on Windows for the Plater
preset selection combo boxes.
2020-02-27 10:44:01 +00:00
|
|
|
// The tab is already constructed.
|
|
|
|
bool completed() const { return m_completed; }
|
2018-10-31 15:22:36 +00:00
|
|
|
virtual bool supports_printer_technology(const PrinterTechnology tech) = 0;
|
2018-01-21 22:35:00 +00:00
|
|
|
|
2018-10-04 14:43:10 +00:00
|
|
|
void create_preset_tab();
|
2019-04-24 23:45:00 +00:00
|
|
|
void add_scaled_button(wxWindow* parent, ScalableButton** btn, const std::string& icon_name,
|
2019-04-13 21:46:52 +00:00
|
|
|
const wxString& label = wxEmptyString,
|
|
|
|
long style = wxBU_EXACTFIT | wxNO_BORDER);
|
2019-04-24 23:45:00 +00:00
|
|
|
void add_scaled_bitmap(wxWindow* parent, ScalableBitmap& btn, const std::string& icon_name);
|
2020-03-04 12:47:35 +00:00
|
|
|
void update_ui_items_related_on_parent_preset(const Preset* selected_preset_parent);
|
2019-04-13 21:46:52 +00:00
|
|
|
void load_current_preset();
|
2019-03-20 15:22:01 +00:00
|
|
|
void rebuild_page_tree();
|
2018-10-21 21:09:24 +00:00
|
|
|
void update_page_tree_visibility();
|
2019-03-22 11:11:23 +00:00
|
|
|
// Select a new preset, possibly delete the current one.
|
|
|
|
void select_preset(std::string preset_name = "", bool delete_current = false);
|
2018-04-13 10:35:04 +00:00
|
|
|
bool may_discard_current_dirty_preset(PresetCollection* presets = nullptr, const std::string& new_printer_name = "");
|
2018-11-29 11:33:04 +00:00
|
|
|
bool may_switch_to_SLA_preset();
|
2017-12-19 10:59:42 +00:00
|
|
|
|
2017-12-13 13:45:10 +00:00
|
|
|
void OnTreeSelChange(wxTreeEvent& event);
|
|
|
|
void OnKeyDown(wxKeyEvent& event);
|
2018-02-01 09:01:05 +00:00
|
|
|
|
2020-03-06 16:41:00 +00:00
|
|
|
void save_preset(std::string name = std::string(), bool detach = false);
|
2018-01-18 10:45:25 +00:00
|
|
|
void delete_preset();
|
|
|
|
void toggle_show_hide_incompatible();
|
2018-01-16 15:28:01 +00:00
|
|
|
void update_show_hide_incompatible_button();
|
|
|
|
void update_ui_from_settings();
|
2018-04-30 12:20:33 +00:00
|
|
|
void update_labels_colour();
|
2018-03-09 07:34:32 +00:00
|
|
|
void update_changed_ui();
|
2018-04-13 16:22:06 +00:00
|
|
|
void get_sys_and_mod_flags(const std::string& opt_key, bool& sys_page, bool& modified_page);
|
2018-03-21 21:21:37 +00:00
|
|
|
void update_changed_tree_ui();
|
2018-03-22 08:37:42 +00:00
|
|
|
void update_undo_buttons();
|
2018-03-21 21:21:37 +00:00
|
|
|
|
2018-04-18 11:32:21 +00:00
|
|
|
void on_roll_back_value(const bool to_sys = false);
|
2018-03-22 09:56:57 +00:00
|
|
|
|
2018-04-13 10:35:04 +00:00
|
|
|
PageShp add_options_page(const wxString& title, const std::string& icon, bool is_extruder_pages = false);
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2018-06-27 07:07:04 +00:00
|
|
|
virtual void OnActivate();
|
2018-10-31 11:56:08 +00:00
|
|
|
virtual void on_preset_loaded() {}
|
2018-01-03 09:12:42 +00:00
|
|
|
virtual void build() = 0;
|
|
|
|
virtual void update() = 0;
|
2018-04-18 11:32:21 +00:00
|
|
|
virtual void init_options_list();
|
2018-03-16 11:56:03 +00:00
|
|
|
void load_initial_data();
|
2018-01-05 14:11:33 +00:00
|
|
|
void update_dirty();
|
2018-01-16 15:28:01 +00:00
|
|
|
void update_tab_ui();
|
2018-04-13 10:35:04 +00:00
|
|
|
void load_config(const DynamicPrintConfig& config);
|
2018-01-12 11:41:13 +00:00
|
|
|
virtual void reload_config();
|
2019-03-20 15:22:01 +00:00
|
|
|
void update_mode();
|
2018-12-21 08:19:00 +00:00
|
|
|
void update_visibility();
|
2020-02-12 11:08:43 +00:00
|
|
|
virtual void msw_rescale();
|
2018-04-13 10:35:04 +00:00
|
|
|
Field* get_field(const t_config_option_key& opt_key, int opt_index = -1) const;
|
|
|
|
bool set_value(const t_config_option_key& opt_key, const boost::any& value);
|
2018-01-15 11:13:05 +00:00
|
|
|
wxSizer* description_line_widget(wxWindow* parent, ogStaticText** StaticText);
|
2018-01-25 12:46:04 +00:00
|
|
|
bool current_preset_is_dirty();
|
2018-04-20 15:32:08 +00:00
|
|
|
|
2018-01-25 12:46:04 +00:00
|
|
|
DynamicPrintConfig* get_config() { return m_config; }
|
2018-04-20 15:32:08 +00:00
|
|
|
PresetCollection* get_presets() { return m_presets; }
|
|
|
|
size_t get_selected_preset_item() { return m_selected_preset_item; }
|
2018-01-21 22:35:00 +00:00
|
|
|
|
2018-04-13 10:35:04 +00:00
|
|
|
void on_value_change(const std::string& opt_key, const boost::any& value);
|
2018-01-21 22:35:00 +00:00
|
|
|
|
2018-05-17 12:07:50 +00:00
|
|
|
void update_wiping_button_visibility();
|
2018-12-04 16:56:49 +00:00
|
|
|
|
2018-01-21 22:35:00 +00:00
|
|
|
protected:
|
2020-03-04 19:58:14 +00:00
|
|
|
void create_line_with_widget(ConfigOptionsGroup* optgroup, const std::string& opt_key, widget_t widget);
|
2018-12-04 16:56:49 +00:00
|
|
|
wxSizer* compatible_widget_create(wxWindow* parent, PresetDependencies &deps);
|
|
|
|
void compatible_widget_reload(PresetDependencies &deps);
|
|
|
|
void load_key_value(const std::string& opt_key, const boost::any& value, bool saved_value = false);
|
|
|
|
|
2018-01-21 22:35:00 +00:00
|
|
|
void on_presets_changed();
|
2020-03-04 12:47:35 +00:00
|
|
|
void build_preset_description_line(ConfigOptionsGroup* optgroup);
|
2018-04-26 10:40:17 +00:00
|
|
|
void update_preset_description_line();
|
2018-03-13 15:14:36 +00:00
|
|
|
void update_frequently_changed_parameters();
|
2018-04-20 10:58:07 +00:00
|
|
|
void fill_icon_descriptions();
|
2018-04-24 12:11:23 +00:00
|
|
|
void set_tooltips_text();
|
2019-08-22 11:19:01 +00:00
|
|
|
|
|
|
|
ConfigManipulation m_config_manipulation;
|
|
|
|
ConfigManipulation get_config_manipulation();
|
2017-12-05 14:54:01 +00:00
|
|
|
};
|
|
|
|
|
2018-01-05 14:11:33 +00:00
|
|
|
class TabPrint : public Tab
|
2017-12-05 14:54:01 +00:00
|
|
|
{
|
|
|
|
public:
|
2018-09-17 10:01:02 +00:00
|
|
|
TabPrint(wxNotebook* parent) :
|
2019-05-10 13:10:17 +00:00
|
|
|
// Tab(parent, _(L("Print Settings")), L("print")) {}
|
|
|
|
Tab(parent, _(L("Print Settings")), Slic3r::Preset::TYPE_PRINT) {}
|
2018-10-31 11:56:08 +00:00
|
|
|
~TabPrint() {}
|
2017-12-13 13:45:10 +00:00
|
|
|
|
2020-02-05 15:53:26 +00:00
|
|
|
ogStaticText* m_recommended_thin_wall_thickness_description_line = nullptr;
|
|
|
|
ogStaticText* m_top_bottom_shell_thickness_explanation = nullptr;
|
|
|
|
bool m_support_material_overhangs_queried = false;
|
2018-01-11 09:33:17 +00:00
|
|
|
|
2018-01-03 09:12:42 +00:00
|
|
|
void build() override;
|
2018-01-12 11:41:13 +00:00
|
|
|
void reload_config() override;
|
2018-01-05 14:11:33 +00:00
|
|
|
void update() override;
|
2018-01-16 15:28:01 +00:00
|
|
|
void OnActivate() override;
|
2018-10-31 15:22:36 +00:00
|
|
|
bool supports_printer_technology(const PrinterTechnology tech) override { return tech == ptFFF; }
|
2017-12-05 14:54:01 +00:00
|
|
|
};
|
2020-02-05 15:53:26 +00:00
|
|
|
|
2018-01-05 14:11:33 +00:00
|
|
|
class TabFilament : public Tab
|
2017-12-22 10:50:28 +00:00
|
|
|
{
|
2018-01-15 11:13:05 +00:00
|
|
|
ogStaticText* m_volumetric_speed_description_line;
|
|
|
|
ogStaticText* m_cooling_description_line;
|
2019-07-03 12:52:39 +00:00
|
|
|
|
2019-07-28 20:00:39 +00:00
|
|
|
void add_filament_overrides_page();
|
|
|
|
void update_filament_overrides_page();
|
2019-08-06 13:11:46 +00:00
|
|
|
void update_volumetric_flow_preset_hints();
|
2019-07-28 20:00:39 +00:00
|
|
|
|
|
|
|
std::map<std::string, wxCheckBox*> m_overrides_options;
|
2017-12-22 10:50:28 +00:00
|
|
|
public:
|
2018-09-17 10:01:02 +00:00
|
|
|
TabFilament(wxNotebook* parent) :
|
2019-05-10 13:10:17 +00:00
|
|
|
// Tab(parent, _(L("Filament Settings")), L("filament")) {}
|
|
|
|
Tab(parent, _(L("Filament Settings")), Slic3r::Preset::TYPE_FILAMENT) {}
|
2018-10-31 11:56:08 +00:00
|
|
|
~TabFilament() {}
|
2017-12-22 10:50:28 +00:00
|
|
|
|
2018-01-03 09:12:42 +00:00
|
|
|
void build() override;
|
2018-01-12 11:41:13 +00:00
|
|
|
void reload_config() override;
|
|
|
|
void update() override;
|
|
|
|
void OnActivate() override;
|
2018-10-31 15:22:36 +00:00
|
|
|
bool supports_printer_technology(const PrinterTechnology tech) override { return tech == ptFFF; }
|
2017-12-22 10:50:28 +00:00
|
|
|
};
|
|
|
|
|
2018-01-05 14:11:33 +00:00
|
|
|
class TabPrinter : public Tab
|
2017-12-22 10:50:28 +00:00
|
|
|
{
|
2018-05-21 12:36:09 +00:00
|
|
|
bool m_has_single_extruder_MM_page = false;
|
2018-06-22 11:01:41 +00:00
|
|
|
bool m_use_silent_mode = false;
|
|
|
|
void append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key);
|
2018-06-25 14:03:43 +00:00
|
|
|
bool m_rebuild_kinematics_page = false;
|
2018-08-03 12:34:52 +00:00
|
|
|
|
2018-08-07 09:58:27 +00:00
|
|
|
std::vector<PageShp> m_pages_fff;
|
|
|
|
std::vector<PageShp> m_pages_sla;
|
2018-12-18 13:34:16 +00:00
|
|
|
|
|
|
|
void build_printhost(ConfigOptionsGroup *optgroup);
|
2017-12-22 10:50:28 +00:00
|
|
|
public:
|
2018-10-31 15:22:36 +00:00
|
|
|
wxButton* m_serial_test_btn = nullptr;
|
2019-04-24 23:45:00 +00:00
|
|
|
ScalableButton* m_print_host_test_btn = nullptr;
|
|
|
|
ScalableButton* m_printhost_browse_btn = nullptr;
|
2019-08-13 07:37:44 +00:00
|
|
|
ScalableButton* m_reset_to_filament_color = nullptr;
|
2018-01-02 11:50:27 +00:00
|
|
|
|
|
|
|
size_t m_extruders_count;
|
2018-04-18 11:32:21 +00:00
|
|
|
size_t m_extruders_count_old = 0;
|
2018-03-07 14:05:41 +00:00
|
|
|
size_t m_initial_extruders_count;
|
2018-03-19 16:21:37 +00:00
|
|
|
size_t m_sys_extruders_count;
|
2018-01-02 11:50:27 +00:00
|
|
|
|
2018-08-07 09:58:27 +00:00
|
|
|
PrinterTechnology m_printer_technology = ptFFF;
|
2018-08-03 12:34:52 +00:00
|
|
|
|
2019-05-10 13:10:17 +00:00
|
|
|
// TabPrinter(wxNotebook* parent) : Tab(parent, _(L("Printer Settings")), L("printer")) {}
|
|
|
|
TabPrinter(wxNotebook* parent) :
|
|
|
|
Tab(parent, _(L("Printer Settings")), Slic3r::Preset::TYPE_PRINTER) {}
|
2018-10-31 11:56:08 +00:00
|
|
|
~TabPrinter() {}
|
2017-12-22 10:50:28 +00:00
|
|
|
|
2018-01-03 09:12:42 +00:00
|
|
|
void build() override;
|
2018-08-07 09:58:27 +00:00
|
|
|
void build_fff();
|
|
|
|
void build_sla();
|
2018-08-03 12:34:52 +00:00
|
|
|
void update() override;
|
2018-08-07 09:58:27 +00:00
|
|
|
void update_fff();
|
|
|
|
void update_sla();
|
|
|
|
void update_pages(); // update m_pages according to printer technology
|
2018-01-12 16:16:59 +00:00
|
|
|
void update_serial_ports();
|
|
|
|
void extruders_count_changed(size_t extruders_count);
|
2018-06-22 14:13:34 +00:00
|
|
|
PageShp build_kinematics_page();
|
2019-04-21 21:12:39 +00:00
|
|
|
void build_unregular_pages();
|
2018-01-16 15:28:01 +00:00
|
|
|
void on_preset_loaded() override;
|
2018-04-18 11:32:21 +00:00
|
|
|
void init_options_list() override;
|
2020-02-12 11:08:43 +00:00
|
|
|
void msw_rescale() override;
|
2018-10-31 15:22:36 +00:00
|
|
|
bool supports_printer_technology(const PrinterTechnology /* tech */) override { return true; }
|
2020-03-04 19:58:14 +00:00
|
|
|
|
|
|
|
wxSizer* create_bed_shape_widget(wxWindow* parent);
|
2017-12-22 10:50:28 +00:00
|
|
|
};
|
|
|
|
|
2018-08-03 11:04:41 +00:00
|
|
|
class TabSLAMaterial : public Tab
|
|
|
|
{
|
|
|
|
public:
|
2018-09-17 10:01:02 +00:00
|
|
|
TabSLAMaterial(wxNotebook* parent) :
|
2019-05-10 13:10:17 +00:00
|
|
|
// Tab(parent, _(L("Material Settings")), L("sla_material")) {}
|
|
|
|
Tab(parent, _(L("Material Settings")), Slic3r::Preset::TYPE_SLA_MATERIAL) {}
|
2018-10-31 11:56:08 +00:00
|
|
|
~TabSLAMaterial() {}
|
2018-08-03 11:04:41 +00:00
|
|
|
|
|
|
|
void build() override;
|
2018-12-04 16:56:49 +00:00
|
|
|
void reload_config() override;
|
2018-08-03 11:04:41 +00:00
|
|
|
void update() override;
|
2018-08-08 15:47:59 +00:00
|
|
|
void init_options_list() override;
|
2018-10-31 15:22:36 +00:00
|
|
|
bool supports_printer_technology(const PrinterTechnology tech) override { return tech == ptSLA; }
|
2018-08-03 11:04:41 +00:00
|
|
|
};
|
|
|
|
|
2018-11-16 16:36:23 +00:00
|
|
|
class TabSLAPrint : public Tab
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TabSLAPrint(wxNotebook* parent) :
|
2019-05-10 13:10:17 +00:00
|
|
|
// Tab(parent, _(L("Print Settings")), L("sla_print")) {}
|
|
|
|
Tab(parent, _(L("Print Settings")), Slic3r::Preset::TYPE_SLA_PRINT) {}
|
2018-11-16 16:36:23 +00:00
|
|
|
~TabSLAPrint() {}
|
2018-12-04 16:56:49 +00:00
|
|
|
void build() override;
|
|
|
|
void reload_config() override;
|
2018-11-16 16:36:23 +00:00
|
|
|
void update() override;
|
|
|
|
// void init_options_list() override;
|
|
|
|
bool supports_printer_technology(const PrinterTechnology tech) override { return tech == ptSLA; }
|
|
|
|
};
|
|
|
|
|
2018-01-18 10:45:25 +00:00
|
|
|
class SavePresetWindow :public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
2018-10-31 11:56:08 +00:00
|
|
|
SavePresetWindow(wxWindow* parent) :wxDialog(parent, wxID_ANY, _(L("Save preset"))) {}
|
|
|
|
~SavePresetWindow() {}
|
2018-01-18 10:45:25 +00:00
|
|
|
|
|
|
|
std::string m_chosen_name;
|
|
|
|
wxComboBox* m_combo;
|
|
|
|
|
2018-04-13 10:35:04 +00:00
|
|
|
void build(const wxString& title, const std::string& default_name, std::vector<std::string> &values);
|
2018-01-18 10:45:25 +00:00
|
|
|
void accept();
|
|
|
|
std::string get_name() { return m_chosen_name; }
|
|
|
|
};
|
|
|
|
|
2017-12-05 14:54:01 +00:00
|
|
|
} // GUI
|
|
|
|
} // Slic3r
|
2018-04-20 10:58:07 +00:00
|
|
|
|
|
|
|
#endif /* slic3r_Tab_hpp_ */
|