OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::DevNozzle Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/DeviceCore/DevNozzleSystem.h>

Collaboration diagram for Slic3r::DevNozzle:

Public Member Functions

bool IsEmpty () const
void SetRack (const std::weak_ptr< DevNozzleRack > &rack)
int GetNozzleId () const
int GetNozzlePosId () const
NozzleType GetNozzleType () const
NozzleFlowType GetNozzleFlowType () const
NozzleDiameterType GetNozzleDiameterType () const
float GetNozzleDiameter () const
float GetNozzleWear () const
int GetNozzlePrintTime () const
DevFirmwareVersionInfo GetFirmwareInfo () const
wxString GetNozzleDiameterStr () const
wxString GetNozzleFlowTypeStr () const
wxString GetNozzleTypeStr () const
std::string GetFilamentId () const
std::string GetFilamentColor () const
bool AtLeftExtruder () const
bool AtRightExtruder () const
int GetLogicExtruderId () const
int GetExtruderId () const
bool IsOnRack () const
bool IsInfoReliable () const
bool IsNormal () const
bool IsAbnormal () const
bool IsUnknown () const
void SetOnRack (bool on_rack)
void SetStatus (int stat)

Static Public Member Functions

static NozzleFlowType ToNozzleFlowType (const NozzleVolumeType &type)
static NozzleVolumeType ToNozzleVolumeType (const NozzleFlowType &type)
static wxString GetNozzleFlowTypeStr (NozzleFlowType type)
static std::string GetNozzleFlowTypeString (NozzleFlowType type)
static std::string ToNozzleFlowString (const NozzleFlowType &type)
static wxString GetNozzleTypeStr (NozzleType type)

Public Attributes

int m_nozzle_id = -1
NozzleFlowType m_nozzle_flow = NozzleFlowType::S_FLOW
NozzleType m_nozzle_type = NozzleType::ntUndefine
float m_diameter = 0.0f

Private Member Functions

int GetTotalExtruderCount () const

Private Attributes

bool m_on_rack = false
int m_stat = 0
float m_wear = 0.0f
std::string m_fila_id
std::string m_filament_clr
std::weak_ptr< DevNozzleRack > m_nozzle_rack
int m_nozzle_print_time {0}

Friends

class DevNozzleSystemParser

Detailed Description

Member Function Documentation

◆ AtLeftExtruder()

bool Slic3r::DevNozzle::AtLeftExtruder ( ) const
210{
211 assert(GetTotalExtruderCount() == 2);
212 if (IsOnRack()) { return false; }
214}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102
bool IsOnRack() const
Definition DevNozzleSystem.h:86
int m_nozzle_id
Definition DevNozzleSystem.h:38
int GetTotalExtruderCount() const
Definition DevNozzleSystem.cpp:223

References DEPUTY_EXTRUDER_ID, GetTotalExtruderCount(), IsOnRack(), and m_nozzle_id.

Referenced by GetExtruderId(), and GetLogicExtruderId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AtRightExtruder()

bool Slic3r::DevNozzle::AtRightExtruder ( ) const
217{
218 assert(GetTotalExtruderCount() == 2);
219 if (IsOnRack()) { return true; }
221}
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101

References GetTotalExtruderCount(), IsOnRack(), m_nozzle_id, and MAIN_EXTRUDER_ID.

Referenced by GetExtruderId(), and GetLogicExtruderId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetExtruderId()

int Slic3r::DevNozzle::GetExtruderId ( ) const
194{
195 int total_ext_count = GetTotalExtruderCount();
196 if (total_ext_count == 1) {
197 return MAIN_EXTRUDER_ID;
198 } else if (total_ext_count == 2) {
199 if (AtRightExtruder()) {
200 return MAIN_EXTRUDER_ID;
201 } else if (AtLeftExtruder()) {
202 return DEPUTY_EXTRUDER_ID;
203 }
204 }
205
206 return MAIN_EXTRUDER_ID;
207}
bool AtRightExtruder() const
Definition DevNozzleSystem.cpp:216
bool AtLeftExtruder() const
Definition DevNozzleSystem.cpp:209

References AtLeftExtruder(), AtRightExtruder(), DEPUTY_EXTRUDER_ID, GetTotalExtruderCount(), and MAIN_EXTRUDER_ID.

Referenced by Slic3r::GUI::SelectMachineDialog::on_ok_btn(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFilamentColor()

std::string Slic3r::DevNozzle::GetFilamentColor ( ) const
inline
76{ return m_filament_clr; }
std::string m_filament_clr
Definition DevNozzleSystem.h:106

References m_filament_clr.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the caller graph for this function:

◆ GetFilamentId()

std::string Slic3r::DevNozzle::GetFilamentId ( ) const
inline
75{ return m_fila_id; }
std::string m_fila_id
Definition DevNozzleSystem.h:105

References m_fila_id.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo().

Here is the caller graph for this function:

◆ GetFirmwareInfo()

DevFirmwareVersionInfo Slic3r::DevNozzle::GetFirmwareInfo ( ) const
161{
162 const auto& nozzle_rack = m_nozzle_rack.lock();
163 if (nozzle_rack) {
164 if (IsOnRack()) {
165 return nozzle_rack->GetNozzleFirmwareInfo(m_nozzle_id);
166 } else if (m_nozzle_id == 0) {
167 return nozzle_rack->GetNozzleSystem()->GetExtruderNozzleFirmware();
168 }
169 }
170
171 return DevFirmwareVersionInfo();
172}
std::weak_ptr< DevNozzleRack > m_nozzle_rack
Definition DevNozzleSystem.h:108

References IsOnRack(), m_nozzle_id, and m_nozzle_rack.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetLogicExtruderId()

int Slic3r::DevNozzle::GetLogicExtruderId ( ) const
177{
178 int total_ext_count = GetTotalExtruderCount();
179 if (total_ext_count == 1) {
181 } else if (total_ext_count == 2) {
182 if (AtLeftExtruder()) {
183 return LOGIC_L_EXTRUDER_ID;
184 } else if (AtRightExtruder()) {
185 return LOGIC_R_EXTRUDER_ID;
186 }
187 }
188
189 assert(0);
191}
#define LOGIC_UNIQUE_EXTRUDER_ID
Definition DevDefs.h:107
#define LOGIC_L_EXTRUDER_ID
Definition DevDefs.h:108
#define LOGIC_R_EXTRUDER_ID
Definition DevDefs.h:109

References AtLeftExtruder(), AtRightExtruder(), GetTotalExtruderCount(), LOGIC_L_EXTRUDER_ID, LOGIC_R_EXTRUDER_ID, and LOGIC_UNIQUE_EXTRUDER_ID.

Referenced by Slic3r::DevNozzleMappingCtrl::GetFlushWeight(), Slic3r::DevUtilBackend::GetNozzleInfo(), and Slic3r::GUI::s_enable_item_if_match().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNozzleDiameter()

float Slic3r::DevNozzle::GetNozzleDiameter ( ) const
inline
63{ return m_diameter; }
float m_diameter
Definition DevNozzleSystem.h:41

References m_diameter.

Referenced by Slic3r::GUI::is_same_nozzle_config(), Slic3r::GUI::SelectMachineDialog::on_ok_btn(), Slic3r::GUI::s_enable_item_if_match(), Slic3r::GUI::sCheckFilamentInfo(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the caller graph for this function:

◆ GetNozzleDiameterStr()

wxString Slic3r::DevNozzle::GetNozzleDiameterStr ( ) const
inline
71{ return wxString::Format("%.1f mm", m_diameter); }

References m_diameter.

Referenced by Slic3r::DevUtilBackend::GetNozzleInfo(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the caller graph for this function:

◆ GetNozzleDiameterType()

NozzleDiameterType Slic3r::DevNozzle::GetNozzleDiameterType ( ) const
147{
148 if (is_approx(m_diameter, 0.2f))
150 else if (is_approx(m_diameter, 0.4f))
152 else if (is_approx(m_diameter, 0.6f))
154 else if (is_approx(m_diameter, 0.8f))
156 else
158}
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:320
@ NOZZLE_DIAMETER_0_4
Definition DevDefs.h:128
@ NOZZLE_DIAMETER_0_2
Definition DevDefs.h:127
@ NOZZLE_DIAMETER_0_6
Definition DevDefs.h:129
@ NONE_DIAMETER_TYPE
Definition DevDefs.h:126
@ NOZZLE_DIAMETER_0_8
Definition DevDefs.h:130

References Slic3r::is_approx(), m_diameter, Slic3r::NONE_DIAMETER_TYPE, Slic3r::NOZZLE_DIAMETER_0_2, Slic3r::NOZZLE_DIAMETER_0_4, Slic3r::NOZZLE_DIAMETER_0_6, and Slic3r::NOZZLE_DIAMETER_0_8.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::updateNozzleImage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNozzleFlowType()

NozzleFlowType Slic3r::DevNozzle::GetNozzleFlowType ( ) const
inline

◆ GetNozzleFlowTypeStr() [1/2]

wxString Slic3r::DevNozzle::GetNozzleFlowTypeStr ( ) const
inline
wxString GetNozzleFlowTypeStr() const
Definition DevNozzleSystem.h:72

References GetNozzleFlowTypeStr(), and m_nozzle_flow.

Referenced by Slic3r::GUI::SelectMachineDialog::CheckErrorExtruderNozzleWithSlicing(), and GetNozzleFlowTypeStr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNozzleFlowTypeStr() [2/2]

wxString Slic3r::DevNozzle::GetNozzleFlowTypeStr ( NozzleFlowType type)
static
67{
68 switch (type) {
69 case NozzleFlowType::H_FLOW: return _L("High Flow");
70 case NozzleFlowType::S_FLOW: return _L("Standard");
71 case NozzleFlowType::U_FLOW: return _L("TPU High Flow");
72 case NozzleFlowType::E_FLOW: return _L("E3D High Flow");
73 default: break;
74 }
75
76 return _L("Unknown");
77}
#define _L(s)
Definition OBJ.cpp:34
@ E_FLOW
Definition DevDefs.h:121
@ H_FLOW
Definition DevDefs.h:119
@ U_FLOW
Definition DevDefs.h:120
@ S_FLOW
Definition DevDefs.h:118

References _L, Slic3r::E_FLOW, Slic3r::H_FLOW, Slic3r::S_FLOW, and Slic3r::U_FLOW.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the caller graph for this function:

◆ GetNozzleFlowTypeString()

std::string Slic3r::DevNozzle::GetNozzleFlowTypeString ( NozzleFlowType type)
static
82{
83 switch (type) {
84 case NozzleFlowType::H_FLOW: return "High Flow";
85 case NozzleFlowType::S_FLOW: return "Standard";
86 case NozzleFlowType::U_FLOW: return "TPU High Flow";
87 case NozzleFlowType::E_FLOW: return "E3D High Flow";
88 default: return "Unknown";
89 }
90}

References Slic3r::E_FLOW, Slic3r::H_FLOW, Slic3r::S_FLOW, and Slic3r::U_FLOW.

Referenced by Slic3r::DevFilaSystem::GetNozzleFlowStringByAmsId(), Slic3r::GUI::SelectMachineDialog::on_ok_btn(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the caller graph for this function:

◆ GetNozzleId()

int Slic3r::DevNozzle::GetNozzleId ( ) const
inline
58{ return m_nozzle_id; }

References m_nozzle_id.

◆ GetNozzlePosId()

int Slic3r::DevNozzle::GetNozzlePosId ( ) const
142{
143 return IsOnRack() ? (m_nozzle_id + 0x10) : m_nozzle_id;
144}

References IsOnRack(), and m_nozzle_id.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackSelect::SetSelectedNozzle(), and Slic3r::GUI::SelectMachineDialog::update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNozzlePrintTime()

int Slic3r::DevNozzle::GetNozzlePrintTime ( ) const
inline
65{ return m_nozzle_print_time; }
int m_nozzle_print_time
Definition DevNozzleSystem.h:109

References m_nozzle_print_time.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo().

Here is the caller graph for this function:

◆ GetNozzleType()

NozzleType Slic3r::DevNozzle::GetNozzleType ( ) const
inline
60{ return m_nozzle_type; }
NozzleType m_nozzle_type
Definition DevNozzleSystem.h:40

References m_nozzle_type.

Referenced by Slic3r::GUI::s_enable_item_if_match(), Slic3r::GUI::SelectMachineDialog::update_show_status(), and Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::updateNozzleImage().

Here is the caller graph for this function:

◆ GetNozzleTypeStr() [1/2]

wxString Slic3r::DevNozzle::GetNozzleTypeStr ( ) const
inline
wxString GetNozzleTypeStr() const
Definition DevNozzleSystem.h:73

References GetNozzleTypeStr(), and m_nozzle_type.

Referenced by GetNozzleTypeStr().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetNozzleTypeStr() [2/2]

wxString Slic3r::DevNozzle::GetNozzleTypeStr ( NozzleType type)
static
106{
107 switch (type) {
108 case Slic3r::ntHardenedSteel: return _L("Hardened Steel");
109 case Slic3r::ntStainlessSteel: return _L("Stainless Steel");
110 case Slic3r::ntTungstenCarbide: return _L("Tungsten Carbide");
111 default: break;
112 }
113
114 return _L("Unknown");
115}
@ ntTungstenCarbide
Definition CommonDefs.hpp:17
@ ntStainlessSteel
Definition CommonDefs.hpp:16
@ ntHardenedSteel
Definition CommonDefs.hpp:15

References _L, Slic3r::ntHardenedSteel, Slic3r::ntStainlessSteel, and Slic3r::ntTungstenCarbide.

Referenced by Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo().

Here is the caller graph for this function:

◆ GetNozzleWear()

float Slic3r::DevNozzle::GetNozzleWear ( ) const
inline
64{ return m_wear; }
float m_wear
Definition DevNozzleSystem.h:103

References m_wear.

◆ GetTotalExtruderCount()

int Slic3r::DevNozzle::GetTotalExtruderCount ( ) const
private
224{
225 auto rack = m_nozzle_rack.lock();
226 if (rack) {
227 MachineObject* obj = rack->GetNozzleSystem()->GetOwner();
228 return obj->GetExtderSystem()->GetTotalExtderCount();
229 }
230 return 1;
231}

References Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::DevNozzleSystem::GetOwner(), Slic3r::DevExtderSystem::GetTotalExtderCount(), and m_nozzle_rack.

Referenced by AtLeftExtruder(), AtRightExtruder(), GetExtruderId(), and GetLogicExtruderId().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsAbnormal()

bool Slic3r::DevNozzle::IsAbnormal ( ) const
132{
133 return DevUtil::get_flag_bits(m_stat, 1, 2) == (1 << 0);
134}
static int get_flag_bits(std::string str, int start, int count=1)
Definition DevUtil.cpp:18
int m_stat
Definition DevNozzleSystem.h:102

References Slic3r::DevUtil::get_flag_bits(), and m_stat.

Referenced by Slic3r::DevNozzleRack::CtrlCanUpdateAll(), Slic3r::GUI::s_enable_item_if_match(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsEmpty()

bool Slic3r::DevNozzle::IsEmpty ( ) const
inline
54{ return m_nozzle_id < 0; }

References m_nozzle_id.

Referenced by IsInfoReliable(), IsNormal(), Slic3r::GUI::s_enable_item_if_match(), Slic3r::GUI::sCheckFilamentInfo(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the caller graph for this function:

◆ IsInfoReliable()

bool Slic3r::DevNozzle::IsInfoReliable ( ) const
120{
121 if (IsEmpty()) { return false; }
122 return DevUtil::get_flag_bits(m_stat, 0, 1) == 0;
123}
bool IsEmpty() const
Definition DevNozzleSystem.h:54

References Slic3r::DevUtil::get_flag_bits(), IsEmpty(), and m_stat.

Here is the call graph for this function:

◆ IsNormal()

bool Slic3r::DevNozzle::IsNormal ( ) const
126{
127 if (IsEmpty()) { return false; }
128 return DevUtil::get_flag_bits(m_stat, 1, 2) == 0;
129}

References Slic3r::DevUtil::get_flag_bits(), IsEmpty(), and m_stat.

Referenced by Slic3r::GUI::NewCalibrationHistoryDialog::on_select_nozzle_pos(), and Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsOnRack()

bool Slic3r::DevNozzle::IsOnRack ( ) const
inline
86{ return m_on_rack; }
bool m_on_rack
Definition DevNozzleSystem.h:100

References m_on_rack.

Referenced by AtLeftExtruder(), AtRightExtruder(), GetFirmwareInfo(), GetNozzlePosId(), and Slic3r::GUI::s_update_nozzle_info().

Here is the caller graph for this function:

◆ IsUnknown()

bool Slic3r::DevNozzle::IsUnknown ( ) const
137{
138 return DevUtil::get_flag_bits(m_stat, 1, 2) == (1 << 1);
139}

References Slic3r::DevUtil::get_flag_bits(), and m_stat.

Referenced by Slic3r::GUI::s_enable_item_if_match(), Slic3r::GUI::s_update_nozzle_info(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateInfo(), and Slic3r::GUI::wgtDeviceNozzleRackToolHead::UpdateToolHeadInfo().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOnRack()

void Slic3r::DevNozzle::SetOnRack ( bool on_rack)
inline
93{ m_on_rack = on_rack; }

References m_on_rack.

Referenced by Slic3r::DevNozzleRack::AddRackNozzle(), and Slic3r::DevNozzleRack::GetNozzle().

Here is the caller graph for this function:

◆ SetRack()

void Slic3r::DevNozzle::SetRack ( const std::weak_ptr< DevNozzleRack > & rack)
inline
56{ m_nozzle_rack = rack; }

References m_nozzle_rack.

Referenced by Slic3r::DevNozzleSystemParser::ParseV1_0(), and Slic3r::DevNozzleSystemParser::ParseV2_0().

Here is the caller graph for this function:

◆ SetStatus()

void Slic3r::DevNozzle::SetStatus ( int stat)
inline
94{ m_stat = stat; }

References m_stat.

Referenced by Slic3r::DevNozzleSystemParser::ParseV2_0().

Here is the caller graph for this function:

◆ ToNozzleFlowString()

std::string Slic3r::DevNozzle::ToNozzleFlowString ( const NozzleFlowType & type)
static
95{
96 switch (type) {
97 case NozzleFlowType::S_FLOW: return "Standard";
98 case NozzleFlowType::H_FLOW: return "High Flow";
99 case NozzleFlowType::U_FLOW: return "TPU High Flow";
100 case NozzleFlowType::E_FLOW: return "E3D High Flow";
101 default: return std::string();
102 }
103}

References Slic3r::E_FLOW, Slic3r::H_FLOW, Slic3r::S_FLOW, and Slic3r::U_FLOW.

Referenced by Slic3r::DevNozzleMappingCtrl::CtrlGetAutoNozzleMappingV0().

Here is the caller graph for this function:

◆ ToNozzleFlowType()

NozzleFlowType Slic3r::DevNozzle::ToNozzleFlowType ( const NozzleVolumeType & type)
static
42{
43 switch (type) {
48 default: return NozzleFlowType::NONE_FLOWTYPE;
49 }
50}
@ nvtE3DHighFlow
Definition PrintConfig.hpp:626
@ nvtHighFlow
Definition PrintConfig.hpp:620
@ nvtTPUHighFlow
Definition PrintConfig.hpp:624
@ nvtStandard
Definition PrintConfig.hpp:619
@ NONE_FLOWTYPE
Definition DevDefs.h:117

References Slic3r::E_FLOW, Slic3r::H_FLOW, Slic3r::NONE_FLOWTYPE, Slic3r::nvtE3DHighFlow, Slic3r::nvtHighFlow, Slic3r::nvtStandard, Slic3r::nvtTPUHighFlow, Slic3r::S_FLOW, and Slic3r::U_FLOW.

Referenced by Slic3r::GUI::SelectMachineDialog::CheckWarningRackStatus(), Slic3r::DevUtilBackend::CollectNozzleInfo(), Slic3r::GUI::HotEndTable::FilterHotEnds(), and Slic3r::GUI::s_get_slicing_extuder_nozzles().

Here is the caller graph for this function:

◆ ToNozzleVolumeType()

◆ DevNozzleSystemParser

friend class DevNozzleSystemParser
friend

References DevNozzleSystemParser.

Referenced by DevNozzleSystemParser.

Member Data Documentation

◆ m_diameter

◆ m_fila_id

std::string Slic3r::DevNozzle::m_fila_id
private

◆ m_filament_clr

std::string Slic3r::DevNozzle::m_filament_clr
private

◆ m_nozzle_flow

◆ m_nozzle_id

◆ m_nozzle_print_time

int Slic3r::DevNozzle::m_nozzle_print_time {0}
private

◆ m_nozzle_rack

std::weak_ptr<DevNozzleRack> Slic3r::DevNozzle::m_nozzle_rack
private

◆ m_nozzle_type

◆ m_on_rack

bool Slic3r::DevNozzle::m_on_rack = false
private

Referenced by IsOnRack(), and SetOnRack().

◆ m_stat

int Slic3r::DevNozzle::m_stat = 0
private

◆ m_wear

float Slic3r::DevNozzle::m_wear = 0.0f
private

The documentation for this struct was generated from the following files: