mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-12 11:37:42 +00:00
Use max limit when current extruder is unknown
This commit is contained in:
@@ -256,7 +256,9 @@ std::string GCodeWriter::set_chamber_temperature(int temperature, bool wait)
|
|||||||
return gcode.str();
|
return gcode.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EXTRUDER_LIMIT(OPT) (OPT.size() <= filament()->extruder_id() ? 0 : OPT[filament()->extruder_id()])
|
#define EXTRUDER_LIMIT(OPT) \
|
||||||
|
(filament() ? ((OPT).size() <= filament()->extruder_id() ? 0 : (OPT)[filament()->extruder_id()]) : \
|
||||||
|
((OPT).empty() ? 0 : *std::max_element((OPT).cbegin(), (OPT).cend())))
|
||||||
|
|
||||||
// copied from PrusaSlicer
|
// copied from PrusaSlicer
|
||||||
std::string GCodeWriter::set_acceleration_internal(Acceleration type, unsigned int acceleration)
|
std::string GCodeWriter::set_acceleration_internal(Acceleration type, unsigned int acceleration)
|
||||||
|
|||||||
@@ -493,10 +493,8 @@ TEST_CASE("Machine envelope emits max limit among used extruders", "[PrintGCode]
|
|||||||
THEN("M205 contains max jerk values") {
|
THEN("M205 contains max jerk values") {
|
||||||
REQUIRE(gcode.find("M205 X12.00 Y13.00 Z0.60 E10.00") != std::string::npos);
|
REQUIRE(gcode.find("M205 X12.00 Y13.00 Z0.60 E10.00") != std::string::npos);
|
||||||
}
|
}
|
||||||
THEN("M205 J is clamped to m_max_junction_deviation (values.front())") {
|
THEN("M205 contains max m_max_junction_deviation ") {
|
||||||
// MAX_LIMIT returns 0.05, but set_junction_deviation clamps to
|
REQUIRE(gcode.find("M205 J0.050") != std::string::npos);
|
||||||
// m_max_junction_deviation which is set from values.front() (0.02).
|
|
||||||
REQUIRE(gcode.find("M205 J0.020") != std::string::npos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user