auto_C.html 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "base.html" %}
  3. {% block title %}{{ title }}{% endblock %}
  4. {% block script %}
  5. <script language="JavaScript">
  6. function myrefresh()
  7. {
  8. $.get('/clean_auto_data', function (resText) {
  9. var CI = [resText.CI1,resText.CI2];
  10. var C=[resText.C1,resText.C2,resText.C3,resText.C4];
  11. var R=[resText.R1];
  12. var S = [resText.S1,resText.S2];
  13. var SO = [resText.SO1,resText.SO2];
  14. var P = [resText.P1,resText.P2];
  15. var PO = [resText.PO1,resText.PO2];
  16. for (let i=0; i<2; i++) {
  17. if (CI[i] == 'CI_InputtingBean') {
  18. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  19. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 入豆中")
  20. } else if (CI[i] == 'CI_Waiting') {
  21. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  22. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 空桶等待")
  23. } else if (CI[i] == 'CI_OutputtingBean') {
  24. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  25. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 可出豆")
  26. } else if (CI[i] == 'CI_Stand_by') {
  27. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  28. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 待命")
  29. } else {
  30. console.log('pass')
  31. }
  32. }
  33. for (let i=0; i<4; i++) {
  34. if (C[i] == 'C_InputtingBean') {
  35. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  36. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 入豆中")
  37. } else if (C[i] == 'C_Waiting') {
  38. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  39. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 空桶等待")
  40. } else if (C[i] == 'C_InputtingWater') {
  41. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  42. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶入水中")
  43. } else if (C[i] == 'C_Cleaning') {
  44. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "plum")
  45. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 清洗中")
  46. } else if (C[i] == 'C_OutputtingWater') {
  47. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  48. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶排水中")
  49. } else if (C[i] == 'C_OutputtingBean') {
  50. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  51. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 可出豆")
  52. } else if (C[i] == 'C_Warning') {
  53. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "crimson")
  54. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 警告")
  55. } else if (C[i] == 'C_Stand_by') {
  56. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  57. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 待命")
  58. } else {
  59. console.log('pass')
  60. }
  61. }
  62. for (let i=0; i<1; i++) {
  63. if (R[i] == 'R_InputtingWater') {
  64. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  65. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 入水中")
  66. } else if (R[i] == 'R_Waiting') {
  67. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  68. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 空桶等待")
  69. } else if (R[i] == 'R_OutputtingWater') {
  70. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  71. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 排水中")
  72. } else if (R[i] == 'R_Stand_by') {
  73. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  74. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 待命")
  75. } else if (R[i] == 'R_Warning') {
  76. console.log('[動作] R桶警告 R' + parseInt(i+1) + ' 警告')
  77. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "crimson")
  78. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 警告")
  79. } else {
  80. console.log('pass')
  81. }
  82. }
  83. for (let i=0; i<2; i++) {
  84. if (S[i] == 'S_InputtingBean') {
  85. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  86. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 入豆中")
  87. } else if (S[i] == 'S_Waiting') {
  88. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  89. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 空桶等待")
  90. } else if (S[i] == 'S_OutputtingBean') {
  91. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  92. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 可出豆")
  93. } else if (S[i] == 'S_Stand_by') {
  94. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  95. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 待命")
  96. } else {
  97. console.log('pass')
  98. }
  99. }
  100. for (let i=0; i<2; i++) {
  101. if (SO[i] == 'SO_InputtingBean') {
  102. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  103. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 入豆中")
  104. } else if (SO[i] == 'SO_Waiting') {
  105. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  106. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 空桶等待")
  107. } else if (SO[i] == 'SO_OutputtingBean') {
  108. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  109. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 可出豆")
  110. } else if (SO[i] == 'SO_Stand_by') {
  111. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  112. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 待命")
  113. } else {
  114. console.log('pass')
  115. }
  116. }
  117. for (let i=0; i<2; i++) {
  118. if (P[i] == 'P_InputtingBean') {
  119. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  120. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 入豆中")
  121. } else if (P[i] == 'P_Waiting') {
  122. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  123. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 空桶等待")
  124. } else if (P[i] == 'P_OutputtingBean') {
  125. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  126. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 可出豆")
  127. } else if (P[i] == 'P_Stand_by') {
  128. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  129. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 待命")
  130. } else {
  131. console.log('pass')
  132. }
  133. }
  134. for (let i=0; i<2; i++) {
  135. if (PO[i] == 'PO_InputtingBean') {
  136. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  137. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 入豆中")
  138. } else if (PO[i] == 'PO_Waiting') {
  139. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  140. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 空桶等待")
  141. } else if (PO[i] == 'PO_OutputtingBean') {
  142. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  143. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 可出豆")
  144. } else if (PO[i] == 'PO_Stand_by') {
  145. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  146. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 待命")
  147. } else {
  148. console.log('pass')
  149. }
  150. }
  151. },'json');
  152. loading_C()
  153. }
  154. setInterval('myrefresh()',1000);
  155. </script>
  156. <script>
  157. var tank_num = '1';
  158. var status = '{{status}}';
  159. var username = '{{username}}';
  160. $(document).ready(function(){
  161. $("#coffee_title_pc").text('清洗自動化');
  162. $("#coffee_title_phone").text('清洗自動化');
  163. $('#navbarDropdown_user_pc').text(username);
  164. $('#navbarDropdown_user_phone').text(username);
  165. reclaimed_tank_status = ['{{CI1}}','{{CI2}}']
  166. for (let i=0; i<reclaimed_tank_status.length; i++) {
  167. if (reclaimed_tank_status[i] == 'CI_InputtingBean') {
  168. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  169. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 入豆中")
  170. } else if (reclaimed_tank_status[i] == 'CI_Waiting') {
  171. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  172. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 空桶等待")
  173. } else if (reclaimed_tank_status[i] == 'CI_OutputtingBean') {
  174. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  175. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 可出豆")
  176. } else if (reclaimed_tank_status[i] == 'CI_Stand_by') {
  177. $("#CI"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  178. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 待命")
  179. } else {
  180. console.log('pass')
  181. }
  182. }
  183. // 清洗桶槽入料顯示
  184. clean_input_status_N = ['{{C1}}', '{{C2}}', '{{C3}}', '{{C4}}']
  185. for (let i=0; i<clean_input_status_N.length; i++) {
  186. if (clean_input_status_N[i] == 'C_InputtingBean') {
  187. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  188. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 入豆中")
  189. } else if (clean_input_status_N[i] == 'C_InputtingWater') {
  190. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  191. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶入水中")
  192. } else if (clean_input_status_N[i] == 'C_Cleaning') {
  193. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "plum")
  194. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 清洗中")
  195. } else if (clean_input_status_N[i] == 'C_Waiting') {
  196. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  197. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 空桶等待")
  198. } else if (clean_input_status_N[i] == 'C_OutputtingWater') {
  199. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  200. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶排水中")
  201. } else if (clean_input_status_N[i] == 'C_OutputtingBean') {
  202. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  203. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 可出豆")
  204. } else if (clean_input_status_N[i] == 'C_Stand_by') {
  205. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  206. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 待命")
  207. } else if (clean_input_status_N[i] == 'C_Warning') {
  208. $("#C"+parseInt(i+1)+"_status_dot").css("background-color", "crimson")
  209. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 警告")
  210. } else {
  211. console.log('pass')
  212. }
  213. }
  214. // R中水桶顯示
  215. console.log('R1: ' + '{{R1}}')
  216. reclaimed_tank_status = ['{{R1}}']
  217. for (let i=0; i<reclaimed_tank_status.length; i++) {
  218. if (reclaimed_tank_status[i] == 'R_InputtingWater') {
  219. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  220. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 入水中")
  221. } else if (reclaimed_tank_status[i] == 'R_Waiting') {
  222. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  223. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 空桶等待")
  224. } else if (reclaimed_tank_status[i] == 'R_OutputtingWater') {
  225. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "DeepSkyBlue")
  226. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 排水中")
  227. } else if (reclaimed_tank_status[i] == 'R_Stand_by') {
  228. $("#R"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  229. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 待命")
  230. } else {
  231. console.log('pass')
  232. }
  233. }
  234. // 色選顯示
  235. console.log('S1: ' + '{{S1}}')
  236. console.log('S2: ' + '{{S2}}')
  237. colorselect_tank_status = ['{{S1}}','{{S2}}']
  238. for (let i=0; i<colorselect_tank_status.length; i++) {
  239. if (colorselect_tank_status[i] == 'S_InputtingBean') {
  240. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  241. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 入豆中")
  242. } else if (colorselect_tank_status[i] == 'S_Waiting') {
  243. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  244. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 空桶等待")
  245. } else if (colorselect_tank_status[i] == 'S_OutputtingBean') {
  246. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  247. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 可出豆")
  248. } else if (colorselect_tank_status[i] == 'S_Stand_by') {
  249. $("#S"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  250. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 待命")
  251. } else {
  252. console.log('pass')
  253. }
  254. }
  255. // 色選出料顯示
  256. colorselect_output_status = ['{{SO1}}','{{SO2}}']
  257. for (let i=0; i<colorselect_output_status.length; i++) {
  258. if (colorselect_output_status[i] == 'SO_InputtingBean') {
  259. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  260. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 入豆中")
  261. } else if (colorselect_output_status[i] == 'SO_Waiting') {
  262. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  263. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 空桶等待")
  264. } else if (colorselect_output_status[i] == 'SO_OutputtingBean') {
  265. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  266. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 可出豆")
  267. } else if (colorselect_output_status[i] == 'SO_Stand_by') {
  268. $("#SO"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  269. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 待命")
  270. } else {
  271. console.log('pass')
  272. }
  273. }
  274. // 脫皮顯示
  275. peel_tank_status = ['{{P1}}','{{P2}}']
  276. for (let i=0; i<peel_tank_status.length; i++) {
  277. if (peel_tank_status[i] == 'P_InputtingBean') {
  278. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  279. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 入豆中")
  280. } else if (peel_tank_status[i] == 'P_Waiting') {
  281. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  282. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 空桶等待")
  283. } else if (peel_tank_status[i] == 'P_OutputtingBean') {
  284. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  285. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 可出豆")
  286. } else if (peel_tank_status[i] == 'P_Stand_by') {
  287. $("#P"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  288. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 待命")
  289. } else {
  290. console.log('pass')
  291. }
  292. }
  293. // 脫皮出料顯示
  294. peel_output_status = ['{{PO1}}','{{PO2}}']
  295. for (let i=0; i<peel_output_status.length; i++) {
  296. if (peel_output_status[i] == 'PO_InputtingBean') {
  297. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  298. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 入豆中")
  299. } else if (peel_output_status[i] == 'PO_Waiting') {
  300. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "lightgray")
  301. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 空桶等待")
  302. } else if (peel_output_status[i] == 'PO_OutputtingBean') {
  303. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "MediumSeaGreen")
  304. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 可出豆")
  305. } else if (peel_output_status[i] == 'PO_Stand_by') {
  306. $("#PO"+parseInt(i+1)+"_status_dot").css("background-color", "HotPink")
  307. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 待命")
  308. } else {
  309. console.log('pass')
  310. }
  311. }
  312. loading_C()
  313. });
  314. function loading_C(){
  315. var ctid = '{{ctid}}';
  316. $.get('/loading/C'+ctid, '', function (resText) {
  317. var a = [resText.vacuum,resText.threewayvalve_input,resText.diskvalve,resText.solenoid_disinfect,resText.solenoid_water_in,resText.solenoid_water_out,resText.motor,resText.solenoid_reclaimed_in,resText.solenoid_reclaimed_out,resText.pump_disinfect,resText.pump_water_in,resText.warning_light];
  318. for (let i=0; i<16; i++) {
  319. if (a[i] == 1) {
  320. $("#actuator_"+parseInt(i)+"_status").css("background-color", "MediumSeaGreen")
  321. } else if (a[i] == 0) {
  322. $("#actuator_"+parseInt(i)+"_status").css("background-color", "lightgray")
  323. }
  324. else {
  325. $("#actuator_"+parseInt(i)+"_status").css("background-color", "crimson")
  326. }
  327. }
  328. $("#sensor_1").text(resText.UltraSonic);
  329. $("#sensor_2").text(resText.tankTurbidity);
  330. $("#sensor_3").text(resText.Encoder);
  331. $("#sensor_4").text(resText.butterflyvalve);
  332. }, 'json');
  333. };
  334. </script>
  335. {% endblock %}
  336. {% block style %}
  337. <style>
  338. .C_status_css {
  339. font-weight: bold;
  340. text-align: center;
  341. }
  342. .input-text {
  343. height: 25px;
  344. width: 40px;
  345. text-align: center;
  346. margin-left: 2px;
  347. margin-right: 5px;
  348. }
  349. </style>
  350. {% endblock %}
  351. {% block main %}
  352. <div class="album py-5 bg-light">
  353. <div class="container">
  354. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  355. <div class="col">
  356. <div class="card shadow-sm">
  357. <div class="card-body">
  358. <div class="d-flex justify-content-between align-items-center">
  359. <table style="border: 3px lightsteelblue solid; margin-right: auto; margin-left: auto; text-align: center; margin-top: 5px;" cellpadding="5" border="1">
  360. <div style="text-align: center;">
  361. <tr>
  362. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  363. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  364. <tr>
  365. <td>
  366. <!-- 清洗入料 R1 -->
  367. <div id="CI1" tabindex="0" class="CI1_position" role="button">
  368. <span id="CI1_status" class="C_status_css">CI1 status</span>
  369. </div>
  370. </td>
  371. </tr>
  372. </table>
  373. </td>
  374. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  375. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  376. <tr>
  377. <td>
  378. <!-- 清洗槽 C1 -->
  379. <div id="C1" tabindex="0" class="C1_position" role="button">
  380. <span id="C1_status" class="C_status_css">C1 status</span>
  381. </div>
  382. </td>
  383. </tr>
  384. </table>
  385. </td>
  386. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  387. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  388. <tr>
  389. <td>
  390. <!-- 清洗槽 C2 -->
  391. <div id="C2" tabindex="0" class="C2_position" role="button">
  392. <span id="C2_status" class="C_status_css">C2 status</span>
  393. </div>
  394. </td>
  395. </tr>
  396. </table>
  397. </td>
  398. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  399. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  400. <tr>
  401. <td>
  402. <!-- 中水桶 R1 -->
  403. <div id="R1" tabindex="0" class="R1_position" role="button">
  404. <span id="R1_status" class="C_status_css">R1 status</span>
  405. </div>
  406. </td>
  407. </tr>
  408. </table>
  409. </td>
  410. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  411. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  412. <tr>
  413. <td>
  414. <!-- 色選槽 S1 -->
  415. <div id="S1" tabindex="0" class="S1_position" role="button">
  416. <span id="S1_status" class="C_status_css">S1 status</span>
  417. </div>
  418. </td>
  419. </tr>
  420. </table>
  421. </td>
  422. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  423. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  424. <tr>
  425. <td>
  426. <!-- 色選出料 SO1 -->
  427. <div id="SO1" tabindex="0" class="SO1_position" role="button">
  428. <span id="SO1_status" class="C_status_css">SO1 status</span>
  429. </div>
  430. </td>
  431. </tr>
  432. </table>
  433. </td>
  434. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  435. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  436. <tr>
  437. <td>
  438. <!-- 脫皮機 P1 -->
  439. <div id="P1" tabindex="0" class="P1_position" role="button">
  440. <span id="P1_status" class="C_status_css">P1 status</span>
  441. </div>
  442. </td>
  443. </tr>
  444. </table>
  445. </td>
  446. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  447. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  448. <tr>
  449. <td>
  450. <!-- 脫皮出料儲豆槽 PO1 -->
  451. <div id="PO1" tabindex="0" class="PO1_position" role="button">
  452. <span id="PO1_status" class="C_status_css">PO1 status</span>
  453. </div>
  454. </td>
  455. </tr>
  456. </table>
  457. </td>
  458. </tr>
  459. <tr>
  460. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  461. <div id="CI1_status_dot" style="height: 20px; background-color: black;"></div>
  462. </td>
  463. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  464. <div id="C1_status_dot" style="height: 20px; background-color: black;"></div>
  465. </td>
  466. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  467. <div id="C2_status_dot" style="height: 20px; background-color: black;"></div>
  468. </td>
  469. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  470. <div id="R1_status_dot" style=" height: 20px; background-color: black;"></div>
  471. </td>
  472. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  473. <div id="S1_status_dot" style="height: 20px; background-color: black;"></div>
  474. </td>
  475. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  476. <div id="SO1_status_dot" style="height: 20px; background-color: black;"></div>
  477. </td>
  478. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  479. <div id="P1_status_dot" style="height: 20px; background-color: black;"></div>
  480. </td>
  481. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  482. <div id="PO1_status_dot" style="height: 20px; background-color: black;"></div>
  483. </td>
  484. </tr>
  485. <tr>
  486. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  487. 清洗入料儲豆槽
  488. </td>
  489. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  490. 清洗槽
  491. </td>
  492. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  493. 清洗槽
  494. </td>
  495. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  496. 中水桶槽
  497. </td>
  498. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  499. 色選機
  500. </td>
  501. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  502. 色選出料儲豆槽
  503. </td>
  504. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  505. 脫皮機
  506. </td>
  507. <td style="border: lightsteelblue 1px solid;" width="12.5%">
  508. 脫皮出料儲豆槽
  509. </td>
  510. </tr>
  511. <tr>
  512. <td style="border: lightsteelblue 1px solid;">
  513. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  514. <tr>
  515. <td>
  516. <!-- 清洗入料 R1 -->
  517. <div id="CI2" tabindex="0" class="CI2_position" role="button">
  518. <span id="CI2_status" class="C_status_css">CI2 status</span>
  519. </div>
  520. </td>
  521. </tr>
  522. </table>
  523. </td>
  524. <td style="border: lightsteelblue 1px solid;">
  525. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  526. <tr>
  527. <td>
  528. <!-- 脫皮機出料儲豆槽 C3 -->
  529. <div id="C3" tabindex="0" class="C3_position" role="button" style="text-align: center;">
  530. <span id="C3_status" class="C_status_css">C3 status</span>
  531. </div>
  532. </td>
  533. </tr>
  534. </table>
  535. </td>
  536. <td style="border: lightsteelblue 1px solid;">
  537. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  538. <tr>
  539. <td>
  540. <!-- 發酵槽入料儲豆槽 FI2 -->
  541. <div id="C4" tabindex="0" class="C4_position" role="button">
  542. <span id="C4_status" class="C_status_css">C4 status</span>
  543. </div>
  544. </td>
  545. </tr>
  546. </table>
  547. </td>
  548. <td style="border: lightsteelblue 1px solid;">
  549. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  550. </table>
  551. </td>
  552. <td style="border: lightsteelblue 1px solid;">
  553. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  554. <tr>
  555. <td>
  556. <!-- 色選 S2 -->
  557. <div id="S2" tabindex="0" class="S2_position" role="button">
  558. <span id="S2_status" class="C_status_css">S2 status</span>
  559. </div>
  560. </td>
  561. </tr>
  562. </table>
  563. </td>
  564. <td style="border: lightsteelblue 1px solid;">
  565. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  566. <tr>
  567. <td>
  568. <!-- 色選出料 SO2 -->
  569. <div id="SO2" tabindex="0" class="SO2_position" role="button">
  570. <span id="SO2_status" class="C_status_css">SO2 status</span>
  571. </div>
  572. </td>
  573. </tr>
  574. </table>
  575. </td>
  576. <td style="border: lightsteelblue 1px solid;">
  577. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  578. <tr>
  579. <td>
  580. <!-- 脫皮機出料儲豆槽 P2 -->
  581. <div id="P2" tabindex="0" class="P2_position" role="button" style="text-align: center;">
  582. <span id="P2_status" class="C_status_css">P2 status</span>
  583. </div>
  584. </td>
  585. </tr>
  586. </table>
  587. </td>
  588. <td style="border: lightsteelblue 1px solid;">
  589. <table style="border: 0px plum solid; margin-right: auto; margin-left: auto; text-align: center;" cellpadding="5">
  590. <tr>
  591. <td>
  592. <!-- 脫皮機出料儲豆槽 PO2 -->
  593. <div id="PO2" tabindex="0" class="PO2_position" role="button" style="text-align: center;">
  594. <span id="PO2_status" class="C_status_css">PO2 status</span>
  595. </div>
  596. </td>
  597. </tr>
  598. </table>
  599. </td>
  600. </tr>
  601. <tr>
  602. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  603. <div id="CI2_status_dot" style="height: 20px; background-color: black;"></div>
  604. </td>
  605. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  606. <div id="C3_status_dot" style="height: 20px; background-color: black;"></div>
  607. </td>
  608. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  609. <div id="C4_status_dot" style="height: 20px; background-color: black;"></div>
  610. </td>
  611. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  612. </td>
  613. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  614. <div id="S2_status_dot" style="height: 20px; background-color: black;"></div>
  615. </td>
  616. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  617. <div id="SO2_status_dot" style="height: 20px; background-color: black;"></div>
  618. </td>
  619. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  620. <div id="P2_status_dot" style="height: 20px; background-color: black;"></div>
  621. </td>
  622. <td width="12.5%" style="border: lightsteelblue 1px solid;">
  623. <div id="PO2_status_dot" style="height: 20px; background-color: black;"></div>
  624. </td>
  625. </tr>
  626. </table>
  627. </div>
  628. <!-- 發酵貨櫃 致動器狀態 感測器數值 -->
  629. <div style="text-align: center;">
  630. <table style="border: 3px lightsteelblue solid; margin-right: auto; margin-left: auto; text-align: center; margin-top: 5px;" cellpadding="5" border="1">
  631. <tr>
  632. <td width="8%" style="border: lightsteelblue 1px solid;">
  633. 桶槽<br>真空吸料機
  634. </td>
  635. <td width="8%" style="border: lightsteelblue 1px solid;">
  636. 入料<br>三通閥
  637. </td>
  638. <td width="8%" style="border: lightsteelblue 1px solid;">
  639. 蝴蝶閥
  640. </td>
  641. <td width="8%" style="border: lightsteelblue 1px solid;">
  642. 桶內消毒<br>電磁閥
  643. </td>
  644. <td width="8%" style="border: lightsteelblue 1px solid;">
  645. 清水入水<br>電磁閥
  646. </td>
  647. <td width="8%" style="border: lightsteelblue 1px solid;">
  648. 排水廢水<br>電磁閥
  649. </td>
  650. <td width="8%" style="border: lightsteelblue 1px solid;">
  651. 馬達
  652. </td>
  653. <td width="8%" style="border: lightsteelblue 1px solid;">
  654. 中水入水<br>電磁閥
  655. </td>
  656. <td width="8%" style="border: lightsteelblue 1px solid;">
  657. 排水中水<br>電磁閥
  658. </td>
  659. <td width="8%" style="border: lightsteelblue 1px solid;">
  660. 混合槽<br>幫浦
  661. </td>
  662. <td width="8%" style="border: lightsteelblue 1px solid;">
  663. 清水入水<br>幫浦
  664. </td>
  665. <td width="8%" style="border: lightsteelblue 1px solid;">
  666. 警示燈
  667. </td>
  668. </tr>
  669. <tr>
  670. <td style="border: lightsteelblue 1px solid;">
  671. <div id="actuator_0_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  672. </td>
  673. <td style="border: lightsteelblue 1px solid;">
  674. <div id="actuator_1_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  675. </td>
  676. <td style="border: lightsteelblue 1px solid;">
  677. <div id="actuator_2_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  678. </td>
  679. <td style="border: lightsteelblue 1px solid;">
  680. <div id="actuator_3_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  681. </td>
  682. <td style="border: lightsteelblue 1px solid;">
  683. <div id="actuator_4_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  684. </td>
  685. <td style="border: lightsteelblue 1px solid;">
  686. <div id="actuator_5_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  687. </td>
  688. <td style="border: lightsteelblue 1px solid;">
  689. <div id="actuator_6_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  690. </td>
  691. <td style="border: lightsteelblue 1px solid;">
  692. <div id="actuator_7_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  693. </td>
  694. <td style="border: lightsteelblue 1px solid;">
  695. <div id="actuator_8_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  696. </td>
  697. <td style="border: lightsteelblue 1px solid;">
  698. <div id="actuator_9_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  699. </td>
  700. <td style="border: lightsteelblue 1px solid;">
  701. <div id="actuator_10_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  702. </td>
  703. <td style="border: lightsteelblue 1px solid;">
  704. <div id="actuator_11_status" style="margin:0 auto; height: 20px; background-color: lightgray;"></div>
  705. </td>
  706. </tr>
  707. </table>
  708. <table style="border: 3px lightsteelblue solid; margin-right: auto; margin-left: auto; text-align: center; margin-top: 5px;" cellpadding="5" border="1">
  709. <tr>
  710. <td style="border: lightsteelblue 1px solid;">
  711. 水位/生豆<br>高度
  712. </td>
  713. <td style="border: lightsteelblue 1px solid;">
  714. 濁度計
  715. </td>
  716. <td style="border: lightsteelblue 1px solid;">
  717. 馬達<br>編碼器
  718. </td>
  719. <td style="border: lightsteelblue 1px solid;">
  720. 蝴蝶閥<br>編碼器
  721. </td>
  722. </tr>
  723. <tr>
  724. <td style="border: lightsteelblue 1px solid;">
  725. <span id="sensor_1"></span>
  726. </td>
  727. <td style="border: lightsteelblue 1px solid;">
  728. <span id="sensor_2"></span>
  729. </td>
  730. <td style="border: lightsteelblue 1px solid;">
  731. <span id="sensor_3"></span>
  732. </td>
  733. <td style="border: lightsteelblue 1px solid;">
  734. <span id="sensor_4"></span>
  735. </td>
  736. </tr>
  737. </table>
  738. <table style="border: 3px lightsteelblue solid; margin-right: auto; margin-left: auto; text-align: center; margin-top: 5px; line-height: 28px;" cellpadding="5" border="1">
  739. <tr>
  740. <td style="border: lightsteelblue 1px solid;">
  741. 桶槽<br>
  742. 參數設定
  743. </td>
  744. </tr>
  745. <tr>
  746. <td style="padding: 10px; text-align: left; vertical-align: text-top;">
  747. 生豆高度
  748. <input name="Ferment_Tank_bean_height" class="input-text" type="text" value="5">公分<br>
  749. 吸放料時間
  750. <input name="Ferment_Tank_vacuumON_time" class="input-text" type="text" value="5">秒<br>
  751. 水位高度
  752. <input name="Ferment_Tank_water_height" class="input-text" type="text" value="8">公分<br>
  753. 馬達轉速
  754. <input name="Ferment_Tank_motor_rpm" class="input-text" type="text" value="15">rpm<br>
  755. 廢水排放
  756. <input name="Ferment_Tank_WaterOut_time" class="input-text" type="text" value="60">秒, 消毒開啟
  757. <input name="Ferment_Tank_Disinfect_time" class="input-text" type="text" value="10">秒<br>
  758. </td>
  759. </tr>
  760. </table>
  761. </div>
  762. </div>
  763. </div>
  764. </div>
  765. </div>
  766. </div>
  767. </div>
  768. </div>
  769. {% endblock %}