NaitLee 5519bbe6a4 Test unknown device on cli side, fixed usability of web side;
prompt to select a device if there are many (web & cli);
Better routine, connect to device only if everything is ok;
Adjusted default printing configurations & behavior;
Added model MX08(C15);
Update about page;
Other fixes and tweaks.
2023-04-16 15:52:40 +08:00

32 lines
1004 B
Python

'''
Printer model specifications.
No rights reserved.
License CC0-1.0-only: https://directory.fsf.org/wiki/License:CC0
'''
class Model():
''' A printer model
`paper_width`: pixels per line for the model/paper
`is_new_kind`: some models have new "start print" command and can understand compressed data.
the algorithm isn't implemented in Cat-Printer yet, but this should be no harm.
`problem_feeding`: didn't yet figure out MX05/MX06 bad behavior giving feed command, use workaround for them
'''
paper_width: int = 384
is_new_kind: bool = False
problem_feeding: bool = False
Models = {}
# all known supported models
for name in '_ZZ00 GB01 GB02 GB03 GT01 MX05 MX06 MX08 YT01'.split(' '):
Models[name] = Model()
# that can receive compressed data
for name in 'GB03'.split(' '):
Models[name].is_new_kind = True
# that have problem giving feed command
for name in 'MX05 MX06 MX08'.split(' '):
Models[name].problem_feeding = True