plotter: add TB54 registration-mark offset command (#1139)

* 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 <crate>)
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 <dylanmtaylor@gmail.com>
This commit is contained in:
Dylan M. TaylorandDylan Taylor authored and GitHub committed 2026-11-12 15:44:47 -05:00
1 parent d23f5f36bb
commit f92a91afa4
3 files changed
+13

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
[lints]
cargo.unused_workspace_dependencies = "allow"
+2
View File
@@ -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"
+9
View File
@@ -293,6 +293,14 @@ pub fn setup(setup: &Setup, op: &Operation, first: bool) -> Vec<Command> {
/// 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<Command> {
let raw = |s: &str| Command::Raw(s.to_string());
let mut c = vec![
@@ -302,6 +310,7 @@ pub fn registration(reg: &Registration) -> Vec<Command> {
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));