ENH: CLI: add the gcode path check logic for cli
Change-Id: I424a93d9ca945598da861a1905da07ae14663157
This commit is contained in:
parent
1a7b12fa38
commit
98f3aaa4bf
|
@ -2065,6 +2065,11 @@ int CLI::run(int argc, char **argv)
|
||||||
print->process();
|
print->process();
|
||||||
}
|
}
|
||||||
if (printer_technology == ptFFF) {
|
if (printer_technology == ptFFF) {
|
||||||
|
std::string conflict_result = dynamic_cast<Print *>(print)->get_conflict_string();
|
||||||
|
if (!conflict_result.empty()) {
|
||||||
|
BOOST_LOG_TRIVIAL(error) << "plate "<< index+1<< ": found slicing result conflict!"<< std::endl;
|
||||||
|
flush_and_exit(CLI_GCODE_PATH_CONFLICTS);
|
||||||
|
}
|
||||||
// The outfile is processed by a PlaceholderParser.
|
// The outfile is processed by a PlaceholderParser.
|
||||||
//outfile = part_plate->get_tmp_gcode_path();
|
//outfile = part_plate->get_tmp_gcode_path();
|
||||||
if (outfile_dir.empty()) {
|
if (outfile_dir.empty()) {
|
||||||
|
|
|
@ -1691,6 +1691,7 @@ void Print::process(bool use_cache)
|
||||||
|
|
||||||
if (conflictRes.has_value()) {
|
if (conflictRes.has_value()) {
|
||||||
m_conflict_result.set(conflictRes.value().first, conflictRes.value().second);
|
m_conflict_result.set(conflictRes.value().first, conflictRes.value().second);
|
||||||
|
BOOST_LOG_TRIVIAL(error) << boost::format("gcode path conflicts found between %1% and %2%")%conflictRes.value().first %conflictRes.value().second;
|
||||||
} else {
|
} else {
|
||||||
m_conflict_result.reset();
|
m_conflict_result.reset();
|
||||||
}
|
}
|
||||||
|
|
|
@ -772,6 +772,15 @@ public:
|
||||||
bool is_support_used() const {return m_support_used;}
|
bool is_support_used() const {return m_support_used;}
|
||||||
bool is_BBL_Printer() const { return m_isBBLPrinter;}
|
bool is_BBL_Printer() const { return m_isBBLPrinter;}
|
||||||
void set_BBL_Printer(const bool isBBL) { m_isBBLPrinter = isBBL;}
|
void set_BBL_Printer(const bool isBBL) { m_isBBLPrinter = isBBL;}
|
||||||
|
std::string get_conflict_string() const
|
||||||
|
{
|
||||||
|
std::string result;
|
||||||
|
if (m_conflict_result.conflicted) {
|
||||||
|
result = "Found gcode path conflicts between object " + m_conflict_result.obj1 + " and " + m_conflict_result.obj2;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
//BBS
|
//BBS
|
||||||
static StringObjectException sequential_print_clearance_valid(const Print &print, Polygons *polygons = nullptr, std::vector<std::pair<Polygon, float>>* height_polygons = nullptr);
|
static StringObjectException sequential_print_clearance_valid(const Print &print, Polygons *polygons = nullptr, std::vector<std::pair<Polygon, float>>* height_polygons = nullptr);
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,8 @@
|
||||||
#define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT -59
|
#define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT -59
|
||||||
#define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP -60
|
#define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP -60
|
||||||
|
|
||||||
#define CLI_SLICING_ERROR -100
|
#define CLI_SLICING_ERROR -100
|
||||||
|
#define CLI_GCODE_PATH_CONFLICTS -101
|
||||||
|
|
||||||
|
|
||||||
namespace boost { namespace filesystem { class directory_entry; }}
|
namespace boost { namespace filesystem { class directory_entry; }}
|
||||||
|
|
Loading…
Reference in New Issue