channel.html 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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 id='select_boxes'>
  10. <select class="select-item" id="company-list" onChange="onChangeColumn1();">
  11. <option value=0>公司A</option>
  12. </select>
  13. <select class="select-item" id="factory-list" onChange="onChangeColumn2();">
  14. <option value=0>工廠A</option>
  15. </select>
  16. <select class="select-item" id="department-list" onChange="onChangeColumn3();">
  17. <option value=0>廠區A</option>
  18. </select>
  19. <select class="select-item" id="towerGroup-list">
  20. <option value=0>機組1</option>
  21. </select>
  22. <button id="tower_btn" onclick="click_button();"><i class="fas fa-search me-2"></i>搜尋</button>
  23. </div>
  24. <div id="tower-box">
  25. <div id="tower-img" class="text-white">
  26. <select id="tower" onChange="show_tower_info();">
  27. </select>
  28. </div>
  29. </div>
  30. <div id='channel_health'>
  31. <div class="row px-0 mx-0">
  32. <div class="col-lg-6 text-center">
  33. <div>
  34. <h1>健康指數</h1>
  35. <canvas id="foo"></canvas>
  36. <h1 style="color: #078B07;" class="text-center">86 &ensp;健康<i style="color: #078B07;"
  37. class="fas fa-check-circle ps-1"></i></h1>
  38. </div>
  39. </div>
  40. <div class="col-lg-6 text-center">
  41. <div>
  42. <h1>預測健康指標</h1>
  43. <canvas id="foo2"></canvas>
  44. <h1 style="color: #078B07;">89</h1>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. <script src="https://cdnjs.cloudflare.com/ajax/libs/gauge.js/1.3.7/gauge.min.js"
  50. integrity="sha512-J0d1VfdfTSDoDPEsahCtf2nC+groXdWkuQFyJjS+s3CpKj63X9Hf3pMEJtjIJt/ODh0QwTRx2/OioL+9fMoqSA=="
  51. crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  52. <script>
  53. // 儀錶板
  54. var opts = {
  55. angle: 0, // The span of the gauge arc
  56. lineWidth: 0.5, // The line thickness
  57. radiusScale: 1, // Relative radius
  58. pointer: {
  59. length: 0.6, // // Relative to gauge radius
  60. strokeWidth: 0.035, // The thickness
  61. color: '#000000' // Fill color
  62. },
  63. staticZones: [
  64. { strokeStyle: "#F03E3E", min: 0, max: 30 }, // Red from 100 to 130
  65. { strokeStyle: "#FFDD00", min: 30, max: 50 }, // Yellow
  66. { strokeStyle: "#30B32D", min: 50, max: 100 }, // Green
  67. ],
  68. staticLabels: {
  69. font: "16px sans-serif", // Specifies font
  70. labels: [30, 50, 100], // Print labels at these values
  71. color: "#000000", // Optional: Label text color
  72. fractionDigits: 0 // Optional: Numerical precision. 0=round off.
  73. },
  74. limitMax: false, // If false, max value increases automatically if value > maxValue
  75. limitMin: false, // If true, the min value of the gauge will be fixed
  76. colorStart: '#6FADCF', // Colors
  77. colorStop: '#8FC0DA', // just experiment with them
  78. strokeColor: '#E0E0E0', // to see which ones work best for you
  79. generateGradient: true,
  80. highDpiSupport: true, // High resolution support
  81. };
  82. var target = document.getElementById('foo'); // your canvas element
  83. var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
  84. gauge.maxValue = 100; // set max gauge value
  85. gauge.setMinValue(0); // Prefer setter over gauge.minValue = 0
  86. gauge.animationSpeed = 1; // set animation speed (32 is default value)
  87. gauge.set(86); // set actual valu
  88. </script>
  89. <script>
  90. // 儀錶板
  91. var opts = {
  92. angle: 0, // The span of the gauge arc
  93. lineWidth: 0.5, // The line thickness
  94. radiusScale: 1, // Relative radius
  95. pointer: {
  96. length: 0.6, // // Relative to gauge radius
  97. strokeWidth: 0.035, // The thickness
  98. color: '#000000' // Fill color
  99. },
  100. staticZones: [
  101. { strokeStyle: "#F03E3E", min: 0, max: 30 }, // Red from 100 to 130
  102. { strokeStyle: "#FFDD00", min: 30, max: 50 }, // Yellow
  103. { strokeStyle: "#30B32D", min: 50, max: 100 }, // Green
  104. ],
  105. staticLabels: {
  106. font: "16px sans-serif", // Specifies font
  107. labels: [30, 50, 100], // Print labels at these values
  108. color: "#000000", // Optional: Label text color
  109. fractionDigits: 0 // Optional: Numerical precision. 0=round off.
  110. },
  111. limitMax: false, // If false, max value increases automatically if value > maxValue
  112. limitMin: false, // If true, the min value of the gauge will be fixed
  113. colorStart: '#6FADCF', // Colors
  114. colorStop: '#8FC0DA', // just experiment with them
  115. strokeColor: '#E0E0E0', // to see which ones work best for you
  116. generateGradient: true,
  117. highDpiSupport: true, // High resolution support
  118. };
  119. var target = document.getElementById('foo2'); // your canvas element
  120. var gauge = new Gauge(target).setOptions(opts); // create sexy gauge!
  121. gauge.maxValue = 100; // set max gauge value
  122. gauge.setMinValue(0); // Prefer setter over gauge.minValue = 0
  123. gauge.animationSpeed = 1; // set animation speed (32 is default value)
  124. gauge.set(89); // set actual valu
  125. </script>
  126. <div id='channel' class="card"></div>
  127. <div id='chart_info'></div>
  128. <h1 class="ps-3">預測資訊 預測結果 <span style="color: #078B07;">正常</span> 未來1125筆後CV值<span style="color: #078B07;">0.801</span> </h1>
  129. <div class="card">
  130. <canvas id="channel_predict"></canvas>
  131. </div>
  132. <div class="card">
  133. <canvas id="channel_frequency"></canvas>
  134. </div>
  135. <div class="card">
  136. <div class="row px-0 mx-0">
  137. <div class="col-lg-12">
  138. <canvas id="CV_index"></canvas>
  139. </div>
  140. <div class="col-lg-6">
  141. <canvas id="RPM"></canvas>
  142. </div>
  143. <div class="col-lg-6">
  144. <canvas id="Vrms"></canvas>
  145. </div>
  146. </div>
  147. </div>
  148. <div id='tower_perfrom'></div>
  149. {% endblock %}