CURA-12509 Restore Method High Speed printers#38
Conversation
Retract and Restart are also bead mode tags, so we cannot add our custom bead mode tags on top of these tags. (There was a firmware bug that was unintentionally blocking all tags from taking effect so we did not previously see the effects of this bug.)
This reverts commit c515836.
…move" This reverts commit b5e5c56.
…restore_Method_HS_printers
| Pause, // Command to allow for user defined pause. | ||
| }; | ||
|
|
||
| #define MB_BEAD_MODE_TAG(TAG_NAME) \ |
There was a problem hiding this comment.
function-like macro MB_BEAD_MODE_TAG used; consider a constexpr template function
| TAG_NAME##_0, \ | ||
| TAG_NAME##_1 | ||
|
|
||
| enum class Tag |
There was a problem hiding this comment.
enum Tag uses a larger base type (int, size: 4 bytes) than necessary for its value set, consider using std::uint8_t (1 byte) as the base type to reduce its size
| { CommandType::WaitForTemperature, "wait_for_temperature" }, | ||
| { CommandType::Pause, "pause" } }) | ||
|
|
||
| #define MB_JTP_TAG(TAG_NAME, TAG_STR) \ |
There was a problem hiding this comment.
function-like macro MB_JTP_TAG used; consider a constexpr template function
| #define MB_JTP_TAG(TAG_NAME, TAG_STR) \ | ||
| { Tag::TAG_NAME, #TAG_STR } | ||
|
|
||
| #define MB_BEAD_MODE_TAG_DEF(TAG_NAME, TAG_STR) \ |
There was a problem hiding this comment.
function-like macro MB_BEAD_MODE_TAG_DEF used; consider a constexpr template function
| MB_JTP_TAG(TAG_NAME##_1, TAG_STR##_1) | ||
|
|
||
| NLOHMANN_JSON_SERIALIZE_ENUM( | ||
| Tag, |
There was a problem hiding this comment.
no header providing "dulcificum::botcmd::Tag" is directly included
| proto_path.emplace_back(move); | ||
| return; | ||
| } | ||
| else |
There was a problem hiding this comment.
do not use else after return
| else | |
| { | ||
| // NOTE: A move may only have a single bead mode tag | ||
| move->tags.emplace_back(botcmd::Tag::TravelMove); | ||
| proto_path.emplace_back(move); | ||
| return; | ||
| } |
There was a problem hiding this comment.
do not use else after return
| { | |
| // NOTE: A move may only have a single bead mode tag | |
| move->tags.emplace_back(botcmd::Tag::TravelMove); | |
| proto_path.emplace_back(move); | |
| return; | |
| } | |
| // NOTE: A move may only have a single bead mode tag | |
| move->tags.emplace_back(botcmd::Tag::TravelMove); | |
| proto_path.emplace_back(move); | |
| return; | |
| } | ||
| } | ||
| else if (state.feature_type == "SKIN") | ||
| { |
There was a problem hiding this comment.
repeated branch body in conditional chain
|
Since each case is isolated and only a single tag is added, either a map or a switch case is easier to read and debug. Performance wise the map is overkill but just to outline the proposed code compartments: |
CURA-12509
Contains #34