Modifica comandi, aggiunta nuovo main per marcatura dime
parent
29624c8798
commit
35ee4ed722
|
|
@ -45,38 +45,38 @@ MKPcommands = {
|
||||||
'begin': '\x02', #STX
|
'begin': '\x02', #STX
|
||||||
'end': '\x03', #ETX
|
'end': '\x03', #ETX
|
||||||
'command': 'TZ',
|
'command': 'TZ',
|
||||||
'success': '\x06\x02[0-9]OK\x03',
|
'success': '\x06\x02([0-9])OK\x03',
|
||||||
'error': '[0-9]E[0-9]',
|
'error': '([0-9])E([0-9])',
|
||||||
'args': ['imageName', 'printMode']
|
'args': ['imageName', 'printMode']
|
||||||
},
|
},
|
||||||
'sendImage': {
|
'sendImage': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'EW----',
|
'command': 'EW----;',
|
||||||
'success': None,
|
'success': None,
|
||||||
'error': None,
|
'error': None,
|
||||||
'args': ['imageName']
|
'args': ['imageName']
|
||||||
},
|
},
|
||||||
'sendImageEnd': {
|
'sendImageEnd': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'EX---',
|
'command': 'EX----;',
|
||||||
'success': 'OK\r',
|
'success': 'OK\r',
|
||||||
'error': None,
|
'error': None,
|
||||||
},
|
},
|
||||||
'receiveImage': {
|
'receiveImage': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'EL',
|
'command': 'EL----;',
|
||||||
'success': None,
|
'success': True,
|
||||||
'error': None
|
'error': None
|
||||||
},
|
},
|
||||||
'receiveDir': {
|
'receiveDir': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'ED----',
|
'command': 'ED----;',
|
||||||
'success': None,
|
'success': True,
|
||||||
'error': None
|
'error': None
|
||||||
},
|
},
|
||||||
'deleteImage': {
|
'deleteImage': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'EQ----',
|
'command': 'EQ----;',
|
||||||
'success': 'OK\r',
|
'success': 'OK\r',
|
||||||
'error': 'Err\r',
|
'error': 'Err\r',
|
||||||
'args': ['imageName']
|
'args': ['imageName']
|
||||||
|
|
@ -91,26 +91,26 @@ MKPcommands = {
|
||||||
'receiveDate': {
|
'receiveDate': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': '*GSTD',
|
'command': '*GSTD',
|
||||||
'success': '[0-9]{13}',
|
'success': True,
|
||||||
'error': None,
|
'error': None,
|
||||||
'args': ['','']
|
'args': ['dateTime']
|
||||||
},
|
},
|
||||||
'status': {
|
'status': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'SV',
|
'command': 'SV',
|
||||||
'success': None,
|
'success': True,
|
||||||
'error': None
|
'error': None
|
||||||
},
|
},
|
||||||
'status1': {
|
'status1': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'S1',
|
'command': 'S1',
|
||||||
'success': None,
|
'success': True,
|
||||||
'error': None
|
'error': None
|
||||||
},
|
},
|
||||||
'status2': {
|
'status2': {
|
||||||
'defPrefix': True,
|
'defPrefix': True,
|
||||||
'command': 'S2',
|
'command': 'S2',
|
||||||
'success': None,
|
'success': True,
|
||||||
'error': None
|
'error': None
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
'''
|
||||||
|
Created on 27 set 2019
|
||||||
|
|
||||||
|
@author: Emanuele Trabattoni
|
||||||
|
'''
|
||||||
|
import time
|
||||||
|
import sys
|
||||||
|
import printer
|
||||||
|
import commands
|
||||||
|
|
||||||
|
def main():
|
||||||
|
printer = printer.MarkoPrinter('./conf.json')
|
||||||
|
printer.connetti()
|
||||||
|
|
||||||
|
pass
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
sys.exit(main())
|
||||||
|
pass
|
||||||
|
|
@ -2,7 +2,6 @@ import socket
|
||||||
import json
|
import json
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
class MarkoPrinter:
|
class MarkoPrinter:
|
||||||
def __init__(self, configFilePath):
|
def __init__(self, configFilePath):
|
||||||
self.inkStatCounter = 0
|
self.inkStatCounter = 0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue