Skip to content

feat(emulator): bridge PrinterActions for document preview and decouple tables - #170

Merged
adcondev merged 3 commits into
masterfrom
feat/loose-coupling-and-emulator-bridge
Oct 18, 2026
Merged

adcondev merged 3 commits into
masterfrom
feat/loose-coupling-and-emulator-bridge

Conversation

@adcondev

Copy link
Copy Markdown
Owner

Summary (Area 2 / Phase 4)

  • Full Protocol Exposure (pkg/commands, pkg/composer): Expose GraphicsCmds(), NVGraphicsCmds(), DownloadGraphicsCmds() on bitimage.Capability and EffectsCmds(), CodeConversionCmds(), UserDefinedCmds() on character.Capability. Add Pulse (ESC p) and Beep (ESC B) to mechanismcontrol, composer, and service.PrinterActions.
  • Pure Text Table Engine (pkg/tables, pkg/document/executor): Remove pkg/composer dependency and raw 0x1B 0x45 byte injection from pkg/tables. Add RenderStructured so executor and emulator toggle bold headers cleanly via PrinterActions, and add Font B table support.
  • Visual Emulator Bridge & CLI -preview (pkg/emulator, cmd/poster): Add emulator.Printer implementing service.PrinterActions (with software QR and 1D barcode rendering) and add -preview <file.png> to cmd/poster.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening this PR, @adcondev!

Here's what will happen next:

  • 🤖 Automated checks will run
  • 🏷️ Labels will be added automatically
  • 👀 A maintainer will review your changes

Please make sure:

  • ✅ All tests pass
  • 📝 The PR title follows conventional commits
  • 📋 The PR template is filled out completely

@adcondev
adcondev merged commit 157e193 into master Oct 18, 2026
13 checks passed
@adcondev
adcondev deleted the feat/loose-coupling-and-emulator-bridge branch October 18, 2026 18:59
@github-actions

Copy link
Copy Markdown
Contributor

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

📈 Performance Comparison

📊 Click to expand detailed results

Current Branch Results

BenchmarkNewDocument-4    	1000000000	         0.2231 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 7626604	       159.0 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  794341	      1408 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	 1000000	      1009 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  969878	      1188 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	  183207	      6543 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  796593	      1409 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  532909	      2164 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	 1000000	      1100 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  475700	      2489 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	14696322	        73.35 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	14999859	        80.27 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	569097672	         2.111 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	60817610	        19.79 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	30016940	        43.29 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	 1000000	      1141 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  265172	      4258 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	    1090	   1031055 ns/op	 3469947 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     596	   1951602 ns/op	 5481086 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     264	   4534635 ns/op	 5231190 B/op	  230423 allocs/op

Base Branch Results

BenchmarkNewDocument-4    	1000000000	         0.2413 ns/op	       0 B/op	       0 allocs/op
BenchmarkBuildSimple-4    	 6811034	       178.7 ns/op	     240 B/op	       4 allocs/op
BenchmarkBuildComplex-4   	  694718	      1592 ns/op	    1856 B/op	      29 allocs/op
BenchmarkToJSON-4         	  930813	      1206 ns/op	     592 B/op	       3 allocs/op
BenchmarkParseDocument_Minimal-4    	  985352	      1230 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Receipt-4    	  171211	      7014 ns/op	    2392 B/op	      34 allocs/op
BenchmarkCommandUnmarshal_Text-4    	  734578	      1550 ns/op	     568 B/op	      19 allocs/op
BenchmarkCommandUnmarshal_Table-4   	  493836	      2310 ns/op	     952 B/op	      22 allocs/op
BenchmarkTextCommandParsing-4       	  947620	      1134 ns/op	     544 B/op	      16 allocs/op
BenchmarkTableCommandParsing-4      	  444739	      2615 ns/op	    1000 B/op	      31 allocs/op
BenchmarkParseHexString-4           	16116068	        72.58 ns/op	      48 B/op	       2 allocs/op
BenchmarkCleanHexString-4           	14837674	        81.68 ns/op	      64 B/op	       2 allocs/op
BenchmarkContainsSequence-4         	538579300	         2.238 ns/op	       0 B/op	       0 allocs/op
BenchmarkCheckCriticalCommands-4    	65303989	        18.72 ns/op	       0 B/op	       0 allocs/op
BenchmarkDocument_Validate-4       	27173571	        44.61 ns/op	       0 B/op	       0 allocs/op
BenchmarkParseDocument_Simple-4    	  955113	      1262 ns/op	     568 B/op	      14 allocs/op
BenchmarkParseDocument_Complex-4   	  257835	      4570 ns/op	    1352 B/op	      26 allocs/op
BenchmarkPrintImage_Small-4             	    1057	   1140451 ns/op	 3469946 B/op	      24 allocs/op
BenchmarkPrintImage_Medium-4            	     536	   2181337 ns/op	 5481085 B/op	      24 allocs/op
BenchmarkPrintImage_ThermalPreview-4    	     240	   5020034 ns/op	 5231182 B/op	  230423 allocs/op

💡 Note: Use benchstat for statistical comparison

🎯 Summary

  • Total Benchmarks: 32
  • Average Speed: 1420595 ns/op
  • Average Memory: 2396747 B/op
  • Average Allocations: 41077 allocs/op

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant