#-*- coding:utf-8 -*-#Author: Pete Yim#Date : 13-7-31
importthreadingimportserialfrom time importsleep
GLOBAL_COUNT=0
GLOBAL_OUT_INIT_NUM=0
GLOBAL_OUT_CHECK_NUM=0
COMMAND_INIT_FLAG=False
COMMAND_CHECK_FLAG=False
COMMAND_OUTPUT= ''GLOBAL_CASH_1=0
GLOBAL_CASH_5=0
GLOBAL_CASH_10=0
GLOBAL_CASH_20=0
GLOBAL_CASH_50=0
SERIAL_SETTING={'PORT' : 4,'BAUDRATE' : 9600,'BYTESIZE': serial.EIGHTBITS,'PARITY': serial.PARITY_NONE,'STOPBITS': serial.STOPBITS_TWO
}
DATA_OUT_DIC={'DATA_OUT_1' : '7F8001116582','DATA_OUT_2' : '7F000123C988','DATA_OUT_3' : '7F800226FC3B56','DATA_OUT_4' : '7F000125DD88','DATA_OUT_5' : '7F0004240301126757','DATA_OUT_6' : '7F0001051E08','DATA_OUT_7' : '7F8001195602','DATA_OUT_8' : '7F0001093608','DATA_OUT_9' : '7F8001071202','DATA_OUT_10' : '7F0003029F0021DA','DATA_OUT_11' : '7F80010A3F82','DATA_OUT_12' : '7F0001071188','DATA_OUT_13' : '7F8003029F002266','DATA_OUT_14' : '7F00010A3C08'}classCashSerial(threading.Thread):def __init__(self):
threading.Thread.__init__(self)
self.__terminate =Falsedefopen(self, settings):try:
self.serial= serial.Serial(port=SERIAL_SETTING['PORT'],
baudrate=SERIAL_SETTING['BAUDRATE'],
bytesize=SERIAL_SETTING['BYTESIZE'],<