clean_container_1124舊架構備份.html 74 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>{{ title }}</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  7. <!-- <meta http-equiv="refresh" content="5" /> 每 content 秒網頁自動更新-->
  8. <!-- 新 Bootstrap4 核心 CSS 文件 -->
  9. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
  10. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  11. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  12. <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
  13. <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  14. <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  15. <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  16. <!--可用來建立使用者小圖示-->
  17. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  18. <!-- Socket.IO -->
  19. <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.0/socket.io.dev.js"></script>
  20. <script type="text/javascript" charset="UTF-8">
  21. /*
  22. $(document).ready(function(){
  23. var url = 'http://0.0.0.0';
  24. var port = '5000';
  25. var socket = io.connent(url + ':' + port);
  26. socket.on('connect', function(){
  27. socket.emit('connect_event', { data: 'connected!'});
  28. })
  29. socket.on('server_response', function(event){
  30. socket.emit('client_event', {data: $('#emit_data').val()});
  31. return false;
  32. });
  33. })
  34. */
  35. </script>
  36. <script language="JavaScript">
  37. // 指定 10秒 刷新網頁一次
  38. var ctid = '{{tid}}';
  39. console.log('ctid:' + ctid)
  40. // WebUpdate_set = setTimeout(function(){WebUpdate(ctid)} , 5 * 1000)
  41. // var WebUpdate_set
  42. $(document).ready(function(){
  43. // WebUpdate_set = setTimeout(function(){WebUpdate(ctid)}, 5 * 1000);
  44. // var WebUpdate_set
  45. // setInterval(function(){location.reload()}, 300 * 1000) // 每八分鐘重新整理
  46. });
  47. </script>
  48. <style>
  49. .footer{
  50. position: absolute;
  51. width: 100%;
  52. background-color: #eee;
  53. text-align: center;
  54. }
  55. body {
  56. margin: 0;
  57. }
  58. input[type="button"] {
  59. padding: 4px 15px;
  60. background: #f3f3f3;
  61. border: 0 none;
  62. cursor: pointer;
  63. -webkit-border-radius: 5px;
  64. border-radius: 5px;
  65. }
  66. .navbar-dark .navbar-nav .nav-link {
  67. color: white;
  68. cursor: pointer;
  69. text-decoration: none;
  70. width: 110px;
  71. height: 46px;
  72. }
  73. .nav-top {
  74. line-height: 40px;
  75. background-color: #C4C4C4;
  76. }
  77. .website_title {
  78. font-family: Roboto;
  79. font-style: normal;
  80. font-weight: normal;
  81. font-size: 30px;
  82. color: #000000;
  83. }
  84. .navbar-nav>li {
  85. float: none;
  86. display: inline-block;
  87. width: 70px;
  88. margin: 0 auto;
  89. text-align: center;
  90. }
  91. .navbar-nav>li a {
  92. font-size: 20px;
  93. }
  94. .main-page {
  95. margin-top: 200px;
  96. }
  97. .page-title {
  98. font-family: Roboto;
  99. font-style: normal;
  100. font-weight: bold;
  101. font-size: 36px;
  102. }
  103. .flex {
  104. display: flex;
  105. flex-direction: row;
  106. flex-wrap: wrap;
  107. justify-content: left;
  108. }
  109. .set-link {
  110. display: inline-block;
  111. width: 350px;
  112. height: 70px;
  113. line-height: 70px;
  114. background: #008CBA;
  115. border: 1px solid #CFCFCF;
  116. box-sizing: border-box;
  117. color: #FFFFFF;
  118. border-radius: 10px;
  119. font-size: 36px;
  120. }
  121. .cmn-toggle {
  122. position: absolute;
  123. margin-left: 0px;
  124. visibility: hidden;
  125. }
  126. .cmn-toggle+label {
  127. display: block;
  128. position: relative;
  129. cursor: pointer;
  130. outline: none;
  131. user-select: none;
  132. }
  133. input.cmn-toggle-round-flat+label {
  134. padding: 2px;
  135. width: 60px;
  136. height: 30px;
  137. background-color: #C0C0C0;
  138. border-radius: 60px;
  139. transition: background 0.4s;
  140. }
  141. input.cmn-toggle-round-flat+label:before,
  142. input.cmn-toggle-round-flat+label:after {
  143. display: block;
  144. position: absolute;
  145. content: "";
  146. }
  147. input.cmn-toggle-round-flat+label:before {
  148. top: 2px;
  149. left: 2px;
  150. bottom: 2px;
  151. right: 2px;
  152. background-color: #fff;
  153. border-radius: 60px;
  154. transition: background 0.4s;
  155. }
  156. input.cmn-toggle-round-flat+label:after {
  157. top: 4px;
  158. left: 4px;
  159. bottom: 4px;
  160. width: 24px;
  161. background-color: #dddddd;
  162. border-radius: 52px;
  163. transition: margin 0.4s, background 0.4s;
  164. }
  165. input.cmn-toggle-round-flat:checked+label {
  166. background-color: #C0C0C0;
  167. }
  168. input.cmn-toggle-round-flat:checked+label:after {
  169. margin-left: 27px;
  170. background-color: #008CBA;
  171. }
  172. @media(max-width:373px) {
  173. .card {
  174. margin-right: 0px;
  175. }
  176. .set-link {
  177. width: 250px;
  178. }
  179. }
  180. @media(max-width:577px) {}
  181. @media(min-width:576px) {}
  182. @media(min-width:768px) {
  183. .navbar-nav>li {
  184. margin-left: 0px;
  185. }
  186. .navbar-nav .li-block {
  187. display: none;
  188. }
  189. }
  190. @media(min-width:991px) {
  191. .navbar-nav>li {
  192. margin-left: 20px;
  193. }
  194. .navbar-nav .li-block {
  195. display: none;
  196. }
  197. }
  198. @media(min-width:1200px) {
  199. .navbar-nav>li {
  200. margin-left: 50px;
  201. }
  202. .navbar-nav .li-block {
  203. display: inline-block;
  204. width: 70px;
  205. }
  206. }
  207. @media(min-width:1400px) {
  208. .navbar-nav .li-block {
  209. display: inline-block;
  210. width: 200px;
  211. }
  212. }
  213. @media(min-width:1689px) {
  214. .navbar-nav>li {
  215. margin-left: 50px;
  216. }
  217. .navbar-nav .li-block {
  218. display: inline-block;
  219. width: 500px;
  220. }
  221. }
  222. </style>
  223. <script>
  224. // 清洗浮選 制動器開關
  225. var tank_num = '{{tid}}';
  226. // 入料 真空吸料機
  227. function inputVacuum() {
  228. var status = "off";
  229. var check = $("input[name=input_vacuum_status]:checked"); // 這裡面是 jQuery 撈取資料的方法, jQuery 常使用到 $ 錢字號
  230. console.log('check:', check);
  231. //大於0代表有被選中, 如果有多個可以呈現勾取的項目數量
  232. if (check.length > 0) {
  233. status = "on";
  234. $("#cmn-toggle-02").prop('checked', false); // 確認是否勾選
  235. if (!confirm("你確定要開啟入料儲豆槽真空吸料機嗎?")) {
  236. return false;
  237. };
  238. } else {
  239. $("#cmn-toggle-02").prop('checked', true);
  240. if (!confirm("你確定要關閉入料儲豆槽真空吸料機嗎?")) {
  241. return false;
  242. };
  243. };
  244. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": status };
  245. // jquery 請求 '/mqtt/{{tid}}' 頁面
  246. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  247. console.log('data:', data)
  248. if (res == 'on') {
  249. $("#cmn-toggle-02").prop('checked', true);
  250. setTimeout("alert('入料儲豆槽真空吸料機_開啟成功!')", 500);
  251. } else if (res == 'off') {
  252. $("#cmn-toggle-02").prop('checked', false);
  253. setTimeout("alert('入料儲豆槽真空吸料機_關閉成功!')", 500);
  254. } else {
  255. alert(res);
  256. };
  257. }, 'text')
  258. // setTimeout(function () { location.reload(); }, 500);
  259. };
  260. function inputVacuum_ON() {
  261. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": "on" };
  262. // jquery 請求 '/mqtt/{{tid}}' 頁面
  263. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  264. console.log('data:', data)
  265. if (res == 'on') {
  266. $("#cmn-toggle-02").prop('checked', true);
  267. } else if (res == 'off') {
  268. $("#cmn-toggle-02").prop('checked', false);
  269. } else {
  270. };
  271. }, 'text')
  272. // setTimeout(function () { location.reload(); }, 500);
  273. };
  274. function inputVacuum_OFF() {
  275. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": "off" };
  276. // jquery 請求 '/mqtt/{{tid}}' 頁面
  277. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  278. console.log('data:', data)
  279. if (res == 'on') {
  280. $("#cmn-toggle-02").prop('checked', true);
  281. } else if (res == 'off') {
  282. $("#cmn-toggle-02").prop('checked', false);
  283. } else {
  284. };
  285. }, 'text')
  286. // setTimeout(function () { location.reload(); }, 500);
  287. };
  288. // 桶內 真空吸料機
  289. function tankVacuum() {
  290. var status = "off";
  291. var check = $("input[name=tank_vacuum_status]:checked");
  292. console.log('check:', check);
  293. //大於0代表有被選中
  294. if (check.length > 0) {
  295. status = "on";
  296. $("#cmn-toggle-05").prop('checked', false);
  297. if (!confirm("你確定要開啟真空吸料機嗎?")) {
  298. return false;
  299. };
  300. } else {
  301. $("#cmn-toggle-05").prop('checked', true);
  302. if (!confirm("你確定要關閉真空吸料機嗎?")) {
  303. return false;
  304. };
  305. };
  306. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": status };
  307. $.post('/mqtt/{{tid}}', data, function (res) {
  308. console.log('data:', data)
  309. if (res == 'on') {
  310. $("#cmn-toggle-05").prop('checked', true);
  311. setTimeout("alert('真空吸料機_開啟成功!')", 500);
  312. } else if (res == 'off') {
  313. $("#cmn-toggle-05").prop('checked', false);
  314. setTimeout("alert('真空吸料機_關閉成功!')", 500);
  315. } else {
  316. alert(res);
  317. };
  318. }, 'text')
  319. // setTimeout(function () { location.reload(); }, 500);
  320. };
  321. function tankVacuum_ON() {
  322. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": "on" };
  323. $.post('/mqtt/{{tid}}', data, function (res) {
  324. console.log('data:', data)
  325. if (res == 'on') {
  326. $("#cmn-toggle-05").prop('checked', true);
  327. } else if (res == 'off') {
  328. $("#cmn-toggle-05").prop('checked', false);
  329. } else {
  330. };
  331. }, 'text')
  332. // setTimeout(function () { location.reload(); }, 500);
  333. };
  334. function tankVacuum_OFF() {
  335. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": "off" };
  336. $.post('/mqtt/{{tid}}', data, function (res) {
  337. console.log('data:', data)
  338. if (res == 'on') {
  339. $("#cmn-toggle-05").prop('checked', true);
  340. } else if (res == 'off') {
  341. $("#cmn-toggle-05").prop('checked', false);
  342. } else {
  343. };
  344. }, 'text')
  345. // setTimeout(function () { location.reload(); }, 500);
  346. };
  347. // 浮選槽注水 雙核隔膜泵 出水口 2、3_雙核泵
  348. function tankPumpWaterL2L3() {
  349. //<!--setInterval(Relay,10000);-->
  350. var status = "off";
  351. var check = $("input[name=tank_pump_waterL2L3_status]:checked");
  352. //大於0代表有被選中
  353. if (check.length > 0) {
  354. status = "on";
  355. $("#cmn-toggle-08").prop('checked', false);
  356. if (!confirm("你確定要開啟浮選槽注水嗎?")) {
  357. return false;
  358. };
  359. } else {
  360. $("#cmn-toggle-08").prop('checked', true);
  361. if (!confirm("你確定要關閉浮選槽注水嗎?")) {
  362. return false;
  363. };
  364. };
  365. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2L3_status", "value": status };
  366. $.post('/mqtt/{{tid}}', data, function (res) {
  367. console.log('data:', data)
  368. if (res == 'on') {
  369. $("#cmn-toggle-08").prop('checked', true);
  370. setTimeout("alert('浮選槽注水入料_開啟成功!')", 500);
  371. } else if (res == 'off') {
  372. $("#cmn-toggle-08").prop('checked', false);
  373. setTimeout("alert('浮選槽注水排氣_關閉成功!')", 500);
  374. } else {
  375. alert(res);
  376. };
  377. }, 'text')
  378. // setTimeout(function () { location.reload(); }, 500);
  379. };
  380. function tankPumpWaterL2L3_ON() {
  381. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2L3_status", "value": "on" };
  382. $.post('/mqtt/{{tid}}', data, function (res) {
  383. console.log('data:', data)
  384. if (res == 'on') {
  385. $("#cmn-toggle-08").prop('checked', true);
  386. } else if (res == 'off') {
  387. $("#cmn-toggle-08").prop('checked', false);
  388. } else {
  389. };
  390. }, 'text')
  391. // setTimeout(function () { location.reload(); }, 500);
  392. };
  393. function tankPumpWaterL2L3_OFF() {
  394. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2L3_status", "value": "off" };
  395. $.post('/mqtt/{{tid}}', data, function (res) {
  396. console.log('data:', data)
  397. if (res == 'on') {
  398. $("#cmn-toggle-08").prop('checked', true);
  399. } else if (res == 'off') {
  400. $("#cmn-toggle-08").prop('checked', false);
  401. } else {
  402. };
  403. }, 'text')
  404. // setTimeout(function () { location.reload(); }, 500);
  405. };
  406. // 第 2 層灑水 雙核隔膜泵 出水口 4、5_雙核泵
  407. function tankPumpWaterL4L5() {
  408. //<!--setInterval(Relay,10000);-->
  409. var status = "off";
  410. var check = $("input[name=tank_pump_waterL4L5_status]:checked");
  411. //大於0代表有被選中
  412. if (check.length > 0) {
  413. status = "on";
  414. $("#cmn-toggle-11").prop('checked', false);
  415. if (!confirm("你確定要開啟清洗第 2 層灑水嗎?")) {
  416. return false;
  417. };
  418. } else {
  419. $("#cmn-toggle-11").prop('checked', true);
  420. if (!confirm("你確定要關閉清洗第 2 層灑水嗎?")) {
  421. return false;
  422. };
  423. };
  424. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4L5_status", "value": status };
  425. $.post('/mqtt/{{tid}}', data, function (res) {
  426. console.log('data:', data)
  427. if (res == 'on') {
  428. $("#cmn-toggle-11").prop('checked', true);
  429. setTimeout("alert('清洗第 2 層灑水_開啟成功!')", 500);
  430. } else if (res == 'off') {
  431. $("#cmn-toggle-11").prop('checked', false);
  432. setTimeout("alert('清洗第 2 層灑水_關閉成功!')", 500);
  433. } else {
  434. alert(res);
  435. };
  436. }, 'text')
  437. // setTimeout(function () { location.reload(); }, 500);
  438. };
  439. function tankPumpWaterL4L5_ON() {
  440. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4L5_status", "value": "on" };
  441. $.post('/mqtt/{{tid}}', data, function (res) {
  442. console.log('data:', data)
  443. if (res == 'on') {
  444. $("#cmn-toggle-11").prop('checked', true);
  445. } else if (res == 'off') {
  446. $("#cmn-toggle-11").prop('checked', false);
  447. } else {
  448. };
  449. }, 'text')
  450. // setTimeout(function () { location.reload(); }, 500);
  451. };
  452. function tankPumpWaterL4L5_OFF() {
  453. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4L5_status", "value": "off" };
  454. $.post('/mqtt/{{tid}}', data, function (res) {
  455. console.log('data:', data)
  456. if (res == 'on') {
  457. $("#cmn-toggle-11").prop('checked', true);
  458. } else if (res == 'off') {
  459. $("#cmn-toggle-11").prop('checked', false);
  460. } else {
  461. };
  462. }, 'text')
  463. // setTimeout(function () { location.reload(); }, 500);
  464. };
  465. // 第 4 層灑水 雙核隔膜泵 入水口_雙核泵
  466. function tankPumpWaterInput() {
  467. var status = "off";
  468. var check = $("input[name=tank_pump_waterInput_status]:checked");
  469. //大於0代表有被選中
  470. if (check.length > 0) {
  471. status = "on";
  472. $("#cmn-toggle-14").prop('checked', false);
  473. if (!confirm("你確定要開啟清洗第 4 層灑水嗎?")) {
  474. return false;
  475. };
  476. } else {
  477. $("#cmn-toggle-14").prop('checked', true);
  478. if (!confirm("你確定要關閉清洗第 4 層灑水嗎?")) {
  479. return false;
  480. };
  481. };
  482. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterInput_status", "value": status };
  483. $.post('/mqtt/{{tid}}', data, function (res) {
  484. console.log('data:', data)
  485. if (res == 'on') {
  486. $("#cmn-toggle-14").prop('checked', true);
  487. setTimeout("alert('清洗第 4 層灑水_開啟成功!')", 500);
  488. } else if (res == 'off') {
  489. $("#cmn-toggle-14").prop('checked', false);
  490. setTimeout("alert('清洗第 4 層灑水_關閉成功!')", 500);
  491. } else {
  492. alert(res);
  493. };
  494. }, 'text')
  495. // setTimeout(function () { location.reload(); }, 500);
  496. };
  497. function tankPumpWaterInput_ON() {
  498. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterInput_status", "value": "on" };
  499. $.post('/mqtt/{{tid}}', data, function (res) {
  500. console.log('data:', data)
  501. if (res == 'on') {
  502. $("#cmn-toggle-14").prop('checked', true);
  503. } else if (res == 'off') {
  504. $("#cmn-toggle-14").prop('checked', false);
  505. } else {
  506. };
  507. }, 'text')
  508. // setTimeout(function () { location.reload(); }, 500);
  509. };
  510. function tankPumpWaterInput_OFF() {
  511. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterInput_status", "value": "off" };
  512. $.post('/mqtt/{{tid}}', data, function (res) {
  513. console.log('data:', data)
  514. if (res == 'on') {
  515. $("#cmn-toggle-14").prop('checked', true);
  516. } else if (res == 'off') {
  517. $("#cmn-toggle-14").prop('checked', false);
  518. } else {
  519. };
  520. }, 'text')
  521. // setTimeout(function () { location.reload(); }, 500);
  522. };
  523. // 清洗第 3 層 電磁閥 出水口 2、3_電磁閥
  524. function tankSolenoidWaterL2L3() {
  525. var status = "off";
  526. var check = $("input[name=tank_solenoid_waterL2L3_status]:checked");
  527. //大於0代表有被選中
  528. if (check.length > 0) {
  529. status = "on";
  530. $("#cmn-toggle-17").prop('checked', false);
  531. if (!confirm("你確定要開啟清洗第 3 層電磁閥嗎?")) {
  532. return false;
  533. };
  534. } else {
  535. $("#cmn-toggle-17").prop('checked', true);
  536. if (!confirm("你確定要關閉清洗第 3 層電磁閥嗎?")) {
  537. return false;
  538. };
  539. };
  540. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL2L3_status", "value": status };
  541. $.post('/mqtt/{{tid}}', data, function (res) {
  542. console.log('data:', data)
  543. if (res == 'on') {
  544. $("#cmn-toggle-17").prop('checked', true);
  545. setTimeout("alert('清洗第 3 層電磁閥_開啟成功!')", 500);
  546. } else if (res == 'off') {
  547. $("#cmn-toggle-17").prop('checked', false);
  548. setTimeout("alert('清洗第 3 層電磁閥_關閉成功!')", 500);
  549. } else {
  550. alert(res);
  551. };
  552. }, 'text')
  553. // setTimeout(function () { location.reload(); }, 500);
  554. };
  555. function tankSolenoidWaterL2L3_ON() {
  556. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL2L3_status", "value": "on" };
  557. $.post('/mqtt/{{tid}}', data, function (res) {
  558. console.log('data:', data)
  559. if (res == 'on') {
  560. $("#cmn-toggle-17").prop('checked', true);
  561. } else if (res == 'off') {
  562. $("#cmn-toggle-17").prop('checked', false);
  563. } else {
  564. };
  565. }, 'text')
  566. // setTimeout(function () { location.reload(); }, 500);
  567. };
  568. function tankSolenoidWaterL2L3_OFF() {
  569. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL2L3_status", "value": "off" };
  570. $.post('/mqtt/{{tid}}', data, function (res) {
  571. console.log('data:', data)
  572. if (res == 'on') {
  573. $("#cmn-toggle-17").prop('checked', true);
  574. } else if (res == 'off') {
  575. $("#cmn-toggle-17").prop('checked', false);
  576. } else {
  577. };
  578. }, 'text')
  579. // setTimeout(function () { location.reload(); }, 500);
  580. };
  581. // 清洗第 5 層 電磁閥 出水口 4、5_電磁閥
  582. function tankSolenoidWaterL4L5() {
  583. var status = "off";
  584. var check = $("input[name=tank_solenoid_waterL4L5_status]:checked");
  585. //大於0代表有被選中
  586. if (check.length > 0) {
  587. status = "on";
  588. $("#cmn-toggle-20").prop('checked', false);
  589. if (!confirm("你確定要開啟清洗第 5 層電磁閥嗎?")) {
  590. return false;
  591. };
  592. } else {
  593. $("#cmn-toggle-20").prop('checked', true);
  594. if (!confirm("你確定要關閉清洗第 5 層電磁閥嗎?")) {
  595. return false;
  596. };
  597. };
  598. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL4L5_status", "value": status };
  599. $.post('/mqtt/{{tid}}', data, function (res) {
  600. console.log('data:', data)
  601. if (res == 'on') {
  602. $("#cmn-toggle-20").prop('checked', true);
  603. setTimeout("alert('清洗第 5 層電磁閥_開啟成功!')", 500);
  604. } else if (res == 'off') {
  605. $("#cmn-toggle-20").prop('checked', false);
  606. setTimeout("alert('清洗第 5 層電磁閥_關閉成功!')", 500);
  607. } else {
  608. alert(res);
  609. };
  610. }, 'text')
  611. // setTimeout(function () { location.reload(); }, 500);
  612. };
  613. function tankSolenoidWaterL4L5_ON() {
  614. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL4L5_status", "value": "on" };
  615. $.post('/mqtt/{{tid}}', data, function (res) {
  616. console.log('data:', data)
  617. if (res == 'on') {
  618. $("#cmn-toggle-20").prop('checked', true);
  619. } else if (res == 'off') {
  620. $("#cmn-toggle-20").prop('checked', false);
  621. } else {
  622. };
  623. }, 'text')
  624. // setTimeout(function () { location.reload(); }, 500);
  625. };
  626. function tankSolenoidWaterL4L5_OFF() {
  627. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL4L5_status", "value": "off" };
  628. $.post('/mqtt/{{tid}}', data, function (res) {
  629. console.log('data:', data)
  630. if (res == 'on') {
  631. $("#cmn-toggle-20").prop('checked', true);
  632. } else if (res == 'off') {
  633. $("#cmn-toggle-20").prop('checked', false);
  634. } else {
  635. };
  636. }, 'text')
  637. // setTimeout(function () { location.reload(); }, 500);
  638. };
  639. // 步進馬達
  640. /*
  641. function tankSteppingMotor() {
  642. var motor_data = $("input[name=steppingmotor_rpm_data]").val();
  643. if (motor_data == '') {
  644. alert("請先輸入要運轉的值!");
  645. return false;
  646. } else if (motor_data == 0) {
  647. alert("轉速 0 為關閉步進馬達");
  648. } else if (Number(motor_data) < -50 || Number(motor_data) > 50 || !Number(motor_data)) {
  649. alert("您輸入的值已超過範圍,請重新輸入!" + !Number(motor_data));
  650. return false;
  651. };
  652. if (motor_data != 0) {
  653. value = motor_data;
  654. if (!confirm("你確定要開啟步進馬達,運轉速度為 " + motor_data + " 嗎?")) {
  655. return false;
  656. };
  657. } else {
  658. if (!confirm("你確定要關閉步進馬達嗎?")) {
  659. return false;
  660. };
  661. };
  662. var data = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": motor_data };
  663. $.post('/mqtt/{{tid}}', data, function (res) {
  664. console.log('data:', data)
  665. if (res == 'on') {
  666. setTimeout("alert('步進馬達_開啟成功!')", 500);
  667. } else if (res == 'off') {
  668. setTimeout("alert('步進馬達_關閉成功!')", 500);
  669. } else {
  670. alert(res);
  671. };
  672. }, 'text')
  673. // setTimeout(function () { location.reload(); }, 500);
  674. };
  675. */
  676. function tankSteppingMotor_STOP() {
  677. var data = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "off" };
  678. $.post('/mqtt/{{tid}}', data, function (res) {
  679. console.log('data:', data)
  680. }, 'text')
  681. // setTimeout(function () { location.reload(); }, 500);
  682. };
  683. function tankSteppingMotor_UP() {
  684. var data = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "on", "dir":"up"};
  685. $.post('/mqtt/{{tid}}', data, function (res) {
  686. console.log('data:', data)
  687. }, 'text')
  688. // setTimeout(function () { location.reload(); }, 500);
  689. };
  690. function tankSteppingMotor_DOWN() {
  691. var data = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "on", "dir":"down" };
  692. $.post('/mqtt/{{tid}}', data, function (res) {
  693. console.log('data:', data)
  694. }, 'text')
  695. // setTimeout(function () { location.reload(); }, 500);
  696. };
  697. function tankSteppingMotor_UPSTOP() {
  698. var data_up = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "on", "dir":"up"};
  699. $.post('/mqtt/{{tid}}', data_up, function (res) {
  700. console.log('data:', data_up)
  701. }, 'text')
  702. var time = new Date();
  703. while ((new Date() - time) < 1 * 1000) { };
  704. var data_stop = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "off" };
  705. $.post('/mqtt/{{tid}}', data_stop, function (res) {
  706. console.log('data:', data_stop)
  707. }, 'text')
  708. };
  709. function tankSteppingMotor_DOWNSTOP() {
  710. var data_down = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "on", "dir":"down"};
  711. $.post('/mqtt/{{tid}}', data_down, function (res) {
  712. console.log('data:', data_down)
  713. }, 'text')
  714. var time = new Date();
  715. while ((new Date() - time) < 1 * 1000) { };
  716. var data_stop = { "tank_num": "C" + tank_num, "command": "step_motor_status", "value": "off" };
  717. $.post('/mqtt/{{tid}}', data_stop, function (res) {
  718. console.log('data:', data_stop)
  719. }, 'text')
  720. };
  721. // 出料 真空吸料機
  722. function outputVacuum() {
  723. var status = "off";
  724. var check = $("input[name=output_vacuum_status]:checked");
  725. //大於0代表有被選中
  726. if (check.length > 0) {
  727. status = "on";
  728. $("#cmn-toggle-26").prop('checked', false);
  729. if (!confirm("你確定要開啟出料儲豆槽真空吸料機嗎?")) {
  730. return false;
  731. };
  732. } else {
  733. $("#cmn-toggle-26").prop('checked', true);
  734. if (!confirm("你確定要關閉出料儲豆槽真空吸料機嗎?")) {
  735. return false;
  736. };
  737. };
  738. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": status };
  739. console.log('data:', data)
  740. $.post('/mqtt/{{tid}}', data, function (res) {
  741. if (res == 'on') {
  742. $("#cmn-toggle-26").prop('checked', true);
  743. setTimeout("alert('出料儲豆槽真空吸料機_開啟成功!')", 500);
  744. } else if (res == 'off') {
  745. $("#cmn-toggle-26").prop('checked', false);
  746. setTimeout("alert('出料儲豆槽真空吸料機_關閉成功!')", 500);
  747. } else {
  748. alert(res);
  749. };
  750. }, 'text')
  751. // setTimeout(function () { location.reload(); }, 500);
  752. };
  753. function outputVacuum_ON() {
  754. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": "on" };
  755. console.log('data:', data)
  756. $.post('/mqtt/{{tid}}', data, function (res) {
  757. if (res == 'on') {
  758. $("#cmn-toggle-26").prop('checked', true);
  759. } else if (res == 'off') {
  760. $("#cmn-toggle-26").prop('checked', false);
  761. } else {
  762. };
  763. }, 'text')
  764. // setTimeout(function () { location.reload(); }, 500);
  765. };
  766. function outputVacuum_OFF() {
  767. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": "off" };
  768. console.log('data:', data)
  769. $.post('/mqtt/{{tid}}', data, function (res) {
  770. if (res == 'on') {
  771. $("#cmn-toggle-26").prop('checked', true);
  772. } else if (res == 'off') {
  773. $("#cmn-toggle-26").prop('checked', false);
  774. } else {
  775. };
  776. }, 'text')
  777. // setTimeout(function () { location.reload(); }, 500);
  778. };
  779. </script>
  780. </head>
  781. <body>
  782. 狀態更新時間(秒):
  783. <input name="webupdate_time" type="text" value="5" style="width:100px;">
  784. <input type="button" value="設定更新時間" onclick="changeUpdate()">
  785. <script language="JavaScript">
  786. function changeUpdate() {
  787. clearInterval(WebUpdate_set);
  788. var webupdate_time = $("input[name=webupdate_time]").val()
  789. console.log('webupdate_time' + webupdate_time)
  790. WebUpdate_set = setTimeout(function(){WebUpdate(ctid)} , webupdate_time * 1000);
  791. }
  792. // jQuery 更新感測器制動器狀態
  793. function WebUpdate(ctid) {
  794. $.get('/loading/C' + ctid, '', function (res) {
  795. if (res.tank_vacuum == 0) {
  796. $("#cmn-toggle-05").prop('checked', false);
  797. } else if (res.tank_vacuum == 1) {
  798. $("#cmn-toggle-05").prop('checked', true);
  799. }
  800. if (res.tank_pump_waterFloat == 0) {
  801. $("#cmn-toggle-08").prop('checked', false);
  802. } else if (res.tank_pump_waterFloat == 1) {
  803. $("#cmn-toggle-08").prop('checked', true);
  804. }
  805. if (res.tank_pump_waterL4L5 == 0) {
  806. $("#cmn-toggle-11").prop('checked', false);
  807. } else if (res.tank_pump_waterL4L5 == 1) {
  808. $("#cmn-toggle-11").prop('checked', true);
  809. }
  810. if (res.tank_pump_waterInput == 0) {
  811. $("#cmn-toggle-14").prop('checked', false);
  812. } else if (res.tank_pump_waterInput == 1) {
  813. $("#cmn-toggle-14").prop('checked', true);
  814. }
  815. if (res.tank_solenoid_waterL2L3 == 0) {
  816. $("#cmn-toggle-17").prop('checked', false);
  817. } else if (res.tank_solenoid_waterL2L3 == 1) {
  818. $("#cmn-toggle-17").prop('checked', true);
  819. }
  820. if (res.tank_solenoid_waterL4L5 == 0) {
  821. $("#cmn-toggle-20").prop('checked', false);
  822. } else if (res.tank_solenoid_waterL4L5 == 1) {
  823. $("#cmn-toggle-20").prop('checked', true);
  824. }
  825. if (res.tank_stepping_motor == 0) {
  826. $("#cmn-toggle-23").prop('checked', false);
  827. } else if (res.tank_stepping_motor == 1) {
  828. $("#cmn-toggle-23").prop('checked', true);
  829. }
  830. $("#tank_stepping_motor_t_status").text(res.tank_stepping_motor);
  831. $("#UltraSonic_t_status").text(res.UltraSonic);
  832. setTimeout(function(){WebUpdate(ctid)}, 5 * 1000);
  833. }, 'json');
  834. }
  835. </script>
  836. <h4>制動器</h4>
  837. <table border="1px solid black" style="font-size:18px;" width=100%>
  838. <tr>
  839. <td style="color:red;">Valve</td>
  840. <td>入料<br>真空吸料機</td>
  841. <td>浮選入豆<br>真空吸料機</td>
  842. <td>出水口 2、3_<br>雙核隔膜泵</td>
  843. <td>出水口 4、5_<br>雙核隔膜泵</td>
  844. <td>入水口_<br>雙核隔膜泵</td>
  845. <td>清洗第 3 層<br>電磁閥</td>
  846. <td>清洗第 5 層<br>電磁閥</td>
  847. <td>
  848. 步進馬達
  849. <span id="tank_stepping_motor_t_status">{{tank_stepping_motor}}</span>
  850. </td>
  851. <td>出料<br>真空吸料機</td>
  852. </tr>
  853. <tr>
  854. <td>
  855. <span style="color:#C0C0C0;">off</span>
  856. <span style="color:#008CBA;">on</span>
  857. </td>
  858. <td>
  859. <div class="switch_div">
  860. <div class="switch">
  861. <input id="cmn-toggle-01" class="cmn-toggle cmn-toggle-round" type="checkbox">
  862. <label for="cmn-toggle-01"></label>
  863. </div>
  864. <div class="switch text-center">
  865. {% if input_vacuum=='ON' %}
  866. <input id="cmn-toggle-02" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  867. name="tank_vacuum_status" value="ON" onclick="inputVacuum()">
  868. {% else %}
  869. <input id="cmn-toggle-02" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  870. name="tank_vacuum_status" value="OFF" onclick="inputVacuum()">
  871. {% endif %}
  872. <label for="cmn-toggle-02"></label>
  873. </div>
  874. <div class="switch">
  875. <input id="cmn-toggle-03" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  876. <label for="cmn-toggle-03" data-on="Yes" data-off="No"></label>
  877. </div>
  878. </div>
  879. </td>
  880. <td>
  881. <div class="switch_div">
  882. <div class="switch">
  883. <input id="cmn-toggle-04" class="cmn-toggle cmn-toggle-round" type="checkbox">
  884. <label for="cmn-toggle-04"></label>
  885. </div>
  886. <div class="switch text-center">
  887. {% if tank_vacuum=='ON' %}
  888. <input id="cmn-toggle-05" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  889. name="tank_vacuum_status" value="ON" onclick="tankVacuum()">
  890. {% else %}
  891. <input id="cmn-toggle-05" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  892. name="tank_vacuum_status" value="OFF" onclick="tankVacuum()">
  893. {% endif %}
  894. <label for="cmn-toggle-05"></label>
  895. </div>
  896. <div class="switch">
  897. <input id="cmn-toggle-06" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  898. <label for="cmn-toggle-06" data-on="Yes" data-off="No"></label>
  899. </div>
  900. </div>
  901. </td>
  902. <td>
  903. <div class="switch_div">
  904. <div class="switch">
  905. <input id="cmn-toggle-07" class="cmn-toggle cmn-toggle-round" type="checkbox">
  906. <label for="cmn-toggle-07"></label>
  907. </div>
  908. <div class="switch text-center">
  909. {% if tank_pump_waterL2L3=='ON' %}
  910. <input id="cmn-toggle-08" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  911. name="tank_pump_waterL2L3_status" value="ON" onclick="tankPumpWaterL2L3()">
  912. {% else %}
  913. <input id="cmn-toggle-08" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  914. name="tank_pump_waterL2L3_status" value="OFF" onclick="tankPumpWaterL2L3()">
  915. {% endif %}
  916. <label for="cmn-toggle-08"></label>
  917. </div>
  918. <div class="switch">
  919. <input id="cmn-toggle-09" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  920. <label for="cmn-toggle-09" data-on="Yes" data-off="No"></label>
  921. </div>
  922. </div>
  923. </td>
  924. <td>
  925. <div class="switch_div">
  926. <div class="switch">
  927. <input id="cmn-toggle-10" class="cmn-toggle cmn-toggle-round" type="checkbox">
  928. <label for="cmn-toggle-10"></label>
  929. </div>
  930. <div class="switch text-center">
  931. {% if tank_pump_waterL4L5=='ON' %}
  932. <input id="cmn-toggle-11" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  933. name="tank_pump_waterL4L5_status" value="ON" onclick="tankPumpWaterL4L5()">
  934. {% else %}
  935. <input id="cmn-toggle-11" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  936. name="tank_pump_waterL4L5_status" value="OFF" onclick="tankPumpWaterL4L5()">
  937. {% endif %}
  938. <label for="cmn-toggle-11"></label>
  939. </div>
  940. <div class="switch">
  941. <input id="cmn-toggle-12" class="cmn-toggle cmn-toggle-on-off" type="checkbox">
  942. <label for="cmn-toggle-12" data-on="Yes" data-off="No"></label>
  943. </div>
  944. </div>
  945. </td>
  946. <td>
  947. <div class="switch_div">
  948. <div class="switch">
  949. <input id="cmn-toggle-13" class="cmn-toggle cmn-toggle-round" type="checkbox">
  950. <label for="cmn-toggle-13"></label>
  951. </div>
  952. <div class="switch text-center">
  953. {% if tank_pump_waterInput=='ON' %}
  954. <input id="cmn-toggle-14" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  955. name="tank_pump_waterInput_status" value="ON" onclick="tankPumpWaterInput()">
  956. {% else %}
  957. <input id="cmn-toggle-14" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  958. name="tank_pump_waterInput_status" value="OFF" onclick="tankPumpWaterInput()">
  959. {% endif %}
  960. <label for="cmn-toggle-14"></label>
  961. </div>
  962. <div class="switch">
  963. <input id="cmn-toggle-15" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  964. <label for="cmn-toggle-15" data-on="Yes" data-off="No"></label>
  965. </div>
  966. </div>
  967. </td>
  968. <td>
  969. <div class="switch_div">
  970. <div class="switch">
  971. <input id="cmn-toggle-16" class="cmn-toggle cmn-toggle-round" type="checkbox">
  972. <label for="cmn-toggle-16"></label>
  973. </div>
  974. <div class="switch text-center">
  975. {% if tank_solenoid_waterL2L3=='ON' %}
  976. <input id="cmn-toggle-17" class="cmn-toggle cmn-toggle-round-flat" checked type="checkbox"
  977. name="tank_solenoid_waterL2L3_status" value="ON" onclick="tankSolenoidWaterL2L3()">
  978. {% else %}
  979. <input id="cmn-toggle-17" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  980. name="tank_solenoid_waterL2L3_status" value="OFF" onclick="tankSolenoidWaterL2L3()">
  981. {% endif %}
  982. <label for="cmn-toggle-17"></label>
  983. </div>
  984. <div class="switch">
  985. <input id="cmn-toggle-18" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  986. <label for="cmn-toggle-18" data-on="Yes" data-off="No"></label>
  987. </div>
  988. </div>
  989. </td>
  990. <td>
  991. <div class="switch_div">
  992. <div class="switch">
  993. <input id="cmn-toggle-19" class="cmn-toggle cmn-toggle-round" type="checkbox">
  994. <label for="cmn-toggle-19"></label>
  995. </div>
  996. <div class="switch text-center">
  997. {% if tank_solenoid_waterL4L5=='ON' %}
  998. <input id="cmn-toggle-20" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  999. name="tank_solenoid_waterL4L5_status" value="ON" onclick="tankSolenoidWaterL4L5()">
  1000. {% else %}
  1001. <input id="cmn-toggle-20" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  1002. name="tank_solenoid_waterL4L5_status" value="OFF" onclick="tankSolenoidWaterL4L5()">
  1003. {% endif %}
  1004. <label for="cmn-toggle-20"></label>
  1005. </div>
  1006. <div class="switch">
  1007. <input id="cmn-toggle-21" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  1008. <label for="cmn-toggle-21" data-on="Yes" data-off="No"></label>
  1009. </div>
  1010. </div>
  1011. </td>
  1012. <td>
  1013. <input type="button" value="UP" name="tank_stepping_motor_UP" onclick="tankSteppingMotor_UP()">
  1014. <input type="button" value="STOP" name="tank_stepping_motor_STOP" onclick="tankSteppingMotor_STOP()">
  1015. <input type="button" value="DOWN" name="tank_stepping_motor_DOWN" onclick="tankSteppingMotor_DOWN()">
  1016. </td>
  1017. <td>
  1018. <div class="switch_div">
  1019. <div class="switch">
  1020. <input id="cmn-toggle-25" class="cmn-toggle cmn-toggle-round" type="checkbox">
  1021. <label for="cmn-toggle-25"></label>
  1022. </div>
  1023. <div class="switch text-center">
  1024. {% if output_vacuum=='ON' %}
  1025. <input id="cmn-toggle-26" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  1026. name="output_vacuum_status" value="ON" onclick="outputVacuum()">
  1027. {% else %}
  1028. <input id="cmn-toggle-26" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  1029. name="output_vacuum_status" value="OFF" onclick="outputVacuum()">
  1030. {% endif %}
  1031. <label for="cmn-toggle-26"></label>
  1032. </div>
  1033. <div class="switch">
  1034. <input id="cmn-toggle-27" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  1035. <label for="cmn-toggle-27" data-on="Yes" data-off="No"></label>
  1036. </div>
  1037. </div>
  1038. </td>
  1039. </tr>
  1040. <tr>
  1041. <td><span style="color:#008CBA;"><b>ON</b></span></td>
  1042. <td><input type="button" value="ON" name="input_vacuum_ON" onclick="inputVacuum_ON()"></td>
  1043. <td><input type="button" value="ON" name="tank_vacuum_ON" onclick="tankVacuum_ON()"></td>
  1044. <td><input type="button" value="ON" name="tank_pump_water_float_ON" onclick="tankPumpWaterL2L3_ON()"></td>
  1045. <td><input type="button" value="ON" name="tank_pump_waterL4L5_ON" onclick="tankPumpWaterL4L5_ON()">
  1046. </td>
  1047. <td><input type="button" value="ON" name="tank_pump_waterInput_ON" onclick="tankPumpWaterInput_ON()">
  1048. </td>
  1049. <td><input type="button" value="ON" name="tank_solenoid_waterL2L3_ON" onclick="tankSolenoidWaterL2L3_ON()">
  1050. </td>
  1051. <td><input type="button" value="ON" name="tank_solenoid_waterL4L5_ON" onclick="tankSolenoidWaterL4L5_ON()">
  1052. </td>
  1053. <td><input type="button" value="UP" name="tank_stepping_motor_UP" onclick="tankSteppingMotor_UPSTOP()">
  1054. </td>
  1055. <td><input type="button" value="ON" name="output_vacuum_ON" onclick="outputVacuum_ON()"></td>
  1056. </tr>
  1057. <tr>
  1058. <td><span style="color:#C0C0C0;"><b>OFF</b></span></td>
  1059. <td><input type="button" value="OFF" name="input_vacuum_OFF" onclick="inputVacuum_OFF()"></td>
  1060. <td><input type="button" value="OFF" name="tank_vacuum_OFF" onclick="tankVacuum_OFF()"></td>
  1061. <td><input type="button" value="OFF" name="tank_pump_water_float_OFF" onclick="tankPumpWaterL2L3_OFF()">
  1062. </td>
  1063. <td><input type="button" value="OFF" name="tank_pump_waterL4L5_OFF" onclick="tankPumpWaterL4L5_OFF()">
  1064. </td>
  1065. <td><input type="button" value="OFF" name="tank_pump_waterInput_OFF" onclick="tankPumpWaterInput_OFF()">
  1066. </td>
  1067. <td><input type="button" value="OFF" name="tank_solenoid_waterL2L3_OFF" onclick="tankSolenoidWaterL2L3_OFF()">
  1068. </td>
  1069. <td><input type="button" value="OFF" name="tank_solenoid_waterL4L5_OFF" onclick="tankSolenoidWaterL4L5_OFF()">
  1070. </td>
  1071. <td><input type="button" value="DOWN" name="tank_stepping_motor_STOP" onclick="tankSteppingMotor_DOWNSTOP()">
  1072. </td>
  1073. <td><input type="button" value="OFF" name="output_vacuum_OFF" onclick="outputVacuum_OFF()"></td>
  1074. </tr>
  1075. </table>
  1076. <br>
  1077. <h4>感測器</h4>
  1078. <table style="font-size:18px; border:2px #cccccc solid;" cellpadding="10" border='1' width=100%>
  1079. <tr>
  1080. <td>[桶內] 生豆高度:<span id="UltraSonic_t_status">{{tank_UltraSonic.UltraSonic}}</span></td>
  1081. </tr>
  1082. </table>
  1083. <br>
  1084. <h4>排程測試</h4>
  1085. <table style="font-size:18px; border:2px #cccccc solid;" cellpadding="10" border='1' width=100%>
  1086. <tr>
  1087. <td>水路測試</td>
  1088. <td>排氣下豆測試</td>
  1089. <td>生豆閘門測試</td>
  1090. <td>出料測試</td>
  1091. <td>出水口 4、5 <br>電磁閥逆洗</td>
  1092. <td>出水口 2、3 <br>電磁閥逆洗</td>
  1093. <td>清洗浮選連動</td>
  1094. </tr>
  1095. <tr>
  1096. <td>
  1097. 入水口_雙核泵 ON
  1098. <input name="waiting_time_1" type="text" value="30" style="width:50px;">
  1099. <br>
  1100. 出水口 4、5_雙核泵 ON
  1101. <input name="waiting_time_2" type="text" value="30" style="width:50px;">
  1102. <br>
  1103. 出水口 2、3_雙核泵 ON
  1104. <input name="waiting_time_3" type="text" value="0" style="width:50px;">
  1105. </td>
  1106. <td>
  1107. 真空吸料機 ON
  1108. <input name="waiting_time_8" type="text" value="1" style="width:50px;">
  1109. <br>
  1110. 真空吸料機 OFF
  1111. <input name="waiting_time_9" type="text" value="10" style="width:50px;">
  1112. <br>
  1113. * 循環次數
  1114. <input name="waiting_loop_3" type="text" value="3" style="width:50px;">
  1115. </td>
  1116. <td>
  1117. 上升
  1118. <input name="waiting_time_4" type="text" value="3.5" style="width:50px;">
  1119. <br>
  1120. 停止
  1121. <input name="waiting_time_5" type="text" value="3" style="width:50px;">
  1122. <br>
  1123. 下降
  1124. <input name="waiting_time_6" type="text" value="3.5" style="width:50px;">
  1125. <br>
  1126. 停止
  1127. <input name="waiting_time_7" type="text" value="3" style="width:50px;">
  1128. <br>
  1129. * 循環次數
  1130. <input name="waiting_loop_2" type="text" value="3" style="width:50px;">
  1131. </td>
  1132. <td>
  1133. 出料_吸料機 ON
  1134. <input name="waiting_time_16" type="text" value="1" style="width:50px;">
  1135. <br>
  1136. 出料_吸料機 OFF
  1137. <input name="waiting_time_17" type="text" value="10" style="width:50px;">
  1138. <br>
  1139. * 循環次數
  1140. <input name="waiting_loop_4" type="text" value="3" style="width:50px;">
  1141. </td>
  1142. <td>
  1143. 請依序開啟:
  1144. <br>
  1145. 入_雙核泵
  1146. <br>
  1147. 水龍頭
  1148. <br>
  1149. 出 4、5_電磁閥
  1150. </td>
  1151. <td>
  1152. 請依序開啟:
  1153. <br>
  1154. 入_雙核泵
  1155. <br>
  1156. 水龍頭
  1157. <br>
  1158. 出 4、5_雙核泵
  1159. <br>
  1160. 出 2、3_電磁閥
  1161. </td>
  1162. <td>
  1163. <font color = "red">生豆閘門零點</font>
  1164. <br>
  1165. 入水口_雙核泵 ON
  1166. <input name="waiting_time_10" type="text" value="30" style="width:50px;">
  1167. <br>
  1168. 出水口 4、5_雙核泵 ON
  1169. <input name="waiting_time_11" type="text" value="30" style="width:50px;">
  1170. <br>
  1171. 出水口 2、3_雙核泵 ON
  1172. <input name="waiting_time_12" type="text" value="60" style="width:50px;">
  1173. <br>
  1174. 真空吸料機 ON
  1175. <input name="waiting_time_13" type="text" value="1" style="width:50px;">
  1176. <br>
  1177. 真空吸料機 OFF
  1178. <input name="waiting_time_14" type="text" value="10" style="width:50px;">
  1179. <br>
  1180. * 循環次數
  1181. <input name="waiting_loop_6" type="text" value="3" style="width:50px;">
  1182. <br>
  1183. 生豆閘門 升
  1184. <br>
  1185. <input name="waiting_time_15" type="text" value="10" style="width:50px;">
  1186. <br>
  1187. 生豆閘門 降
  1188. <br>
  1189. 等待出豆時間
  1190. <input name="waiting_time_20" type="text" value="120" style="width:50px;">
  1191. <br>
  1192. 出料_吸料機 ON
  1193. <input name="waiting_time_18" type="text" value="1" style="width:50px;">
  1194. <br>
  1195. 出料_吸料機 OFF
  1196. <input name="waiting_time_19" type="text" value="10" style="width:50px;">
  1197. <br>
  1198. * 循環次數
  1199. <input name="waiting_loop_5" type="text" value="3" style="width:50px;">
  1200. </td>
  1201. </tr>
  1202. <tr>
  1203. <td>
  1204. <button type="submit" class="btn btn-primary" onclick="tank_WaterIn_testing()">水路測試</button>&nbsp;
  1205. <button type="submit" class="btn btn-primary" onclick="tank_WaterIn_testing_OFF()">水路測試 OFF</button>
  1206. <script>
  1207. function tank_WaterIn_testing() {
  1208. // 清洗第 4 層灑水 ON
  1209. tankPumpWaterInput_ON()
  1210. console.log('tank_pump_waterInput_status ON')
  1211. // 等待時間(秒)
  1212. var time1 = $("input[name=waiting_time_1]").val();
  1213. console.log('等待 ' + time1 + ' 秒')
  1214. var time = new Date();
  1215. while ((new Date() - time) < time1 * 1000) { };
  1216. // 清洗第 2 層灑水 ON
  1217. tankPumpWaterL4L5_ON()
  1218. console.log('tank_pump_waterL4L5_status ON')
  1219. // 等待時間(秒)
  1220. var time2 = $("input[name=waiting_time_2]").val();
  1221. console.log('等待 ' + time2 + ' 秒')
  1222. var time = new Date();
  1223. while ((new Date() - time) < time2 * 1000) { };
  1224. // 浮選槽注水 ON
  1225. tankPumpWaterL2L3_ON()
  1226. console.log('tank_pump_waterL2L3_status ON')
  1227. // 等待時間(秒)
  1228. var time3 = $("input[name=waiting_time_3]").val();
  1229. console.log('等待 ' + time3 + ' 秒')
  1230. var time = new Date();
  1231. while ((new Date() - time) < time3 * 1000) { };
  1232. };
  1233. </script>
  1234. <script>
  1235. function tank_WaterIn_testing_OFF(){
  1236. tankPumpWaterInput_OFF()
  1237. console.log('tankPumpWaterInput_OFF')
  1238. var time = new Date();
  1239. while ((new Date() - time) < 2 * 1000) { };
  1240. tankPumpWaterL4L5_OFF()
  1241. console.log('tankPumpWaterL4L5_OFF')
  1242. var time = new Date();
  1243. while ((new Date() - time) < 2 * 1000) { };
  1244. tankPumpWaterL2L3_OFF()
  1245. console.log('tankPumpWaterL2L3_OFF')
  1246. }
  1247. </script>
  1248. </td>
  1249. <td>
  1250. <button type="submit" class="btn btn-primary" onclick="tank_BeanInputAir_testing()">排氣下豆測試</button>
  1251. <script>
  1252. function tank_BeanInputAir_testing() {
  1253. // 循環次數
  1254. var loop3 = $("input[name=waiting_loop_3]").val();
  1255. console.log('--- 循環 ' + loop3 + ' 次 ---')
  1256. for (step = 1; step <= loop3; step++) {
  1257. // 真空吸料機 ON
  1258. tankVacuum_ON()
  1259. console.log('tankVacuum_ON')
  1260. // 吸料時間
  1261. var time8 = $("input[name=waiting_time_8]").val();
  1262. console.log('等待 ' + time8 + ' 秒')
  1263. var time = new Date();
  1264. while ((new Date() - time) < time8 * 1000) { };
  1265. // 真空吸料機 OFF
  1266. tankVacuum_OFF()
  1267. console.log('tankVacuum_OFF')
  1268. // 吸料時間
  1269. var time9 = $("input[name=waiting_time_9]").val();
  1270. console.log('等待 ' + time9 + ' 秒')
  1271. var time = new Date();
  1272. while ((new Date() - time) < time9 * 1000) { };
  1273. }
  1274. }
  1275. </script>
  1276. </td>
  1277. <td>
  1278. <button type="submit" class="btn btn-primary" onclick="tank_BeanBaffle_testing()">生豆閘門測試</button>
  1279. <script>
  1280. function tank_BeanBaffle_testing() {
  1281. // 循環次數
  1282. var loop2 = $("input[name=waiting_loop_2]").val();
  1283. console.log('--- 循環 ' + loop2 + ' 次 ---')
  1284. for (step = 1; step <= loop2; step++) {
  1285. // 生豆閘門 上升
  1286. tankSteppingMotor_UP()
  1287. console.log('tankSteppingMotor_UP')
  1288. // 上升持續時間(秒)
  1289. var time4 = $("input[name=waiting_time_4]").val();
  1290. console.log('等待 ' + time4 + ' 秒')
  1291. var time = new Date();
  1292. while ((new Date() - time) < time4 * 1000) { };
  1293. // 生豆閘門 停止
  1294. tankSteppingMotor_STOP()
  1295. console.log('tankSteppingMotor_STOP')
  1296. // 暫停時間(秒)
  1297. var time5 = $("input[name=waiting_time_5]").val();
  1298. console.log('等待 ' + time5 + ' 秒')
  1299. var time = new Date();
  1300. while ((new Date() - time) < time5 * 1000) { };
  1301. // 生豆閘門 下降
  1302. tankSteppingMotor_DOWN()
  1303. console.log('tankSteppingMotor_DOWN')
  1304. // 下降持續時間(秒)
  1305. var time6 = $("input[name=waiting_time_6]").val();
  1306. console.log('等待 ' + time6 + ' 秒')
  1307. var time = new Date();
  1308. while ((new Date() - time) < time6 * 1000) { };
  1309. // 生豆閘門 停止
  1310. tankSteppingMotor_STOP()
  1311. console.log('tankSteppingMotor_STOP')
  1312. // 暫停時間(秒)
  1313. var time7 = $("input[name=waiting_time_7]").val();
  1314. console.log('等待 ' + time7 + ' 秒')
  1315. var time = new Date();
  1316. while ((new Date() - time) < time7 * 1000) { };
  1317. }
  1318. }
  1319. </script>
  1320. </td>
  1321. <td>
  1322. <button type="submit" class="btn btn-primary" onclick="output_Bean_testing()">出料測試</button>
  1323. <script>
  1324. function output_Bean_testing(){
  1325. // 循環次數
  1326. var loop4 = $("input[name=waiting_loop_4]").val();
  1327. console.log('--- 循環 ' + loop4 + ' 次 ---')
  1328. for (step = 1; step <= loop4; step++) {
  1329. // 出料_吸料機 ON
  1330. outputVacuum_ON()
  1331. console.log('outputVacuum_ON')
  1332. // 吸料時間
  1333. var time16 = $("input[name=waiting_time_16]").val();
  1334. console.log('等待 ' + time16 + ' 秒')
  1335. var time = new Date();
  1336. while ((new Date() - time) < time16 * 1000) { };
  1337. // 出料_吸料機 OFF
  1338. outputVacuum_OFF()
  1339. console.log('outputVacuum_OFF')
  1340. // 放料時間
  1341. var time17 = $("input[name=waiting_time_17]").val();
  1342. console.log('等待 ' + time17 + ' 秒')
  1343. var time = new Date();
  1344. while ((new Date() - time) < time17 * 1000) { };
  1345. };
  1346. };
  1347. </script>
  1348. </td>
  1349. <td>
  1350. <button type="submit" class="btn btn-primary" onclick="tank_SolenoidWaterL4L5_testing()">出 4、5 閥逆洗</button>
  1351. <br>
  1352. <button type="submit" class="btn btn-primary" onclick="tank_SolenoidWaterL4L5_testing_OFF()">出 4、5 閥逆洗 OFF</button>
  1353. <script>
  1354. function tank_SolenoidWaterL4L5_testing(){
  1355. // 入水口_雙核泵 ON
  1356. tankPumpWaterInput_ON()
  1357. console.log('tankPumpWaterInput_ON')
  1358. // 水龍頭 ON
  1359. var time = new Date();
  1360. while ((new Date() - time) < 3 * 1000) { };
  1361. // 出水口 4、5_電磁閥 ON
  1362. tankSolenoidWaterL4L5_ON()
  1363. console.log('tankSolenoidWaterL4L5_ON')
  1364. };
  1365. function tank_SolenoidWaterL4L5_testing_OFF(){
  1366. // 出水口 4、5_電磁閥 OFF
  1367. tankSolenoidWaterL4L5_OFF()
  1368. console.log('tankSolenoidWaterL4L5_OFF')
  1369. // 水龍頭 OFF
  1370. var time = new Date();
  1371. while ((new Date() - time) < 3 * 1000) { };
  1372. // 入水口_雙核泵 OFF
  1373. tankPumpWaterInput_OFF()
  1374. console.log('tankPumpWaterInput_OFF')
  1375. };
  1376. </script>
  1377. </td>
  1378. <td>
  1379. <button type="submit" class="btn btn-primary" onclick="tank_SolenoidWaterL2L3_testing()">出 2、3 閥逆洗</button>
  1380. <br>
  1381. <button type="submit" class="btn btn-primary" onclick="tank_SolenoidWaterL2L3_testing_OFF()">出 2、3 閥逆洗 OFF</button>
  1382. <script>
  1383. function tank_SolenoidWaterL2L3_testing(){
  1384. // 入水口_雙核泵 ON
  1385. tankPumpWaterInput_ON()
  1386. console.log('tankPumpWaterInput_ON')
  1387. // 水龍頭 ON
  1388. var time = new Date();
  1389. while ((new Date() - time) < 3 * 1000) { };
  1390. // 出水口 4、5_雙核泵 ON
  1391. tankPumpWaterL4L5_ON()
  1392. console.log('tankPumpWaterL4L5_ON')
  1393. // 出水口 2、3_電磁閥 ON
  1394. tankSolenoidWaterL2L3_ON()
  1395. console.log('tankSolenoidWaterL2L3_ON')
  1396. };
  1397. function tank_SolenoidWaterL2L3_testing_OFF(){
  1398. // 出水口 2、3_電磁閥 OFF
  1399. tankSolenoidWaterL2L3_OFF()
  1400. console.log('tankSolenoidWaterL2L3_OFF')
  1401. // 出水口 4、5_雙核泵 OFF
  1402. tankPumpWaterL4L5_OFF()
  1403. console.log('tankPumpWaterL4L5_OFF')
  1404. // 水龍頭 OFF
  1405. var time = new Date();
  1406. while ((new Date() - time) < 3 * 1000) { };
  1407. // 入水口_雙核泵 OFF
  1408. tankPumpWaterInput_OFF()
  1409. console.log('tankPumpWaterInput_OFF')
  1410. };
  1411. </script>
  1412. </td>
  1413. <td>
  1414. <button type="submit" class="btn btn-primary" onclick="tank_CleanWash_testing()">清洗浮選連動測試</button>
  1415. <script>
  1416. function tank_CleanWash_testing(){
  1417. // 生豆閘門 DOWN
  1418. // tankSteppingMotor_DOWNSTOP()
  1419. // console.log('tankSteppingMotor_DOWN')
  1420. //入水口_雙核泵 ON
  1421. tankPumpWaterInput_ON()
  1422. console.log('tankPumpWaterInput_ON')
  1423. //入水口_雙核泵 ON 等待時間
  1424. var time10 = $("input[name=waiting_time_10]").val();
  1425. console.log('等待 ' + time10 + ' 秒')
  1426. var time = new Date();
  1427. while ((new Date() - time) < time10 * 1000) { };
  1428. //出水口 4、5_雙核泵 ON
  1429. tankPumpWaterL4L5_ON()
  1430. console.log('tankPumpWaterL4L5_ON')
  1431. //出水口 4、5_雙核泵 ON 等待時間
  1432. var time11 = $("input[name=waiting_time_11]").val();
  1433. console.log('等待 ' + time11 + ' 秒')
  1434. var time = new Date();
  1435. while ((new Date() - time) < time11 * 1000) { };
  1436. //出水口 2、3_雙核泵 ON
  1437. tankPumpWaterL2L3_ON()
  1438. console.log('tankPumpWaterL2L3_ON')
  1439. //出水口 2、3_雙核泵 ON 等待時間
  1440. var time12 = $("input[name=waiting_time_12]").val();
  1441. console.log('等待 ' + time12 + ' 秒')
  1442. var time = new Date();
  1443. while ((new Date() - time) < time12 * 1000) { };
  1444. //* 循環次數
  1445. var loop6 = $("input[name=waiting_loop_6]").val();
  1446. console.log('--- 循環 ' + loop6 + ' 次 ---')
  1447. for (step = 1; step <= loop6; step++) {
  1448. // 真空吸料機 ON
  1449. tankVacuum_ON()
  1450. console.log('tankVacuum_ON')
  1451. // 吸料時間
  1452. var time13 = $("input[name=waiting_time_13]").val();
  1453. console.log('等待 ' + time13 + ' 秒')
  1454. var time = new Date();
  1455. while ((new Date() - time) < time13 * 1000) { };
  1456. // 真空吸料機 OFF
  1457. tankVacuum_OFF()
  1458. console.log('tankVacuum_OFF')
  1459. // 吸料時間
  1460. var time14 = $("input[name=waiting_time_14]").val();
  1461. console.log('等待 ' + time14 + ' 秒')
  1462. var time = new Date();
  1463. while ((new Date() - time) < time14 * 1000) { };
  1464. };
  1465. // 生豆閘門 UP
  1466. tankSteppingMotor_UP()
  1467. console.log('tankSteppingMotor_UP')
  1468. var time = new Date();
  1469. while ((new Date() - time) < 3 * 1000) { };
  1470. tankSteppingMotor_STOP()
  1471. console.log('tankSteppingMotor_STOP')
  1472. // 閘門開啟時間
  1473. var time15 = $("input[name=waiting_time_15]").val();
  1474. console.log('等待 ' + time15 + ' 秒')
  1475. var time = new Date();
  1476. while ((new Date() - time) < time15 * 1000) { };
  1477. // 生豆閘門 DOWN
  1478. tankSteppingMotor_DOWN()
  1479. console.log('tankSteppingMotor_DOWN')
  1480. var time = new Date();
  1481. while ((new Date() - time) < 3 * 1000) { };
  1482. tankSteppingMotor_STOP()
  1483. console.log('tankSteppingMotor_STOP')
  1484. var time20 = $("input[name=waiting_time_20]").val();
  1485. console.log('等待 ' + time20 + ' 秒')
  1486. var time = new Date();
  1487. while ((new Date() - time) < time20 * 1000) { };
  1488. // 循環次數
  1489. var loop5 = $("input[name=waiting_loop_5]").val();
  1490. console.log('--- 循環 ' + loop5 + ' 次 ---')
  1491. for (step = 1; step <= loop5; step++) {
  1492. // 出料_吸料機 ON
  1493. outputVacuum_ON()
  1494. console.log('outputVacuum_ON')
  1495. // 吸料時間
  1496. var time18 = $("input[name=waiting_time_18]").val();
  1497. console.log('等待 ' + time18 + ' 秒')
  1498. var time = new Date();
  1499. while ((new Date() - time) < time18 * 1000) { };
  1500. // 出料_吸料機 OFF
  1501. outputVacuum_OFF()
  1502. console.log('outputVacuum_OFF')
  1503. // 放料時間
  1504. var time19 = $("input[name=waiting_time_19]").val();
  1505. console.log('等待 ' + time19 + ' 秒')
  1506. var time = new Date();
  1507. while ((new Date() - time) < time19 * 1000) { };
  1508. };
  1509. };
  1510. </script>
  1511. <button type="submit" class="btn btn-primary" onclick="tank_CleanWash_OFF_testing()">清洗浮選出入水 OFF</button>
  1512. <script>
  1513. function tank_CleanWash_OFF_testing(){
  1514. //入水口_雙核泵 OFF
  1515. tankPumpWaterInput_OFF()
  1516. console.log('tankPumpWaterInput_OFF')
  1517. var time = new Date();
  1518. while ((new Date() - time) < 1 * 1000) { };
  1519. //出水口 4、5_雙核泵 OFF
  1520. tankPumpWaterL4L5_OFF()
  1521. console.log('tankPumpWaterL4L5_OFF')
  1522. var time = new Date();
  1523. while ((new Date() - time) < 1 * 1000) { };
  1524. //出水口 2、3_雙核泵 OFF
  1525. tankPumpWaterL2L3_OFF()
  1526. console.log('tankPumpWaterL2L3_OFF')
  1527. };
  1528. </script>
  1529. </td>
  1530. </tr>
  1531. </table>
  1532. <br>
  1533. <h4>攝影機 M5CameraF</h4>
  1534. <div class="container-fluid">
  1535. <div class="row" style="margin-top:10px;">
  1536. <div class="col flex">
  1537. <div class="col-md-12 row flex" style="text-align:left; margin-top:5px;">
  1538. <div class="col-md-12 row flex">
  1539. <img src="" id="three" width="90%" height="90%">
  1540. </div>
  1541. </div>
  1542. <script>
  1543. // M5 攝影機
  1544. //const img = document.querySelector('#one');
  1545. const img2 = document.querySelector('#three');
  1546. const WS_URL2 = 'ws:///60.250.156.230:8088'; // M5CameraF (有廣角的)
  1547. //const WS_URL2 = 'ws:///60.250.156.230:8090'; // M5Camera
  1548. const ws2 = new WebSocket(WS_URL2);
  1549. let urlObject2;
  1550. ws2.onopen = () => console.log(`Connected to ${WS_URL2}`);
  1551. ws2.onmessage = message2 => {
  1552. const arrayBuffer2 = message2.data;
  1553. if (urlObject2) {
  1554. URL.revokeObjectURL(urlObject2);
  1555. }
  1556. urlObject2 = URL.createObjectURL(new Blob([arrayBuffer2]));
  1557. // console.log(urlObject2)
  1558. img2.src = urlObject2;
  1559. }
  1560. </script>
  1561. </div>
  1562. </div>
  1563. </div>
  1564. <footer class="footer">
  1565. <div style="text-align: center; margin-top: 10px; font-size: 13px; margin-bottom: 10px;">
  1566. Copyright © 2021 Gold-in Tech. All Rights Reserved. 金子進科技股份有限公司 版權所有
  1567. <a href="mailto:service.gitc@gmail.com" target="_blank">service.gitc@gmail.com</a>
  1568. </div>
  1569. </footer>
  1570. </body>
  1571. </html>