mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 10:15:55 +08:00
New extruder temperature is only set when it differs from the old one
This commit is contained in:
parent
290e3e66c0
commit
706dd7020f
@ -260,10 +260,13 @@ public:
|
|||||||
// Set extruder temperature, don't wait by default.
|
// Set extruder temperature, don't wait by default.
|
||||||
Writer& set_extruder_temp(int temperature, bool wait = false)
|
Writer& set_extruder_temp(int temperature, bool wait = false)
|
||||||
{
|
{
|
||||||
char buf[128];
|
if (temperature != current_temp) {
|
||||||
sprintf(buf, "M%d S%d\n", wait ? 109 : 104, temperature);
|
char buf[128];
|
||||||
m_gcode += buf;
|
sprintf(buf, "M%d S%d\n", wait ? 109 : 104, temperature);
|
||||||
return *this;
|
m_gcode += buf;
|
||||||
|
current_temp = temperature;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Wait for a period of time (seconds).
|
// Wait for a period of time (seconds).
|
||||||
@ -377,6 +380,7 @@ private:
|
|||||||
float m_wipe_tower_width = 0.f;
|
float m_wipe_tower_width = 0.f;
|
||||||
float m_wipe_tower_depth = 0.f;
|
float m_wipe_tower_depth = 0.f;
|
||||||
float m_last_fan_speed = 0.f;
|
float m_last_fan_speed = 0.f;
|
||||||
|
int current_temp = -1;
|
||||||
|
|
||||||
std::string
|
std::string
|
||||||
set_format_X(float x)
|
set_format_X(float x)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user