mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-24 23:27:46 +08:00
Rework G10 temperature support to be enabled only for a new Firmware type RepRapFirmware
leaving the RepRap/Sprinter
behaviour alone. Rename the enum for gcfRepRap
to gcfRepRapSprinter
and add new gcfRepRapFirmware
enum value. Also adds code to only use the G10 searching in custom G-code if the flavour is RepRapFirmware.
This commit is contained in:
parent
e275197518
commit
f6d25d0634
@ -500,7 +500,7 @@ std::string WipeTowerIntegration::prime(GCode &gcodegen)
|
|||||||
|
|
||||||
|
|
||||||
// Disable linear advance for the wipe tower operations.
|
// Disable linear advance for the wipe tower operations.
|
||||||
//gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
//gcode += (gcodegen.config().gcode_flavor == gcfRepRapSprinter ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||||
|
|
||||||
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
|
for (const WipeTower::ToolChangeResult& tcr : m_priming) {
|
||||||
if (!tcr.extrusions.empty())
|
if (!tcr.extrusions.empty())
|
||||||
@ -1720,7 +1720,8 @@ void GCode::_print_first_layer_extruder_temperatures(FILE *file, Print &print, c
|
|||||||
{
|
{
|
||||||
// Is the bed temperature set by the provided custom G-code?
|
// Is the bed temperature set by the provided custom G-code?
|
||||||
int temp_by_gcode = -1;
|
int temp_by_gcode = -1;
|
||||||
if (custom_gcode_sets_temperature(gcode, 104, 109, true, temp_by_gcode)) {
|
bool include_g10 = (print.config().gcode_flavor == gcfRepRapFirmware);
|
||||||
|
if (custom_gcode_sets_temperature(gcode, 104, 109, include_g10, temp_by_gcode)) {
|
||||||
// Set the extruder temperature at m_writer, but throw away the generated G-code as it will be written with the custom G-code.
|
// Set the extruder temperature at m_writer, but throw away the generated G-code as it will be written with the custom G-code.
|
||||||
int temp = print.config().first_layer_temperature.get_at(first_printing_extruder_id);
|
int temp = print.config().first_layer_temperature.get_at(first_printing_extruder_id);
|
||||||
if (temp_by_gcode >= 0 && temp_by_gcode < 1000)
|
if (temp_by_gcode >= 0 && temp_by_gcode < 1000)
|
||||||
|
@ -102,7 +102,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
WipeTowerWriter& disable_linear_advance() {
|
WipeTowerWriter& disable_linear_advance() {
|
||||||
m_gcode += (m_gcode_flavor == gcfRepRap
|
m_gcode += (m_gcode_flavor == gcfRepRapSprinter || m_gcode_flavor == gcfRepRapFirmware
|
||||||
? (std::string("M572 D") + std::to_string(m_current_tool) + " S0\n")
|
? (std::string("M572 D") + std::to_string(m_current_tool) + " S0\n")
|
||||||
: std::string("M900 K0\n"));
|
: std::string("M900 K0\n"));
|
||||||
return *this;
|
return *this;
|
||||||
@ -351,7 +351,7 @@ public:
|
|||||||
// Set digital trimpot motor
|
// Set digital trimpot motor
|
||||||
WipeTowerWriter& set_extruder_trimpot(int current)
|
WipeTowerWriter& set_extruder_trimpot(int current)
|
||||||
{
|
{
|
||||||
if (m_gcode_flavor == gcfRepRap)
|
if (m_gcode_flavor == gcfRepRapSprinter || m_gcode_flavor == gcfRepRapFirmware)
|
||||||
m_gcode += "M906 E";
|
m_gcode += "M906 E";
|
||||||
else
|
else
|
||||||
m_gcode += "M907 E";
|
m_gcode += "M907 E";
|
||||||
|
@ -622,7 +622,7 @@ namespace Slic3r {
|
|||||||
void GCodeTimeEstimator::set_default()
|
void GCodeTimeEstimator::set_default()
|
||||||
{
|
{
|
||||||
set_units(Millimeters);
|
set_units(Millimeters);
|
||||||
set_dialect(gcfRepRap);
|
set_dialect(gcfRepRapSprinter);
|
||||||
set_global_positioning_type(Absolute);
|
set_global_positioning_type(Absolute);
|
||||||
set_e_local_positioning_type(Absolute);
|
set_e_local_positioning_type(Absolute);
|
||||||
|
|
||||||
@ -1201,7 +1201,8 @@ namespace Slic3r {
|
|||||||
if ((dialect == gcfRepetier) ||
|
if ((dialect == gcfRepetier) ||
|
||||||
(dialect == gcfMarlin) ||
|
(dialect == gcfMarlin) ||
|
||||||
(dialect == gcfSmoothie) ||
|
(dialect == gcfSmoothie) ||
|
||||||
(dialect == gcfRepRap))
|
(dialect == gcfRepRapSprinter) ||
|
||||||
|
(dialect == gcfRepRapFirmware))
|
||||||
{
|
{
|
||||||
if (line.has_value('S', value))
|
if (line.has_value('S', value))
|
||||||
extra_time += value;
|
extra_time += value;
|
||||||
@ -1313,7 +1314,7 @@ namespace Slic3r {
|
|||||||
GCodeFlavor dialect = get_dialect();
|
GCodeFlavor dialect = get_dialect();
|
||||||
|
|
||||||
// see http://reprap.org/wiki/G-code#M201:_Set_max_printing_acceleration
|
// see http://reprap.org/wiki/G-code#M201:_Set_max_printing_acceleration
|
||||||
float factor = ((dialect != gcfRepRap) && (get_units() == GCodeTimeEstimator::Inches)) ? INCHES_TO_MM : 1.0f;
|
float factor = ((dialect != gcfRepRapSprinter && dialect != gcfRepRapFirmware) && (get_units() == GCodeTimeEstimator::Inches)) ? INCHES_TO_MM : 1.0f;
|
||||||
|
|
||||||
if (line.has_x())
|
if (line.has_x())
|
||||||
set_axis_max_acceleration(X, line.x() * factor);
|
set_axis_max_acceleration(X, line.x() * factor);
|
||||||
|
@ -46,7 +46,13 @@ std::string GCodeWriter::preamble()
|
|||||||
gcode << "G21 ; set units to millimeters\n";
|
gcode << "G21 ; set units to millimeters\n";
|
||||||
gcode << "G90 ; use absolute coordinates\n";
|
gcode << "G90 ; use absolute coordinates\n";
|
||||||
}
|
}
|
||||||
if (FLAVOR_IS(gcfRepRap) || FLAVOR_IS(gcfMarlin) || FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepetier) || FLAVOR_IS(gcfSmoothie)) {
|
if (FLAVOR_IS(gcfRepRapSprinter) ||
|
||||||
|
FLAVOR_IS(gcfRepRapFirmware) ||
|
||||||
|
FLAVOR_IS(gcfMarlin) ||
|
||||||
|
FLAVOR_IS(gcfTeacup) ||
|
||||||
|
FLAVOR_IS(gcfRepetier) ||
|
||||||
|
FLAVOR_IS(gcfSmoothie))
|
||||||
|
{
|
||||||
if (this->config.use_relative_e_distances) {
|
if (this->config.use_relative_e_distances) {
|
||||||
gcode << "M83 ; use relative distances for extrusion\n";
|
gcode << "M83 ; use relative distances for extrusion\n";
|
||||||
} else {
|
} else {
|
||||||
@ -72,11 +78,11 @@ std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, in
|
|||||||
return "";
|
return "";
|
||||||
|
|
||||||
std::string code, comment;
|
std::string code, comment;
|
||||||
if (wait && FLAVOR_IS_NOT(gcfTeacup) && FLAVOR_IS_NOT(gcfRepRap)) {
|
if (wait && FLAVOR_IS_NOT(gcfTeacup) && FLAVOR_IS_NOT(gcfRepRapFirmware)) {
|
||||||
code = "M109";
|
code = "M109";
|
||||||
comment = "set temperature and wait for it to be reached";
|
comment = "set temperature and wait for it to be reached";
|
||||||
} else {
|
} else {
|
||||||
if (FLAVOR_IS(gcfRepRap)) { // M104 is deprecated on RepRapFirmware
|
if (FLAVOR_IS(gcfRepRapFirmware)) { // M104 is deprecated on RepRapFirmware
|
||||||
code = "G10";
|
code = "G10";
|
||||||
} else {
|
} else {
|
||||||
code = "M104";
|
code = "M104";
|
||||||
@ -94,7 +100,7 @@ std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, in
|
|||||||
gcode << temperature;
|
gcode << temperature;
|
||||||
bool multiple_tools = this->multiple_extruders && ! m_single_extruder_multi_material;
|
bool multiple_tools = this->multiple_extruders && ! m_single_extruder_multi_material;
|
||||||
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) ) {
|
if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) ) {
|
||||||
if (FLAVOR_IS(gcfRepRap)) {
|
if (FLAVOR_IS(gcfRepRapFirmware)) {
|
||||||
gcode << " P" << tool;
|
gcode << " P" << tool;
|
||||||
} else {
|
} else {
|
||||||
gcode << " T" << tool;
|
gcode << " T" << tool;
|
||||||
@ -102,7 +108,7 @@ std::string GCodeWriter::set_temperature(unsigned int temperature, bool wait, in
|
|||||||
}
|
}
|
||||||
gcode << " ; " << comment << "\n";
|
gcode << " ; " << comment << "\n";
|
||||||
|
|
||||||
if ((FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepRap)) && wait)
|
if ((FLAVOR_IS(gcfTeacup) || FLAVOR_IS(gcfRepRapFirmware)) && wait)
|
||||||
gcode << "M116 ; wait for temperature to be reached\n";
|
gcode << "M116 ; wait for temperature to be reached\n";
|
||||||
|
|
||||||
return gcode.str();
|
return gcode.str();
|
||||||
|
@ -1259,8 +1259,9 @@ std::string Print::validate() const
|
|||||||
"and use filaments of the same diameter.");
|
"and use filaments of the same diameter.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_config.gcode_flavor != gcfRepRap && m_config.gcode_flavor != gcfRepetier && m_config.gcode_flavor != gcfMarlin)
|
if (m_config.gcode_flavor != gcfRepRapSprinter && m_config.gcode_flavor != gcfRepRapFirmware &&
|
||||||
return L("The Wipe Tower is currently only supported for the Marlin, RepRap/Sprinter and Repetier G-code flavors.");
|
m_config.gcode_flavor != gcfRepetier && m_config.gcode_flavor != gcfMarlin)
|
||||||
|
return L("The Wipe Tower is currently only supported for the Marlin, RepRap/Sprinter, RepRapFirmware and Repetier G-code flavors.");
|
||||||
if (! m_config.use_relative_e_distances)
|
if (! m_config.use_relative_e_distances)
|
||||||
return L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).");
|
return L("The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).");
|
||||||
if (m_config.ooze_prevention)
|
if (m_config.ooze_prevention)
|
||||||
|
@ -953,6 +953,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
"The \"No extrusion\" flavor prevents PrusaSlicer from exporting any extrusion value at all.");
|
"The \"No extrusion\" flavor prevents PrusaSlicer from exporting any extrusion value at all.");
|
||||||
def->enum_keys_map = &ConfigOptionEnum<GCodeFlavor>::get_enum_values();
|
def->enum_keys_map = &ConfigOptionEnum<GCodeFlavor>::get_enum_values();
|
||||||
def->enum_values.push_back("reprap");
|
def->enum_values.push_back("reprap");
|
||||||
|
def->enum_values.push_back("reprapfirmware");
|
||||||
def->enum_values.push_back("repetier");
|
def->enum_values.push_back("repetier");
|
||||||
def->enum_values.push_back("teacup");
|
def->enum_values.push_back("teacup");
|
||||||
def->enum_values.push_back("makerware");
|
def->enum_values.push_back("makerware");
|
||||||
@ -963,6 +964,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->enum_values.push_back("smoothie");
|
def->enum_values.push_back("smoothie");
|
||||||
def->enum_values.push_back("no-extrusion");
|
def->enum_values.push_back("no-extrusion");
|
||||||
def->enum_labels.push_back("RepRap/Sprinter");
|
def->enum_labels.push_back("RepRap/Sprinter");
|
||||||
|
def->enum_labels.push_back("RepRapFirmware");
|
||||||
def->enum_labels.push_back("Repetier");
|
def->enum_labels.push_back("Repetier");
|
||||||
def->enum_labels.push_back("Teacup");
|
def->enum_labels.push_back("Teacup");
|
||||||
def->enum_labels.push_back("MakerWare (MakerBot)");
|
def->enum_labels.push_back("MakerWare (MakerBot)");
|
||||||
@ -973,7 +975,7 @@ void PrintConfigDef::init_fff_params()
|
|||||||
def->enum_labels.push_back("Smoothie");
|
def->enum_labels.push_back("Smoothie");
|
||||||
def->enum_labels.push_back(L("No extrusion"));
|
def->enum_labels.push_back(L("No extrusion"));
|
||||||
def->mode = comExpert;
|
def->mode = comExpert;
|
||||||
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfRepRap));
|
def->set_default_value(new ConfigOptionEnum<GCodeFlavor>(gcfRepRapSprinter));
|
||||||
|
|
||||||
def = this->add("gcode_label_objects", coBool);
|
def = this->add("gcode_label_objects", coBool);
|
||||||
def->label = L("Label objects");
|
def->label = L("Label objects");
|
||||||
@ -3290,11 +3292,12 @@ std::string FullPrintConfig::validate()
|
|||||||
|
|
||||||
if (this->use_firmware_retraction.value &&
|
if (this->use_firmware_retraction.value &&
|
||||||
this->gcode_flavor.value != gcfSmoothie &&
|
this->gcode_flavor.value != gcfSmoothie &&
|
||||||
this->gcode_flavor.value != gcfRepRap &&
|
this->gcode_flavor.value != gcfRepRapSprinter &&
|
||||||
|
this->gcode_flavor.value != gcfRepRapFirmware &&
|
||||||
this->gcode_flavor.value != gcfMarlin &&
|
this->gcode_flavor.value != gcfMarlin &&
|
||||||
this->gcode_flavor.value != gcfMachinekit &&
|
this->gcode_flavor.value != gcfMachinekit &&
|
||||||
this->gcode_flavor.value != gcfRepetier)
|
this->gcode_flavor.value != gcfRepetier)
|
||||||
return "--use-firmware-retraction is only supported by Marlin, Smoothie, Repetier and Machinekit firmware";
|
return "--use-firmware-retraction is only supported by Marlin, Smoothie, RepRapFirmware, Repetier and Machinekit firmware";
|
||||||
|
|
||||||
if (this->use_firmware_retraction.value)
|
if (this->use_firmware_retraction.value)
|
||||||
for (unsigned char wipe : this->wipe.values)
|
for (unsigned char wipe : this->wipe.values)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
enum GCodeFlavor : unsigned char {
|
enum GCodeFlavor : unsigned char {
|
||||||
gcfRepRap, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlin, gcfSailfish, gcfMach3, gcfMachinekit,
|
gcfRepRapSprinter, gcfRepRapFirmware, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlin, gcfSailfish, gcfMach3, gcfMachinekit,
|
||||||
gcfSmoothie, gcfNoExtrusion,
|
gcfSmoothie, gcfNoExtrusion,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -84,7 +84,8 @@ template<> inline const t_config_enum_values& ConfigOptionEnum<PrinterTechnology
|
|||||||
template<> inline const t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
|
template<> inline const t_config_enum_values& ConfigOptionEnum<GCodeFlavor>::get_enum_values() {
|
||||||
static t_config_enum_values keys_map;
|
static t_config_enum_values keys_map;
|
||||||
if (keys_map.empty()) {
|
if (keys_map.empty()) {
|
||||||
keys_map["reprap"] = gcfRepRap;
|
keys_map["reprap"] = gcfRepRapSprinter;
|
||||||
|
keys_map["reprapfirmware"] = gcfRepRapFirmware;
|
||||||
keys_map["repetier"] = gcfRepetier;
|
keys_map["repetier"] = gcfRepetier;
|
||||||
keys_map["teacup"] = gcfTeacup;
|
keys_map["teacup"] = gcfTeacup;
|
||||||
keys_map["makerware"] = gcfMakerWare;
|
keys_map["makerware"] = gcfMakerWare;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user