-
Notifications
You must be signed in to change notification settings - Fork 1
CURA-12509 Restore Method High Speed printers #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0c762e0
24093fb
98e5d78
2db488f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,10 @@ enum class CommandType | |
| Pause, // Command to allow for user defined pause. | ||
| }; | ||
|
|
||
| #define MB_BEAD_MODE_TAG(TAG_NAME) \ | ||
| TAG_NAME##_0, \ | ||
| TAG_NAME##_1 | ||
|
|
||
| enum class Tag | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { | ||
| Invalid, | ||
|
|
@@ -41,11 +45,20 @@ enum class Tag | |
| Restart, | ||
| Retract, | ||
| Roof, | ||
| Support, | ||
| Sparse, | ||
| TravelMove | ||
| TravelMove, | ||
| MB_BEAD_MODE_TAG(Fill), | ||
| MB_BEAD_MODE_TAG(PrimeTower), | ||
| MB_BEAD_MODE_TAG(TopSurface), | ||
| MB_BEAD_MODE_TAG(Support), | ||
| MB_BEAD_MODE_TAG(SupportInterface), | ||
| MB_BEAD_MODE_TAG(WallOuter), | ||
| MB_BEAD_MODE_TAG(WallInner), | ||
| MB_BEAD_MODE_TAG(Skirt) | ||
| }; | ||
|
|
||
| #undef MB_BEAD_MODE_TAG | ||
|
|
||
| using ExtruderIndex = size_t; | ||
|
|
||
| struct Command | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,20 +26,39 @@ NLOHMANN_JSON_SERIALIZE_ENUM( | |
| { CommandType::WaitForTemperature, "wait_for_temperature" }, | ||
| { CommandType::Pause, "pause" } }) | ||
|
|
||
| #define MB_JTP_TAG(TAG_NAME, TAG_STR) \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { Tag::TAG_NAME, #TAG_STR } | ||
|
|
||
| #define MB_BEAD_MODE_TAG_DEF(TAG_NAME, TAG_STR) \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| MB_JTP_TAG(TAG_NAME##_0, TAG_STR##_0), \ | ||
| MB_JTP_TAG(TAG_NAME##_1, TAG_STR##_1) | ||
|
|
||
| NLOHMANN_JSON_SERIALIZE_ENUM( | ||
| Tag, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| { { Tag::Invalid, "Invalid" }, | ||
| { Tag::Infill, "Infill" }, | ||
| { Tag::Inset, "Inset" }, | ||
| { Tag::Purge, "Purge" }, | ||
| { Tag::QuickToggle, "Quick Toggle" }, | ||
| { Tag::Raft, "Raft" }, | ||
| { Tag::Restart, "Restart" }, | ||
| { Tag::Retract, "Retract" }, | ||
| { Tag::Roof, "Roof" }, | ||
| { Tag::Sparse, "Sparse" }, | ||
| { Tag::Support, "Support" }, | ||
| { Tag::TravelMove, "Travel Move" } }) | ||
| { | ||
| MB_JTP_TAG(Invalid, Invalid), | ||
| MB_JTP_TAG(Infill, Infill), | ||
| MB_JTP_TAG(Inset, Inset), | ||
| MB_JTP_TAG(Purge, Purge), | ||
| MB_JTP_TAG(QuickToggle, Quick Toggle), | ||
| MB_JTP_TAG(Raft, Raft), | ||
| MB_JTP_TAG(Restart, Restart), | ||
| MB_JTP_TAG(Retract, Retract), | ||
| MB_JTP_TAG(Roof, Roof), | ||
| MB_JTP_TAG(Sparse, Sparse), | ||
| MB_JTP_TAG(TravelMove, Travel Move), | ||
| MB_BEAD_MODE_TAG_DEF(Fill, FILL), | ||
| MB_BEAD_MODE_TAG_DEF(PrimeTower, PRIME_TOWER), | ||
| MB_BEAD_MODE_TAG_DEF(TopSurface, TOP_SURFACE), | ||
| MB_BEAD_MODE_TAG_DEF(Support, SUPPORT), | ||
| MB_BEAD_MODE_TAG_DEF(SupportInterface, SUPPORT_INTERFACE), | ||
| MB_BEAD_MODE_TAG_DEF(WallOuter, WALL_OUTER), | ||
| MB_BEAD_MODE_TAG_DEF(WallInner, WALL_INNER), | ||
| MB_BEAD_MODE_TAG_DEF(Skirt, SKIRT) | ||
| }) | ||
|
|
||
| #undef MB_BEAD_MODE_TAG | ||
| #undef MB_JTP_TAG | ||
|
|
||
| } // namespace botcmd | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -270,56 +270,141 @@ void VisitCommand::to_proto_path(const gcode::ast::G0_G1& command) | |||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| if (delta_e > 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| // NOTE: A move may only have a single bead mode tag | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Restart); | ||||||||||||||||||||||||
| state.is_retracted = false; | ||||||||||||||||||||||||
| proto_path.emplace_back(move); | ||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| // NOTE: A move may only have a single bead mode tag | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TravelMove); | ||||||||||||||||||||||||
| proto_path.emplace_back(move); | ||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
Comment on lines
280
to
285
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (delta_e < 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| // NOTE: A move may only have a single bead mode tag | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Retract); | ||||||||||||||||||||||||
| state.is_retracted = true; | ||||||||||||||||||||||||
| proto_path.emplace_back(move); | ||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (delta_e == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| // NOTE: A move may only have a single bead mode tag | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TravelMove); | ||||||||||||||||||||||||
| proto_path.emplace_back(move); | ||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| if (state.feature_type == "WALL-OUTER" || state.feature_type == "INNER-OUTER") | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| // Bead Mode Tags | ||||||||||||||||||||||||
| // NOTE: A move may only have a single bead mode tag | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| if (state.feature_type == "WALL-OUTER") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Inset); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::WallOuter_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::WallOuter_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "WALL-INNER") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::WallInner_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::WallInner_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "SKIN") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Roof); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TopSurface_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TopSurface_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "TOP-SURFACE") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Roof); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TopSurface_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::TopSurface_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "PRIME-TOWER") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Purge); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::PrimeTower_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::PrimeTower_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "FILL") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Infill); | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Sparse); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Fill_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Fill_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "Purge") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Raft); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "SUPPORT") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Sparse); | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Support); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Support_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Support_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "SUPPORT-INTERFACE") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Support); | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::SupportInterface_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::SupportInterface_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else if (state.feature_type == "SKIRT") | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| if (state.active_tool == 0) | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Skirt_0); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| else | ||||||||||||||||||||||||
| { | ||||||||||||||||||||||||
| move->tags.emplace_back(botcmd::Tag::Skirt_1); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
| proto_path.emplace_back(move); | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function-like macro
MB_BEAD_MODE_TAGused; consider aconstexprtemplate function