1
0

camera_test.html 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  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. <style>
  18. #four {
  19. margin-bottom: 0px;
  20. }
  21. body {
  22. margin: 0;
  23. }
  24. .navbar-dark .navbar-nav .nav-link {
  25. color: white;
  26. cursor: pointer;
  27. text-decoration: none;
  28. width: 110px;
  29. height: 46px;
  30. }
  31. .nav-top {
  32. line-height: 40px;
  33. background-color: #C4C4C4;
  34. }
  35. .website_title {
  36. font-family: Roboto;
  37. font-style: normal;
  38. font-weight: normal;
  39. font-size: 30px;
  40. color: #000000;
  41. }
  42. .navbar-nav>li {
  43. float: none;
  44. display: inline-block;
  45. width: 100px;
  46. margin: 0 auto;
  47. text-align: center;
  48. }
  49. .navbar-nav>li a {
  50. font-size: 20px;
  51. }
  52. .main-page {
  53. margin-top: 200px;
  54. }
  55. .page-title {
  56. font-family: Roboto;
  57. font-style: normal;
  58. font-weight: bold;
  59. font-size: 36px;
  60. }
  61. .flex {
  62. display: flex;
  63. flex-direction: row;
  64. flex-wrap: wrap;
  65. justify-content: center;
  66. }
  67. .set-link {
  68. display: inline-block;
  69. width: 350px;
  70. height: 100px;
  71. line-height: 100px;
  72. background: #008CBA;
  73. border: 1px solid #CFCFCF;
  74. box-sizing: border-box;
  75. color: #FFFFFF;
  76. border-radius: 10px;
  77. font-size: 36px;
  78. }
  79. .cmn-toggle {
  80. position: absolute;
  81. margin-left: 0px;
  82. visibility: hidden;
  83. }
  84. .cmn-toggle+label {
  85. display: block;
  86. position: relative;
  87. cursor: pointer;
  88. outline: none;
  89. user-select: none;
  90. }
  91. input.cmn-toggle-round-flat+label {
  92. padding: 2px;
  93. width: 60px;
  94. height: 30px;
  95. background-color: #C0C0C0;
  96. border-radius: 60px;
  97. transition: background 0.4s;
  98. }
  99. input.cmn-toggle-round-flat+label:before,
  100. input.cmn-toggle-round-flat+label:after {
  101. display: block;
  102. position: absolute;
  103. content: "";
  104. }
  105. input.cmn-toggle-round-flat+label:before {
  106. top: 2px;
  107. left: 2px;
  108. bottom: 2px;
  109. right: 2px;
  110. background-color: #fff;
  111. border-radius: 60px;
  112. transition: background 0.4s;
  113. }
  114. input.cmn-toggle-round-flat+label:after {
  115. top: 4px;
  116. left: 4px;
  117. bottom: 4px;
  118. width: 24px;
  119. background-color: #dddddd;
  120. border-radius: 52px;
  121. transition: margin 0.4s, background 0.4s;
  122. }
  123. input.cmn-toggle-round-flat:checked+label {
  124. background-color: #C0C0C0;
  125. }
  126. input.cmn-toggle-round-flat:checked+label:after {
  127. margin-left: 27px;
  128. background-color: #008CBA;
  129. }
  130. @media(max-width:373px) {
  131. .card {
  132. margin-right: 0px;
  133. }
  134. .set-link {
  135. width: 250px;
  136. }
  137. }
  138. @media(max-width:577px) {}
  139. @media(min-width:576px) {}
  140. @media(min-width:768px) {
  141. .navbar-nav>li {
  142. margin-left: 0px;
  143. }
  144. .navbar-nav .li-block {
  145. display: none;
  146. }
  147. }
  148. @media(min-width:991px) {
  149. .navbar-nav>li {
  150. margin-left: 20px;
  151. }
  152. .navbar-nav .li-block {
  153. display: none;
  154. }
  155. }
  156. @media(min-width:1200px) {
  157. .navbar-nav>li {
  158. margin-left: 50px;
  159. }
  160. .navbar-nav .li-block {
  161. display: inline-block;
  162. width: 100px;
  163. }
  164. }
  165. @media(min-width:1400px) {
  166. .navbar-nav .li-block {
  167. display: inline-block;
  168. width: 200px;
  169. }
  170. }
  171. @media(min-width:1689px) {
  172. .navbar-nav>li {
  173. margin-left: 50px;
  174. }
  175. .navbar-nav .li-block {
  176. display: inline-block;
  177. width: 500px;
  178. }
  179. }
  180. </style>
  181. <script language="JavaScript">
  182. var tid = '{{tid}}';
  183. var WS_URL = '{{WS_URL}}';
  184. var camera_title = '{{camera_title}}';
  185. console.log('tid:' + tid)
  186. console.log('camera_title: ' + camera_title)
  187. $(document).ready(function (){
  188. $("#camera_dry_title").text("M5 攝影機畫面_" + camera_title + " " + tid);
  189. if (camera_title == '乾燥出料儲豆槽' | camera_title == '乾燥入料儲豆槽' | camera_title == '乾燥槽') {
  190. $("#PreviousPage").attr('href','/dry');
  191. $("#PreviousPage").text('返回乾燥貨櫃');
  192. $("#NextPage").attr('href','/camera_dry');
  193. $("#NextPage").text('前往乾燥貨櫃總攝影機畫面');
  194. } else if (camera_title == '發酵出料儲豆槽' | camera_title == '發酵入料儲豆槽' | camera_title == '發酵槽') {
  195. $("#PreviousPage").attr('href','/ferment');
  196. $("#PreviousPage").text('返回發酵貨櫃');
  197. $("#NextPage").attr('href','/camera_ferment');
  198. $("#NextPage").text('前往發酵貨櫃總攝影機畫面');
  199. } else if (camera_title == '清洗浮選出料儲豆槽' | camera_title == '清洗浮選槽' | camera_title == '色選機出料儲豆槽' |
  200. camera_title == '色選機' | camera_title == '脫皮機出料儲豆槽' | camera_title == '脫皮機') {
  201. $("#PreviousPage").attr('href','/clean');
  202. $("#PreviousPage").text('返回清洗貨櫃');
  203. $("#NextPage").attr('href','/camera_clean');
  204. $("#NextPage").text('前往清洗貨櫃總攝影機畫面');
  205. }
  206. });
  207. </script>
  208. </head>
  209. <body style="background-color: rgb(207, 207, 207);">
  210. <div style="text-align: left;">
  211. <a id="PreviousPage" href="" style="float: left;">________________</a>
  212. </div>
  213. <div style="text-align: right;">
  214. <a id="NextPage" href="" style="float: right;">________________</a>
  215. </div>
  216. <div id="camera_dry_title" style="text-align: center; margin-top: 30px; font-size: 24px;">
  217. M5 攝影機畫面
  218. </div>
  219. <!--
  220. <div class="container-fluid">
  221. <div class="row" style="margin-top:50px;">
  222. <div class="col flex">
  223. <div class="col-md-12 row flex" style="text-align:center; margin-top:5px;">
  224. <div class="col-md-12 row flex">
  225. <img src="" id="four" width="90%" height="90%">
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. -->
  232. <center>1.2 * 1.2</center>
  233. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  234. <tr>
  235. <td>
  236. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  237. </td>
  238. <td>
  239. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  240. </td>
  241. <td>
  242. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  243. </td>
  244. </tr>
  245. <tr>
  246. <td>
  247. 攝影機畫面
  248. </td>
  249. <td>
  250. 攝影機畫面
  251. </td>
  252. <td>
  253. 攝影機畫面
  254. </td>
  255. </tr>
  256. <tr>
  257. <td>
  258. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  259. </td>
  260. <td>
  261. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  262. </td>
  263. <td>
  264. <img src="../static/img/video_pic_3.png" id="four" height="288px" width="384px">
  265. </td>
  266. </tr>
  267. <tr>
  268. <td>
  269. 攝影機畫面
  270. </td>
  271. <td>
  272. 攝影機畫面
  273. </td>
  274. <td>
  275. 攝影機畫面
  276. </td>
  277. </tr>
  278. </table>
  279. <br>
  280. <br>
  281. <br>
  282. <hr>
  283. <center>1.3 * 1.3</center>
  284. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  285. <tr>
  286. <td>
  287. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  288. </td>
  289. <td>
  290. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  291. </td>
  292. <td>
  293. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  294. </td>
  295. </tr>
  296. <tr>
  297. <td>
  298. 攝影機畫面
  299. </td>
  300. <td>
  301. 攝影機畫面
  302. </td>
  303. <td>
  304. 攝影機畫面
  305. </td>
  306. </tr>
  307. <tr>
  308. <td>
  309. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  310. </td>
  311. <td>
  312. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  313. </td>
  314. <td>
  315. <img src="../static/img/video_pic_3.png" id="four" height="312px" width="416px">
  316. </td>
  317. </tr>
  318. <tr>
  319. <td>
  320. 攝影機畫面
  321. </td>
  322. <td>
  323. 攝影機畫面
  324. </td>
  325. <td>
  326. 攝影機畫面
  327. </td>
  328. </tr>
  329. </table>
  330. <br>
  331. <br>
  332. <br>
  333. <hr>
  334. <center>1.35 * 1.35 (等比例高滿版)</center>
  335. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  336. <tr>
  337. <td>
  338. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  339. </td>
  340. <td>
  341. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  342. </td>
  343. <td>
  344. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  345. </td>
  346. </tr>
  347. <tr>
  348. <td>
  349. 攝影機畫面
  350. </td>
  351. <td>
  352. 攝影機畫面
  353. </td>
  354. <td>
  355. 攝影機畫面
  356. </td>
  357. </tr>
  358. <tr>
  359. <td>
  360. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  361. </td>
  362. <td>
  363. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  364. </td>
  365. <td>
  366. <img src="../static/img/video_pic_3.png" id="four" height="324px" width="432px">
  367. </td>
  368. </tr>
  369. <tr>
  370. <td>
  371. 攝影機畫面
  372. </td>
  373. <td>
  374. 攝影機畫面
  375. </td>
  376. <td>
  377. 攝影機畫面
  378. </td>
  379. </tr>
  380. </table>
  381. <br>
  382. <br>
  383. <br>
  384. <hr>
  385. <center>1.4 * 1.4</center>
  386. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  387. <tr>
  388. <td>
  389. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  390. </td>
  391. <td>
  392. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  393. </td>
  394. <td>
  395. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  396. </td>
  397. </tr>
  398. <tr>
  399. <td>
  400. 攝影機畫面
  401. </td>
  402. <td>
  403. 攝影機畫面
  404. </td>
  405. <td>
  406. 攝影機畫面
  407. </td>
  408. </tr>
  409. <tr>
  410. <td>
  411. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  412. </td>
  413. <td>
  414. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  415. </td>
  416. <td>
  417. <img src="../static/img/video_pic_3.png" id="four" height="336px" width="448px">
  418. </td>
  419. </tr>
  420. <tr>
  421. <td>
  422. 攝影機畫面
  423. </td>
  424. <td>
  425. 攝影機畫面
  426. </td>
  427. <td>
  428. 攝影機畫面
  429. </td>
  430. </tr>
  431. </table>
  432. <br>
  433. <br>
  434. <br>
  435. <hr>
  436. <center>1.5 * 1.5</center>
  437. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  438. <tr>
  439. <td>
  440. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  441. </td>
  442. <td>
  443. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  444. </td>
  445. <td>
  446. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  447. </td>
  448. </tr>
  449. <tr>
  450. <td>
  451. 攝影機畫面
  452. </td>
  453. <td>
  454. 攝影機畫面
  455. </td>
  456. <td>
  457. 攝影機畫面
  458. </td>
  459. </tr>
  460. <tr>
  461. <td>
  462. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  463. </td>
  464. <td>
  465. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  466. </td>
  467. <td>
  468. <img src="../static/img/video_pic_3.png" id="four" height="360px" width="480px">
  469. </td>
  470. </tr>
  471. <tr>
  472. <td>
  473. 攝影機畫面
  474. </td>
  475. <td>
  476. 攝影機畫面
  477. </td>
  478. <td>
  479. 攝影機畫面
  480. </td>
  481. </tr>
  482. </table>
  483. <br>
  484. <br>
  485. <br>
  486. <hr>
  487. <center>1.55 * 1.55 (等比例寬滿版)</center>
  488. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  489. <tr>
  490. <td>
  491. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  492. </td>
  493. <td>
  494. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  495. </td>
  496. <td>
  497. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  498. </td>
  499. </tr>
  500. <tr>
  501. <td>
  502. 攝影機畫面
  503. </td>
  504. <td>
  505. 攝影機畫面
  506. </td>
  507. <td>
  508. 攝影機畫面
  509. </td>
  510. </tr>
  511. <tr>
  512. <td>
  513. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  514. </td>
  515. <td>
  516. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  517. </td>
  518. <td>
  519. <img src="../static/img/video_pic_3.png" id="four" width="496px" height="372px">
  520. </td>
  521. </tr>
  522. <tr>
  523. <td>
  524. 攝影機畫面
  525. </td>
  526. <td>
  527. 攝影機畫面
  528. </td>
  529. <td>
  530. 攝影機畫面
  531. </td>
  532. </tr>
  533. </table>
  534. <br>
  535. <br>
  536. <br>
  537. <hr>
  538. <center> 1對4 (寬2.34 * 高1.35 全滿版)</center>
  539. <table border="1" style="margin: auto; font-size:18px; border:2px #f0f0f0 solid; margin-top: 10px; text-align: center;" cellpadding="3">
  540. <tr>
  541. <td>
  542. <img src="../static/img/video_pic_3.png" id="four" width="750px" height="325px">
  543. </td>
  544. <td>
  545. <img src="../static/img/video_pic_3.png" id="four" width="750px" height="325px">
  546. </td>
  547. </tr>
  548. <tr>
  549. <td>
  550. 攝影機畫面
  551. </td>
  552. <td>
  553. 攝影機畫面
  554. </td>
  555. </tr>
  556. <tr>
  557. <td>
  558. <img src="../static/img/video_pic_3.png" id="four" width="750px" height="325px">
  559. </td>
  560. <td>
  561. <img src="../static/img/video_pic_3.png" id="four" width="750px" height="325px">
  562. </td>
  563. </tr>
  564. <tr>
  565. <td>
  566. 攝影機畫面
  567. </td>
  568. <td>
  569. 攝影機畫面
  570. </td>
  571. </tr>
  572. </table>
  573. <script>
  574. // M5 攝影機
  575. //const img = document.querySelector('#one');
  576. const img3 = document.querySelector('#four');
  577. //const WS_URL3 = 'ws:///60.250.156.230:0000';
  578. const WS_URL3 = WS_URL;
  579. const ws3 = new WebSocket(WS_URL3);
  580. let urlObject3;
  581. ws3.onopen = () => console.log(`Connected to ${WS_URL3}`);
  582. ws3.onmessage = message3 => {
  583. const arrayBuffer3 = message3.data;
  584. if (urlObject3) {
  585. URL.revokeObjectURL(urlObject3);
  586. }
  587. urlObject3 = URL.createObjectURL(new Blob([arrayBuffer3]));
  588. img3.src = urlObject3;
  589. }
  590. </script>
  591. </body>
  592. </html>