clean.html 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "base.html" %}
  3. {% block title %}{{ title }}{% endblock %}
  4. {% block script %}
  5. <script>
  6. var status = '{{status}}';
  7. var username = '{{username}}';
  8. $(document).ready(function(){
  9. $("#coffee_title_pc").text('清洗貨櫃');
  10. $("#coffee_title_phone").text('清洗貨櫃');
  11. $('#navbarDropdown_user_pc').text(username);
  12. $('#navbarDropdown_user_phone').text(username);
  13. myrefresh();
  14. });
  15. function myrefresh()
  16. {
  17. $.get('/clean_auto_data', function (resText) {
  18. var CI = [resText.CI1,resText.CI2];
  19. var C=[resText.C1,resText.C2,resText.C3,resText.C4];
  20. var R=[resText.R1];
  21. var S = [resText.S1,resText.S2];
  22. var SO = [resText.SO1,resText.SO2];
  23. var P = [resText.P1,resText.P2];
  24. var PO = [resText.PO1,resText.PO2];
  25. for (let i=0; i<2; i++) {
  26. if (CI[i] == 'CI_InputtingBean') {
  27. $("#CI"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  28. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 入豆中")
  29. } else if (CI[i] == 'CI_Waiting') {
  30. $("#CI"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  31. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 空桶等待")
  32. } else if (CI[i] == 'CI_OutputtingBean') {
  33. $("#CI"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  34. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 可出豆")
  35. } else if (CI[i] == 'CI_Stand_by') {
  36. $("#CI"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  37. $("#CI"+parseInt(i+1)+"_status").text("CI" + parseInt(i+1) + " 待命")
  38. } else {
  39. console.log('pass')
  40. }
  41. }
  42. for (let i=0; i<4; i++) {
  43. if (C[i] == 'C_InputtingBean') {
  44. $("#C"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  45. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 入豆中")
  46. } else if (C[i] == 'C_Waiting') {
  47. $("#C"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  48. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 空桶等待")
  49. } else if (C[i] == 'C_InputtingWater') {
  50. $("#C"+parseInt(i+1)+"_bar").css("background-color", "DeepSkyBlue")
  51. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶入水中")
  52. } else if (C[i] == 'C_Cleaning') {
  53. $("#C"+parseInt(i+1)+"_bar").css("background-color", "plum")
  54. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 清洗中")
  55. } else if (C[i] == 'C_OutputtingWater') {
  56. $("#C"+parseInt(i+1)+"_bar").css("background-color", "DeepSkyBlue")
  57. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 內桶排水中")
  58. } else if (C[i] == 'C_OutputtingBean') {
  59. $("#C"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  60. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 可出豆")
  61. } else if (C[i] == 'C_Warning') {
  62. $("#C"+parseInt(i+1)+"_bar").css("background-color", "crimson")
  63. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 警告")
  64. } else if (C[i] == 'C_Stand_by') {
  65. $("#C"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  66. $("#C"+parseInt(i+1)+"_status").text("C" + parseInt(i+1) + " 待命")
  67. } else {
  68. console.log('pass')
  69. }
  70. }
  71. for (let i=0; i<1; i++) {
  72. if (R[i] == 'R_InputtingWater') {
  73. $("#R"+parseInt(i+1)+"_bar").css("background-color", "DeepSkyBlue")
  74. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 入水中")
  75. } else if (R[i] == 'R_Waiting') {
  76. $("#R"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  77. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 空桶等待")
  78. } else if (R[i] == 'R_OutputtingWater') {
  79. $("#R"+parseInt(i+1)+"_bar").css("background-color", "DeepSkyBlue")
  80. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 排水中")
  81. } else if (R[i] == 'R_Stand_by') {
  82. $("#R"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  83. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 待命")
  84. } else if (R[i] == 'R_Warning') {
  85. console.log('[動作] R桶警告 R' + parseInt(i+1) + ' 警告')
  86. $("#R"+parseInt(i+1)+"_bar").css("background-color", "crimson")
  87. $("#R"+parseInt(i+1)+"_status").text("R" + parseInt(i+1) + " 警告")
  88. } else {
  89. console.log('pass')
  90. }
  91. }
  92. for (let i=0; i<2; i++) {
  93. if (S[i] == 'S_InputtingBean') {
  94. $("#S"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  95. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 入豆中")
  96. } else if (S[i] == 'S_Waiting') {
  97. $("#S"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  98. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 空桶等待")
  99. } else if (S[i] == 'S_OutputtingBean') {
  100. $("#S"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  101. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 可出豆")
  102. } else if (S[i] == 'S_Stand_by') {
  103. $("#S"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  104. $("#S"+parseInt(i+1)+"_status").text("S" + parseInt(i+1) + " 待命")
  105. } else {
  106. console.log('pass')
  107. }
  108. }
  109. for (let i=0; i<2; i++) {
  110. if (SO[i] == 'SO_InputtingBean') {
  111. $("#SO"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  112. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 入豆中")
  113. } else if (SO[i] == 'SO_Waiting') {
  114. $("#SO"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  115. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 空桶等待")
  116. } else if (SO[i] == 'SO_OutputtingBean') {
  117. $("#SO"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  118. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 可出豆")
  119. } else if (SO[i] == 'SO_Stand_by') {
  120. $("#SO"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  121. $("#SO"+parseInt(i+1)+"_status").text("SO" + parseInt(i+1) + " 待命")
  122. } else {
  123. console.log('pass')
  124. }
  125. }
  126. for (let i=0; i<2; i++) {
  127. if (P[i] == 'P_InputtingBean') {
  128. $("#P"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  129. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 入豆中")
  130. } else if (P[i] == 'P_Waiting') {
  131. $("#P"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  132. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 空桶等待")
  133. } else if (P[i] == 'P_OutputtingBean') {
  134. $("#P"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  135. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 可出豆")
  136. } else if (P[i] == 'P_Stand_by') {
  137. $("#P"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  138. $("#P"+parseInt(i+1)+"_status").text("P" + parseInt(i+1) + " 待命")
  139. } else {
  140. console.log('pass')
  141. }
  142. }
  143. for (let i=0; i<2; i++) {
  144. if (PO[i] == 'PO_InputtingBean') {
  145. $("#PO"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  146. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 入豆中")
  147. } else if (PO[i] == 'PO_Waiting') {
  148. $("#PO"+parseInt(i+1)+"_bar").css("background-color", "lightgray")
  149. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 空桶等待")
  150. } else if (PO[i] == 'PO_OutputtingBean') {
  151. $("#PO"+parseInt(i+1)+"_bar").css("background-color", "MediumSeaGreen")
  152. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 可出豆")
  153. } else if (PO[i] == 'PO_Stand_by') {
  154. $("#PO"+parseInt(i+1)+"_bar").css("background-color", "HotPink")
  155. $("#PO"+parseInt(i+1)+"_status").text("PO" + parseInt(i+1) + " 待命")
  156. } else {
  157. console.log('pass')
  158. }
  159. }
  160. },'json');
  161. }
  162. setInterval('myrefresh()',1000);
  163. </script>
  164. {% endblock %}
  165. {% block style %}
  166. <style>
  167. /* 各桶槽狀態大小的共同 CSS */
  168. .div_CleanTank_position {
  169. text-align: center;
  170. font-weight: bold;
  171. border: 0px aquamarine solid;
  172. }
  173. .td-clickable:hover {
  174. background-color: Lavender;
  175. border: 2px Gray solid;
  176. }
  177. /* 桶槽狀態顯示的顏色條 */
  178. .div_CleanTank_Status {
  179. height: 20px;
  180. border-style: solid;
  181. border-color: whitesmoke;
  182. background-color: black;
  183. }
  184. /* 致動器狀態的圈圈 */
  185. .actuator_status {
  186. width: 18px;
  187. height: 18px;
  188. background-color:black;
  189. border-radius: 50%;
  190. }
  191. /* 狀態外框的 CSS */
  192. .table_css {
  193. border: 0px lightsteelblue solid;
  194. margin-right: auto;
  195. margin-left: auto;
  196. text-align: center;
  197. margin-top: 5px;
  198. width: 80%;
  199. }
  200. </style>
  201. {% endblock %}
  202. {% block main %}
  203. <!-- 清洗浮選 模态框 -->
  204. <div class="modal fade" id="C_Modal">
  205. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  206. <div class="modal-content">
  207. <div class="modal-header">
  208. <h4 id="C_Modal_title" class="modal-title">清洗浮選槽 C1 狀態</h4>
  209. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  210. </div>
  211. <!-- 模态框主体 -->
  212. <div class="modal-body">
  213. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  214. <!--<table style="border:0px gray solid;-->
  215. <tr>
  216. <td><strong><a id="C_actuator_link" href="/clean_container_tank/1">致動器狀態</a></strong></td>
  217. <td><strong><a id="C_sensor_link" href="/clean_container_tank/1">感測器狀態</a></strong></td>
  218. </tr>
  219. <tr>
  220. <td style="vertical-align:text-top;">
  221. <table style="border:0px gray solid;" cellpadding="3">
  222. <tr>
  223. <td>
  224. <div id="Ctank_vacuum_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  225. </div>
  226. </td>
  227. <td>
  228. <a id="C_Vacuum" href="">真空吸料機</a>
  229. </td>
  230. </tr>
  231. <tr>
  232. <td>
  233. <div id="Ctank_threewayvalve_input_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  234. </div>
  235. </td>
  236. <td>
  237. <a id="C_threewayvalve_input" href="">入料三通閥</a>
  238. </td>
  239. </tr>
  240. <tr>
  241. <td>
  242. <div id="Ctank_motor_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  243. </div>
  244. </td>
  245. <td>
  246. <a id="C_motor" href="">馬達</a>
  247. </td>
  248. </tr>
  249. <tr>
  250. <td>
  251. <div id="Ctank_solenoid_reclaimed_in_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  252. </div>
  253. </td>
  254. <td>
  255. <a id="C_solenoid_reclaimed_in" href="">中水入水電磁閥</a>
  256. </td>
  257. </tr>
  258. <tr>
  259. <td>
  260. <div id="Ctank_solenoid_water_in_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  261. </div>
  262. </td>
  263. <td>
  264. <a id="C_solenoid_water_in" href="">清水入水電磁閥</a>
  265. </td>
  266. </tr>
  267. <tr>
  268. <td>
  269. <div id="Ctank_pump_water_in_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  270. </div>
  271. </td>
  272. <td>
  273. <a id="C_pump_water_in" href="">幫浦(清水入水)</a>
  274. </td>
  275. </tr>
  276. <tr>
  277. <td>
  278. <div id="Ctank_solenoid_water_out_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  279. </div>
  280. </td>
  281. <td>
  282. <a id="C_solenoid_water_out" href="">排水廢水電磁閥</a>
  283. </td>
  284. <tr>
  285. <td>
  286. <div id="Ctank_solenoid_reclaimed_out_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  287. </div>
  288. </td>
  289. <td>
  290. <a id="C_solenoid_reclaimed_out" href="">排水中水電磁閥</a>
  291. </td>
  292. </tr>
  293. <tr>
  294. <td>
  295. <div id="Ctank_solenoid_disinfect_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  296. </div>
  297. </td>
  298. <td>
  299. <a id="C_solenoid_disinfect" href="">桶內消毒電磁閥</a>
  300. </td>
  301. </tr>
  302. <tr>
  303. <td>
  304. <div id="Ctank_pump_disinfect_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  305. </div>
  306. </td>
  307. <td>
  308. <a id="C_pump_disinfect" href="">混合槽幫浦</a>
  309. </td>
  310. </tr>
  311. <tr>
  312. <td>
  313. <div id="Ctank_diskvalve_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  314. </div>
  315. </td>
  316. <td>
  317. <a id="C_diskvalve" href="">蝴蝶閥</a>
  318. </td>
  319. </tr>
  320. <tr>
  321. <td>
  322. <div id="Warning_Light_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  323. </div>
  324. </td>
  325. <td>
  326. <a id="Warning_Light" href="">警示燈</a>
  327. </td>
  328. </tr>
  329. </tr>
  330. </table>
  331. </td>
  332. <td style="vertical-align:text-top;">
  333. <table style="border:0px gray solid;" cellpadding="3">
  334. <tr>
  335. <td>
  336. <a id="C_UltraSonic" href="">水位/生豆高度</a>
  337. </td>
  338. <td>
  339. <span id="CUltraSonic_t_status"></span>
  340. </td>
  341. </tr>
  342. <tr>
  343. <td>
  344. <a id="C_MotorEncoder" href="">馬達編碼器</a>
  345. </td>
  346. <td>
  347. <span id="CMotorEncoder_t_status"></span>
  348. </td>
  349. </tr>
  350. <tr>
  351. <td>
  352. <a id="butterflyvalve" href="">蝴蝶閥編碼器</a>
  353. </td>
  354. <td>
  355. <span id="butterflyvalve_status"></span>
  356. </td>
  357. </tr>
  358. <tr>
  359. <td>
  360. <a id="C_Turbidity" href="">濁度計</a>
  361. </td>
  362. <td>
  363. <span id="CtankTurbidity_t_status"></span>
  364. </td>
  365. </tr>
  366. <tr>
  367. <td>
  368. <a id="camera_clean_tid" href=""><strong>攝影機畫面</strong></a>
  369. </td>
  370. </tr>
  371. <tr>
  372. <td><strong><a id="C_set" href="">自動化設定</a></strong></td>
  373. </tr>
  374. </table>
  375. </td>
  376. </tr>
  377. </table>
  378. </div>
  379. </div>
  380. </div>
  381. </div>
  382. <!-- 清洗浮選 出料儲豆槽 模态框 -->
  383. <div class="modal fade" id="CI_Modal">
  384. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  385. <div class="modal-content">
  386. <div class="modal-header">
  387. <h4 id="CI_Modal_title" class="modal-title">清洗浮選入料儲豆槽 CI1 狀態</h4>
  388. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  389. </div>
  390. <!-- 模态框主体 -->
  391. <div class="modal-body">
  392. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  393. <!--<table style="border:0px gray solid;-->
  394. <tr>
  395. <td><strong><a id="CI_actuator_link" href="/clean_container/1">致動器狀態</a></strong></td>
  396. <td><strong><a id="CI_sensor_link" href="/clean_container/1">感測器狀態</a></strong></td>
  397. </tr>
  398. <tr>
  399. <td style="vertical-align:text-top;">
  400. <table style="border:0px gray solid;" cellpadding="3">
  401. <tr>
  402. <td>
  403. <div id="CI_vacuum_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  404. </div>
  405. </td>
  406. <td>
  407. <a id="input_Vacuum" href="">真空吸料機</a>
  408. </td>
  409. </tr>
  410. </table>
  411. </td>
  412. <td style="vertical-align:text-top;">
  413. <table style="border:0px gray solid;" cellpadding="3">
  414. <tr>
  415. <td>
  416. <a id="CI_UltraSonic" href="">咖啡生豆高度</a>
  417. </td>
  418. <td>
  419. <span id="CI_UltraSonic_status"></span>
  420. </td>
  421. </tr>
  422. <tr>
  423. <td>
  424. <a id="CI_camera_clean_tid" href=""><strong>攝影機畫面</strong></a>
  425. </td>
  426. </tr>
  427. <tr>
  428. <td><strong><a id="CI_set" href="">自動化設定</a></strong></td>
  429. </tr>
  430. </table>
  431. </td>
  432. </tr>
  433. </table>
  434. </div>
  435. </div>
  436. </div>
  437. </div>
  438. <!-- 色選機 模态框 -->
  439. <div class="modal fade" id="S_Modal">
  440. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  441. <div class="modal-content">
  442. <div class="modal-header">
  443. <h4 id="S_Modal_title" class="modal-title">色選機 S1 狀態</h4>
  444. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  445. </div>
  446. <!-- 模态框主体 -->
  447. <div class="modal-body">
  448. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  449. <!--<table style="border:0px gray solid;-->
  450. <tr>
  451. <td><strong><a id="S_actuator_link" href="/colorselect_container_tank/1">致動器狀態</a></strong></td>
  452. <td><strong><a id="S_sensor_link" href="/colorselect_container_tank/1">感測器狀態</a></strong></td>
  453. </tr>
  454. <tr>
  455. <td style="vertical-align:text-top;">
  456. <table style="border:0px gray solid;" cellpadding="3">
  457. <tr>
  458. <td>
  459. <div id="S_vacuum_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  460. </div>
  461. </td>
  462. <td>
  463. <a id="S_Vacuum" href="">真空吸料機</a>
  464. </td>
  465. </tr>
  466. <tr>
  467. <td>
  468. <div id="S_motor_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  469. </div>
  470. </td>
  471. <td>
  472. <a id="S_motor" href="">馬達</a>
  473. </td>
  474. </tr>
  475. <tr>
  476. <td>
  477. <div id="S_nozzle_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  478. </div>
  479. </td>
  480. <td>
  481. <a id="S_nozzle" href="">噴嘴</a>
  482. </td>
  483. </tr>
  484. </table>
  485. </td>
  486. <td style="vertical-align:text-top;">
  487. <table style="border:0px gray solid;" cellpadding="3">
  488. <tr>
  489. <td>
  490. <a id="S_color" href="">顏色感測器</a>
  491. </td>
  492. <td>
  493. <span id="S_color_status"></span>
  494. </td>
  495. </tr>
  496. <tr>
  497. <td>
  498. <a id="S_camera_colorselect_tid" href=""><strong>攝影機畫面</strong></a>
  499. </td>
  500. </tr>
  501. <tr>
  502. <td><strong><a id="S_set" href="">自動化設定</a></strong></td>
  503. </tr>
  504. </table>
  505. </td>
  506. </tr>
  507. </table>
  508. </div>
  509. </div>
  510. </div>
  511. </div>
  512. <!-- 色選機 出料儲豆槽 模态框 -->
  513. <div class="modal fade" id="SO_Modal">
  514. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  515. <div class="modal-content">
  516. <div class="modal-header">
  517. <h4 id="SO_Modal_title" class="modal-title">色選機出料儲豆槽 SO1 狀態</h4>
  518. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  519. </div>
  520. <!-- 模态框主体 -->
  521. <div class="modal-body">
  522. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  523. <!--<table style="border:0px gray solid;-->
  524. <tr>
  525. <td><strong><a id="SO_sensor_link" href="/colorselect_container/1">感測器狀態</a></strong></td>
  526. </tr>
  527. <tr>
  528. <td style="vertical-align:text-top;">
  529. <table style="border:0px gray solid;" cellpadding="3">
  530. <tr>
  531. <td>
  532. <a id="SO_UltraSonic" href="">咖啡生豆高度</a>
  533. </td>
  534. <td>
  535. <span id="SO_UltraSonic_status"></span>
  536. </td>
  537. </tr>
  538. <tr>
  539. <td>
  540. <a id="SO_camera_colorselect_tid" href=""><strong>攝影機畫面</strong></a>
  541. </td>
  542. </tr>
  543. <tr>
  544. <td><strong><a id="SO_set" href="">自動化設定</a></strong></td>
  545. </tr>
  546. </table>
  547. </td>
  548. </tr>
  549. </table>
  550. </div>
  551. </div>
  552. </div>
  553. </div>
  554. <!-- 脫皮機 模态框 -->
  555. <div class="modal fade" id="P_Modal">
  556. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  557. <div class="modal-content">
  558. <div class="modal-header">
  559. <h4 id="P_Modal_title" class="modal-title">脫皮機 P1 狀態</h4>
  560. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  561. </div>
  562. <!-- 模态框主体 -->
  563. <div class="modal-body">
  564. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  565. <!--<table style="border:0px gray solid;-->
  566. <tr>
  567. <td><strong><a id="P_actuator_link" href="">致動器狀態</a></strong></td>
  568. <td><strong><a id="P_sensor_link" href="">感測器狀態</a></strong></td>
  569. </tr>
  570. <tr>
  571. <td style="vertical-align:text-top;">
  572. <table style="border:0px gray solid;" cellpadding="3">
  573. <tr>
  574. <td>
  575. <div id="P_vacuum_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  576. </div>
  577. </td>
  578. <td>
  579. <a id="P_Vacuum" href="">真空吸料機</a>
  580. </td>
  581. </tr>
  582. <tr>
  583. <td>
  584. <div id="tank_motor_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  585. </div>
  586. </td>
  587. <td>
  588. <a id="motor" href="">馬達</a>
  589. </td>
  590. </tr>
  591. </table>
  592. </td>
  593. <td style="vertical-align:text-top;">
  594. <table style="border:0px gray solid;" cellpadding="3">
  595. <tr>
  596. <td>
  597. <a id="motorEncoder" href="">馬達編碼器</a>
  598. </td>
  599. <td>
  600. <span id="P_motorEncoder_status"></span>
  601. </td>
  602. </tr>
  603. <tr>
  604. <td>
  605. <a id="camera_peel_tid" href=""><strong>攝影機畫面</strong></a>
  606. </td>
  607. </tr>
  608. <tr>
  609. <td><strong><a id="P_set" href="">自動化設定</a></strong></td>
  610. </tr>
  611. </table>
  612. </td>
  613. </tr>
  614. </table>
  615. </div>
  616. </div>
  617. </div>
  618. </div>
  619. <!-- 脫皮機 出料儲豆槽 模态框 -->
  620. <div class="modal fade" id="PO_Modal">
  621. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  622. <div class="modal-content">
  623. <div class="modal-header">
  624. <h4 id="PO_Modal_title" class="modal-title">脫皮機出料儲豆槽 PO1 狀態</h4>
  625. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  626. </div>
  627. <!-- 模态框主体 -->
  628. <div class="modal-body">
  629. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  630. <!--<table style="border:0px gray solid;-->
  631. <tr>
  632. <td><strong><a id="PO_actuator_link" href="/clean_container/1">致動器狀態</a></strong></td>
  633. <td><strong><a id="PO_sensor_link" href="/clean_container/1">感測器狀態</a></strong></td>
  634. </tr>
  635. <tr>
  636. <td style="vertical-align:text-top;">
  637. <table style="border:0px gray solid;" cellpadding="3">
  638. <tr>
  639. <td>
  640. <div id="PO_vacuum_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  641. </div>
  642. </td>
  643. <td>
  644. <a id="output_Vacuum" href="">真空吸料機</a>
  645. </td>
  646. </tr>
  647. </table>
  648. </td>
  649. <td style="vertical-align:text-top;">
  650. <table style="border:0px gray solid;" cellpadding="3">
  651. <tr>
  652. <td>
  653. <a id="PO_UltraSonic" href="">咖啡生豆高度</a>
  654. </td>
  655. <td>
  656. <span id="PO_UltraSonic_status"></span>
  657. </td>
  658. </tr>
  659. <tr>
  660. <td>
  661. <a id="PO_camera_peel_tid" href=""><strong>攝影機畫面</strong></a>
  662. </td>
  663. </tr>
  664. <tr>
  665. <td><strong><a id="PO_set" href="">自動化設定</a></strong></td>
  666. </tr>
  667. </table>
  668. </td>
  669. </tr>
  670. </table>
  671. </div>
  672. </div>
  673. </div>
  674. </div>
  675. <!-- 中水桶 模态框 -->
  676. <div class="modal fade" id="R_Modal">
  677. <div class="modal-dialog modal-dialog-centered" style="width: 400px;">
  678. <div class="modal-content">
  679. <div class="modal-header">
  680. <h4 id="R_Modal_title" class="modal-title">中水桶 R1 狀態</h4>
  681. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  682. </div>
  683. <!-- 模态框主体 -->
  684. <div class="modal-body">
  685. <table style="border:0px gray solid; width: 100%;" cellpadding="3">
  686. <!--<table style="border:0px gray solid;-->
  687. <tr>
  688. <td><strong><a id="R_actuator_link" href="/reclimedwater_tank/1">致動器狀態</a></strong></td>
  689. <td><strong><a id="R_sensor_link" href="/reclimedwater_tank/1">感測器狀態</a></strong></td>
  690. </tr>
  691. <tr>
  692. <td style="vertical-align:text-top;">
  693. <table style="border:0px gray solid;" cellpadding="3">
  694. <tr>
  695. <td>
  696. <div id="R_solenoid_water_in_status"style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  697. </div>
  698. </td>
  699. <td>
  700. <a id="R_solenoid_water_in" href="">清水入水電磁閥</a>
  701. </td>
  702. </tr>
  703. <tr>
  704. <td>
  705. <div id="R_solenoid_reclaimed_out_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  706. </div>
  707. </td>
  708. <td>
  709. <a id="R_solenoid_reclaimed_out" href="">排水中水電磁閥</a>
  710. </td>
  711. </tr>
  712. <tr>
  713. <td>
  714. <div id="R_solenoid_water_out_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  715. </div>
  716. </td>
  717. <td>
  718. <a id="R_solenoid_water_out" href="">排水廢水電磁閥</a>
  719. </td>
  720. </tr>
  721. <tr>
  722. <td>
  723. <div id="R_pump_reclaimed_out_status" style="width: 18px; height: 18px; background-color:black; border-radius: 50%;">
  724. </div>
  725. </td>
  726. <td>
  727. <a id="R_pump_reclaimed_out" href="">入水清洗槽幫浦</a>
  728. </td>
  729. </tr>
  730. </table>
  731. </td>
  732. <td style="vertical-align:text-top;">
  733. <table style="border:0px gray solid;" cellpadding="3">
  734. <tr>
  735. <td>
  736. <a id="R_UltraSonic" href="">水位</a>
  737. </td>
  738. <td>
  739. <span id="R_UltraSonic_status"></span>
  740. </td>
  741. </tr>
  742. <tr>
  743. <td>
  744. <a id="R_Turbidity" href="">濁度計</a>
  745. </td>
  746. <td>
  747. <span id="R_Turbidity_status"></span>
  748. </td>
  749. </tr>
  750. <tr>
  751. <td>
  752. <a id="R_camera_reclaimedwater_tid" href=""><strong>攝影機畫面</strong></a>
  753. </td>
  754. </tr>
  755. <tr>
  756. <td><strong><a id="R_set" href="">自動化設定</a></strong></td>
  757. </tr>
  758. </table>
  759. </td>
  760. </tr>
  761. </table>
  762. </div>
  763. </div>
  764. </div>
  765. </div>
  766. </div>
  767. <div class="album py-5 bg-light">
  768. <div class="container">
  769. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  770. <div class="col">
  771. <div class="card shadow-sm">
  772. <div class="card-body">
  773. <div class="d-flex justify-content-between align-items-center">
  774. <table class="table_css" cellpadding="6" border="1" style="width: 100%" >
  775. <tr>
  776. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  777. <div id="CI1" tabindex="0" class="div_CleanTank_position" role="button">
  778. <span id="CI1_status" class="demo_status_css">CI1 status</span>
  779. </div>
  780. </td>
  781. <td style="width: 10px; font-weight: 900; border: lightsteelblue 1px solid;">
  782. 入料
  783. </td>
  784. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  785. <div id="C1" tabindex="0" class="div_CleanTank_position" role="button">
  786. <span id="C1_status" class="demo_status_css">C1 status</span>
  787. </div>
  788. </td>
  789. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  790. <div id="C2" tabindex="0" class="div_CleanTank_position" role="button">
  791. <span id="C2_status" class="demo_status_css">C2 status</span>
  792. </div>
  793. </td>
  794. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  795. <div id="R1" tabindex="0" class="div_CleanTank_position" role="button">
  796. <span id="R1_status" class="demo_status_css">R1 status</span>
  797. </div>
  798. </td>
  799. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  800. <div id="S1" tabindex="0" class="div_CleanTank_position" role="button">
  801. <span id="S1_status" class="demo_status_css">S1 status</span>
  802. </div>
  803. </td>
  804. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  805. <div id="SO1" tabindex="0" class="div_CleanTank_position" role="button">
  806. <span id="SO1_status" class="demo_status_css">SO1 status</span>
  807. </div>
  808. </td>
  809. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  810. <div id="P1" tabindex="0" class="div_CleanTank_position" role="button">
  811. <span id="P1_status" class="demo_status_css">P1 status</span>
  812. </div>
  813. </td>
  814. <td style="width: 10px; font-weight: 900; border: lightsteelblue 1px solid;">
  815. 出料
  816. </td>
  817. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  818. <div id="PO1" tabindex="0" class="div_CleanTank_position" role="button">
  819. <span id="PO1_status" class="demo_status_css">PO1 status</span>
  820. </div>
  821. </td>
  822. </tr>
  823. <tr>
  824. <td style="border: lightsteelblue 1px solid;">
  825. <center><div id="CI1_bar" class="div_CleanTank_Status"></div></center>
  826. </td>
  827. <td style="border: lightsteelblue 1px solid;">
  828. </td>
  829. <td style="border: lightsteelblue 1px solid;">
  830. <center><div id="C1_bar" class="div_CleanTank_Status"></div></center>
  831. </td>
  832. <td style="border: lightsteelblue 1px solid;">
  833. <center><div id="C2_bar" class="div_CleanTank_Status"></div></center>
  834. </td>
  835. <td style="border: lightsteelblue 1px solid;">
  836. <center><div id="R1_bar" class="div_CleanTank_Status"></div></center>
  837. </td>
  838. <td style="border: lightsteelblue 1px solid;">
  839. <center><div id="S1_bar" class="div_CleanTank_Status"></div></center>
  840. </td>
  841. <td style="border: lightsteelblue 1px solid;">
  842. <center><div id="SO1_bar" class="div_CleanTank_Status"></div></center>
  843. </td>
  844. <td style="border: lightsteelblue 1px solid;">
  845. <center><div id="P1_bar" class="div_CleanTank_Status"></div></center>
  846. </td>
  847. <td style="border: lightsteelblue 1px solid;">
  848. </td>
  849. <td style="border: lightsteelblue 1px solid;">
  850. <center><div id="PO1_bar" class="div_CleanTank_Status"></div></center>
  851. </td>
  852. </tr>
  853. </table>
  854. </div>
  855. </div>
  856. <img src="../static/img/web_CleanColorPeel_container.png">
  857. <div class="card-body">
  858. <div class="d-flex justify-content-between align-items-center">
  859. <table class="table_css" cellpadding="6" border="1" style="width: 100%">
  860. <tr>
  861. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  862. <div id="CI2" tabindex="0" class="div_CleanTank_position" role="button">
  863. <span id="CI2_status" class="demo_status_css">CI2 status</span>
  864. </div>
  865. </td>
  866. <td style="width: 10px; font-weight: 900; border: lightsteelblue 1px solid;">
  867. 入料
  868. </td>
  869. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  870. <div id="C3" tabindex="0" class="div_CleanTank_position" role="button">
  871. <span id="C3_status" class="demo_status_css">C3 status</span>
  872. </div>
  873. </td>
  874. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  875. <div id="C4" tabindex="0" class="div_CleanTank_position" role="button">
  876. <span id="C4_status" class="demo_status_css">C4 status</span>
  877. </div>
  878. </td>
  879. <td style="border: lightsteelblue 1px solid;">
  880. </td>
  881. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  882. <div id="S2" tabindex="0" class="div_CleanTank_position" role="button">
  883. <span id="S2_status" class="demo_status_css">S2 status</span>
  884. </div>
  885. </td>
  886. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  887. <div id="SO2" tabindex="0" class="div_CleanTank_position" role="button">
  888. <span id="SO2_status" class="demo_status_css">SO2 status</span>
  889. </div>
  890. </td>
  891. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  892. <div id="P2" tabindex="0" class="div_CleanTank_position" role="button">
  893. <span id="P2_status" class="demo_status_css">P2 status</span>
  894. </div>
  895. </td>
  896. <td style="width: 10px; font-weight: 900; border: lightsteelblue 1px solid;">
  897. 出料
  898. </td>
  899. <td class="td-clickable" width="12%" style="border: lightsteelblue 1px solid;">
  900. <div id="PO2" tabindex="0" class="div_CleanTank_position" role="button">
  901. <span id="PO2_status" class="demo_status_css">PO2 status</span>
  902. </div>
  903. </td>
  904. </tr>
  905. <tr>
  906. <td style="border: lightsteelblue 1px solid;">
  907. <center><div id="CI2_bar" class="div_CleanTank_Status"></div></center>
  908. </td>
  909. <td style="border: lightsteelblue 1px solid;">
  910. </td>
  911. <td style="border: lightsteelblue 1px solid;">
  912. <center><div id="C3_bar" class="div_CleanTank_Status"></div></center>
  913. </td>
  914. <td style="border: lightsteelblue 1px solid;">
  915. <center><div id="C4_bar" class="div_CleanTank_Status"></div></center>
  916. </td>
  917. <td style="border: lightsteelblue 1px solid;">
  918. </td>
  919. <td style="border: lightsteelblue 1px solid;">
  920. <center><div id="S2_bar" class="div_CleanTank_Status"></div></center>
  921. </td>
  922. <td style="border: lightsteelblue 1px solid;">
  923. <center><div id="SO2_bar" class="div_CleanTank_Status"></div></center>
  924. </td>
  925. <td style="border: lightsteelblue 1px solid;">
  926. <center><div id="P2_bar" class="div_CleanTank_Status"></div></center>
  927. </td>
  928. <td style="border: lightsteelblue 1px solid;">
  929. </td>
  930. <td style="border: lightsteelblue 1px solid;">
  931. <center><div id="PO2_bar" class="div_CleanTank_Status"></div></center>
  932. </td>
  933. </tr>
  934. </table>
  935. </div>
  936. </div>
  937. </div>
  938. </div>
  939. </div>
  940. </div>
  941. </div>
  942. {% endblock %}
  943. {% block script2 %}
  944. <script>
  945. function update_data_C(ctid) {
  946. $.get('/loading/C' + ctid, '', function (res) {
  947. if (res.vacuum == 0) {
  948. $("#Ctank_vacuum_status").css("background-color", "#C0C0C0")
  949. } else if (res.vacuum == 1) {
  950. $("#Ctank_vacuum_status").css("background-color", "forestgreen")
  951. } else { $("#Ctank_vacuum_status").css("background-color", "crimson") }
  952. if (res.threewayvalve_input == 0) {
  953. $("#Ctank_threewayvalve_input_status").css("background-color", "#C0C0C0")
  954. } else if (res.threewayvalve_input == 1) {
  955. $("#Ctank_threewayvalve_input_status").css("background-color", "forestgreen")
  956. } else { $("#Ctank_threewayvalve_input_status").css("background-color", "crimson") }
  957. if (res.motor == 0) {
  958. $("#Ctank_motor_status").css("background-color", "#C0C0C0")
  959. }else if (res.motor == 1) {
  960. $("#Ctank_motor_status").css("background-color", "forestgreen")
  961. }
  962. else { $("#Ctank_motor_status").css("background-color", "crimson") }
  963. if (res.solenoid_reclaimed_in == 0) {
  964. $("#Ctank_solenoid_reclaimed_in_status").css("background-color", "#C0C0C0")
  965. } else if (res.solenoid_reclaimed_in == 1) {
  966. $("#Ctank_solenoid_reclaimed_in_status").css("background-color", "forestgreen")
  967. } else { $("#Ctank_solenoid_reclaimed_in_status").css("background-color", "crimson") }
  968. if (res.solenoid_water_in == 0) {
  969. $("#Ctank_solenoid_water_in_status").css("background-color", "#C0C0C0")
  970. } else if (res.solenoid_water_in == 1) {
  971. $("#Ctank_solenoid_water_in_status").css("background-color", "forestgreen")
  972. } else { $("#Ctank_solenoid_water_in_status").css("background-color", "crimson") }
  973. if (res.solenoid_water_out == 0) {
  974. $("#Ctank_solenoid_water_out_status").css("background-color", "#C0C0C0")
  975. } else if (res.solenoid_water_out == 1) {
  976. $("#Ctank_solenoid_water_out_status").css("background-color", "forestgreen")
  977. } else { $("#Ctank_solenoid_water_out_status").css("background-color", "crimson") }
  978. if (res.solenoid_reclaimed_out == 0) {
  979. $("#Ctank_solenoid_reclaimed_out_status").css("background-color", "#C0C0C0")
  980. } else if (res.solenoid_reclaimed_out == 1) {
  981. $("#Ctank_solenoid_reclaimed_out_status").css("background-color", "forestgreen")
  982. } else { $("#Ctank_solenoid_reclaimed_out_status").css("background-color", "crimson") }
  983. if (res.solenoid_disinfect == 0) {
  984. $("#Ctank_solenoid_disinfect_status").css("background-color", "#C0C0C0")
  985. } else if (res.solenoid_disinfect == 1) {
  986. $("#Ctank_solenoid_disinfect_status").css("background-color", "forestgreen")
  987. } else { $("#Ctank_solenoid_disinfect_status").css("background-color", "crimson") }
  988. if (res.pump_disinfect == 0) {
  989. $("#Ctank_pump_disinfect_status").css("background-color", "#C0C0C0")
  990. } else if (res.pump_disinfect == 1) {
  991. $("#Ctank_pump_disinfect_status").css("background-color", "forestgreen")
  992. } else { $("#Ctank_pump_disinfect_status").css("background-color", "crimson") }
  993. if (res.diskvalve == 0) {
  994. $("#Ctank_diskvalve_status").css("background-color", "#C0C0C0")
  995. } else if (res.diskvalve == 1) {
  996. $("#Ctank_diskvalve_status").css("background-color", "forestgreen")
  997. } else { $("#Ctank_diskvalve_status").css("background-color", "crimson") }
  998. if (res.pump_water_in == 0) {
  999. $("#Ctank_pump_water_in_status").css("background-color", "#C0C0C0")
  1000. } else if (res.pump_water_in == 1) {
  1001. $("#Ctank_pump_water_in_status").css("background-color", "forestgreen")
  1002. } else { $("#Ctank_pump_water_in_status").css("background-color", "crimson") }
  1003. if (res.warning_light == 0) {
  1004. $("#Warning_Light_status").css("background-color", "#C0C0C0")
  1005. } else if (res.warning_light == 1) {
  1006. $("#Warning_Light__status").css("background-color", "forestgreen")
  1007. } else { $("#Warning_Light_status").css("background-color", "crimson") }
  1008. $("#CUltraSonic_t_status").text(res.UltraSonic);
  1009. $("#CMotorEncoder_t_status").text(res.Encoder);
  1010. $("#CtankTurbidity_t_status").text(res.tankTurbidity);
  1011. $("#butterflyvalve_status").text(res.butterflyvalve);
  1012. }, 'json');
  1013. $('#C_Modal_title').text("清洗浮選槽 C" + ctid + " 狀態");
  1014. $('#C_actuator_link').attr("href", "/clean_container_tank/" + ctid);
  1015. $('#C_sensor_link').attr("href", "/clean_container_tank/" + ctid);
  1016. $("#C_Vacuum").attr("href", "/actuator_chart_C/vacuum/" + ctid);
  1017. $("#C_threewayvalve_input").attr("href", "/actuator_chart_C/threewayvalve_input/" + ctid);
  1018. $("#C_diskvalve").attr("href", "/actuator_chart_C/diskvalve/" + ctid);
  1019. $("#C_motor").attr("href", "/actuator_chart_C/motor/" + ctid);
  1020. $("#C_solenoid_disinfect").attr("href", "/actuator_chart_C/solenoid_disinfect/" + ctid);
  1021. $("#C_solenoid_water_in").attr("href", "/actuator_chart_C/solenoid_tank_water_in/" + ctid);
  1022. $("#C_solenoid_water_out").attr("href", "/actuator_chart_C/solenoid_tank_water_out/" + ctid);
  1023. $("#C_solenoid_reclaimed_in").attr("href", "/actuator_chart_C/solenoid_reclaimed_in/" + ctid);
  1024. $("#C_solenoid_reclaimed_out").attr("href", "/actuator_chart_C/solenoid_reclaimed_out/" + ctid);
  1025. $("#C_pump_water_in").attr("href", "/actuator_chart_C/pump_water_in/" + ctid);
  1026. $("#C_pump_disinfect").attr("href", "/actuator_chart_C/pump_disinfect/" + ctid);
  1027. $("#Warning_Light").attr("href", "/actuator_chart_C/Warning_Light/" + ctid);
  1028. $("#C_UltraSonic").attr("href", "/sensor_chart_C/UltraSonic/" + ctid);
  1029. $("#C_MotorEncoder").attr("href", "/sensor_chart_C/motorEncoder/" + ctid);
  1030. $("#C_Turbidity").attr("href", "/sensor_chart_C/turbidity/" + ctid);
  1031. $("#butterflyvalve").attr("href", "/sensor_chart_C/butterflyvalve/" + ctid);
  1032. $('#camera_clean_tid').attr("href", "/camera_C" + ctid);
  1033. $('#C_set').attr("href", "/auto_C/" + ctid);
  1034. $('#C_Modal').modal('show');
  1035. }
  1036. function update_data_SO(sotid){
  1037. $.get('/loading/SO' + sotid, '', function (res) {
  1038. $("#SO_UltraSonic_status").text(res.tank_UltraSonic);
  1039. }, 'json');
  1040. $('#SO_Modal_title').text("色選機出料儲豆槽 SO" + sotid + " 狀態");
  1041. $('#SO_actuator_link').attr("href", "/colorselect_container/" + sotid);
  1042. $('#SO_sensor_link').attr("href", "/colorselect_container/" + sotid);
  1043. $("#SO_Vacuum").attr("href", "/actuator_chart_SO/vacuum/" + sotid);
  1044. $('#SO_UltraSonic').attr("href", "/sensor_chart_SO/UltraSonic/" + sotid);
  1045. $('#SO_camera_colorselect_tid').attr("href", "/camera_SO" + sotid);
  1046. $('#SO_set').attr("href", "/auto_SO/" + sotid);
  1047. $('#SO_Modal').modal('show');
  1048. }
  1049. function update_data_S(stid) {
  1050. $.get('/loading/S' + stid, '', function (res) {
  1051. if (res.tank_vacuum == 0) {
  1052. $("#S_vacuum_status").css("background-color", "#C0C0C0")
  1053. } else if (res.tank_vacuum == 1) {
  1054. $("#S_vacuum_status").css("background-color", "forestgreen")
  1055. } else { $("#S_vacuum_status").css("background-color", "crimson") }
  1056. if (res.tank_motor == 0) {
  1057. $("#S_motor_status").css("background-color", "#C0C0C0")
  1058. } else if (res.tank_motor == 1) {
  1059. $("#S_motor_status").css("background-color", "forestgreen")
  1060. } else { $("#S_motor_status").css("background-color", "crimson") }
  1061. if (res.tank_nozzle == 0) {
  1062. $("#S_nozzle_status").css("background-color", "#C0C0C0")
  1063. } else if (res.tank_nozzle == 1) {
  1064. $("#S_nozzle_status").css("background-color", "forestgreen")
  1065. } else { $("#S_nozzle_status").css("background-color", "crimson") }
  1066. $("#S_color_status").text(res.color);
  1067. }, 'json');
  1068. $('#S_Modal_title').text("色選機 S" + stid + " 狀態");
  1069. $('#S_actuator_link').attr("href", "/colorselect_container_tank/" + stid);
  1070. $('#S_sensor_link').attr("href", "/colorselect_container_tank/" + stid);
  1071. $("#S_Vacuum").attr("href", "/actuator_chart_S/vacuum/" + stid);
  1072. $("#S_motor").attr("href", "/actuator_chart_S/motor/" + stid);
  1073. $("#S_nozzle").attr("href", "/actuator_chart_S/nozzle/" + stid);
  1074. $("#S_color").attr("href", "/sensor_chart_S/color/" + stid);
  1075. $('#S_camera_colorselect_tid').attr("href", "/camera_S" + stid);
  1076. $('#S_set').attr("href", "/auto_S/" + stid);
  1077. $('#S_Modal').modal('show');
  1078. }
  1079. function update_data_P(ptid) {
  1080. $.get('/loading/P' + ptid, '', function (res) {
  1081. if (res.tank_vacuum == 0) {
  1082. $("#P_vacuum_status").css("background-color", "#C0C0C0")
  1083. } else if (res.tank_vacuum == 1) {
  1084. $("#P_vacuum_status").css("background-color", "forestgreen")
  1085. } else { $("#P_vacuum_status").css("background-color", "crimson") }
  1086. if (res.tank_motor == 1 ) {
  1087. $("#tank_motor_status").css("background-color", "forestgreen")
  1088. } else if (res.tank_motor == 0) {
  1089. $("#tank_motor_status").css("background-color", "#C0C0C0")
  1090. } else { $("#tank_motor_status").css("background-color", "crimson") }
  1091. $("#P_motorEncoder_status").text(res.motorEncoder);
  1092. }, 'json');
  1093. $('#P_Modal_title').text("脫皮機 P" + ptid + " 狀態");
  1094. $('#P_actuator_link').attr("href", "/peel_container_tank/" + ptid);
  1095. $('#P_sensor_link').attr("href", "/peel_container_tank/" + ptid);
  1096. $("#P_Vacuum").attr("href", "/actuator_chart_P/vacuum/" + ptid);
  1097. $("#motor").attr("href", "/actuator_chart_P/motor/" + ptid);
  1098. $("#motorEncoder").attr("href", "/sensor_chart_P/motorEncoder/" + ptid);
  1099. $('#camera_peel_tid').attr("href", "/camera_P" + ptid);
  1100. $('#P_set').attr("href", "/auto_P/" + ptid);
  1101. $('#P_Modal').modal('show');
  1102. }
  1103. function update_data_CI(citid){
  1104. $.get('loading/CI' + citid, '', function (res){
  1105. if (res.input_vacuum == 0) {
  1106. $("#CI_vacuum_status").css("background-color", "#C0C0C0")
  1107. } else if (res.input_vacuum == 1) {
  1108. $("#CI_vacuum_status").css("background-color", "forestgreen")
  1109. } else { $("#CI_vacuum_status").css("background-color", "crimson") }
  1110. $("#CI_UltraSonic_status").text(res.input_UltraSonic);
  1111. }, 'json');
  1112. $('#CI_Modal_title').text("清洗浮選出料儲豆槽 CI" + citid + " 狀態");
  1113. $('#CI_actuator_link').attr("href", "/clean_container/" + citid);
  1114. $('#CI_sensor_link').attr("href", "/clean_container/" + citid);
  1115. $("#input_Vacuum").attr("href", "/actuator_chart_CI/vacuum/" + citid);
  1116. $('#CI_UltraSonic').attr("href", "/sensor_chart_CI/UltraSonic/" + citid);
  1117. $('#CI_camera_clean_tid').attr("href", "/camera_CI" + citid);
  1118. $('#CI_set').attr("href", "/auto_CI/" + citid);
  1119. $('#CI_Modal').modal('show');
  1120. }
  1121. function update_data_PO(potid){
  1122. $.get('loading/PO' + potid, '', function (res){
  1123. if (res.output_vacuum == 0) {
  1124. $("#PO_vacuum_status").css("background-color", "#C0C0C0")
  1125. } else if (res.output_vacuum == 1) {
  1126. $("#PO_vacuum_status").css("background-color", "forestgreen")
  1127. } else { $("#PO_vacuum_status").css("background-color", "crimson") }
  1128. $("#PO_UltraSonic_status").text(res.output_UltraSonic);
  1129. }, 'json');
  1130. $('#PO_Modal_title').text("脫皮機出料儲豆槽 PO" + potid + " 狀態");
  1131. $('#PO_actuator_link').attr("href", "/peel_container/" + potid);
  1132. $('#PO_sensor_link').attr("href", "/peel_container/" + potid);
  1133. $("#output_Vacuum").attr("href", "/actuator_chart_PO/vacuum/" + potid)
  1134. $('#PO_UltraSonic').attr("href", "/sensor_chart_PO/UltraSonic/" + potid);
  1135. $('#PO_camera_peel_tid').attr("href", "/camera_PO" + potid);
  1136. $('#PO_set').attr("href", "/auto_PO/" + potid);
  1137. $('#PO_Modal').modal('show');
  1138. }
  1139. function update_data_R(rtid){
  1140. $.get('/loading/R' + rtid, '', function (res) {
  1141. if (res.tank_solenoid_water_in == 0) {
  1142. $("#R_solenoid_water_in_status").css("background-color", "#C0C0C0")
  1143. } else if (res.tank_solenoid_water_in == 1) {
  1144. $("#R_solenoid_water_in_status").css("background-color", "forestgreen")
  1145. } else { $("#R_solenoid_water_in_status").css("background-color", "crimson") }
  1146. if (res.tank_solenoid_reclaimed_out == 0) {
  1147. $("#R_solenoid_reclaimed_out_status").css("background-color", "#C0C0C0")
  1148. } else if (res.tank_solenoid_reclaimed_out == 1) {
  1149. $("#R_solenoid_reclaimed_out_status").css("background-color", "forestgreen")
  1150. } else { $("#R_solenoid_reclaimed_out_status").css("background-color", "crimson") }
  1151. if (res.tank_solenoid_water_out == 0) {
  1152. $("#R_solenoid_water_out_status").css("background-color", "#C0C0C0")
  1153. } else if (res.tank_solenoid_water_out == 1) {
  1154. $("#R_solenoid_water_out_status").css("background-color", "forestgreen")
  1155. } else { $("#R_solenoid_water_out_status").css("background-color", "crimson") }
  1156. if (res.tank_pump_reclaimed_out == 0) {
  1157. $("#R_pump_reclaimed_out_status").css("background-color", "#C0C0C0")
  1158. } else if (res.tank_pump_reclaimed_out == 1) {
  1159. $("#R_pump_reclaimed_out_status").css("background-color", "forestgreen")
  1160. } else { $("#R_pump_reclaimed_out_status").css("background-color", "crimson") }
  1161. $("#R_UltraSonic_status").text(res.tank_UltraSonic);
  1162. $("#R_Turbidity_status").text(res.tank_Turbidity);
  1163. }, 'json');
  1164. $('#R_Modal_title').text("中水桶 R" + rtid + " 狀態");
  1165. $('#R_actuator_link').attr("href", "/reclaimedwater_tank/" + rtid);
  1166. $('#R_sensor_link').attr("href", "/reclaimedwater_tank/" + rtid);
  1167. $('#R_solenoid_water_in').attr("href", "/actuator_chart_R/solenoid_water_in/" + rtid);
  1168. $('#R_solenoid_reclaimed_out').attr("href", "/actuator_chart_R/solenoid_reclaimed_out/" + rtid);
  1169. $('#R_solenoid_water_out').attr("href", "/actuator_chart_R/solenoid_water_out/" + rtid);
  1170. $('#R_pump_reclaimed_out').attr("href", "/actuator_chart_R/pump_reclaimed_out/" + rtid);
  1171. $('#R_UltraSonic').attr("href", "/sensor_chart_R/UltraSonic/" + rtid);
  1172. $('#R_camera_reclaimedwater_tid').attr("href", "/camera_R" + rtid);
  1173. $('#R_set').attr("href", "/auto_R/" + rtid);
  1174. $('#R_Modal').modal('show');
  1175. }
  1176. var button_CI1 = document.getElementById('CI1');
  1177. button_CI1.addEventListener('click', function () { update_data_CI("1") });
  1178. var button_CI2 = document.getElementById('CI2');
  1179. button_CI2.addEventListener('click', function () { update_data_CI("2") });
  1180. var button_C1 = document.getElementById('C1');
  1181. button_C1.addEventListener('click', function () { update_data_C("1") });
  1182. var button_C3 = document.getElementById('C3');
  1183. button_C3.addEventListener('click', function () { update_data_C("3") });
  1184. var button_C2 = document.getElementById('C2');
  1185. button_C2.addEventListener('click', function () { update_data_C("2") });
  1186. var button_C4 = document.getElementById('C4');
  1187. button_C4.addEventListener('click', function () { update_data_C("4") });
  1188. var button_R1 = document.getElementById('R1');
  1189. button_R1.addEventListener('click', function () { update_data_R("1") });
  1190. var button_S1 = document.getElementById('S1');
  1191. button_S1.addEventListener('click', function () { update_data_S("1") });
  1192. var button_S2 = document.getElementById('S2');
  1193. button_S2.addEventListener('click', function () { update_data_S("2") });
  1194. var button_SO1 = document.getElementById('SO1');
  1195. button_SO1.addEventListener('click', function () { update_data_SO("1") });
  1196. var button_SO2 = document.getElementById('SO2');
  1197. button_SO2.addEventListener('click', function () { update_data_SO("2") });
  1198. var button_P1 = document.getElementById('P1');
  1199. button_P1.addEventListener('click', function () { update_data_P("1") });
  1200. var button_P2 = document.getElementById('P2');
  1201. button_P2.addEventListener('click', function () { update_data_P("2") });
  1202. var button_PO1 = document.getElementById('PO1');
  1203. button_PO1.addEventListener('click', function () { update_data_PO("1") });
  1204. var button_PO2 = document.getElementById('PO2');
  1205. button_PO2.addEventListener('click', function () { update_data_PO("2") });
  1206. </script>
  1207. {% endblock %}