mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-22 21:32:16 -05:00
Replaces the runtime reader of firmwareExe's JSON with Klipper-native storage. Per-unit numbers now live in ordinary config: hand-written [ff_tool 0..3] dock_x/dock_y and [ff_toolchange] feeds in ff-toolchange.cfg; calibrated nozzle_x/y/z per tool, station_x/y/z and the per-tool z_adjust are written via configfile.set and persisted with SAVE_CONFIG into printer.cfg's #*# block, like PID / input shaper. They must never be placed in an included .cfg (the fork's SAVE_CONFIG refuses "conflicts with included value"). New extras and commands: - ff_tool.py: [ff_tool n] per-tool sections. - ff_tool_offset.py: TOOL_OFFSET_CALIBRATE / STATION_CALIBRATE / TOOL_OFFSET_STATUS -- the touchscreen's nozzle XY/Z offset calibration (testEddyExtruderOffsetForwardTwoCheck), recovered from the binary and reimplemented on the fork's e_stop probes. - ff_legacy.py: FF_IMPORT_FIRMWARE_CONFIG, one-shot import of the factory extruder/test/zoffset.json; include ff-legacy.cfg only for that step. - ff_toolchange.py: takes docks/offsets from the ff_tool objects, adds TOOL_Z_ADJUST (per-tool persistent babystep), drops the JSON reader and TOOLCHANGE_RELOAD. - config: ff-tool-offset.cfg, ff-legacy.cfg; updated ff-toolchange.cfg and ff-print-macros.cfg. Safety gates: START_PRINT (_FF_REQUIRE_CALIBRATION) and the SDCARD_PRINT_FILE wrapper refuse to start while ff_toolchange.print_offset_ready is false; calibration requires PLATE_REMOVED=1, probes to Z -3 by default and stops 2 mm below a known trigger height; residual (0.05 mm) and nozzle-to-station gap (1.5-5 mm) guards refuse to save implausible results. Docs: README rewritten for the new install/calibration flow; notes 45 (Klipper port) and 46 (recovered sequence) added; notes 40/60 no longer refer to TOOLCHANGE_RELOAD. Untested on hardware -- mock harness only. main keeps the JSON-reading design. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>