mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-25 15:44:12 -06:00
Merge branch 'master' of https://github.com/Prusa3d/Slic3r
This commit is contained in:
commit
17100ef2fe
60 changed files with 5238 additions and 4256 deletions
|
@ -184,7 +184,7 @@ std::string WipeTowerIntegration::append_tcr(GCode &gcodegen, const WipeTower::T
|
|||
|
||||
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
gcode += "M900 K0\n";
|
||||
gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
// Move over the wipe tower.
|
||||
// Retract for a tool change, using the toolchange retract value and setting the priming extra length.
|
||||
gcode += gcodegen.retract(true);
|
||||
|
@ -289,7 +289,7 @@ std::string WipeTowerIntegration::prime(GCode &gcodegen)
|
|||
|
||||
if (&m_priming != nullptr && ! m_priming.extrusions.empty()) {
|
||||
// Disable linear advance for the wipe tower operations.
|
||||
gcode += "M900 K0\n";
|
||||
gcode += (gcodegen.config().gcode_flavor == gcfRepRap ? std::string("M572 D0 S0\n") : std::string("M900 K0\n"));
|
||||
// Let the tool change be executed by the wipe tower class.
|
||||
// Inform the G-code writer about the changes done behind its back.
|
||||
gcode += m_priming.gcode;
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace PrusaMultiMaterial {
|
|||
class Writer
|
||||
{
|
||||
public:
|
||||
Writer(float layer_height, float line_width) :
|
||||
Writer(float layer_height, float line_width, GCodeFlavor flavor) :
|
||||
m_current_pos(std::numeric_limits<float>::max(), std::numeric_limits<float>::max()),
|
||||
m_current_z(0.f),
|
||||
m_current_feedrate(0.f),
|
||||
|
@ -48,7 +48,8 @@ public:
|
|||
m_extrusion_flow(0.f),
|
||||
m_preview_suppressed(false),
|
||||
m_elapsed_time(0.f),
|
||||
m_default_analyzer_line_width(line_width)
|
||||
m_default_analyzer_line_width(line_width),
|
||||
m_gcode_flavor(flavor)
|
||||
{
|
||||
// adds tag for analyzer:
|
||||
char buf[64];
|
||||
|
@ -333,7 +334,10 @@ public:
|
|||
Writer& set_extruder_trimpot(int current)
|
||||
{
|
||||
char buf[128];
|
||||
sprintf(buf, "M907 E%d\n", current);
|
||||
if (m_gcode_flavor == gcfRepRap)
|
||||
sprintf(buf, "M906 E%d\n", current);
|
||||
else
|
||||
sprintf(buf, "M907 E%d\n", current);
|
||||
m_gcode += buf;
|
||||
return *this;
|
||||
};
|
||||
|
@ -407,6 +411,7 @@ private:
|
|||
int current_temp = -1;
|
||||
const float m_default_analyzer_line_width;
|
||||
float m_used_filament_length = 0.f;
|
||||
GCodeFlavor m_gcode_flavor;
|
||||
|
||||
std::string set_format_X(float x)
|
||||
{
|
||||
|
@ -510,7 +515,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::prime(
|
|||
const float prime_section_width = std::min(240.f / tools.size(), 60.f);
|
||||
box_coordinates cleaning_box(xy(5.f, 0.01f + m_perimeter_width/2.f), prime_section_width, 100.f);
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -612,7 +617,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
|
|||
(tool != (unsigned int)(-1) ? /*m_layer_info->depth*/wipe_area+m_depth_traversed-0.5*m_perimeter_width
|
||||
: m_wipe_tower_depth-m_perimeter_width));
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -631,7 +636,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
|
|||
|
||||
// Increase the extruder driver current to allow fast ramming.
|
||||
if (m_set_extruder_trimpot)
|
||||
writer.set_extruder_trimpot(550);
|
||||
writer.set_extruder_trimpot(750);
|
||||
|
||||
// Ram the hot material out of the melt zone, retract the filament into the cooling tubes and let it cool.
|
||||
if (tool != (unsigned int)-1){ // This is not the last change.
|
||||
|
@ -693,7 +698,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::toolchange_Brim(bool sideOnly, flo
|
|||
m_wipe_tower_width,
|
||||
m_wipe_tower_depth);
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow * 1.1f)
|
||||
.set_z(m_z_pos) // Let the writer know the current Z position as a base for Z-hop.
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
@ -1022,7 +1027,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
|
|||
// Otherwise the caller would likely travel to the wipe tower in vain.
|
||||
assert(! this->layer_finished());
|
||||
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width);
|
||||
PrusaMultiMaterial::Writer writer(m_layer_height, m_perimeter_width, m_gcode_flavor);
|
||||
writer.set_extrusion_flow(m_extrusion_flow)
|
||||
.set_z(m_z_pos)
|
||||
.set_initial_tool(m_current_tool)
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include <algorithm>
|
||||
|
||||
#include "WipeTower.hpp"
|
||||
#include "PrintConfig.hpp"
|
||||
|
||||
|
||||
namespace Slic3r
|
||||
|
@ -46,7 +47,7 @@ public:
|
|||
// wipe_area -- space available for one toolchange in mm
|
||||
WipeTowerPrusaMM(float x, float y, float width, float rotation_angle, float cooling_tube_retraction,
|
||||
float cooling_tube_length, float parking_pos_retraction, float extra_loading_move,
|
||||
float bridging, bool set_extruder_trimpot,
|
||||
float bridging, bool set_extruder_trimpot, GCodeFlavor flavor,
|
||||
const std::vector<std::vector<float>>& wiping_matrix, unsigned int initial_tool) :
|
||||
m_wipe_tower_pos(x, y),
|
||||
m_wipe_tower_width(width),
|
||||
|
@ -60,6 +61,7 @@ public:
|
|||
m_extra_loading_move(extra_loading_move),
|
||||
m_bridging(bridging),
|
||||
m_set_extruder_trimpot(set_extruder_trimpot),
|
||||
m_gcode_flavor(flavor),
|
||||
m_current_tool(initial_tool),
|
||||
wipe_volumes(wiping_matrix)
|
||||
{}
|
||||
|
@ -223,6 +225,7 @@ private:
|
|||
bool m_set_extruder_trimpot = false;
|
||||
bool m_retain_speed_override = true;
|
||||
bool m_adhesion = true;
|
||||
GCodeFlavor m_gcode_flavor;
|
||||
|
||||
float m_perimeter_width = 0.4f * Width_To_Nozzle_Ratio; // Width of an extrusion line, also a perimeter spacing for 100% infill.
|
||||
float m_extrusion_flow = 0.038f; //0.029f;// Extrusion flow is derived from m_perimeter_width, layer height and filament diameter.
|
||||
|
|
|
@ -126,7 +126,6 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
|||
"first_layer_bed_temperature",
|
||||
"first_layer_speed",
|
||||
"gcode_comments",
|
||||
"gcode_flavor",
|
||||
"gcode_label_objects",
|
||||
"infill_acceleration",
|
||||
"layer_gcode",
|
||||
|
@ -1777,7 +1776,7 @@ void Print::_make_wipe_tower()
|
|||
float(m_config.wipe_tower_rotation_angle.value), float(m_config.cooling_tube_retraction.value),
|
||||
float(m_config.cooling_tube_length.value), float(m_config.parking_pos_retraction.value),
|
||||
float(m_config.extra_loading_move.value), float(m_config.wipe_tower_bridging),
|
||||
m_config.high_current_on_filament_swap.value, wipe_volumes,
|
||||
m_config.high_current_on_filament_swap.value, m_config.gcode_flavor, wipe_volumes,
|
||||
m_wipe_tower_data.tool_ordering.first_extruder());
|
||||
|
||||
//wipe_tower.set_retract();
|
||||
|
|
|
@ -131,7 +131,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"as [layer_num] and [layer_z].");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -140,7 +140,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("This code is inserted between objects when using sequential printing. By default extruder and bed temperature are reset using non-wait command; however if M104, M109, M140 or M190 are detected in this custom code, Slic3r will not add temperature commands. Note that you can use placeholder variables for all Slic3r settings, so you can put a \"M109 S[first_layer_temperature]\" command wherever you want.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -360,7 +360,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"Note that you can use placeholder variables for all Slic3r settings.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("M104 S0 ; turn off temperature\nG28 X0 ; home X axis\nM84 ; disable motors\n");
|
||||
|
||||
|
@ -539,7 +539,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("If layer print time is estimated below this number of seconds, fan will be enabled "
|
||||
"and its speed will be calculated by interpolating the minimum and maximum speeds.");
|
||||
def->sidetext = L("approximate seconds");
|
||||
def->width = 60;
|
||||
def->width = 6;
|
||||
def->min = 0;
|
||||
def->max = 1000;
|
||||
def->mode = comExpert;
|
||||
|
@ -556,7 +556,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("You can put your notes regarding the filament here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionStrings { "" };
|
||||
|
||||
|
@ -1007,7 +1007,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->label = L("Inherits profile");
|
||||
def->tooltip = L("Name of the profile, from which this profile inherits.");
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->default_value = new ConfigOptionString();
|
||||
def->cli = ConfigOptionDef::nocli;
|
||||
|
||||
|
@ -1034,7 +1034,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->cli = "after-layer-gcode|layer-gcode";
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1053,7 +1053,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionBool(true);
|
||||
|
||||
const int machine_limits_opt_width = 70;
|
||||
const int machine_limits_opt_width = 7;
|
||||
{
|
||||
struct AxisDefault {
|
||||
std::string name;
|
||||
|
@ -1252,7 +1252,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"header comments.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1387,7 +1387,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->gui_flags = "serialized";
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 60;
|
||||
def->height = 6;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionStrings();
|
||||
|
||||
|
@ -1402,7 +1402,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("You can put your notes regarding the printer here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -1589,7 +1589,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->label = "";
|
||||
def->full_label = L("Serial port");
|
||||
def->tooltip = L("USB/serial port for printer connection.");
|
||||
def->width = 200;
|
||||
def->width = 20;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
def = this->add("serial_speed", coInt);
|
||||
|
@ -1635,7 +1635,7 @@ void PrintConfigDef::init_fff_params()
|
|||
def->tooltip = L("If layer print time is estimated below this number of seconds, print moves "
|
||||
"speed will be scaled down to extend duration to this value.");
|
||||
def->sidetext = L("approximate seconds");
|
||||
def->width = 60;
|
||||
def->width = 6;
|
||||
def->min = 0;
|
||||
def->max = 1000;
|
||||
def->mode = comExpert;
|
||||
|
@ -1742,7 +1742,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"a \"M109 S[first_layer_temperature]\" command wherever you want.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n");
|
||||
|
||||
|
@ -1758,7 +1758,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"in extruder order.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 120;
|
||||
def->height = 12;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionStrings { "; Filament gcode\n" };
|
||||
|
||||
|
@ -2008,7 +2008,7 @@ void PrintConfigDef::init_fff_params()
|
|||
"as [previous_extruder] and [next_extruder].");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 50;
|
||||
def->height = 5;
|
||||
def->mode = comExpert;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
@ -2330,7 +2330,7 @@ void PrintConfigDef::init_sla_params()
|
|||
def->tooltip = L("You can put your notes regarding the SLA print material here.");
|
||||
def->multiline = true;
|
||||
def->full_width = true;
|
||||
def->height = 130;
|
||||
def->height = 13;
|
||||
def->mode = comAdvanced;
|
||||
def->default_value = new ConfigOptionString("");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue