1
0

models.py 63 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384
  1. # coding: utf-8
  2. from datetime import datetime
  3. from time import timezone
  4. from sqlalchemy import Column, Date, DateTime, Float, Index, Integer, String, Text
  5. from sqlalchemy.schema import FetchedValue
  6. from flask_sqlalchemy import SQLAlchemy
  7. # db = SQLAlchemy()
  8. #與當前項目相關的模型文件,即所有的實體類在此編寫
  9. from coffee_manage import db
  10. # from werkzeug.utils import send_file
  11. #用戶表
  12. class User(db.Model):
  13. __tablename__ = 'user'
  14. userID = db.Column(db.Integer, primary_key=True)
  15. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  16. firstname = db.Column(db.String(30), nullable=False)
  17. lastname = db.Column(db.String(30), nullable=False)
  18. mail = db.Column(db.String(50), nullable=False)
  19. phone = db.Column(db.String(20), nullable=False)
  20. username = db.Column(db.String(30), nullable=False, unique=True)
  21. password = db.Column(db.String(40), nullable=False)
  22. status = db.Column(db.Integer, nullable=False, info='0:admin;1:new;9:disable')
  23. # ////////////////////////////////////////////////////////////////////////////////
  24. # coffee 1.0 板子燒錄 腳位存值
  25. class coffee1_0_pin(db.Model):
  26. __tablename__ = 'coffee1_0_pin'
  27. sn = db.Column(db.Integer, primary_key=True)
  28. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  29. tid = db.Column(db.Text, nullable=True)
  30. ethernet = db.Column(db.Text, nullable=True)
  31. wifi = db.Column(db.Text, nullable=True)
  32. zigbee = db.Column(db.Text, nullable=True)
  33. R1 = db.Column(db.Text, nullable=True)
  34. R2 = db.Column(db.Text, nullable=True)
  35. R3 = db.Column(db.Text, nullable=True)
  36. R4 = db.Column(db.Text, nullable=True)
  37. R5 = db.Column(db.Text, nullable=True)
  38. R6 = db.Column(db.Text, nullable=True)
  39. R7 = db.Column(db.Text, nullable=True)
  40. R8 = db.Column(db.Text, nullable=True)
  41. R9 = db.Column(db.Text, nullable=True)
  42. R10 = db.Column(db.Text, nullable=True)
  43. R11 = db.Column(db.Text, nullable=True)
  44. R12 = db.Column(db.Text, nullable=True)
  45. R13 = db.Column(db.Text, nullable=True)
  46. R14 = db.Column(db.Text, nullable=True)
  47. R15 = db.Column(db.Text, nullable=True)
  48. R16 = db.Column(db.Text, nullable=True)
  49. R17 = db.Column(db.Text, nullable=True)
  50. R18 = db.Column(db.Text, nullable=True)
  51. R19 = db.Column(db.Text, nullable=True)
  52. R20 = db.Column(db.Text, nullable=True)
  53. M1= db.Column(db.Text, nullable=True)
  54. M2= db.Column(db.Text, nullable=True)
  55. M3= db.Column(db.Text, nullable=True)
  56. M4= db.Column(db.Text, nullable=True)
  57. M5= db.Column(db.Text, nullable=True)
  58. M6= db.Column(db.Text, nullable=True)
  59. M7= db.Column(db.Text, nullable=True)
  60. M8= db.Column(db.Text, nullable=True)
  61. M9= db.Column(db.Text, nullable=True)
  62. M10= db.Column(db.Text, nullable=True)
  63. M11= db.Column(db.Text, nullable=True)
  64. M12= db.Column(db.Text, nullable=True)
  65. M13= db.Column(db.Text, nullable=True)
  66. M14= db.Column(db.Text, nullable=True)
  67. M15= db.Column(db.Text, nullable=True)
  68. M16= db.Column(db.Text, nullable=True)
  69. M17= db.Column(db.Text, nullable=True)
  70. M18= db.Column(db.Text, nullable=True)
  71. M19= db.Column(db.Text, nullable=True)
  72. M1_Hz= db.Column(db.Text, nullable=True)
  73. M2_Hz= db.Column(db.Text, nullable=True)
  74. M3_Hz= db.Column(db.Text, nullable=True)
  75. M4_Hz= db.Column(db.Text, nullable=True)
  76. M5_Hz= db.Column(db.Text, nullable=True)
  77. M6_Hz= db.Column(db.Text, nullable=True)
  78. M7_Hz= db.Column(db.Text, nullable=True)
  79. M8_Hz= db.Column(db.Text, nullable=True)
  80. M9_Hz= db.Column(db.Text, nullable=True)
  81. M10_Hz= db.Column(db.Text, nullable=True)
  82. M11_Hz= db.Column(db.Text, nullable=True)
  83. M12_Hz= db.Column(db.Text, nullable=True)
  84. M13_Hz= db.Column(db.Text, nullable=True)
  85. M14_Hz= db.Column(db.Text, nullable=True)
  86. M15_Hz= db.Column(db.Text, nullable=True)
  87. M16_Hz= db.Column(db.Text, nullable=True)
  88. M17_Hz= db.Column(db.Text, nullable=True)
  89. M18_Hz= db.Column(db.Text, nullable=True)
  90. M19_Hz= db.Column(db.Text, nullable=True)
  91. # =============================================================================
  92. class dry_block_waiting(db.Model):
  93. __tablename__ = 'dry_block_waiting'
  94. __table_args__ = {
  95. 'mysql_row_format':'DYNAMIC'
  96. }
  97. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  98. cond_z1_1 = db.Column(db.Text, nullable=True)
  99. # cond_tank1_1 = db.Column(db.Text, nullable=True)
  100. cond_a1_1 = db.Column(db.Text, nullable=True)
  101. cond_b1_1 = db.Column(db.Text, nullable=True)
  102. cond_c1_1 = db.Column(db.Text, nullable=True)
  103. cond_a1_2 = db.Column(db.Text, nullable=True)
  104. cond_b1_2 = db.Column(db.Text, nullable=True)
  105. cond_c1_2 = db.Column(db.Text, nullable=True)
  106. cond_d1_2 = db.Column(db.Text, nullable=True)
  107. cond_a1_3 = db.Column(db.Text, nullable=True)
  108. cond_b1_3 = db.Column(db.Text, nullable=True)
  109. cond_c1_3 = db.Column(db.Text, nullable=True)
  110. cond_d1_3 = db.Column(db.Text, nullable=True)
  111. cond_a1_4 = db.Column(db.Text, nullable=True)
  112. cond_b1_4 = db.Column(db.Text, nullable=True)
  113. cond_c1_4 = db.Column(db.Text, nullable=True)
  114. cond_d1_4 = db.Column(db.Text, nullable=True)
  115. cond_a1_5 = db.Column(db.Text, nullable=True)
  116. cond_b1_5 = db.Column(db.Text, nullable=True)
  117. cond_c1_5 = db.Column(db.Text, nullable=True)
  118. cond_d1_5 = db.Column(db.Text, nullable=True)
  119. do_obj1_1 = db.Column(db.Text, nullable=True)
  120. do_act1_1 = db.Column(db.Text, nullable=True)
  121. do_obj1_2 = db.Column(db.Text, nullable=True)
  122. do_act1_2 = db.Column(db.Text, nullable=True)
  123. do_obj1_3 = db.Column(db.Text, nullable=True)
  124. do_act1_3 = db.Column(db.Text, nullable=True)
  125. do_obj1_4 = db.Column(db.Text, nullable=True)
  126. do_act1_4 = db.Column(db.Text, nullable=True)
  127. do_obj1_5 = db.Column(db.Text, nullable=True)
  128. do_act1_5 = db.Column(db.Text, nullable=True)
  129. cond_z2_1 = db.Column(db.Text, nullable=True)
  130. # cond_tank2_1 = db.Column(db.Text, nullable=True)
  131. cond_a2_1 = db.Column(db.Text, nullable=True)
  132. cond_b2_1 = db.Column(db.Text, nullable=True)
  133. cond_c2_1 = db.Column(db.Text, nullable=True)
  134. cond_a2_2 = db.Column(db.Text, nullable=True)
  135. cond_b2_2 = db.Column(db.Text, nullable=True)
  136. cond_c2_2 = db.Column(db.Text, nullable=True)
  137. cond_d2_2 = db.Column(db.Text, nullable=True)
  138. cond_a2_3 = db.Column(db.Text, nullable=True)
  139. cond_b2_3 = db.Column(db.Text, nullable=True)
  140. cond_c2_3 = db.Column(db.Text, nullable=True)
  141. cond_d2_3 = db.Column(db.Text, nullable=True)
  142. cond_a2_4 = db.Column(db.Text, nullable=True)
  143. cond_b2_4 = db.Column(db.Text, nullable=True)
  144. cond_c2_4 = db.Column(db.Text, nullable=True)
  145. cond_d2_4 = db.Column(db.Text, nullable=True)
  146. cond_a2_5 = db.Column(db.Text, nullable=True)
  147. cond_b2_5 = db.Column(db.Text, nullable=True)
  148. cond_c2_5 = db.Column(db.Text, nullable=True)
  149. cond_d2_5 = db.Column(db.Text, nullable=True)
  150. do_obj2_1 = db.Column(db.Text, nullable=True)
  151. do_act2_1 = db.Column(db.Text, nullable=True)
  152. do_obj2_2 = db.Column(db.Text, nullable=True)
  153. do_act2_2 = db.Column(db.Text, nullable=True)
  154. do_obj2_3 = db.Column(db.Text, nullable=True)
  155. do_act2_3 = db.Column(db.Text, nullable=True)
  156. do_obj2_4 = db.Column(db.Text, nullable=True)
  157. do_act2_4 = db.Column(db.Text, nullable=True)
  158. do_obj2_5 = db.Column(db.Text, nullable=True)
  159. do_act2_5 = db.Column(db.Text, nullable=True)
  160. cond_z3_1 = db.Column(db.Text, nullable=True)
  161. # cond_tank3_1 = db.Column(db.Text, nullable=True)
  162. cond_a3_1 = db.Column(db.Text, nullable=True)
  163. cond_b3_1 = db.Column(db.Text, nullable=True)
  164. cond_c3_1 = db.Column(db.Text, nullable=True)
  165. cond_a3_2 = db.Column(db.Text, nullable=True)
  166. cond_b3_2 = db.Column(db.Text, nullable=True)
  167. cond_c3_2 = db.Column(db.Text, nullable=True)
  168. cond_d3_2 = db.Column(db.Text, nullable=True)
  169. cond_a3_3 = db.Column(db.Text, nullable=True)
  170. cond_b3_3 = db.Column(db.Text, nullable=True)
  171. cond_c3_3 = db.Column(db.Text, nullable=True)
  172. cond_d3_3 = db.Column(db.Text, nullable=True)
  173. cond_a3_4 = db.Column(db.Text, nullable=True)
  174. cond_b3_4 = db.Column(db.Text, nullable=True)
  175. cond_c3_4 = db.Column(db.Text, nullable=True)
  176. cond_d3_4 = db.Column(db.Text, nullable=True)
  177. cond_a3_5 = db.Column(db.Text, nullable=True)
  178. cond_b3_5 = db.Column(db.Text, nullable=True)
  179. cond_c3_5 = db.Column(db.Text, nullable=True)
  180. cond_d3_5 = db.Column(db.Text, nullable=True)
  181. do_obj3_1 = db.Column(db.Text, nullable=True)
  182. do_act3_1 = db.Column(db.Text, nullable=True)
  183. do_obj3_2 = db.Column(db.Text, nullable=True)
  184. do_act3_2 = db.Column(db.Text, nullable=True)
  185. do_obj3_3 = db.Column(db.Text, nullable=True)
  186. do_act3_3 = db.Column(db.Text, nullable=True)
  187. do_obj3_4 = db.Column(db.Text, nullable=True)
  188. do_act3_4 = db.Column(db.Text, nullable=True)
  189. do_obj3_5 = db.Column(db.Text, nullable=True)
  190. do_act3_5 = db.Column(db.Text, nullable=True)
  191. cond_z4_1 = db.Column(db.Text, nullable=True)
  192. # cond_tank4_1 = db.Column(db.Text, nullable=True)
  193. cond_a4_1 = db.Column(db.Text, nullable=True)
  194. cond_b4_1 = db.Column(db.Text, nullable=True)
  195. cond_c4_1 = db.Column(db.Text, nullable=True)
  196. cond_a4_2 = db.Column(db.Text, nullable=True)
  197. cond_b4_2 = db.Column(db.Text, nullable=True)
  198. cond_c4_2 = db.Column(db.Text, nullable=True)
  199. cond_d4_2 = db.Column(db.Text, nullable=True)
  200. cond_a4_3 = db.Column(db.Text, nullable=True)
  201. cond_b4_3 = db.Column(db.Text, nullable=True)
  202. cond_c4_3 = db.Column(db.Text, nullable=True)
  203. cond_d4_3 = db.Column(db.Text, nullable=True)
  204. cond_a4_4 = db.Column(db.Text, nullable=True)
  205. cond_b4_4 = db.Column(db.Text, nullable=True)
  206. cond_c4_4 = db.Column(db.Text, nullable=True)
  207. cond_d4_4 = db.Column(db.Text, nullable=True)
  208. cond_a4_5 = db.Column(db.Text, nullable=True)
  209. cond_b4_5 = db.Column(db.Text, nullable=True)
  210. cond_c4_5 = db.Column(db.Text, nullable=True)
  211. cond_d4_5 = db.Column(db.Text, nullable=True)
  212. do_obj4_1 = db.Column(db.Text, nullable=True)
  213. do_act4_1 = db.Column(db.Text, nullable=True)
  214. do_obj4_2 = db.Column(db.Text, nullable=True)
  215. do_act4_2 = db.Column(db.Text, nullable=True)
  216. do_obj4_3 = db.Column(db.Text, nullable=True)
  217. do_act4_3 = db.Column(db.Text, nullable=True)
  218. do_obj4_4 = db.Column(db.Text, nullable=True)
  219. do_act4_4 = db.Column(db.Text, nullable=True)
  220. do_obj4_5 = db.Column(db.Text, nullable=True)
  221. do_act4_5 = db.Column(db.Text, nullable=True)
  222. cond_z5_1 = db.Column(db.Text, nullable=True)
  223. # cond_tank5_1 = db.Column(db.Text, nullable=True)
  224. cond_a5_1 = db.Column(db.Text, nullable=True)
  225. cond_b5_1 = db.Column(db.Text, nullable=True)
  226. cond_c5_1 = db.Column(db.Text, nullable=True)
  227. cond_a5_2 = db.Column(db.Text, nullable=True)
  228. cond_b5_2 = db.Column(db.Text, nullable=True)
  229. cond_c5_2 = db.Column(db.Text, nullable=True)
  230. cond_d5_2 = db.Column(db.Text, nullable=True)
  231. cond_a5_3 = db.Column(db.Text, nullable=True)
  232. cond_b5_3 = db.Column(db.Text, nullable=True)
  233. cond_c5_3 = db.Column(db.Text, nullable=True)
  234. cond_d5_3 = db.Column(db.Text, nullable=True)
  235. cond_a5_4 = db.Column(db.Text, nullable=True)
  236. cond_b5_4 = db.Column(db.Text, nullable=True)
  237. cond_c5_4 = db.Column(db.Text, nullable=True)
  238. cond_d5_4 = db.Column(db.Text, nullable=True)
  239. cond_a5_5 = db.Column(db.Text, nullable=True)
  240. cond_b5_5 = db.Column(db.Text, nullable=True)
  241. cond_c5_5 = db.Column(db.Text, nullable=True)
  242. cond_d5_5 = db.Column(db.Text, nullable=True)
  243. do_obj5_1 = db.Column(db.Text, nullable=True)
  244. do_act5_1 = db.Column(db.Text, nullable=True)
  245. do_obj5_2 = db.Column(db.Text, nullable=True)
  246. do_act5_2 = db.Column(db.Text, nullable=True)
  247. do_obj5_3 = db.Column(db.Text, nullable=True)
  248. do_act5_3 = db.Column(db.Text, nullable=True)
  249. do_obj5_4 = db.Column(db.Text, nullable=True)
  250. do_act5_4 = db.Column(db.Text, nullable=True)
  251. do_obj5_5 = db.Column(db.Text, nullable=True)
  252. do_act5_5 = db.Column(db.Text, nullable=True)
  253. class dry_block_waiting1(db.Model):
  254. __tablename__ = 'dry_block_waiting1'
  255. __table_args__ = {
  256. 'mysql_row_format':'DYNAMIC'
  257. }
  258. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  259. IP = db.Column(db.Text, nullable=True)
  260. cond_z1_1 = db.Column(db.Text, nullable=True)
  261. cond_a1_1 = db.Column(db.Text, nullable=True)
  262. cond_b1_1 = db.Column(db.Text, nullable=True)
  263. cond_c1_1 = db.Column(db.Text, nullable=True)
  264. cond_a1_2 = db.Column(db.Text, nullable=True)
  265. cond_b1_2 = db.Column(db.Text, nullable=True)
  266. cond_c1_2 = db.Column(db.Text, nullable=True)
  267. cond_d1_2 = db.Column(db.Text, nullable=True)
  268. cond_a1_3 = db.Column(db.Text, nullable=True)
  269. cond_b1_3 = db.Column(db.Text, nullable=True)
  270. cond_c1_3 = db.Column(db.Text, nullable=True)
  271. cond_d1_3 = db.Column(db.Text, nullable=True)
  272. cond_a1_4 = db.Column(db.Text, nullable=True)
  273. cond_b1_4 = db.Column(db.Text, nullable=True)
  274. cond_c1_4 = db.Column(db.Text, nullable=True)
  275. cond_d1_4 = db.Column(db.Text, nullable=True)
  276. cond_a1_5 = db.Column(db.Text, nullable=True)
  277. cond_b1_5 = db.Column(db.Text, nullable=True)
  278. cond_c1_5 = db.Column(db.Text, nullable=True)
  279. cond_d1_5 = db.Column(db.Text, nullable=True)
  280. cond_a1_6 = db.Column(db.Text, nullable=True)
  281. cond_b1_6 = db.Column(db.Text, nullable=True)
  282. cond_c1_6 = db.Column(db.Text, nullable=True)
  283. cond_d1_6 = db.Column(db.Text, nullable=True)
  284. cond_a1_7 = db.Column(db.Text, nullable=True)
  285. cond_b1_7 = db.Column(db.Text, nullable=True)
  286. cond_c1_7 = db.Column(db.Text, nullable=True)
  287. cond_d1_7 = db.Column(db.Text, nullable=True)
  288. cond_a1_8 = db.Column(db.Text, nullable=True)
  289. cond_b1_8 = db.Column(db.Text, nullable=True)
  290. cond_c1_8 = db.Column(db.Text, nullable=True)
  291. cond_d1_8 = db.Column(db.Text, nullable=True)
  292. cond_a1_9 = db.Column(db.Text, nullable=True)
  293. cond_b1_9 = db.Column(db.Text, nullable=True)
  294. cond_c1_9 = db.Column(db.Text, nullable=True)
  295. cond_d1_9 = db.Column(db.Text, nullable=True)
  296. cond_a1_10 = db.Column(db.Text, nullable=True)
  297. cond_b1_10 = db.Column(db.Text, nullable=True)
  298. cond_c1_10 = db.Column(db.Text, nullable=True)
  299. cond_d1_10 = db.Column(db.Text, nullable=True)
  300. cond_a1_11 = db.Column(db.Text, nullable=True)
  301. cond_b1_11 = db.Column(db.Text, nullable=True)
  302. cond_c1_11 = db.Column(db.Text, nullable=True)
  303. cond_d1_11 = db.Column(db.Text, nullable=True)
  304. cond_a1_12 = db.Column(db.Text, nullable=True)
  305. cond_b1_12 = db.Column(db.Text, nullable=True)
  306. cond_c1_12 = db.Column(db.Text, nullable=True)
  307. cond_d1_12 = db.Column(db.Text, nullable=True)
  308. cond_a1_13 = db.Column(db.Text, nullable=True)
  309. cond_b1_13 = db.Column(db.Text, nullable=True)
  310. cond_c1_13 = db.Column(db.Text, nullable=True)
  311. cond_d1_13 = db.Column(db.Text, nullable=True)
  312. do_obj1_1 = db.Column(db.Text, nullable=True)
  313. do_act1_1 = db.Column(db.Text, nullable=True)
  314. do_obj1_2 = db.Column(db.Text, nullable=True)
  315. do_act1_2 = db.Column(db.Text, nullable=True)
  316. do_obj1_3 = db.Column(db.Text, nullable=True)
  317. do_act1_3 = db.Column(db.Text, nullable=True)
  318. do_obj1_4 = db.Column(db.Text, nullable=True)
  319. do_act1_4 = db.Column(db.Text, nullable=True)
  320. do_obj1_5 = db.Column(db.Text, nullable=True)
  321. do_act1_5 = db.Column(db.Text, nullable=True)
  322. do_obj1_6 = db.Column(db.Text, nullable=True)
  323. do_act1_6 = db.Column(db.Text, nullable=True)
  324. do_obj1_7 = db.Column(db.Text, nullable=True)
  325. do_act1_7 = db.Column(db.Text, nullable=True)
  326. do_obj1_8 = db.Column(db.Text, nullable=True)
  327. do_act1_8 = db.Column(db.Text, nullable=True)
  328. do_obj1_9 = db.Column(db.Text, nullable=True)
  329. do_act1_9 = db.Column(db.Text, nullable=True)
  330. do_obj1_10 = db.Column(db.Text, nullable=True)
  331. do_act1_10 = db.Column(db.Text, nullable=True)
  332. do_obj1_11 = db.Column(db.Text, nullable=True)
  333. do_act1_11 = db.Column(db.Text, nullable=True)
  334. do_obj1_12 = db.Column(db.Text, nullable=True)
  335. do_act1_12 = db.Column(db.Text, nullable=True)
  336. do_obj1_13 = db.Column(db.Text, nullable=True)
  337. do_act1_13 = db.Column(db.Text, nullable=True)
  338. do_obj1_14 = db.Column(db.Text, nullable=True)
  339. do_act1_14 = db.Column(db.Text, nullable=True)
  340. do_obj1_15 = db.Column(db.Text, nullable=True)
  341. do_act1_15 = db.Column(db.Text, nullable=True)
  342. do_obj1_16 = db.Column(db.Text, nullable=True)
  343. do_act1_16 = db.Column(db.Text, nullable=True)
  344. do_obj1_17 = db.Column(db.Text, nullable=True)
  345. do_act1_17 = db.Column(db.Text, nullable=True)
  346. do_obj1_18 = db.Column(db.Text, nullable=True)
  347. do_act1_18 = db.Column(db.Text, nullable=True)
  348. do_obj1_19 = db.Column(db.Text, nullable=True)
  349. do_act1_19 = db.Column(db.Text, nullable=True)
  350. do_obj1_20 = db.Column(db.Text, nullable=True)
  351. do_act1_20 = db.Column(db.Text, nullable=True)
  352. class block_cond_d1_1(db.Model):
  353. __tablename__ = 'block_cond_d1_1'
  354. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  355. IP = db.Column(db.Text, nullable=True)
  356. cond_z1_1 = db.Column(db.Text, nullable=True)
  357. cond_a1_1 = db.Column(db.Text, nullable=True)
  358. cond_b1_1 = db.Column(db.Text, nullable=True)
  359. cond_c1_1 = db.Column(db.Text, nullable=True)
  360. cond_a1_2 = db.Column(db.Text, nullable=True)
  361. cond_b1_2 = db.Column(db.Text, nullable=True)
  362. cond_c1_2 = db.Column(db.Text, nullable=True)
  363. cond_d1_2 = db.Column(db.Text, nullable=True)
  364. cond_a1_3 = db.Column(db.Text, nullable=True)
  365. cond_b1_3 = db.Column(db.Text, nullable=True)
  366. cond_c1_3 = db.Column(db.Text, nullable=True)
  367. cond_d1_3 = db.Column(db.Text, nullable=True)
  368. cond_a1_4 = db.Column(db.Text, nullable=True)
  369. cond_b1_4 = db.Column(db.Text, nullable=True)
  370. cond_c1_4 = db.Column(db.Text, nullable=True)
  371. cond_d1_4 = db.Column(db.Text, nullable=True)
  372. cond_a1_5 = db.Column(db.Text, nullable=True)
  373. cond_b1_5 = db.Column(db.Text, nullable=True)
  374. cond_c1_5 = db.Column(db.Text, nullable=True)
  375. cond_d1_5 = db.Column(db.Text, nullable=True)
  376. cond_a1_6 = db.Column(db.Text, nullable=True)
  377. cond_b1_6 = db.Column(db.Text, nullable=True)
  378. cond_c1_6 = db.Column(db.Text, nullable=True)
  379. cond_d1_6 = db.Column(db.Text, nullable=True)
  380. cond_a1_7 = db.Column(db.Text, nullable=True)
  381. cond_b1_7 = db.Column(db.Text, nullable=True)
  382. cond_c1_7 = db.Column(db.Text, nullable=True)
  383. cond_d1_7 = db.Column(db.Text, nullable=True)
  384. cond_a1_8 = db.Column(db.Text, nullable=True)
  385. cond_b1_8 = db.Column(db.Text, nullable=True)
  386. cond_c1_8 = db.Column(db.Text, nullable=True)
  387. cond_d1_8 = db.Column(db.Text, nullable=True)
  388. cond_a1_9 = db.Column(db.Text, nullable=True)
  389. cond_b1_9 = db.Column(db.Text, nullable=True)
  390. cond_c1_9 = db.Column(db.Text, nullable=True)
  391. cond_d1_9 = db.Column(db.Text, nullable=True)
  392. cond_a1_10 = db.Column(db.Text, nullable=True)
  393. cond_b1_10 = db.Column(db.Text, nullable=True)
  394. cond_c1_10 = db.Column(db.Text, nullable=True)
  395. cond_d1_10 = db.Column(db.Text, nullable=True)
  396. cond_a1_11 = db.Column(db.Text, nullable=True)
  397. cond_b1_11 = db.Column(db.Text, nullable=True)
  398. cond_c1_11 = db.Column(db.Text, nullable=True)
  399. cond_d1_11 = db.Column(db.Text, nullable=True)
  400. cond_a1_12 = db.Column(db.Text, nullable=True)
  401. cond_b1_12 = db.Column(db.Text, nullable=True)
  402. cond_c1_12 = db.Column(db.Text, nullable=True)
  403. cond_d1_12 = db.Column(db.Text, nullable=True)
  404. cond_a1_13 = db.Column(db.Text, nullable=True)
  405. cond_b1_13 = db.Column(db.Text, nullable=True)
  406. cond_c1_13 = db.Column(db.Text, nullable=True)
  407. cond_d1_13 = db.Column(db.Text, nullable=True)
  408. do_obj1_1 = db.Column(db.Text, nullable=True)
  409. do_act1_1 = db.Column(db.Text, nullable=True)
  410. do_obj1_2 = db.Column(db.Text, nullable=True)
  411. do_act1_2 = db.Column(db.Text, nullable=True)
  412. do_obj1_3 = db.Column(db.Text, nullable=True)
  413. do_act1_3 = db.Column(db.Text, nullable=True)
  414. do_obj1_4 = db.Column(db.Text, nullable=True)
  415. do_act1_4 = db.Column(db.Text, nullable=True)
  416. do_obj1_5 = db.Column(db.Text, nullable=True)
  417. do_act1_5 = db.Column(db.Text, nullable=True)
  418. do_obj1_6 = db.Column(db.Text, nullable=True)
  419. do_act1_6 = db.Column(db.Text, nullable=True)
  420. do_obj1_7 = db.Column(db.Text, nullable=True)
  421. do_act1_7 = db.Column(db.Text, nullable=True)
  422. do_obj1_8 = db.Column(db.Text, nullable=True)
  423. do_act1_8 = db.Column(db.Text, nullable=True)
  424. do_obj1_9 = db.Column(db.Text, nullable=True)
  425. do_act1_9 = db.Column(db.Text, nullable=True)
  426. do_obj1_10 = db.Column(db.Text, nullable=True)
  427. do_act1_10 = db.Column(db.Text, nullable=True)
  428. do_obj1_11 = db.Column(db.Text, nullable=True)
  429. do_act1_11 = db.Column(db.Text, nullable=True)
  430. do_obj1_12 = db.Column(db.Text, nullable=True)
  431. do_act1_12 = db.Column(db.Text, nullable=True)
  432. do_obj1_13 = db.Column(db.Text, nullable=True)
  433. do_act1_13 = db.Column(db.Text, nullable=True)
  434. do_obj1_14 = db.Column(db.Text, nullable=True)
  435. do_act1_14 = db.Column(db.Text, nullable=True)
  436. do_obj1_15 = db.Column(db.Text, nullable=True)
  437. do_act1_15 = db.Column(db.Text, nullable=True)
  438. do_obj1_16 = db.Column(db.Text, nullable=True)
  439. do_act1_16 = db.Column(db.Text, nullable=True)
  440. do_obj1_17 = db.Column(db.Text, nullable=True)
  441. do_act1_17 = db.Column(db.Text, nullable=True)
  442. do_obj1_18 = db.Column(db.Text, nullable=True)
  443. do_act1_18 = db.Column(db.Text, nullable=True)
  444. do_obj1_19 = db.Column(db.Text, nullable=True)
  445. do_act1_19 = db.Column(db.Text, nullable=True)
  446. do_obj1_20 = db.Column(db.Text, nullable=True)
  447. do_act1_20 = db.Column(db.Text, nullable=True)
  448. class block_cond_d1_2(db.Model):
  449. __tablename__ = 'block_cond_d1_2'
  450. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  451. IP = db.Column(db.Text, nullable=False)
  452. cond_z2_1 = db.Column(db.Text, nullable=True)
  453. cond_a2_1 = db.Column(db.Text, nullable=True)
  454. cond_b2_1 = db.Column(db.Text, nullable=True)
  455. cond_c2_1 = db.Column(db.Text, nullable=True)
  456. cond_a2_2 = db.Column(db.Text, nullable=True)
  457. cond_b2_2 = db.Column(db.Text, nullable=True)
  458. cond_c2_2 = db.Column(db.Text, nullable=True)
  459. cond_d2_2 = db.Column(db.Text, nullable=True)
  460. cond_a2_3 = db.Column(db.Text, nullable=True)
  461. cond_b2_3 = db.Column(db.Text, nullable=True)
  462. cond_c2_3 = db.Column(db.Text, nullable=True)
  463. cond_d2_3 = db.Column(db.Text, nullable=True)
  464. cond_a2_4 = db.Column(db.Text, nullable=True)
  465. cond_b2_4 = db.Column(db.Text, nullable=True)
  466. cond_c2_4 = db.Column(db.Text, nullable=True)
  467. cond_d2_4 = db.Column(db.Text, nullable=True)
  468. cond_a2_5 = db.Column(db.Text, nullable=True)
  469. cond_b2_5 = db.Column(db.Text, nullable=True)
  470. cond_c2_5 = db.Column(db.Text, nullable=True)
  471. cond_d2_5 = db.Column(db.Text, nullable=True)
  472. cond_a2_6 = db.Column(db.Text, nullable=True)
  473. cond_b2_6 = db.Column(db.Text, nullable=True)
  474. cond_c2_6 = db.Column(db.Text, nullable=True)
  475. cond_d2_6 = db.Column(db.Text, nullable=True)
  476. cond_a2_7 = db.Column(db.Text, nullable=True)
  477. cond_b2_7 = db.Column(db.Text, nullable=True)
  478. cond_c2_7 = db.Column(db.Text, nullable=True)
  479. cond_d2_7 = db.Column(db.Text, nullable=True)
  480. cond_a2_8 = db.Column(db.Text, nullable=True)
  481. cond_b2_8 = db.Column(db.Text, nullable=True)
  482. cond_c2_8 = db.Column(db.Text, nullable=True)
  483. cond_d2_8 = db.Column(db.Text, nullable=True)
  484. cond_a2_9 = db.Column(db.Text, nullable=True)
  485. cond_b2_9 = db.Column(db.Text, nullable=True)
  486. cond_c2_9 = db.Column(db.Text, nullable=True)
  487. cond_d2_9 = db.Column(db.Text, nullable=True)
  488. cond_a2_10 = db.Column(db.Text, nullable=True)
  489. cond_b2_10 = db.Column(db.Text, nullable=True)
  490. cond_c2_10 = db.Column(db.Text, nullable=True)
  491. cond_d2_10 = db.Column(db.Text, nullable=True)
  492. cond_a2_11 = db.Column(db.Text, nullable=True)
  493. cond_b2_11 = db.Column(db.Text, nullable=True)
  494. cond_c2_11 = db.Column(db.Text, nullable=True)
  495. cond_d2_11 = db.Column(db.Text, nullable=True)
  496. cond_a2_12 = db.Column(db.Text, nullable=True)
  497. cond_b2_12 = db.Column(db.Text, nullable=True)
  498. cond_c2_12 = db.Column(db.Text, nullable=True)
  499. cond_d2_12 = db.Column(db.Text, nullable=True)
  500. cond_a2_13 = db.Column(db.Text, nullable=True)
  501. cond_b2_13 = db.Column(db.Text, nullable=True)
  502. cond_c2_13 = db.Column(db.Text, nullable=True)
  503. cond_d2_13 = db.Column(db.Text, nullable=True)
  504. do_obj2_1 = db.Column(db.Text, nullable=True)
  505. do_act2_1 = db.Column(db.Text, nullable=True)
  506. do_obj2_2 = db.Column(db.Text, nullable=True)
  507. do_act2_2 = db.Column(db.Text, nullable=True)
  508. do_obj2_3 = db.Column(db.Text, nullable=True)
  509. do_act2_3 = db.Column(db.Text, nullable=True)
  510. do_obj2_4 = db.Column(db.Text, nullable=True)
  511. do_act2_4 = db.Column(db.Text, nullable=True)
  512. do_obj2_5 = db.Column(db.Text, nullable=True)
  513. do_act2_5 = db.Column(db.Text, nullable=True)
  514. do_obj2_6 = db.Column(db.Text, nullable=True)
  515. do_act2_6 = db.Column(db.Text, nullable=True)
  516. do_obj2_7 = db.Column(db.Text, nullable=True)
  517. do_act2_7 = db.Column(db.Text, nullable=True)
  518. do_obj2_8 = db.Column(db.Text, nullable=True)
  519. do_act2_8 = db.Column(db.Text, nullable=True)
  520. do_obj2_9 = db.Column(db.Text, nullable=True)
  521. do_act2_9 = db.Column(db.Text, nullable=True)
  522. do_obj2_10 = db.Column(db.Text, nullable=True)
  523. do_act2_10 = db.Column(db.Text, nullable=True)
  524. do_obj2_11 = db.Column(db.Text, nullable=True)
  525. do_act2_11 = db.Column(db.Text, nullable=True)
  526. do_obj2_12 = db.Column(db.Text, nullable=True)
  527. do_act2_12 = db.Column(db.Text, nullable=True)
  528. do_obj2_13 = db.Column(db.Text, nullable=True)
  529. do_act2_13 = db.Column(db.Text, nullable=True)
  530. do_obj2_14 = db.Column(db.Text, nullable=True)
  531. do_act2_14 = db.Column(db.Text, nullable=True)
  532. do_obj2_15 = db.Column(db.Text, nullable=True)
  533. do_act2_15 = db.Column(db.Text, nullable=True)
  534. do_obj2_16 = db.Column(db.Text, nullable=True)
  535. do_act2_16 = db.Column(db.Text, nullable=True)
  536. do_obj2_17 = db.Column(db.Text, nullable=True)
  537. do_act2_17 = db.Column(db.Text, nullable=True)
  538. do_obj2_18 = db.Column(db.Text, nullable=True)
  539. do_act2_18 = db.Column(db.Text, nullable=True)
  540. do_obj2_19 = db.Column(db.Text, nullable=True)
  541. do_act2_19 = db.Column(db.Text, nullable=True)
  542. do_obj2_20 = db.Column(db.Text, nullable=True)
  543. do_act2_20 = db.Column(db.Text, nullable=True)
  544. class block_cond_d1_3(db.Model):
  545. __tablename__ = 'block_cond_d1_3'
  546. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  547. IP = db.Column(db.Text, nullable=False)
  548. cond_z3_1 = db.Column(db.Text, nullable=True)
  549. cond_a3_1 = db.Column(db.Text, nullable=True)
  550. cond_b3_1 = db.Column(db.Text, nullable=True)
  551. cond_c3_1 = db.Column(db.Text, nullable=True)
  552. cond_a3_2 = db.Column(db.Text, nullable=True)
  553. cond_b3_2 = db.Column(db.Text, nullable=True)
  554. cond_c3_2 = db.Column(db.Text, nullable=True)
  555. cond_d3_2 = db.Column(db.Text, nullable=True)
  556. cond_a3_3 = db.Column(db.Text, nullable=True)
  557. cond_b3_3 = db.Column(db.Text, nullable=True)
  558. cond_c3_3 = db.Column(db.Text, nullable=True)
  559. cond_d3_3 = db.Column(db.Text, nullable=True)
  560. cond_a3_4 = db.Column(db.Text, nullable=True)
  561. cond_b3_4 = db.Column(db.Text, nullable=True)
  562. cond_c3_4 = db.Column(db.Text, nullable=True)
  563. cond_d3_4 = db.Column(db.Text, nullable=True)
  564. cond_a3_5 = db.Column(db.Text, nullable=True)
  565. cond_b3_5 = db.Column(db.Text, nullable=True)
  566. cond_c3_5 = db.Column(db.Text, nullable=True)
  567. cond_d3_5 = db.Column(db.Text, nullable=True)
  568. cond_a3_6 = db.Column(db.Text, nullable=True)
  569. cond_b3_6 = db.Column(db.Text, nullable=True)
  570. cond_c3_6 = db.Column(db.Text, nullable=True)
  571. cond_d3_6 = db.Column(db.Text, nullable=True)
  572. cond_a3_7 = db.Column(db.Text, nullable=True)
  573. cond_b3_7 = db.Column(db.Text, nullable=True)
  574. cond_c3_7 = db.Column(db.Text, nullable=True)
  575. cond_d3_7 = db.Column(db.Text, nullable=True)
  576. cond_a3_8 = db.Column(db.Text, nullable=True)
  577. cond_b3_8 = db.Column(db.Text, nullable=True)
  578. cond_c3_8 = db.Column(db.Text, nullable=True)
  579. cond_d3_8 = db.Column(db.Text, nullable=True)
  580. cond_a3_9 = db.Column(db.Text, nullable=True)
  581. cond_b3_9 = db.Column(db.Text, nullable=True)
  582. cond_c3_9 = db.Column(db.Text, nullable=True)
  583. cond_d3_9 = db.Column(db.Text, nullable=True)
  584. cond_a3_10 = db.Column(db.Text, nullable=True)
  585. cond_b3_10 = db.Column(db.Text, nullable=True)
  586. cond_c3_10 = db.Column(db.Text, nullable=True)
  587. cond_d3_10 = db.Column(db.Text, nullable=True)
  588. cond_a3_11 = db.Column(db.Text, nullable=True)
  589. cond_b3_11 = db.Column(db.Text, nullable=True)
  590. cond_c3_11 = db.Column(db.Text, nullable=True)
  591. cond_d3_11 = db.Column(db.Text, nullable=True)
  592. cond_a3_12 = db.Column(db.Text, nullable=True)
  593. cond_b3_12 = db.Column(db.Text, nullable=True)
  594. cond_c3_12 = db.Column(db.Text, nullable=True)
  595. cond_d3_12 = db.Column(db.Text, nullable=True)
  596. cond_a3_13 = db.Column(db.Text, nullable=True)
  597. cond_b3_13 = db.Column(db.Text, nullable=True)
  598. cond_c3_13 = db.Column(db.Text, nullable=True)
  599. cond_d3_13 = db.Column(db.Text, nullable=True)
  600. do_obj3_1 = db.Column(db.Text, nullable=True)
  601. do_act3_1 = db.Column(db.Text, nullable=True)
  602. do_obj3_2 = db.Column(db.Text, nullable=True)
  603. do_act3_2 = db.Column(db.Text, nullable=True)
  604. do_obj3_3 = db.Column(db.Text, nullable=True)
  605. do_act3_3 = db.Column(db.Text, nullable=True)
  606. do_obj3_4 = db.Column(db.Text, nullable=True)
  607. do_act3_4 = db.Column(db.Text, nullable=True)
  608. do_obj3_5 = db.Column(db.Text, nullable=True)
  609. do_act3_5 = db.Column(db.Text, nullable=True)
  610. do_obj3_6 = db.Column(db.Text, nullable=True)
  611. do_act3_6 = db.Column(db.Text, nullable=True)
  612. do_obj3_7 = db.Column(db.Text, nullable=True)
  613. do_act3_7 = db.Column(db.Text, nullable=True)
  614. do_obj3_8 = db.Column(db.Text, nullable=True)
  615. do_act3_8 = db.Column(db.Text, nullable=True)
  616. do_obj3_9 = db.Column(db.Text, nullable=True)
  617. do_act3_9 = db.Column(db.Text, nullable=True)
  618. do_obj3_10 = db.Column(db.Text, nullable=True)
  619. do_act3_10 = db.Column(db.Text, nullable=True)
  620. do_obj3_11 = db.Column(db.Text, nullable=True)
  621. do_act3_11 = db.Column(db.Text, nullable=True)
  622. do_obj3_12 = db.Column(db.Text, nullable=True)
  623. do_act3_12 = db.Column(db.Text, nullable=True)
  624. do_obj3_13 = db.Column(db.Text, nullable=True)
  625. do_act3_13 = db.Column(db.Text, nullable=True)
  626. do_obj3_14 = db.Column(db.Text, nullable=True)
  627. do_act3_14 = db.Column(db.Text, nullable=True)
  628. do_obj3_15 = db.Column(db.Text, nullable=True)
  629. do_act3_15 = db.Column(db.Text, nullable=True)
  630. do_obj3_16 = db.Column(db.Text, nullable=True)
  631. do_act3_16 = db.Column(db.Text, nullable=True)
  632. do_obj3_17 = db.Column(db.Text, nullable=True)
  633. do_act3_17 = db.Column(db.Text, nullable=True)
  634. do_obj3_18 = db.Column(db.Text, nullable=True)
  635. do_act3_18 = db.Column(db.Text, nullable=True)
  636. do_obj3_19 = db.Column(db.Text, nullable=True)
  637. do_act3_19 = db.Column(db.Text, nullable=True)
  638. do_obj3_20 = db.Column(db.Text, nullable=True)
  639. do_act3_20 = db.Column(db.Text, nullable=True)
  640. class block_cond_d1_t(db.Model):
  641. __tablename__ = 'block_cond_d1_t'
  642. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  643. IP = db.Column(db.Text, nullable=False)
  644. tank_num = db.Column(db.Text, nullable=False)
  645. cond1= db.Column(db.Text, nullable=True)
  646. cond2= db.Column(db.Text, nullable=True)
  647. cond3= db.Column(db.Text, nullable=True)
  648. cond4= db.Column(db.Text, nullable=True)
  649. cond5= db.Column(db.Text, nullable=True)
  650. cond6= db.Column(db.Text, nullable=True)
  651. cond7= db.Column(db.Text, nullable=True)
  652. cond8= db.Column(db.Text, nullable=True)
  653. cond9= db.Column(db.Text, nullable=True)
  654. cond10= db.Column(db.Text, nullable=True)
  655. cond11= db.Column(db.Text, nullable=True)
  656. cond12= db.Column(db.Text, nullable=True)
  657. cond13= db.Column(db.Text, nullable=True)
  658. cond14= db.Column(db.Text, nullable=True)
  659. cond15= db.Column(db.Text, nullable=True)
  660. cond16= db.Column(db.Text, nullable=True)
  661. cond17= db.Column(db.Text, nullable=True)
  662. cond18= db.Column(db.Text, nullable=True)
  663. cond19= db.Column(db.Text, nullable=True)
  664. cond20= db.Column(db.Text, nullable=True)
  665. class block_cond_dry_t(db.Model):
  666. __tablename__ = 'block_cond_dry_t'
  667. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  668. UserName = db.Column(db.Text, nullable=False)
  669. tank_num = db.Column(db.Text, nullable=False)
  670. cond= db.Column(db.Text, nullable=True)
  671. class dry_tank_relation(db.Model):
  672. __tablename__ = 'dry_tank_relation'
  673. tank_id = db.Column(db.String(5), nullable=False, primary_key=True)
  674. tank_type = db.Column(db.Text, nullable=False)
  675. tank_import = db.Column(db.Text, nullable=False)
  676. tank_export = db.Column(db.Text, nullable=False)
  677. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  678. # # ////////////////////////////////////////////////////////////////////////////////
  679. # 乾燥槽
  680. # 乾燥桶入料_感測器_超音波感測器
  681. class dry_input_sensor(db.Model):
  682. __tablename__ = 'dry_input_sensor'
  683. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  684. tank_num = db.Column(db.Text, nullable=False)
  685. UltraSonic = db.Column(db.Text, nullable=False)
  686. # 乾燥桶_感測器_SHT11
  687. class dry_tank_SHT11(db.Model):
  688. __tablename__ = 'dry_tank_SHT11'
  689. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  690. tank_num = db.Column(db.Text, nullable=False)
  691. SHT11_Temp = db.Column(db.Text, nullable=False)
  692. SHT11_Humidity = db.Column(db.Text, nullable=False)
  693. # 乾燥桶_感測器_土壤三合一感測器
  694. class dry_tank_Soil(db.Model):
  695. __tablename__ = 'dry_tank_Soil'
  696. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  697. tank_num = db.Column(db.Text, nullable=False)
  698. soil_Temp = db.Column(db.Text, nullable=False)
  699. soil_Humidity = db.Column(db.Text, nullable=False)
  700. soil_EC = db.Column(db.Text, nullable=False)
  701. # 乾燥桶_感測器_大氣壓力
  702. class dry_tank_PA(db.Model):
  703. __tablename__ = 'dry_tank_PA'
  704. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  705. tank_num = db.Column(db.Text, nullable=False)
  706. PA = db.Column(db.Text, nullable=False)
  707. # 乾燥桶_感測器_超音波感測器
  708. class dry_tank_UltraSonic(db.Model):
  709. __tablename__ = 'dry_tank_UltraSonic'
  710. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  711. tank_num = db.Column(db.Text, nullable=False)
  712. UltraSonic = db.Column(db.Text, nullable=False)
  713. # 乾燥桶出料_感測器_超音波感測器
  714. class dry_output_sensor(db.Model):
  715. __tablename__ = 'dry_output_sensor'
  716. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  717. tank_num = db.Column(db.Text, nullable=False)
  718. UltraSonic = db.Column(db.Text, nullable=False)
  719. # 乾燥桶入料_排程設定
  720. class set_dry_input(db.Model):
  721. __tablename__ = 'set_dry_input'
  722. sn = db.Column(db.Integer, primary_key=True)
  723. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  724. input_height = db.Column(db.Text, nullable=False)
  725. input_entertime = db.Column(db.Text, nullable=False)
  726. input_exittime = db.Column(db.Text, nullable=False)
  727. tank_height = db.Column(db.Text, nullable=False)
  728. # 乾燥桶入料_致動器_真空吸料機
  729. class dry_input_brake(db.Model):
  730. __tablename__ = 'dry_input_brake'
  731. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  732. tank_num = db.Column(db.Text, nullable=False)
  733. vacuum = db.Column(db.Integer, nullable=False)
  734. #乾燥桶_致動器_ALL
  735. class dry_tank_brake(db.Model):
  736. __tablename__ = 'dry_tank_brake'
  737. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  738. tank_num = db.Column(db.Text, nullable=False)
  739. vacuum = db.Column(db.Integer, nullable=False)
  740. threewayvalve_input = db.Column(db.Integer, nullable=False)
  741. threewayvalve_bean = db.Column(db.Integer, nullable=False)
  742. diskvalve = db.Column(db.Integer, nullable=False)
  743. solenoid_disinfect = db.Column(db.Integer, nullable=False)
  744. solenoid_water = db.Column(db.Integer, nullable=False)
  745. solenoid_outer_water = db.Column(db.Integer, nullable=False)
  746. motor = db.Column(db.Integer, nullable=False)
  747. blower = db.Column(db.Integer, nullable=False)
  748. heater1 = db.Column(db.Integer, nullable=False)
  749. heater2 = db.Column(db.Integer, nullable=False)
  750. temp1_enable = db.Column(db.Integer, nullable=False)
  751. temp1 = db.Column(db.Float, nullable=False)
  752. # 乾燥桶出料_致動器_真空吸料機
  753. class dry_output_brake(db.Model):
  754. __tablename__ = 'dry_output_brake'
  755. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  756. tank_num = db.Column(db.Text, nullable=False)
  757. vacuum = db.Column(db.Integer, nullable=False)
  758. # ////////////////////////////////////////////////////////////////////////////////
  759. # 發酵槽
  760. # 發酵槽_發酵貨櫃入料儲豆槽_超音波感測器
  761. class ferment_input_UltraSonic(db.Model):
  762. __tablename__ = 'ferment_input_UltraSonic'
  763. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  764. tank_num = db.Column(db.Text, nullable=False)
  765. UltraSonic = db.Column(db.Text, nullable=False)
  766. # 發酵槽_發酵貨櫃入料儲豆槽_致動器
  767. class ferment_input_actuator(db.Model):
  768. __tablename__ = 'ferment_input_actuator'
  769. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  770. tank_num = db.Column(db.Text, nullable=False)
  771. vacuum = db.Column(db.Integer, nullable=False)
  772. # 發酵槽_感測器_SHT11
  773. class ferment_tank_SHT11(db.Model):
  774. __tablename__ = 'ferment_tank_SHT11'
  775. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  776. tank_num = db.Column(db.Text, nullable=False)
  777. SHT11_Temp = db.Column(db.Text, nullable=False)
  778. SHT11_Humidity = db.Column(db.Text, nullable=False)
  779. # 發酵槽_感測器_二氧化碳
  780. class ferment_tank_CO2(db.Model):
  781. __tablename__ = 'ferment_tank_CO2'
  782. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  783. tank_num = db.Column(db.Text, nullable=False)
  784. CO2 = db.Column(db.Text, nullable=False)
  785. # 發酵槽_感測器_PH
  786. class ferment_tank_PH(db.Model):
  787. __tablename__ = 'ferment_tank_PH'
  788. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  789. tank_num = db.Column(db.Text, nullable=False)
  790. PH = db.Column(db.Text, nullable=False)
  791. # 發酵槽_感測器_ORP
  792. class ferment_tank_ORP(db.Model):
  793. __tablename__ = 'ferment_tank_ORP'
  794. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  795. tank_num = db.Column(db.Text, nullable=False)
  796. ORP = db.Column(db.Text, nullable=False)
  797. # 發酵槽_感測器_DO
  798. class ferment_tank_DO(db.Model):
  799. __tablename__ = 'ferment_tank_DO'
  800. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  801. tank_num = db.Column(db.Text, nullable=False)
  802. DO = db.Column(db.Text, nullable=False)
  803. # 發酵槽_感測器_EC
  804. class ferment_tank_EC(db.Model):
  805. __tablename__ = 'ferment_tank_EC'
  806. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  807. tank_num = db.Column(db.Text, nullable=False)
  808. EC = db.Column(db.Text, nullable=False)
  809. # 發酵槽_感測器_PA
  810. class ferment_tank_PA(db.Model):
  811. __tablename__ = 'ferment_tank_PA'
  812. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  813. tank_num = db.Column(db.Text, nullable=False)
  814. PA = db.Column(db.Text, nullable=False)
  815. # 發酵槽保溫夾層_感測器_保溫夾層水位計
  816. class ferment_tank_WaterLevel(db.Model):
  817. __tablename__ = 'ferment_tank_WaterLevel'
  818. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  819. tank_num = db.Column(db.Text, nullable=False)
  820. WaterLevel = db.Column(db.Text, nullable=False)
  821. # 發酵槽_感測器_超音波感測器
  822. class ferment_tank_UltraSonic(db.Model):
  823. __tablename__ = 'ferment_tank_UltraSonic'
  824. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  825. tank_num = db.Column(db.Text, nullable=False)
  826. UltraSonic = db.Column(db.Text, nullable=False)
  827. # 發酵槽_感測器_咖啡生豆高度
  828. class ferment_tank_LiDAR(db.Model):
  829. __tablename__ = 'ferment_tank_LiDAR'
  830. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  831. tank_num = db.Column(db.Text, nullable=False)
  832. LiDAR = db.Column(db.Text, nullable=False)
  833. # 發酵槽_感測器_水位高度
  834. class ferment_tank_PressureWaterLevel(db.Model):
  835. __tablename__ = 'ferment_tank_PressureWaterLevel'
  836. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  837. tank_num = db.Column(db.Text, nullable=False)
  838. PressureWaterLevel = db.Column(db.Text, nullable=False)
  839. # 發酵槽_感測器_馬達編碼器
  840. class ferment_tank_motorEncoder(db.Model):
  841. __tablename__ = 'ferment_tank_motorEncoder'
  842. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  843. tank_num = db.Column(db.Text, nullable=False)
  844. motorEncoder = db.Column(db.Text, nullable=False)
  845. # 發酵槽_致動器
  846. class ferment_tank_actuator(db.Model):
  847. __tablename__ = 'ferment_tank_actuator'
  848. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  849. tank_num = db.Column(db.Text, nullable=False)
  850. vacuum = db.Column(db.Integer, nullable=False)
  851. threewayvalve_input = db.Column(db.Integer, nullable=False)
  852. diskvalve = db.Column(db.Integer, nullable=False)
  853. solenoid_tank_pump = db.Column(db.Integer, nullable=False)
  854. solenoid_tank_disinfect = db.Column(db.Integer, nullable=False)
  855. solenoid_outer_water = db.Column(db.Integer, nullable=False)
  856. solenoid_tank_water_in = db.Column(db.Integer, nullable=False)
  857. solenoid_tank_water_out = db.Column(db.Integer, nullable=False)
  858. pump_sensor = db.Column(db.Integer, nullable=False)
  859. threewayvalve_outer_float = db.Column(db.Integer, nullable=False)
  860. motor = db.Column(db.Integer, nullable=False)
  861. heater1 = db.Column(db.Integer, nullable=False)
  862. heater2 = db.Column(db.Integer, nullable=False)
  863. temp_enable = db.Column(db.Integer, nullable=False)
  864. temp = db.Column(db.Integer, nullable=False)
  865. # 發酵槽_發酵貨櫃出料儲豆槽_感測器
  866. class ferment_output_UltraSonic(db.Model):
  867. __tablename__ = 'ferment_output_UltraSonic'
  868. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  869. tank_num = db.Column(db.Text, nullable=False)
  870. UltraSonic = db.Column(db.Text, nullable=False)
  871. # 發酵槽_發酵貨櫃出料儲豆槽_致動器
  872. class ferment_output_actuator(db.Model):
  873. __tablename__ = 'ferment_output_actuator'
  874. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  875. tank_num = db.Column(db.Text, nullable=False)
  876. vacuum = db.Column(db.Integer, nullable=False)
  877. # 發酵槽_發酵貨櫃自動化狀態判斷
  878. class ferment_container_status(db.Model):
  879. __tablename__ = 'ferment_container_status'
  880. sn = db.Column(db.Integer, primary_key=True)
  881. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  882. Ferment_Input_1 = db.Column(db.Text, nullable=False)
  883. Ferment_Input_2 = db.Column(db.Text, nullable=False)
  884. Ferment_Tank_1 = db.Column(db.Text, nullable=False)
  885. Ferment_Tank_2 = db.Column(db.Text, nullable=False)
  886. Ferment_Tank_3 = db.Column(db.Text, nullable=False)
  887. Ferment_Tank_4 = db.Column(db.Text, nullable=False)
  888. Ferment_Tank_5 = db.Column(db.Text, nullable=False)
  889. Ferment_Tank_6 = db.Column(db.Text, nullable=False)
  890. Ferment_Tank_7 = db.Column(db.Text, nullable=False)
  891. Ferment_Tank_8 = db.Column(db.Text, nullable=False)
  892. Ferment_Tank_9 = db.Column(db.Text, nullable=False)
  893. Ferment_Tank_10 = db.Column(db.Text, nullable=False)
  894. Ferment_Tank_11 = db.Column(db.Text, nullable=False)
  895. Ferment_Tank_12 = db.Column(db.Text, nullable=False)
  896. Ferment_Output_1 = db.Column(db.Text, nullable=False)
  897. Ferment_Output_2 = db.Column(db.Text, nullable=False)
  898. # 乾燥槽_乾燥貨櫃自動化狀態判斷
  899. class dry_container_status(db.Model):
  900. __tablename__ = 'dry_container_status'
  901. sn = db.Column(db.Integer, primary_key=True)
  902. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  903. Dry_Input_1 = db.Column(db.Text, nullable=False)
  904. Dry_Input_2 = db.Column(db.Text, nullable=False)
  905. Dry_Tank_1 = db.Column(db.Text, nullable=False)
  906. Dry_Tank_2 = db.Column(db.Text, nullable=False)
  907. Dry_Tank_3 = db.Column(db.Text, nullable=False)
  908. Dry_Tank_4 = db.Column(db.Text, nullable=False)
  909. Dry_Tank_5 = db.Column(db.Text, nullable=False)
  910. Dry_Tank_6 = db.Column(db.Text, nullable=False)
  911. Dry_Tank_7 = db.Column(db.Text, nullable=False)
  912. Dry_Tank_8 = db.Column(db.Text, nullable=False)
  913. Dry_Tank_9 = db.Column(db.Text, nullable=False)
  914. Dry_Tank_10 = db.Column(db.Text, nullable=False)
  915. Dry_Tank_11 = db.Column(db.Text, nullable=False)
  916. Dry_Tank_12 = db.Column(db.Text, nullable=False)
  917. Dry_Output_1 = db.Column(db.Text, nullable=False)
  918. Dry_Output_2 = db.Column(db.Text, nullable=False)
  919. # 乾燥槽_乾燥貨櫃自動化狀態判斷
  920. class clean_container_status(db.Model):
  921. __tablename__ = 'clean_container_status'
  922. sn = db.Column(db.Integer, primary_key=True)
  923. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  924. Clean_Input_1 = db.Column(db.Text, nullable=False)
  925. Clean_Input_2 = db.Column(db.Text, nullable=False)
  926. Clean_Tank_1 = db.Column(db.Text, nullable=False)
  927. Clean_Tank_2 = db.Column(db.Text, nullable=False)
  928. Clean_Tank_3 = db.Column(db.Text, nullable=False)
  929. Clean_Tank_4 = db.Column(db.Text, nullable=False)
  930. Reclaimed_Tank_1 = db.Column(db.Text, nullable=False)
  931. ColorSelect_Input_1 = db.Column(db.Text, nullable=False)
  932. ColorSelect_Input_2 = db.Column(db.Text, nullable=False)
  933. ColorSelect_Tank_1 = db.Column(db.Text, nullable=False)
  934. ColorSelect_Tank_2 = db.Column(db.Text, nullable=False)
  935. ColorSelect_Output_g1 = db.Column(db.Text, nullable=False)
  936. ColorSelect_Output_b1 = db.Column(db.Text, nullable=False)
  937. ColorSelect_Output_g2 = db.Column(db.Text, nullable=False)
  938. ColorSelect_Output_b2 = db.Column(db.Text, nullable=False)
  939. Peel_Tank_1 = db.Column(db.Text, nullable=False)
  940. Peel_Tank_2 = db.Column(db.Text, nullable=False)
  941. Peel_Output_1 = db.Column(db.Text, nullable=False)
  942. Peel_Output_2 = db.Column(db.Text, nullable=False)
  943. Peel_Output_b1 = db.Column(db.Text, nullable=False)
  944. # ////////////////////////////////////////////////////////////////////////////////
  945. # 清洗貨櫃
  946. # 清洗浮選槽_清洗貨櫃入料儲豆槽_致動器
  947. class clean_input_actuator(db.Model):
  948. __tablename__ = 'clean_input_actuator'
  949. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  950. tank_num = db.Column(db.Text, nullable=False)
  951. vacuum = db.Column(db.Integer, nullable=False)
  952. # 清洗浮選槽_致動器 (old)
  953. class clean_tank_actuator(db.Model):
  954. __tablename__ = 'clean_tank_actuator'
  955. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  956. tank_num = db.Column(db.Text, nullable=False)
  957. vacuum = db.Column(db.Integer, nullable=False)
  958. pump_waterInput = db.Column(db.Integer, nullable=False)
  959. pump_waterL2L3 = db.Column(db.Integer, nullable=False)
  960. pump_waterL4L5 = db.Column(db.Integer, nullable=False)
  961. solenoid_waterL2L3 = db.Column(db.Integer, nullable=False)
  962. solenoid_waterL4L5 = db.Column(db.Integer, nullable=False)
  963. stepping_motor = db.Column(db.Text, nullable=False)
  964. # 清洗浮選槽_致動器 (new)
  965. class cleann_tank_actuator(db.Model):
  966. __tablename__ = 'cleann_tank_actuator'
  967. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  968. tank_num = db.Column(db.Text, nullable=False)
  969. vacuum = db.Column(db.Integer, nullable=False)
  970. threewayvalve_input = db.Column(db.Integer, nullable=False)
  971. motor = db.Column(db.Integer, nullable=False)
  972. solenoid_reclaimed_in = db.Column(db.Integer, nullable=False)
  973. solenoid_water_in = db.Column(db.Integer, nullable=False)
  974. pump_water_in = db.Column(db.Integer, nullable=False)
  975. solenoid_water_out = db.Column(db.Integer, nullable=False)
  976. solenoid_reclaimed_out = db.Column(db.Integer, nullable=False)
  977. solenoid_disinfect = db.Column(db.Integer, nullable=False)
  978. pump_disinfect = db.Column(db.Integer, nullable=False)
  979. diskvalve = db.Column(db.Integer, nullable=False)
  980. # 清洗浮選槽_清洗貨櫃出料儲豆槽_致動器
  981. class clean_output_actuator(db.Model):
  982. __tablename__ = 'clean_output_actuator'
  983. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  984. tank_num = db.Column(db.Text, nullable=False)
  985. vacuum = db.Column(db.Integer, nullable=False)
  986. # 清洗浮選槽_感測器
  987. class clean_tank_UltraSonic(db.Model):
  988. __tablename__ = 'clean_tank_UltraSonic'
  989. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  990. tank_num = db.Column(db.Text, nullable=False)
  991. UltraSonic = db.Column(db.Text, nullable=False)
  992. class clean_tank_Encoder(db.Model):
  993. __tablename__ = 'clean_tank_Encoder'
  994. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  995. tank_num = db.Column(db.Text, nullable=False)
  996. Encoder = db.Column(db.Text, nullable=False)
  997. class clean_tank_Turbidity(db.Model):
  998. __tablename__ = 'clean_tank_Turbidity'
  999. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1000. tank_num = db.Column(db.Text, nullable=False)
  1001. tankTurbidity = db.Column(db.Text, nullable=False)
  1002. class clean_filter_Turbidity(db.Model):
  1003. __tablename__ = 'clean_filter_Turbidity'
  1004. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1005. tank_num = db.Column(db.Text, nullable=False)
  1006. filterTurbidity = db.Column(db.Text, nullable=False)
  1007. # 脫皮機_清洗貨櫃入料儲豆槽_致動器
  1008. class peel_input_actuator(db.Model):
  1009. __tablename__ = 'peel_input_actuator'
  1010. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1011. tank_num = db.Column(db.Text, nullable=False)
  1012. vacuum = db.Column(db.Integer, nullable=False)
  1013. # 脫皮機_致動器
  1014. class peel_tank_actuator(db.Model):
  1015. __tablename__ = 'peel_tank_actuator'
  1016. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1017. tank_num = db.Column(db.Text, nullable=False)
  1018. vacuum = db.Column(db.Integer, nullable=False)
  1019. motor = db.Column(db.Integer, nullable=False)
  1020. # 脫皮機_感測器
  1021. class peel_output_UltraSonic(db.Model):
  1022. __tablename__ = 'peel_output_UltraSonic'
  1023. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1024. tank_num = db.Column(db.Text, nullable=False)
  1025. UltraSonic = db.Column(db.Text, nullable=False)
  1026. class peel_output_motorEncoder(db.Model):
  1027. __tablename__ = 'peel_output_motorEncoder'
  1028. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1029. tank_num = db.Column(db.Text, nullable=False)
  1030. motorEncoder = db.Column(db.Text, nullable=False)
  1031. # 脫皮機_清洗貨櫃出料儲豆槽_致動器
  1032. class peel_output_actuator(db.Model):
  1033. __tablename__ = 'peel_output_actuator'
  1034. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1035. tank_num = db.Column(db.Text, nullable=False)
  1036. vacuum = db.Column(db.Integer, nullable=False)
  1037. # 色選機_清洗貨櫃出料儲豆槽_致動器
  1038. class colorselect_output_actuator(db.Model):
  1039. __tablename__ = 'colorselect_output_actuator'
  1040. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1041. tank_num = db.Column(db.Text, nullable=False)
  1042. vacuum = db.Column(db.Integer, nullable=False)
  1043. class colorselect_tank_actuator(db.Model):
  1044. __tablename__ = 'colorselect_tank_actuator'
  1045. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1046. tank_num = db.Column(db.Text, nullable=False)
  1047. vacuum = db.Column(db.Integer, nullable=False)
  1048. motor = db.Column(db.Integer, nullable=False)
  1049. nozzle = db.Column(db.Integer, nullable=False)
  1050. class colorselect_tank_color(db.Model):
  1051. __tablename__ = 'colorselect_tank_color'
  1052. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1053. tank_num = db.Column(db.Text, nullable=False)
  1054. color = db.Column(db.Integer, nullable=False)
  1055. class colorselect_tank_UltraSonic(db.Model):
  1056. __tablename__ = 'colorselect_tank_UltraSonic'
  1057. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1058. tank_num = db.Column(db.Text, nullable=False)
  1059. UltraSonic = db.Column(db.Integer, nullable=False)
  1060. # 中水桶_致動器
  1061. class reclaimed_tank_actuator(db.Model):
  1062. __tablename__ = 'reclaimed_tank_actuator'
  1063. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1064. tank_num = db.Column(db.Text, nullable=False)
  1065. solenoid_water_in = db.Column(db.Integer, nullable=False)
  1066. solenoid_water_out = db.Column(db.Integer, nullable=False)
  1067. solenoid_reclaimed_out = db.Column(db.Integer, nullable=False)
  1068. pump_reclaimed_out = db.Column(db.Integer, nullable=False)
  1069. # ////////////////////////////////////////////////////////////////////////////////
  1070. # #發酵槽溫度感測器表
  1071. # class TankTemSensor(db.Model):
  1072. # __tablename__ = 'tank_tem_sensor'
  1073. # sn = db.Column(db.Integer, primary_key=True)
  1074. # datetime = db.Column(db.DateTime, nullable=False)
  1075. # tank_num = db.Column(db.Integer, nullable=False)
  1076. # tem = db.Column(db.Text, nullable=False)
  1077. # #發酵槽二氧化碳感測器表
  1078. # class TankCO2Sensor(db.Model):
  1079. # __tablename__ = 'tank_co2_sensor'
  1080. # sn = db.Column(db.Integer, primary_key=True)
  1081. # datetime = db.Column(db.DateTime, nullable=False)
  1082. # tank_num = db.Column(db.Integer, nullable=False)
  1083. # co2 = db.Column(db.Text, nullable=False)
  1084. # #發酵槽酸鹼值感測器表
  1085. # class TankPHSensor(db.Model):
  1086. # __tablename__ = 'tank_ph_sensor'
  1087. # sn = db.Column(db.Integer, primary_key=True)
  1088. # datetime = db.Column(db.DateTime, nullable=False)
  1089. # tank_num = db.Column(db.Integer, nullable=False)
  1090. # ph = db.Column(db.Text, nullable=False)
  1091. # #發酵槽酸鹼值感測器表
  1092. # class TankECSensor(db.Model):
  1093. # __tablename__ = 'tank_ec_sensor'
  1094. # sn = db.Column(db.Integer, primary_key=True)
  1095. # datetime = db.Column(db.DateTime, nullable=False)
  1096. # tank_num = db.Column(db.Integer, nullable=False)
  1097. # ec = db.Column(db.Text, nullable=False)
  1098. # #發酵槽超音波感測器表
  1099. # class TankSonicSensor(db.Model):
  1100. # __tablename__ = 'tank_sonic_sensor'
  1101. # sn = db.Column(db.Integer, primary_key=True)
  1102. # datetime = db.Column(db.DateTime, nullable=False)
  1103. # tank_num = db.Column(db.Integer, nullable=False)
  1104. # sonic = db.Column(db.Text, nullable=False)
  1105. # class BeanValve(db.Model):
  1106. # __tablename__ = 'bean_valve'
  1107. # sn = db.Column(db.Integer, primary_key=True)
  1108. # datetime = db.Column(db.DateTime, nullable=False)
  1109. # duration = db.Column(db.Text, nullable=False)
  1110. # start = db.Column(db.Text, nullable=False)
  1111. # end = db.Column(db.Text, nullable=False)
  1112. # class WashMachine(db.Model):
  1113. # __tablename__ = 'wash_machine'
  1114. # sn = db.Column(db.Integer, primary_key=True)
  1115. # datetime = db.Column(db.DateTime, nullable=False)
  1116. # duration = db.Column(db.Text, nullable=False)
  1117. # start = db.Column(db.Text, nullable=False)
  1118. # end = db.Column(db.Text, nullable=False)
  1119. # class ConveyorBelt1(db.Model):
  1120. # __tablename__ = 'conveyor_belt1'
  1121. # sn = db.Column(db.Integer, primary_key=True)
  1122. # datetime = db.Column(db.DateTime, nullable=False)
  1123. # duration = db.Column(db.Text, nullable=False)
  1124. # start = db.Column(db.Text, nullable=False)
  1125. # end = db.Column(db.Text, nullable=False)
  1126. # class Cargo1Disinfect(db.Model):
  1127. # __tablename__ = 'cargo1_disinfect'
  1128. # sn = db.Column(db.Integer, primary_key=True)
  1129. # datetime = db.Column(db.DateTime, nullable=False)
  1130. # duration = db.Column(db.Text, nullable=False)
  1131. # start = db.Column(db.Text, nullable=False)
  1132. # end = db.Column(db.Text, nullable=False)
  1133. # class ColorMachine(db.Model):
  1134. # __tablename__ = 'color_machine'
  1135. # sn = db.Column(db.Integer, primary_key=True)
  1136. # datetime = db.Column(db.DateTime, nullable=False)
  1137. # duration = db.Column(db.Text, nullable=False)
  1138. # start = db.Column(db.Text, nullable=False)
  1139. # end = db.Column(db.Text, nullable=False)
  1140. # class ConveyorBelt2(db.Model):
  1141. # __tablename__ = 'conveyor_belt2'
  1142. # sn = db.Column(db.Integer, primary_key=True)
  1143. # datetime = db.Column(db.DateTime, nullable=False)
  1144. # duration = db.Column(db.Text, nullable=False)
  1145. # start = db.Column(db.Text, nullable=False)
  1146. # end = db.Column(db.Text, nullable=False)
  1147. # class PeelingMachine(db.Model):
  1148. # __tablename__ = 'peeling_machine'
  1149. # sn = db.Column(db.Integer, primary_key=True)
  1150. # datetime = db.Column(db.DateTime, nullable=False)
  1151. # duration = db.Column(db.Text, nullable=False)
  1152. # start = db.Column(db.Text, nullable=False)
  1153. # end = db.Column(db.Text, nullable=False)
  1154. # class ConveyorBelt3(db.Model):
  1155. # __tablename__ = 'conveyor_belt3'
  1156. # sn = db.Column(db.Integer, primary_key=True)
  1157. # datetime = db.Column(db.DateTime, nullable=False)
  1158. # duration = db.Column(db.Text, nullable=False)
  1159. # start = db.Column(db.Text, nullable=False)
  1160. # end = db.Column(db.Text, nullable=False)
  1161. # class Bacteria(db.Model):
  1162. # __tablename__ = 'bacteria'
  1163. # sn = db.Column(db.Integer, primary_key=True)
  1164. # datetime = db.Column(db.DateTime, nullable=False)
  1165. # tank_num = db.Column(db.Integer, nullable=False)
  1166. # duration = db.Column(db.Text, nullable=False)
  1167. # start = db.Column(db.Text, nullable=False)
  1168. # end = db.Column(db.Text, nullable=False)
  1169. # class Cargo2Disinfect(db.Model):
  1170. # __tablename__ = 'cargo2_disinfect'
  1171. # sn = db.Column(db.Integer, primary_key=True)
  1172. # datetime = db.Column(db.DateTime, nullable=False)
  1173. # tank_num = db.Column(db.Integer, nullable=False)
  1174. # duration = db.Column(db.Text, nullable=False)
  1175. # start = db.Column(db.Text, nullable=False)
  1176. # end = db.Column(db.Text, nullable=False)
  1177. # class Heating(db.Model):
  1178. # __tablename__ = 'heating'
  1179. # sn = db.Column(db.Integer, primary_key=True)
  1180. # datetime = db.Column(db.DateTime, nullable=False)
  1181. # tank_num = db.Column(db.Integer, nullable=False)
  1182. # duration = db.Column(db.Text, nullable=False)
  1183. # start = db.Column(db.Text, nullable=False)
  1184. # end = db.Column(db.Text, nullable=False)
  1185. # class Stir(db.Model):
  1186. # __tablename__ = 'stir'
  1187. # sn = db.Column(db.Integer, primary_key=True)
  1188. # datetime = db.Column(db.DateTime, nullable=False)
  1189. # tank_num = db.Column(db.Integer, nullable=False)
  1190. # duration = db.Column(db.Text, nullable=False)
  1191. # start = db.Column(db.Text, nullable=False)
  1192. # end = db.Column(db.Text, nullable=False)
  1193. # class WaterInjection(db.Model):
  1194. # __tablename__ = 'water_injection'
  1195. # sn = db.Column(db.Integer, primary_key=True)
  1196. # datetime = db.Column(db.DateTime, nullable=False)
  1197. # tank_num = db.Column(db.Integer, nullable=False)
  1198. # duration = db.Column(db.Text, nullable=False)
  1199. # start = db.Column(db.Text, nullable=False)
  1200. # end = db.Column(db.Text, nullable=False)
  1201. # class TopValve(db.Model):
  1202. # __tablename__ = 'top_valve'
  1203. # sn = db.Column(db.Integer, primary_key=True)
  1204. # datetime = db.Column(db.DateTime, nullable=False)
  1205. # tank_num = db.Column(db.Integer, nullable=False)
  1206. # duration = db.Column(db.Text, nullable=False)
  1207. # start = db.Column(db.Text, nullable=False)
  1208. # end = db.Column(db.Text, nullable=False)
  1209. # class BottomValve(db.Model):
  1210. # __tablename__ = 'bottom_valve'
  1211. # sn = db.Column(db.Integer, primary_key=True)
  1212. # datetime = db.Column(db.DateTime, nullable=False)
  1213. # tank_num = db.Column(db.Integer, nullable=False)
  1214. # duration = db.Column(db.Text, nullable=False)
  1215. # start = db.Column(db.Text, nullable=False)
  1216. # end = db.Column(db.Text, nullable=False)
  1217. # class Temperature(db.Model):
  1218. # __tablename__ = 'temperature'
  1219. # sn = db.Column(db.Integer, primary_key=True)
  1220. # datetime = db.Column(db.DateTime, nullable=False)
  1221. # tank_num = db.Column(db.Integer, nullable=False)
  1222. # duration = db.Column(db.Text, nullable=False)
  1223. # start = db.Column(db.Text, nullable=False)
  1224. # end = db.Column(db.Text, nullable=False)
  1225. # class Hoist(db.Model):
  1226. # __tablename__ = 'hoist'
  1227. # sn = db.Column(db.Integer, primary_key=True)
  1228. # datetime = db.Column(db.DateTime, nullable=False)
  1229. # duration = db.Column(db.Text, nullable=False)
  1230. # start = db.Column(db.Text, nullable=False)
  1231. # end = db.Column(db.Text, nullable=False)
  1232. # class Dryer(db.Model):
  1233. # __tablename__ = 'dryer'
  1234. # sn = db.Column(db.Integer, primary_key=True)
  1235. # datetime = db.Column(db.DateTime, nullable=False)
  1236. # duration = db.Column(db.Text, nullable=False)
  1237. # start = db.Column(db.Text, nullable=False)
  1238. # end = db.Column(db.Text, nullable=False)
  1239. # class Relay(db.Model):
  1240. # __tablename__ = 'relay'
  1241. # sn = db.Column(db.Integer, primary_key=True)
  1242. # datetime = db.Column(db.DateTime, nullable=False)
  1243. # tank_num = db.Column(db.Integer, nullable=False)
  1244. # status= db.Column(db.Text, nullable=False)
  1245. # class PeelingMachineRPM(db.Model):
  1246. # __tablename__ = 'peeling_machine_rpm'
  1247. # sn = db.Column(db.Integer, primary_key=True)
  1248. # datetime = db.Column(db.DateTime, nullable=False)
  1249. # tank_num = db.Column(db.Integer, nullable=False)
  1250. # rpm = db.Column(db.Text, nullable=False)
  1251. # class StirRPM(db.Model):
  1252. # __tablename__ = 'stir_rpm'
  1253. # sn = db.Column(db.Integer, primary_key=True)
  1254. # datetime = db.Column(db.DateTime, nullable=False)
  1255. # tank_num = db.Column(db.Integer, nullable=False)
  1256. # rpm = db.Column(db.Text, nullable=False)
  1257. db.create_all()