models.py 66 KB

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