Skip to content

Commit

Permalink
Don't check zsafe against zchange when zchange-absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
pci06 authored and eyal0 committed May 10, 2022
1 parent a3d6033 commit 9a16351
Show file tree
Hide file tree
Showing 19 changed files with 1,814 additions and 2 deletions.
7 changes: 6 additions & 1 deletion integration_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"multivibrator_pre_post_milling_gcode",
"multivibrator_xy_offset",
"multivibrator_xy_offset_zero_start",
"multivibrator-zchange-absolute",
"multi_outline",
"null_drill",
"overlapping_edge_cuts",
Expand Down Expand Up @@ -163,7 +164,11 @@
[TestCase("invalid_millfeedirection",
os.path.join(EXAMPLES_PATH),
["--mill-feed-direction=invalid_value"],
101)]
101)] +
[TestCase("zchange_below_zdrill",
os.path.join(EXAMPLES_PATH, "multivibrator-zchange-absolute"),
["--zchange-absolute=false"],
19)]
)

def colored(text, **color):
Expand Down
2 changes: 1 addition & 1 deletion options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ static void check_drilling_parameters(po::variables_map const& vm)

if (!vm.count("zchange")) {
options::maybe_throw("Error: Drill bit changing height (--zchange) not specified.", ERR_NOZCHANGE);
} else if (vm["zchange"].as<Length>().asInch(unit) <= vm["zdrill"].as<Length>().asInch(unit)) {
} else if (!vm["zchange-absolute"].as<bool>() && vm["zchange"].as<Length>().asInch(unit) <= vm["zdrill"].as<Length>().asInch(unit)) {
options::maybe_throw("Error: The safety height --zsafe is lower than the tool "
"change height --zchange!", ERR_ZSAFELOWERZCHANGE);
}
Expand Down

0 comments on commit 9a16351

Please sign in to comment.