def clear(): try: Config.genfilepath(os.getcwd()) with tool.AppSettingReader() as s: s.set('wnpasswd', {'value': ''}) s.set('mode', {'value': 'single'}) s.set('protocol', {'value': 'serial'}) s.set('initwinnum', {'value': '1'}) if os.path.exists(Config.tmp): shutil.rmtree(Config.tmp) os.mkdir(Config.tmp) except Exception: pass
def prepare(self): Config.connect_normal_db() Config.genfilepath( os.getcwd() ) with tool.AppSettingReader() as s: Config.showmesarea = eval( s.get('showmesarea', 'value') ) Config.autosn = eval( s.get('autosn', 'value') ) Config.autoworkstage = eval(s.get('autoworkstage', 'value')) Config.mes_attr['extern_StationCode'] = s.get('stationcode', 'value') Config.mes_attr['extern_SubLineCode'] = s.get('linecode', 'value') Config.mes_attr['extern_WJTableName'] = s.get('worktable', 'value') Config.mes_attr['op_workers'] = int( s.get('operators', 'value') ) Config.initwinnum = int( s.get('initwinnum', 'value') ) Config.mode['mode'] = s.get('mode', 'value') Config.protocol = s.get('protocol', 'value') Config.wn = s.get('wn', 'value') Config.autopos = eval( s.get('autopos', 'value') ) Config.posx = int(s.get('posx', 'value')) Config.posy = int(s.get('posy', 'value')) Config.autopos = True if int(Config.initwinnum) > 1 else False