diff --git a/docs/CAD/ux/mockups/gen_offer_table.py b/docs/CAD/ux/mockups/gen_offer_table.py index 503bf26007..38e1ad9c66 100644 --- a/docs/CAD/ux/mockups/gen_offer_table.py +++ b/docs/CAD/ux/mockups/gen_offer_table.py @@ -16,7 +16,12 @@ import sys HERE = os.path.dirname(os.path.abspath(__file__)) UX = os.path.dirname(HERE) -REPO = os.path.dirname(os.path.dirname(UX)) +# One dirname more than you would expect: this generator lives at docs/CAD/ux/mockups/, +# not docs/ux/mockups/, since the design docs moved into the CAD subfolder (bbd1989e1e). +# With the old count REPO resolved to docs/, so OUT pointed at docs/src/.../DesignOffer.hpp, +# which does not exist -- and --check then diffed the real generated table against an empty +# file and reported the whole 189-line header as a difference. +REPO = os.path.dirname(os.path.dirname(os.path.dirname(UX))) ATLAS = os.path.join(UX, "tool_atlas.json") OUT = os.path.join(REPO, "src", "slic3r", "GUI", "CAD", "DesignOffer.hpp") diff --git a/scripts/CAD/check-gui-sketching.py b/scripts/CAD/check-gui-sketching.py index dcb49c06e5..181289704d 100644 --- a/scripts/CAD/check-gui-sketching.py +++ b/scripts/CAD/check-gui-sketching.py @@ -209,7 +209,19 @@ def leave_sketch(): TREE_ROW0 = (300, 215) -DESIGN_TAB = (128, 29) +# EVERY absolute chrome coordinate below is written in the Snapmaker fork's layout and then +# shifted by CHROME_DY, because this fork keeps mainline OrcaSlicer's top row (File / save / +# undo / redo / Calibration, with the document title) which that fork does not have. The whole +# chrome — tab strip, sketch toolbar, confirm button — sits 26 px lower here. +# +# Getting this wrong does not look like a coordinate problem. At the unshifted y the Design tab +# click landed in that toolbar, the app stayed on the Home page, and the first rung reported +# "no sketch opened after plane click + Shift+S"; the unshifted Construction checkbox reported +# "0 construction axis". Both name the wrong subsystem. Canvas coordinates are immune because +# clickmm() derives them from the live canvas geometry — only the chrome constants need this. +CHROME_DY = int(os.environ.get("SNAPORCA_CHROME_DY", "26")) + +DESIGN_TAB = (128, 29 + CHROME_DY) def go_design(): @@ -677,7 +689,7 @@ def corner_pair(ents): die("no adjacent pair in what should be a rectangle") -CONSTRUCTION_CHECKBOX = (419, 75) +CONSTRUCTION_CHECKBOX = (419, 75 + CHROME_DY) def draw_line(x0, y0, x1, y1, length, angle): @@ -794,10 +806,22 @@ def rung_extend(): # has not constrained anything, it has only nudged it. # Constrain-mode toolbar, measured off the rig at 1920x1080 (icon centres, 42 px apart). -CON_BTN_Y = 76 +# +# THIS LIST MIRRORS THE cbtn() SEQUENCE IN DesignPanel.cpp AND HAS TO BE UPDATED WHEN A BUTTON +# IS INSERTED. Positions are computed by index, so inserting a button shifts every entry after +# it and the map silently points at the wrong icon -- a rung then applies some OTHER constraint +# and fails with a geometric message that says nothing about buttons. +# +# It has already happened once, undetected: equal_radius and collinear (after "equal"), sym_v +# and sym_h (after "symmetric") and dist_x and dist_y (after "fix") were added while this list +# still had 14 names. Everything from index 6 on was wrong in both forks. Nothing caught it +# because the ladder only ever clicks "perpendicular" (3) and "equal" (5), both of which sit +# before the first insertion. The next rung to use "tangent" would have clicked "collinear". +CON_BTN_Y = 76 + CHROME_DY CON_BTN = {n: (449 + 42 * i, CON_BTN_Y) for i, n in enumerate( ["horizontal", "vertical", "parallel", "perpendicular", "coincident", "equal", - "concentric", "tangent", "midpoint", "symmetric", "angle", "radius", "diameter", "fix"])} + "equal_radius", "collinear", "concentric", "tangent", "midpoint", "symmetric", + "sym_v", "sym_h", "angle", "radius", "diameter", "fix", "dist_x", "dist_y"])} def draw_rect_undimensioned(): @@ -826,7 +850,7 @@ def rung_dimension(): leave_sketch() -CONFIRM_BTN = (1751, 75) +CONFIRM_BTN = (1751, 75 + CHROME_DY) def confirm_and_reopen(): diff --git a/scripts/CAD/run-all-checks.sh b/scripts/CAD/run-all-checks.sh index ee9cdf4281..e2f9664fd0 100755 --- a/scripts/CAD/run-all-checks.sh +++ b/scripts/CAD/run-all-checks.sh @@ -38,17 +38,26 @@ step() { # SC2329: every call goes through step(), which invokes it via "$@", so shellcheck # cannot see the callers below. # shellcheck disable=SC2329 +# This fork's rig runs Xvfb on :11, the other fork's on :10, and the check scripts default +# to ":10" when DISPLAY is unset -- which docker exec leaves unset. The rungs that drive the +# GUI therefore looked for a window on a display that does not exist here and reported +# "FATAL no app window on :10", which reads like a dead app rather than a wrong display. +RIG_DISPLAY="${RIG_DISPLAY:-:11}" + run_in_rig() { # copy the script in fresh, then run it there docker cp "$1" "$C:/tmp/$(basename "$1")" >/dev/null || return 1 shift - docker exec "$C" python3 "$@" + docker exec -e DISPLAY="$RIG_DISPLAY" "$C" python3 "$@" } # FIRST, and it needs no rig: the offer table the menu is compiled from must be what the atlas # says. The header calls itself GENERATED and had been hand-edited anyway — which cost four rows # that existed only in the header, one row wired to the wrong action, and a count of 91 for a # 92-row array, so the last verb was unreachable (snaporca-z8rs, snaporca-ziam). -step "offer table matches the atlas" python3 docs/ux/mockups/gen_offer_table.py --check +# docs/CAD/, not docs/: SoftFever moved the design docs into the CAD subfolder +# (bbd1989e1e) and this line kept the old path, so the rung failed on a missing file +# rather than on anything about the table. The other fork still has docs/ux/. +step "offer table matches the atlas" python3 docs/CAD/ux/mockups/gen_offer_table.py --check step "kernel suite" scripts/CAD/run-kernel-tests.sh --vol "${KVOL:-snaporca_kerneltest}"