mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-07 07:41:06 +00:00
* Ignore Clipper, libpng, mcut and Boost.Polygon Internals in clang-tidy Each only works through a wrapper or umbrella header: libslic3r/clipper.hpp or clipper_z.hpp configure Clipper before including it, png.h pulls in libpng's config headers, and Boost.Polygon's headers only compile through polygon.hpp or voronoi.hpp. * Ignore minilzo's Config Headers in clang-tidy lzoconf.h and lzodefs.h are internal to minilzo.h, which is what the code includes. * Add Missing Includes Across the Remaining Sources and Tests Covers src/slic3r/Utils, src/slic3r/plugin, src/slic3r/Config, src/libvgcode, src/dev-utils, src/OrcaSlicer.cpp and tests/, the directories left after src/slic3r/GUI and src/libslic3r. Generated with clang-tidy misc-include-cleaner. libvgcode's own headers are included by relative path as in the rest of that library, and Catch2 and pybind11 with angle brackets as elsewhere in the repo. * Make the GUI and Test Headers Compile on Their Own Each now includes, or forward-declares, what it uses instead of relying on what its includers happened to include first. Headers that only compile on one platform, or that nothing built includes, are left alone. * Keep Windows and nanosvg Setup Ahead of the Added Includes OrcaSlicer.cpp and several tests set _WIN32_WINNT, WIN32_LEAN_AND_MEAN or NOMINMAX before including Windows.h, and the profile validator defines NANOSVG_IMPLEMENTATION before any libslic3r header. The added includes had landed above those blocks, which broke the Windows build. * Add the GUI Includes the First Pass Missed Covers headers that only became editable once they compiled on their own, and wx symbols whose suggested header changed as the clang-tidy ignore list grew after the src/slic3r/GUI pass. * Keep the Added Test Includes Below the NOMINMAX Guard test_marchingsquares.cpp and test_texture_displacement.cpp had includes inside #ifndef NOMINMAX, which the tests inherit as defined on Windows from libslic3r, so those were skipped there. .clang-tidy also ignores the MSVC STL and UCRT internals, Boost.Multiprecision's fwd.hpp and CPython's Windows include directory, as in #16068.
244 lines
9.0 KiB
C++
244 lines
9.0 KiB
C++
#ifndef slic3r_GUI_AMXCONTROL_hpp_
|
|
#define slic3r_GUI_AMXCONTROL_hpp_
|
|
|
|
#include "../wxExtensions.hpp"
|
|
#include "StaticBox.hpp"
|
|
#include "StepCtrl.hpp"
|
|
#include "Button.hpp"
|
|
#include "AMSItem.hpp"
|
|
#include "../DeviceManager.hpp"
|
|
#include "slic3r/GUI/Event.hpp"
|
|
#include "slic3r/GUI/AmsMappingPopup.hpp"
|
|
#include <wx/anybutton.h>
|
|
#include <wx/checklst.h>
|
|
#include <wx/gdicmn.h>
|
|
#include <string>
|
|
#include <map>
|
|
#include <vector>
|
|
#include <utility>
|
|
#include <wx/panel.h>
|
|
#include <wx/scrolwin.h>
|
|
#include "slic3r/GUI/Widgets/Label.hpp"
|
|
#include <wx/colour.h>
|
|
#include <wx/event.h>
|
|
#include <wx/simplebook.h>
|
|
#include <wx/hyperlink.h>
|
|
#include <wx/animate.h>
|
|
#include <wx/dynarray.h>
|
|
#include <tuple>
|
|
#include <wx/sizer.h>
|
|
#include <wx/string.h>
|
|
|
|
#include "slic3r/GUI/DeviceCore/DevExtruderSystem.h"
|
|
#include "slic3r/GUI/AMSDryControl.hpp"
|
|
|
|
|
|
namespace Slic3r { namespace GUI {
|
|
|
|
//Previous definitions
|
|
class uiAmsPercentHumidityDryPopup;
|
|
|
|
class AMSControl : public wxSimplebook
|
|
{
|
|
public:
|
|
AMSControl(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize);
|
|
~AMSControl();
|
|
|
|
void on_retry();
|
|
|
|
protected:
|
|
std::string m_current_ams;
|
|
std::string m_current_slot_left;
|
|
std::string m_current_slot_right;
|
|
std::string m_current_show_ams_left;
|
|
std::string m_current_show_ams_right;
|
|
std::map<std::string, int> m_ams_selection;
|
|
|
|
std::map<std::string, AMSPreview*> m_ams_preview_list;
|
|
|
|
std::vector<AMSinfo> m_ams_info;
|
|
std::vector<AMSinfo> m_ext_info;
|
|
std::map<std::string, AmsItem*> m_ams_item_list;
|
|
std::map<std::string, AMSExtImage*> m_ext_image_list;
|
|
|
|
std::string m_dev_id;
|
|
std::vector<std::vector<std::string>> m_item_ids{ {}, {} };
|
|
std::vector<std::pair<string, string>> pair_id;
|
|
|
|
int m_total_ext_count = 1;
|
|
AMSextruder *m_extruder{nullptr};
|
|
SwitcherImage *m_switcher{nullptr}; // Orca: filament-switch routing glyph (hidden unless a switch is installed)
|
|
AMSRoadDownPart* m_down_road{ nullptr };
|
|
|
|
// Orca: "AMS not initialized" warning banner, materialized lazily only when a switch needs it (see show_switcher_status)
|
|
wxBoxSizer* m_sizer_body{nullptr};
|
|
wxPanel* tipPanel{nullptr};
|
|
wxBoxSizer* tipSizer{nullptr};
|
|
wxStaticBitmap* icon{nullptr};
|
|
wxStaticText* tipText{nullptr};
|
|
|
|
/*items*/
|
|
wxBoxSizer* m_sizer_ams_items{nullptr};
|
|
wxScrolledWindow* m_panel_prv_left {nullptr};
|
|
wxScrolledWindow* m_panel_prv_right{nullptr};
|
|
wxBoxSizer* m_sizer_prv_left{nullptr};
|
|
wxBoxSizer* m_sizer_prv_right{nullptr};
|
|
|
|
/*ams */
|
|
wxBoxSizer *m_sizer_ams_body{nullptr};
|
|
wxBoxSizer* m_sizer_ams_area_left{nullptr};
|
|
wxBoxSizer* m_sizer_ams_area_right{nullptr};
|
|
wxBoxSizer* m_sizer_down_road{ nullptr };
|
|
|
|
/*option*/
|
|
wxBoxSizer *m_sizer_ams_option{nullptr};
|
|
wxBoxSizer* m_sizer_option_left{nullptr};
|
|
wxBoxSizer* m_sizer_option_mid{nullptr};
|
|
wxBoxSizer* m_sizer_option_right{nullptr};
|
|
|
|
|
|
AmsIntroducePopup m_ams_introduce_popup;
|
|
|
|
//wxSimplebook *m_simplebook_right{nullptr};
|
|
wxSimplebook *m_simplebook_ams_left{nullptr};
|
|
wxSimplebook *m_simplebook_ams_right{ nullptr };
|
|
wxSimplebook *m_simplebook_bottom{nullptr};
|
|
wxPanel *m_panel_down_road{ nullptr };
|
|
int m_left_page_index = 0;
|
|
int m_right_page_index = 0;
|
|
|
|
|
|
wxStaticText *m_tip_right_top{nullptr};
|
|
Label *m_tip_load_info{nullptr};
|
|
wxWindow * m_amswin{nullptr};
|
|
wxBoxSizer* m_vams_sizer{nullptr};
|
|
wxBoxSizer* m_sizer_vams_tips{nullptr};
|
|
|
|
Label* m_ams_tip {nullptr};
|
|
|
|
Caninfo m_vams_info;
|
|
StaticBox* m_panel_virtual {nullptr};
|
|
AMSLib* m_vams_lib {nullptr};
|
|
AMSRoad* m_vams_road {nullptr};
|
|
|
|
|
|
wxBoxSizer *m_sizer_right_tip {nullptr};
|
|
wxBoxSizer* m_sizer_ams_tips {nullptr};
|
|
|
|
::StepIndicator *m_filament_load_step {nullptr};
|
|
::StepIndicator *m_filament_unload_step {nullptr};
|
|
::StepIndicator *m_filament_vt_load_step {nullptr};
|
|
|
|
Button *m_button_extruder_feed {nullptr};
|
|
Button *m_button_extruder_back {nullptr};
|
|
Button *m_button_auto_refill{ nullptr };
|
|
wxStaticBitmap* m_button_ams_setting {nullptr};
|
|
wxStaticBitmap* m_img_ams_backup {nullptr};
|
|
wxStaticBitmap* m_img_amsmapping_tip {nullptr};
|
|
wxStaticBitmap* m_img_vams_tip {nullptr};
|
|
ScalableBitmap m_button_ams_setting_normal;
|
|
ScalableBitmap m_button_ams_setting_hover;
|
|
ScalableBitmap m_button_ams_setting_press;
|
|
|
|
AmsHumidityTipPopup m_Humidity_tip_popup;
|
|
uiAmsPercentHumidityDryPopup* m_percent_humidity_dry_popup;
|
|
AMSDryCtrWin* m_ams_dry_ctr_win;
|
|
|
|
std::string m_last_ams_id = "";
|
|
std::string m_last_tray_id = "";
|
|
|
|
public:
|
|
std::string GetCurentAms();
|
|
std::string GetCurentShowAms(AMSPanelPos pos = AMSPanelPos::RIGHT_PANEL);
|
|
std::string GetCurrentCan(std::string amsid);
|
|
bool IsAmsInRightPanel(std::string ams_id);
|
|
wxColour GetCanColour(std::string amsid, std::string canid);
|
|
void createAms(wxSimplebook* parent, int& idx, AMSinfo info, AMSPanelPos pos);
|
|
void createAmsPanel(wxSimplebook *parent, int &idx, std::vector<AMSinfo> infos, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos, int total_ext_num);
|
|
AMSRoadShowMode findFirstMode(AMSPanelPos pos);
|
|
|
|
AMSModel m_ams_model{AMSModel::EXT_AMS};
|
|
AMSModel m_ext_model{AMSModel::EXT_AMS};
|
|
AMSModel m_is_none_ams_mode{AMSModel::EXT_AMS};
|
|
bool m_single_nozzle_no_ams = { true };
|
|
|
|
void SetAmsModel(AMSModel mode, AMSModel ext_mode) {m_ams_model = mode; m_ext_model = ext_mode;};
|
|
void AmsSelectedSwitch(wxCommandEvent& event);
|
|
|
|
void EnableLoadFilamentBtn(bool enable, const std::string& ams_id, const std::string& can_id, const wxString& tips);
|
|
void EnableUnLoadFilamentBtn(bool enable, const std::string& ams_id, const std::string& can_id,const wxString& tips);
|
|
|
|
void EnterNoneAMSMode();
|
|
void EnterGenericAMSMode();
|
|
void EnterExtraAMSMode();
|
|
|
|
void PlayRridLoading(wxString amsid, wxString canid);
|
|
void StopRridLoading(wxString amsid, wxString canid);
|
|
void ShowFilamentTip(bool hasams = true);
|
|
|
|
// Orca: Filament Track Switch awareness. isFilaSwitchReady() resolves the selected machine and
|
|
// returns {installed, ready}; show_switcher_status() toggles the "AMS not initialized" banner.
|
|
std::tuple<bool, bool> isFilaSwitchReady();
|
|
void show_switcher_status(bool show);
|
|
|
|
void UpdatePassRoad(string ams_id, AMSPassRoadType type, AMSPassRoadSTEP step);
|
|
void CreateAms();
|
|
void CreateAmsDoubleNozzle(const std::string &series_name, const std::string& printer_type);
|
|
void CreateAmsSingleNozzle(const std::string &series_name, const std::string &printer_type);
|
|
void ClearAms();
|
|
void UpdateAmsDryControl(MachineObject* obj);
|
|
void UpdateAms(const std::string &series_name,
|
|
const std::string &printer_type,
|
|
std::vector<AMSinfo> ams_info,
|
|
std::vector<AMSinfo> ext_info,
|
|
DevExtderSystem data,
|
|
std::string dev_id,
|
|
MachineObject* obj = nullptr,
|
|
bool is_reset = true,
|
|
bool test = false);
|
|
// Orca: simulation-data generator for local AMS-layout testing (no device required)
|
|
std::vector<AMSinfo> GenerateSimulateData();
|
|
|
|
void AddAms(AMSinfo info, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL);
|
|
//void AddExtAms(int ams_id);
|
|
void AddAmsPreview(AMSinfo info, AMSModel type);
|
|
//void AddExtraAms(AMSinfo info);
|
|
|
|
void AddAms(std::vector<AMSinfo> single_info, const std::string &series_name, const std::string &printer_type, AMSPanelPos pos = AMSPanelPos::LEFT_PANEL);
|
|
void AddAmsPreview(std::vector<AMSinfo>single_info, AMSPanelPos pos);
|
|
//void AddExtraAms(std::vector<AMSinfo>single_info);
|
|
void SetExtruder(bool on_off, int nozzle_id, std::string ams_id, std::string slot_id);
|
|
void SetAmsStep(std::string ams_id, std::string canid, AMSPassRoadType type, AMSPassRoadSTEP step);
|
|
void SwitchAms(std::string ams_id);
|
|
|
|
void msw_rescale();
|
|
void on_filament_load(wxCommandEvent &event);
|
|
void on_filament_unload(wxCommandEvent &event);
|
|
void auto_refill(wxCommandEvent& event);
|
|
void on_ams_setting_click(wxMouseEvent &event);
|
|
void on_extrusion_cali(wxCommandEvent &event);
|
|
void on_ams_setting_click(wxCommandEvent &event);
|
|
void on_clibration_again_click(wxMouseEvent &event);
|
|
void on_clibration_cancel_click(wxMouseEvent &event);
|
|
void Reset();
|
|
|
|
void show_noams_mode();
|
|
void show_auto_refill(bool show);
|
|
void enable_ams_setting(bool en);
|
|
void show_vams_kn_value(bool show);
|
|
void post_event(wxEvent&& event);
|
|
|
|
virtual bool Enable(bool enable = true);
|
|
void parse_object(MachineObject* obj);
|
|
|
|
private:
|
|
std::string get_filament_id(const std::string& ams_id, const std::string& can_id);
|
|
|
|
public:
|
|
std::string m_current_select;
|
|
};
|
|
|
|
}} // namespace Slic3r::GUI
|
|
|
|
#endif // !slic3r_GUI_amscontrol_hpp_
|