mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-29 11:41:20 -06:00
1st installment of g-code window in preview
This commit is contained in:
parent
34417574f5
commit
2c8f385c7f
10 changed files with 251 additions and 4 deletions
|
|
@ -747,8 +747,16 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessor::Result* re
|
|||
BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info();
|
||||
m_processor.process_file(path_tmp, true, [print]() { print->throw_if_canceled(); });
|
||||
DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
|
||||
#if ENABLE_GCODE_WINDOW
|
||||
if (result != nullptr) {
|
||||
*result = std::move(m_processor.extract_result());
|
||||
// set the filename to the correct value
|
||||
result->filename = path;
|
||||
}
|
||||
#else
|
||||
if (result != nullptr)
|
||||
*result = std::move(m_processor.extract_result());
|
||||
#endif // ENABLE_GCODE_WINDOW
|
||||
BOOST_LOG_TRIVIAL(debug) << "Finished processing gcode, " << log_memory_info();
|
||||
|
||||
if (rename_file(path_tmp, path))
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@
|
|||
#include <boost/log/trivial.hpp>
|
||||
#include <boost/nowide/fstream.hpp>
|
||||
#include <boost/nowide/cstdio.hpp>
|
||||
#if ENABLE_GCODE_WINDOW
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#endif // ENABLE_GCODE_WINDOW
|
||||
|
||||
#include <float.h>
|
||||
#include <assert.h>
|
||||
|
|
@ -976,6 +979,9 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr
|
|||
}
|
||||
|
||||
// process gcode
|
||||
#if ENABLE_GCODE_WINDOW
|
||||
m_result.filename = filename;
|
||||
#endif // ENABLE_GCODE_WINDOW
|
||||
m_result.id = ++s_result_id;
|
||||
// 1st move must be a dummy move
|
||||
m_result.moves.emplace_back(MoveVertex());
|
||||
|
|
|
|||
|
|
@ -334,13 +334,15 @@ namespace Slic3r {
|
|||
std::vector<std::string> filament;
|
||||
std::string printer;
|
||||
|
||||
void reset()
|
||||
{
|
||||
void reset() {
|
||||
print = "";
|
||||
filament = std::vector<std::string>();
|
||||
printer = "";
|
||||
}
|
||||
};
|
||||
#if ENABLE_GCODE_WINDOW
|
||||
std::string filename;
|
||||
#endif // ENABLE_GCODE_WINDOW
|
||||
unsigned int id;
|
||||
std::vector<MoveVertex> moves;
|
||||
Pointfs bed_shape;
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
#define ENABLE_WARNING_TEXTURE_REMOVAL (1 && ENABLE_2_3_1_ALPHA1)
|
||||
#define ENABLE_GCODE_LINES_ID_IN_H_SLIDER (1 && ENABLE_2_3_1_ALPHA1)
|
||||
#define ENABLE_VALIDATE_CUSTOM_GCODE (1 && ENABLE_2_3_1_ALPHA1)
|
||||
#define ENABLE_GCODE_WINDOW (1 && ENABLE_2_3_1_ALPHA1)
|
||||
|
||||
|
||||
#endif // _prusaslicer_technologies_h_
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue