update src

This commit is contained in:
QIDI TECH
2025-08-18 10:34:25 +08:00
parent 15dd71693d
commit dab82d0248
11 changed files with 87 additions and 68 deletions

View File

@@ -60,9 +60,10 @@ std::string escape_string_cstyle(const std::string &str)
} else if (c == '\n') {
(*outptr ++) = '\\';
(*outptr ++) = 'n';
} else if (c == '\\') {
(*outptr ++) = '\\';
(*outptr ++) = '\\';
//y70
} else if (c == '\\' || c == '"') {
(*outptr++) = '\\';
(*outptr++) = c;
} else
(*outptr ++) = c;
}
@@ -950,36 +951,44 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
}
}
char single_sep = ',';
char array_sep = '#'; // currenty not used
bool escape_string_type = false;
if (optdef) {
switch (optdef->type)
{
case coStrings:
escape_string_type = true;
single_sep = ';';
break;
case coPointsGroups:
single_sep = '#';
break;
default:
//y70
bool use_comma = true;
if (optdef && optdef->type == coStrings) {
use_comma = false;
}
for (auto iter = it.value().begin(); iter != it.value().end(); iter++) {
if (iter.value().is_string()) {
if (!first) {
if (use_comma)
value_str += ",";
else
value_str += ";";
}
else
first = false;
if (use_comma)
value_str += iter.value();
else {
value_str += "\"";
value_str += escape_string_cstyle(iter.value());
value_str += "\"";
}
}
else {
//should not happen
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << file << " error, invalid json array for " << it.key();
valid = false;
break;
}
}
// QDS: we only support 2 depth array
valid = parse_str_arr(it, single_sep, array_sep,escape_string_type, value_str);
if (!valid) {
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << file << " error, invalid json array for " << it.key();
break;
}
if (valid)
this->set_deserialize(opt_key, value_str, substitution_context);
}
else {
//should not happen
BOOST_LOG_TRIVIAL(error) << __FUNCTION__<< ": parse "<<file<<" error, invalid json type for " << it.key();
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << file << " error, invalid json type for " << it.key();
}
}
}

View File

@@ -2924,15 +2924,14 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id());
activate_air_filtration &= m_config.support_air_filtration.getBool();
//w36
/*if (activate_air_filtration) {
if (activate_air_filtration) {
int complete_print_exhaust_fan_speed = 0;
for (const auto& extruder : m_writer.extruders())
if (m_config.activate_air_filtration.get_at(extruder.id()))
complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id()));
file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true));
}*/
file.write(m_writer.set_exhaust_fan(0, true));
}
//w25
file.write(DoExport::update_print_stats_and_format_filament_stats(
// Const inputs

View File

@@ -2844,8 +2844,9 @@ WipeTower::ToolChangeResult WipeTower::merge_tcr(ToolChangeResult &first, ToolCh
assert(first.new_tool == second.initial_tool);
WipeTower::ToolChangeResult out = first;
if ((first.end_pos - second.start_pos).norm() > (float)EPSILON) {
//y70
std::string travel_gcode = "G1 X" + Slic3r::float_to_string_decimal_point(second.start_pos.x(), 3) + " Y" +
Slic3r::float_to_string_decimal_point(second.start_pos.y(), 3) + " F" + std::to_string(m_max_speed) + "\n";
Slic3r::float_to_string_decimal_point(second.start_pos.y(), 3) + " F" + Slic3r::float_to_string_decimal_point(m_max_speed, 3) + "\n";
bool need_insert_travel = true;
if (second.is_tool_change
&& is_approx(second.start_pos.x(), second.tool_change_start_pos.x())

View File

@@ -501,7 +501,7 @@ void PresetBundle::reset_project_embedded_presets()
if (!prefered_filament_profile.empty())
filament_presets[i] = prefered_filament_profile;
else
filament_presets[i] = this->filaments.first_visible().name;
filament_presets[i] = this->filaments.first_visible().name;
}
}
}