Commit Graph

13 Commits

Author SHA1 Message Date
ske087 93afa3c417 Add P-touch Labels for Asset: 63x20 mm label format for PT-E560BT
New three-column label format for Brother P-touch EDGE PT-E560BT asset tags:
logo | three static lines + variable field | QR code.

Layout and rendering
- ptouch_label.py: geometry engine with PDF and preview renderers. Both
  consume the same geometry, so the preview matches the print exactly.
- Code symbols are snapped to whole printer dots per module. Fractional
  modules are the usual reason a small QR code will not scan.
- QR is maximised to the printable height by default (16.4 mm, 4 dots per
  module) instead of a fixed 16 mm box (12.3 mm, 3 dots per module).
- Code payload is composed as prefix + inventory + suffix. A legacy
  {inventory} template is migrated on first save.

Hardware handling
- print_area.py reads the driver's real printable area via GetDeviceCaps.
  The PT-E560BT head is 128 dots at 180 dpi, so the maximum print height is
  18.06 mm even on 24 mm tape; the driver reports media as 65x24 mm but only
  about 61x18 mm is reachable. Content is fitted to the reachable area,
  otherwise the driver silently crops it.
- set_printer_resolution.py reads/switches the driver's resolution mode. The
  driver offers 180x180 (symmetric) and 180x360 (anisotropic, 2x across the
  tape); the anisotropic mode scaled output incorrectly.

GUI
- label_printer_ptouch_gui.py: 600x300 two-column panel - controls on the
  left, live preview on the right. Advanced settings for logo, static lines,
  code prefix/suffix and error correction.
- native_file_dialog.py: the standard Windows file picker, run in a
  subprocess because Tk and Kivy both want the main event loop.

Printing
- Print failures are reported honestly. print_to_printer previously returned
  True unconditionally, so a failed print claimed success and was logged as
  SUCCESS.
- SumatraPDF exit codes are now checked (4 = no printer, 5 = driver error).
- The PDF is sent with noscale so driver-side scaling cannot distort the QR
  module pitch.

Tests
- validate_ptouch_layout.py decodes the QR back out of the rendered preview
  module by module, proving the preview and PDF are the same layout.
- test_ptouch_pipeline.py writes to a temp config so it cannot overwrite
  operator settings.
- test_gui_layout.py exercises the real app class headlessly.
- test_print_reporting.py covers the failure paths.

Diagnostics: check_print_area.py, check_print_geometry.py, check_devmode.py,
print_calibration.py, print_measure_scale.py, capture_print_job.py.
2026-09-25 17:30:11 +03:00
ske087 f09c365384 Fix printer detection, implement portable deployment with SumatraPDF
- Fixed network printer enumeration (PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS)
- Added printer name truncation to 20 chars with full name mapping
- Implemented silent PDF printing using SumatraPDF with landscape orientation
- Added auto-dismiss for success popup (3 seconds)
- Bundled SumatraPDF inside executable for portable single-file deployment
- Updated build script to embed SumatraPDF
- Added setup_sumatra.ps1 for downloading SumatraPDF portable
- Added DEPLOYMENT.md documentation
2026-02-06 14:00:17 +02:00
ske087 b204ce38fc Fix silent printing and shorten printer display names
- Print directly via win32print API without opening PDF viewer
- Shorten printer names to 20 chars in dropdown (strip server prefix for network printers)
- Map display names back to full names for printing
- PDF backup saved silently without launching viewer
2026-02-06 11:18:27 +02:00
ske087 1cf4482914 updated printer list to show local networ printers 2026-02-06 10:48:19 +02:00
Quality App Developer fa5c846ebb Add network printer detection on Windows: support printers from print servers 2026-02-06 10:20:57 +02:00
Quality App Developer 184178275b Add Windows support with cross-platform printer detection
- Make app cross-platform compatible (Windows, Linux, macOS)
- Replace CUPS-only printer detection with platform-aware code
- Add Windows printer support using win32print/win32api
- Add macOS printer support using lpstat
- Keep Linux CUPS support
- Add requirements_windows.txt for Windows installation
- Add comprehensive WINDOWS_SETUP.md guide
- Fallback to PDF output on all platforms
- Tested on Linux, ready for Windows/macOS
2026-02-05 01:06:49 +02:00
Quality App Developer 33c9c3d099 Improve GUI and barcode generation
- Update GUI title to 'Label Printing' with white text
- Add character limit (25 chars) to all input fields
- Add number-only filter to quantity field
- Fix barcode generation in PDF module
- Create pdf_backup folder for storing generated PDFs
- Add pdf backup logging and confirmation
- Move demo files and tests to documentation folder
- Reorganize project structure for better clarity
2026-02-05 01:02:53 +02:00
Quality App Developer 719a086f87 Fix tkinter dependency and add comprehensive tests
- Removed tkinter/ImageTk imports from print_label.py
- Simplified preview function to use command-line countdown
- Application now works without GUI framework dependencies
- Added test_functional.py: Comprehensive functional test suite (5/5 PASS)
- Added demo_usage.py: Functional demonstration
- Added TEST_REPORT.md: Complete testing report
- All core functionality verified and working
- GUI ready for deployment on compatible systems
2026-02-04 15:46:18 +02:00
Quality App Developer 31fab25430 Add Kivy GUI interface for label printer
- Created label_printer_gui.py: Complete Kivy-based GUI application
  - Two-column layout (input form + live preview)
  - SAP-Nr, Quantity, Cable ID input fields
  - Real-time barcode preview (11.5cm x 8cm)
  - Printer selection dropdown
  - Print button with CUPS integration

- Added setup automation:
  - setup_and_run.py: Python setup launcher
  - start_gui.sh: Bash launcher script
  - validate_project.py: Project validation

- Added comprehensive documentation:
  - INDEX.md: Project overview and quick start
  - GETTING_STARTED.md: 15-minute quick start guide
  - README_GUI.md: Complete feature documentation
  - TECHNICAL_DOCS.md: Architecture and customization
  - FILE_GUIDE.md: File reference guide
  - IMPLEMENTATION_SUMMARY.md: Implementation overview

- Updated dependencies:
  - requirements_gui.txt: New Kivy dependencies

- Preserved:
  - print_label.py: Original printing engine (modified to remove main code)
  - Original documentation and dependencies

Features:
- Live preview of labels as you type
- Automatic CUPS printer detection
- Non-blocking background printing
- User-friendly error handling
- Responsive two-column layout
- Production-ready quality
2026-02-04 15:37:04 +02:00
ske087 e5f2e69b10 final state 2025-07-15 13:10:17 +03:00
ske087 efe7b7a671 Final code 2025-06-30 16:08:07 +03:00
ske087 17231fbae1 simple function to print 9/5 labels 2025-06-30 15:55:56 +03:00
ske087 33df76f758 print label function created 2025-06-30 15:45:36 +03:00