mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 06:41:14 -06:00
Fixed errors after cherry picking Prusalink related commits
Add Prusa MK4 profile (working, but more work to do)
This commit is contained in:
commit
15d3aa646e
32 changed files with 676 additions and 257 deletions
|
@ -335,6 +335,9 @@ void AppConfig::set_defaults()
|
|||
// }
|
||||
// #endif
|
||||
|
||||
if (get("allow_ip_resolve").empty())
|
||||
set("allow_ip_resolve", "1");
|
||||
|
||||
if (get("presets", "filament_colors").empty()) {
|
||||
set_str("presets", "filament_colors", "#F2754E");
|
||||
}
|
||||
|
|
|
@ -80,6 +80,8 @@ public:
|
|||
{ std::string value; this->get(section, key, value); return value; }
|
||||
std::string get(const std::string &key) const
|
||||
{ std::string value; this->get("app", key, value); return value; }
|
||||
bool get_bool(const std::string &key) const
|
||||
{ return this->get(key) == "true"; }
|
||||
void set(const std::string §ion, const std::string &key, const std::string &value)
|
||||
{
|
||||
#ifndef NDEBUG
|
||||
|
|
|
@ -2489,6 +2489,12 @@ void GCode::print_machine_envelope(GCodeOutputStream &file, Print &print)
|
|||
file.write_format("M204 P%d T%d ; sets acceleration (P, T), mm/sec^2\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
travel_acc);
|
||||
else if (flavor == gcfMarlinFirmware)
|
||||
// New Marlin uses M204 P[print] R[retract] T[travel]
|
||||
file.write_format("M204 P%d R%d T%d ; sets acceleration (P, T) and retract acceleration (R), mm/sec^2\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_retracting.values.front() + 0.5),
|
||||
int(print.config().machine_max_acceleration_travel.values.front() + 0.5));
|
||||
else
|
||||
file.write_format("M204 P%d R%d T%d\n",
|
||||
int(print.config().machine_max_acceleration_extruding.values.front() + 0.5),
|
||||
|
|
|
@ -18,16 +18,20 @@ namespace Slic3r {
|
|||
bool GCodeWriter::full_gcode_comment = true;
|
||||
const double GCodeWriter::slope_threshold = 3 * PI / 180;
|
||||
|
||||
bool supports_separate_travel_acceleration(GCodeFlavor flavor)
|
||||
{
|
||||
return (flavor == gcfRepetier || flavor == gcfMarlinFirmware || flavor == gcfRepRapFirmware);
|
||||
}
|
||||
|
||||
void GCodeWriter::apply_print_config(const PrintConfig &print_config)
|
||||
{
|
||||
this->config.apply(print_config, true);
|
||||
m_single_extruder_multi_material = print_config.single_extruder_multi_material.value;
|
||||
bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy ||
|
||||
print_config.gcode_flavor.value == gcfMarlinFirmware ||
|
||||
print_config.gcode_flavor.value == gcfKlipper ||
|
||||
print_config.gcode_flavor.value == gcfRepRapFirmware;
|
||||
bool use_mach_limits = print_config.gcode_flavor.value == gcfMarlinLegacy || print_config.gcode_flavor.value == gcfMarlinFirmware ||
|
||||
print_config.gcode_flavor.value == gcfKlipper || print_config.gcode_flavor.value == gcfRepRapFirmware;
|
||||
m_max_acceleration = std::lrint(use_mach_limits ? print_config.machine_max_acceleration_extruding.values.front() : 0);
|
||||
m_max_jerk = std::lrint(use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
|
||||
m_max_jerk = std::lrint(
|
||||
use_mach_limits ? std::min(print_config.machine_max_jerk_x.values.front(), print_config.machine_max_jerk_y.values.front()) : 0);
|
||||
m_max_jerk_z = print_config.machine_max_jerk_z.values.front();
|
||||
m_max_jerk_e = print_config.machine_max_jerk_e.values.front();
|
||||
}
|
||||
|
|
|
@ -1972,7 +1972,7 @@ void PrintConfigDef::init_fff_params()
|
|||
//def->enum_values.push_back("repetier");
|
||||
//def->enum_values.push_back("teacup");
|
||||
//def->enum_values.push_back("makerware");
|
||||
//def->enum_values.push_back("marlin2");
|
||||
def->enum_values.push_back("marlin2");
|
||||
//def->enum_values.push_back("sailfish");
|
||||
//def->enum_values.push_back("mach3");
|
||||
//def->enum_values.push_back("machinekit");
|
||||
|
@ -1985,7 +1985,7 @@ void PrintConfigDef::init_fff_params()
|
|||
//def->enum_labels.push_back("Repetier");
|
||||
//def->enum_labels.push_back("Teacup");
|
||||
//def->enum_labels.push_back("MakerWare (MakerBot)");
|
||||
//def->enum_labels.push_back("Marlin 2");
|
||||
def->enum_labels.push_back("Marlin 2");
|
||||
//def->enum_labels.push_back("Sailfish (MakerBot)");
|
||||
//def->enum_labels.push_back("Mach3/LinuxCNC");
|
||||
//def->enum_labels.push_back("Machinekit");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue