New extruder temperature is only set when it differs from the old one
This commit is contained in:
parent
290e3e66c0
commit
706dd7020f
1 changed files with 8 additions and 4 deletions
|
@ -260,9 +260,12 @@ public:
|
|||
// Set extruder temperature, don't wait by default.
|
||||
Writer& set_extruder_temp(int temperature, bool wait = false)
|
||||
{
|
||||
if (temperature != current_temp) {
|
||||
char buf[128];
|
||||
sprintf(buf, "M%d S%d\n", wait ? 109 : 104, temperature);
|
||||
m_gcode += buf;
|
||||
current_temp = temperature;
|
||||
}
|
||||
return *this;
|
||||
};
|
||||
|
||||
|
@ -377,6 +380,7 @@ private:
|
|||
float m_wipe_tower_width = 0.f;
|
||||
float m_wipe_tower_depth = 0.f;
|
||||
float m_last_fan_speed = 0.f;
|
||||
int current_temp = -1;
|
||||
|
||||
std::string
|
||||
set_format_X(float x)
|
||||
|
|
Loading…
Reference in a new issue