Update P2 P3 fan gcode

This commit is contained in:
QIDI TECH
2023-09-23 13:41:54 +08:00
parent 40e1a5534e
commit 478a3cabc4
2 changed files with 20 additions and 6 deletions

View File

@@ -39,6 +39,9 @@ void CoolingBuffer::reset(const Vec3d &position)
m_current_pos[2] = float(position.z());
m_current_pos[4] = float(m_config.travel_speed.value);
m_fan_speed = -1;
//Y12
m_fan_speed = -1;
m_fan_speed = -1;
}
struct CoolingLine
@@ -807,16 +810,24 @@ std::string CoolingBuffer::apply_layer_cooldown(
}
//B15 //B39
if (int(layer_id) == disable_rapid_cooling_fan_first_layers) {
int auxiliary_fan_speed_new = 255 * enable_auxiliary_fan / 100;
if (auxiliary_fan_speed_new != m_auxiliary_fan_speed) {
std::ostringstream fan_gcode;
fan_gcode << "M106 P2 S" << 255.0 * enable_auxiliary_fan / 100.0 << "\n";
m_auxiliary_fan_speed = auxiliary_fan_speed_new;
fan_gcode << "M106 P2 S" << auxiliary_fan_speed_new << "\n";
new_gcode += fan_gcode.str();
}
}
//B25
if (int(layer_id) == disable_fan_first_layers) {
int volume_fan_speed_new = 255 * enable_volume_fan / 100;
if (volume_fan_speed_new != m_volume_fan_speed) {
std::ostringstream fan_gcode;
fan_gcode << "M106 P3 S" << 255.0 * enable_volume_fan / 100.0 << "\n";
m_volume_fan_speed = volume_fan_speed_new;
fan_gcode << "M106 P3 S" << volume_fan_speed_new << "\n";
new_gcode += fan_gcode.str();
}
}
if (fan_speed_new != m_fan_speed) {
m_fan_speed = fan_speed_new;

View File

@@ -45,6 +45,9 @@ private:
std::vector<float> m_current_pos;
// Current known fan speed or -1 if not known yet.
int m_fan_speed;
//Y12
int m_auxiliary_fan_speed;
int m_volume_fan_speed;
// Cached from GCodeWriter.
// Printing extruder IDs, zero based.
std::vector<unsigned int> m_extruder_ids;