mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
ENH: support recommended filament map when print by object
1. support recommended filament map when print by object 2. placeholder_parser support function filament_change 3. extruder_id of filament_map is start from 1 Change-Id: Ide8019cd4a165a25972f22706ff685c3005aa031 (cherry picked from commit b42d94e1d05236b8b7b2e65b4a24810eecf040cb)
This commit is contained in:
@@ -1570,6 +1570,13 @@ namespace client
|
||||
expr::random(param1, param2, ctx->context_data->rng);
|
||||
}
|
||||
|
||||
static void filament_change(const MyContext* ctx, expr<Iterator>& param)
|
||||
{
|
||||
MyContext *context = const_cast<MyContext *>(ctx);
|
||||
context->current_extruder_id = param.as_i();
|
||||
}
|
||||
|
||||
template <typename Iterator>
|
||||
static void throw_exception(const std::string &msg, const IteratorRange &it_range)
|
||||
{
|
||||
// An asterix is added to the start of the string to differentiate the boost::spirit::info::tag content
|
||||
@@ -2163,6 +2170,7 @@ namespace client
|
||||
[ px::bind(&expr::max, _val, _2) ]
|
||||
| (kw["random"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > ')')
|
||||
[ px::bind(&MyContext::random, _r1, _val, _2) ]
|
||||
| (kw["filament_change"] > '(' > conditional_expression(_r1) > ')') [ px::bind(&MyContext::filament_change<Iterator>, _r1, _1) ]
|
||||
| (kw["digits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
|
||||
[ px::bind(&expr::digits<false>, _val, _2, _3) ]
|
||||
| (kw["zdigits"] > '(' > conditional_expression(_r1) [_val = _1] > ',' > conditional_expression(_r1) > optional_parameter(_r1))
|
||||
@@ -2246,6 +2254,7 @@ namespace client
|
||||
("min")
|
||||
("max")
|
||||
("random")
|
||||
("filament_change")
|
||||
("repeat")
|
||||
("round")
|
||||
("not")
|
||||
|
||||
Reference in New Issue
Block a user