mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
ENH: remove nozzle_hrc in params page and profiles
use std::map to map nozzle_type to nozzle_hrc Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ie9d1db486808bd5164c7952caecaf4ac279f43d8
This commit is contained in:
parent
0c45cac1a8
commit
793c657b46
18 changed files with 19 additions and 33 deletions
File diff suppressed because one or more lines are too long
|
@ -21,7 +21,6 @@
|
||||||
"min_layer_height": [
|
"min_layer_height": [
|
||||||
"0.12"
|
"0.12"
|
||||||
],
|
],
|
||||||
"nozzle_hrc": "55",
|
|
||||||
"nozzle_type": "hardened_steel",
|
"nozzle_type": "hardened_steel",
|
||||||
"retraction_length": [
|
"retraction_length": [
|
||||||
"1.4"
|
"1.4"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
"min_layer_height": [
|
"min_layer_height": [
|
||||||
"0.16"
|
"0.16"
|
||||||
],
|
],
|
||||||
"nozzle_hrc": "55",
|
|
||||||
"nozzle_type": "hardened_steel",
|
"nozzle_type": "hardened_steel",
|
||||||
"retract_length_toolchange": [
|
"retract_length_toolchange": [
|
||||||
"3"
|
"3"
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
"machine_load_filament_time": "29",
|
"machine_load_filament_time": "29",
|
||||||
"machine_unload_filament_time": "28",
|
"machine_unload_filament_time": "28",
|
||||||
"nozzle_type": "stainless_steel",
|
"nozzle_type": "stainless_steel",
|
||||||
"nozzle_hrc": "20",
|
|
||||||
"auxiliary_fan": "1",
|
"auxiliary_fan": "1",
|
||||||
"upward_compatible_machine":[
|
"upward_compatible_machine":[
|
||||||
"Bambu Lab P1P 0.4 nozzle",
|
"Bambu Lab P1P 0.4 nozzle",
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -18,7 +18,6 @@
|
||||||
"min_layer_height": [
|
"min_layer_height": [
|
||||||
"0.12"
|
"0.12"
|
||||||
],
|
],
|
||||||
"nozzle_hrc": "55",
|
|
||||||
"nozzle_type": "hardened_steel",
|
"nozzle_type": "hardened_steel",
|
||||||
"retraction_length": [
|
"retraction_length": [
|
||||||
"1.4"
|
"1.4"
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
"min_layer_height": [
|
"min_layer_height": [
|
||||||
"0.16"
|
"0.16"
|
||||||
],
|
],
|
||||||
"nozzle_hrc": "55",
|
|
||||||
"nozzle_type": "hardened_steel",
|
"nozzle_type": "hardened_steel",
|
||||||
"retract_length_toolchange": [
|
"retract_length_toolchange": [
|
||||||
"3"
|
"3"
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
"min_layer_height": [
|
"min_layer_height": [
|
||||||
"0.04"
|
"0.04"
|
||||||
],
|
],
|
||||||
"nozzle_hrc": "20",
|
|
||||||
"nozzle_type": "stainless_steel",
|
"nozzle_type": "stainless_steel",
|
||||||
"retraction_length": [
|
"retraction_length": [
|
||||||
"0.4"
|
"0.4"
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -63,6 +63,13 @@ const std::vector<std::string> GCodeProcessor::Reserved_Tags = {
|
||||||
const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START";
|
const std::string GCodeProcessor::Flush_Start_Tag = " FLUSH_START";
|
||||||
const std::string GCodeProcessor::Flush_End_Tag = " FLUSH_END";
|
const std::string GCodeProcessor::Flush_End_Tag = " FLUSH_END";
|
||||||
|
|
||||||
|
const std::map<NozzleType,int> GCodeProcessor::Nozzle_Type_To_HRC={
|
||||||
|
{NozzleType::ntStainlessSteel,20},
|
||||||
|
{NozzleType::ntHardenedSteel,55},
|
||||||
|
{NozzleType::ntBrass,2},
|
||||||
|
{NozzleType::ntUndefine,0}
|
||||||
|
};
|
||||||
|
|
||||||
const float GCodeProcessor::Wipe_Width = 0.05f;
|
const float GCodeProcessor::Wipe_Width = 0.05f;
|
||||||
const float GCodeProcessor::Wipe_Height = 0.05f;
|
const float GCodeProcessor::Wipe_Height = 0.05f;
|
||||||
|
|
||||||
|
@ -910,8 +917,7 @@ void GCodeProcessor::apply_config(const PrintConfig& config)
|
||||||
m_result.filament_densities.resize(extruders_count);
|
m_result.filament_densities.resize(extruders_count);
|
||||||
m_result.filament_vitrification_temperature.resize(extruders_count);
|
m_result.filament_vitrification_temperature.resize(extruders_count);
|
||||||
m_extruder_temps.resize(extruders_count);
|
m_extruder_temps.resize(extruders_count);
|
||||||
m_result.nozzle_hrc = static_cast<int>(config.nozzle_hrc.getInt());
|
m_result.nozzle_type = config.nozzle_type;
|
||||||
|
|
||||||
for (size_t i = 0; i < extruders_count; ++ i) {
|
for (size_t i = 0; i < extruders_count; ++ i) {
|
||||||
m_extruder_offsets[i] = to_3d(config.extruder_offset.get_at(i).cast<float>().eval(), 0.f);
|
m_extruder_offsets[i] = to_3d(config.extruder_offset.get_at(i).cast<float>().eval(), 0.f);
|
||||||
m_extruder_colors[i] = static_cast<unsigned char>(i);
|
m_extruder_colors[i] = static_cast<unsigned char>(i);
|
||||||
|
@ -967,8 +973,9 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
if (nozzle_volume != nullptr)
|
if (nozzle_volume != nullptr)
|
||||||
m_nozzle_volume = nozzle_volume->value;
|
m_nozzle_volume = nozzle_volume->value;
|
||||||
|
|
||||||
const ConfigOptionInt *nozzle_HRC = config.option<ConfigOptionInt>("nozzle_hrc");
|
const ConfigOptionEnum<NozzleType>* nozzle_type = config.option<ConfigOptionEnum<NozzleType>>("nozzle_type");
|
||||||
if (nozzle_HRC != nullptr) m_result.nozzle_hrc = nozzle_HRC->value;
|
if (nozzle_type != nullptr)
|
||||||
|
m_result.nozzle_type=nozzle_type->value;
|
||||||
|
|
||||||
const ConfigOptionEnum<GCodeFlavor>* gcode_flavor = config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor");
|
const ConfigOptionEnum<GCodeFlavor>* gcode_flavor = config.option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor");
|
||||||
if (gcode_flavor != nullptr)
|
if (gcode_flavor != nullptr)
|
||||||
|
@ -4281,12 +4288,14 @@ void GCodeProcessor::update_slice_warnings()
|
||||||
//bbs:HRC checker
|
//bbs:HRC checker
|
||||||
warning.params.clear();
|
warning.params.clear();
|
||||||
warning.level=1;
|
warning.level=1;
|
||||||
if (m_result.nozzle_hrc!=0) {
|
|
||||||
|
int nozzle_hrc = Nozzle_Type_To_HRC.find(m_result.nozzle_type)->second;
|
||||||
|
if (nozzle_hrc!=0) {
|
||||||
for (size_t i = 0; i < used_extruders.size(); i++) {
|
for (size_t i = 0; i < used_extruders.size(); i++) {
|
||||||
int HRC=0;
|
int HRC=0;
|
||||||
if (used_extruders[i] < m_result.required_nozzle_HRC.size())
|
if (used_extruders[i] < m_result.required_nozzle_HRC.size())
|
||||||
HRC = m_result.required_nozzle_HRC[used_extruders[i]];
|
HRC = m_result.required_nozzle_HRC[used_extruders[i]];
|
||||||
if (HRC != 0 && (m_result.nozzle_hrc<HRC))
|
if (HRC != 0 && (nozzle_hrc<HRC))
|
||||||
warning.params.push_back(std::to_string(used_extruders[i]));
|
warning.params.push_back(std::to_string(used_extruders[i]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace Slic3r {
|
||||||
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
std::vector<std::pair<float, std::pair<size_t, size_t>>> spiral_vase_layers;
|
||||||
//BBS
|
//BBS
|
||||||
std::vector<SliceWarning> warnings;
|
std::vector<SliceWarning> warnings;
|
||||||
int nozzle_hrc;
|
NozzleType nozzle_type;
|
||||||
BedType bed_type = BedType::btCount;
|
BedType bed_type = BedType::btCount;
|
||||||
#if ENABLE_GCODE_VIEWER_STATISTICS
|
#if ENABLE_GCODE_VIEWER_STATISTICS
|
||||||
int64_t time{ 0 };
|
int64_t time{ 0 };
|
||||||
|
@ -237,7 +237,7 @@ namespace Slic3r {
|
||||||
static const std::vector<std::string> Reserved_Tags;
|
static const std::vector<std::string> Reserved_Tags;
|
||||||
static const std::string Flush_Start_Tag;
|
static const std::string Flush_Start_Tag;
|
||||||
static const std::string Flush_End_Tag;
|
static const std::string Flush_End_Tag;
|
||||||
|
static const std::map<NozzleType, int>Nozzle_Type_To_HRC;
|
||||||
public:
|
public:
|
||||||
enum class ETags : unsigned char
|
enum class ETags : unsigned char
|
||||||
{
|
{
|
||||||
|
|
|
@ -831,7 +831,7 @@ static std::vector<std::string> s_Preset_printer_options {
|
||||||
"silent_mode",
|
"silent_mode",
|
||||||
// BBS
|
// BBS
|
||||||
"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode",
|
"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_pause_gcode", "template_custom_gcode",
|
||||||
"nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types",
|
"nozzle_type","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types",
|
||||||
//OrcaSlicer
|
//OrcaSlicer
|
||||||
"host_type", "print_host", "printhost_apikey",
|
"host_type", "print_host", "printhost_apikey",
|
||||||
"print_host_webui",
|
"print_host_webui",
|
||||||
|
|
|
@ -146,7 +146,6 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n
|
||||||
"curr_bed_type",
|
"curr_bed_type",
|
||||||
"nozzle_volume",
|
"nozzle_volume",
|
||||||
"chamber_temperature",
|
"chamber_temperature",
|
||||||
"nozzle_hrc",
|
|
||||||
"required_nozzle_HRC",
|
"required_nozzle_HRC",
|
||||||
"upward_compatible_machine",
|
"upward_compatible_machine",
|
||||||
//OrcaSlicer
|
//OrcaSlicer
|
||||||
|
|
|
@ -1675,15 +1675,6 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->mode = comDevelop;
|
def->mode = comDevelop;
|
||||||
def->set_default_value(new ConfigOptionEnum<NozzleType>(ntUndefine));
|
def->set_default_value(new ConfigOptionEnum<NozzleType>(ntUndefine));
|
||||||
|
|
||||||
def = this->add("nozzle_hrc", coInt);
|
|
||||||
def->label = L("Nozzle HRC");
|
|
||||||
def->tooltip = L("The nozzle's hardness. Zero means no checking for nozzle's hardness during slicing.");
|
|
||||||
def->sidetext = L("HRC");
|
|
||||||
def->min = 0;
|
|
||||||
def->max = 500;
|
|
||||||
def->mode = comDevelop;
|
|
||||||
def->set_default_value(new ConfigOptionInt{0});
|
|
||||||
|
|
||||||
def = this->add("auxiliary_fan", coBool);
|
def = this->add("auxiliary_fan", coBool);
|
||||||
def->label = L("Auxiliary part cooling fan");
|
def->label = L("Auxiliary part cooling fan");
|
||||||
def->tooltip = L("Enable this option if machine has auxiliary part cooling fan");
|
def->tooltip = L("Enable this option if machine has auxiliary part cooling fan");
|
||||||
|
@ -4247,7 +4238,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va
|
||||||
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
|
"remove_freq_sweep", "remove_bed_leveling", "remove_extrusion_calibration",
|
||||||
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
|
"support_transition_line_width", "support_transition_speed", "bed_temperature", "bed_temperature_initial_layer",
|
||||||
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height",
|
"can_switch_nozzle_type", "can_add_auxiliary_fan", "extra_flush_volume", "spaghetti_detector", "adaptive_layer_height",
|
||||||
"z_hop_type"
|
"z_hop_type","nozzle_hrc"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (ignore.find(opt_key) != ignore.end()) {
|
if (ignore.find(opt_key) != ignore.end()) {
|
||||||
|
|
|
@ -866,7 +866,6 @@ PRINT_CONFIG_CLASS_DEFINE(
|
||||||
((ConfigOptionString, template_custom_gcode))
|
((ConfigOptionString, template_custom_gcode))
|
||||||
//BBS
|
//BBS
|
||||||
((ConfigOptionEnum<NozzleType>, nozzle_type))
|
((ConfigOptionEnum<NozzleType>, nozzle_type))
|
||||||
((ConfigOptionInt, nozzle_hrc))
|
|
||||||
((ConfigOptionBool, auxiliary_fan))
|
((ConfigOptionBool, auxiliary_fan))
|
||||||
((ConfigOptionBool, accel_to_decel_enable))
|
((ConfigOptionBool, accel_to_decel_enable))
|
||||||
((ConfigOptionPercent, accel_to_decel_factor))
|
((ConfigOptionPercent, accel_to_decel_factor))
|
||||||
|
|
|
@ -3080,7 +3080,6 @@ void TabPrinter::build_fff()
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/);
|
optgroup = page->new_optgroup(L("Accessory") /*, L"param_accessory"*/);
|
||||||
optgroup->append_single_option_line("nozzle_type");
|
optgroup->append_single_option_line("nozzle_type");
|
||||||
optgroup->append_single_option_line("nozzle_hrc");
|
|
||||||
optgroup->append_single_option_line("auxiliary_fan");
|
optgroup->append_single_option_line("auxiliary_fan");
|
||||||
|
|
||||||
const int gcode_field_height = 15; // 150
|
const int gcode_field_height = 15; // 150
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue