Skip to content

Add HTTP interface, ZPL/GRF flash memory simulation, and Labelary rate-limit protection - #105

Open
vinceformica-cyncly wants to merge 27 commits into
porrey:mainfrom
vinceformica-cyncly:virtual-flash
Open

vinceformica-cyncly wants to merge 27 commits into
porrey:mainfrom
vinceformica-cyncly:virtual-flash

Conversation

@vinceformica-cyncly

Copy link
Copy Markdown

Summary

  • HTTP interface — embedded web server (configurable port, default 9200) with a ZPL template editor and live label preview. Preview uses the same server-side pipeline as TCP (^DF + ^XF sent to Labelary natively), eliminating any client-side field substitution discrepancy.
  • ^DF / ^XF flash memory — format templates downloaded via ^DF are persisted to disk and recalled via ^XF. On recall, the stored template is prepended as a ^DF label so Labelary resolves the ^XF natively — identical behaviour to real Zebra hardware.
  • ~DG / ^XG flash memory — GRF image blobs uploaded via ~DG are stored and injected inline before any ^XG reference is sent to Labelary.
  • Labelary rate-limit protection — a SemaphoreSlim(1,1) serializes all Labelary calls across concurrent TCP connections. Semaphore acquisition happens at the start of each job so processing order matches TCP acceptance order. A configurable inter-request delay (default 400 ms, exposed in Global Settings) keeps burst workloads within the free-tier 3 req/sec limit.

Test plan

  • Send a single ZPL label via TCP — renders correctly
  • Send a 5-unit work order — all 5 labels render in sequence (1,2,3,4,5) with no HTTP 429 errors
  • Send ~DG image blob then a label with ^XG reference — image appears in rendered label
  • Send ^DF template then a print job with ^XF recall — label renders with field values populated
  • Open browser editor, set field values, click Preview — label renders matching TCP output
  • Change Labelary Request Delay in Global Settings — saved and applied on next job

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant