models.py 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394
  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 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. # 乾燥桶_感測器_SHT11 本機測試
  694. class dry_tank_sht11(db.Model):
  695. __tablename__ = 'dry_tank_sht11'
  696. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  697. tank_num = db.Column(db.Text, nullable=False)
  698. SHT11_Temp = db.Column(db.Text, nullable=False)
  699. SHT11_Humidity = db.Column(db.Text, nullable=False)
  700. # 乾燥桶_感測器_土壤三合一感測器
  701. class dry_tank_Soil(db.Model):
  702. __tablename__ = 'dry_tank_Soil'
  703. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  704. tank_num = db.Column(db.Text, nullable=False)
  705. soil_Temp = db.Column(db.Text, nullable=False)
  706. soil_Humidity = db.Column(db.Text, nullable=False)
  707. soil_EC = db.Column(db.Text, nullable=False)
  708. # 乾燥桶_感測器_大氣壓力
  709. class dry_tank_PA(db.Model):
  710. __tablename__ = 'dry_tank_PA'
  711. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  712. tank_num = db.Column(db.Text, nullable=False)
  713. PA = db.Column(db.Text, nullable=False)
  714. # 乾燥桶_感測器_超音波感測器
  715. class dry_tank_UltraSonic(db.Model):
  716. __tablename__ = 'dry_tank_UltraSonic'
  717. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  718. tank_num = db.Column(db.Text, nullable=False)
  719. UltraSonic = db.Column(db.Text, nullable=False)
  720. # 乾燥桶出料_感測器_超音波感測器
  721. class dry_output_sensor(db.Model):
  722. __tablename__ = 'dry_output_sensor'
  723. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  724. tank_num = db.Column(db.Text, nullable=False)
  725. UltraSonic = db.Column(db.Text, nullable=False)
  726. # 乾燥桶入料_排程設定
  727. class set_dry_input(db.Model):
  728. __tablename__ = 'set_dry_input'
  729. sn = db.Column(db.Integer, primary_key=True)
  730. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  731. input_height = db.Column(db.Text, nullable=False)
  732. input_entertime = db.Column(db.Text, nullable=False)
  733. input_exittime = db.Column(db.Text, nullable=False)
  734. tank_height = db.Column(db.Text, nullable=False)
  735. # 乾燥桶入料_致動器_真空吸料機
  736. class dry_input_brake(db.Model):
  737. __tablename__ = 'dry_input_brake'
  738. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  739. tank_num = db.Column(db.Text, nullable=False)
  740. vacuum = db.Column(db.Integer, nullable=False)
  741. #乾燥桶_致動器_ALL
  742. class dry_tank_brake(db.Model):
  743. __tablename__ = 'dry_tank_brake'
  744. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  745. tank_num = db.Column(db.Text, nullable=False)
  746. vacuum = db.Column(db.Integer, nullable=False)
  747. threewayvalve_input = db.Column(db.Integer, nullable=False)
  748. threewayvalve_bean = db.Column(db.Integer, nullable=False)
  749. diskvalve = db.Column(db.Integer, nullable=False)
  750. solenoid_disinfect = db.Column(db.Integer, nullable=False)
  751. solenoid_water = db.Column(db.Integer, nullable=False)
  752. solenoid_outer_water = db.Column(db.Integer, nullable=False)
  753. motor = db.Column(db.Integer, nullable=False)
  754. blower = db.Column(db.Integer, nullable=False)
  755. heater1 = db.Column(db.Integer, nullable=False)
  756. heater2 = db.Column(db.Integer, nullable=False)
  757. temp1_enable = db.Column(db.Integer, nullable=False)
  758. temp1 = db.Column(db.Float, nullable=False)
  759. # 乾燥桶出料_致動器_真空吸料機
  760. class dry_output_brake(db.Model):
  761. __tablename__ = 'dry_output_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. # ////////////////////////////////////////////////////////////////////////////////
  766. # 發酵槽
  767. # 發酵槽_發酵貨櫃入料儲豆槽_超音波感測器
  768. class ferment_input_UltraSonic(db.Model):
  769. __tablename__ = 'ferment_input_UltraSonic'
  770. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  771. tank_num = db.Column(db.Text, nullable=False)
  772. UltraSonic = db.Column(db.Text, nullable=False)
  773. # 發酵槽_發酵貨櫃入料儲豆槽_致動器
  774. class ferment_input_actuator(db.Model):
  775. __tablename__ = 'ferment_input_actuator'
  776. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  777. tank_num = db.Column(db.Text, nullable=False)
  778. vacuum = db.Column(db.Integer, nullable=False)
  779. # 發酵槽_感測器_SHT11
  780. class ferment_tank_SHT11(db.Model):
  781. __tablename__ = 'ferment_tank_SHT11'
  782. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  783. tank_num = db.Column(db.Text, nullable=False)
  784. SHT11_Temp = db.Column(db.Text, nullable=False)
  785. SHT11_Humidity = db.Column(db.Text, nullable=False)
  786. # 發酵槽_感測器_二氧化碳
  787. class ferment_tank_CO2(db.Model):
  788. __tablename__ = 'ferment_tank_CO2'
  789. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  790. tank_num = db.Column(db.Text, nullable=False)
  791. CO2 = db.Column(db.Text, nullable=False)
  792. # 發酵槽_感測器_PH
  793. class ferment_tank_PH(db.Model):
  794. __tablename__ = 'ferment_tank_PH'
  795. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  796. tank_num = db.Column(db.Text, nullable=False)
  797. PH = db.Column(db.Text, nullable=False)
  798. # 發酵槽_感測器_ORP
  799. class ferment_tank_ORP(db.Model):
  800. __tablename__ = 'ferment_tank_ORP'
  801. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  802. tank_num = db.Column(db.Text, nullable=False)
  803. ORP = db.Column(db.Text, nullable=False)
  804. # 發酵槽_感測器_DO
  805. class ferment_tank_DO(db.Model):
  806. __tablename__ = 'ferment_tank_DO'
  807. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  808. tank_num = db.Column(db.Text, nullable=False)
  809. DO = db.Column(db.Text, nullable=False)
  810. # 發酵槽_感測器_EC
  811. class ferment_tank_EC(db.Model):
  812. __tablename__ = 'ferment_tank_EC'
  813. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  814. tank_num = db.Column(db.Text, nullable=False)
  815. EC = db.Column(db.Text, nullable=False)
  816. # 發酵槽_感測器_PA
  817. class ferment_tank_PA(db.Model):
  818. __tablename__ = 'ferment_tank_PA'
  819. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  820. tank_num = db.Column(db.Text, nullable=False)
  821. PA = db.Column(db.Text, nullable=False)
  822. # 發酵槽保溫夾層_感測器_保溫夾層水位計
  823. class ferment_tank_WaterLevel(db.Model):
  824. __tablename__ = 'ferment_tank_WaterLevel'
  825. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  826. tank_num = db.Column(db.Text, nullable=False)
  827. WaterLevel = db.Column(db.Text, nullable=False)
  828. # 發酵槽_感測器_超音波感測器
  829. class ferment_tank_UltraSonic(db.Model):
  830. __tablename__ = 'ferment_tank_UltraSonic'
  831. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  832. tank_num = db.Column(db.Text, nullable=False)
  833. UltraSonic = db.Column(db.Text, nullable=False)
  834. # 發酵槽_感測器_咖啡生豆高度
  835. class ferment_tank_LiDAR(db.Model):
  836. __tablename__ = 'ferment_tank_LiDAR'
  837. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  838. tank_num = db.Column(db.Text, nullable=False)
  839. LiDAR = db.Column(db.Text, nullable=False)
  840. # 發酵槽_感測器_水位高度
  841. class ferment_tank_PressureWaterLevel(db.Model):
  842. __tablename__ = 'ferment_tank_PressureWaterLevel'
  843. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  844. tank_num = db.Column(db.Text, nullable=False)
  845. PressureWaterLevel = db.Column(db.Text, nullable=False)
  846. # 發酵槽_感測器_馬達編碼器
  847. class ferment_tank_motorEncoder(db.Model):
  848. __tablename__ = 'ferment_tank_motorEncoder'
  849. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  850. tank_num = db.Column(db.Text, nullable=False)
  851. motorEncoder = db.Column(db.Text, nullable=False)
  852. # 發酵槽_致動器
  853. class ferment_tank_actuator(db.Model):
  854. __tablename__ = 'ferment_tank_actuator'
  855. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  856. tank_num = db.Column(db.Text, nullable=False)
  857. vacuum = db.Column(db.Integer, nullable=False)
  858. threewayvalve_input = db.Column(db.Integer, nullable=False)
  859. diskvalve = db.Column(db.Integer, nullable=False)
  860. solenoid_tank_pump = db.Column(db.Integer, nullable=False)
  861. solenoid_tank_disinfect = db.Column(db.Integer, nullable=False)
  862. solenoid_outer_water = db.Column(db.Integer, nullable=False)
  863. solenoid_tank_water_in = db.Column(db.Integer, nullable=False)
  864. solenoid_tank_water_out = db.Column(db.Integer, nullable=False)
  865. pump_sensor = db.Column(db.Integer, nullable=False)
  866. threewayvalve_outer_float = db.Column(db.Integer, nullable=False)
  867. motor = db.Column(db.Integer, nullable=False)
  868. heater1 = db.Column(db.Integer, nullable=False)
  869. heater2 = db.Column(db.Integer, nullable=False)
  870. temp_enable = db.Column(db.Integer, nullable=False)
  871. temp = db.Column(db.Integer, nullable=False)
  872. # 發酵槽_發酵貨櫃出料儲豆槽_感測器
  873. class ferment_output_UltraSonic(db.Model):
  874. __tablename__ = 'ferment_output_UltraSonic'
  875. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  876. tank_num = db.Column(db.Text, nullable=False)
  877. UltraSonic = db.Column(db.Text, nullable=False)
  878. # 發酵槽_發酵貨櫃出料儲豆槽_致動器
  879. class ferment_output_actuator(db.Model):
  880. __tablename__ = 'ferment_output_actuator'
  881. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  882. tank_num = db.Column(db.Text, nullable=False)
  883. vacuum = db.Column(db.Integer, nullable=False)
  884. # 發酵槽_發酵貨櫃自動化狀態判斷
  885. class ferment_container_status(db.Model):
  886. __tablename__ = 'ferment_container_status'
  887. sn = db.Column(db.Integer, primary_key=True)
  888. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  889. Ferment_Input_1 = db.Column(db.Text, nullable=False)
  890. Ferment_Input_2 = db.Column(db.Text, nullable=False)
  891. Ferment_Tank_1 = db.Column(db.Text, nullable=False)
  892. Ferment_Tank_2 = db.Column(db.Text, nullable=False)
  893. Ferment_Tank_3 = db.Column(db.Text, nullable=False)
  894. Ferment_Tank_4 = db.Column(db.Text, nullable=False)
  895. Ferment_Tank_5 = db.Column(db.Text, nullable=False)
  896. Ferment_Tank_6 = db.Column(db.Text, nullable=False)
  897. Ferment_Tank_7 = db.Column(db.Text, nullable=False)
  898. Ferment_Tank_8 = db.Column(db.Text, nullable=False)
  899. Ferment_Tank_9 = db.Column(db.Text, nullable=False)
  900. Ferment_Tank_10 = db.Column(db.Text, nullable=False)
  901. Ferment_Tank_11 = db.Column(db.Text, nullable=False)
  902. Ferment_Tank_12 = db.Column(db.Text, nullable=False)
  903. Ferment_Output_1 = db.Column(db.Text, nullable=False)
  904. Ferment_Output_2 = db.Column(db.Text, nullable=False)
  905. # 乾燥槽_乾燥貨櫃自動化狀態判斷
  906. class dry_container_status(db.Model):
  907. __tablename__ = 'dry_container_status'
  908. sn = db.Column(db.Integer, primary_key=True)
  909. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  910. Dry_Input_1 = db.Column(db.Text, nullable=False)
  911. Dry_Input_2 = db.Column(db.Text, nullable=False)
  912. Dry_Tank_1 = db.Column(db.Text, nullable=False)
  913. Dry_Tank_2 = db.Column(db.Text, nullable=False)
  914. Dry_Tank_3 = db.Column(db.Text, nullable=False)
  915. Dry_Tank_4 = db.Column(db.Text, nullable=False)
  916. Dry_Tank_5 = db.Column(db.Text, nullable=False)
  917. Dry_Tank_6 = db.Column(db.Text, nullable=False)
  918. Dry_Tank_7 = db.Column(db.Text, nullable=False)
  919. Dry_Tank_8 = db.Column(db.Text, nullable=False)
  920. Dry_Tank_9 = db.Column(db.Text, nullable=False)
  921. Dry_Tank_10 = db.Column(db.Text, nullable=False)
  922. Dry_Tank_11 = db.Column(db.Text, nullable=False)
  923. Dry_Tank_12 = db.Column(db.Text, nullable=False)
  924. Dry_Output_1 = db.Column(db.Text, nullable=False)
  925. Dry_Output_2 = db.Column(db.Text, nullable=False)
  926. # 清洗槽_清洗貨櫃自動化狀態判斷
  927. class clean_container_status(db.Model):
  928. __tablename__ = 'clean_container_status'
  929. sn = db.Column(db.Integer, primary_key=True)
  930. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False)
  931. Clean_Input_1 = db.Column(db.Text, nullable=False)
  932. Clean_Input_2 = db.Column(db.Text, nullable=False)
  933. Clean_Tank_1 = db.Column(db.Text, nullable=False)
  934. Clean_Tank_2 = db.Column(db.Text, nullable=False)
  935. Clean_Tank_3 = db.Column(db.Text, nullable=False)
  936. Clean_Tank_4 = db.Column(db.Text, nullable=False)
  937. Reclaimed_Tank_1 = db.Column(db.Text, nullable=False)
  938. ColorSelect_Input_1 = db.Column(db.Text, nullable=False)
  939. ColorSelect_Input_2 = db.Column(db.Text, nullable=False)
  940. ColorSelect_Tank_1 = db.Column(db.Text, nullable=False)
  941. ColorSelect_Tank_2 = db.Column(db.Text, nullable=False)
  942. ColorSelect_Output_g1 = db.Column(db.Text, nullable=False)
  943. ColorSelect_Output_b1 = db.Column(db.Text, nullable=False)
  944. ColorSelect_Output_g2 = db.Column(db.Text, nullable=False)
  945. ColorSelect_Output_b2 = db.Column(db.Text, nullable=False)
  946. Peel_Tank_1 = db.Column(db.Text, nullable=False)
  947. Peel_Tank_2 = db.Column(db.Text, nullable=False)
  948. Peel_Output_1 = db.Column(db.Text, nullable=False)
  949. Peel_Output_2 = db.Column(db.Text, nullable=False)
  950. Peel_Output_b1 = db.Column(db.Text, nullable=False)
  951. # ////////////////////////////////////////////////////////////////////////////////
  952. # 清洗貨櫃
  953. # 清洗浮選槽_清洗貨櫃入料儲豆槽_致動器
  954. class clean_input_actuator(db.Model):
  955. __tablename__ = 'clean_input_actuator'
  956. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  957. tank_num = db.Column(db.Text, nullable=False)
  958. vacuum = db.Column(db.Integer, nullable=False)
  959. # 清洗浮選槽_致動器 (old)
  960. class clean_tank_actuator(db.Model):
  961. __tablename__ = 'clean_tank_actuator'
  962. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  963. tank_num = db.Column(db.Text, nullable=False)
  964. vacuum = db.Column(db.Integer, nullable=False)
  965. pump_waterInput = db.Column(db.Integer, nullable=False)
  966. pump_waterL2L3 = db.Column(db.Integer, nullable=False)
  967. pump_waterL4L5 = db.Column(db.Integer, nullable=False)
  968. solenoid_waterL2L3 = db.Column(db.Integer, nullable=False)
  969. solenoid_waterL4L5 = db.Column(db.Integer, nullable=False)
  970. stepping_motor = db.Column(db.Text, nullable=False)
  971. # 清洗浮選槽_致動器 (new)
  972. class cleann_tank_actuator(db.Model):
  973. __tablename__ = 'cleann_tank_actuator'
  974. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  975. tank_num = db.Column(db.Text, nullable=False)
  976. vacuum = db.Column(db.Integer, nullable=False)
  977. threewayvalve_input = db.Column(db.Integer, nullable=False)
  978. motor = db.Column(db.Integer, nullable=False)
  979. solenoid_reclaimed_in = db.Column(db.Integer, nullable=False)
  980. solenoid_water_in = db.Column(db.Integer, nullable=False)
  981. pump_water_in = db.Column(db.Integer, nullable=False)
  982. solenoid_water_out = db.Column(db.Integer, nullable=False)
  983. solenoid_reclaimed_out = db.Column(db.Integer, nullable=False)
  984. solenoid_disinfect = db.Column(db.Integer, nullable=False)
  985. pump_disinfect = db.Column(db.Integer, nullable=False)
  986. diskvalve = db.Column(db.Integer, nullable=False)
  987. # 清洗浮選槽_清洗貨櫃出料儲豆槽_致動器
  988. class clean_output_actuator(db.Model):
  989. __tablename__ = 'clean_output_actuator'
  990. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  991. tank_num = db.Column(db.Text, nullable=False)
  992. vacuum = db.Column(db.Integer, nullable=False)
  993. # 清洗浮選槽_感測器
  994. class clean_tank_UltraSonic(db.Model):
  995. __tablename__ = 'clean_tank_UltraSonic'
  996. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  997. tank_num = db.Column(db.Text, nullable=False)
  998. UltraSonic = db.Column(db.Text, nullable=False)
  999. class clean_tank_Encoder(db.Model):
  1000. __tablename__ = 'clean_tank_Encoder'
  1001. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1002. tank_num = db.Column(db.Text, nullable=False)
  1003. Encoder = db.Column(db.Text, nullable=False)
  1004. class clean_tank_Turbidity(db.Model):
  1005. __tablename__ = 'clean_tank_Turbidity'
  1006. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1007. tank_num = db.Column(db.Text, nullable=False)
  1008. tankTurbidity = db.Column(db.Text, nullable=False)
  1009. class clean_filter_Turbidity(db.Model):
  1010. __tablename__ = 'clean_filter_Turbidity'
  1011. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1012. tank_num = db.Column(db.Text, nullable=False)
  1013. filterTurbidity = db.Column(db.Text, nullable=False)
  1014. # 脫皮機_清洗貨櫃入料儲豆槽_致動器
  1015. class peel_input_actuator(db.Model):
  1016. __tablename__ = 'peel_input_actuator'
  1017. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1018. tank_num = db.Column(db.Text, nullable=False)
  1019. vacuum = db.Column(db.Integer, nullable=False)
  1020. # 脫皮機_致動器
  1021. class peel_tank_actuator(db.Model):
  1022. __tablename__ = 'peel_tank_actuator'
  1023. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1024. tank_num = db.Column(db.Text, nullable=False)
  1025. vacuum = db.Column(db.Integer, nullable=False)
  1026. motor = db.Column(db.Integer, nullable=False)
  1027. # 脫皮機_感測器
  1028. class peel_output_UltraSonic(db.Model):
  1029. __tablename__ = 'peel_output_UltraSonic'
  1030. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1031. tank_num = db.Column(db.Text, nullable=False)
  1032. UltraSonic = db.Column(db.Text, nullable=False)
  1033. class peel_output_motorEncoder(db.Model):
  1034. __tablename__ = 'peel_output_motorEncoder'
  1035. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1036. tank_num = db.Column(db.Text, nullable=False)
  1037. motorEncoder = db.Column(db.Text, nullable=False)
  1038. # 脫皮機_清洗貨櫃出料儲豆槽_致動器
  1039. class peel_output_actuator(db.Model):
  1040. __tablename__ = 'peel_output_actuator'
  1041. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1042. tank_num = db.Column(db.Text, nullable=False)
  1043. vacuum = db.Column(db.Integer, nullable=False)
  1044. # 色選機_清洗貨櫃出料儲豆槽_致動器
  1045. class colorselect_output_actuator(db.Model):
  1046. __tablename__ = 'colorselect_output_actuator'
  1047. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1048. tank_num = db.Column(db.Text, nullable=False)
  1049. vacuum = db.Column(db.Integer, nullable=False)
  1050. class colorselect_tank_actuator(db.Model):
  1051. __tablename__ = 'colorselect_tank_actuator'
  1052. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1053. tank_num = db.Column(db.Text, nullable=False)
  1054. vacuum = db.Column(db.Integer, nullable=False)
  1055. motor = db.Column(db.Integer, nullable=False)
  1056. nozzle = db.Column(db.Integer, nullable=False)
  1057. class colorselect_tank_color(db.Model):
  1058. __tablename__ = 'colorselect_tank_color'
  1059. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1060. tank_num = db.Column(db.Text, nullable=False)
  1061. color = db.Column(db.Integer, nullable=False)
  1062. class colorselect_tank_UltraSonic(db.Model):
  1063. __tablename__ = 'colorselect_tank_UltraSonic'
  1064. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1065. tank_num = db.Column(db.Text, nullable=False)
  1066. UltraSonic = db.Column(db.Integer, nullable=False)
  1067. # 中水桶_致動器
  1068. class reclaimed_tank_actuator(db.Model):
  1069. __tablename__ = 'reclaimed_tank_actuator'
  1070. datetime = db.Column(db.DateTime, default=datetime.now(), nullable=False, primary_key=True)
  1071. tank_num = db.Column(db.Text, nullable=False)
  1072. solenoid_water_in = db.Column(db.Integer, nullable=False)
  1073. solenoid_water_out = db.Column(db.Integer, nullable=False)
  1074. solenoid_reclaimed_out = db.Column(db.Integer, nullable=False)
  1075. pump_reclaimed_out = db.Column(db.Integer, nullable=False)
  1076. # ////////////////////////////////////////////////////////////////////////////////
  1077. # #發酵槽溫度感測器表
  1078. # class TankTemSensor(db.Model):
  1079. # __tablename__ = 'tank_tem_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. # tem = db.Column(db.Text, nullable=False)
  1084. # #發酵槽二氧化碳感測器表
  1085. # class TankCO2Sensor(db.Model):
  1086. # __tablename__ = 'tank_co2_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. # co2 = db.Column(db.Text, nullable=False)
  1091. # #發酵槽酸鹼值感測器表
  1092. # class TankPHSensor(db.Model):
  1093. # __tablename__ = 'tank_ph_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. # ph = db.Column(db.Text, nullable=False)
  1098. # #發酵槽酸鹼值感測器表
  1099. # class TankECSensor(db.Model):
  1100. # __tablename__ = 'tank_ec_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. # ec = db.Column(db.Text, nullable=False)
  1105. # #發酵槽超音波感測器表
  1106. # class TankSonicSensor(db.Model):
  1107. # __tablename__ = 'tank_sonic_sensor'
  1108. # sn = db.Column(db.Integer, primary_key=True)
  1109. # datetime = db.Column(db.DateTime, nullable=False)
  1110. # tank_num = db.Column(db.Integer, nullable=False)
  1111. # sonic = db.Column(db.Text, nullable=False)
  1112. # class BeanValve(db.Model):
  1113. # __tablename__ = 'bean_valve'
  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 WashMachine(db.Model):
  1120. # __tablename__ = 'wash_machine'
  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 ConveyorBelt1(db.Model):
  1127. # __tablename__ = 'conveyor_belt1'
  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 Cargo1Disinfect(db.Model):
  1134. # __tablename__ = 'cargo1_disinfect'
  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 ColorMachine(db.Model):
  1141. # __tablename__ = 'color_machine'
  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 ConveyorBelt2(db.Model):
  1148. # __tablename__ = 'conveyor_belt2'
  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 PeelingMachine(db.Model):
  1155. # __tablename__ = 'peeling_machine'
  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 ConveyorBelt3(db.Model):
  1162. # __tablename__ = 'conveyor_belt3'
  1163. # sn = db.Column(db.Integer, primary_key=True)
  1164. # datetime = db.Column(db.DateTime, nullable=False)
  1165. # duration = db.Column(db.Text, nullable=False)
  1166. # start = db.Column(db.Text, nullable=False)
  1167. # end = db.Column(db.Text, nullable=False)
  1168. # class Bacteria(db.Model):
  1169. # __tablename__ = 'bacteria'
  1170. # sn = db.Column(db.Integer, primary_key=True)
  1171. # datetime = db.Column(db.DateTime, nullable=False)
  1172. # tank_num = db.Column(db.Integer, nullable=False)
  1173. # duration = db.Column(db.Text, nullable=False)
  1174. # start = db.Column(db.Text, nullable=False)
  1175. # end = db.Column(db.Text, nullable=False)
  1176. # class Cargo2Disinfect(db.Model):
  1177. # __tablename__ = 'cargo2_disinfect'
  1178. # sn = db.Column(db.Integer, primary_key=True)
  1179. # datetime = db.Column(db.DateTime, nullable=False)
  1180. # tank_num = db.Column(db.Integer, nullable=False)
  1181. # duration = db.Column(db.Text, nullable=False)
  1182. # start = db.Column(db.Text, nullable=False)
  1183. # end = db.Column(db.Text, nullable=False)
  1184. # class Heating(db.Model):
  1185. # __tablename__ = 'heating'
  1186. # sn = db.Column(db.Integer, primary_key=True)
  1187. # datetime = db.Column(db.DateTime, nullable=False)
  1188. # tank_num = db.Column(db.Integer, nullable=False)
  1189. # duration = db.Column(db.Text, nullable=False)
  1190. # start = db.Column(db.Text, nullable=False)
  1191. # end = db.Column(db.Text, nullable=False)
  1192. # class Stir(db.Model):
  1193. # __tablename__ = 'stir'
  1194. # sn = db.Column(db.Integer, primary_key=True)
  1195. # datetime = db.Column(db.DateTime, nullable=False)
  1196. # tank_num = db.Column(db.Integer, 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 WaterInjection(db.Model):
  1201. # __tablename__ = 'water_injection'
  1202. # sn = db.Column(db.Integer, primary_key=True)
  1203. # datetime = db.Column(db.DateTime, nullable=False)
  1204. # tank_num = db.Column(db.Integer, nullable=False)
  1205. # duration = db.Column(db.Text, nullable=False)
  1206. # start = db.Column(db.Text, nullable=False)
  1207. # end = db.Column(db.Text, nullable=False)
  1208. # class TopValve(db.Model):
  1209. # __tablename__ = 'top_valve'
  1210. # sn = db.Column(db.Integer, primary_key=True)
  1211. # datetime = db.Column(db.DateTime, nullable=False)
  1212. # tank_num = db.Column(db.Integer, nullable=False)
  1213. # duration = db.Column(db.Text, nullable=False)
  1214. # start = db.Column(db.Text, nullable=False)
  1215. # end = db.Column(db.Text, nullable=False)
  1216. # class BottomValve(db.Model):
  1217. # __tablename__ = 'bottom_valve'
  1218. # sn = db.Column(db.Integer, primary_key=True)
  1219. # datetime = db.Column(db.DateTime, nullable=False)
  1220. # tank_num = db.Column(db.Integer, nullable=False)
  1221. # duration = db.Column(db.Text, nullable=False)
  1222. # start = db.Column(db.Text, nullable=False)
  1223. # end = db.Column(db.Text, nullable=False)
  1224. # class Temperature(db.Model):
  1225. # __tablename__ = 'temperature'
  1226. # sn = db.Column(db.Integer, primary_key=True)
  1227. # datetime = db.Column(db.DateTime, nullable=False)
  1228. # tank_num = db.Column(db.Integer, 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 Hoist(db.Model):
  1233. # __tablename__ = 'hoist'
  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 Dryer(db.Model):
  1240. # __tablename__ = 'dryer'
  1241. # sn = db.Column(db.Integer, primary_key=True)
  1242. # datetime = db.Column(db.DateTime, 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 Relay(db.Model):
  1247. # __tablename__ = 'relay'
  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. # status= db.Column(db.Text, nullable=False)
  1252. # class PeelingMachineRPM(db.Model):
  1253. # __tablename__ = 'peeling_machine_rpm'
  1254. # sn = db.Column(db.Integer, primary_key=True)
  1255. # datetime = db.Column(db.DateTime, nullable=False)
  1256. # tank_num = db.Column(db.Integer, nullable=False)
  1257. # rpm = db.Column(db.Text, nullable=False)
  1258. # class StirRPM(db.Model):
  1259. # __tablename__ = 'stir_rpm'
  1260. # sn = db.Column(db.Integer, primary_key=True)
  1261. # datetime = db.Column(db.DateTime, nullable=False)
  1262. # tank_num = db.Column(db.Integer, nullable=False)
  1263. # rpm = db.Column(db.Text, nullable=False)
  1264. db.create_all()