peel_container_0728.html 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371
  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. <!-- 新 Bootstrap4 核心 CSS 文件 -->
  8. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/4.1.0/css/bootstrap.min.css">
  9. <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
  10. <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
  11. <!-- popper.min.js 用于弹窗、提示、下拉菜单 -->
  12. <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
  13. <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
  14. <script src="https://cdn.bootcss.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
  15. <!--可用來建立使用者小圖示-->
  16. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
  17. <script language="JavaScript">
  18. // 指定 10秒 刷新網頁一次
  19. var ctid = '{{tid}}';
  20. console.log('ctid:' + ctid)
  21. WebUpdate_set = setInterval(function(){WebUpdate(ctid)} , 5 * 1000)
  22. // var WebUpdate_set
  23. </script>
  24. <style>
  25. body {
  26. margin: 0;
  27. }
  28. input[type="button"] {
  29. padding: 4px 15px;
  30. background: #f3f3f3;
  31. border: 0 none;
  32. cursor: pointer;
  33. -webkit-border-radius: 5px;
  34. border-radius: 5px;
  35. }
  36. .navbar-dark .navbar-nav .nav-link {
  37. color: white;
  38. cursor: pointer;
  39. text-decoration: none;
  40. width: 110px;
  41. height: 46px;
  42. }
  43. .nav-top {
  44. line-height: 40px;
  45. background-color: #C4C4C4;
  46. }
  47. .website_title {
  48. font-family: Roboto;
  49. font-style: normal;
  50. font-weight: normal;
  51. font-size: 30px;
  52. color: #000000;
  53. }
  54. .navbar-nav>li {
  55. float: none;
  56. display: inline-block;
  57. width: 70px;
  58. margin: 0 auto;
  59. text-align: center;
  60. }
  61. .navbar-nav>li a {
  62. font-size: 20px;
  63. }
  64. .main-page {
  65. margin-top: 200px;
  66. }
  67. .page-title {
  68. font-family: Roboto;
  69. font-style: normal;
  70. font-weight: bold;
  71. font-size: 36px;
  72. }
  73. .flex {
  74. display: flex;
  75. flex-direction: row;
  76. flex-wrap: wrap;
  77. justify-content: center;
  78. }
  79. .set-link {
  80. display: inline-block;
  81. width: 350px;
  82. height: 70px;
  83. line-height: 70px;
  84. background: #008CBA;
  85. border: 1px solid #CFCFCF;
  86. box-sizing: border-box;
  87. color: #FFFFFF;
  88. border-radius: 10px;
  89. font-size: 36px;
  90. }
  91. .cmn-toggle {
  92. position: absolute;
  93. margin-left: 0px;
  94. visibility: hidden;
  95. }
  96. .cmn-toggle+label {
  97. display: block;
  98. position: relative;
  99. cursor: pointer;
  100. outline: none;
  101. user-select: none;
  102. }
  103. input.cmn-toggle-round-flat+label {
  104. padding: 2px;
  105. width: 60px;
  106. height: 30px;
  107. background-color: #C0C0C0;
  108. border-radius: 60px;
  109. transition: background 0.4s;
  110. }
  111. input.cmn-toggle-round-flat+label:before,
  112. input.cmn-toggle-round-flat+label:after {
  113. display: block;
  114. position: absolute;
  115. content: "";
  116. }
  117. input.cmn-toggle-round-flat+label:before {
  118. top: 2px;
  119. left: 2px;
  120. bottom: 2px;
  121. right: 2px;
  122. background-color: #fff;
  123. border-radius: 60px;
  124. transition: background 0.4s;
  125. }
  126. input.cmn-toggle-round-flat+label:after {
  127. top: 4px;
  128. left: 4px;
  129. bottom: 4px;
  130. width: 24px;
  131. background-color: #dddddd;
  132. border-radius: 52px;
  133. transition: margin 0.4s, background 0.4s;
  134. }
  135. input.cmn-toggle-round-flat:checked+label {
  136. background-color: #C0C0C0;
  137. }
  138. input.cmn-toggle-round-flat:checked+label:after {
  139. margin-left: 27px;
  140. background-color: #008CBA;
  141. }
  142. @media(max-width:373px) {
  143. .card {
  144. margin-right: 0px;
  145. }
  146. .set-link {
  147. width: 250px;
  148. }
  149. }
  150. @media(max-width:577px) {}
  151. @media(min-width:576px) {}
  152. @media(min-width:768px) {
  153. .navbar-nav>li {
  154. margin-left: 0px;
  155. }
  156. .navbar-nav .li-block {
  157. display: none;
  158. }
  159. }
  160. @media(min-width:991px) {
  161. .navbar-nav>li {
  162. margin-left: 20px;
  163. }
  164. .navbar-nav .li-block {
  165. display: none;
  166. }
  167. }
  168. @media(min-width:1200px) {
  169. .navbar-nav>li {
  170. margin-left: 50px;
  171. }
  172. .navbar-nav .li-block {
  173. display: inline-block;
  174. width: 70px;
  175. }
  176. }
  177. @media(min-width:1400px) {
  178. .navbar-nav .li-block {
  179. display: inline-block;
  180. width: 200px;
  181. }
  182. }
  183. @media(min-width:1689px) {
  184. .navbar-nav>li {
  185. margin-left: 50px;
  186. }
  187. .navbar-nav .li-block {
  188. display: inline-block;
  189. width: 500px;
  190. }
  191. }
  192. </style>
  193. <script>
  194. // 脫皮機 制動器開關
  195. var tank_num = '{{tid}}';
  196. // 入料 真空吸料機
  197. function inputVacuum() {
  198. var status = "off";
  199. var check = $("input[name=input_vacuum_status]:checked"); // 這裡面是 jQuery 撈取資料的方法, jQuery 常使用到 $ 錢字號
  200. console.log('check:', check);
  201. //大於0代表有被選中, 如果有多個可以呈現勾取的項目數量
  202. if (check.length > 0) {
  203. status = "on";
  204. $("#cmn-toggle-02").prop('checked', false); // 確認是否勾選
  205. if (!confirm("你確定要開啟入料儲豆槽真空吸料機嗎?")) {
  206. return false;
  207. };
  208. } else {
  209. $("#cmn-toggle-02").prop('checked', true);
  210. if (!confirm("你確定要關閉入料儲豆槽真空吸料機嗎?")) {
  211. return false;
  212. };
  213. };
  214. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": status };
  215. // jquery 請求 '/mqtt/{{tid}}' 頁面
  216. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  217. console.log('data:', data)
  218. if (res == 'on') {
  219. $("#cmn-toggle-02").prop('checked', true);
  220. setTimeout("alert('入料儲豆槽真空吸料機_開啟成功!')", 500);
  221. } else if (res == 'off') {
  222. $("#cmn-toggle-02").prop('checked', false);
  223. setTimeout("alert('入料儲豆槽真空吸料機_關閉成功!')", 500);
  224. } else {
  225. alert(res);
  226. };
  227. }, 'text')
  228. // setTimeout(function () { location.reload(); }, 500);
  229. };
  230. function inputVacuum_ON() {
  231. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": "on" };
  232. // jquery 請求 '/mqtt/{{tid}}' 頁面
  233. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  234. console.log('data:', data)
  235. if (res == 'on') {
  236. $("#cmn-toggle-02").prop('checked', true);
  237. } else if (res == 'off') {
  238. $("#cmn-toggle-02").prop('checked', false);
  239. } else {
  240. };
  241. }, 'text')
  242. // setTimeout(function () { location.reload(); }, 500);
  243. };
  244. function inputVacuum_OFF() {
  245. var data = { "tank_num": "C" + tank_num, "command": "input_vacuum_status", "value": "off" };
  246. // jquery 請求 '/mqtt/{{tid}}' 頁面
  247. $.post('/mqtt/{{tid}}', data, function (res) { //res:HTTP response argument to the middleware function
  248. console.log('data:', data)
  249. if (res == 'on') {
  250. $("#cmn-toggle-02").prop('checked', true);
  251. } else if (res == 'off') {
  252. $("#cmn-toggle-02").prop('checked', false);
  253. } else {
  254. };
  255. }, 'text')
  256. // setTimeout(function () { location.reload(); }, 500);
  257. };
  258. // 桶內 真空吸料機
  259. function tankVacuum() {
  260. var status = "off";
  261. var check = $("input[name=tank_vacuum_status]:checked");
  262. console.log('check:', check);
  263. //大於0代表有被選中
  264. if (check.length > 0) {
  265. status = "on";
  266. $("#cmn-toggle-05").prop('checked', false);
  267. if (!confirm("你確定要開啟真空吸料機嗎?")) {
  268. return false;
  269. };
  270. } else {
  271. $("#cmn-toggle-05").prop('checked', true);
  272. if (!confirm("你確定要關閉真空吸料機嗎?")) {
  273. return false;
  274. };
  275. };
  276. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": status };
  277. $.post('/mqtt/{{tid}}', data, function (res) {
  278. console.log('data:', data)
  279. if (res == 'on') {
  280. $("#cmn-toggle-05").prop('checked', true);
  281. setTimeout("alert('真空吸料機_開啟成功!')", 500);
  282. } else if (res == 'off') {
  283. $("#cmn-toggle-05").prop('checked', false);
  284. setTimeout("alert('真空吸料機_關閉成功!')", 500);
  285. } else {
  286. alert(res);
  287. };
  288. }, 'text')
  289. // setTimeout(function () { location.reload(); }, 500);
  290. };
  291. function tankVacuum_ON() {
  292. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": "on" };
  293. $.post('/mqtt/{{tid}}', data, function (res) {
  294. console.log('data:', data)
  295. if (res == 'on') {
  296. $("#cmn-toggle-05").prop('checked', true);
  297. } else if (res == 'off') {
  298. $("#cmn-toggle-05").prop('checked', false);
  299. } else {
  300. };
  301. }, 'text')
  302. // setTimeout(function () { location.reload(); }, 500);
  303. };
  304. function tankVacuum_OFF() {
  305. var data = { "tank_num": "C" + tank_num, "command": "tank_vacuum_status", "value": "off" };
  306. $.post('/mqtt/{{tid}}', data, function (res) {
  307. console.log('data:', data)
  308. if (res == 'on') {
  309. $("#cmn-toggle-05").prop('checked', true);
  310. } else if (res == 'off') {
  311. $("#cmn-toggle-05").prop('checked', false);
  312. } else {
  313. };
  314. }, 'text')
  315. // setTimeout(function () { location.reload(); }, 500);
  316. };
  317. // 浮選槽注水 雙核隔膜泵
  318. function tankPumpWaterFloat() {
  319. //<!--setInterval(Relay,10000);-->
  320. var status = "off";
  321. var check = $("input[name=tank_pump_waterFloat_status]:checked");
  322. //大於0代表有被選中
  323. if (check.length > 0) {
  324. status = "on";
  325. $("#cmn-toggle-08").prop('checked', false);
  326. if (!confirm("你確定要開啟浮選槽注水嗎?")) {
  327. return false;
  328. };
  329. } else {
  330. $("#cmn-toggle-08").prop('checked', true);
  331. if (!confirm("你確定要關閉浮選槽注水嗎?")) {
  332. return false;
  333. };
  334. };
  335. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterFloat_status", "value": status };
  336. $.post('/mqtt/{{tid}}', data, function (res) {
  337. console.log('data:', data)
  338. if (res == 'on') {
  339. $("#cmn-toggle-08").prop('checked', true);
  340. setTimeout("alert('浮選槽注水入料_開啟成功!')", 500);
  341. } else if (res == 'off') {
  342. $("#cmn-toggle-08").prop('checked', false);
  343. setTimeout("alert('浮選槽注水排氣_關閉成功!')", 500);
  344. } else {
  345. alert(res);
  346. };
  347. }, 'text')
  348. // setTimeout(function () { location.reload(); }, 500);
  349. };
  350. function tankPumpWaterFloat_ON() {
  351. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterFloat_status", "value": "on" };
  352. $.post('/mqtt/{{tid}}', data, function (res) {
  353. console.log('data:', data)
  354. if (res == 'on') {
  355. $("#cmn-toggle-08").prop('checked', true);
  356. } else if (res == 'off') {
  357. $("#cmn-toggle-08").prop('checked', false);
  358. } else {
  359. };
  360. }, 'text')
  361. // setTimeout(function () { location.reload(); }, 500);
  362. };
  363. function tankPumpWaterFloat_OFF() {
  364. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterFloat_status", "value": "off" };
  365. $.post('/mqtt/{{tid}}', data, function (res) {
  366. console.log('data:', data)
  367. if (res == 'on') {
  368. $("#cmn-toggle-08").prop('checked', true);
  369. } else if (res == 'off') {
  370. $("#cmn-toggle-08").prop('checked', false);
  371. } else {
  372. };
  373. }, 'text')
  374. // setTimeout(function () { location.reload(); }, 500);
  375. };
  376. // 第 2 層灑水 雙核隔膜泵
  377. function tankPumpWaterL2() {
  378. //<!--setInterval(Relay,10000);-->
  379. var status = "off";
  380. var check = $("input[name=tank_pump_waterL2_status]:checked");
  381. //大於0代表有被選中
  382. if (check.length > 0) {
  383. status = "on";
  384. $("#cmn-toggle-11").prop('checked', false);
  385. if (!confirm("你確定要開啟清洗第 2 層灑水嗎?")) {
  386. return false;
  387. };
  388. } else {
  389. $("#cmn-toggle-11").prop('checked', true);
  390. if (!confirm("你確定要關閉清洗第 2 層灑水嗎?")) {
  391. return false;
  392. };
  393. };
  394. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2_status", "value": status };
  395. $.post('/mqtt/{{tid}}', data, function (res) {
  396. console.log('data:', data)
  397. if (res == 'on') {
  398. $("#cmn-toggle-11").prop('checked', true);
  399. setTimeout("alert('清洗第 2 層灑水_開啟成功!')", 500);
  400. } else if (res == 'off') {
  401. $("#cmn-toggle-11").prop('checked', false);
  402. setTimeout("alert('清洗第 2 層灑水_關閉成功!')", 500);
  403. } else {
  404. alert(res);
  405. };
  406. }, 'text')
  407. // setTimeout(function () { location.reload(); }, 500);
  408. };
  409. function tankPumpWaterL2_ON() {
  410. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2_status", "value": "on" };
  411. $.post('/mqtt/{{tid}}', data, function (res) {
  412. console.log('data:', data)
  413. if (res == 'on') {
  414. $("#cmn-toggle-11").prop('checked', true);
  415. } else if (res == 'off') {
  416. $("#cmn-toggle-11").prop('checked', false);
  417. } else {
  418. };
  419. }, 'text')
  420. // setTimeout(function () { location.reload(); }, 500);
  421. };
  422. function tankPumpWaterL2_OFF() {
  423. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL2_status", "value": "off" };
  424. $.post('/mqtt/{{tid}}', data, function (res) {
  425. console.log('data:', data)
  426. if (res == 'on') {
  427. $("#cmn-toggle-11").prop('checked', true);
  428. } else if (res == 'off') {
  429. $("#cmn-toggle-11").prop('checked', false);
  430. } else {
  431. };
  432. }, 'text')
  433. // setTimeout(function () { location.reload(); }, 500);
  434. };
  435. // 第 4 層灑水 雙核隔膜泵
  436. function tankPumpWaterL4() {
  437. var status = "off";
  438. var check = $("input[name=tank_pump_waterL4_status]:checked");
  439. //大於0代表有被選中
  440. if (check.length > 0) {
  441. status = "on";
  442. $("#cmn-toggle-14").prop('checked', false);
  443. if (!confirm("你確定要開啟清洗第 4 層灑水嗎?")) {
  444. return false;
  445. };
  446. } else {
  447. $("#cmn-toggle-14").prop('checked', true);
  448. if (!confirm("你確定要關閉清洗第 4 層灑水嗎?")) {
  449. return false;
  450. };
  451. };
  452. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4_status", "value": status };
  453. $.post('/mqtt/{{tid}}', data, function (res) {
  454. console.log('data:', data)
  455. if (res == 'on') {
  456. $("#cmn-toggle-14").prop('checked', true);
  457. setTimeout("alert('清洗第 4 層灑水_開啟成功!')", 500);
  458. } else if (res == 'off') {
  459. $("#cmn-toggle-14").prop('checked', false);
  460. setTimeout("alert('清洗第 4 層灑水_關閉成功!')", 500);
  461. } else {
  462. alert(res);
  463. };
  464. }, 'text')
  465. // setTimeout(function () { location.reload(); }, 500);
  466. };
  467. function tankPumpWaterL4_ON() {
  468. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4_status", "value": "on" };
  469. $.post('/mqtt/{{tid}}', data, function (res) {
  470. console.log('data:', data)
  471. if (res == 'on') {
  472. $("#cmn-toggle-14").prop('checked', true);
  473. } else if (res == 'off') {
  474. $("#cmn-toggle-14").prop('checked', false);
  475. } else {
  476. };
  477. }, 'text')
  478. // setTimeout(function () { location.reload(); }, 500);
  479. };
  480. function tankPumpWaterL4_OFF() {
  481. var data = { "tank_num": "C" + tank_num, "command": "tank_pump_waterL4_status", "value": "off" };
  482. $.post('/mqtt/{{tid}}', data, function (res) {
  483. console.log('data:', data)
  484. if (res == 'on') {
  485. $("#cmn-toggle-14").prop('checked', true);
  486. } else if (res == 'off') {
  487. $("#cmn-toggle-14").prop('checked', false);
  488. } else {
  489. };
  490. }, 'text')
  491. // setTimeout(function () { location.reload(); }, 500);
  492. };
  493. // 清洗第 3 層 電磁閥
  494. function tankSolenoidWaterL3() {
  495. var status = "off";
  496. var check = $("input[name=tank_solenoid_waterL3_status]:checked");
  497. //大於0代表有被選中
  498. if (check.length > 0) {
  499. status = "on";
  500. $("#cmn-toggle-17").prop('checked', false);
  501. if (!confirm("你確定要開啟清洗第 3 層電磁閥嗎?")) {
  502. return false;
  503. };
  504. } else {
  505. $("#cmn-toggle-17").prop('checked', true);
  506. if (!confirm("你確定要關閉清洗第 3 層電磁閥嗎?")) {
  507. return false;
  508. };
  509. };
  510. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL3_status", "value": status };
  511. $.post('/mqtt/{{tid}}', data, function (res) {
  512. console.log('data:', data)
  513. if (res == 'on') {
  514. $("#cmn-toggle-17").prop('checked', true);
  515. setTimeout("alert('清洗第 3 層電磁閥_開啟成功!')", 500);
  516. } else if (res == 'off') {
  517. $("#cmn-toggle-17").prop('checked', false);
  518. setTimeout("alert('清洗第 3 層電磁閥_關閉成功!')", 500);
  519. } else {
  520. alert(res);
  521. };
  522. }, 'text')
  523. // setTimeout(function () { location.reload(); }, 500);
  524. };
  525. function tankSolenoidWaterL3_ON() {
  526. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL3_status", "value": "on" };
  527. $.post('/mqtt/{{tid}}', data, function (res) {
  528. console.log('data:', data)
  529. if (res == 'on') {
  530. $("#cmn-toggle-17").prop('checked', true);
  531. } else if (res == 'off') {
  532. $("#cmn-toggle-17").prop('checked', false);
  533. } else {
  534. };
  535. }, 'text')
  536. // setTimeout(function () { location.reload(); }, 500);
  537. };
  538. function tankSolenoidWaterL3_OFF() {
  539. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL3_status", "value": "off" };
  540. $.post('/mqtt/{{tid}}', data, function (res) {
  541. console.log('data:', data)
  542. if (res == 'on') {
  543. $("#cmn-toggle-17").prop('checked', true);
  544. } else if (res == 'off') {
  545. $("#cmn-toggle-17").prop('checked', false);
  546. } else {
  547. };
  548. }, 'text')
  549. // setTimeout(function () { location.reload(); }, 500);
  550. };
  551. // 清洗第 5 層 電磁閥
  552. function tankSolenoidWaterL5() {
  553. var status = "off";
  554. var check = $("input[name=tank_solenoid_waterL5_status]:checked");
  555. //大於0代表有被選中
  556. if (check.length > 0) {
  557. status = "on";
  558. $("#cmn-toggle-20").prop('checked', false);
  559. if (!confirm("你確定要開啟清洗第 5 層電磁閥嗎?")) {
  560. return false;
  561. };
  562. } else {
  563. $("#cmn-toggle-20").prop('checked', true);
  564. if (!confirm("你確定要關閉清洗第 5 層電磁閥嗎?")) {
  565. return false;
  566. };
  567. };
  568. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL5_status", "value": status };
  569. $.post('/mqtt/{{tid}}', data, function (res) {
  570. console.log('data:', data)
  571. if (res == 'on') {
  572. $("#cmn-toggle-20").prop('checked', true);
  573. setTimeout("alert('清洗第 5 層電磁閥_開啟成功!')", 500);
  574. } else if (res == 'off') {
  575. $("#cmn-toggle-20").prop('checked', false);
  576. setTimeout("alert('清洗第 5 層電磁閥_關閉成功!')", 500);
  577. } else {
  578. alert(res);
  579. };
  580. }, 'text')
  581. // setTimeout(function () { location.reload(); }, 500);
  582. };
  583. function tankSolenoidWaterL5_ON() {
  584. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL5_status", "value": "on" };
  585. $.post('/mqtt/{{tid}}', data, function (res) {
  586. console.log('data:', data)
  587. if (res == 'on') {
  588. $("#cmn-toggle-20").prop('checked', true);
  589. } else if (res == 'off') {
  590. $("#cmn-toggle-20").prop('checked', false);
  591. } else {
  592. };
  593. }, 'text')
  594. // setTimeout(function () { location.reload(); }, 500);
  595. };
  596. function tankSolenoidWaterL5_OFF() {
  597. var data = { "tank_num": "C" + tank_num, "command": "tank_solenoid_waterL5_status", "value": "off" };
  598. $.post('/mqtt/{{tid}}', data, function (res) {
  599. console.log('data:', data)
  600. if (res == 'on') {
  601. $("#cmn-toggle-20").prop('checked', true);
  602. } else if (res == 'off') {
  603. $("#cmn-toggle-20").prop('checked', false);
  604. } else {
  605. };
  606. }, 'text')
  607. // setTimeout(function () { location.reload(); }, 500);
  608. };
  609. // 步進馬達
  610. /*
  611. function tankSteppingMotor() {
  612. var motor_data = $("input[name=steppingmotor_rpm_data]").val();
  613. if (motor_data == '') {
  614. alert("請先輸入要運轉的值!");
  615. return false;
  616. } else if (motor_data == 0) {
  617. alert("轉速 0 為關閉步進馬達");
  618. } else if (Number(motor_data) < -50 || Number(motor_data) > 50 || !Number(motor_data)) {
  619. alert("您輸入的值已超過範圍,請重新輸入!" + !Number(motor_data));
  620. return false;
  621. };
  622. if (motor_data != 0) {
  623. value = motor_data;
  624. if (!confirm("你確定要開啟步進馬達,運轉速度為 " + motor_data + " 嗎?")) {
  625. return false;
  626. };
  627. } else {
  628. if (!confirm("你確定要關閉步進馬達嗎?")) {
  629. return false;
  630. };
  631. };
  632. var data = { "tank_num": "C" + tank_num, "command": "tank_stepping_motor_status", "value": motor_data };
  633. $.post('/mqtt/{{tid}}', data, function (res) {
  634. console.log('data:', data)
  635. if (res == 'on') {
  636. setTimeout("alert('步進馬達_開啟成功!')", 500);
  637. } else if (res == 'off') {
  638. setTimeout("alert('步進馬達_關閉成功!')", 500);
  639. } else {
  640. alert(res);
  641. };
  642. }, 'text')
  643. // setTimeout(function () { location.reload(); }, 500);
  644. };
  645. */
  646. function tankSteppingMotor_UP() {
  647. var data = { "tank_num": "C" + tank_num, "command": "tank_stepping_motor_status", "value": "up" };
  648. $.post('/mqtt/{{tid}}', data, function (res) {
  649. console.log('data:', data)
  650. if (res == 'on') {
  651. } else if (res == 'off') {
  652. } else {
  653. };
  654. }, 'text')
  655. // setTimeout(function () { location.reload(); }, 500);
  656. };
  657. function tankSteppingMotor_DOWN() {
  658. var data = { "tank_num": "C" + tank_num, "command": "tank_stepping_motor_status", "value": "down" };
  659. $.post('/mqtt/{{tid}}', data, function (res) {
  660. console.log('data:', data)
  661. if (res == 'on') {
  662. } else if (res == 'off') {
  663. } else {
  664. };
  665. }, 'text')
  666. // setTimeout(function () { location.reload(); }, 500);
  667. };
  668. function tankSteppingMotor_STOP() {
  669. var data = { "tank_num": "C" + tank_num, "command": "tank_stepping_motor_status", "value": "stop" };
  670. $.post('/mqtt/{{tid}}', data, function (res) {
  671. console.log('data:', data)
  672. if (res == 'on') {
  673. } else if (res == 'off') {
  674. } else {
  675. };
  676. }, 'text')
  677. // setTimeout(function () { location.reload(); }, 500);
  678. };
  679. // 出料 真空吸料機
  680. function outputVacuum() {
  681. var status = "off";
  682. var check = $("input[name=output_vacuum_status]:checked");
  683. //大於0代表有被選中
  684. if (check.length > 0) {
  685. status = "on";
  686. $("#cmn-toggle-26").prop('checked', false);
  687. if (!confirm("你確定要開啟出料儲豆槽真空吸料機嗎?")) {
  688. return false;
  689. };
  690. } else {
  691. $("#cmn-toggle-26").prop('checked', true);
  692. if (!confirm("你確定要關閉出料儲豆槽真空吸料機嗎?")) {
  693. return false;
  694. };
  695. };
  696. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": status };
  697. console.log('data:', data)
  698. $.post('/mqtt/{{tid}}', data, function (res) {
  699. if (res == 'on') {
  700. $("#cmn-toggle-26").prop('checked', true);
  701. setTimeout("alert('出料儲豆槽真空吸料機_開啟成功!')", 500);
  702. } else if (res == 'off') {
  703. $("#cmn-toggle-26").prop('checked', false);
  704. setTimeout("alert('出料儲豆槽真空吸料機_關閉成功!')", 500);
  705. } else {
  706. alert(res);
  707. };
  708. }, 'text')
  709. // setTimeout(function () { location.reload(); }, 500);
  710. };
  711. function outputVacuum_ON() {
  712. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": "on" };
  713. console.log('data:', data)
  714. $.post('/mqtt/{{tid}}', data, function (res) {
  715. if (res == 'on') {
  716. $("#cmn-toggle-26").prop('checked', true);
  717. } else if (res == 'off') {
  718. $("#cmn-toggle-26").prop('checked', false);
  719. } else {
  720. };
  721. }, 'text')
  722. // setTimeout(function () { location.reload(); }, 500);
  723. };
  724. function outputVacuum_OFF() {
  725. var data = { "tank_num": "C" + tank_num, "command": "output_vacuum_status", "value": "off" };
  726. console.log('data:', data)
  727. $.post('/mqtt/{{tid}}', data, function (res) {
  728. if (res == 'on') {
  729. $("#cmn-toggle-26").prop('checked', true);
  730. } else if (res == 'off') {
  731. $("#cmn-toggle-26").prop('checked', false);
  732. } else {
  733. };
  734. }, 'text')
  735. // setTimeout(function () { location.reload(); }, 500);
  736. };
  737. </script>
  738. </head>
  739. <body>
  740. 狀態更新時間(秒):
  741. <input name="webupdate_time" type="text" value="5" style="width:100px;">
  742. <input type="button" value="設定更新時間" onclick="changeUpdate()">
  743. <script language="JavaScript">
  744. function changeUpdate() {
  745. clearInterval(WebUpdate_set);
  746. var webupdate_time = $("input[name=webupdate_time]").val()
  747. console.log('webupdate_time' + webupdate_time)
  748. WebUpdate_set = setInterval(function(){WebUpdate(ctid)} , webupdate_time * 1000);
  749. }
  750. // jQuery 更新感測器制動器狀態
  751. function WebUpdate(ctid) {
  752. $.get('/loading/C' + ctid, '', function (res) {
  753. if (res.tank_vacuum == 0) {
  754. $("#cmn-toggle-05").prop('checked', false);
  755. } else if (res.tank_vacuum == 1) {
  756. $("#cmn-toggle-05").prop('checked', true);
  757. }
  758. if (res.tank_pump_waterFloat == 0) {
  759. $("#cmn-toggle-08").prop('checked', false);
  760. } else if (res.tank_pump_waterFloat == 1) {
  761. $("#cmn-toggle-08").prop('checked', true);
  762. }
  763. if (res.tank_pump_waterL2 == 0) {
  764. $("#cmn-toggle-11").prop('checked', false);
  765. } else if (res.tank_pump_waterL2 == 1) {
  766. $("#cmn-toggle-11").prop('checked', true);
  767. }
  768. if (res.tank_pump_waterL4 == 0) {
  769. $("#cmn-toggle-14").prop('checked', false);
  770. } else if (res.tank_pump_waterL4 == 1) {
  771. $("#cmn-toggle-14").prop('checked', true);
  772. }
  773. if (res.tank_solenoid_waterL3 == 0) {
  774. $("#cmn-toggle-17").prop('checked', false);
  775. } else if (res.tank_solenoid_waterL3 == 1) {
  776. $("#cmn-toggle-17").prop('checked', true);
  777. }
  778. if (res.tank_solenoid_waterL5 == 0) {
  779. $("#cmn-toggle-20").prop('checked', false);
  780. } else if (res.tank_solenoid_waterL5 == 1) {
  781. $("#cmn-toggle-20").prop('checked', true);
  782. }
  783. $("#UltraSonic_t_status").text(res.UltraSonic);
  784. }, 'json');
  785. }
  786. </script>
  787. <h4>制動器</h4>
  788. <table border="1px solid black" style="font-size:18px;" width=100%>
  789. <tr>
  790. <td style="color:red;">Valve</td>
  791. <td>入料<br>真空吸料機</td>
  792. <td>浮選入豆<br>真空吸料機</td>
  793. <td>浮選槽注水<br>雙核隔膜泵</td>
  794. <td>第 2 層灑水<br>雙核隔膜泵</td>
  795. <td>第 4 層灑水<br>雙核隔膜泵</td>
  796. <td>清洗第 3 層<br>電磁閥</td>
  797. <td>清洗第 5 層<br>電磁閥</td>
  798. <td>步進馬達</td>
  799. <td>出料<br>真空吸料機</td>
  800. </tr>
  801. <tr>
  802. <td>
  803. <span style="color:#C0C0C0;">off</span>
  804. <span style="color:#008CBA;">on</span>
  805. </td>
  806. <td>
  807. <div class="switch_div">
  808. <div class="switch">
  809. <input id="cmn-toggle-01" class="cmn-toggle cmn-toggle-round" type="checkbox">
  810. <label for="cmn-toggle-01"></label>
  811. </div>
  812. <div class="switch text-center">
  813. {% if input_vacuum=='ON' %}
  814. <input id="cmn-toggle-02" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  815. name="tank_vacuum_status" value="ON" onclick="inputVacuum()">
  816. {% else %}
  817. <input id="cmn-toggle-02" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  818. name="tank_vacuum_status" value="OFF" onclick="inputVacuum()">
  819. {% endif %}
  820. <label for="cmn-toggle-02"></label>
  821. </div>
  822. <div class="switch">
  823. <input id="cmn-toggle-03" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  824. <label for="cmn-toggle-03" data-on="Yes" data-off="No"></label>
  825. </div>
  826. </div>
  827. </td>
  828. <td>
  829. <div class="switch_div">
  830. <div class="switch">
  831. <input id="cmn-toggle-04" class="cmn-toggle cmn-toggle-round" type="checkbox">
  832. <label for="cmn-toggle-04"></label>
  833. </div>
  834. <div class="switch text-center">
  835. {% if tank_vacuum=='ON' %}
  836. <input id="cmn-toggle-05" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  837. name="tank_vacuum_status" value="ON" onclick="tankVacuum()">
  838. {% else %}
  839. <input id="cmn-toggle-05" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  840. name="tank_vacuum_status" value="OFF" onclick="tankVacuum()">
  841. {% endif %}
  842. <label for="cmn-toggle-05"></label>
  843. </div>
  844. <div class="switch">
  845. <input id="cmn-toggle-06" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  846. <label for="cmn-toggle-06" data-on="Yes" data-off="No"></label>
  847. </div>
  848. </div>
  849. </td>
  850. <td>
  851. <div class="switch_div">
  852. <div class="switch">
  853. <input id="cmn-toggle-07" class="cmn-toggle cmn-toggle-round" type="checkbox">
  854. <label for="cmn-toggle-07"></label>
  855. </div>
  856. <div class="switch text-center">
  857. {% if tank_pump_waterFloat=='ON' %}
  858. <input id="cmn-toggle-08" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  859. name="tank_pump_waterFloat_status" value="ON" onclick="tankPumpWaterFloat()">
  860. {% else %}
  861. <input id="cmn-toggle-08" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  862. name="tank_pump_waterFloat_status" value="OFF" onclick="tankPumpWaterFloat()">
  863. {% endif %}
  864. <label for="cmn-toggle-08"></label>
  865. </div>
  866. <div class="switch">
  867. <input id="cmn-toggle-09" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  868. <label for="cmn-toggle-09" data-on="Yes" data-off="No"></label>
  869. </div>
  870. </div>
  871. </td>
  872. <td>
  873. <div class="switch_div">
  874. <div class="switch">
  875. <input id="cmn-toggle-10" class="cmn-toggle cmn-toggle-round" type="checkbox">
  876. <label for="cmn-toggle-10"></label>
  877. </div>
  878. <div class="switch text-center">
  879. {% if tank_pump_waterL2=='ON' %}
  880. <input id="cmn-toggle-11" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  881. name="tank_pump_waterL2_status" value="ON" onclick="tankPumpWaterL2()">
  882. {% else %}
  883. <input id="cmn-toggle-11" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  884. name="tank_pump_waterL2_status" value="OFF" onclick="tankPumpWaterL2()">
  885. {% endif %}
  886. <label for="cmn-toggle-11"></label>
  887. </div>
  888. <div class="switch">
  889. <input id="cmn-toggle-12" class="cmn-toggle cmn-toggle-on-off" type="checkbox">
  890. <label for="cmn-toggle-12" data-on="Yes" data-off="No"></label>
  891. </div>
  892. </div>
  893. </td>
  894. <td>
  895. <div class="switch_div">
  896. <div class="switch">
  897. <input id="cmn-toggle-13" class="cmn-toggle cmn-toggle-round" type="checkbox">
  898. <label for="cmn-toggle-13"></label>
  899. </div>
  900. <div class="switch text-center">
  901. {% if tank_pump_waterL4=='ON' %}
  902. <input id="cmn-toggle-14" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  903. name="tank_pump_waterL4_status" value="ON" onclick="tankPumpWaterL4()">
  904. {% else %}
  905. <input id="cmn-toggle-14" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  906. name="tank_pump_waterL4_status" value="OFF" onclick="tankPumpWaterL4()">
  907. {% endif %}
  908. <label for="cmn-toggle-14"></label>
  909. </div>
  910. <div class="switch">
  911. <input id="cmn-toggle-15" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  912. <label for="cmn-toggle-15" data-on="Yes" data-off="No"></label>
  913. </div>
  914. </div>
  915. </td>
  916. <td>
  917. <div class="switch_div">
  918. <div class="switch">
  919. <input id="cmn-toggle-16" class="cmn-toggle cmn-toggle-round" type="checkbox">
  920. <label for="cmn-toggle-16"></label>
  921. </div>
  922. <div class="switch text-center">
  923. {% if tank_solenoid_waterL3=='ON' %}
  924. <input id="cmn-toggle-17" class="cmn-toggle cmn-toggle-round-flat" checked type="checkbox"
  925. name="tank_solenoid_waterL3_status" value="ON" onclick="tankSolenoidWaterL3()">
  926. {% else %}
  927. <input id="cmn-toggle-17" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  928. name="tank_solenoid_waterL3_status" value="OFF" onclick="tankSolenoidWaterL3()">
  929. {% endif %}
  930. <label for="cmn-toggle-17"></label>
  931. </div>
  932. <div class="switch">
  933. <input id="cmn-toggle-18" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  934. <label for="cmn-toggle-18" data-on="Yes" data-off="No"></label>
  935. </div>
  936. </div>
  937. </td>
  938. <td>
  939. <div class="switch_div">
  940. <div class="switch">
  941. <input id="cmn-toggle-19" class="cmn-toggle cmn-toggle-round" type="checkbox">
  942. <label for="cmn-toggle-19"></label>
  943. </div>
  944. <div class="switch text-center">
  945. {% if tank_solenoid_waterL5=='ON' %}
  946. <input id="cmn-toggle-20" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  947. name="tank_solenoid_waterL5_status" value="ON" onclick="tankSolenoidWaterL5()">
  948. {% else %}
  949. <input id="cmn-toggle-20" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  950. name="tank_solenoid_waterL5_status" value="OFF" onclick="tankSolenoidWaterL5()">
  951. {% endif %}
  952. <label for="cmn-toggle-20"></label>
  953. </div>
  954. <div class="switch">
  955. <input id="cmn-toggle-21" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  956. <label for="cmn-toggle-21" data-on="Yes" data-off="No"></label>
  957. </div>
  958. </div>
  959. </td>
  960. <td>
  961. <input type="button" value="UP" name="tank_stepping_motor_UP" onclick="tankSteppingMotor_UP()">
  962. <input type="button" value="STOP" name="tank_stepping_motor_STOP" onclick="tankSteppingMotor_STOP()">
  963. <input type="button" value="DOWN" name="tank_stepping_motor_DOWN" onclick="tankSteppingMotor_DOWN()">
  964. </td>
  965. <td>
  966. <div class="switch_div">
  967. <div class="switch">
  968. <input id="cmn-toggle-25" class="cmn-toggle cmn-toggle-round" type="checkbox">
  969. <label for="cmn-toggle-25"></label>
  970. </div>
  971. <div class="switch text-center">
  972. {% if output_vacuum=='ON' %}
  973. <input id="cmn-toggle-26" class="cmn-toggle cmn-toggle-round-flat" type="checkbox" checked
  974. name="output_vacuum_status" value="ON" onclick="outputVacuum()">
  975. {% else %}
  976. <input id="cmn-toggle-26" class="cmn-toggle cmn-toggle-round-flat" type="checkbox"
  977. name="output_vacuum_status" value="OFF" onclick="outputVacuum()">
  978. {% endif %}
  979. <label for="cmn-toggle-26"></label>
  980. </div>
  981. <div class="switch">
  982. <input id="cmn-toggle-27" class="cmn-toggle cmn-toggle-yes-no" type="checkbox">
  983. <label for="cmn-toggle-27" data-on="Yes" data-off="No"></label>
  984. </div>
  985. </div>
  986. </td>
  987. </tr>
  988. <tr>
  989. <td><span style="color:#008CBA;"><b>ON</b></span></td>
  990. <td><input type="button" value="ON" name="input_vacuum_ON" onclick="inputVacuum_ON()"></td>
  991. <td><input type="button" value="ON" name="tank_vacuum_ON" onclick="tankVacuum_ON()"></td>
  992. <td><input type="button" value="ON" name="tank_pump_water_float_ON" onclick="tankPumpWaterFloat_ON()"></td>
  993. <td><input type="button" value="ON" name="tank_pump_waterL2_ON" onclick="tankPumpWaterL2_ON()">
  994. </td>
  995. <td><input type="button" value="ON" name="tank_pump_waterL4_ON" onclick="tankPumpWaterL4_ON()">
  996. </td>
  997. <td><input type="button" value="ON" name="tank_solenoid_waterL3_ON" onclick="tankSolenoidWaterL3_ON()">
  998. </td>
  999. <td><input type="button" value="ON" name="tank_solenoid_waterL5_ON" onclick="tankSolenoidWaterL5_ON()">
  1000. </td>
  1001. <td><input type="button" value="UP" name="tank_stepping_motor_UP" onclick="tankSteppingMotor_UP()">
  1002. </td>
  1003. <td><input type="button" value="ON" name="output_vacuum_ON" onclick="outputVacuum_ON()"></td>
  1004. </tr>
  1005. <tr>
  1006. <td><span style="color:#C0C0C0;"><b>OFF</b></span></td>
  1007. <td><input type="button" value="OFF" name="input_vacuum_OFF" onclick="inputVacuum_OFF()"></td>
  1008. <td><input type="button" value="OFF" name="tank_vacuum_OFF" onclick="tankVacuum_OFF()"></td>
  1009. <td><input type="button" value="ON" name="tank_pump_water_float_OFF" onclick="tankPumpWaterFloat_OFF()">
  1010. </td>
  1011. <td><input type="button" value="OFF" name="tank_pump_waterL2_OFF" onclick="tankPumpWaterL2_OFF()">
  1012. </td>
  1013. <td><input type="button" value="OFF" name="tank_pump_waterL4_OFF" onclick="tankPumpWaterL4_OFF()">
  1014. </td>
  1015. <td><input type="button" value="OFF" name="tank_solenoid_waterL3_OFF" onclick="tankSolenoidWaterL3_OFF()">
  1016. </td>
  1017. <td><input type="button" value="OFF" name="tank_solenoid_waterL5_OFF" onclick="tankSolenoidWaterL5_OFF()">
  1018. </td>
  1019. <td><input type="button" value="STOP" name="tank_stepping_motor_STOP" onclick="tankSteppingMotor_STOP()">
  1020. </td>
  1021. <td><input type="button" value="OFF" name="output_vacuum_OFF" onclick="outputVacuum_OFF()"></td>
  1022. </tr>
  1023. </table>
  1024. <br>
  1025. <h4>感測器</h4>
  1026. <table style="font-size:18px; border:2px #cccccc solid;" cellpadding="10" border='1' width=100%>
  1027. <tr>
  1028. <td></td>
  1029. </tr>
  1030. </table>
  1031. <br>
  1032. <h4>排程測試</h4>
  1033. <table style="font-size:18px; border:2px #cccccc solid;" cellpadding="10" border='1' width=100%>
  1034. <tr>
  1035. <td>水路測試</td>
  1036. <td>生豆擋板測試</td>
  1037. <td>排氣下豆測試</td>
  1038. </tr>
  1039. <tr>
  1040. <td>
  1041. 清洗第 4 層灑水 ON
  1042. <input name="waiting_time_1" type="text" value="30" style="width:50px;">
  1043. <br>
  1044. 清洗第 2 層灑水 ON
  1045. <input name="waiting_time_2" type="text" value="30" style="width:50px;">
  1046. <br>
  1047. 浮選槽注水 ON
  1048. <input name="waiting_time_3" type="text" value="30" style="width:50px;">
  1049. </td>
  1050. <td>
  1051. 生豆擋板 上升
  1052. <input name="waiting_time_4" type="text" value="5" style="width:50px;">
  1053. <br>
  1054. 生豆擋板 停止
  1055. <input name="waiting_time_5" type="text" value="5" style="width:50px;">
  1056. <br>
  1057. 生豆擋板 下降
  1058. <input name="waiting_time_6" type="text" value="5" style="width:50px;">
  1059. <br>
  1060. 生豆擋板 停止
  1061. <input name="waiting_time_7" type="text" value="5" style="width:50px;">
  1062. <br>
  1063. * 循環次數
  1064. <input name="waiting_loop_2" type="text" value="3" style="width:50px;">
  1065. </td>
  1066. <td>
  1067. 真空吸料機 ON
  1068. <input name="waiting_time_8" type="text" value="5" style="width:50px;">
  1069. <br>
  1070. 真空吸料機 OFF
  1071. <input name="waiting_time_9" type="text" value="5" style="width:50px;">
  1072. <br>
  1073. * 循環次數
  1074. <input name="waiting_loop_3" type="text" value="3" style="width:50px;">
  1075. </td>
  1076. </tr>
  1077. <tr>
  1078. <td>
  1079. <button type="submit" class="btn btn-primary" onclick="tank_WaterIn_testing()">水路測試</button>&nbsp;
  1080. <button type="submit" class="btn btn-primary" onclick="tank_WaterIn_testing_OFF()">水路測試 OFF</button>
  1081. <script>
  1082. function tank_WaterIn_testing() {
  1083. // 清洗第 4 層灑水 ON
  1084. tankPumpWaterL4_ON()
  1085. console.log('tank_pump_waterL4_status ON')
  1086. // 等待時間(秒)
  1087. var time1 = $("input[name=waiting_time_1]").val();
  1088. console.log('等待 ' + time1 + ' 秒')
  1089. var time = new Date();
  1090. while ((new Date() - time) < time1 * 1000) { };
  1091. // 清洗第 2 層灑水 ON
  1092. tankPumpWaterL2_ON()
  1093. console.log('tank_pump_waterL2_status ON')
  1094. // 等待時間(秒)
  1095. var time2 = $("input[name=waiting_time_2]").val();
  1096. console.log('等待 ' + time2 + ' 秒')
  1097. var time = new Date();
  1098. while ((new Date() - time) < time2 * 1000) { };
  1099. // 浮選槽注水 ON
  1100. tankPumpWaterFloat_ON()
  1101. console.log('tank_pump_waterFloat_status ON')
  1102. // 等待時間(秒)
  1103. var time3 = $("input[name=waiting_time_3]").val();
  1104. console.log('等待 ' + time3 + ' 秒')
  1105. var time = new Date();
  1106. while ((new Date() - time) < time3 * 1000) { };
  1107. };
  1108. </script>
  1109. <script>
  1110. function tank_WaterIn_testing_OFF(){
  1111. tankPumpWaterL4_OFF()
  1112. console.log('tankPumpWaterL4_OFF')
  1113. var time = new Date();
  1114. while ((new Date() - time) < 5 * 1000) { };
  1115. tankPumpWaterL2_OFF()
  1116. console.log('tankPumpWaterL2_OFF')
  1117. var time = new Date();
  1118. while ((new Date() - time) < 5 * 1000) { };
  1119. tankPumpWaterFloat_OFF()
  1120. console.log('tankPumpWaterFloat_OFF')
  1121. }
  1122. </script>
  1123. </td>
  1124. <td>
  1125. <button type="submit" class="btn btn-primary" onclick="tank_BeanBaffle_testing()">生豆擋板測試</button>
  1126. <script>
  1127. function tank_BeanBaffle_testing() {
  1128. // 循環次數
  1129. var loop2 = $("input[name=waiting_loop_2]").val();
  1130. console.log('循環 ' + loop2 + ' 次')
  1131. for (step = 1; step <= loop2; step++) {
  1132. // 生豆擋板 上升
  1133. tankSteppingMotor_UP()
  1134. console.log('tankSteppingMotor_UP')
  1135. // 上升持續時間(秒)
  1136. var time4 = $("input[name=waiting_time_4]").val();
  1137. console.log('等待 ' + time4 + ' 秒')
  1138. var time = new Date();
  1139. while ((new Date() - time) < time4 * 1000) { };
  1140. // 生豆擋板 停止
  1141. tankSteppingMotor_STOP()
  1142. console.log('tankSteppingMotor_STOP')
  1143. // 暫停時間(秒)
  1144. var time5 = $("input[name=waiting_time_5]").val();
  1145. console.log('等待 ' + time5 + ' 秒')
  1146. var time = new Date();
  1147. while ((new Date() - time) < time5 * 1000) { };
  1148. // 生豆擋板 下降
  1149. tankSteppingMotor_DOWN()
  1150. console.log('tankSteppingMotor_DOWN')
  1151. // 下降持續時間(秒)
  1152. var time6 = $("input[name=waiting_time_6]").val();
  1153. console.log('等待 ' + time6 + ' 秒')
  1154. var time = new Date();
  1155. while ((new Date() - time) < time6 * 1000) { };
  1156. // 生豆擋板 停止
  1157. tankSteppingMotor_STOP()
  1158. console.log('tankSteppingMotor_STOP')
  1159. // 暫停時間(秒)
  1160. var time7 = $("input[name=waiting_time_7]").val();
  1161. console.log('等待 ' + time7 + ' 秒')
  1162. var time = new Date();
  1163. while ((new Date() - time) < time7 * 1000) { };
  1164. }
  1165. }
  1166. </script>
  1167. </td>
  1168. <td>
  1169. <button type="submit" class="btn btn-primary" onclick="tank_BeanInputAir_testing()">排氣下豆測試</button>
  1170. <script>
  1171. function tank_BeanInputAir_testing() {
  1172. // 循環次數
  1173. var loop3 = $("input[name=waiting_loop_3]").val();
  1174. console.log('循環 ' + loop3 + ' 次')
  1175. for (step = 1; step <= loop3; step++) {
  1176. // 真空吸料機 ON
  1177. tankVacuum_ON()
  1178. console.log('tankVacuum_ON')
  1179. // 吸料時間
  1180. var time8 = $("input[name=waiting_time_8]").val();
  1181. console.log('等待 ' + time8 + ' 秒')
  1182. var time = new Date();
  1183. while ((new Date() - time) < time8 * 1000) { };
  1184. // 真空吸料機 OFF
  1185. tankVacuum_OFF()
  1186. console.log('tankVacuum_OFF')
  1187. // 吸料時間
  1188. var time9 = $("input[name=waiting_time_9]").val();
  1189. console.log('等待 ' + time9 + ' 秒')
  1190. var time = new Date();
  1191. while ((new Date() - time) < time9 * 1000) { };
  1192. }
  1193. }
  1194. </script>
  1195. </td>
  1196. </tr>
  1197. </table>
  1198. </body>
  1199. </html>