ENH: add nozzle type ntTungstenCarbide

jira: [STUDIO-11597]
Change-Id: Ibec41549042d253aeb85ba81e93e7c26a4a56ed2
This commit is contained in:
xin.zhang 2025-04-16 14:16:53 +08:00 committed by lane.wei
parent 9b585239f7
commit 1352cff314
11 changed files with 20 additions and 16 deletions

View File

@ -1,8 +1,9 @@
{ {
"version": "1.0.0.1", "version": "1.0.0.2",
"nozzle_hrc": { "nozzle_hrc": {
"hardened_steel": 55, "hardened_steel": 55,
"stainless_steel": 20, "stainless_steel": 20,
"tungsten_carbide", 85,
"brass": 2, "brass": 2,
"undefine": 0 "undefine": 0
} }

View File

@ -2451,6 +2451,7 @@ int Print::get_hrc_by_nozzle_type(const NozzleType&type)
nozzle_type_to_hrc = { nozzle_type_to_hrc = {
{"hardened_steel",55}, {"hardened_steel",55},
{"stainless_steel",20}, {"stainless_steel",20},
{"tungsten_carbide", 85},
{"brass",2}, {"brass",2},
{"undefine",0} {"undefine",0}
}; };

View File

@ -365,6 +365,7 @@ static t_config_enum_values s_keys_map_NozzleType {
{ "undefine", int(NozzleType::ntUndefine) }, { "undefine", int(NozzleType::ntUndefine) },
{ "hardened_steel", int(NozzleType::ntHardenedSteel) }, { "hardened_steel", int(NozzleType::ntHardenedSteel) },
{ "stainless_steel", int(NozzleType::ntStainlessSteel)}, { "stainless_steel", int(NozzleType::ntStainlessSteel)},
{ "tungsten_carbide", int(NozzleType::ntTungstenCarbide)},
{ "brass", int(NozzleType::ntBrass) } { "brass", int(NozzleType::ntBrass) }
}; };
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(NozzleType) CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(NozzleType)
@ -2369,10 +2370,12 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("undefine"); def->enum_values.push_back("undefine");
def->enum_values.push_back("hardened_steel"); def->enum_values.push_back("hardened_steel");
def->enum_values.push_back("stainless_steel"); def->enum_values.push_back("stainless_steel");
def->enum_values.push_back("tungsten_carbide");
def->enum_values.push_back("brass"); def->enum_values.push_back("brass");
def->enum_labels.push_back(L("Undefine")); def->enum_labels.push_back(L("Undefine"));
def->enum_labels.push_back(L("Hardened steel")); def->enum_labels.push_back(L("Hardened steel"));
def->enum_labels.push_back(L("Stainless steel")); def->enum_labels.push_back(L("Stainless steel"));
def->enum_labels.push_back(L("Tungsten carbide"));
def->enum_labels.push_back(L("Brass")); def->enum_labels.push_back(L("Brass"));
def->mode = comDevelop; def->mode = comDevelop;
def->nullable = true; def->nullable = true;

View File

@ -264,6 +264,7 @@ enum NozzleType {
ntUndefine = 0, ntUndefine = 0,
ntHardenedSteel, ntHardenedSteel,
ntStainlessSteel, ntStainlessSteel,
ntTungstenCarbide,
ntBrass, ntBrass,
ntCount ntCount
}; };
@ -272,6 +273,7 @@ static std::unordered_map<NozzleType, std::string>NozzleTypeEumnToStr = {
{NozzleType::ntUndefine, "undefine"}, {NozzleType::ntUndefine, "undefine"},
{NozzleType::ntHardenedSteel, "hardened_steel"}, {NozzleType::ntHardenedSteel, "hardened_steel"},
{NozzleType::ntStainlessSteel, "stainless_steel"}, {NozzleType::ntStainlessSteel, "stainless_steel"},
{NozzleType::ntTungstenCarbide, "tungsten_carbide"},
{NozzleType::ntBrass, "brass"} {NozzleType::ntBrass, "brass"}
}; };
@ -279,6 +281,7 @@ static std::unordered_map<std::string, NozzleType>NozzleTypeStrToEumn = {
{"undefine", NozzleType::ntUndefine}, {"undefine", NozzleType::ntUndefine},
{"hardened_steel", NozzleType::ntHardenedSteel}, {"hardened_steel", NozzleType::ntHardenedSteel},
{"stainless_steel", NozzleType::ntStainlessSteel}, {"stainless_steel", NozzleType::ntStainlessSteel},
{"tungsten_carbide", NozzleType::ntTungstenCarbide},
{"brass", NozzleType::ntBrass} {"brass", NozzleType::ntBrass}
}; };

View File

@ -6321,6 +6321,8 @@ void MachineObject::parse_new_info(json print)
nozzle_obj.nozzle_type = NozzleType::ntStainlessSteel; nozzle_obj.nozzle_type = NozzleType::ntStainlessSteel;
} else if (type.substr(2, 2) == std::string("01")) { } else if (type.substr(2, 2) == std::string("01")) {
nozzle_obj.nozzle_type = NozzleType::ntHardenedSteel; nozzle_obj.nozzle_type = NozzleType::ntHardenedSteel;
} else if (type.substr(2, 2) == std::string("05")) {
nozzle_obj.nozzle_type = NozzleType::ntTungstenCarbide;
} }
} else { } else {
nozzle_obj.tool_type = NozzleToolType::NONE_TOOLTYPE; nozzle_obj.tool_type = NozzleToolType::NONE_TOOLTYPE;
@ -6797,7 +6799,7 @@ bool DeviceManager::EnableMultiMachine = false;
bool DeviceManager::key_field_only = false; bool DeviceManager::key_field_only = false;
std::vector<float> nozzle_diameter_list{ 0.2f,0.4f,0.6f,0.8f }; std::vector<float> nozzle_diameter_list{ 0.2f,0.4f,0.6f,0.8f };
std::vector<std::string> nozzle_type_list{ "hardened_steel", "stainless_steel" }; std::vector<std::string> nozzle_type_list {"hardened_steel", "stainless_steel", "tungsten_carbide"};
DeviceManager::DeviceManager(NetworkAgent* agent) DeviceManager::DeviceManager(NetworkAgent* agent)
{ {

View File

@ -188,7 +188,7 @@ struct Nozzle
int id; int id;
NozzleToolType tool_type; // H nozzle or Cut NozzleToolType tool_type; // H nozzle or Cut
NozzleFlowType nozzle_flow; // 0-common 1-high flow NozzleFlowType nozzle_flow; // 0-common 1-high flow
NozzleType nozzle_type; // 0-stainless_steel 1-hardened_steel NozzleType nozzle_type; // 0-stainless_steel 1-hardened_steel 5-tungsten_carbide
float diameter = {0.4f}; // 0-0.2mm 1-0.4mm 2-0.6 mm3-0.8mm float diameter = {0.4f}; // 0-0.2mm 1-0.4mm 2-0.6 mm3-0.8mm
int max_temp = 0; int max_temp = 0;
int wear = 0; int wear = 0;

View File

@ -794,6 +794,7 @@ wxString PrinterPartsDialog::GetString(NozzleType nozzle_type) const {
switch (nozzle_type) { switch (nozzle_type) {
case Slic3r::ntHardenedSteel: return _L("Hardened Steel"); case Slic3r::ntHardenedSteel: return _L("Hardened Steel");
case Slic3r::ntStainlessSteel: return _L("Stainless Steel"); case Slic3r::ntStainlessSteel: return _L("Stainless Steel");
case Slic3r::ntTungstenCarbide: return _L("Tungsten Carbide");
default: break; default: break;
} }

View File

@ -2313,6 +2313,9 @@ wxString SelectMachineDialog::format_steel_name(NozzleType type)
else if (type == NozzleType::ntStainlessSteel) { else if (type == NozzleType::ntStainlessSteel) {
return _L("Stainless Steel"); return _L("Stainless Steel");
} }
else if (type == NozzleType::ntTungstenCarbide) {
return _L("Tungsten Carbide");
}
return _L("Unknown"); return _L("Unknown");
} }

View File

@ -2086,17 +2086,6 @@ void SyncAmsInfoDialog::show_errors(wxString &info)
confirm_dlg.on_show(); confirm_dlg.on_show();
} }
wxString SyncAmsInfoDialog::format_steel_name(NozzleType type)
{
if (type == NozzleType::ntHardenedSteel) {
return _L("Hardened Steel");
} else if (type == NozzleType::ntStainlessSteel) {
return _L("Stainless Steel");
}
return wxEmptyString;
}
void SyncAmsInfoDialog::Enable_Auto_Refill(bool enable) void SyncAmsInfoDialog::Enable_Auto_Refill(bool enable)
{ {
if (!m_ams_backup_tip) { return; } if (!m_ams_backup_tip) { return; }

View File

@ -224,7 +224,6 @@ public:
std::string get_print_status_info(PrintDialogStatus status); std::string get_print_status_info(PrintDialogStatus status);
PrintFromType get_print_type() { return m_print_type; }; PrintFromType get_print_type() { return m_print_type; };
wxString format_steel_name(NozzleType type);
wxString format_text(wxString &m_msg); wxString format_text(wxString &m_msg);
PrintDialogStatus get_status() { return m_print_status; } PrintDialogStatus get_status() { return m_print_status; }
std::vector<std::string> sort_string(std::vector<std::string> strArray); std::vector<std::string> sort_string(std::vector<std::string> strArray);

View File

@ -124,6 +124,8 @@ static wxString to_wstring_name(std::string name)
return _L("Hardened Steel"); return _L("Hardened Steel");
} else if (name == "stainless_steel") { } else if (name == "stainless_steel") {
return _L("Stainless Steel"); return _L("Stainless Steel");
} else if (name == "tungsten_carbide") {
return _L("Tungsten Carbide");
} }
return wxEmptyString; return wxEmptyString;