Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Vojtech Bubnik 2016-05-03 22:05:31 +02:00
commit d022493297
22 changed files with 106 additions and 80 deletions

View file

@ -177,11 +177,11 @@ Wipe::wipe(GCode &gcodegen, bool toolchange)
/* Reduce retraction length a bit to avoid effective retraction speed to be greater than the configured one
due to rounding (TODO: test and/or better math for this) */
double dE = length * (segment_length / wipe_dist) * 0.95;
gcode += gcodegen.writer.set_speed(wipe_speed*60);
gcode += gcodegen.writer.set_speed(wipe_speed*60, gcodegen.enable_cooling_markers ? ";_WIPE" : "");
gcode += gcodegen.writer.extrude_to_xy(
gcodegen.point_to_gcode(line->b),
-dE,
(std::string)"wipe and retract" + (gcodegen.enable_cooling_markers ? ";_WIPE" : "")
"wipe and retract"
);
retracted += dE;
}
@ -198,7 +198,7 @@ Wipe::wipe(GCode &gcodegen, bool toolchange)
GCode::GCode()
: placeholder_parser(NULL), enable_loop_clipping(true), enable_cooling_markers(false), layer_count(0),
layer_index(-1), layer(NULL), first_layer(false), elapsed_time(0), volumetric_speed(0),
layer_index(-1), layer(NULL), first_layer(false), elapsed_time(0.0), volumetric_speed(0),
_last_pos_defined(false)
{
}
@ -562,7 +562,7 @@ GCode::_extrude(ExtrusionPath path, std::string description, double speed)
// extrude arc or line
if (path.is_bridge() && this->enable_cooling_markers)
gcode += ";_BRIDGE_FAN_START\n";
gcode += this->writer.set_speed(F);
gcode += this->writer.set_speed(F, this->enable_cooling_markers ? ";_EXTRUDE_SET_SPEED" : "");
double path_length = 0;
{
std::string comment = this->config.gcode_comments ? description : "";
@ -629,9 +629,17 @@ GCode::travel_to(const Point &point, ExtrusionRole role, std::string comment)
// use G1 because we rely on paths being straight (G0 may make round paths)
Lines lines = travel.lines();
for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line)
gcode += this->writer.travel_to_xy(this->point_to_gcode(line->b), comment);
double path_length = 0;
for (Lines::const_iterator line = lines.begin(); line != lines.end(); ++line) {
const double line_length = line->length() * SCALING_FACTOR;
path_length += line_length;
gcode += this->writer.travel_to_xy(this->point_to_gcode(line->b), comment);
}
if (this->config.cooling)
this->elapsed_time += path_length / this->config.get_abs_value("travel_speed");
return gcode;
}

View file

@ -82,7 +82,7 @@ class GCode {
const Layer* layer;
std::map<const PrintObject*,Point> _seam_position;
bool first_layer; // this flag triggers first layer speeds
unsigned int elapsed_time; // seconds
float elapsed_time; // seconds
double volumetric_speed;
GCode();

View file

@ -5,7 +5,13 @@
#include <sstream>
#include <unistd.h> // provides **environ
extern char **environ;
#ifdef __APPLE__
#include <crt_externs.h>
#undef environ
#define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif
namespace Slic3r {