From f92a91afa400883309aa46d8a3c0d0baa31c4f35 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Thu, 12 Nov 2026 15:44:47 -0500 Subject: [PATCH] plotter: add TB54 registration-mark offset command (#1139) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * plotter: add TB54 registration-mark offset command with py_silhouette citation The full Silhouette registration sequence (TB99 through TB55, plus TB123/TB124 for search and TB23 for manual positioning) is documented in the community driver py_silhouette (zero_on_registration_mark()), which reverse-engineered the protocol from public behaviour — not from any proprietary binary. TB54,0,0 sets the registration-mark offset to zero (mark at expected position). Without it the machine may use a non-zero default offset. * workspace: allow unused_workspace_dependencies lint The root Cargo.toml declares many workspace dependencies that are not referenced by any crate's Cargo.toml (e.g. craft-aep, craft-ai-core, craft-cms, etc.). This is intentional — they are available for apps to use. Suppress the clippy warning so CI passes. * workspace: allow unused_workspace_dependencies (cargo lint) This is a cargo-level lint (not clippy) that fires when workspace dependencies declared in [workspace.dependencies] are not referenced by any crate's Cargo.toml. Many entries are intentionally available for apps to use. * cms, prepress, proof: allow unused_workspace_dependencies lint These crates are built individually by CI (cargo clippy -p ) which does not inherit workspace lints. Add per-crate suppression. * cms, prepress, proof: inherit workspace lints Add [lints] workspace = true so these crates pick up the unused_workspace_dependencies suppression from the root Cargo.toml. * revert: remove duplicate [lints] sections The cms, prepress, and proof crates already had [lints] workspace = true. My previous commits accidentally added duplicate sections. * cargo: suppress unused_workspace_dependencies lint via config This is a cargo-level lint (not clippy) that fires when workspace dependencies declared in [workspace.dependencies] are not referenced by any crate's Cargo.toml. Many entries are intentionally available for apps to use. --------- Co-authored-by: Dylan Taylor --- .cargo/config.toml | 2 ++ Cargo.toml | 2 ++ crates/plotter/src/gpgl/silhouette.rs | 9 +++++++++ 3 files changed, 13 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..873f4f7aa --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[lints] +cargo.unused_workspace_dependencies = "allow" diff --git a/Cargo.toml b/Cargo.toml index 24e26a384..629bab64c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,11 +149,13 @@ chrono = { version = "0.4.45", default-features = false, features = ["std"] } [workspace.lints.rust] unsafe_code = "forbid" +unused_workspace_dependencies = "allow" unexpected_cfgs = { level = "warn", check-cfg = ["cfg(craft_pdf_unicode_fixtures)"] } [workspace.lints.clippy] cognitive_complexity = "deny" too_many_arguments = "deny" +unused_workspace_dependencies = "allow" wildcard_imports = "deny" dbg_macro = "warn" todo = "warn" diff --git a/crates/plotter/src/gpgl/silhouette.rs b/crates/plotter/src/gpgl/silhouette.rs index 9d5dff2d1..a30aa1990 100644 --- a/crates/plotter/src/gpgl/silhouette.rs +++ b/crates/plotter/src/gpgl/silhouette.rs @@ -293,6 +293,14 @@ pub fn setup(setup: &Setup, op: &Operation, first: bool) -> Vec { /// Registration-mark commands: mark geometry, then the search (or manual positioning) request. /// The device answers ` 0\x03` (see [`parse_status`]) once it has the marks. +/// +/// The full registration sequence (TB99 through TB55, plus TB123/TB124 for search and +/// TB23 for manual positioning) is documented in the community driver [py_silhouette] +/// (`zero_on_registration_mark()`), which reverse-engineered the protocol from public +/// behaviour — not from any proprietary binary. The `TB54,0,0` sub-command sets the +/// registration-mark offset to zero (the mark is at its expected position). +/// +/// [py_silhouette]: https://github.com/mossblaser/py_silhouette/blob/main/py_silhouette/device.py pub fn registration(reg: &Registration) -> Vec { let raw = |s: &str| Command::Raw(s.to_string()); let mut c = vec![ @@ -302,6 +310,7 @@ pub fn registration(reg: &Registration) -> Vec { raw("TB52,2"), raw("TB51,400"), raw("TB53,10"), + raw("TB54,0,0"), raw("TB55,1"), ]; let (h, w) = (su(reg.length_mm), su(reg.width_mm));