2022-07-15 15:37:19 +00:00
|
|
|
#ifndef slic3r_AMSMaterialsSetting_hpp_
|
|
|
|
#define slic3r_AMSMaterialsSetting_hpp_
|
|
|
|
|
|
|
|
#include "libslic3r/Preset.hpp"
|
|
|
|
#include "wxExtensions.hpp"
|
|
|
|
#include "GUI_Utils.hpp"
|
|
|
|
#include "DeviceManager.hpp"
|
|
|
|
#include "wx/clrpicker.h"
|
|
|
|
#include "Widgets/RadioBox.hpp"
|
|
|
|
#include "Widgets/Button.hpp"
|
|
|
|
#include "Widgets/RoundedRectangle.hpp"
|
|
|
|
#include "Widgets/Label.hpp"
|
|
|
|
#include "Widgets/CheckBox.hpp"
|
|
|
|
#include "Widgets/ComboBox.hpp"
|
|
|
|
#include "Widgets/TextInput.hpp"
|
|
|
|
|
|
|
|
#define AMS_MATERIALS_SETTING_DEF_COLOUR wxColour(255, 255, 255)
|
2022-08-03 03:28:16 +00:00
|
|
|
#define AMS_MATERIALS_SETTING_GREY900 wxColour(38, 46, 48)
|
2022-07-15 15:37:19 +00:00
|
|
|
#define AMS_MATERIALS_SETTING_GREY800 wxColour(50, 58, 61)
|
|
|
|
#define AMS_MATERIALS_SETTING_GREY700 wxColour(107, 107, 107)
|
|
|
|
#define AMS_MATERIALS_SETTING_GREY300 wxColour(174,174,174)
|
|
|
|
#define AMS_MATERIALS_SETTING_GREY200 wxColour(248, 248, 248)
|
2022-08-03 03:28:16 +00:00
|
|
|
#define AMS_MATERIALS_SETTING_BODY_WIDTH FromDIP(380)
|
2022-07-15 15:37:19 +00:00
|
|
|
#define AMS_MATERIALS_SETTING_LABEL_WIDTH FromDIP(80)
|
|
|
|
#define AMS_MATERIALS_SETTING_COMBOX_WIDTH wxSize(FromDIP(250), FromDIP(30))
|
|
|
|
#define AMS_MATERIALS_SETTING_BUTTON_SIZE wxSize(FromDIP(90), FromDIP(24))
|
|
|
|
#define AMS_MATERIALS_SETTING_INPUT_SIZE wxSize(FromDIP(90), FromDIP(24))
|
|
|
|
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
|
2022-08-03 03:28:16 +00:00
|
|
|
class AMSMaterialsSetting : public DPIDialog
|
2022-07-15 15:37:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
AMSMaterialsSetting(wxWindow *parent, wxWindowID id);
|
|
|
|
~AMSMaterialsSetting();
|
|
|
|
void create();
|
|
|
|
|
|
|
|
void paintEvent(wxPaintEvent &evt);
|
|
|
|
void input_min_finish();
|
|
|
|
void input_max_finish();
|
|
|
|
void update();
|
|
|
|
void enable_confirm_button(bool en);
|
|
|
|
bool Show(bool show) override;
|
2022-11-22 09:54:39 +00:00
|
|
|
void Popup(wxString filament = wxEmptyString, wxString sn = wxEmptyString,
|
|
|
|
wxString temp_min = wxEmptyString, wxString temp_max = wxEmptyString,
|
|
|
|
wxString k = wxEmptyString, wxString n = wxEmptyString);
|
2022-07-15 15:37:19 +00:00
|
|
|
|
2022-11-22 09:54:39 +00:00
|
|
|
void post_select_event();
|
2022-07-22 09:46:10 +00:00
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
void set_color(wxColour color);
|
|
|
|
|
|
|
|
MachineObject *obj{nullptr};
|
|
|
|
int ams_id { 0 }; /* 0 ~ 3 */
|
|
|
|
int tray_id { 0 }; /* 0 ~ 3 */
|
|
|
|
|
|
|
|
std::string ams_filament_id;
|
2022-11-22 09:54:39 +00:00
|
|
|
std::string ams_setting_id;
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
bool m_is_third;
|
|
|
|
wxString m_brand_filament;
|
|
|
|
wxString m_brand_sn;
|
|
|
|
wxString m_brand_tmp;
|
|
|
|
wxColour m_brand_colour;
|
|
|
|
std::string m_filament_type;
|
|
|
|
|
|
|
|
protected:
|
2022-11-22 09:54:39 +00:00
|
|
|
void create_panel_normal(wxWindow* parent);
|
|
|
|
void create_panel_kn(wxWindow* parent);
|
2022-08-03 03:28:16 +00:00
|
|
|
void on_dpi_changed(const wxRect &suggested_rect) override;
|
2022-07-15 15:37:19 +00:00
|
|
|
void on_select_filament(wxCommandEvent& evt);
|
2022-08-03 03:28:16 +00:00
|
|
|
void on_select_ok(wxCommandEvent &event);
|
|
|
|
void on_select_close(wxCommandEvent &event);
|
|
|
|
void on_clr_picker(wxCommandEvent &event);
|
2022-11-22 09:54:39 +00:00
|
|
|
bool is_virtual_tray();
|
|
|
|
void update_widgets();
|
2022-07-22 09:46:10 +00:00
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
protected:
|
|
|
|
StateColor m_btn_bg_green;
|
2022-08-03 03:28:16 +00:00
|
|
|
StateColor m_btn_bg_gray;
|
2022-11-22 09:54:39 +00:00
|
|
|
wxPanel * m_panel_normal;
|
2022-07-15 15:37:19 +00:00
|
|
|
wxPanel * m_panel_SN;
|
|
|
|
wxStaticText * m_sn_number;
|
|
|
|
wxStaticText * warning_text;
|
2022-08-03 03:28:16 +00:00
|
|
|
//wxPanel * m_panel_body;
|
2022-07-15 15:37:19 +00:00
|
|
|
wxStaticText * m_title_filament;
|
|
|
|
wxStaticText * m_title_colour;
|
|
|
|
wxStaticText * m_title_temperature;
|
|
|
|
TextInput * m_input_nozzle_min;
|
|
|
|
TextInput* m_input_nozzle_max;
|
|
|
|
Button * m_button_confirm;
|
2022-10-20 08:17:46 +00:00
|
|
|
wxStaticText* m_tip_readonly;
|
2022-08-03 03:28:16 +00:00
|
|
|
Button * m_button_close;
|
2022-12-16 07:56:01 +00:00
|
|
|
Button * m_clr_picker;
|
2022-08-03 03:28:16 +00:00
|
|
|
wxColourData * m_clrData;
|
2022-11-22 09:54:39 +00:00
|
|
|
|
|
|
|
wxPanel * m_panel_kn;
|
|
|
|
wxStaticText* m_k_param;
|
|
|
|
TextInput* m_input_k_val;
|
|
|
|
wxStaticText* m_n_param;
|
|
|
|
TextInput* m_input_n_val;
|
2023-02-08 02:21:44 +00:00
|
|
|
int m_filament_selection;
|
2022-11-22 09:54:39 +00:00
|
|
|
|
2022-07-22 09:46:10 +00:00
|
|
|
#ifdef __APPLE__
|
2022-11-22 09:54:39 +00:00
|
|
|
wxComboBox *m_comboBox_filament;
|
2022-08-03 03:28:16 +00:00
|
|
|
#else
|
|
|
|
ComboBox *m_comboBox_filament;
|
2022-07-22 09:46:10 +00:00
|
|
|
#endif
|
2022-09-05 07:07:57 +00:00
|
|
|
TextInput* m_readonly_filament;
|
2022-07-15 15:37:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}} // namespace Slic3r::GUI
|
|
|
|
|
|
|
|
#endif
|