from tkinter import * import datetime import time import sql class Var_value(Frame): def __init__(self, init_window): self.init_window = init_window self.windows_idx = 'app' self.last_windows_idx = 'app' self.screen_width = 1024 self.screen_height = 600 self.sqlclient = sql.sqlclient self.pro_exit_stat = False self.order_ok_str = StringVar() self.order_ng_str = StringVar() self.order_targe_str = StringVar() self.order_snp_str = StringVar() self.order_year_str = StringVar() self.batch_str = StringVar() self.printf_num_str = StringVar() self.serial_num_str = StringVar() self.airtightness_17700_str = StringVar() self.airtightness_17720_str = StringVar() self.startdelay_17700_str = StringVar() self.airtime_17700_str = StringVar() self.presstime_17700_str = StringVar() self.testtime_17700_str = StringVar() self.exhaust_17700_str = StringVar() self.maxpress_17700_str = StringVar() self.minpress_17700_str = StringVar() self.setpress_17700_str = StringVar() self.capacity_17700_str = StringVar() self.posthreshold_17700_str =StringVar() self.pnegthreshold_17700_str = StringVar() self.startdelay_17720_str = StringVar() self.airtime_17720_str = StringVar() self.presstime_17720_str = StringVar() self.testtime_17720_str = StringVar() self.exhaust_17720_str = StringVar() self.maxpress_17720_str = StringVar() self.minpress_17720_str = StringVar() self.setpress_17720_str = StringVar() self.capacity_17720_str = StringVar() self.posthreshold_17720_str = StringVar() self.pnegthreshold_17720_str = StringVar() # self.team_list = ['A组', 'B组', 'C组', 'D组'] self.team_list = ['A组', 'B组'] self.team_sel = 0 self.team = chr(self.team_sel + ord('A')) self.team_value = self.team_list[self.team_sel] self.product_load = True self.product_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', ''] self.product_17700_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', ''] self.product_17720_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', ''] self.product_idx = 0 self.product_list_str = [StringVar()]*14 for i in range(14): temp = StringVar() temp.set(self.product_list[i]) self.product_list_str[i] = temp self.opc_product_idx = 0 self.opc_product_name = '' self.product_idx_str = StringVar() self.product_str = StringVar() self.product_idx_str.set(self.product_idx+1) self.product_name = self.product_list[self.product_idx] self.product_str.set(self.product_name) self.workstatstr = False self.bee_stat = False self.auth_stat = False self.auth_timeout = 300 self.originchkok_stat = False self.upairtightok_stat = False self.upairtightng_stat = False self.upprintok_stat = False self.origindir_stat = False self.downairtightok_stat = False self.downairtightng_stat = False self.downprintok_stat = False self.motororiginok_stat = False self.motoronup_stat = False self.motorondown_stat = False self.motorunuse_stat = False self.upgages_stat = False self.upworks_stat = False self.upmpen_stat = False self.upconnect_stat = False self.downgages_stat = False self.downworks_stat = False self.downmpen_stat = False self.downconnect_stat = False self.batch_y = 'L' self.batch_m = '1' self.batch_d = '01' self.batch = self.batch_y+self.batch_m+self.batch_d self.batch_str.set(self.batch) self.order_ok_str.set("0") self.order_ng_str.set("0") self.order_targe_str.set("0") self.order_snp_str.set("----") self.order_year_str.set(self.batch_y) self.order_ok = 0 self.order_ng = 0 self.order_targe = 0 self.order_sng = 0 self.order_update_stat = False # 批号 self.number_type = '2GN' self.number_count = 1 self.number_value = '{0}{1}{2}{3}{4:04d}{5}'.format(self.number_type, self.batch_y, self.batch_m, self.batch_d, self.number_count, chr(self.team_sel + ord('A'))) self.printf_num_str.set(self.number_value) self.serial_num = 1 self.serial_num_value = '{0:04d}{1:02d}{2:02d}{3:05d}'.format(datetime.datetime.now().year, datetime.datetime.now().month, datetime.datetime.now().day, self.serial_num) self.serial_num_str.set(self.serial_num_value) self.serial_num_working = '' self.product_ok = False # '<01>:0.215 MPa:(OK):0.171 ml/min' self.airtightness_17700 = '' # '<01>:0.51 MPa:(TD):0.504 ml/min' self.airtightness_17720 = '' self.airtightness_17700_str.set(self.airtightness_17700) self.airtightness_17720_str.set(self.airtightness_17720) self.product_17700_name = '' self.product_17720_name = '' self.product_name_noset = '品番读取中' self.inquire_begin_data = datetime.datetime.now().strftime('%Y-%m-%d') self.inquire_end_data = datetime.datetime.now().strftime('%Y-%m-%d') self.opc_conn_stat = "OPC服务器未连接" self.socket_conn_stat = False self.airdata_work_stat = 'finish' self.order_count = 1 self.order_num = '{0}{1}{2}{3:02d}'.format(self.number_type, datetime.datetime.now().strftime('%Y%m%d%H%M%S'), chr(self.team_sel + ord('A')), self.order_count) # 查询 self.data_columns = ( "date", "time", "serial", "batch", "testok", "data", "team", "product_name", "startup", "air", "press", "test", "exhaust", "maxpress", "minpress", "setpress", "capacity", "posthreshold", "pnegthreshold") self.data_headers = ( "日期", "时间", "序号", "标签号", "测试结果", "气密数据", "班组", "品番", "启动延时", "充气时间", "保压时间", "测试时间", "排气时间", "最大压力", "最小压力", "设定压力", "容积", "正阈值", "负阈值") self.param_columns = ("product_idx", "product_name", "param_type", "startup", "air", "press", "test", "exhaust", "maxpress", "minpress", "setpress", "capacity", "posthreshold", "pnegthreshold") self.param_headers = ("产品编号", "品番", "启动延时", "充气时间", "保压时间", "测试时间", "排气时间", "最大压力", "最小压力", "设定压力", "容积", "正阈值", "负阈值") self.product_data = [] self.listview_content = "NULL" self.listview_stat = False self.listview_lock = False self.file_name = '' self.file_save_stat = True class opc_var: def __init__(self): self.lock = False self.opcrdkv = {} self.opcwrkv = {} self.opcwrstatkv = {} # OPC组 self.stationtype = 'G01_0350' self.stationdev = 'DevCJ2W' self.stationgroup = "{0}.{1}".format(self.stationtype, self.stationdev) # 蜂鸣器控制 self.Bee_Addr = '{0}.{1}.Bee'.format(self.stationtype, self.stationdev) self.opcaddrlist = [self.Bee_Addr] self.opcrdkv[self.Bee_Addr] = True self.opcwrkv[self.Bee_Addr] = True self.opcwrstatkv[self.Bee_Addr] = False # 产品编号 self.Product_idx_Addr = '{0}.{1}.Product_idx'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Product_idx_Addr) self.opcrdkv[self.Product_idx_Addr] = 0 self.opcwrkv[self.Product_idx_Addr] = 0 self.opcwrstatkv[self.Product_idx_Addr] = False # 品番名 self.Product_name_Addr = '{0}.{1}.Product_name'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Product_name_Addr) self.opcrdkv[self.Product_name_Addr] = '' self.opcwrkv[self.Product_name_Addr] = '' self.opcwrstatkv[self.Product_name_Addr] = False # 批号前缀 self.Number_type_Addr = '{0}.{1}.Dev_num'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Number_type_Addr) self.opcrdkv[self.Number_type_Addr] = '' self.opcwrkv[self.Number_type_Addr] = '' self.opcwrstatkv[self.Number_type_Addr] = False # 年批号 ASCII A-Z self.Batch_y_Addr = '{0}.{1}.Batch_y'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Batch_y_Addr) self.opcrdkv[self.Batch_y_Addr] = 65 self.opcwrkv[self.Batch_y_Addr] = 65 self.opcwrstatkv[self.Batch_y_Addr] = False # 月批号 ASCII A-Z self.Batch_m_Addr = '{0}.{1}.Batch_m'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Batch_m_Addr) self.opcrdkv[self.Batch_m_Addr] = 65 self.opcwrkv[self.Batch_m_Addr] = 65 self.opcwrstatkv[self.Batch_m_Addr] = False # 日批号 self.Batch_d_Addr = '{0}.{1}.Batch_d'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Batch_d_Addr) self.opcrdkv[self.Batch_d_Addr] = 1 self.opcwrkv[self.Batch_d_Addr] = 1 self.opcwrstatkv[self.Batch_d_Addr] = False # 气密数据17700 self.Air_data_17720_Addr = '{0}.{1}.Air_data_17720'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Air_data_17720_Addr) self.opcrdkv[self.Air_data_17720_Addr] = '' self.opcwrkv[self.Air_data_17720_Addr] = '' self.opcwrstatkv[self.Air_data_17720_Addr] = False # 气密数据17720 self.Air_data_17700_Addr = '{0}.{1}.Air_data_17700'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Air_data_17700_Addr) self.opcrdkv[self.Air_data_17700_Addr] = '' self.opcwrkv[self.Air_data_17700_Addr] = '' self.opcwrstatkv[self.Air_data_17700_Addr] = False # OK数 self.Ok_count_Addr = '{0}.{1}.Ok_count'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Ok_count_Addr) self.opcrdkv[self.Ok_count_Addr] = 0 self.opcwrkv[self.Ok_count_Addr] = 0 self.opcwrstatkv[self.Ok_count_Addr] = False # NG数 self.Ng_count_Addr = '{0}.{1}.Ng_count'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Ng_count_Addr) self.opcrdkv[self.Ng_count_Addr] = 0 self.opcwrkv[self.Ng_count_Addr] = 0 self.opcwrstatkv[self.Ng_count_Addr] = False # Targe数 self.Targe_count_Addr = '{0}.{1}.Targe_count'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Targe_count_Addr) self.opcrdkv[self.Targe_count_Addr] = 0 self.opcwrkv[self.Targe_count_Addr] = 0 self.opcwrstatkv[self.Targe_count_Addr] = False # SNP self.SNP_count_Addr = '{0}.{1}.SNP_count'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.SNP_count_Addr) self.opcrdkv[self.SNP_count_Addr] = 0 self.opcwrkv[self.SNP_count_Addr] = 0 self.opcwrstatkv[self.SNP_count_Addr] = False # 点检OK self.Origin_ok_Addr = '{0}.{1}.Origin_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Origin_ok_Addr) self.opcrdkv[self.Origin_ok_Addr] = 0 self.opcwrkv[self.Origin_ok_Addr] = 0 self.opcwrstatkv[self.Origin_ok_Addr] = False # 原点指示 self.Origin_dir_Addr = '{0}.{1}.Origin_dir'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Origin_dir_Addr) self.opcrdkv[self.Origin_dir_Addr] = 0 self.opcwrkv[self.Origin_dir_Addr] = 0 self.opcwrstatkv[self.Origin_dir_Addr] = False # 上气密OK self.Upairtight_ok_Addr = '{0}.{1}.Upairtight_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upairtight_ok_Addr) self.opcrdkv[self.Upairtight_ok_Addr] = False self.opcwrkv[self.Upairtight_ok_Addr] = False self.opcwrstatkv[self.Upairtight_ok_Addr] = False # 上气密OK self.Upairtight_ng_Addr = '{0}.{1}.Upairtight_ng'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upairtight_ng_Addr) self.opcrdkv[self.Upairtight_ng_Addr] = False self.opcwrkv[self.Upairtight_ng_Addr] = False self.opcwrstatkv[self.Upairtight_ng_Addr] = False # 下气密OK self.Downairtight_ok_Addr = '{0}.{1}.Downairtight_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downairtight_ok_Addr) self.opcrdkv[self.Downairtight_ok_Addr] = False self.opcwrkv[self.Downairtight_ok_Addr] = False self.opcwrstatkv[self.Downairtight_ok_Addr] = False # 下气密OK self.Downairtight_ng_Addr = '{0}.{1}.Downairtight_ng'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downairtight_ng_Addr) self.opcrdkv[self.Downairtight_ng_Addr] = False self.opcwrkv[self.Downairtight_ng_Addr] = False self.opcwrstatkv[self.Downairtight_ng_Addr] = False # 上刻印完成 self.Upprint_ok_Addr = '{0}.{1}.Upprint_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upprint_ok_Addr) self.opcrdkv[self.Upprint_ok_Addr] = False self.opcwrkv[self.Upprint_ok_Addr] = False self.opcwrstatkv[self.Upprint_ok_Addr] = False # 下刻印完成 self.Downprint_ok_Addr = '{0}.{1}.Downprint_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downprint_ok_Addr) self.opcrdkv[self.Downprint_ok_Addr] = False self.opcwrkv[self.Downprint_ok_Addr] = False self.opcwrstatkv[self.Downprint_ok_Addr] = False # 上gage-s self.Upgage_s_Addr = '{0}.{1}.Upgage_s'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upgage_s_Addr) self.opcrdkv[self.Upgage_s_Addr] = False self.opcwrkv[self.Upgage_s_Addr] = False self.opcwrstatkv[self.Upgage_s_Addr] = False # 下gage-s self.Downgage_s_Addr = '{0}.{1}.Downgage_s'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downgage_s_Addr) self.opcrdkv[self.Downgage_s_Addr] = False self.opcwrkv[self.Downgage_s_Addr] = False self.opcwrstatkv[self.Downgage_s_Addr] = False # 上work-s self.Upwork_s_Addr = '{0}.{1}.Upwork_s'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upwork_s_Addr) self.opcrdkv[self.Upwork_s_Addr] = False self.opcwrkv[self.Upwork_s_Addr] = False self.opcwrstatkv[self.Upwork_s_Addr] = False # 下work-s self.Downwork_s_Addr = '{0}.{1}.Downwork_s'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downwork_s_Addr) self.opcrdkv[self.Downwork_s_Addr] = False self.opcwrkv[self.Downwork_s_Addr] = False self.opcwrstatkv[self.Downwork_s_Addr] = False # 上m-pen self.Upm_pen_Addr = '{0}.{1}.Upm_pen'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upm_pen_Addr) self.opcrdkv[self.Upm_pen_Addr] = False self.opcwrkv[self.Upm_pen_Addr] = False self.opcwrstatkv[self.Upm_pen_Addr] = False # 下m-pen self.Downm_pen_Addr = '{0}.{1}.Downm_pen'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downm_pen_Addr) self.opcrdkv[self.Downm_pen_Addr] = False self.opcwrkv[self.Downm_pen_Addr] = False self.opcwrstatkv[self.Downm_pen_Addr] = False # 上connet self.Upconnect_Addr = '{0}.{1}.Upconnect'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Upconnect_Addr) self.opcrdkv[self.Upconnect_Addr] = False self.opcwrkv[self.Upconnect_Addr] = False self.opcwrstatkv[self.Upconnect_Addr] = False # 下connet self.Downconnect_Addr = '{0}.{1}.Downconnect'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Downconnect_Addr) self.opcrdkv[self.Downconnect_Addr] = False self.opcwrkv[self.Downconnect_Addr] = False self.opcwrstatkv[self.Downconnect_Addr] = False # 电机原点正确 self.Motororgin_ok_Addr = '{0}.{1}.Motororgin_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Motororgin_ok_Addr) self.opcrdkv[self.Motororgin_ok_Addr] = False self.opcwrkv[self.Motororgin_ok_Addr] = False self.opcwrstatkv[self.Motororgin_ok_Addr] = False # 电机位于上工位 self.Motor_onup_Addr = '{0}.{1}.Motor_onup'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Motor_onup_Addr) self.opcrdkv[self.Motor_onup_Addr] = False self.opcwrkv[self.Motor_onup_Addr] = False self.opcwrstatkv[self.Motor_onup_Addr] = False # 电机位于下工位 self.Motor_ondown_Addr = '{0}.{1}.Motor_ondown'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Motor_ondown_Addr) self.opcrdkv[self.Motor_ondown_Addr] = False self.opcwrkv[self.Motor_ondown_Addr] = False self.opcwrstatkv[self.Motor_ondown_Addr] = False # 手动刻印 self.Manual_print_Addr = '{0}.{1}.Manual_print'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Manual_print_Addr) self.opcrdkv[self.Manual_print_Addr] = False self.opcwrkv[self.Manual_print_Addr] = False self.opcwrstatkv[self.Manual_print_Addr] = False # 手动刻印上工位 self.Manual_printup_Addr = '{0}.{1}.Manual_printup'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Manual_printup_Addr) self.opcrdkv[self.Manual_printup_Addr] = False self.opcwrkv[self.Manual_printup_Addr] = False self.opcwrstatkv[self.Manual_printup_Addr] = False # 手动刻印上工位 self.Manual_printdown_Addr = '{0}.{1}.Manual_printdown'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Manual_printdown_Addr) self.opcrdkv[self.Manual_printdown_Addr] = False self.opcwrkv[self.Manual_printdown_Addr] = False self.opcwrstatkv[self.Manual_printdown_Addr] = False # 手动刻印OK self.Manual_printok_Addr = '{0}.{1}.Manual_printok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Manual_printok_Addr) self.opcrdkv[self.Manual_printok_Addr] = False self.opcwrkv[self.Manual_printok_Addr] = False self.opcwrstatkv[self.Manual_printok_Addr] = False # PLC通讯状态 self.PLC_ok_Addr = '{0}.{1}.PLC_ok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.PLC_ok_Addr) self.opcrdkv[self.PLC_ok_Addr] = False self.opcwrkv[self.PLC_ok_Addr] = False self.opcwrstatkv[self.PLC_ok_Addr] = False # 气密数据保存状态 self.Airdata_stat_Addr = '{0}.{1}.Airdata_stat'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Airdata_stat_Addr) self.opcrdkv[self.Airdata_stat_Addr] = 0 self.opcwrkv[self.Airdata_stat_Addr] = 0 self.opcwrstatkv[self.Airdata_stat_Addr] = False # 自动刻印完成 self.Auto_printok_Addr = '{0}.{1}.Auto_printok'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Auto_printok_Addr) self.opcrdkv[self.Auto_printok_Addr] = False self.opcwrkv[self.Auto_printok_Addr] = False self.opcwrstatkv[self.Auto_printok_Addr] = False # 打印开始信号 self.Print_start_Addr = '{0}.{1}.Print_start'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Print_start_Addr) self.opcrdkv[self.Print_start_Addr] = False self.opcwrkv[self.Print_start_Addr] = False self.opcwrstatkv[self.Print_start_Addr] = False # 开始工作信号 self.Start_work_Addr = '{0}.{1}.Start_work'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Start_work_Addr) self.opcrdkv[self.Start_work_Addr] = False self.opcwrkv[self.Start_work_Addr] = False self.opcwrstatkv[self.Start_work_Addr] = False # 测试值ok_r self.Airtest_ok_r_Addr = '{0}.{1}.Airtest_ok_r'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Airtest_ok_r_Addr) self.opcrdkv[self.Airtest_ok_r_Addr] = False self.opcwrkv[self.Airtest_ok_r_Addr] = False self.opcwrstatkv[self.Airtest_ok_r_Addr] = False # 测试值ok_w self.Airtest_ok_w_Addr = '{0}.{1}.Airtest_ok_w'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Airtest_ok_w_Addr) self.opcrdkv[self.Airtest_ok_w_Addr] = False self.opcwrkv[self.Airtest_ok_w_Addr] = False self.opcwrstatkv[self.Airtest_ok_w_Addr] = False # 测试值ng_r self.Airtest_ng_r_Addr = '{0}.{1}.Airtest_ng_r'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Airtest_ng_r_Addr) self.opcrdkv[self.Airtest_ng_r_Addr] = False self.opcwrkv[self.Airtest_ng_r_Addr] = False self.opcwrstatkv[self.Airtest_ng_r_Addr] = False # 测试值ng_w self.Airtest_ng_w_Addr = '{0}.{1}.Airtest_ng_w'.format(self.stationtype, self.stationdev) self.opcaddrlist.append(self.Airtest_ng_w_Addr) self.opcrdkv[self.Airtest_ng_w_Addr] = False self.opcwrkv[self.Airtest_ng_w_Addr] = False self.opcwrstatkv[self.Airtest_ng_w_Addr] = False def set_Bee(self, value): while(self.lock == True): time.sleep(0.01) self.opcwrkv[self.Bee_Addr] = value self.opcwrstatkv[self.Bee_Addr] = True def get_Bee(self): return self.opcrdkv[self.Bee_Addr] def check_Bee(self): if self.opcwrstatkv[self.Bee_Addr] == True: if self.opcrdkv[self.Bee_Addr] == self.opcwrkv[self.Bee_Addr]: self.opcwrstatkv[self.Bee_Addr] = False def set_Product_idx(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Product_idx_Addr] = value self.opcwrstatkv[self.Product_idx_Addr] = True def get_Product_idx(self): return self.opcrdkv[self.Product_idx_Addr] def check_Product_idx(self): if self.opcwrstatkv[self.Product_idx_Addr] == True: if self.opcrdkv[self.Product_idx_Addr] == self.opcwrkv[self.Product_idx_Addr]: self.opcwrstatkv[self.Product_idx_Addr] = False def set_Number_type(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Number_type_Addr] = value self.opcwrstatkv[self.Number_type_Addr] = True def get_Number_type(self): return self.opcrdkv[self.Number_type_Addr] def check_Number_type(self): if self.opcwrstatkv[self.Number_type_Addr] == True: if self.opcrdkv[self.Number_type_Addr] == self.opcwrkv[self.Number_type_Addr]: self.opcwrstatkv[self.Number_type_Addr] = False def set_Product_name(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Product_name_Addr] = value self.opcwrstatkv[self.Product_name_Addr] = True def get_Product_name(self): return self.opcrdkv[self.Product_name_Addr] def check_Product_name(self): if self.opcwrstatkv[self.Product_name_Addr] == True: if self.opcrdkv[self.Product_name_Addr] == self.opcwrkv[self.Product_name_Addr]: self.opcwrstatkv[self.Product_name_Addr] = False def set_Batch_y(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Batch_y_Addr] = value self.opcwrstatkv[self.Batch_y_Addr] = True def get_Batch_y(self): return self.opcrdkv[self.Batch_y_Addr] def check_Batch_y(self): if self.opcwrstatkv[self.Batch_y_Addr] == True: if self.opcrdkv[self.Batch_y_Addr] == self.opcwrkv[self.Batch_y_Addr]: self.opcwrstatkv[self.Batch_y_Addr] = False def set_Batch_m(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Batch_m_Addr] = value self.opcwrstatkv[self.Batch_m_Addr] = True def get_Batch_m(self): return self.opcrdkv[self.Batch_m_Addr] def check_Batch_m(self): if self.opcwrstatkv[self.Batch_m_Addr] == True: if self.opcrdkv[self.Batch_m_Addr] == self.opcwrkv[self.Batch_m_Addr]: self.opcwrstatkv[self.Batch_m_Addr] = False def set_Batch_d(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Batch_d_Addr] = value self.opcwrstatkv[self.Batch_d_Addr] = True def get_Batch_d(self): return self.opcrdkv[self.Batch_d_Addr] def check_Batch_d(self): if self.opcwrstatkv[self.Batch_d_Addr] == True: if self.opcrdkv[self.Batch_d_Addr] == self.opcwrkv[self.Batch_d_Addr]: self.opcwrstatkv[self.Batch_d_Addr] = False def set_Air_data_17700(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Air_data_17700_Addr] = value self.opcwrstatkv[self.Air_data_17700_Addr] = True def get_Air_data_17700(self): return self.opcrdkv[self.Air_data_17700_Addr] def check_Air_data_17700(self): if self.opcwrstatkv[self.Air_data_17700_Addr] == True: if self.opcrdkv[self.Air_data_17700_Addr] == self.opcwrkv[self.Air_data_17700_Addr]: self.opcwrstatkv[self.Air_data_17700_Addr] = False def set_Air_data_17720(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Air_data_17720_Addr] = value self.opcwrstatkv[self.Air_data_17720_Addr] = True def get_Air_data_17720(self): return self.opcrdkv[self.Air_data_17720_Addr] def check_Air_data_17720(self): if self.opcwrstatkv[self.Air_data_17720_Addr] == True: if self.opcrdkv[self.Air_data_17720_Addr] == self.opcwrkv[self.Air_data_17720_Addr]: self.opcwrstatkv[self.Air_data_17720_Addr] = False def set_Ok_count(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Ok_count_Addr] = value self.opcwrstatkv[self.Ok_count_Addr] = True def get_Ok_count(self): return self.opcrdkv[self.Ok_count_Addr] def check_Ok_count(self): if self.opcwrstatkv[self.Ok_count_Addr] == True: if self.opcrdkv[self.Ok_count_Addr] == self.opcwrkv[self.Ok_count_Addr]: self.opcwrstatkv[self.Ok_count_Addr] = False def set_Ng_count(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Ng_count_Addr] = value self.opcwrstatkv[self.Ng_count_Addr] = True def get_Ng_count(self): return self.opcrdkv[self.Ng_count_Addr] def check_Ng_count(self): if self.opcwrstatkv[self.Ng_count_Addr] == True: if self.opcrdkv[self.Ng_count_Addr] == self.opcwrkv[self.Ng_count_Addr]: self.opcwrstatkv[self.Ng_count_Addr] = False def set_Targe_count(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Targe_count_Addr] = value self.opcwrstatkv[self.Targe_count_Addr] = True def get_Targe_count(self): return self.opcrdkv[self.Targe_count_Addr] def check_Targe_count(self): if self.opcwrstatkv[self.Targe_count_Addr] == True: if self.opcrdkv[self.Targe_count_Addr] == self.opcwrkv[self.Targe_count_Addr]: self.opcwrstatkv[self.Targe_count_Addr] = False def set_SNP_count(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.SNP_count_Addr] = value self.opcwrstatkv[self.SNP_count_Addr] = True def get_SNP_count(self): return self.opcrdkv[self.SNP_count_Addr] def check_SNP_count(self): if self.opcwrstatkv[self.SNP_count_Addr] == True: if self.opcrdkv[self.SNP_count_Addr] == self.opcwrkv[self.SNP_count_Addr]: self.opcwrstatkv[self.SNP_count_Addr] = False def set_Origin_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Origin_ok_Addr] = value self.opcwrstatkv[self.Origin_ok_Addr] = True def get_Origin_ok(self): return self.opcrdkv[self.Origin_ok_Addr] def check_Origin_ok(self): if self.opcwrstatkv[self.Origin_ok_Addr] == True: if self.opcrdkv[self.Origin_ok_Addr] == self.opcwrkv[self.Origin_ok_Addr]: self.opcwrstatkv[self.Origin_ok_Addr] = False def set_Origin_dir(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Origin_dir_Addr] = value self.opcwrstatkv[self.Origin_dir_Addr] = True def get_Origin_dir(self): return self.opcrdkv[self.Origin_dir_Addr] def check_Origin_dir(self): if self.opcwrstatkv[self.Origin_dir_Addr] == True: if self.opcrdkv[self.Origin_dir_Addr] == self.opcwrkv[self.Origin_dir_Addr]: self.opcwrstatkv[self.Origin_dir_Addr] = False def set_Upairtight_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upairtight_ok_Addr] = value self.opcwrstatkv[self.Upairtight_ok_Addr] = True def get_Upairtight_ok(self): return self.opcrdkv[self.Upairtight_ok_Addr] def check_Upairtight_ok(self): if self.opcwrstatkv[self.Upairtight_ok_Addr] == True: if self.opcrdkv[self.Upairtight_ok_Addr] == self.opcwrkv[self.Upairtight_ok_Addr]: self.opcwrstatkv[self.Upairtight_ok_Addr] = False def set_Upairtight_ng(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upairtight_ng_Addr] = value self.opcwrstatkv[self.Upairtight_ng_Addr] = True def get_Upairtight_ng(self): return self.opcrdkv[self.Upairtight_ng_Addr] def check_Upairtight_ng(self): if self.opcwrstatkv[self.Upairtight_ng_Addr] == True: if self.opcrdkv[self.Upairtight_ng_Addr] == self.opcwrkv[self.Upairtight_ng_Addr]: self.opcwrstatkv[self.Upairtight_ng_Addr] = False def set_Downairtight_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downairtight_ok_Addr] = value self.opcwrstatkv[self.Downairtight_ok_Addr] = True def get_Downairtight_ok(self): return self.opcrdkv[self.Downairtight_ok_Addr] def check_Downairtight_ok(self): if self.opcwrstatkv[self.Downairtight_ok_Addr] == True: if self.opcrdkv[self.Downairtight_ok_Addr] == self.opcwrkv[self.Downairtight_ok_Addr]: self.opcwrstatkv[self.Downairtight_ok_Addr] = False def set_Downairtight_ng(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downairtight_ng_Addr] = value self.opcwrstatkv[self.Downairtight_ng_Addr] = True def get_Downairtight_ng(self): return self.opcrdkv[self.Downairtight_ng_Addr] def check_Downairtight_ng(self): if self.opcwrstatkv[self.Downairtight_ng_Addr] == True: if self.opcrdkv[self.Downairtight_ng_Addr] == self.opcwrkv[self.Downairtight_ng_Addr]: self.opcwrstatkv[self.Downairtight_ng_Addr] = False def set_Upprint_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upprint_ok_Addr] = value self.opcwrstatkv[self.Upprint_ok_Addr] = True def get_Upprint_ok(self): return self.opcrdkv[self.Upprint_ok_Addr] def check_Upprint_ok(self): if self.opcwrstatkv[self.Upprint_ok_Addr] == True: if self.opcrdkv[self.Upprint_ok_Addr] == self.opcwrkv[self.Upprint_ok_Addr]: self.opcwrstatkv[self.Upprint_ok_Addr] = False def set_Downprint_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downprint_ok_Addr] = value self.opcwrstatkv[self.Downprint_ok_Addr] = True def get_Downprint_ok(self): return self.opcrdkv[self.Downprint_ok_Addr] def check_Downprint_ok(self): if self.opcwrstatkv[self.Downprint_ok_Addr] == True: if self.opcrdkv[self.Downprint_ok_Addr] == self.opcwrkv[self.Downprint_ok_Addr]: self.opcwrstatkv[self.Downprint_ok_Addr] = False def set_Upgage_s(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upgage_s_Addr] = value self.opcwrstatkv[self.Upgage_s_Addr] = True def get_Upgage_s(self): return self.opcrdkv[self.Upgage_s_Addr] def check_Upgage_s(self): if self.opcwrstatkv[self.Upgage_s_Addr] == True: if self.opcrdkv[self.Upgage_s_Addr] == self.opcwrkv[self.Upgage_s_Addr]: self.opcwrstatkv[self.Upgage_s_Addr] = False def set_Downgage_s(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downgage_s_Addr] = value self.opcwrstatkv[self.Downgage_s_Addr] = True def get_Downgage_s(self): return self.opcrdkv[self.Downgage_s_Addr] def check_Downgage_s(self): if self.opcwrstatkv[self.Downgage_s_Addr] == True: if self.opcrdkv[self.Downgage_s_Addr] == self.opcwrkv[self.Downgage_s_Addr]: self.opcwrstatkv[self.Downgage_s_Addr] = False def set_Upwork_s(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upwork_s_Addr] = value self.opcwrstatkv[self.Upwork_s_Addr] = True def get_Upwork_s(self): return self.opcrdkv[self.Upwork_s_Addr] def check_Upwork_s(self): if self.opcwrstatkv[self.Upwork_s_Addr] == True: if self.opcrdkv[self.Upwork_s_Addr] == self.opcwrkv[self.Upwork_s_Addr]: self.opcwrstatkv[self.Upwork_s_Addr] = False def set_Downwork_s(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downwork_s_Addr] = value self.opcwrstatkv[self.Downwork_s_Addr] = True def get_Downwork_s(self): return self.opcrdkv[self.Downwork_s_Addr] def check_Downwork_s(self): if self.opcwrstatkv[self.Downwork_s_Addr] == True: if self.opcrdkv[self.Downwork_s_Addr] == self.opcwrkv[self.Downwork_s_Addr]: self.opcwrstatkv[self.Downwork_s_Addr] = False def set_Upm_pen(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upm_pen_Addr] = value self.opcwrstatkv[self.Upm_pen_Addr] = True def get_Upm_pen(self): return self.opcrdkv[self.Upm_pen_Addr] def check_Upm_pen(self): if self.opcwrstatkv[self.Upm_pen_Addr] == True: if self.opcrdkv[self.Upm_pen_Addr] == self.opcwrkv[self.Upm_pen_Addr]: self.opcwrstatkv[self.Upm_pen_Addr] = False def set_Downm_pen(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downm_pen_Addr] = value self.opcwrstatkv[self.Downm_pen_Addr] = True def get_Downm_pen(self): return self.opcrdkv[self.Downm_pen_Addr] def check_Downm_pen(self): if self.opcwrstatkv[self.Downm_pen_Addr] == True: if self.opcrdkv[self.Downm_pen_Addr] == self.opcwrkv[self.Downm_pen_Addr]: self.opcwrstatkv[self.Downm_pen_Addr] = False def set_Upconnect(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Upconnect_Addr] = value self.opcwrstatkv[self.Upconnect_Addr] = True def get_Upconnect(self): return self.opcrdkv[self.Upconnect_Addr] def check_Upconnect(self): if self.opcwrstatkv[self.Upconnect_Addr] == True: if self.opcrdkv[self.Upconnect_Addr] == self.opcwrkv[self.Upconnect_Addr]: self.opcwrstatkv[self.Upconnect_Addr] = False def set_Downconnect(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Downconnect_Addr] = value self.opcwrstatkv[self.Downconnect_Addr] = True def get_Downconnect(self): return self.opcrdkv[self.Downconnect_Addr] def check_Downconnect(self): if self.opcwrstatkv[self.Downconnect_Addr] == True: if self.opcrdkv[self.Downconnect_Addr] == self.opcwrkv[self.Downconnect_Addr]: self.opcwrstatkv[self.Downconnect_Addr] = False def set_Motororgin_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Motororgin_ok_Addr] = value self.opcwrstatkv[self.Motororgin_ok_Addr] = True def get_Motororgin_ok(self): return self.opcrdkv[self.Motororgin_ok_Addr] def check_Motororgin_ok(self): if self.opcwrstatkv[self.Motororgin_ok_Addr] == True: if self.opcrdkv[self.Motororgin_ok_Addr] == self.opcwrkv[self.Motororgin_ok_Addr]: self.opcwrstatkv[self.Motororgin_ok_Addr] = False def set_Motor_onup(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Motor_onup_Addr] = value self.opcwrstatkv[self.Motor_onup_Addr] = True def get_Motor_onup(self): return self.opcrdkv[self.Motor_onup_Addr] def check_Motor_onup(self): if self.opcwrstatkv[self.Motor_onup_Addr] == True: if self.opcrdkv[self.Motor_onup_Addr] == self.opcwrkv[self.Motor_onup_Addr]: self.opcwrstatkv[self.Motor_onup_Addr] = False def set_Motor_ondown(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Motor_ondown_Addr] = value self.opcwrstatkv[self.Motor_ondown_Addr] = True def get_Motor_ondown(self): return self.opcrdkv[self.Motor_ondown_Addr] def check_Motor_ondown(self): if self.opcwrstatkv[self.Motor_ondown_Addr] == True: if self.opcrdkv[self.Motor_ondown_Addr] == self.opcwrkv[self.Motor_ondown_Addr]: self.opcwrstatkv[self.Motor_ondown_Addr] = False def set_Manual_print(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Manual_print_Addr] = value self.opcwrstatkv[self.Manual_print_Addr] = True def get_Manual_print(self): return self.opcrdkv[self.Manual_print_Addr] def check_Manual_print(self): if self.opcwrstatkv[self.Manual_print_Addr] == True: if self.opcrdkv[self.Manual_print_Addr] == self.opcwrkv[self.Manual_print_Addr]: self.opcwrstatkv[self.Manual_print_Addr] = False def set_Manual_printup(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Manual_printup_Addr] = value self.opcwrstatkv[self.Manual_printup_Addr] = True def get_Manual_printup(self): return self.opcrdkv[self.Manual_printup_Addr] def check_Manual_printup(self): if self.opcwrstatkv[self.Manual_printup_Addr] == True: if self.opcrdkv[self.Manual_printup_Addr] == self.opcwrkv[self.Manual_printup_Addr]: self.opcwrstatkv[self.Manual_printup_Addr] = False def set_Manual_printdown(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Manual_printdown_Addr] = value self.opcwrstatkv[self.Manual_printdown_Addr] = True def get_Manual_printdown(self): return self.opcrdkv[self.Manual_printdown_Addr] def check_Manual_printdown(self): if self.opcwrstatkv[self.Manual_printdown_Addr] == True: if self.opcrdkv[self.Manual_printdown_Addr] == self.opcwrkv[self.Manual_printdown_Addr]: self.opcwrstatkv[self.Manual_printdown_Addr] = False def set_Manual_printok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Manual_printok_Addr] = value self.opcwrstatkv[self.Manual_printok_Addr] = True def get_Manual_printok(self): return self.opcrdkv[self.Manual_printok_Addr] def check_Manual_printok(self): if self.opcwrstatkv[self.Manual_printok_Addr] == True: if self.opcrdkv[self.Manual_printok_Addr] == self.opcwrkv[self.Manual_printok_Addr]: self.opcwrstatkv[self.Manual_printok_Addr] = False def set_PLC_ok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.PLC_ok_Addr] = value self.opcwrstatkv[self.PLC_ok_Addr] = True def get_PLC_ok(self): return self.opcrdkv[self.PLC_ok_Addr] def check_PLC_ok(self): if self.opcwrstatkv[self.PLC_ok_Addr] == True: if self.opcrdkv[self.PLC_ok_Addr] == self.opcwrkv[self.PLC_ok_Addr]: self.opcwrstatkv[self.PLC_ok_Addr] = False def set_Airdata_stat(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Airdata_stat_Addr] = value self.opcwrstatkv[self.Airdata_stat_Addr] = True def get_Airdata_stat(self): return self.opcrdkv[self.Airdata_stat_Addr] def check_Airdata_stat(self): if self.opcwrstatkv[self.Airdata_stat_Addr] == True: if self.opcrdkv[self.Airdata_stat_Addr] == self.opcwrkv[self.Airdata_stat_Addr]: self.opcwrstatkv[self.Airdata_stat_Addr] = False def set_Auto_printok(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Auto_printok_Addr] = value self.opcwrstatkv[self.Auto_printok_Addr] = True def get_Auto_printok(self): return self.opcrdkv[self.Auto_printok_Addr] def check_Auto_printok(self): if self.opcwrstatkv[self.Auto_printok_Addr] == True: if self.opcrdkv[self.Auto_printok_Addr] == self.opcwrkv[self.Auto_printok_Addr]: self.opcwrstatkv[self.Auto_printok_Addr] = False def set_Print_start(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Print_start_Addr] = value self.opcwrstatkv[self.Print_start_Addr] = True def get_Print_start(self): return self.opcrdkv[self.Print_start_Addr] def check_Print_start(self): if self.opcwrstatkv[self.Print_start_Addr] == True: if self.opcrdkv[self.Print_start_Addr] == self.opcwrkv[self.Print_start_Addr]: self.opcwrstatkv[self.Print_start_Addr] = False def set_Start_work(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Start_work_Addr] = value self.opcwrstatkv[self.Start_work_Addr] = True def get_Start_work(self): return self.opcrdkv[self.Start_work_Addr] def check_Start_work(self): if self.opcwrstatkv[self.Start_work_Addr] == True: if self.opcrdkv[self.Start_work_Addr] == self.opcwrkv[self.Start_work_Addr]: self.opcwrstatkv[self.Start_work_Addr] = False def set_Airtest_ok_r(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Airtest_ok_r_Addr] = value self.opcwrstatkv[self.Airtest_ok_r_Addr] = True def get_Airtest_ok_r(self): return self.opcrdkv[self.Airtest_ok_r_Addr] def check_Airtest_ok_r(self): if self.opcwrstatkv[self.Airtest_ok_r_Addr] == True: if self.opcrdkv[self.Airtest_ok_r_Addr] == self.opcwrkv[self.Airtest_ok_r_Addr]: self.opcwrstatkv[self.Airtest_ok_r_Addr] = False def set_Airtest_ok_w(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Airtest_ok_w_Addr] = value self.opcwrstatkv[self.Airtest_ok_w_Addr] = True def get_Airtest_ok_w(self): return self.opcrdkv[self.Airtest_ok_w_Addr] def check_Airtest_ok_w(self): if self.opcwrstatkv[self.Airtest_ok_w_Addr] == True: if self.opcrdkv[self.Airtest_ok_w_Addr] == self.opcwrkv[self.Airtest_ok_w_Addr]: self.opcwrstatkv[self.Airtest_ok_w_Addr] = False def set_Airtest_ng_r(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Airtest_ng_r_Addr] = value self.opcwrstatkv[self.Airtest_ng_r_Addr] = True def get_Airtest_ng_r(self): return self.opcrdkv[self.Airtest_ng_r_Addr] def check_Airtest_ng_r(self): if self.opcwrstatkv[self.Airtest_ng_r_Addr] == True: if self.opcrdkv[self.Airtest_ng_r_Addr] == self.opcwrkv[self.Airtest_ng_r_Addr]: self.opcwrstatkv[self.Airtest_ng_r_Addr] = False def set_Airtest_ng_w(self, value): while (self.lock == True): time.sleep(0.01) self.opcwrkv[self.Airtest_ng_w_Addr] = value self.opcwrstatkv[self.Airtest_ng_w_Addr] = True def get_Airtest_ng_w(self): return self.opcrdkv[self.Airtest_ng_w_Addr] def check_Airtest_ng_w(self): if self.opcwrstatkv[self.Airtest_ng_w_Addr] == True: if self.opcrdkv[self.Airtest_ng_w_Addr] == self.opcwrkv[self.Airtest_ng_w_Addr]: self.opcwrstatkv[self.Airtest_ng_w_Addr] = False