-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Development of Initial CUSTOM Printer Implementation #105
base: master
Are you sure you want to change the base?
Conversation
… support for QR Code printing.
Wow nice to see the 2D barcodes printed! I've implemented it but couldn't test it effectively. |
@jmalda nice job implementing this! Are all the other commands (alignment, text size, image printing, etc) the same as EPSON? |
@jmalda sorry about the flood, but I was thinking now, maybe we can centralize a good chunk of Or what if we just changed these byte arrays to be virtual and thus override only them ? |
@jmalda I promise this is the last time! lol Can you please add the new emitter to the Global Unit tests? You need just to add the same |
Thanks @igorocampos . The only commands I noticed so far that were slightly different were the QR Code implementations. I will print the various tests from the Console App again tomorrow and see if there is anything else that jumps out. |
@igorocampos Will do. I did notice a number of the current tests appear to fail because the barcode content is longer than 21 characters. |
@igorocampos No worries about the flood of messages. 👍 Are you thinking along the lines of an |
Thanks for working on this @jmalda ! It looks like the QR codes are the same though? Does the CUSTOM not support the different QR types? |
@jmalda yes, something like that. I didn't think it all the way through, I was just throwing ideas of how can we reduce the number of repetitive code lines, you know? |
Hi @lukevp ! I will compare the ESPON and CUSTOM commands in their respective protocol documentation to see if there are any differences regarding the QR Code types. Are you able to share with me what a printout of the 2D Codes looks like on an ESPON printer? |
@igorocampos It would certainly reduce duplicate code, and also provide greater flexibility for allowing overrides at both the CommandEmitter and CommandValues level. Please let me know if you want that as part of this PR or not. Thanks. |
@igorocampos Below are most of the current Print Tests being printed on the CUSTOM printer. It looks like there are a few issues with the GS1 Barcodes, as well as Images (Legacy Images appear to work just fine). |
@jmalda I'd say yes for that, BUT who am I to decide? I'm just a contributor like you :) @lukevp is the owner of this repository |
¡Hi! sorry for join late on the conversation, you did grate! @jmalda. @igorocampos now that we have virtualized the methods on the BaseCommandEmitter we can start here to reduce the boilerplate code, another thing we can do is definitely an interface to hide the real implementation and to work better with DI or IoC |
Hi @danielmeza @igorocampos I started down the road of changing the CommandValues to adhere to some sort of interface. It is a significant change with many files affected. I am wondering if this is something we want to do as a completely separate PR so that it contains just this refactor. @lukevp Thoughts? |
Can you all think of a way we could hide / shadow the non-legacy images? It appears to only work on EPSON, as the CUSTOM and other printers we've seen come through here all fail to print the non-legacy image test. I think we should move the non-legacy image implementation out of the base implementation and only into the EPSON emitter if that's the case. This might also be a good approach with the GS1 barcodes, if most printers don't support them perhaps they should be only in EPSON? |
I totally agree with moving it out of base emitter, and have it implemented only in EPSON's emitter. The alternative would be a more basic base emitter, that has only simple commands that we all know that successfully runs in all printers, then a base epson-like class with a little bit more commands that other generic printers don't accept, but EPSON and others do. However, I'm not sure how true that would be, if there are any "epson-like" printers. That's why I would go for what @lukevp first said, just take it out of base and implement directly in EPSON. |
The more I dig into this, the more differences I find between the EPSON and CUSTOM implementations of ESC \ POS. For starters, CUSTOM does not take advantage of any 100 series functions. I.e. where ESPON uses Function 167, CUSTOM uses Function 067 and so on. Digging into the barcodes, it looks like some of our underlying enums would need to change as well depending on the implementation (e.g. Size2DCode, TwoDimensionCodeType etc). I will continue to get to the bottom of the barcodes. If you are interested, below are the EPSON, CUSTOM, and STAR Micronics command manuals for ESC \ POS. CUSTOM ESC POS Command Manual.pdf |
For Enums we can use SmartEnum or a custom implementation of Enhanced Enums |
Created initial framework for supporting the CUSTOM Printer implementation of ESC \ POS Protocol.
Support has been added for CUSTOM QR Code printing. Printout on left is is EPSON protocol on a CUSTOM Printer. Printout on right is CUSTOM protocol on a CUSTOM printer.