mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-27 21:02:23 +00:00
ENH: add the error codes return logic
1. write a json to the outputdir 2. including message/error code/plate id Change-Id: If2a13a89d34982a86102162c9c968cdf60702f19
This commit is contained in:
@@ -955,7 +955,10 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
|
||||
if (extruders.size() > 1 && m_config.print_sequence != PrintSequence::ByObject) {
|
||||
auto ret = check_multi_filament_valid(*this);
|
||||
if (!ret.string.empty())
|
||||
{
|
||||
ret.type = STRING_EXCEPT_FILAMENTS_DIFFERENT_TEMP;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_config.print_sequence == PrintSequence::ByObject) {
|
||||
@@ -964,13 +967,16 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
|
||||
|
||||
//BBS: refine seq-print validation logic
|
||||
auto ret = sequential_print_clearance_valid(*this, collison_polygons, height_polygons);
|
||||
if (!ret.string.empty())
|
||||
if (!ret.string.empty()) {
|
||||
ret.type = STRING_EXCEPT_OBJECT_COLLISION_IN_SEQ_PRINT;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//BBS
|
||||
auto ret = layered_print_cleareance_valid(*this, warning);
|
||||
if (!ret.string.empty()) {
|
||||
ret.type = STRING_EXCEPT_OBJECT_COLLISION_IN_LAYER_PRINT;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -3141,7 +3147,14 @@ int Print::export_cached_data(const std::string& directory, bool with_space)
|
||||
if (fs::exists(directory_path)) {
|
||||
fs::remove_all(directory_path);
|
||||
}
|
||||
if (!fs::create_directory(directory_path)) {
|
||||
try {
|
||||
if (!fs::create_directory(directory_path)) {
|
||||
BOOST_LOG_TRIVIAL(error) << boost::format("create directory %1% failed")%directory;
|
||||
return CLI_EXPORT_CACHE_DIRECTORY_CREATE_FAILED;
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(error) << boost::format("create directory %1% failed")%directory;
|
||||
return CLI_EXPORT_CACHE_DIRECTORY_CREATE_FAILED;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,9 @@ namespace Slic3r {
|
||||
enum StringExceptionType {
|
||||
STRING_EXCEPT_NOT_DEFINED = 0,
|
||||
STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE = 1,
|
||||
STRING_EXCEPT_FILAMENTS_DIFFERENT_TEMP = 2,
|
||||
STRING_EXCEPT_OBJECT_COLLISION_IN_SEQ_PRINT = 3,
|
||||
STRING_EXCEPT_OBJECT_COLLISION_IN_LAYER_PRINT = 4,
|
||||
STRING_EXCEPT_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -49,6 +49,11 @@
|
||||
#define CLI_SLICING_TIME_EXCEEDS_LIMIT -58
|
||||
#define CLI_TRIANGLE_COUNT_EXCEEDS_LIMIT -59
|
||||
#define CLI_NO_SUITABLE_OBJECTS_AFTER_SKIP -60
|
||||
#define CLI_FILAMENT_NOT_MATCH_BED_TYPE -61
|
||||
#define CLI_FILAMENTS_DIFFERENT_TEMP -62
|
||||
#define CLI_OBJECT_COLLISION_IN_SEQ_PRINT -63
|
||||
#define CLI_OBJECT_COLLISION_IN_LAYER_PRINT -64
|
||||
|
||||
|
||||
#define CLI_SLICING_ERROR -100
|
||||
#define CLI_GCODE_PATH_CONFLICTS -101
|
||||
|
||||
Reference in New Issue
Block a user