channel.html 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. {% extends "index.html" %}
  2. {% block title %}水塔監控{% endblock %}
  3. {% block head %}
  4. {{ super() }}
  5. {% endblock %}
  6. {% block body %}
  7. <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.js"></script>
  8. <script type="text/javascript" src="/static/channel.js"></script>
  9. <div style="overflow: hidden;">
  10. <div id='select_boxes'>
  11. <select class="select-item" id="company-list" onChange="onChangeColumn1();">
  12. <option value=0>公司A</option>
  13. </select>
  14. <select class="select-item" id="factory-list" onChange="onChangeColumn2();">
  15. <option value=0>工廠A</option>
  16. </select>
  17. <select class="select-item" id="department-list" onChange="onChangeColumn3();">
  18. <option value=0>廠區A</option>
  19. </select>
  20. <select class="select-item" id="towerGroup-list">
  21. <option value=0>機組1</option>
  22. </select>
  23. <button class="me-0" id="tower_btn" onclick="click_button();"><i class="fas fa-search me-2"></i>搜尋</button>
  24. </div>
  25. <div id="select_boxes">
  26. <div id="tower-img" class="text-white">
  27. <select class="select-item" id="tower" onChange="show_tower_info();">
  28. </select>
  29. </div>
  30. </div>
  31. <div id='channel_health'>
  32. <div class="row">
  33. <div class="col-lg-4">
  34. <div class="h-100">
  35. <div class="card">
  36. <h1 style="color:#002e86;" class="pb-0">健康指數:<span style="color:#078B07;">86 &ensp;健康<i
  37. style="color: #078B07;" class="fas fa-check-circle ps-1"></i></span></h1>
  38. <h1 class="my-0 py-0">
  39. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  40. </h1>
  41. <canvas id="foo"></canvas>
  42. <!-- <h1 style="color: #078B07;" class="text-center">86 &ensp;健康<i style="color: #078B07;"
  43. class="fas fa-check-circle ps-1"></i></h1> -->
  44. </div>
  45. <div class="card mb-0">
  46. <h1 style="color:#002e86;" class='pb-0'>預測健康指標:<span style="color:#078B07">89</span></h1>
  47. <h1 class="my-0 py-0">
  48. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  49. </h1>
  50. <canvas id="foo2"></canvas>
  51. <!-- <h1 style="color: #078B07;">89</h1> -->
  52. </div>
  53. </div>
  54. </div>
  55. <div class="col-lg-8">
  56. <div id='channel' style="height: 97%;" class="card pb-0"></div>
  57. </div>
  58. </div>
  59. </div>
  60. <div id='chart_info'></div>
  61. </h1>
  62. <div class="card mt-5">
  63. <h1 style="color:#002e86;">預測資訊</h1>
  64. <h1 class="my-0 py-0">
  65. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  66. </h1>
  67. <p style="color:#002e86; padding-left: 15px; font-weight: 900;">預測結果:<span
  68. style="color: #078B07;">&ensp;正常</span> 未來1125筆後CV值:<span style="color: #078B07;">&ensp;0.801</span></p>
  69. <div style="padding:15px;">
  70. <canvas id="channel_predict"></canvas>
  71. </div>
  72. </div>
  73. <div class="card">
  74. <h1 style="color:#002e86;">最新頻域圖</h1>
  75. <h1 class="my-0 py-0">
  76. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  77. </h1>
  78. <div style="padding:15px">
  79. <canvas id="channel_frequency"></canvas>
  80. </div>
  81. </div>
  82. <div class="card">
  83. <h1 style="color:#002e86;">七日內健康指標累計圖表</h1>
  84. <h1 class="my-0 py-0">
  85. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  86. </h1>
  87. <div style="padding:30px">
  88. <canvas id="CV_index"></canvas>
  89. </div>
  90. </div>
  91. <div class="row">
  92. <div class="col-lg-6">
  93. <div class="card">
  94. <h1 style="color:#002e86;">七日內 Vrms 累計圖表 (mm/s)</h1>
  95. <h1 class="my-0 py-0">
  96. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  97. </h1>
  98. <div style="padding: 15px;">
  99. <canvas id="RPM"></canvas>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="col-lg-6">
  104. <div class="card">
  105. <h1 style="color:#002e86;">七日內 RMS 累計圖表 (g)</h1>
  106. <h1 class="my-0 py-0">
  107. <hr class="mt-1 mb-3" style="background:#002e86; height: 1px; opacity: 1;">
  108. </h1>
  109. <div style="padding: 15px;">
  110. <canvas id="Vrms"></canvas>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. </div>
  116. <div id='tower_perfrom'></div>
  117. <script src="https://cdnjs.cloudflare.com/ajax/libs/gauge.js/1.3.7/gauge.min.js"
  118. integrity="sha512-J0d1VfdfTSDoDPEsahCtf2nC+groXdWkuQFyJjS+s3CpKj63X9Hf3pMEJtjIJt/ODh0QwTRx2/OioL+9fMoqSA=="
  119. crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  120. <script>
  121. // 儀錶板
  122. var opts = {
  123. angle: 0, // The span of the gauge arc
  124. lineWidth: 0.5, // The line thickness
  125. radiusScale: 1, // Relative radius
  126. pointer: {
  127. length: 0.6, // // Relative to gauge radius
  128. strokeWidth: 0.035, // The thickness
  129. color: '#000000' // Fill color
  130. },
  131. staticZones: [
  132. { strokeStyle: "#F03E3E", min: 0, max: 30 }, // Red from 100 to 130
  133. { strokeStyle: "#FFDD00", min: 30, max: 50 }, // Yellow
  134. { strokeStyle: "#30B32D", min: 50, max: 100 }, // Green
  135. ],
  136. staticLabels: {
  137. font: "16px sans-serif", // Specifies font
  138. labels: [30, 50, 100], // Print labels at these values
  139. color: "#000000", // Optional: Label text color
  140. fractionDigits: 0 // Optional: Numerical precision. 0=round off.
  141. },
  142. limitMax: false, // If false, max value increases automatically if value > maxValue
  143. limitMin: false, // If true, the min value of the gauge will be fixed
  144. colorStart: '#6FADCF', // Colors
  145. colorStop: '#8FC0DA', // just experiment with them
  146. strokeColor: '#E0E0E0', // to see which ones work best for you
  147. generateGradient: true,
  148. highDpiSupport: true, // High resolution support
  149. };
  150. var target = document.getElementById('foo'); // your canvas element
  151. var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
  152. gauge.maxValue = 100; // set max gauge value
  153. gauge.setMinValue(0); // Prefer setter over gauge.minValue = 0
  154. gauge.animationSpeed = 1; // set animation speed (32 is default value)
  155. gauge.set(86); // set actual valu
  156. </script>
  157. <script>
  158. // 儀錶板
  159. var opts = {
  160. angle: 0, // The span of the gauge arc
  161. lineWidth: 0.5, // The line thickness
  162. radiusScale: 1, // Relative radius
  163. pointer: {
  164. length: 0.6, // // Relative to gauge radius
  165. strokeWidth: 0.035, // The thickness
  166. color: '#000000' // Fill color
  167. },
  168. staticZones: [
  169. { strokeStyle: "#F03E3E", min: 0, max: 30 }, // Red from 100 to 130
  170. { strokeStyle: "#FFDD00", min: 30, max: 50 }, // Yellow
  171. { strokeStyle: "#30B32D", min: 50, max: 100 }, // Green
  172. ],
  173. staticLabels: {
  174. font: "16px sans-serif", // Specifies font
  175. labels: [30, 50, 100], // Print labels at these values
  176. color: "#000000", // Optional: Label text color
  177. fractionDigits: 0 // Optional: Numerical precision. 0=round off.
  178. },
  179. limitMax: false, // If false, max value increases automatically if value > maxValue
  180. limitMin: false, // If true, the min value of the gauge will be fixed
  181. colorStart: '#6FADCF', // Colors
  182. colorStop: '#8FC0DA', // just experiment with them
  183. strokeColor: '#E0E0E0', // to see which ones work best for you
  184. generateGradient: true,
  185. highDpiSupport: true, // High resolution support
  186. };
  187. var target = document.getElementById('foo2'); // your canvas element
  188. var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
  189. gauge.maxValue = 100; // set max gauge value
  190. gauge.setMinValue(0); // Prefer setter over gauge.minValue = 0
  191. gauge.animationSpeed = 1; // set animation speed (32 is default value)
  192. gauge.set(89); // set actual valu
  193. </script>
  194. {% endblock %}