var.py 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. from tkinter import *
  2. import datetime
  3. import time
  4. import sql
  5. class Var_value(Frame):
  6. def __init__(self, init_window):
  7. self.init_window = init_window
  8. self.windows_idx = 'app'
  9. self.last_windows_idx = 'app'
  10. self.screen_width = 1024
  11. self.screen_height = 600
  12. self.sqlclient = sql.sqlclient
  13. self.pro_exit_stat = False
  14. self.order_ok_str = StringVar()
  15. self.order_ng_str = StringVar()
  16. self.order_targe_str = StringVar()
  17. self.order_snp_str = StringVar()
  18. self.order_year_str = StringVar()
  19. self.batch_str = StringVar()
  20. self.printf_num_str = StringVar()
  21. self.serial_num_str = StringVar()
  22. self.airtightness_17700_str = StringVar()
  23. self.airtightness_17720_str = StringVar()
  24. self.startdelay_17700_str = StringVar()
  25. self.airtime_17700_str = StringVar()
  26. self.presstime_17700_str = StringVar()
  27. self.testtime_17700_str = StringVar()
  28. self.exhaust_17700_str = StringVar()
  29. self.maxpress_17700_str = StringVar()
  30. self.minpress_17700_str = StringVar()
  31. self.setpress_17700_str = StringVar()
  32. self.capacity_17700_str = StringVar()
  33. self.posthreshold_17700_str =StringVar()
  34. self.pnegthreshold_17700_str = StringVar()
  35. self.startdelay_17720_str = StringVar()
  36. self.airtime_17720_str = StringVar()
  37. self.presstime_17720_str = StringVar()
  38. self.testtime_17720_str = StringVar()
  39. self.exhaust_17720_str = StringVar()
  40. self.maxpress_17720_str = StringVar()
  41. self.minpress_17720_str = StringVar()
  42. self.setpress_17720_str = StringVar()
  43. self.capacity_17720_str = StringVar()
  44. self.posthreshold_17720_str = StringVar()
  45. self.pnegthreshold_17720_str = StringVar()
  46. # self.team_list = ['A组', 'B组', 'C组', 'D组']
  47. self.team_list = ['A组', 'B组']
  48. self.team_sel = 0
  49. self.team = chr(self.team_sel + ord('A'))
  50. self.team_value = self.team_list[self.team_sel]
  51. self.product_load = True
  52. self.product_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', '']
  53. self.product_17700_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', '']
  54. self.product_17720_list = ['', '', '', '', '', '', '', '', '', '', '', '', '', '']
  55. self.product_idx = 0
  56. self.product_list_str = [StringVar()]*14
  57. for i in range(14):
  58. temp = StringVar()
  59. temp.set(self.product_list[i])
  60. self.product_list_str[i] = temp
  61. self.opc_product_idx = 0
  62. self.opc_product_name = ''
  63. self.product_idx_str = StringVar()
  64. self.product_str = StringVar()
  65. self.product_idx_str.set(self.product_idx+1)
  66. self.product_name = self.product_list[self.product_idx]
  67. self.product_str.set(self.product_name)
  68. self.workstatstr = False
  69. self.bee_stat = False
  70. self.auth_stat = False
  71. self.auth_timeout = 300
  72. self.originchkok_stat = False
  73. self.upairtightok_stat = False
  74. self.upairtightng_stat = False
  75. self.upprintok_stat = False
  76. self.origindir_stat = False
  77. self.downairtightok_stat = False
  78. self.downairtightng_stat = False
  79. self.downprintok_stat = False
  80. self.motororiginok_stat = False
  81. self.motoronup_stat = False
  82. self.motorondown_stat = False
  83. self.motorunuse_stat = False
  84. self.upgages_stat = False
  85. self.upworks_stat = False
  86. self.upmpen_stat = False
  87. self.upconnect_stat = False
  88. self.downgages_stat = False
  89. self.downworks_stat = False
  90. self.downmpen_stat = False
  91. self.downconnect_stat = False
  92. self.batch_y = 'L'
  93. self.batch_m = '1'
  94. self.batch_d = '01'
  95. self.batch = self.batch_y+self.batch_m+self.batch_d
  96. self.batch_str.set(self.batch)
  97. self.order_ok_str.set("0")
  98. self.order_ng_str.set("0")
  99. self.order_targe_str.set("0")
  100. self.order_snp_str.set("----")
  101. self.order_year_str.set(self.batch_y)
  102. self.order_ok = 0
  103. self.order_ng = 0
  104. self.order_targe = 0
  105. self.order_sng = 0
  106. self.order_update_stat = False
  107. # 批号
  108. self.number_type = '2GN'
  109. self.number_count = 1
  110. self.number_value = '{0}{1}{2}{3}{4:04d}{5}'.format(self.number_type,
  111. self.batch_y, self.batch_m,
  112. self.batch_d,
  113. self.number_count,
  114. chr(self.team_sel + ord('A')))
  115. self.printf_num_str.set(self.number_value)
  116. self.serial_num = 1
  117. self.serial_num_value = '{0:04d}{1:02d}{2:02d}{3:05d}'.format(datetime.datetime.now().year,
  118. datetime.datetime.now().month,
  119. datetime.datetime.now().day,
  120. self.serial_num)
  121. self.serial_num_str.set(self.serial_num_value)
  122. self.serial_num_working = ''
  123. self.product_ok = False
  124. # '<01>:0.215 MPa:(OK):0.171 ml/min'
  125. self.airtightness_17700 = ''
  126. # '<01>:0.51 MPa:(TD):0.504 ml/min'
  127. self.airtightness_17720 = ''
  128. self.airtightness_17700_str.set(self.airtightness_17700)
  129. self.airtightness_17720_str.set(self.airtightness_17720)
  130. self.product_17700_name = ''
  131. self.product_17720_name = ''
  132. self.product_name_noset = '品番读取中'
  133. self.inquire_begin_data = datetime.datetime.now().strftime('%Y-%m-%d')
  134. self.inquire_end_data = datetime.datetime.now().strftime('%Y-%m-%d')
  135. self.opc_conn_stat = "OPC服务器未连接"
  136. self.socket_conn_stat = False
  137. self.airdata_work_stat = 'finish'
  138. self.order_count = 1
  139. self.order_num = '{0}{1}{2}{3:02d}'.format(self.number_type, datetime.datetime.now().strftime('%Y%m%d%H%M%S'),
  140. chr(self.team_sel + ord('A')), self.order_count)
  141. # 查询
  142. self.data_columns = (
  143. "date", "time", "serial", "batch", "testok", "data", "team", "product_name", "startup", "air", "press",
  144. "test", "exhaust", "maxpress", "minpress", "setpress",
  145. "capacity", "posthreshold", "pnegthreshold")
  146. self.data_headers = (
  147. "日期", "时间", "序号", "标签号", "测试结果", "气密数据", "班组", "品番", "启动延时", "充气时间",
  148. "保压时间", "测试时间", "排气时间", "最大压力", "最小压力", "设定压力", "容积", "正阈值", "负阈值")
  149. self.param_columns = ("product_idx", "product_name", "param_type", "startup", "air", "press",
  150. "test", "exhaust", "maxpress", "minpress", "setpress",
  151. "capacity", "posthreshold", "pnegthreshold")
  152. self.param_headers = ("产品编号", "品番", "启动延时", "充气时间",
  153. "保压时间", "测试时间", "排气时间", "最大压力", "最小压力", "设定压力", "容积", "正阈值", "负阈值")
  154. self.product_data = []
  155. self.listview_content = "NULL"
  156. self.listview_stat = False
  157. self.listview_lock = False
  158. self.file_name = ''
  159. self.file_save_stat = True
  160. class opc_var:
  161. def __init__(self):
  162. self.lock = False
  163. self.opcrdkv = {}
  164. self.opcwrkv = {}
  165. self.opcwrstatkv = {}
  166. # OPC组
  167. self.stationtype = 'G01_0350'
  168. self.stationdev = 'DevCJ2W'
  169. self.stationgroup = "{0}.{1}".format(self.stationtype, self.stationdev)
  170. # 蜂鸣器控制
  171. self.Bee_Addr = '{0}.{1}.Bee'.format(self.stationtype, self.stationdev)
  172. self.opcaddrlist = [self.Bee_Addr]
  173. self.opcrdkv[self.Bee_Addr] = True
  174. self.opcwrkv[self.Bee_Addr] = True
  175. self.opcwrstatkv[self.Bee_Addr] = False
  176. # 产品编号
  177. self.Product_idx_Addr = '{0}.{1}.Product_idx'.format(self.stationtype, self.stationdev)
  178. self.opcaddrlist.append(self.Product_idx_Addr)
  179. self.opcrdkv[self.Product_idx_Addr] = 0
  180. self.opcwrkv[self.Product_idx_Addr] = 0
  181. self.opcwrstatkv[self.Product_idx_Addr] = False
  182. # 品番名
  183. self.Product_name_Addr = '{0}.{1}.Product_name'.format(self.stationtype, self.stationdev)
  184. self.opcaddrlist.append(self.Product_name_Addr)
  185. self.opcrdkv[self.Product_name_Addr] = ''
  186. self.opcwrkv[self.Product_name_Addr] = ''
  187. self.opcwrstatkv[self.Product_name_Addr] = False
  188. # 批号前缀
  189. self.Number_type_Addr = '{0}.{1}.Dev_num'.format(self.stationtype, self.stationdev)
  190. self.opcaddrlist.append(self.Number_type_Addr)
  191. self.opcrdkv[self.Number_type_Addr] = ''
  192. self.opcwrkv[self.Number_type_Addr] = ''
  193. self.opcwrstatkv[self.Number_type_Addr] = False
  194. # 年批号 ASCII A-Z
  195. self.Batch_y_Addr = '{0}.{1}.Batch_y'.format(self.stationtype, self.stationdev)
  196. self.opcaddrlist.append(self.Batch_y_Addr)
  197. self.opcrdkv[self.Batch_y_Addr] = 65
  198. self.opcwrkv[self.Batch_y_Addr] = 65
  199. self.opcwrstatkv[self.Batch_y_Addr] = False
  200. # 月批号 ASCII A-Z
  201. self.Batch_m_Addr = '{0}.{1}.Batch_m'.format(self.stationtype, self.stationdev)
  202. self.opcaddrlist.append(self.Batch_m_Addr)
  203. self.opcrdkv[self.Batch_m_Addr] = 65
  204. self.opcwrkv[self.Batch_m_Addr] = 65
  205. self.opcwrstatkv[self.Batch_m_Addr] = False
  206. # 日批号
  207. self.Batch_d_Addr = '{0}.{1}.Batch_d'.format(self.stationtype, self.stationdev)
  208. self.opcaddrlist.append(self.Batch_d_Addr)
  209. self.opcrdkv[self.Batch_d_Addr] = 1
  210. self.opcwrkv[self.Batch_d_Addr] = 1
  211. self.opcwrstatkv[self.Batch_d_Addr] = False
  212. # 气密数据17700
  213. self.Air_data_17720_Addr = '{0}.{1}.Air_data_17720'.format(self.stationtype, self.stationdev)
  214. self.opcaddrlist.append(self.Air_data_17720_Addr)
  215. self.opcrdkv[self.Air_data_17720_Addr] = ''
  216. self.opcwrkv[self.Air_data_17720_Addr] = ''
  217. self.opcwrstatkv[self.Air_data_17720_Addr] = False
  218. # 气密数据17720
  219. self.Air_data_17700_Addr = '{0}.{1}.Air_data_17700'.format(self.stationtype, self.stationdev)
  220. self.opcaddrlist.append(self.Air_data_17700_Addr)
  221. self.opcrdkv[self.Air_data_17700_Addr] = ''
  222. self.opcwrkv[self.Air_data_17700_Addr] = ''
  223. self.opcwrstatkv[self.Air_data_17700_Addr] = False
  224. # OK数
  225. self.Ok_count_Addr = '{0}.{1}.Ok_count'.format(self.stationtype, self.stationdev)
  226. self.opcaddrlist.append(self.Ok_count_Addr)
  227. self.opcrdkv[self.Ok_count_Addr] = 0
  228. self.opcwrkv[self.Ok_count_Addr] = 0
  229. self.opcwrstatkv[self.Ok_count_Addr] = False
  230. # NG数
  231. self.Ng_count_Addr = '{0}.{1}.Ng_count'.format(self.stationtype, self.stationdev)
  232. self.opcaddrlist.append(self.Ng_count_Addr)
  233. self.opcrdkv[self.Ng_count_Addr] = 0
  234. self.opcwrkv[self.Ng_count_Addr] = 0
  235. self.opcwrstatkv[self.Ng_count_Addr] = False
  236. # Targe数
  237. self.Targe_count_Addr = '{0}.{1}.Targe_count'.format(self.stationtype, self.stationdev)
  238. self.opcaddrlist.append(self.Targe_count_Addr)
  239. self.opcrdkv[self.Targe_count_Addr] = 0
  240. self.opcwrkv[self.Targe_count_Addr] = 0
  241. self.opcwrstatkv[self.Targe_count_Addr] = False
  242. # SNP
  243. self.SNP_count_Addr = '{0}.{1}.SNP_count'.format(self.stationtype, self.stationdev)
  244. self.opcaddrlist.append(self.SNP_count_Addr)
  245. self.opcrdkv[self.SNP_count_Addr] = 0
  246. self.opcwrkv[self.SNP_count_Addr] = 0
  247. self.opcwrstatkv[self.SNP_count_Addr] = False
  248. # 点检OK
  249. self.Origin_ok_Addr = '{0}.{1}.Origin_ok'.format(self.stationtype, self.stationdev)
  250. self.opcaddrlist.append(self.Origin_ok_Addr)
  251. self.opcrdkv[self.Origin_ok_Addr] = 0
  252. self.opcwrkv[self.Origin_ok_Addr] = 0
  253. self.opcwrstatkv[self.Origin_ok_Addr] = False
  254. # 原点指示
  255. self.Origin_dir_Addr = '{0}.{1}.Origin_dir'.format(self.stationtype, self.stationdev)
  256. self.opcaddrlist.append(self.Origin_dir_Addr)
  257. self.opcrdkv[self.Origin_dir_Addr] = 0
  258. self.opcwrkv[self.Origin_dir_Addr] = 0
  259. self.opcwrstatkv[self.Origin_dir_Addr] = False
  260. # 上气密OK
  261. self.Upairtight_ok_Addr = '{0}.{1}.Upairtight_ok'.format(self.stationtype, self.stationdev)
  262. self.opcaddrlist.append(self.Upairtight_ok_Addr)
  263. self.opcrdkv[self.Upairtight_ok_Addr] = False
  264. self.opcwrkv[self.Upairtight_ok_Addr] = False
  265. self.opcwrstatkv[self.Upairtight_ok_Addr] = False
  266. # 上气密OK
  267. self.Upairtight_ng_Addr = '{0}.{1}.Upairtight_ng'.format(self.stationtype, self.stationdev)
  268. self.opcaddrlist.append(self.Upairtight_ng_Addr)
  269. self.opcrdkv[self.Upairtight_ng_Addr] = False
  270. self.opcwrkv[self.Upairtight_ng_Addr] = False
  271. self.opcwrstatkv[self.Upairtight_ng_Addr] = False
  272. # 下气密OK
  273. self.Downairtight_ok_Addr = '{0}.{1}.Downairtight_ok'.format(self.stationtype, self.stationdev)
  274. self.opcaddrlist.append(self.Downairtight_ok_Addr)
  275. self.opcrdkv[self.Downairtight_ok_Addr] = False
  276. self.opcwrkv[self.Downairtight_ok_Addr] = False
  277. self.opcwrstatkv[self.Downairtight_ok_Addr] = False
  278. # 下气密OK
  279. self.Downairtight_ng_Addr = '{0}.{1}.Downairtight_ng'.format(self.stationtype, self.stationdev)
  280. self.opcaddrlist.append(self.Downairtight_ng_Addr)
  281. self.opcrdkv[self.Downairtight_ng_Addr] = False
  282. self.opcwrkv[self.Downairtight_ng_Addr] = False
  283. self.opcwrstatkv[self.Downairtight_ng_Addr] = False
  284. # 上刻印完成
  285. self.Upprint_ok_Addr = '{0}.{1}.Upprint_ok'.format(self.stationtype, self.stationdev)
  286. self.opcaddrlist.append(self.Upprint_ok_Addr)
  287. self.opcrdkv[self.Upprint_ok_Addr] = False
  288. self.opcwrkv[self.Upprint_ok_Addr] = False
  289. self.opcwrstatkv[self.Upprint_ok_Addr] = False
  290. # 下刻印完成
  291. self.Downprint_ok_Addr = '{0}.{1}.Downprint_ok'.format(self.stationtype, self.stationdev)
  292. self.opcaddrlist.append(self.Downprint_ok_Addr)
  293. self.opcrdkv[self.Downprint_ok_Addr] = False
  294. self.opcwrkv[self.Downprint_ok_Addr] = False
  295. self.opcwrstatkv[self.Downprint_ok_Addr] = False
  296. # 上gage-s
  297. self.Upgage_s_Addr = '{0}.{1}.Upgage_s'.format(self.stationtype, self.stationdev)
  298. self.opcaddrlist.append(self.Upgage_s_Addr)
  299. self.opcrdkv[self.Upgage_s_Addr] = False
  300. self.opcwrkv[self.Upgage_s_Addr] = False
  301. self.opcwrstatkv[self.Upgage_s_Addr] = False
  302. # 下gage-s
  303. self.Downgage_s_Addr = '{0}.{1}.Downgage_s'.format(self.stationtype, self.stationdev)
  304. self.opcaddrlist.append(self.Downgage_s_Addr)
  305. self.opcrdkv[self.Downgage_s_Addr] = False
  306. self.opcwrkv[self.Downgage_s_Addr] = False
  307. self.opcwrstatkv[self.Downgage_s_Addr] = False
  308. # 上work-s
  309. self.Upwork_s_Addr = '{0}.{1}.Upwork_s'.format(self.stationtype, self.stationdev)
  310. self.opcaddrlist.append(self.Upwork_s_Addr)
  311. self.opcrdkv[self.Upwork_s_Addr] = False
  312. self.opcwrkv[self.Upwork_s_Addr] = False
  313. self.opcwrstatkv[self.Upwork_s_Addr] = False
  314. # 下work-s
  315. self.Downwork_s_Addr = '{0}.{1}.Downwork_s'.format(self.stationtype, self.stationdev)
  316. self.opcaddrlist.append(self.Downwork_s_Addr)
  317. self.opcrdkv[self.Downwork_s_Addr] = False
  318. self.opcwrkv[self.Downwork_s_Addr] = False
  319. self.opcwrstatkv[self.Downwork_s_Addr] = False
  320. # 上m-pen
  321. self.Upm_pen_Addr = '{0}.{1}.Upm_pen'.format(self.stationtype, self.stationdev)
  322. self.opcaddrlist.append(self.Upm_pen_Addr)
  323. self.opcrdkv[self.Upm_pen_Addr] = False
  324. self.opcwrkv[self.Upm_pen_Addr] = False
  325. self.opcwrstatkv[self.Upm_pen_Addr] = False
  326. # 下m-pen
  327. self.Downm_pen_Addr = '{0}.{1}.Downm_pen'.format(self.stationtype, self.stationdev)
  328. self.opcaddrlist.append(self.Downm_pen_Addr)
  329. self.opcrdkv[self.Downm_pen_Addr] = False
  330. self.opcwrkv[self.Downm_pen_Addr] = False
  331. self.opcwrstatkv[self.Downm_pen_Addr] = False
  332. # 上connet
  333. self.Upconnect_Addr = '{0}.{1}.Upconnect'.format(self.stationtype, self.stationdev)
  334. self.opcaddrlist.append(self.Upconnect_Addr)
  335. self.opcrdkv[self.Upconnect_Addr] = False
  336. self.opcwrkv[self.Upconnect_Addr] = False
  337. self.opcwrstatkv[self.Upconnect_Addr] = False
  338. # 下connet
  339. self.Downconnect_Addr = '{0}.{1}.Downconnect'.format(self.stationtype, self.stationdev)
  340. self.opcaddrlist.append(self.Downconnect_Addr)
  341. self.opcrdkv[self.Downconnect_Addr] = False
  342. self.opcwrkv[self.Downconnect_Addr] = False
  343. self.opcwrstatkv[self.Downconnect_Addr] = False
  344. # 电机原点正确
  345. self.Motororgin_ok_Addr = '{0}.{1}.Motororgin_ok'.format(self.stationtype, self.stationdev)
  346. self.opcaddrlist.append(self.Motororgin_ok_Addr)
  347. self.opcrdkv[self.Motororgin_ok_Addr] = False
  348. self.opcwrkv[self.Motororgin_ok_Addr] = False
  349. self.opcwrstatkv[self.Motororgin_ok_Addr] = False
  350. # 电机位于上工位
  351. self.Motor_onup_Addr = '{0}.{1}.Motor_onup'.format(self.stationtype, self.stationdev)
  352. self.opcaddrlist.append(self.Motor_onup_Addr)
  353. self.opcrdkv[self.Motor_onup_Addr] = False
  354. self.opcwrkv[self.Motor_onup_Addr] = False
  355. self.opcwrstatkv[self.Motor_onup_Addr] = False
  356. # 电机位于下工位
  357. self.Motor_ondown_Addr = '{0}.{1}.Motor_ondown'.format(self.stationtype, self.stationdev)
  358. self.opcaddrlist.append(self.Motor_ondown_Addr)
  359. self.opcrdkv[self.Motor_ondown_Addr] = False
  360. self.opcwrkv[self.Motor_ondown_Addr] = False
  361. self.opcwrstatkv[self.Motor_ondown_Addr] = False
  362. # 手动刻印
  363. self.Manual_print_Addr = '{0}.{1}.Manual_print'.format(self.stationtype, self.stationdev)
  364. self.opcaddrlist.append(self.Manual_print_Addr)
  365. self.opcrdkv[self.Manual_print_Addr] = False
  366. self.opcwrkv[self.Manual_print_Addr] = False
  367. self.opcwrstatkv[self.Manual_print_Addr] = False
  368. # 手动刻印上工位
  369. self.Manual_printup_Addr = '{0}.{1}.Manual_printup'.format(self.stationtype, self.stationdev)
  370. self.opcaddrlist.append(self.Manual_printup_Addr)
  371. self.opcrdkv[self.Manual_printup_Addr] = False
  372. self.opcwrkv[self.Manual_printup_Addr] = False
  373. self.opcwrstatkv[self.Manual_printup_Addr] = False
  374. # 手动刻印上工位
  375. self.Manual_printdown_Addr = '{0}.{1}.Manual_printdown'.format(self.stationtype, self.stationdev)
  376. self.opcaddrlist.append(self.Manual_printdown_Addr)
  377. self.opcrdkv[self.Manual_printdown_Addr] = False
  378. self.opcwrkv[self.Manual_printdown_Addr] = False
  379. self.opcwrstatkv[self.Manual_printdown_Addr] = False
  380. # 手动刻印OK
  381. self.Manual_printok_Addr = '{0}.{1}.Manual_printok'.format(self.stationtype, self.stationdev)
  382. self.opcaddrlist.append(self.Manual_printok_Addr)
  383. self.opcrdkv[self.Manual_printok_Addr] = False
  384. self.opcwrkv[self.Manual_printok_Addr] = False
  385. self.opcwrstatkv[self.Manual_printok_Addr] = False
  386. # PLC通讯状态
  387. self.PLC_ok_Addr = '{0}.{1}.PLC_ok'.format(self.stationtype, self.stationdev)
  388. self.opcaddrlist.append(self.PLC_ok_Addr)
  389. self.opcrdkv[self.PLC_ok_Addr] = False
  390. self.opcwrkv[self.PLC_ok_Addr] = False
  391. self.opcwrstatkv[self.PLC_ok_Addr] = False
  392. # 气密数据保存状态
  393. self.Airdata_stat_Addr = '{0}.{1}.Airdata_stat'.format(self.stationtype, self.stationdev)
  394. self.opcaddrlist.append(self.Airdata_stat_Addr)
  395. self.opcrdkv[self.Airdata_stat_Addr] = 0
  396. self.opcwrkv[self.Airdata_stat_Addr] = 0
  397. self.opcwrstatkv[self.Airdata_stat_Addr] = False
  398. # 自动刻印完成
  399. self.Auto_printok_Addr = '{0}.{1}.Auto_printok'.format(self.stationtype, self.stationdev)
  400. self.opcaddrlist.append(self.Auto_printok_Addr)
  401. self.opcrdkv[self.Auto_printok_Addr] = False
  402. self.opcwrkv[self.Auto_printok_Addr] = False
  403. self.opcwrstatkv[self.Auto_printok_Addr] = False
  404. # 打印开始信号
  405. self.Print_start_Addr = '{0}.{1}.Print_start'.format(self.stationtype, self.stationdev)
  406. self.opcaddrlist.append(self.Print_start_Addr)
  407. self.opcrdkv[self.Print_start_Addr] = False
  408. self.opcwrkv[self.Print_start_Addr] = False
  409. self.opcwrstatkv[self.Print_start_Addr] = False
  410. # 开始工作信号
  411. self.Start_work_Addr = '{0}.{1}.Start_work'.format(self.stationtype, self.stationdev)
  412. self.opcaddrlist.append(self.Start_work_Addr)
  413. self.opcrdkv[self.Start_work_Addr] = False
  414. self.opcwrkv[self.Start_work_Addr] = False
  415. self.opcwrstatkv[self.Start_work_Addr] = False
  416. # 测试值ok_r
  417. self.Airtest_ok_r_Addr = '{0}.{1}.Airtest_ok_r'.format(self.stationtype, self.stationdev)
  418. self.opcaddrlist.append(self.Airtest_ok_r_Addr)
  419. self.opcrdkv[self.Airtest_ok_r_Addr] = False
  420. self.opcwrkv[self.Airtest_ok_r_Addr] = False
  421. self.opcwrstatkv[self.Airtest_ok_r_Addr] = False
  422. # 测试值ok_w
  423. self.Airtest_ok_w_Addr = '{0}.{1}.Airtest_ok_w'.format(self.stationtype, self.stationdev)
  424. self.opcaddrlist.append(self.Airtest_ok_w_Addr)
  425. self.opcrdkv[self.Airtest_ok_w_Addr] = False
  426. self.opcwrkv[self.Airtest_ok_w_Addr] = False
  427. self.opcwrstatkv[self.Airtest_ok_w_Addr] = False
  428. # 测试值ng_r
  429. self.Airtest_ng_r_Addr = '{0}.{1}.Airtest_ng_r'.format(self.stationtype, self.stationdev)
  430. self.opcaddrlist.append(self.Airtest_ng_r_Addr)
  431. self.opcrdkv[self.Airtest_ng_r_Addr] = False
  432. self.opcwrkv[self.Airtest_ng_r_Addr] = False
  433. self.opcwrstatkv[self.Airtest_ng_r_Addr] = False
  434. # 测试值ng_w
  435. self.Airtest_ng_w_Addr = '{0}.{1}.Airtest_ng_w'.format(self.stationtype, self.stationdev)
  436. self.opcaddrlist.append(self.Airtest_ng_w_Addr)
  437. self.opcrdkv[self.Airtest_ng_w_Addr] = False
  438. self.opcwrkv[self.Airtest_ng_w_Addr] = False
  439. self.opcwrstatkv[self.Airtest_ng_w_Addr] = False
  440. def set_Bee(self, value):
  441. while(self.lock == True):
  442. time.sleep(0.01)
  443. self.opcwrkv[self.Bee_Addr] = value
  444. self.opcwrstatkv[self.Bee_Addr] = True
  445. def get_Bee(self):
  446. return self.opcrdkv[self.Bee_Addr]
  447. def check_Bee(self):
  448. if self.opcwrstatkv[self.Bee_Addr] == True:
  449. if self.opcrdkv[self.Bee_Addr] == self.opcwrkv[self.Bee_Addr]:
  450. self.opcwrstatkv[self.Bee_Addr] = False
  451. def set_Product_idx(self, value):
  452. while (self.lock == True):
  453. time.sleep(0.01)
  454. self.opcwrkv[self.Product_idx_Addr] = value
  455. self.opcwrstatkv[self.Product_idx_Addr] = True
  456. def get_Product_idx(self):
  457. return self.opcrdkv[self.Product_idx_Addr]
  458. def check_Product_idx(self):
  459. if self.opcwrstatkv[self.Product_idx_Addr] == True:
  460. if self.opcrdkv[self.Product_idx_Addr] == self.opcwrkv[self.Product_idx_Addr]:
  461. self.opcwrstatkv[self.Product_idx_Addr] = False
  462. def set_Number_type(self, value):
  463. while (self.lock == True):
  464. time.sleep(0.01)
  465. self.opcwrkv[self.Number_type_Addr] = value
  466. self.opcwrstatkv[self.Number_type_Addr] = True
  467. def get_Number_type(self):
  468. return self.opcrdkv[self.Number_type_Addr]
  469. def check_Number_type(self):
  470. if self.opcwrstatkv[self.Number_type_Addr] == True:
  471. if self.opcrdkv[self.Number_type_Addr] == self.opcwrkv[self.Number_type_Addr]:
  472. self.opcwrstatkv[self.Number_type_Addr] = False
  473. def set_Product_name(self, value):
  474. while (self.lock == True):
  475. time.sleep(0.01)
  476. self.opcwrkv[self.Product_name_Addr] = value
  477. self.opcwrstatkv[self.Product_name_Addr] = True
  478. def get_Product_name(self):
  479. return self.opcrdkv[self.Product_name_Addr]
  480. def check_Product_name(self):
  481. if self.opcwrstatkv[self.Product_name_Addr] == True:
  482. if self.opcrdkv[self.Product_name_Addr] == self.opcwrkv[self.Product_name_Addr]:
  483. self.opcwrstatkv[self.Product_name_Addr] = False
  484. def set_Batch_y(self, value):
  485. while (self.lock == True):
  486. time.sleep(0.01)
  487. self.opcwrkv[self.Batch_y_Addr] = value
  488. self.opcwrstatkv[self.Batch_y_Addr] = True
  489. def get_Batch_y(self):
  490. return self.opcrdkv[self.Batch_y_Addr]
  491. def check_Batch_y(self):
  492. if self.opcwrstatkv[self.Batch_y_Addr] == True:
  493. if self.opcrdkv[self.Batch_y_Addr] == self.opcwrkv[self.Batch_y_Addr]:
  494. self.opcwrstatkv[self.Batch_y_Addr] = False
  495. def set_Batch_m(self, value):
  496. while (self.lock == True):
  497. time.sleep(0.01)
  498. self.opcwrkv[self.Batch_m_Addr] = value
  499. self.opcwrstatkv[self.Batch_m_Addr] = True
  500. def get_Batch_m(self):
  501. return self.opcrdkv[self.Batch_m_Addr]
  502. def check_Batch_m(self):
  503. if self.opcwrstatkv[self.Batch_m_Addr] == True:
  504. if self.opcrdkv[self.Batch_m_Addr] == self.opcwrkv[self.Batch_m_Addr]:
  505. self.opcwrstatkv[self.Batch_m_Addr] = False
  506. def set_Batch_d(self, value):
  507. while (self.lock == True):
  508. time.sleep(0.01)
  509. self.opcwrkv[self.Batch_d_Addr] = value
  510. self.opcwrstatkv[self.Batch_d_Addr] = True
  511. def get_Batch_d(self):
  512. return self.opcrdkv[self.Batch_d_Addr]
  513. def check_Batch_d(self):
  514. if self.opcwrstatkv[self.Batch_d_Addr] == True:
  515. if self.opcrdkv[self.Batch_d_Addr] == self.opcwrkv[self.Batch_d_Addr]:
  516. self.opcwrstatkv[self.Batch_d_Addr] = False
  517. def set_Air_data_17700(self, value):
  518. while (self.lock == True):
  519. time.sleep(0.01)
  520. self.opcwrkv[self.Air_data_17700_Addr] = value
  521. self.opcwrstatkv[self.Air_data_17700_Addr] = True
  522. def get_Air_data_17700(self):
  523. return self.opcrdkv[self.Air_data_17700_Addr]
  524. def check_Air_data_17700(self):
  525. if self.opcwrstatkv[self.Air_data_17700_Addr] == True:
  526. if self.opcrdkv[self.Air_data_17700_Addr] == self.opcwrkv[self.Air_data_17700_Addr]:
  527. self.opcwrstatkv[self.Air_data_17700_Addr] = False
  528. def set_Air_data_17720(self, value):
  529. while (self.lock == True):
  530. time.sleep(0.01)
  531. self.opcwrkv[self.Air_data_17720_Addr] = value
  532. self.opcwrstatkv[self.Air_data_17720_Addr] = True
  533. def get_Air_data_17720(self):
  534. return self.opcrdkv[self.Air_data_17720_Addr]
  535. def check_Air_data_17720(self):
  536. if self.opcwrstatkv[self.Air_data_17720_Addr] == True:
  537. if self.opcrdkv[self.Air_data_17720_Addr] == self.opcwrkv[self.Air_data_17720_Addr]:
  538. self.opcwrstatkv[self.Air_data_17720_Addr] = False
  539. def set_Ok_count(self, value):
  540. while (self.lock == True):
  541. time.sleep(0.01)
  542. self.opcwrkv[self.Ok_count_Addr] = value
  543. self.opcwrstatkv[self.Ok_count_Addr] = True
  544. def get_Ok_count(self):
  545. return self.opcrdkv[self.Ok_count_Addr]
  546. def check_Ok_count(self):
  547. if self.opcwrstatkv[self.Ok_count_Addr] == True:
  548. if self.opcrdkv[self.Ok_count_Addr] == self.opcwrkv[self.Ok_count_Addr]:
  549. self.opcwrstatkv[self.Ok_count_Addr] = False
  550. def set_Ng_count(self, value):
  551. while (self.lock == True):
  552. time.sleep(0.01)
  553. self.opcwrkv[self.Ng_count_Addr] = value
  554. self.opcwrstatkv[self.Ng_count_Addr] = True
  555. def get_Ng_count(self):
  556. return self.opcrdkv[self.Ng_count_Addr]
  557. def check_Ng_count(self):
  558. if self.opcwrstatkv[self.Ng_count_Addr] == True:
  559. if self.opcrdkv[self.Ng_count_Addr] == self.opcwrkv[self.Ng_count_Addr]:
  560. self.opcwrstatkv[self.Ng_count_Addr] = False
  561. def set_Targe_count(self, value):
  562. while (self.lock == True):
  563. time.sleep(0.01)
  564. self.opcwrkv[self.Targe_count_Addr] = value
  565. self.opcwrstatkv[self.Targe_count_Addr] = True
  566. def get_Targe_count(self):
  567. return self.opcrdkv[self.Targe_count_Addr]
  568. def check_Targe_count(self):
  569. if self.opcwrstatkv[self.Targe_count_Addr] == True:
  570. if self.opcrdkv[self.Targe_count_Addr] == self.opcwrkv[self.Targe_count_Addr]:
  571. self.opcwrstatkv[self.Targe_count_Addr] = False
  572. def set_SNP_count(self, value):
  573. while (self.lock == True):
  574. time.sleep(0.01)
  575. self.opcwrkv[self.SNP_count_Addr] = value
  576. self.opcwrstatkv[self.SNP_count_Addr] = True
  577. def get_SNP_count(self):
  578. return self.opcrdkv[self.SNP_count_Addr]
  579. def check_SNP_count(self):
  580. if self.opcwrstatkv[self.SNP_count_Addr] == True:
  581. if self.opcrdkv[self.SNP_count_Addr] == self.opcwrkv[self.SNP_count_Addr]:
  582. self.opcwrstatkv[self.SNP_count_Addr] = False
  583. def set_Origin_ok(self, value):
  584. while (self.lock == True):
  585. time.sleep(0.01)
  586. self.opcwrkv[self.Origin_ok_Addr] = value
  587. self.opcwrstatkv[self.Origin_ok_Addr] = True
  588. def get_Origin_ok(self):
  589. return self.opcrdkv[self.Origin_ok_Addr]
  590. def check_Origin_ok(self):
  591. if self.opcwrstatkv[self.Origin_ok_Addr] == True:
  592. if self.opcrdkv[self.Origin_ok_Addr] == self.opcwrkv[self.Origin_ok_Addr]:
  593. self.opcwrstatkv[self.Origin_ok_Addr] = False
  594. def set_Origin_dir(self, value):
  595. while (self.lock == True):
  596. time.sleep(0.01)
  597. self.opcwrkv[self.Origin_dir_Addr] = value
  598. self.opcwrstatkv[self.Origin_dir_Addr] = True
  599. def get_Origin_dir(self):
  600. return self.opcrdkv[self.Origin_dir_Addr]
  601. def check_Origin_dir(self):
  602. if self.opcwrstatkv[self.Origin_dir_Addr] == True:
  603. if self.opcrdkv[self.Origin_dir_Addr] == self.opcwrkv[self.Origin_dir_Addr]:
  604. self.opcwrstatkv[self.Origin_dir_Addr] = False
  605. def set_Upairtight_ok(self, value):
  606. while (self.lock == True):
  607. time.sleep(0.01)
  608. self.opcwrkv[self.Upairtight_ok_Addr] = value
  609. self.opcwrstatkv[self.Upairtight_ok_Addr] = True
  610. def get_Upairtight_ok(self):
  611. return self.opcrdkv[self.Upairtight_ok_Addr]
  612. def check_Upairtight_ok(self):
  613. if self.opcwrstatkv[self.Upairtight_ok_Addr] == True:
  614. if self.opcrdkv[self.Upairtight_ok_Addr] == self.opcwrkv[self.Upairtight_ok_Addr]:
  615. self.opcwrstatkv[self.Upairtight_ok_Addr] = False
  616. def set_Upairtight_ng(self, value):
  617. while (self.lock == True):
  618. time.sleep(0.01)
  619. self.opcwrkv[self.Upairtight_ng_Addr] = value
  620. self.opcwrstatkv[self.Upairtight_ng_Addr] = True
  621. def get_Upairtight_ng(self):
  622. return self.opcrdkv[self.Upairtight_ng_Addr]
  623. def check_Upairtight_ng(self):
  624. if self.opcwrstatkv[self.Upairtight_ng_Addr] == True:
  625. if self.opcrdkv[self.Upairtight_ng_Addr] == self.opcwrkv[self.Upairtight_ng_Addr]:
  626. self.opcwrstatkv[self.Upairtight_ng_Addr] = False
  627. def set_Downairtight_ok(self, value):
  628. while (self.lock == True):
  629. time.sleep(0.01)
  630. self.opcwrkv[self.Downairtight_ok_Addr] = value
  631. self.opcwrstatkv[self.Downairtight_ok_Addr] = True
  632. def get_Downairtight_ok(self):
  633. return self.opcrdkv[self.Downairtight_ok_Addr]
  634. def check_Downairtight_ok(self):
  635. if self.opcwrstatkv[self.Downairtight_ok_Addr] == True:
  636. if self.opcrdkv[self.Downairtight_ok_Addr] == self.opcwrkv[self.Downairtight_ok_Addr]:
  637. self.opcwrstatkv[self.Downairtight_ok_Addr] = False
  638. def set_Downairtight_ng(self, value):
  639. while (self.lock == True):
  640. time.sleep(0.01)
  641. self.opcwrkv[self.Downairtight_ng_Addr] = value
  642. self.opcwrstatkv[self.Downairtight_ng_Addr] = True
  643. def get_Downairtight_ng(self):
  644. return self.opcrdkv[self.Downairtight_ng_Addr]
  645. def check_Downairtight_ng(self):
  646. if self.opcwrstatkv[self.Downairtight_ng_Addr] == True:
  647. if self.opcrdkv[self.Downairtight_ng_Addr] == self.opcwrkv[self.Downairtight_ng_Addr]:
  648. self.opcwrstatkv[self.Downairtight_ng_Addr] = False
  649. def set_Upprint_ok(self, value):
  650. while (self.lock == True):
  651. time.sleep(0.01)
  652. self.opcwrkv[self.Upprint_ok_Addr] = value
  653. self.opcwrstatkv[self.Upprint_ok_Addr] = True
  654. def get_Upprint_ok(self):
  655. return self.opcrdkv[self.Upprint_ok_Addr]
  656. def check_Upprint_ok(self):
  657. if self.opcwrstatkv[self.Upprint_ok_Addr] == True:
  658. if self.opcrdkv[self.Upprint_ok_Addr] == self.opcwrkv[self.Upprint_ok_Addr]:
  659. self.opcwrstatkv[self.Upprint_ok_Addr] = False
  660. def set_Downprint_ok(self, value):
  661. while (self.lock == True):
  662. time.sleep(0.01)
  663. self.opcwrkv[self.Downprint_ok_Addr] = value
  664. self.opcwrstatkv[self.Downprint_ok_Addr] = True
  665. def get_Downprint_ok(self):
  666. return self.opcrdkv[self.Downprint_ok_Addr]
  667. def check_Downprint_ok(self):
  668. if self.opcwrstatkv[self.Downprint_ok_Addr] == True:
  669. if self.opcrdkv[self.Downprint_ok_Addr] == self.opcwrkv[self.Downprint_ok_Addr]:
  670. self.opcwrstatkv[self.Downprint_ok_Addr] = False
  671. def set_Upgage_s(self, value):
  672. while (self.lock == True):
  673. time.sleep(0.01)
  674. self.opcwrkv[self.Upgage_s_Addr] = value
  675. self.opcwrstatkv[self.Upgage_s_Addr] = True
  676. def get_Upgage_s(self):
  677. return self.opcrdkv[self.Upgage_s_Addr]
  678. def check_Upgage_s(self):
  679. if self.opcwrstatkv[self.Upgage_s_Addr] == True:
  680. if self.opcrdkv[self.Upgage_s_Addr] == self.opcwrkv[self.Upgage_s_Addr]:
  681. self.opcwrstatkv[self.Upgage_s_Addr] = False
  682. def set_Downgage_s(self, value):
  683. while (self.lock == True):
  684. time.sleep(0.01)
  685. self.opcwrkv[self.Downgage_s_Addr] = value
  686. self.opcwrstatkv[self.Downgage_s_Addr] = True
  687. def get_Downgage_s(self):
  688. return self.opcrdkv[self.Downgage_s_Addr]
  689. def check_Downgage_s(self):
  690. if self.opcwrstatkv[self.Downgage_s_Addr] == True:
  691. if self.opcrdkv[self.Downgage_s_Addr] == self.opcwrkv[self.Downgage_s_Addr]:
  692. self.opcwrstatkv[self.Downgage_s_Addr] = False
  693. def set_Upwork_s(self, value):
  694. while (self.lock == True):
  695. time.sleep(0.01)
  696. self.opcwrkv[self.Upwork_s_Addr] = value
  697. self.opcwrstatkv[self.Upwork_s_Addr] = True
  698. def get_Upwork_s(self):
  699. return self.opcrdkv[self.Upwork_s_Addr]
  700. def check_Upwork_s(self):
  701. if self.opcwrstatkv[self.Upwork_s_Addr] == True:
  702. if self.opcrdkv[self.Upwork_s_Addr] == self.opcwrkv[self.Upwork_s_Addr]:
  703. self.opcwrstatkv[self.Upwork_s_Addr] = False
  704. def set_Downwork_s(self, value):
  705. while (self.lock == True):
  706. time.sleep(0.01)
  707. self.opcwrkv[self.Downwork_s_Addr] = value
  708. self.opcwrstatkv[self.Downwork_s_Addr] = True
  709. def get_Downwork_s(self):
  710. return self.opcrdkv[self.Downwork_s_Addr]
  711. def check_Downwork_s(self):
  712. if self.opcwrstatkv[self.Downwork_s_Addr] == True:
  713. if self.opcrdkv[self.Downwork_s_Addr] == self.opcwrkv[self.Downwork_s_Addr]:
  714. self.opcwrstatkv[self.Downwork_s_Addr] = False
  715. def set_Upm_pen(self, value):
  716. while (self.lock == True):
  717. time.sleep(0.01)
  718. self.opcwrkv[self.Upm_pen_Addr] = value
  719. self.opcwrstatkv[self.Upm_pen_Addr] = True
  720. def get_Upm_pen(self):
  721. return self.opcrdkv[self.Upm_pen_Addr]
  722. def check_Upm_pen(self):
  723. if self.opcwrstatkv[self.Upm_pen_Addr] == True:
  724. if self.opcrdkv[self.Upm_pen_Addr] == self.opcwrkv[self.Upm_pen_Addr]:
  725. self.opcwrstatkv[self.Upm_pen_Addr] = False
  726. def set_Downm_pen(self, value):
  727. while (self.lock == True):
  728. time.sleep(0.01)
  729. self.opcwrkv[self.Downm_pen_Addr] = value
  730. self.opcwrstatkv[self.Downm_pen_Addr] = True
  731. def get_Downm_pen(self):
  732. return self.opcrdkv[self.Downm_pen_Addr]
  733. def check_Downm_pen(self):
  734. if self.opcwrstatkv[self.Downm_pen_Addr] == True:
  735. if self.opcrdkv[self.Downm_pen_Addr] == self.opcwrkv[self.Downm_pen_Addr]:
  736. self.opcwrstatkv[self.Downm_pen_Addr] = False
  737. def set_Upconnect(self, value):
  738. while (self.lock == True):
  739. time.sleep(0.01)
  740. self.opcwrkv[self.Upconnect_Addr] = value
  741. self.opcwrstatkv[self.Upconnect_Addr] = True
  742. def get_Upconnect(self):
  743. return self.opcrdkv[self.Upconnect_Addr]
  744. def check_Upconnect(self):
  745. if self.opcwrstatkv[self.Upconnect_Addr] == True:
  746. if self.opcrdkv[self.Upconnect_Addr] == self.opcwrkv[self.Upconnect_Addr]:
  747. self.opcwrstatkv[self.Upconnect_Addr] = False
  748. def set_Downconnect(self, value):
  749. while (self.lock == True):
  750. time.sleep(0.01)
  751. self.opcwrkv[self.Downconnect_Addr] = value
  752. self.opcwrstatkv[self.Downconnect_Addr] = True
  753. def get_Downconnect(self):
  754. return self.opcrdkv[self.Downconnect_Addr]
  755. def check_Downconnect(self):
  756. if self.opcwrstatkv[self.Downconnect_Addr] == True:
  757. if self.opcrdkv[self.Downconnect_Addr] == self.opcwrkv[self.Downconnect_Addr]:
  758. self.opcwrstatkv[self.Downconnect_Addr] = False
  759. def set_Motororgin_ok(self, value):
  760. while (self.lock == True):
  761. time.sleep(0.01)
  762. self.opcwrkv[self.Motororgin_ok_Addr] = value
  763. self.opcwrstatkv[self.Motororgin_ok_Addr] = True
  764. def get_Motororgin_ok(self):
  765. return self.opcrdkv[self.Motororgin_ok_Addr]
  766. def check_Motororgin_ok(self):
  767. if self.opcwrstatkv[self.Motororgin_ok_Addr] == True:
  768. if self.opcrdkv[self.Motororgin_ok_Addr] == self.opcwrkv[self.Motororgin_ok_Addr]:
  769. self.opcwrstatkv[self.Motororgin_ok_Addr] = False
  770. def set_Motor_onup(self, value):
  771. while (self.lock == True):
  772. time.sleep(0.01)
  773. self.opcwrkv[self.Motor_onup_Addr] = value
  774. self.opcwrstatkv[self.Motor_onup_Addr] = True
  775. def get_Motor_onup(self):
  776. return self.opcrdkv[self.Motor_onup_Addr]
  777. def check_Motor_onup(self):
  778. if self.opcwrstatkv[self.Motor_onup_Addr] == True:
  779. if self.opcrdkv[self.Motor_onup_Addr] == self.opcwrkv[self.Motor_onup_Addr]:
  780. self.opcwrstatkv[self.Motor_onup_Addr] = False
  781. def set_Motor_ondown(self, value):
  782. while (self.lock == True):
  783. time.sleep(0.01)
  784. self.opcwrkv[self.Motor_ondown_Addr] = value
  785. self.opcwrstatkv[self.Motor_ondown_Addr] = True
  786. def get_Motor_ondown(self):
  787. return self.opcrdkv[self.Motor_ondown_Addr]
  788. def check_Motor_ondown(self):
  789. if self.opcwrstatkv[self.Motor_ondown_Addr] == True:
  790. if self.opcrdkv[self.Motor_ondown_Addr] == self.opcwrkv[self.Motor_ondown_Addr]:
  791. self.opcwrstatkv[self.Motor_ondown_Addr] = False
  792. def set_Manual_print(self, value):
  793. while (self.lock == True):
  794. time.sleep(0.01)
  795. self.opcwrkv[self.Manual_print_Addr] = value
  796. self.opcwrstatkv[self.Manual_print_Addr] = True
  797. def get_Manual_print(self):
  798. return self.opcrdkv[self.Manual_print_Addr]
  799. def check_Manual_print(self):
  800. if self.opcwrstatkv[self.Manual_print_Addr] == True:
  801. if self.opcrdkv[self.Manual_print_Addr] == self.opcwrkv[self.Manual_print_Addr]:
  802. self.opcwrstatkv[self.Manual_print_Addr] = False
  803. def set_Manual_printup(self, value):
  804. while (self.lock == True):
  805. time.sleep(0.01)
  806. self.opcwrkv[self.Manual_printup_Addr] = value
  807. self.opcwrstatkv[self.Manual_printup_Addr] = True
  808. def get_Manual_printup(self):
  809. return self.opcrdkv[self.Manual_printup_Addr]
  810. def check_Manual_printup(self):
  811. if self.opcwrstatkv[self.Manual_printup_Addr] == True:
  812. if self.opcrdkv[self.Manual_printup_Addr] == self.opcwrkv[self.Manual_printup_Addr]:
  813. self.opcwrstatkv[self.Manual_printup_Addr] = False
  814. def set_Manual_printdown(self, value):
  815. while (self.lock == True):
  816. time.sleep(0.01)
  817. self.opcwrkv[self.Manual_printdown_Addr] = value
  818. self.opcwrstatkv[self.Manual_printdown_Addr] = True
  819. def get_Manual_printdown(self):
  820. return self.opcrdkv[self.Manual_printdown_Addr]
  821. def check_Manual_printdown(self):
  822. if self.opcwrstatkv[self.Manual_printdown_Addr] == True:
  823. if self.opcrdkv[self.Manual_printdown_Addr] == self.opcwrkv[self.Manual_printdown_Addr]:
  824. self.opcwrstatkv[self.Manual_printdown_Addr] = False
  825. def set_Manual_printok(self, value):
  826. while (self.lock == True):
  827. time.sleep(0.01)
  828. self.opcwrkv[self.Manual_printok_Addr] = value
  829. self.opcwrstatkv[self.Manual_printok_Addr] = True
  830. def get_Manual_printok(self):
  831. return self.opcrdkv[self.Manual_printok_Addr]
  832. def check_Manual_printok(self):
  833. if self.opcwrstatkv[self.Manual_printok_Addr] == True:
  834. if self.opcrdkv[self.Manual_printok_Addr] == self.opcwrkv[self.Manual_printok_Addr]:
  835. self.opcwrstatkv[self.Manual_printok_Addr] = False
  836. def set_PLC_ok(self, value):
  837. while (self.lock == True):
  838. time.sleep(0.01)
  839. self.opcwrkv[self.PLC_ok_Addr] = value
  840. self.opcwrstatkv[self.PLC_ok_Addr] = True
  841. def get_PLC_ok(self):
  842. return self.opcrdkv[self.PLC_ok_Addr]
  843. def check_PLC_ok(self):
  844. if self.opcwrstatkv[self.PLC_ok_Addr] == True:
  845. if self.opcrdkv[self.PLC_ok_Addr] == self.opcwrkv[self.PLC_ok_Addr]:
  846. self.opcwrstatkv[self.PLC_ok_Addr] = False
  847. def set_Airdata_stat(self, value):
  848. while (self.lock == True):
  849. time.sleep(0.01)
  850. self.opcwrkv[self.Airdata_stat_Addr] = value
  851. self.opcwrstatkv[self.Airdata_stat_Addr] = True
  852. def get_Airdata_stat(self):
  853. return self.opcrdkv[self.Airdata_stat_Addr]
  854. def check_Airdata_stat(self):
  855. if self.opcwrstatkv[self.Airdata_stat_Addr] == True:
  856. if self.opcrdkv[self.Airdata_stat_Addr] == self.opcwrkv[self.Airdata_stat_Addr]:
  857. self.opcwrstatkv[self.Airdata_stat_Addr] = False
  858. def set_Auto_printok(self, value):
  859. while (self.lock == True):
  860. time.sleep(0.01)
  861. self.opcwrkv[self.Auto_printok_Addr] = value
  862. self.opcwrstatkv[self.Auto_printok_Addr] = True
  863. def get_Auto_printok(self):
  864. return self.opcrdkv[self.Auto_printok_Addr]
  865. def check_Auto_printok(self):
  866. if self.opcwrstatkv[self.Auto_printok_Addr] == True:
  867. if self.opcrdkv[self.Auto_printok_Addr] == self.opcwrkv[self.Auto_printok_Addr]:
  868. self.opcwrstatkv[self.Auto_printok_Addr] = False
  869. def set_Print_start(self, value):
  870. while (self.lock == True):
  871. time.sleep(0.01)
  872. self.opcwrkv[self.Print_start_Addr] = value
  873. self.opcwrstatkv[self.Print_start_Addr] = True
  874. def get_Print_start(self):
  875. return self.opcrdkv[self.Print_start_Addr]
  876. def check_Print_start(self):
  877. if self.opcwrstatkv[self.Print_start_Addr] == True:
  878. if self.opcrdkv[self.Print_start_Addr] == self.opcwrkv[self.Print_start_Addr]:
  879. self.opcwrstatkv[self.Print_start_Addr] = False
  880. def set_Start_work(self, value):
  881. while (self.lock == True):
  882. time.sleep(0.01)
  883. self.opcwrkv[self.Start_work_Addr] = value
  884. self.opcwrstatkv[self.Start_work_Addr] = True
  885. def get_Start_work(self):
  886. return self.opcrdkv[self.Start_work_Addr]
  887. def check_Start_work(self):
  888. if self.opcwrstatkv[self.Start_work_Addr] == True:
  889. if self.opcrdkv[self.Start_work_Addr] == self.opcwrkv[self.Start_work_Addr]:
  890. self.opcwrstatkv[self.Start_work_Addr] = False
  891. def set_Airtest_ok_r(self, value):
  892. while (self.lock == True):
  893. time.sleep(0.01)
  894. self.opcwrkv[self.Airtest_ok_r_Addr] = value
  895. self.opcwrstatkv[self.Airtest_ok_r_Addr] = True
  896. def get_Airtest_ok_r(self):
  897. return self.opcrdkv[self.Airtest_ok_r_Addr]
  898. def check_Airtest_ok_r(self):
  899. if self.opcwrstatkv[self.Airtest_ok_r_Addr] == True:
  900. if self.opcrdkv[self.Airtest_ok_r_Addr] == self.opcwrkv[self.Airtest_ok_r_Addr]:
  901. self.opcwrstatkv[self.Airtest_ok_r_Addr] = False
  902. def set_Airtest_ok_w(self, value):
  903. while (self.lock == True):
  904. time.sleep(0.01)
  905. self.opcwrkv[self.Airtest_ok_w_Addr] = value
  906. self.opcwrstatkv[self.Airtest_ok_w_Addr] = True
  907. def get_Airtest_ok_w(self):
  908. return self.opcrdkv[self.Airtest_ok_w_Addr]
  909. def check_Airtest_ok_w(self):
  910. if self.opcwrstatkv[self.Airtest_ok_w_Addr] == True:
  911. if self.opcrdkv[self.Airtest_ok_w_Addr] == self.opcwrkv[self.Airtest_ok_w_Addr]:
  912. self.opcwrstatkv[self.Airtest_ok_w_Addr] = False
  913. def set_Airtest_ng_r(self, value):
  914. while (self.lock == True):
  915. time.sleep(0.01)
  916. self.opcwrkv[self.Airtest_ng_r_Addr] = value
  917. self.opcwrstatkv[self.Airtest_ng_r_Addr] = True
  918. def get_Airtest_ng_r(self):
  919. return self.opcrdkv[self.Airtest_ng_r_Addr]
  920. def check_Airtest_ng_r(self):
  921. if self.opcwrstatkv[self.Airtest_ng_r_Addr] == True:
  922. if self.opcrdkv[self.Airtest_ng_r_Addr] == self.opcwrkv[self.Airtest_ng_r_Addr]:
  923. self.opcwrstatkv[self.Airtest_ng_r_Addr] = False
  924. def set_Airtest_ng_w(self, value):
  925. while (self.lock == True):
  926. time.sleep(0.01)
  927. self.opcwrkv[self.Airtest_ng_w_Addr] = value
  928. self.opcwrstatkv[self.Airtest_ng_w_Addr] = True
  929. def get_Airtest_ng_w(self):
  930. return self.opcrdkv[self.Airtest_ng_w_Addr]
  931. def check_Airtest_ng_w(self):
  932. if self.opcwrstatkv[self.Airtest_ng_w_Addr] == True:
  933. if self.opcrdkv[self.Airtest_ng_w_Addr] == self.opcwrkv[self.Airtest_ng_w_Addr]:
  934. self.opcwrstatkv[self.Airtest_ng_w_Addr] = False