nuova logica per compilare i comandi

master
Emanuele Trabattoni 2019-09-27 17:40:51 +02:00
parent 4c361f2cc3
commit e9f7e6e3b5
3 changed files with 14 additions and 8 deletions

View File

@ -44,15 +44,15 @@ MKPcommands = {
'defPrefix': False,
'begin': '\x02', #STX
'end': '\x03', #ETX
'command': 'TZ',
'command': 'TZ{imagename};{printMode};{queueNo};{delay}\r{fieldContent}{counterStart}',
'success': '\x06\x02([0-9])OK\x03',
'error': '([0-9])E([0-9])',
'args': ['imageName', 'printMode', 'fieldContent']
'args': ['imageName', 'printMode', 'fieldContent'],
'optArgs': ['queueNo', 'delay', 'counterStart']
},
'sendImage': {
'defPrefix': True,
'command': 'EW----;',
'command': 'EW----;{imageName}',
'success': None,
'error': None,
'args': ['imageName']
@ -77,14 +77,14 @@ MKPcommands = {
},
'deleteImage': {
'defPrefix': True,
'command': 'EQ----;',
'command': 'EQ----;{imageName}',
'success': 'OK\r',
'error': 'Err\r',
'args': ['imageName']
},
'sendDate': {
'defPrefix': True,
'command': '*STD',
'command': '*STD{dateTime};{offset}',
'success': 'Ok\r',
'error': 'Err\r',
'args': ['dateTime','offset']
@ -94,7 +94,6 @@ MKPcommands = {
'command': '*GSTD',
'success': True,
'error': None,
'args': ['dateTime']
},
'status': {
'defPrefix': True,

View File

@ -1,2 +1,9 @@
09-27 15:54:43|WARNING|<module> |36 : MarcaturaDime Started!
09-27 15:55:11|WARNING|<module> |36 : MarcaturaDime Started!
09-27 16:42:33|WARNING|<module> |49 : MarcaturaDime Started!
09-27 16:42:46|WARNING|<module> |50 : MarcaturaDime Started!
09-27 16:42:57|WARNING|<module> |50 : MarcaturaDime Started!
09-27 16:43:07|WARNING|<module> |50 : MarcaturaDime Started!
09-27 16:44:46|WARNING|<module> |50 : MarcaturaDime Started!
09-27 16:48:41|WARNING|<module> |50 : MarcaturaDime Started!
09-27 17:24:19|WARNING|<module> |50 : MarcaturaDime Started!

View File

@ -20,7 +20,7 @@ def main():
lastTimestamp = int(time.time()*100)
commandString = test.cmdString('callPrintImage', {'imageName': 'TM2.00I',
'printMode': '10',
'fieldContent': '\r{0}\r{0}\r'.format(lastTimestamp)
'fieldContent': '{0}\r{0}\r'.format(lastTimestamp)
}
)
LOGGER.debug(commandString)