Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/libslic3r/CustomGCode.cpp')
-rw-r--r--src/libslic3r/CustomGCode.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libslic3r/CustomGCode.cpp b/src/libslic3r/CustomGCode.cpp
index 7c505c978..193235bf8 100644
--- a/src/libslic3r/CustomGCode.cpp
+++ b/src/libslic3r/CustomGCode.cpp
@@ -1,6 +1,6 @@
#include "CustomGCode.hpp"
#include "Config.hpp"
-#include "GCode/PreviewData.hpp"
+#include "GCode.hpp"
#include "GCodeWriter.hpp"
namespace Slic3r {
@@ -17,13 +17,13 @@ extern void update_custom_gcode_per_print_z_from_config(Info& info, DynamicPrint
return;
if (info.gcodes.empty() && ! colorprint_heights->values.empty()) {
// Convert the old colorprint_heighs only if there is no equivalent data in a new format.
- const std::vector<std::string>& colors = GCodePreviewData::ColorPrintColors();
- const auto& colorprint_values = colorprint_heights->values;
+ const std::vector<std::string>& colors = ColorPrintColors::get();
+ const auto& colorprint_values = colorprint_heights->values;
info.gcodes.clear();
info.gcodes.reserve(colorprint_values.size());
int i = 0;
for (auto val : colorprint_values)
- info.gcodes.emplace_back(Item{ val, ColorChangeCode, 1, colors[(++i)%7] });
+ info.gcodes.emplace_back(Item{ val, ColorChange, 1, colors[(++i)%7] });
info.mode = SingleExtruder;
}
@@ -43,11 +43,11 @@ extern void check_mode_for_custom_gcode_per_print_z(Info& info)
bool is_single_extruder = true;
for (auto item : info.gcodes)
{
- if (item.gcode == ToolChangeCode) {
+ if (item.type == ToolChange) {
info.mode = MultiAsSingle;
return;
}
- if (item.gcode == ColorChangeCode && item.extruder > 1)
+ if (item.type == ColorChange && item.extruder > 1)
is_single_extruder = false;
}
@@ -60,9 +60,10 @@ std::vector<std::pair<double, unsigned int>> custom_tool_changes(const Info& cus
{
std::vector<std::pair<double, unsigned int>> custom_tool_changes;
for (const Item& custom_gcode : custom_gcode_per_print_z.gcodes)
- if (custom_gcode.gcode == ToolChangeCode) {
+ if (custom_gcode.type == ToolChange) {
// If extruder count in PrinterSettings was changed, use default (0) extruder for extruders, more than num_extruders
- custom_tool_changes.emplace_back(custom_gcode.print_z, static_cast<unsigned int>(custom_gcode.extruder > num_extruders ? 1 : custom_gcode.extruder));
+ assert(custom_gcode.extruder >= 0);
+ custom_tool_changes.emplace_back(custom_gcode.print_z, static_cast<unsigned int>(size_t(custom_gcode.extruder) > num_extruders ? 1 : custom_gcode.extruder));
}
return custom_tool_changes;
}