Files
OrcaSlicer/src/slic3r/GUI/DeviceTab/wgtDeviceNozzleRackUpdate.h
T
Kris Austin 1e4b48c548 build: clear 227 warnings - dead private fields, malformed comments (#15376)
build: drop dead private fields, close malformed comments (227 warnings)

Clears 227 of the clang-cl warnings tracked in #15374, taking a full
Windows build from 1,491 to 1,264. Five of the six changes are in
headers, which are re-diagnosed in every translation unit that includes
them, so the count is large for a 14-line diff.

Tabbook.hpp: delete two private fields, unread since the 2022 import.
m_parent also shadowed wxWindowBase::m_parent.

GUI_Utils.hpp: the wxEVT_SYS_COLOUR_CHANGED lambda body is empty on
Windows, so its `this` capture is unused there. (void) this; leaves the
handler bound, which is what stops the event propagating.

DevFirmware.h: mark m_owner [[maybe_unused]]. The class is never
instantiated, and the file tracks BambuStudio, so this is the smallest
divergence.

Eight DeviceTab/ files, AMSItem.cpp and SelectMachine.cpp: block
comments malformed so that they read as a nested /*.

No behavior change. -Wcomment goes to zero, and only the three intended
categories move.
2026-08-26 07:38:52 -03:00

166 lines
4.4 KiB
C++

//**********************************************************/
/* File: wgtDeviceNozzleRackUpdate.h
* Description: The panel for updating hotends
*
* \n class wgtDeviceNozzleRackUpdate
************************************************************/
#pragma once
#include "slic3r/GUI/DeviceCore/DevNozzleRack.h"
#include "slic3r/GUI/GUI_Utils.hpp"
#include "slic3r/GUI/Widgets/StaticBox.hpp"
#include "slic3r/GUI/Widgets/AnimaController.hpp"
#include <wx/panel.h>
#include <memory>
// Previous definitions
class Button;
class Label;
class ScalableBitmap;
class ScalableButton;
namespace Slic3r
{
struct DevNozzle;
class DevNozzleRack;
namespace GUI
{
class wgtDeviceNozzleRackUprade;
class wgtDeviceNozzleRackHotendUpdate;
}
};
namespace Slic3r::GUI
{
class wgtDeviceNozzleRackUpgradeDlg : public DPIDialog
{
public:
wgtDeviceNozzleRackUpgradeDlg(wxWindow* parent, const std::shared_ptr<DevNozzleRack> rack);
public:
void UpdateRackInfo(const std::shared_ptr<DevNozzleRack> rack);;
public:
void on_dpi_changed(const wxRect& suggested_rect) override;
private:
wgtDeviceNozzleRackUprade* m_rack_upgrade_panel;
};
class wgtDeviceNozzleRackUprade : public wxPanel
{
public:
wgtDeviceNozzleRackUprade(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL);
~wgtDeviceNozzleRackUprade() = default;
public:
void UpdateRackInfo(const std::shared_ptr<DevNozzleRack> rack);
void Rescale();
private:
void CreateGui();
void OnBtnReadAll(wxCommandEvent& e);
private:
std::weak_ptr<DevNozzleRack> m_nozzle_rack;
// GUI
wgtDeviceNozzleRackHotendUpdate* m_extruder_nozzle_item;
std::unordered_map<int, wgtDeviceNozzleRackHotendUpdate*> m_nozzle_items;
};
// Using for rack nozzle id or extruder nozzle id
class wgtDeviceNozzleRackHotendUpdate : public StaticBox
{
public:
wgtDeviceNozzleRackHotendUpdate(wxWindow* parent, const wxString& idx_text);
public:
// Color
void UpdateColourStyle(const wxColour& clr);
// extruder nozzle
int GetExtruderNozzleId() const { return m_ext_nozzle_id; }
void SetExtruderNozzleId(int ext_nozzle_id) { m_ext_nozzle_id = ext_nozzle_id; }
void UpdateExtruderNozzleInfo(const std::shared_ptr<DevNozzleRack> rack);
// rack nozzle
void SetRackNozzleId(int rack_nozzle_id) { m_rack_nozzle_id = rack_nozzle_id; }
int GetRackNozzleId() const { return m_rack_nozzle_id; }
void UpdateRackNozzleInfo(const std::shared_ptr<DevNozzleRack> rack);
// gui
void Rescale();
private:
void CreateGui();
void UpdateInfo(const DevNozzle& nozzle);
void OnBitmapHoverEnter(wxMouseEvent& event);
void OnBitmapHoverLeave(wxMouseEvent& event);
void OnStatusIconClick(wxMouseEvent& event);
void updateNozzleImage(const DevNozzle& nozzle);
private:
enum NozzleStatus : int
{
NOZZLE_STATUS_DC = -1,
NOZZLE_STATUS_EMPTY,
NOZZLE_STATUS_NORMAL,
NOZZLE_STATUS_ABNORMAL,
NOZZLE_STATUS_UNKNOWN,
};
private:
int m_ext_nozzle_id = -1;
int m_rack_nozzle_id = -1;
bool m_isRefreshFinish = false;
bool findNozzleImage = false;
NozzleStatus m_nozzle_status = NOZZLE_STATUS_DC;
std::weak_ptr<DevNozzleRack> m_nozzle_rack;
std::vector<std::vector<ScalableBitmap*>> nozzle_hs;
std::vector<std::vector<ScalableBitmap*>> nozzle_hh;
// GUI
ScalableBitmap* m_nozzle_image = nullptr;
ScalableBitmap* m_nozzle_empty_image = nullptr;
ScalableBitmap* m_scaled_nozzle_image = nullptr;
ScalableBitmap* m_scaled_nozzle_empty_image = nullptr;
ScalableBitmap* m_refresh_icon = nullptr;
// ScalableBitmap* m_in_refreh_icon = nullptr;
AnimaIcon* m_refreshing_icon = nullptr;
ScalableBitmap* m_error_icon = nullptr;
Label* m_idx_label;
wxStaticBitmap* m_icon_bitmap{ nullptr };
wxStaticBitmap* m_status_bitmap{ nullptr };
Label* m_material_label{ nullptr };
StaticBox* m_colour_box{ nullptr };
wxFrame* m_hoverFrame{ nullptr };
Label* m_status_label{ nullptr };
Label* m_used_time{ nullptr };
Label* m_diameter_label;
Label* m_flowtype_label;
Label* m_type_label;
ScalableButton* m_error_button{ nullptr };
Label* m_sn_label;
Label* m_version_label;
Label* m_version_new_label;
};
wxDECLARE_EVENT(wxEVT_NOZZLE_JUMP_UPGRADE, wxCommandEvent);
};// end of namespace Slic3r::GUI