mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-23 16:51:21 -06:00
ENH: add filament alias to a print warning
Change-Id: Ie7a2e0cbdd016c2120c46cde9a92a93baffbe832 Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
8f9d8b55eb
commit
bdab8a28c9
4 changed files with 47 additions and 3 deletions
|
|
@ -1098,9 +1098,15 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return { format(L("Plate %d: %s does not support filament %s.\n"), this->get_plate_index() + 1,
|
||||
L(bed_type_name), extruder_id + 1) };
|
||||
|
||||
StringObjectException except;
|
||||
except.string = format(L("Plate %d: %s does not support filament %s\n"), this->get_plate_index() + 1, L(bed_type_name), extruder_id + 1);
|
||||
except.type = STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE;
|
||||
except.params.push_back(std::to_string(this->get_plate_index() + 1));
|
||||
except.params.push_back(L(bed_type_name));
|
||||
except.params.push_back(std::to_string(extruder_id+1));
|
||||
except.object = nullptr;
|
||||
return except;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,12 +16,20 @@
|
|||
|
||||
namespace Slic3r {
|
||||
|
||||
enum StringExceptionType {
|
||||
STRING_EXCEPT_NOT_DEFINED = 0,
|
||||
STRING_EXCEPT_FILAMENT_NOT_MATCH_BED_TYPE = 1,
|
||||
STRING_EXCEPT_COUNT
|
||||
};
|
||||
|
||||
// BBS: error with object
|
||||
struct StringObjectException
|
||||
{
|
||||
std::string string;
|
||||
ObjectBase const *object = nullptr;
|
||||
std::string opt_key;
|
||||
StringExceptionType type; // warning type for tips
|
||||
std::vector<std::string> params; // warning params for tips
|
||||
};
|
||||
|
||||
class CanceledException : public std::exception
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue