2022-07-15 15:37:19 +00:00
|
|
|
#ifndef _WIPE_TOWER_DIALOG_H_
|
|
|
|
#define _WIPE_TOWER_DIALOG_H_
|
|
|
|
|
|
|
|
#include <wx/spinctrl.h>
|
|
|
|
#include <wx/stattext.h>
|
|
|
|
#include <wx/textctrl.h>
|
|
|
|
#include <wx/checkbox.h>
|
|
|
|
#include <wx/msgdlg.h>
|
|
|
|
|
2022-12-12 09:01:29 +00:00
|
|
|
class Button;
|
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
class WipingPanel : public wxPanel {
|
|
|
|
public:
|
2022-12-12 09:01:29 +00:00
|
|
|
// BBS
|
|
|
|
WipingPanel(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours, Button* calc_button,
|
2022-07-22 09:46:10 +00:00
|
|
|
int extra_flush_volume, float flush_multiplier);
|
2022-07-15 15:37:19 +00:00
|
|
|
std::vector<float> read_matrix_values();
|
|
|
|
std::vector<float> read_extruders_values();
|
|
|
|
void toggle_advanced(bool user_action = false);
|
|
|
|
void create_panels(wxWindow* parent, const int num);
|
2022-07-22 09:46:10 +00:00
|
|
|
void calc_flushing_volumes();
|
|
|
|
|
|
|
|
float get_flush_multiplier()
|
|
|
|
{
|
|
|
|
if (m_flush_multiplier_ebox == nullptr)
|
|
|
|
return 1.f;
|
|
|
|
|
|
|
|
return std::atof(m_flush_multiplier_ebox->GetValue().c_str());
|
|
|
|
}
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void fill_in_matrix();
|
|
|
|
bool advanced_matches_simple();
|
2022-07-22 09:46:10 +00:00
|
|
|
int calc_flushing_volume(const wxColour& from, const wxColour& to);
|
2022-12-05 01:14:52 +00:00
|
|
|
void update_warning_texts();
|
2022-07-15 15:37:19 +00:00
|
|
|
|
|
|
|
std::vector<wxSpinCtrl*> m_old;
|
|
|
|
std::vector<wxSpinCtrl*> m_new;
|
|
|
|
std::vector<std::vector<wxTextCtrl*>> edit_boxes;
|
|
|
|
std::vector<wxColour> m_colours;
|
|
|
|
unsigned int m_number_of_extruders = 0;
|
|
|
|
bool m_advanced = false;
|
|
|
|
wxPanel* m_page_simple = nullptr;
|
|
|
|
wxPanel* m_page_advanced = nullptr;
|
|
|
|
wxPanel* header_line_panel = nullptr;
|
|
|
|
wxBoxSizer* m_sizer = nullptr;
|
|
|
|
wxBoxSizer* m_sizer_simple = nullptr;
|
|
|
|
wxBoxSizer* m_sizer_advanced = nullptr;
|
|
|
|
wxGridSizer* m_gridsizer_advanced = nullptr;
|
|
|
|
wxButton* m_widget_button = nullptr;
|
2022-07-22 09:46:10 +00:00
|
|
|
|
2022-12-05 01:14:52 +00:00
|
|
|
const int m_min_flush_volume;
|
|
|
|
const int m_max_flush_volume;
|
|
|
|
|
2022-07-22 09:46:10 +00:00
|
|
|
wxTextCtrl* m_flush_multiplier_ebox = nullptr;
|
2022-12-05 01:14:52 +00:00
|
|
|
wxStaticText* m_min_flush_label = nullptr;
|
2023-01-17 10:06:45 +00:00
|
|
|
|
|
|
|
std::vector<float> m_matrix;
|
2022-07-15 15:37:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WipingDialog : public wxDialog {
|
|
|
|
public:
|
2022-07-22 09:46:10 +00:00
|
|
|
WipingDialog(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours,
|
|
|
|
int extra_flush_volume, float flush_multiplier);
|
2022-07-15 15:37:19 +00:00
|
|
|
std::vector<float> get_matrix() const { return m_output_matrix; }
|
|
|
|
std::vector<float> get_extruders() const { return m_output_extruders; }
|
|
|
|
|
|
|
|
wxBoxSizer* create_btn_sizer(long flags);
|
|
|
|
|
2022-07-22 09:46:10 +00:00
|
|
|
float get_flush_multiplier()
|
|
|
|
{
|
|
|
|
if (m_panel_wiping == nullptr)
|
|
|
|
return 1.f;
|
|
|
|
|
|
|
|
return m_panel_wiping->get_flush_multiplier();
|
|
|
|
}
|
|
|
|
|
2022-07-15 15:37:19 +00:00
|
|
|
private:
|
|
|
|
WipingPanel* m_panel_wiping = nullptr;
|
|
|
|
std::vector<float> m_output_matrix;
|
|
|
|
std::vector<float> m_output_extruders;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WIPE_TOWER_DIALOG_H_
|