Skip to content

Commit

Permalink
Refactor GCode handler variable and command line flag names
Browse files Browse the repository at this point in the history
Renamed `gcode_prefix_handler_` to `gcode_header_handler_` for clarity. Updated corresponding usage in `EmscriptenCommunication.h`, `CommandLine.cpp`, and `EmscriptenCommunication.cpp`.

Contribute to NP-327
  • Loading branch information
jellespijker committed Aug 22, 2024
1 parent f87791a commit d5afe4f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/communication/EmscriptenCommunication.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class EmscriptenCommunication : public CommandLine
{
private:
std::string progress_handler_; ///< Handler for progress messages.
std::string gcode_prefix_handler_; /// <Handler for getting gcode_prefix.
std::string gcode_header_handler_; ///< Handler for getting the GCode handler.
std::string slice_info_handler_; ///< Handler for slice information messages.

/**
Expand Down
2 changes: 1 addition & 1 deletion src/communication/CommandLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void CommandLine::sliceNext()
force_read_parent = false;
force_read_nondefault = false;
}
else if (argument.starts_with("--progress_cb") || argument.starts_with("--slice_info_cb") || argument.starts_with("--gcode_prefix_cb"))
else if (argument.starts_with("--progress_cb") || argument.starts_with("--slice_info_cb") || argument.starts_with("--gcode_header_cb"))
{
// Unused in command line slicing, but used in EmscriptenCommunication.
argument_index++;
Expand Down
4 changes: 2 additions & 2 deletions src/communication/EmscriptenCommunication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ EmscriptenCommunication::EmscriptenCommunication(const std::vector<std::string>&
{
slice_info_handler_ = *ranges::next(slice_info_flag);
}
if (auto gcode_prefix_flag = ranges::find(arguments_, "--gcode_prefix_cb"); gcode_prefix_flag != arguments_.end())
if (auto gcode_header_flag = ranges::find(arguments_, "--gcode_header_cb"); gcode_header_flag != arguments_.end())
{
gcode_prefix_handler_ = *ranges::next(gcode_prefix_flag);
gcode_header_handler_ = *ranges::next(gcode_header_flag);
}
}

Expand Down

0 comments on commit d5afe4f

Please sign in to comment.