index_zh-Hant.html 126 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111
  1. <!-- 宣告我們要套用模板 -->
  2. {% extends "base.html" %}
  3. {% block title %}{{ title }}{% endblock %}
  4. {% block link %}
  5. <link rel="stylesheet" type="text/css" href="../static/css/prettify.css">
  6. <link rel="stylesheet" type="text/css" href="../static/css/jquery.terminal.css">
  7. <script type="text/javascript" src="../static/js/blockly_compressed.js"></script>
  8. <script type="text/javascript" src="../static/js/blocks_compressed.js"></script>
  9. <script type="text/javascript" src="../static/js/cake_compressed.js"></script>
  10. <script type="text/javascript" src="../static/msg/js/zh-hant.js"></script>
  11. <script type="text/javascript" src="../static/js/jquery-2.1.1.min.js"></script>
  12. <script type="text/javascript" src="../static/js/code.js"></script>
  13. <script type="text/javascript" src="../static/js/FileSaver.js"></script>
  14. <script type="text/javascript" src="../static/js/prettify.js"></script>
  15. <script type="text/javascript" src="../static/js/jquery.mousewheel.min.js"></script>
  16. <script type="text/javascript" src="../static/js/pin_set.js"></script>
  17. <script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script>
  18. {% endblock %}
  19. {% block script %}
  20. <script>
  21. var status = '{{status}}';
  22. Blockly.Blocks['var'] = {
  23. init: function() {
  24. this.appendDummyInput()
  25. .appendField(new Blockly.FieldDropdown([["u8_t","u8_t"], ["__IO","__IO"], ["char","char"], ["int","int"], ["uint8_t","uint8_t"], ["uint16_t","uint16_t"], ["uint32_t","uint32_t"]]), "1")
  26. .appendField("變數名稱")
  27. .appendField(new Blockly.FieldTextInput("myvar"), "NAME1")
  28. .appendField("初始值")
  29. .appendField(new Blockly.FieldTextInput("0"), "NAME");
  30. this.setPreviousStatement(true, null);
  31. this.setNextStatement(true, null);
  32. }
  33. };
  34. Blockly.cake['var'] = function(block) {
  35. var dropdown_1 = block.getFieldValue('1');
  36. var text_12 = block.getFieldValue('NAME1');
  37. var text_2 = block.getFieldValue('NAME');
  38. // TODO: Assemble JavaScript into code variable.
  39. var code = dropdown_1+" "+text_12+"="+text_2+';\n';
  40. return code;
  41. };
  42. Blockly.Blocks['control'] = {
  43. init: function() {
  44. this.appendDummyInput()
  45. .appendField("控制腳位")
  46. .appendField(new Blockly.FieldDropdown([["relay1","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_13,"], ["relay2","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_12,"], ["relay3","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_11,"], ["relay4","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_10,"], ["relay5","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_9,"], ["relay6","HAL_GPIO_WritePin(GPIOA,GPIO_PIN_8,"], ["relay7","HAL_GPIO_WritePin(GPIOC,GPIO_PIN_9,"], ["relay8","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_15,"], ["relay9","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_14,"], ["relay10","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_13,"], ["relay11","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_12,"], ["relay12","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_11,"], ["relay13","HAL_GPIO_WritePin(GPIOD,GPIO_PIN_10,"], ["relay14","HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,"], ["relay15","HAL_GPIO_WritePin(GPIOB,GPIO_PIN_14,"], ["relay16","HAL_GPIO_WritePin(GPIOE,GPIO_PIN_15,"], ["relay17","HAL_GPIO_WritePin(GPIOE,GPIO_PIN_14,"], ["relay18","HAL_GPIO_WritePin(GPIOE,GPIO_PIN_13,"], ["relay19","HAL_GPIO_WritePin(GPIOE,GPIO_PIN_12,"], ["relay20","HAL_GPIO_WritePin(GPIOE,GPIO_PIN_11,"]]), "NAME")
  47. .appendField(",")
  48. .appendField(new Blockly.FieldDropdown([["開啟","GPIO_PIN_RESET)"], ["關閉","GPIO_PIN_SET)"]]), "NAME1");
  49. this.setPreviousStatement(true, null);
  50. this.setNextStatement(true, null);
  51. }
  52. };
  53. Blockly.cake['control'] = function(block) {
  54. var dropdown_name = block.getFieldValue('NAME');
  55. var dropdown_name1 = block.getFieldValue('NAME1');
  56. // TODO: Assemble JavaScript into code variable.
  57. var code = dropdown_name+dropdown_name1+";\n"
  58. // TODO: Change ORDER_NONE to the correct strength.
  59. return code;
  60. };
  61. Blockly.Blocks['free'] = {
  62. init: function() {
  63. this.appendDummyInput()
  64. .appendField("自由定義")
  65. .appendField(new Blockly.FieldTextInput("default"), "NAME");
  66. this.setPreviousStatement(true, null);
  67. this.setNextStatement(true, null);
  68. this.setColour(230);
  69. }
  70. };
  71. Blockly.cake['free'] = function(block) {
  72. var text_name = block.getFieldValue('NAME');
  73. // TODO: Assemble JavaScript into code variable.
  74. var code =text_name+';\n';
  75. return code;
  76. };
  77. </script>
  78. <script>
  79. function load_xml() {
  80. var a = document.getElementById("program_name");
  81. a.value = '{{TankID}}';
  82. tid='{{TankID}}';
  83. $.get('/load_xml_'+tid, function (resText) {
  84. try {
  85. var xml = Blockly.Xml.textToDom(resText.xml);
  86. }
  87. catch (e) {
  88. alert('剖析XML錯誤:\n' + e);
  89. return;
  90. }
  91. var count = Blockly.mainWorkspace.getAllBlocks().length;
  92. if (count) {
  93. Blockly.mainWorkspace.clear();
  94. }
  95. Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, xml);
  96. },'json');
  97. }
  98. function save_xml() {
  99. var xml = Blockly.Xml.workspaceToDom(Blockly.mainWorkspace);
  100. var xml_text = Blockly.Xml.domToPrettyText(xml);
  101. console.log(xml_text);
  102. var json = {
  103. 'tank_num': '{{TankID}}',
  104. 'xml': xml_text,
  105. };
  106. $.get('/save_xml',json,function(resText){
  107. if(resText.pass=="pass"){
  108. alert('儲存成功');
  109. }
  110. else{
  111. alert('儲存失敗');
  112. }
  113. },'json');
  114. }
  115. function save_code() {
  116. var code = Blockly.cake.workspaceToCode();
  117. console.log(code);
  118. var json = {
  119. 'user':'{{username}}',
  120. 'tank_num': '{{TankID}}',
  121. 'code': code
  122. };
  123. $.get('/save_code',json,function(resText){
  124. if(resText.pass=="pass"){
  125. alert('下載成功');
  126. }
  127. else{
  128. alert('下載失敗');
  129. }
  130. },'json');
  131. }
  132. function back(){
  133. window.location.href='/board';
  134. };
  135. function programmer() {
  136. var msg;
  137. $.get('/make_hex',function(res){
  138. if(res.pass=="NG"){
  139. $("#creat_hex_Value").text("生成hex檔失敗");
  140. $("#programmer_Value").text("上一步驟失敗");
  141. }
  142. else{
  143. $("#creat_hex_Value").text("生成hex檔成功");
  144. }
  145. if(res.pass=="pass")
  146. {
  147. alert("生成hex檔成功");
  148. }
  149. else
  150. {
  151. alert("生成hex檔失敗");
  152. }
  153. if(res.pass=="NG")
  154. {
  155. $("#programmer_Value").text("上一步驟失敗");
  156. }
  157. else
  158. {
  159. var USERNAME = '{{username}}';
  160. var confirm_programmer = confirm("即將燒錄 Coffee1.0, 確定請按下 [確認] :");
  161. if (!confirm_programmer) {
  162. alert("已取消燒錄");
  163. $("#programmer_Value").text("燒錄取消");
  164. }
  165. else {
  166. var prog_tank_data = '{{TankID}}';
  167. var prog_burner_mac = "b8:27:eb:b4:59:3e";
  168. console.log("prog_burner_mac: " + prog_burner_mac);
  169. var prog_data = {'tank':prog_tank_data,
  170. 'USERNAME': USERNAME,
  171. 'burner_mac':prog_burner_mac}
  172. $.get('/programmer', prog_data, function (res) {
  173. if(res=="start burn")
  174. {
  175. $("#programmer_Value").text("準備燒錄...");
  176. }
  177. else
  178. {
  179. $("#programmer_Value").text("燒錄失敗");
  180. }}, 'text');
  181. }
  182. }
  183. },'json');
  184. }
  185. $(document).ready(function(){
  186. load_xml();
  187. });
  188. </script>
  189. <script>
  190. // 當右方的下拉式選單選擇時, 更新左方圖片上的文字 - relay
  191. function select_relay(id) {
  192. var select_relay_text = $("#select_relay_" + id).find(':selected').text()
  193. //console.log("select_relay_text: " + select_relay_text)
  194. if (select_relay_text == '') {
  195. $("#relay" + id).text('');
  196. }
  197. else {
  198. $("#relay" + id).text(select_relay_text);
  199. }
  200. }
  201. function selectSensor(PinNum) {
  202. var Pin_sensor = $("#selectSensor_" + PinNum).find(':selected').text();
  203. // console.log("Pin_sensor: " + Pin_sensor)
  204. if (Pin_sensor == '') {
  205. $("#" + PinNum).text('');
  206. } else {
  207. $("#" + PinNum).text(Pin_sensor);
  208. // alert("sensorlist[PinNum]]\n" + sensorlist[PinNum.substring(1)])
  209. }
  210. }
  211. function select_RF(rf) {
  212. var rf_sensor = $("#select_" + rf).find(':selected').text();
  213. if (rf_sensor == "ON") {
  214. $("#" + rf).css("fill", "rgb(60, 179, 113)");
  215. } else {
  216. $("#" + rf).css("fill", "rgb(107, 107, 107)");
  217. }
  218. }
  219. const list_R = ['R1','R2','R3','R4','R5','R6','R7','R8','R9','R10','R11','R12','R13','R14','R15','R16','R17','R18','R19','R20']
  220. const list_M = ['M1','M2','M3','M4','M5','M6','M7','M8','M9','M10','M11','M12','M13','M14','M15','M16','M17','M18','M19']
  221. function ItemGetValueToDB() {
  222. var ethernet_text = $("#select_eth").find(':selected').val();
  223. var wifi_text = $("#select_wifi").find(':selected').val();
  224. var zigbee_text = $("#select_zigbee").find(':selected').val();
  225. var tank_text = '{{TankID}}';
  226. console.log("ethernet_text: " + ethernet_text);
  227. console.log("wifi_text: " + wifi_text);
  228. console.log("zigbee_text: " + zigbee_text);
  229. console.log("tank_text: " + tank_text);
  230. list_relay_item = [];
  231. for (let i = 1; i < 21; i++) {
  232. var relay_text = $("#select_relay_" + i).find(':selected').val();
  233. if (relay_text != '') {
  234. list_relay_item.push(relay_text);
  235. } else {
  236. list_relay_item.push('');
  237. }
  238. }
  239. console.log("list_relay_item: " + list_relay_item);
  240. list_sensor_item = [];
  241. for (let i = 1; i < 20; i++) {
  242. var sensor_text = $("#selectSensor_M" + i).find(':selected').val();
  243. if (sensor_text != '') {
  244. list_sensor_item.push(sensor_text);
  245. } else {
  246. list_sensor_item.push('');
  247. }
  248. }
  249. console.log("list_sensor_item: " + list_sensor_item);
  250. var SQL_insert = 'INSERT INTO `coffee1_0_pin` (' +
  251. '`datetime`, `tid`, `ethernet`, `wifi`, `zigbee`, `' +
  252. list_R.join("`, `") +
  253. '`, `' +
  254. list_M.join("`, `") +
  255. '`) VALUES (' +
  256. 'current_timestamp(), "' + tank_text + '", "' + ethernet_text + '", "' + wifi_text + '", "' + zigbee_text + '", "' +
  257. list_relay_item.join('", "') +
  258. '", "' +
  259. list_sensor_item.join('", "') +
  260. '")';
  261. var sql_data = { "sql":SQL_insert };
  262. console.log(sql_data)
  263. $.get('/sql_get', sql_data, function (res) {
  264. if (res['response'] == '') {
  265. alert("腳位配置儲存成功");
  266. } else {
  267. alert(res['response']);
  268. }
  269. location.reload();
  270. }, 'json');
  271. }
  272. $(function(){
  273. const pin_data_ethernet = '{{pin_data.ethernet}}';
  274. if (pin_data_ethernet == 'ON') {
  275. $("#select_eth").val('ON');
  276. $("#eth").css("fill", "rgb(60, 179, 113)");
  277. }
  278. else{
  279. $("#select_eth").val('OFF');
  280. $("#eth").css("fill", "rgb(107, 107, 107)");
  281. }
  282. const pin_data_wifi = '{{pin_data.wifi}}';
  283. if (pin_data_wifi == 'ON') {
  284. $("#select_wifi").val('ON');
  285. $("#wifi").css("fill", "rgb(60, 179, 113)");
  286. }
  287. else{
  288. $("#select_wifi").val('OFF');
  289. $("#wifi").css("fill", "rgb(107, 107, 107)");
  290. }
  291. const pin_data_zigbee = '{{pin_data.zigbee}}';
  292. if (pin_data_zigbee == 'ON') {
  293. $("#select_zigbee").val('ON');
  294. $("#zigbee").css("fill", "rgb(60, 179, 113)");
  295. }
  296. else{
  297. $("#select_zigbee").val('OFF');
  298. $("#zigbee").css("fill", "rgb(107, 107, 107)");
  299. }
  300. const pin_data_relay = ['', '{{pin_data.R1}}','{{pin_data.R2}}','{{pin_data.R3}}','{{pin_data.R4}}',
  301. '{{pin_data.R5}}','{{pin_data.R6}}','{{pin_data.R7}}','{{pin_data.R8}}','{{pin_data.R9}}',
  302. '{{pin_data.R10}}','{{pin_data.R11}}','{{pin_data.R12}}','{{pin_data.R13}}','{{pin_data.R14}}',
  303. '{{pin_data.R15}}','{{pin_data.R16}}','{{pin_data.R17}}','{{pin_data.R18}}','{{pin_data.R19}}','{{pin_data.R20}}'
  304. ]
  305. const pin_data_sensor = ['', '{{pin_data.M1}}','{{pin_data.M2}}','{{pin_data.M3}}','{{pin_data.M4}}',
  306. '{{pin_data.M5}}','{{pin_data.M6}}','{{pin_data.M7}}','{{pin_data.M8}}','{{pin_data.M9}}',
  307. '{{pin_data.M10}}','{{pin_data.M11}}','{{pin_data.M12}}','{{pin_data.M13}}','{{pin_data.M14}}',
  308. '{{pin_data.M15}}','{{pin_data.M16}}','{{pin_data.M17}}','{{pin_data.M18}}','{{pin_data.M19}}'
  309. ]
  310. // 腳位配置-relay
  311. for (let p_r = 1; p_r <= pin_data_relay.length; p_r++) {
  312. if (pin_data_relay[p_r] != '') {
  313. $("#select_relay_" + p_r).val(pin_data_relay[p_r]);
  314. $("#relay" + p_r).text(pin_data_relay[p_r]);
  315. }
  316. }
  317. // 腳位配置-sensor
  318. for (let p_m = 1; p_m <= pin_data_sensor.length; p_m++) {
  319. if (pin_data_sensor[p_m] != '') {
  320. $("#selectSensor_M" + p_m).val(pin_data_sensor[p_m]);
  321. $("#M" + p_m).text(pin_data_sensor[p_m]);
  322. }
  323. }
  324. })
  325. </script>
  326. <script>
  327. // the URL or IP address of the MQTT server to connect to
  328. const mqtt_server = "60.250.156.234"
  329. // the port of the MQTT server to connect to
  330. const mqtt_port = 8080
  331. // the MQTT topic to publish to 9c:65:f9:1e:6c:68 b8:27:eb:84:e9:3f b8:27:eb:f8:24:92 b8:27:eb:7e:24:78 b8:27:eb:b4:59:3e
  332. const mqtt_pub_topic = "AISKY/Coffee/MK-G/b8:27:eb:b4:59:3e";
  333. // the MQTT topic to subscribe to b8:27:eb:b4:59:3e b8:27:eb:7e:24:78 9c:65:f9:1e:84:9f b8:27:eb:7e:24:78 b8:27:eb:b4:59:3e
  334. const mqtt_sub_topic = "AISKY/Coffee/MK-G/b8:27:eb:b4:59:3e/Log";
  335. var client = false;
  336. // the function to be executed when connected to the MQTT broker
  337. function onConnect() {
  338. // once connected, start subscribing to the topic
  339. console.log("onConnect: start subscribing to the topic");
  340. client.subscribe(mqtt_sub_topic, { qos: Number(2) });
  341. }
  342. // the function to be executed when the message is received
  343. function onMessageArrived(message) {
  344. console.log("onMessageArrived:" + message.payloadString);
  345. // display received messages on the webpage
  346. //document.getElementById("mqtt_monitor").innerText = message.payloadString;
  347. var data = JSON.parse(message.payloadString);
  348. if(data.command=="Code_upload")
  349. {
  350. if(data.response=="no reply")
  351. {
  352. $("#programmer_Value").text("無回覆");
  353. alert("控制板無回覆");
  354. }
  355. else if(data.response=="success")
  356. {
  357. $("#programmer_Value").text("成功燒錄");
  358. alert("燒錄成功");
  359. }
  360. else if(data.response=="upload error")
  361. {
  362. $("#programmer_Value").text("上傳失敗");
  363. alert("資料上傳失敗");
  364. }
  365. else
  366. {
  367. $("#programmer_Value").text("上傳失敗");
  368. alert("資料上傳失敗");
  369. }
  370. var json = {
  371. 'user':'{{username}}',
  372. 'tank_num': '{{TankID}}',
  373. 'result': data.response,
  374. };
  375. $.get('/result', json, function (res) {
  376. if (res.pass == 'pass') {
  377. alert("燒錄結果已儲存");
  378. } else {
  379. alert("燒錄結果儲存失敗");
  380. }
  381. }, 'json');
  382. }
  383. }
  384. //-------------------------------------------------------------------------------
  385. function init() {
  386. // assign the client ID for MQTT broker authentication, you can assign it on your own
  387. var MQTT_CLIENT_ID = "iot_web_" + Math.floor((1 + Math.random()) * 0x10000000000).toString(16);
  388. // create a MQTT client instance
  389. // make sure the MQTT broker address and port number are correct
  390. // the port number should be used for websocket, not other protocol
  391. client = new Paho.MQTT.Client(mqtt_server, mqtt_port, '/ws', MQTT_CLIENT_ID);
  392. // the public MQTT broker "iot.eclipse.org" can be used for testing
  393. // client = new Paho.MQTT.Client("iot.eclipse.org", 80, '/ws', MQTT_CLIENT_ID);
  394. // the function to be executed when the message is received
  395. client.onMessageArrived = onMessageArrived;
  396. // connect to the MQTT broker
  397. client.connect({
  398. // if you don't use user name and password, just remove these lines
  399. userName: "aisky-server",
  400. password: "aisky",
  401. // the function to be executed when connected
  402. onSuccess:onConnect
  403. });
  404. }
  405. window.addEventListener('load', init, false);
  406. </script>
  407. <script>
  408. function pin_record(){
  409. var nr = '{{TankID}}';
  410. var datetime= document.getElementById("datetime").value;
  411. var json = {"nr":nr,"datetime":datetime};
  412. $.get('/pin_set', json, function(resText){
  413. console.log(resText[0]);
  414. const pin_data_ethernet = resText[0][3];
  415. if (pin_data_ethernet == 'ON') {
  416. $("#select_eth").val('ON');
  417. $("#eth").css("fill", "rgb(60, 179, 113)");
  418. }
  419. else{
  420. $("#select_eth").val('OFF');
  421. $("#eth").css("fill", "rgb(107, 107, 107)");
  422. }
  423. const pin_data_wifi = resText[0][4];
  424. if (pin_data_wifi == 'ON') {
  425. $("#select_wifi").val('ON');
  426. $("#wifi").css("fill", "rgb(60, 179, 113)");
  427. }
  428. else{
  429. $("#select_wifi").val('OFF');
  430. $("#wifi").css("fill", "rgb(107, 107, 107)");
  431. }
  432. const pin_data_zigbee = resText[0][5];
  433. if (pin_data_zigbee == 'ON') {
  434. $("#select_zigbee").val('ON');
  435. $("#zigbee").css("fill", "rgb(60, 179, 113)");
  436. }
  437. else{
  438. $("#select_zigbee").val('OFF');
  439. $("#zigbee").css("fill", "rgb(107, 107, 107)");
  440. }
  441. // 腳位配置-relay
  442. for (let p_r = 1; p_r < 21; p_r++) {
  443. $("#select_relay_" + p_r).val(resText[0][p_r+5]);
  444. $("#relay" + p_r).text(resText[0][p_r+5]);
  445. }
  446. // 腳位配置-sensor
  447. for (let p_m = 1; p_m < 21; p_m++) {
  448. $("#selectSensor_M" + p_m).val(resText[0][p_m+25]);
  449. $("#M" + p_m).text(resText[0][p_m+25]);
  450. }
  451. }, 'json');
  452. };
  453. function pin_set(){
  454. var nr = '{{TankID}}';
  455. var json = {"nr":nr};
  456. $.get('/pin_history', json, function(resText){
  457. var html_t = '';
  458. html_t += '<option value="' + '">' + '</option>';
  459. for (let j = 1; j < resText.length; j++) {
  460. var obj = resText[j];
  461. html_t += '<option value="' + obj + '">' + obj + '</option>';
  462. }
  463. $("#datetime").html(html_t);
  464. }, 'json');
  465. };
  466. function code_record() {
  467. var a = document.getElementById("program_name");
  468. a.value = '{{TankID}}';
  469. var nr = '{{TankID}}';
  470. var datetime= document.getElementById("code_record").value;
  471. var json = {"nr":nr,"datetime":datetime};
  472. $.get('/code_set',json, function (resText) {
  473. try {
  474. var xml = Blockly.Xml.textToDom(resText[0][2]);
  475. }
  476. catch (e) {
  477. alert('剖析XML錯誤:\n' + e);
  478. return;
  479. }
  480. var count = Blockly.mainWorkspace.getAllBlocks().length;
  481. if (count) {
  482. Blockly.mainWorkspace.clear();
  483. }
  484. Blockly.Xml.domToWorkspace(Blockly.mainWorkspace, xml);
  485. },'json');
  486. }
  487. function code_set(){
  488. var nr = '{{TankID}}';
  489. var json = {"nr":nr};
  490. $.get('/code_history', json, function(resText){
  491. var html_t = '';
  492. html_t += '<option value="' + '">' + '</option>';
  493. for (let j = 1; j < resText.length; j++) {
  494. var obj = resText[j];
  495. html_t += '<option value="' + obj + '">' + obj + '</option>';
  496. }
  497. $("#code_record").html(html_t);
  498. }, 'json');
  499. };
  500. </script>
  501. {% endblock %}
  502. {% block style %}
  503. <style>
  504. #main-wrapper {
  505. height: auto;
  506. min-height: 560px;
  507. min-width: 400px;
  508. }
  509. #terminal-wrapper {
  510. height: auto;
  511. }
  512. #terminal {
  513. width: 100%;
  514. height: 300px;
  515. }
  516. #blocklyDiv {
  517. /* height: auto; */
  518. height: -moz-calc(100vh - 150px); /* Firefox */
  519. height: -webkit-calc(100vh - 150px); /* WebKit */
  520. height: -o-calc(100vh - 150px); /* Opera */
  521. height: calc(100vh - 150px); /* Standard */
  522. min-height: 560px;
  523. margin-bottom: 0;
  524. padding: 0px !important;
  525. }
  526. #code-wrapper {
  527. height: auto;
  528. }
  529. #code {
  530. /* height: auto; */
  531. height: -moz-calc(100vh - 150px); /* Firefox */
  532. height: -webkit-calc(100vh - 150px); /* WebKit */
  533. height: -o-calc(100vh - 150px); /* Opera */
  534. height: calc(100vh - 150px); /* Standard */
  535. min-height: 560px;
  536. margin-bottom: 0;
  537. }
  538. #toolbox {
  539. display: none;
  540. }
  541. #footer {
  542. border-top: 1px solid #e5e5e5;
  543. }
  544. #program_name {
  545. background-color: transparent;
  546. border: none !important;
  547. font-size: 24px;
  548. }
  549. </style>
  550. {% endblock %}
  551. {% block main %}
  552. <div class="album py-5 bg-light">
  553. <div class="container">
  554. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  555. <div class="col">
  556. <div class="card shadow-sm">
  557. <h1 class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">{{TankID}}</h1>
  558. <h1 class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">桶槽腳位配置</h1>
  559. <div class="row row-cols-12 row-cols-sm-12 row-cols-md-12">
  560. <div class="btn-toolbar" role="toolbar" style="justify-content: center;">
  561. <div class="btn-group">
  562. <button type="button" class="btn btn-secondary" onclick="back()">
  563. <span class="glyphicon glyphicon-folder-open"></span> 重新選擇桶槽
  564. </button>
  565. <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#control_record_Modal" onclick="pin_set()">
  566. <span class="glyphicon glyphicon-download-alt"></span> 載入腳位配置
  567. </button>
  568. <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#control_RF_Modal">
  569. <span class="glyphicon glyphicon-download-alt"></span> 腳位配置設定
  570. </button>
  571. </div>
  572. </div>
  573. </div>
  574. <div class="card-body">
  575. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-2" style="justify-content: center;">
  576. <svg version="1.0" viewBox="0 0 600 500" class="sim" x="0px" y="0px" width="100%" height="100%" fill="rgba(0,0,0,0)">
  577. //板子形狀
  578. <rect class="body" x="0" y="0" width="598" height="450" rx="3" ry="3" style=" fill: rgb(60, 179, 113);"></rect>
  579. //relay形狀
  580. <rect class="relay" x="0" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  581. <rect class="relay" x="30" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  582. <rect class="relay" x="60" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  583. <rect class="relay" x="90" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  584. <rect class="relay" x="120" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  585. <rect class="relay" x="150" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  586. <rect class="relay" x="180" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  587. <rect class="relay" x="210" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  588. <rect class="relay" x="240" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  589. <rect class="relay" x="270" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  590. <rect class="relay" x="300" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  591. <rect class="relay" x="330" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  592. <rect class="relay" x="360" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  593. <rect class="relay" x="390" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  594. <rect class="relay" x="420" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  595. <rect class="relay" x="450" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  596. <rect class="relay" x="480" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  597. <rect class="relay" x="510" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  598. <rect class="relay" x="540" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  599. <rect class="relay" x="570" y="0" width="28" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  600. //valve形狀
  601. <rect class="valve" x="0" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  602. <rect class="valve" x="30" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  603. <rect class="valve" x="60" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  604. <rect class="valve" x="90" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  605. <rect class="valve" x="120" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  606. <rect class="valve" x="150" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  607. <rect class="valve" x="180" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  608. <rect class="valve" x="210" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  609. <rect class="valve" x="240" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  610. <rect class="valve" x="270" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  611. <rect class="valve" x="300" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  612. <rect class="valve" x="330" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  613. <rect class="valve" x="360" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  614. <rect class="valve" x="390" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  615. <rect class="valve" x="420" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  616. <rect class="valve" x="450" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  617. <rect class="valve" x="480" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  618. <rect class="valve" x="510" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  619. <rect class="valve" x="540" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  620. <rect class="valve" x="570" y="30" width="28" height="120" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  621. //莫仕座形狀
  622. <rect class="sensor" x="0" y="200" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  623. <rect class="sensor" x="0" y="240" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  624. <rect class="sensor" x="0" y="280" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  625. <rect class="sensor" x="0" y="320" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  626. <rect class="sensor" x="0" y="360" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  627. <rect class="sensor" x="0" y="400" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  628. <rect class="sensor" x="80" y="200" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  629. <rect class="sensor" x="80" y="240" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  630. <rect class="sensor" x="80" y="280" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  631. <rect class="sensor" x="80" y="320" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  632. <rect class="sensor" x="80" y="360" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  633. <rect class="sensor" x="160" y="200" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  634. <rect class="sensor" x="160" y="240" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  635. <rect class="sensor" x="160" y="280" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  636. <rect class="sensor" x="160" y="320" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  637. <rect class="sensor" x="160" y="360" width="70" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  638. <rect class="sensor" x="240" y="280" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  639. <rect class="sensor" x="240" y="320" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  640. <rect class="sensor" x="240" y="360" width="50" height="25" rx="3" ry="3" style=" fill: rgb(250, 240, 230);"></rect>
  641. //通訊介面
  642. ------------------------------------
  643. <rect class="RF" x="528" y="230" width="70" height="60" rx="3" ry="3" style=" fill: rgb(240, 240, 240);"></rect>
  644. <rect id=eth class="RF" x="538" y="250" width="10" height="10" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  645. ------------------------------------
  646. <rect class="RF" x="498" y="300" width="100" height="60" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  647. <rect class="RF" x="502" y="305" width="60" height="50" rx="3" ry="3" style=" fill: rgb(240, 240, 240);"></rect>
  648. <rect class="RF" x="565" y="305" width="25" height="4" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  649. <rect class="RF" x="565" y="315" width="23" height="4" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  650. <rect class="RF" x="565" y="305" width="4" height="14" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  651. <rect class="RF" x="584" y="315" width="4" height="24" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  652. <rect class="RF" x="565" y="335" width="22" height="4" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  653. <rect class="RF" x="565" y="335" width="4" height="14" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  654. <rect class="RF" x="565" y="345" width="22" height="4" rx="3" ry="3" style=" fill: rgb(255, 255, 0);"></rect>
  655. <rect id=wifi class="RF" x="507" y="330" width="10" height="10" rx="3" ry="3" style=" fill: rgb(107, 107, 107);"></rect>
  656. ------------------------------------
  657. <rect class="RF" x="498" y="380" width="100" height="60" rx="3" ry="3" style=" fill: rgb(220, 20, 60);"></rect>
  658. <rect class="RF" x="500" y="385" width="70" height="50" rx="3" ry="3" style=" fill: rgb(240, 240, 240);"></rect>
  659. <rect class="RF" x="563" y="385" width="20" height="30" rx="3" ry="3" style=" fill: rgb(240, 240, 240);"></rect>
  660. <rect id=zigbee class="RF" x="500" y="405" width="10" height="10" rx="3" ry="3" style=" fill:rgb(107, 107, 107);"></rect>
  661. --------------------------------------------
  662. //relay文字說明
  663. <text x="0" y="18" fill="#111">R1</text>
  664. <text x="30" y="18" fill="#111">R2</text>
  665. <text x="60" y="18" fill="#111">R3</text>
  666. <text x="90" y="18" fill="#111">R4</text>
  667. <text x="120" y="18" fill="#111">R5</text>
  668. <text x="150" y="18" fill="#111">R6</text>
  669. <text x="180" y="18" fill="#111">R7</text>
  670. <text x="210" y="18" fill="#111">R8</text>
  671. <text x="240" y="18" fill="#111">R9</text>
  672. <text x="270" y="18" fill="#111">R10</text>
  673. <text x="300" y="18" fill="#111">R11</text>
  674. <text x="330" y="18" fill="#111">R12</text>
  675. <text x="360" y="18" fill="#111">R13</text>
  676. <text x="390" y="18" fill="#111">R14</text>
  677. <text x="420" y="18" fill="#111">R15</text>
  678. <text x="450" y="18" fill="#111">R16</text>
  679. <text x="480" y="18" fill="#111">R17</text>
  680. <text x="510" y="18" fill="#111">R18</text>
  681. <text x="540" y="18" fill="#111">R19</text>
  682. <text x="570" y="18" fill="#111">R20</text>
  683. //閥門名稱
  684. <text id =relay1 x="13" y="30" fill="#111" style=" writing-mode: tb;"></text>
  685. <text id =relay2 x="43" y="30" fill="#111" style=" writing-mode: tb;"></text>
  686. <text id =relay3 x="73" y="30" fill="#111" style=" writing-mode: tb;"></text>
  687. <text id =relay4 x="103" y="30" fill="#111" style=" writing-mode: tb;"></text>
  688. <text id =relay5 x="133" y="30" fill="#111" style=" writing-mode: tb;"></text>
  689. <text id =relay6 x="163" y="30" fill="#111" style=" writing-mode: tb;"></text>
  690. <text id =relay7 x="193" y="30" fill="#111" style=" writing-mode: tb;"></text>
  691. <text id =relay8 x="223" y="30" fill="#111" style=" writing-mode: tb;"></text>
  692. <text id =relay9 x="253" y="30" fill="#111" style=" writing-mode: tb;"></text>
  693. <text id =relay10 x="283" y="30" fill="#111" style=" writing-mode: tb;"></text>
  694. <text id =relay11 x="313" y="30" fill="#111" style=" writing-mode: tb;"></text>
  695. <text id =relay12 x="343" y="30" fill="#111" style=" writing-mode: tb;"></text>
  696. <text id =relay13 x="373" y="30" fill="#111" style=" writing-mode: tb;"></text>
  697. <text id =relay14 x="403" y="30" fill="#111" style=" writing-mode: tb;"></text>
  698. <text id =relay15 x="433" y="30" fill="#111" style=" writing-mode: tb;"></text>
  699. <text id =relay16 x="463" y="30" fill="#111" style=" writing-mode: tb;"></text>
  700. <text id =relay17 x="493" y="30" fill="#111" style=" writing-mode: tb;"></text>
  701. <text id =relay18 x="523" y="30" fill="#111" style=" writing-mode: tb;"></text>
  702. <text id =relay19 x="553" y="30" fill="#111" style=" writing-mode: tb;"></text>
  703. <text id =relay20 x="583" y="30" fill="#111" style=" writing-mode: tb;"></text>
  704. //通訊介面文字說明
  705. <text x="550" y="260" fill="#111">eth</text>
  706. <text x="520" y="340" fill="#111">wifi</text>
  707. <text x="510" y="415" fill="#111">zigbee</text>
  708. //感測器文字說明
  709. <text x="0" y="200" fill="#111">M4</text>
  710. <text x="0" y="240" fill="#111">M5</text>
  711. <text x="0" y="280" fill="#111">M7</text>
  712. <text x="0" y="320" fill="#111">M9</text>
  713. <text x="0" y="360" fill="#111">M12</text>
  714. <text x="0" y="400" fill="#111">M19</text>
  715. <text x="80" y="200" fill="#111">M10</text>
  716. <text x="80" y="240" fill="#111">M2</text>
  717. <text x="80" y="280" fill="#111">M3</text>
  718. <text x="80" y="320" fill="#111">M14</text>
  719. <text x="80" y="360" fill="#111">M11</text>
  720. <text x="160" y="200" fill="#111">M16</text>
  721. <text x="160" y="240" fill="#111">M17</text>
  722. <text x="160" y="280" fill="#111">M18</text>
  723. <text x="160" y="320" fill="#111">M15</text>
  724. <text x="160" y="360" fill="#111">M8</text>
  725. <text x="240" y="280" fill="#111">M6</text>
  726. <text x="240" y="320" fill="#111">M13</text>
  727. <text x="240" y="360" fill="#111">M1</text>
  728. //感測器名稱
  729. <text id =M4 x="0" y="220" fill="#111"></text>
  730. <text id =M5 x="0" y="260" fill="#111"></text>
  731. <text id =M7 x="0" y="300" fill="#111"></text>
  732. <text id =M9 x="0" y="340" fill="#111" style="font-size:12px;"></text>
  733. <text id =M12 x="0" y="380" fill="#111" style="font-size:12px;"></text>
  734. <text id =M19 x="0" y="420" fill="#111" style="font-size:12px;"></text>
  735. <text id =M10 x="80" y="220" fill="#111"></text>
  736. <text id =M2 x="80" y="260" fill="#111"></text>
  737. <text id =M3 x="80" y="300" fill="#111"></text>
  738. <text id =M14 x="80" y="340" fill="#111"></text>
  739. <text id =M11 x="80" y="380" fill="#111" style="font-size:12px;"></text>
  740. <text id =M16 x="160" y="220" fill="#111"></text>
  741. <text id =M17 x="160" y="260" fill="#111"></text>
  742. <text id =M18 x="160" y="300" fill="#111"></text>
  743. <text id =M15 x="160" y="340" fill="#111" style="font-size:12px;"></text>
  744. <text id =M8 x="160" y="380" fill="#111" style="font-size:12px;"></text>
  745. <text id =M6 x="240" y="300" fill="#111"></text>
  746. <text id =M13 x="240" y="340" fill="#111"></text>
  747. <text id =M1 x="240" y="380" fill="#111"></text>
  748. </svg>
  749. </div>
  750. </div>
  751. </div>
  752. </div>
  753. </div>
  754. </div>
  755. </div>
  756. <!-- 燒錄通訊器互動視窗 -->
  757. <div class="modal fade" id="control_RF_Modal">
  758. <div class="modal-dialog modal-dialog-centered modal-lg">
  759. <div class="modal-content">
  760. <!-- 互動視窗 標題 -->
  761. <div class="modal-header">
  762. <h4 id="Modal_RF_title_input" class="modal-title"></h4>
  763. <span class="h3 mx-1">腳位配置</span>
  764. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  765. </div>
  766. <!-- 互動視窗 內容 -->
  767. <div class="modal-body">
  768. <!-- 燒錄通訊 -->
  769. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1">
  770. <strong><a>通訊介面:</a></strong>
  771. </div>
  772. <div class="row row-cols-5 row-cols-sm-5 row-cols-md-5">
  773. <div class="col">
  774. eth :
  775. <select id="select_eth" onchange="select_RF('eth')" class="select-input">
  776. <option></option>
  777. <option>OFF</option>
  778. <option>ON</option>
  779. </select>
  780. </div>
  781. <div class="col">
  782. wifi :
  783. <select id="select_wifi" onchange="select_RF('wifi')" class="select-input">
  784. <option></option>
  785. <option>OFF</option>
  786. <option>ON</option>
  787. </select>
  788. </div>
  789. <div class="col">
  790. zigbee :
  791. <select id="select_zigbee" onchange="select_RF('zigbee')" class="select-input">
  792. <option></option>
  793. <option>OFF</option>
  794. <option>ON</option>
  795. </select>
  796. </div>
  797. </div>
  798. <!-- 燒錄致動器 -->
  799. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1">
  800. <strong><a>致動器:</a></strong>
  801. </div>
  802. <div class="row row-cols-2 row-cols-sm-2 row-cols-md-3">
  803. <div class="col">
  804. Relay1:
  805. <br>
  806. <select id="select_relay_1" onchange="select_relay('1')" class="select-input">
  807. <option></option>
  808. <option value="真空吸料機">真空吸料機</option>
  809. <option value="中水入水">中水入水</option>
  810. <option value="清水入水">清水入水</option>
  811. <option value="幫浦">幫浦</option>
  812. <option value="排水廢水">排水廢水</option>
  813. <option value="排水中水">排水中水</option>
  814. <option value="桶內消毒">桶內消毒</option>
  815. <option value="混合槽幫浦">混合槽幫浦</option>
  816. <option value="蝴蝶閥">蝴蝶閥</option>
  817. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  818. <option value="保溫夾層進水">保溫夾層進水</option>
  819. <option value="逆洗幫浦">逆洗幫浦</option>
  820. <option value="雙核隔膜泵">雙核隔膜泵</option>
  821. <option value="警示燈">警示燈</option>
  822. <option value="攝影機">攝影機</option>
  823. <option value="加熱器1">加熱器1</option>
  824. <option value="加熱器2">加熱器2</option>
  825. <option value="乾燥真空機">乾燥真空機</option>
  826. <option value="噴嘴">噴嘴</option>
  827. </select>
  828. </div>
  829. <div class="col">
  830. Relay2:
  831. <br>
  832. <select id="select_relay_2" onchange="select_relay('2')" class="select-input">
  833. <option></option>
  834. <option value="真空吸料機">真空吸料機</option>
  835. <option value="中水入水">中水入水</option>
  836. <option value="清水入水">清水入水</option>
  837. <option value="幫浦">幫浦</option>
  838. <option value="排水廢水">排水廢水</option>
  839. <option value="排水中水">排水中水</option>
  840. <option value="桶內消毒">桶內消毒</option>
  841. <option value="混合槽幫浦">混合槽幫浦</option>
  842. <option value="蝴蝶閥">蝴蝶閥</option>
  843. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  844. <option value="保溫夾層進水">保溫夾層進水</option>
  845. <option value="逆洗幫浦">逆洗幫浦</option>
  846. <option value="雙核隔膜泵">雙核隔膜泵</option>
  847. <option value="警示燈">警示燈</option>
  848. <option value="攝影機">攝影機</option>
  849. <option value="加熱器1">加熱器1</option>
  850. <option value="加熱器2">加熱器2</option>
  851. <option value="乾燥真空機">乾燥真空機</option>
  852. <option value="噴嘴">噴嘴</option>
  853. </select>
  854. </div>
  855. <div class="col">
  856. Relay3:
  857. <br>
  858. <select id="select_relay_3" onchange="select_relay('3')" class="select-input">
  859. <option></option>
  860. <option value="真空吸料機">真空吸料機</option>
  861. <option value="中水入水">中水入水</option>
  862. <option value="清水入水">清水入水</option>
  863. <option value="幫浦">幫浦</option>
  864. <option value="排水廢水">排水廢水</option>
  865. <option value="排水中水">排水中水</option>
  866. <option value="桶內消毒">桶內消毒</option>
  867. <option value="混合槽幫浦">混合槽幫浦</option>
  868. <option value="蝴蝶閥">蝴蝶閥</option>
  869. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  870. <option value="保溫夾層進水">保溫夾層進水</option>
  871. <option value="逆洗幫浦">逆洗幫浦</option>
  872. <option value="雙核隔膜泵">雙核隔膜泵</option>
  873. <option value="警示燈">警示燈</option>
  874. <option value="攝影機">攝影機</option>
  875. <option value="加熱器1">加熱器1</option>
  876. <option value="加熱器2">加熱器2</option>
  877. <option value="乾燥真空機">乾燥真空機</option>
  878. <option value="噴嘴">噴嘴</option>
  879. </select>
  880. </div>
  881. <div class="col">
  882. Relay4:
  883. <br>
  884. <select id="select_relay_4" onchange="select_relay('4')" class="select-input">
  885. <option></option>
  886. <option value="真空吸料機">真空吸料機</option>
  887. <option value="中水入水">中水入水</option>
  888. <option value="清水入水">清水入水</option>
  889. <option value="幫浦">幫浦</option>
  890. <option value="排水廢水">排水廢水</option>
  891. <option value="排水中水">排水中水</option>
  892. <option value="桶內消毒">桶內消毒</option>
  893. <option value="混合槽幫浦">混合槽幫浦</option>
  894. <option value="蝴蝶閥">蝴蝶閥</option>
  895. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  896. <option value="保溫夾層進水">保溫夾層進水</option>
  897. <option value="逆洗幫浦">逆洗幫浦</option>
  898. <option value="雙核隔膜泵">雙核隔膜泵</option>
  899. <option value="警示燈">警示燈</option>
  900. <option value="攝影機">攝影機</option>
  901. <option value="加熱器1">加熱器1</option>
  902. <option value="加熱器2">加熱器2</option>
  903. <option value="乾燥真空機">乾燥真空機</option>
  904. <option value="噴嘴">噴嘴</option>
  905. </select>
  906. </div>
  907. <div class="col">
  908. Relay5:
  909. <br>
  910. <select id="select_relay_5" onchange="select_relay('5')" class="select-input">
  911. <option></option>
  912. <option value="真空吸料機">真空吸料機</option>
  913. <option value="中水入水">中水入水</option>
  914. <option value="清水入水">清水入水</option>
  915. <option value="幫浦">幫浦</option>
  916. <option value="排水廢水">排水廢水</option>
  917. <option value="排水中水">排水中水</option>
  918. <option value="桶內消毒">桶內消毒</option>
  919. <option value="混合槽幫浦">混合槽幫浦</option>
  920. <option value="蝴蝶閥">蝴蝶閥</option>
  921. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  922. <option value="保溫夾層進水">保溫夾層進水</option>
  923. <option value="逆洗幫浦">逆洗幫浦</option>
  924. <option value="雙核隔膜泵">雙核隔膜泵</option>
  925. <option value="警示燈">警示燈</option>
  926. <option value="攝影機">攝影機</option>
  927. <option value="加熱器1">加熱器1</option>
  928. <option value="加熱器2">加熱器2</option>
  929. <option value="乾燥真空機">乾燥真空機</option>
  930. <option value="噴嘴">噴嘴</option>
  931. </select>
  932. </div>
  933. <div class="col">
  934. Relay6:
  935. <br>
  936. <select id="select_relay_6" onchange="select_relay('6')" class="select-input">
  937. <option></option>
  938. <option value="真空吸料機">真空吸料機</option>
  939. <option value="中水入水">中水入水</option>
  940. <option value="清水入水">清水入水</option>
  941. <option value="幫浦">幫浦</option>
  942. <option value="排水廢水">排水廢水</option>
  943. <option value="排水中水">排水中水</option>
  944. <option value="桶內消毒">桶內消毒</option>
  945. <option value="混合槽幫浦">混合槽幫浦</option>
  946. <option value="蝴蝶閥">蝴蝶閥</option>
  947. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  948. <option value="保溫夾層進水">保溫夾層進水</option>
  949. <option value="逆洗幫浦">逆洗幫浦</option>
  950. <option value="雙核隔膜泵">雙核隔膜泵</option>
  951. <option value="警示燈">警示燈</option>
  952. <option value="攝影機">攝影機</option>
  953. <option value="加熱器1">加熱器1</option>
  954. <option value="加熱器2">加熱器2</option>
  955. <option value="乾燥真空機">乾燥真空機</option>
  956. <option value="噴嘴">噴嘴</option>
  957. </select>
  958. </div>
  959. <div class="col">
  960. Relay7:
  961. <br>
  962. <select id="select_relay_7" onchange="select_relay('7')" class="select-input">
  963. <option></option>
  964. <option value="真空吸料機">真空吸料機</option>
  965. <option value="中水入水">中水入水</option>
  966. <option value="清水入水">清水入水</option>
  967. <option value="幫浦">幫浦</option>
  968. <option value="排水廢水">排水廢水</option>
  969. <option value="排水中水">排水中水</option>
  970. <option value="桶內消毒">桶內消毒</option>
  971. <option value="混合槽幫浦">混合槽幫浦</option>
  972. <option value="蝴蝶閥">蝴蝶閥</option>
  973. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  974. <option value="保溫夾層進水">保溫夾層進水</option>
  975. <option value="逆洗幫浦">逆洗幫浦</option>
  976. <option value="雙核隔膜泵">雙核隔膜泵</option>
  977. <option value="警示燈">警示燈</option>
  978. <option value="攝影機">攝影機</option>
  979. <option value="加熱器1">加熱器1</option>
  980. <option value="加熱器2">加熱器2</option>
  981. <option value="乾燥真空機">乾燥真空機</option>
  982. <option value="噴嘴">噴嘴</option>
  983. </select>
  984. </div>
  985. <div class="col">
  986. Relay8:
  987. <br>
  988. <select id="select_relay_8" onchange="select_relay('8')" class="select-input">
  989. <option></option>
  990. <option value="真空吸料機">真空吸料機</option>
  991. <option value="中水入水">中水入水</option>
  992. <option value="清水入水">清水入水</option>
  993. <option value="幫浦">幫浦</option>
  994. <option value="排水廢水">排水廢水</option>
  995. <option value="排水中水">排水中水</option>
  996. <option value="桶內消毒">桶內消毒</option>
  997. <option value="混合槽幫浦">混合槽幫浦</option>
  998. <option value="蝴蝶閥">蝴蝶閥</option>
  999. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1000. <option value="保溫夾層進水">保溫夾層進水</option>
  1001. <option value="逆洗幫浦">逆洗幫浦</option>
  1002. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1003. <option value="警示燈">警示燈</option>
  1004. <option value="攝影機">攝影機</option>
  1005. <option value="加熱器1">加熱器1</option>
  1006. <option value="加熱器2">加熱器2</option>
  1007. <option value="乾燥真空機">乾燥真空機</option>
  1008. <option value="噴嘴">噴嘴</option>
  1009. </select>
  1010. </div>
  1011. <div class="col">
  1012. Relay9:
  1013. <br>
  1014. <select id="select_relay_9" onchange="select_relay('9')" class="select-input">
  1015. <option></option>
  1016. <option value="真空吸料機">真空吸料機</option>
  1017. <option value="中水入水">中水入水</option>
  1018. <option value="清水入水">清水入水</option>
  1019. <option value="幫浦">幫浦</option>
  1020. <option value="排水廢水">排水廢水</option>
  1021. <option value="排水中水">排水中水</option>
  1022. <option value="桶內消毒">桶內消毒</option>
  1023. <option value="混合槽幫浦">混合槽幫浦</option>
  1024. <option value="蝴蝶閥">蝴蝶閥</option>
  1025. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1026. <option value="保溫夾層進水">保溫夾層進水</option>
  1027. <option value="逆洗幫浦">逆洗幫浦</option>
  1028. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1029. <option value="警示燈">警示燈</option>
  1030. <option value="攝影機">攝影機</option>
  1031. <option value="加熱器1">加熱器1</option>
  1032. <option value="加熱器2">加熱器2</option>
  1033. <option value="乾燥真空機">乾燥真空機</option>
  1034. <option value="噴嘴">噴嘴</option>
  1035. </select>
  1036. </div>
  1037. <div class="col">
  1038. Relay10:
  1039. <br>
  1040. <select id="select_relay_10" onchange="select_relay('10')" class="select-input">
  1041. <option></option>
  1042. <option value="真空吸料機">真空吸料機</option>
  1043. <option value="中水入水">中水入水</option>
  1044. <option value="清水入水">清水入水</option>
  1045. <option value="幫浦">幫浦</option>
  1046. <option value="排水廢水">排水廢水</option>
  1047. <option value="排水中水">排水中水</option>
  1048. <option value="桶內消毒">桶內消毒</option>
  1049. <option value="混合槽幫浦">混合槽幫浦</option>
  1050. <option value="蝴蝶閥">蝴蝶閥</option>
  1051. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1052. <option value="保溫夾層進水">保溫夾層進水</option>
  1053. <option value="逆洗幫浦">逆洗幫浦</option>
  1054. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1055. <option value="警示燈">警示燈</option>
  1056. <option value="攝影機">攝影機</option>
  1057. <option value="加熱器1">加熱器1</option>
  1058. <option value="加熱器2">加熱器2</option>
  1059. <option value="乾燥真空機">乾燥真空機</option>
  1060. <option value="噴嘴">噴嘴</option>
  1061. </select>
  1062. </div>
  1063. <div class="col">
  1064. Relay11:
  1065. <br>
  1066. <select id="select_relay_11" onchange="select_relay('11')" class="select-input">
  1067. <option></option>
  1068. <option value="真空吸料機">真空吸料機</option>
  1069. <option value="中水入水">中水入水</option>
  1070. <option value="清水入水">清水入水</option>
  1071. <option value="幫浦">幫浦</option>
  1072. <option value="排水廢水">排水廢水</option>
  1073. <option value="排水中水">排水中水</option>
  1074. <option value="桶內消毒">桶內消毒</option>
  1075. <option value="混合槽幫浦">混合槽幫浦</option>
  1076. <option value="蝴蝶閥">蝴蝶閥</option>
  1077. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1078. <option value="保溫夾層進水">保溫夾層進水</option>
  1079. <option value="逆洗幫浦">逆洗幫浦</option>
  1080. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1081. <option value="警示燈">警示燈</option>
  1082. <option value="攝影機">攝影機</option>
  1083. <option value="加熱器1">加熱器1</option>
  1084. <option value="加熱器2">加熱器2</option>
  1085. <option value="乾燥真空機">乾燥真空機</option>
  1086. <option value="噴嘴">噴嘴</option>
  1087. </select>
  1088. </div>
  1089. <div class="col">
  1090. Relay12:
  1091. <br>
  1092. <select id="select_relay_12" onchange="select_relay('12')" class="select-input">
  1093. <option></option>
  1094. <option value="真空吸料機">真空吸料機</option>
  1095. <option value="中水入水">中水入水</option>
  1096. <option value="清水入水">清水入水</option>
  1097. <option value="幫浦">幫浦</option>
  1098. <option value="排水廢水">排水廢水</option>
  1099. <option value="排水中水">排水中水</option>
  1100. <option value="桶內消毒">桶內消毒</option>
  1101. <option value="混合槽幫浦">混合槽幫浦</option>
  1102. <option value="蝴蝶閥">蝴蝶閥</option>
  1103. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1104. <option value="保溫夾層進水">保溫夾層進水</option>
  1105. <option value="逆洗幫浦">逆洗幫浦</option>
  1106. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1107. <option value="警示燈">警示燈</option>
  1108. <option value="攝影機">攝影機</option>
  1109. <option value="加熱器1">加熱器1</option>
  1110. <option value="加熱器2">加熱器2</option>
  1111. <option value="乾燥真空機">乾燥真空機</option>
  1112. <option value="噴嘴">噴嘴</option>
  1113. </select>
  1114. </div>
  1115. <div class="col">
  1116. Relay13:
  1117. <br>
  1118. <select id="select_relay_13" onchange="select_relay('13')" class="select-input">
  1119. <option></option>
  1120. <option value="真空吸料機">真空吸料機</option>
  1121. <option value="中水入水">中水入水</option>
  1122. <option value="清水入水">清水入水</option>
  1123. <option value="幫浦">幫浦</option>
  1124. <option value="排水廢水">排水廢水</option>
  1125. <option value="排水中水">排水中水</option>
  1126. <option value="桶內消毒">桶內消毒</option>
  1127. <option value="混合槽幫浦">混合槽幫浦</option>
  1128. <option value="蝴蝶閥">蝴蝶閥</option>
  1129. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1130. <option value="保溫夾層進水">保溫夾層進水</option>
  1131. <option value="逆洗幫浦">逆洗幫浦</option>
  1132. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1133. <option value="警示燈">警示燈</option>
  1134. <option value="攝影機">攝影機</option>
  1135. <option value="加熱器1">加熱器1</option>
  1136. <option value="加熱器2">加熱器2</option>
  1137. <option value="乾燥真空機">乾燥真空機</option>
  1138. <option value="噴嘴">噴嘴</option>
  1139. </select>
  1140. </div>
  1141. <div class="col">
  1142. Relay14:
  1143. <br>
  1144. <select id="select_relay_14" onchange="select_relay('14')" class="select-input">
  1145. <option></option>
  1146. <option value="真空吸料機">真空吸料機</option>
  1147. <option value="中水入水">中水入水</option>
  1148. <option value="清水入水">清水入水</option>
  1149. <option value="幫浦">幫浦</option>
  1150. <option value="排水廢水">排水廢水</option>
  1151. <option value="排水中水">排水中水</option>
  1152. <option value="桶內消毒">桶內消毒</option>
  1153. <option value="混合槽幫浦">混合槽幫浦</option>
  1154. <option value="蝴蝶閥">蝴蝶閥</option>
  1155. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1156. <option value="保溫夾層進水">保溫夾層進水</option>
  1157. <option value="逆洗幫浦">逆洗幫浦</option>
  1158. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1159. <option value="警示燈">警示燈</option>
  1160. <option value="攝影機">攝影機</option>
  1161. <option value="加熱器1">加熱器1</option>
  1162. <option value="加熱器2">加熱器2</option>
  1163. <option value="乾燥真空機">乾燥真空機</option>
  1164. <option value="噴嘴">噴嘴</option>
  1165. </select>
  1166. </div>
  1167. <div class="col">
  1168. Relay15:
  1169. <br>
  1170. <select id="select_relay_15" onchange="select_relay('15')" class="select-input">
  1171. <option></option>
  1172. <option value="真空吸料機">真空吸料機</option>
  1173. <option value="中水入水">中水入水</option>
  1174. <option value="清水入水">清水入水</option>
  1175. <option value="幫浦">幫浦</option>
  1176. <option value="排水廢水">排水廢水</option>
  1177. <option value="排水中水">排水中水</option>
  1178. <option value="桶內消毒">桶內消毒</option>
  1179. <option value="混合槽幫浦">混合槽幫浦</option>
  1180. <option value="蝴蝶閥">蝴蝶閥</option>
  1181. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1182. <option value="保溫夾層進水">保溫夾層進水</option>
  1183. <option value="逆洗幫浦">逆洗幫浦</option>
  1184. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1185. <option value="警示燈">警示燈</option>
  1186. <option value="攝影機">攝影機</option>
  1187. <option value="加熱器1">加熱器1</option>
  1188. <option value="加熱器2">加熱器2</option>
  1189. <option value="乾燥真空機">乾燥真空機</option>
  1190. <option value="噴嘴">噴嘴</option>
  1191. </select>
  1192. </div>
  1193. <div class="col">
  1194. Relay16:
  1195. <br>
  1196. <select id="select_relay_16" onchange="select_relay('16')" class="select-input">
  1197. <option></option>
  1198. <option value="真空吸料機">真空吸料機</option>
  1199. <option value="中水入水">中水入水</option>
  1200. <option value="清水入水">清水入水</option>
  1201. <option value="幫浦">幫浦</option>
  1202. <option value="排水廢水">排水廢水</option>
  1203. <option value="排水中水">排水中水</option>
  1204. <option value="桶內消毒">桶內消毒</option>
  1205. <option value="混合槽幫浦">混合槽幫浦</option>
  1206. <option value="蝴蝶閥">蝴蝶閥</option>
  1207. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1208. <option value="保溫夾層進水">保溫夾層進水</option>
  1209. <option value="逆洗幫浦">逆洗幫浦</option>
  1210. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1211. <option value="警示燈">警示燈</option>
  1212. <option value="攝影機">攝影機</option>
  1213. <option value="加熱器1">加熱器1</option>
  1214. <option value="加熱器2">加熱器2</option>
  1215. <option value="乾燥真空機">乾燥真空機</option>
  1216. <option value="噴嘴">噴嘴</option>
  1217. </select>
  1218. </div>
  1219. <div class="col">
  1220. Relay17:
  1221. <br>
  1222. <select id="select_relay_17" onchange="select_relay('17')" class="select-input">
  1223. <option></option>
  1224. <option value="真空吸料機">真空吸料機</option>
  1225. <option value="中水入水">中水入水</option>
  1226. <option value="清水入水">清水入水</option>
  1227. <option value="幫浦">幫浦</option>
  1228. <option value="排水廢水">排水廢水</option>
  1229. <option value="排水中水">排水中水</option>
  1230. <option value="桶內消毒">桶內消毒</option>
  1231. <option value="混合槽幫浦">混合槽幫浦</option>
  1232. <option value="蝴蝶閥">蝴蝶閥</option>
  1233. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1234. <option value="保溫夾層進水">保溫夾層進水</option>
  1235. <option value="逆洗幫浦">逆洗幫浦</option>
  1236. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1237. <option value="警示燈">警示燈</option>
  1238. <option value="攝影機">攝影機</option>
  1239. <option value="加熱器1">加熱器1</option>
  1240. <option value="加熱器2">加熱器2</option>
  1241. <option value="乾燥真空機">乾燥真空機</option>
  1242. <option value="噴嘴">噴嘴</option>
  1243. </select>
  1244. </div>
  1245. <div class="col">
  1246. Relay18:
  1247. <br>
  1248. <select id="select_relay_18" onchange="select_relay('18')" class="select-input">
  1249. <option></option>
  1250. <option value="真空吸料機">真空吸料機</option>
  1251. <option value="中水入水">中水入水</option>
  1252. <option value="清水入水">清水入水</option>
  1253. <option value="幫浦">幫浦</option>
  1254. <option value="排水廢水">排水廢水</option>
  1255. <option value="排水中水">排水中水</option>
  1256. <option value="桶內消毒">桶內消毒</option>
  1257. <option value="混合槽幫浦">混合槽幫浦</option>
  1258. <option value="蝴蝶閥">蝴蝶閥</option>
  1259. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1260. <option value="保溫夾層進水">保溫夾層進水</option>
  1261. <option value="逆洗幫浦">逆洗幫浦</option>
  1262. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1263. <option value="警示燈">警示燈</option>
  1264. <option value="攝影機">攝影機</option>
  1265. <option value="加熱器1">加熱器1</option>
  1266. <option value="加熱器2">加熱器2</option>
  1267. <option value="乾燥真空機">乾燥真空機</option>
  1268. <option value="噴嘴">噴嘴</option>
  1269. </select>
  1270. </div>
  1271. <div class="col">
  1272. Relay19:
  1273. <br>
  1274. <select id="select_relay_19" onchange="select_relay('19')" class="select-input">
  1275. <option></option>
  1276. <option value="真空吸料機">真空吸料機</option>
  1277. <option value="中水入水">中水入水</option>
  1278. <option value="清水入水">清水入水</option>
  1279. <option value="幫浦">幫浦</option>
  1280. <option value="排水廢水">排水廢水</option>
  1281. <option value="排水中水">排水中水</option>
  1282. <option value="桶內消毒">桶內消毒</option>
  1283. <option value="混合槽幫浦">混合槽幫浦</option>
  1284. <option value="蝴蝶閥">蝴蝶閥</option>
  1285. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1286. <option value="保溫夾層進水">保溫夾層進水</option>
  1287. <option value="逆洗幫浦">逆洗幫浦</option>
  1288. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1289. <option value="警示燈">警示燈</option>
  1290. <option value="攝影機">攝影機</option>
  1291. <option value="加熱器1">加熱器1</option>
  1292. <option value="加熱器2">加熱器2</option>
  1293. <option value="乾燥真空機">乾燥真空機</option>
  1294. <option value="噴嘴">噴嘴</option>
  1295. </select>
  1296. </div>
  1297. <div class="col">
  1298. Relay20:
  1299. <br>
  1300. <select id="select_relay_20" onchange="select_relay('20')" class="select-input">
  1301. <option></option>
  1302. <option value="真空吸料機">真空吸料機</option>
  1303. <option value="中水入水">中水入水</option>
  1304. <option value="清水入水">清水入水</option>
  1305. <option value="幫浦">幫浦</option>
  1306. <option value="排水廢水">排水廢水</option>
  1307. <option value="排水中水">排水中水</option>
  1308. <option value="桶內消毒">桶內消毒</option>
  1309. <option value="混合槽幫浦">混合槽幫浦</option>
  1310. <option value="蝴蝶閥">蝴蝶閥</option>
  1311. <option value="入水清洗槽幫浦">入水清洗槽幫浦</option>
  1312. <option value="保溫夾層進水">保溫夾層進水</option>
  1313. <option value="逆洗幫浦">逆洗幫浦</option>
  1314. <option value="雙核隔膜泵">雙核隔膜泵</option>
  1315. <option value="警示燈">警示燈</option>
  1316. <option value="攝影機">攝影機</option>
  1317. <option value="加熱器1">加熱器1</option>
  1318. <option value="加熱器2">加熱器2</option>
  1319. <option value="乾燥真空機">乾燥真空機</option>
  1320. <option value="噴嘴">噴嘴</option>
  1321. </select>
  1322. </div>
  1323. </div>
  1324. <!-- 燒錄通訊 -->
  1325. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1">
  1326. <strong><a>感測器:</a></strong>
  1327. </div>
  1328. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1329. <div class="col">
  1330. 類比 M4 :
  1331. <br>
  1332. <select id="selectSensor_M4" onchange="selectSensor('M4')" class="select-input">
  1333. <option></option>
  1334. <option value="PH計">PH計</option>
  1335. <option value="DO計">DO計</option>
  1336. <option value="ORP計">ORP計</option>
  1337. </select>
  1338. </div>
  1339. <div class="col">
  1340. PWM M10 :
  1341. <br>
  1342. <select id="selectSensor_M10" onchange="selectSensor('M10')" class="select-input">
  1343. <option></option>
  1344. <option value="馬達">馬達</option>
  1345. </select>
  1346. </div>
  1347. <div class="col">
  1348. UART M16 :
  1349. <br>
  1350. <select id="selectSensor_M16" onchange="selectSensor('M16')" class="select-input">
  1351. <option></option>
  1352. <option value="EC計">EC計</option>
  1353. <option value="水溫計">水溫計</option>
  1354. <option value="真空閥">真空閥</option>
  1355. </select>
  1356. </div>
  1357. </div>
  1358. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1359. <div class="col">
  1360. 類比 M5 :
  1361. <br>
  1362. <select id="selectSensor_M5" onchange="selectSensor('M5')" class="select-input">
  1363. <option></option>
  1364. <option value="PH計">PH計</option>
  1365. <option value="DO計">DO計</option>
  1366. <option value="ORP計">ORP計</option>
  1367. </select>
  1368. </div>
  1369. <div class="col">
  1370. PWM M2 :
  1371. <br>
  1372. <select id="selectSensor_M2" onchange="selectSensor('M2')" class="select-input">
  1373. <option></option>
  1374. <option value="三通閥">三通閥</option>
  1375. </select>
  1376. </div>
  1377. <div class="col">
  1378. UART M17 :
  1379. <br>
  1380. <select id="selectSensor_M17" onchange="selectSensor('M17')" class="select-input">
  1381. <option></option>
  1382. <option value="溫溼度">溫溼度</option>
  1383. <option value="真空閥">真空閥</option>
  1384. </select>
  1385. </div>
  1386. </div>
  1387. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1388. <div class="col">
  1389. 類比 M7 :
  1390. <br>
  1391. <select id="selectSensor_M7" onchange="selectSensor('M7')" class="select-input">
  1392. <option></option>
  1393. <option value="PH計">PH計</option>
  1394. <option value="DO計">DO計</option>
  1395. <option value="ORP計">ORP計</option>
  1396. </select>
  1397. </div>
  1398. <div class="col">
  1399. PWM M3 :
  1400. <br>
  1401. <select id="selectSensor_M3" onchange="selectSensor('M3')" class="select-input">
  1402. <option></option>
  1403. <option value="三通閥">三通閥</option>
  1404. </select>
  1405. </div>
  1406. <div class="col">
  1407. UART M18 :
  1408. <br>
  1409. <select id="selectSensor_M18" onchange="selectSensor('M18')" class="select-input">
  1410. <option></option>
  1411. <option>未定義</option>
  1412. </select>
  1413. </div>
  1414. <div class="col">
  1415. 分壓類比 M6:
  1416. <br>
  1417. <select id="selectSensor_M6" onchange="selectSensor('M6')" class="select-input">
  1418. <option></option>
  1419. <option value="濁度計">濁度計</option>
  1420. </select>
  1421. </div>
  1422. </div>
  1423. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1424. <div class="col">
  1425. 數位 M9 :
  1426. <br>
  1427. <select id="selectSensor_M9" onchange="selectSensor('M9')" class="select-input">
  1428. <option></option>
  1429. <option value="水位計">水位計</option>
  1430. <option value="馬達編碼器">馬達編碼器</option>
  1431. <option value="蝴蝶閥編碼器">蝴蝶閥編碼器</option>
  1432. </select>
  1433. </div>
  1434. <div class="col">
  1435. 數位 M14 :
  1436. <br>
  1437. <select id="selectSensor_M14" onchange="selectSensor('M14')" class="select-input">
  1438. <option></option>
  1439. <option value="溫溼度">溫溼度</option>
  1440. <option value="水溫計">水溫計</option>
  1441. </select>
  1442. </div>
  1443. <div class="col">
  1444. I2C M15:
  1445. <br>
  1446. <select id="selectSensor_M15" onchange="selectSensor('M15')" class="select-input">
  1447. <option></option>
  1448. <option value="大氣壓力計">大氣壓力計</option>
  1449. </select>
  1450. </div>
  1451. <div class="col">
  1452. 分壓類比 M13:
  1453. <br>
  1454. <select id="selectSensor_M13" onchange="selectSensor('M13')" class="select-input">
  1455. <option></option>
  1456. <option value="濁度計">濁度計</option>
  1457. </select>
  1458. </div>
  1459. </div>
  1460. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1461. <div class="col">
  1462. 數位 M12 :
  1463. <br>
  1464. <select id="selectSensor_M12" onchange="selectSensor('M12')" class="select-input">
  1465. <option></option>
  1466. <option value="水位計">水位計</option>
  1467. <option value="馬達編碼器">馬達編碼器</option>
  1468. <option value="蝴蝶閥編碼器">蝴蝶閥編碼器</option>
  1469. </select>
  1470. </div>
  1471. <div class="col">
  1472. 數位 M11 :
  1473. <br>
  1474. <select id="selectSensor_M11" onchange="selectSensor('M11')" class="select-input">
  1475. <option></option>
  1476. <option value="水位計">水位計</option>
  1477. <option value="馬達編碼器">馬達編碼器</option>
  1478. <option value="蝴蝶閥編碼器">蝴蝶閥編碼器</option>
  1479. </select>
  1480. </div>
  1481. <div class="col">
  1482. 485 M8:
  1483. <br>
  1484. <select id="selectSensor_M8" onchange="selectSensor('M8')" class="select-input">
  1485. <option></option>
  1486. <option value="土壤檢測計">土壤檢測計</option>
  1487. </select>
  1488. </div>
  1489. <div class="col">
  1490. 分壓類比 M1:
  1491. <br>
  1492. <select id="selectSensor_M1" onchange="selectSensor('M1')" class="select-input">
  1493. <option></option>
  1494. <option value="超音波">超音波</option>
  1495. </select>
  1496. </div>
  1497. </div>
  1498. <div class="row row-cols-3 row-cols-sm-3 row-cols-md-4">
  1499. <div class="col">
  1500. 數位 M19 :
  1501. <br>
  1502. <select id="selectSensor_M19" onchange="selectSensor('M19')" class="select-input">
  1503. <option></option>
  1504. <option value="水位計">水位計</option>
  1505. <option value="馬達編碼器">馬達編碼器</option>
  1506. <option value="蝴蝶閥編碼器">蝴蝶閥編碼器</option>
  1507. </select>
  1508. </div>
  1509. </div>
  1510. </div>
  1511. <div class="modal-footer flex-nowrap p-0">
  1512. <button type="button" class="btn btn-primary fs-6 text-decoration-none col-6 m-0 rounded-0 " onclick="ItemGetValueToDB()"><strong>儲存</strong></button>
  1513. <button type="button" class="btn btn-secondary fs-6 text-decoration-none col-6 m-0 rounded-0 " data-bs-dismiss="modal"><strong>關閉</strong></button>
  1514. </div>
  1515. </div>
  1516. </div>
  1517. </div>
  1518. <!-- 載入腳位設定互動視窗 -->
  1519. <div class="modal fade" id="control_record_Modal">
  1520. <div class="modal-dialog modal-dialog-centered modal-lg">
  1521. <div class="modal-content">
  1522. <!-- 互動視窗 標題 -->
  1523. <div class="modal-header">
  1524. <h4 id="Modal_RF_title_input" class="modal-title"></h4>
  1525. <span class="h3 mx-1">載入腳位配置</span>
  1526. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1527. </div>
  1528. <!-- 互動視窗 內容 -->
  1529. <div class="modal-body">
  1530. <strong><a>歷史腳位配置:</a></strong>
  1531. <select id="datetime">
  1532. <option value=""></option>
  1533. </select>
  1534. </div>
  1535. <div class="modal-footer flex-nowrap p-0">
  1536. <button type="button" class="btn btn-primary fs-6 text-decoration-none col-6 m-0 rounded-0 " onclick="pin_record();"><strong>載入</strong></button>
  1537. <button type="button" class="btn btn-secondary fs-6 text-decoration-none col-6 m-0 rounded-0 " data-bs-dismiss="modal"><strong>關閉</strong></button>
  1538. </div>
  1539. </div>
  1540. </div>
  1541. </div>
  1542. <!-- 載入腳位設定互動視窗 -->
  1543. <div class="modal fade" id="control_code_Modal">
  1544. <div class="modal-dialog modal-dialog-centered modal-lg">
  1545. <div class="modal-content">
  1546. <!-- 互動視窗 標題 -->
  1547. <div class="modal-header">
  1548. <h4 id="Modal_RF_title_input" class="modal-title"></h4>
  1549. <span class="h3 mx-1">載入積木程式</span>
  1550. <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  1551. </div>
  1552. <!-- 互動視窗 內容 -->
  1553. <div class="modal-body">
  1554. <strong><a>歷史程式紀錄:</a></strong>
  1555. <select id="code_record" oninput="">
  1556. <option value=""></option>
  1557. </select>
  1558. </div>
  1559. <div class="modal-footer flex-nowrap p-0">
  1560. <button type="button" class="btn btn-primary fs-6 text-decoration-none col-6 m-0 rounded-0 " onclick="code_record()"><strong>開啟</strong></button>
  1561. <button type="button" class="btn btn-secondary fs-6 text-decoration-none col-6 m-0 rounded-0 " data-bs-dismiss="modal"><strong>關閉</strong></button>
  1562. </div>
  1563. </div>
  1564. </div>
  1565. </div>
  1566. <div class="album py-5 bg-light">
  1567. <div class="container">
  1568. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  1569. <div class="col">
  1570. <div class="card shadow-sm">
  1571. <input id="program_name" type="text" value='{{TankID}}' class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">
  1572. <h1 class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">積木程式設定</h1>
  1573. <div class="card-body">
  1574. <body onload="start()">
  1575. <div class="row row-cols-12 row-cols-sm-12 row-cols-md-12">
  1576. <div class="btn-toolbar" role="toolbar" style="justify-content: center;">
  1577. <div class="btn-group">
  1578. <button type="button" class="btn btn-secondary" onclick="back()">
  1579. <span class="glyphicon glyphicon-folder-open"></span> 重新選擇桶槽
  1580. </button>
  1581. <button type="button" class="btn btn-secondary" data-bs-toggle="modal" data-bs-target="#control_code_Modal" onclick="code_set()">
  1582. <span class="glyphicon glyphicon-folder-open"></span> 開啟積木程式
  1583. </button>
  1584. <input type="file" id="load" style="display: none;"/>
  1585. <button type="button" class="btn btn-secondary" onclick="save_xml()">
  1586. <span class="glyphicon glyphicon-floppy-disk"></span> 儲存積木程式
  1587. </button>
  1588. <button type="button" class="btn btn-secondary" onclick="discard()">
  1589. <span class="glyphicon glyphicon-trash"></span> 清除工作區
  1590. </button>
  1591. <button type="button" class="btn btn-secondary" onclick="save_code()">
  1592. <span class="glyphicon glyphicon-download-alt"></span> 下載 C 程式
  1593. </button>
  1594. </div>
  1595. </div>
  1596. </div>
  1597. <div class="container">
  1598. <div id="main-wrapper" class="row">
  1599. <div class="col-md-7">
  1600. <div class="panel panel-default">
  1601. <div class="panel-heading">
  1602. <h3 class="panel-title">積木程式</h3>
  1603. </div>
  1604. <div id="blocklyDiv" class="panel-body" ></div>
  1605. </div>
  1606. </div>
  1607. <xml id="toolbox">
  1608. <category name="變數">
  1609. <category name="變數">
  1610. <block type="variables_declare">
  1611. <value name="VALUE">
  1612. <block type="math_number">
  1613. <field name="NUM">2</field>
  1614. </block>
  1615. </value>
  1616. </block>
  1617. <block type="variables_get"></block>
  1618. <block type="variables_set">
  1619. <value name="VALUE">
  1620. <block type="math_number">
  1621. <field name="NUM">1</field>
  1622. </block>
  1623. </value>
  1624. </block>
  1625. <block type="library_stdio_text_char"></block>
  1626. <block type="math_number"></block>
  1627. </category>
  1628. <category name="指標">
  1629. <block type="variables_pointer_declare">
  1630. <value name="VALUE">
  1631. <block type="logic_null"></block>
  1632. </value>
  1633. </block>
  1634. <block type="variables_pointer_get"></block>
  1635. <block type="variables_pointer_set">
  1636. <value name="VAR">
  1637. <block type="variables_pointer_get">
  1638. </block>
  1639. </value>
  1640. <value name="VALUE">
  1641. <block type="variables_pointer_&">
  1642. <value name="VALUE">
  1643. <block type="variables_get">
  1644. </block>
  1645. </value>
  1646. </block>
  1647. </value>
  1648. </block>
  1649. <block type="variables_pointer_&"></block>
  1650. <block type="variables_pointer_*"></block>
  1651. </category>
  1652. <category name="陣列">
  1653. <block type="variables_array_declare">
  1654. <value name="LENGTH_1">
  1655. <block type="math_number">
  1656. <field name="NUM">3</field>
  1657. </block>
  1658. </value>
  1659. </block>
  1660. <block type="variables_array_initial"></block>
  1661. <block type="variables_array_get">
  1662. <value name="LENGTH_1">
  1663. <block type="math_number">
  1664. <field name="NUM">0</field>
  1665. </block>
  1666. </value>
  1667. </block>
  1668. <block type="variables_array_set">
  1669. <value name="LENGTH_1">
  1670. <block type="math_number">
  1671. <field name="NUM">0</field>
  1672. </block>
  1673. </value>
  1674. <value name="VALUE">
  1675. <block type="math_number">
  1676. <field name="NUM">1</field>
  1677. </block>
  1678. </value>
  1679. </block>
  1680. <block type="variables_array_pointer"></block>
  1681. <block type="variables_string_declare">
  1682. <value name="LENGTH_1">
  1683. <block type="math_number">
  1684. <field name="NUM">15</field>
  1685. </block>
  1686. </value>
  1687. <value name="VALUE">
  1688. <block type="library_stdio_text">
  1689. <field name="TEXT">hello!</field>
  1690. </block>
  1691. </value>
  1692. </block>
  1693. <block type="library_stdio_text_char"></block>
  1694. <block type="variables_string_null"></block>
  1695. <block type="arr_data"></block>
  1696. </category>
  1697. </category>
  1698. <category name="運算">
  1699. <block type="math_number"></block>
  1700. <block type="math_arithmetic"></block>
  1701. <block type="math_modulo"></block>
  1702. <block type="math_convert_type"></block>
  1703. <block type="math_auto_convert_type"></block>
  1704. <block type="math_increment_expression"></block>
  1705. <block type="math_decrement_expression"></block>
  1706. <block type="math_prev_inc_decrement"></block>
  1707. <block type="math_post_inc_decrement"></block>
  1708. </category>
  1709. <category name="輸出">
  1710. <block type="library_stdio_printf"></block>
  1711. <block type="library_stdio_text"></block>
  1712. <block type="library_stdio_newLine"></block>
  1713. <block type="library_stdio_tab"></block>
  1714. <block type="math_number"></block>
  1715. </category>
  1716. <category name="輸入">
  1717. <block type="library_stdio_scanf">
  1718. <value name="VAR0">
  1719. <block type="variables_get">
  1720. </block>
  1721. </value>
  1722. </block>
  1723. </category>
  1724. <category name="條件">
  1725. <block type="controls_if"></block>
  1726. <block type="controls_switch"></block>
  1727. <block type="controls_switch_break"></block>
  1728. <block type="logic_ternary"></block>
  1729. </category>
  1730. <category name="迴圈">
  1731. <block type="controls_whileUntil"></block>
  1732. <block type="controls_doWhile"></block>
  1733. <block type="controls_for">
  1734. <value name="FROM">
  1735. <block type="math_number">
  1736. <field name="NUM">1</field>
  1737. </block>
  1738. </value>
  1739. <value name="TO">
  1740. <block type="math_number">
  1741. <field name="NUM">10</field>
  1742. </block>
  1743. </value>
  1744. <value name="BY">
  1745. <block type="math_number">
  1746. <field name="NUM">1</field>
  1747. </block>
  1748. </value>
  1749. </block>
  1750. <block type="controls_flow_statements"></block>
  1751. <block type="controls_fors">
  1752. <value name="FROM">
  1753. <block type="math_number">
  1754. <field name="NUM">1</field>
  1755. </block>
  1756. </value>
  1757. <value name="TO">
  1758. <block type="math_number">
  1759. <field name="NUM">10</field>
  1760. </block>
  1761. </value>
  1762. <value name="BY">
  1763. <block type="math_number">
  1764. <field name="NUM">1</field>
  1765. </block>
  1766. </value>
  1767. </block>
  1768. </category>
  1769. <category name="邏輯">
  1770. <block type="logic_compare"></block>
  1771. <block type="logic_operation"></block>
  1772. <block type="logic_negate"></block>
  1773. <block type="logic_boolean"></block>
  1774. <block type="logic_null"></block>
  1775. </category>
  1776. <category name="函數" custom="PROCEDURE">
  1777. <block type="procedures_defnoreturn"></block>
  1778. <block type="procedures_defreturn"></block>
  1779. <block type="procedures_return"></block>
  1780. </category>
  1781. </category>
  1782. <category name="結構" custom="STRUCTURE">
  1783. <block type="structure_define"></block>
  1784. <block type="structure_declare"></block>
  1785. </category>
  1786. <category name="函數庫">
  1787. <category name="標準函數庫 stdlib.h">
  1788. <block type="library_stdlib_abs"></block>
  1789. <block type="library_stdlib_convert"></block>
  1790. <block type="library_stdlib_rand">
  1791. <value name="VAR">
  1792. <block type="library_stdlib_rand_scope">
  1793. <value name="A">
  1794. <block type="library_stdlib_number_forRandScope1"></block>
  1795. </value>
  1796. <value name="B">
  1797. <block type="library_stdlib_number_forRandScope100"></block>
  1798. </value>
  1799. </block>
  1800. </value>
  1801. </block>
  1802. <block type="library_stdlib_malloc">
  1803. <value name="VAR">
  1804. <block type="library_stdlib_arithmetic_forMalloc">
  1805. <value name="A">
  1806. <block type="library_stdlib_sizeof_forMalloc"></block>
  1807. </value>
  1808. <value name="B">
  1809. <block type="library_stdlib_number_forMalloc"></block>
  1810. </value>
  1811. </block>
  1812. </value>
  1813. </block>
  1814. <block type="library_stdlib_arithmetic_forMalloc">
  1815. <value name="A">
  1816. <block type="library_stdlib_sizeof_forMalloc"></block>
  1817. </value>
  1818. <value name="B">
  1819. <block type="library_stdlib_number_forMalloc"></block>
  1820. </value>
  1821. </block>
  1822. <block type="library_stdlib_free"></block>
  1823. <block type="library_stdlib_exit"></block>
  1824. </category>
  1825. <category name="字串 string.h">
  1826. <block type="library_string_strlen"></block>
  1827. <block type="library_string_strcat"></block>
  1828. <block type="library_string_strcpy"></block>
  1829. <block type="library_string_strcmp"></block>
  1830. </category>
  1831. <category name="數學 math.h">
  1832. <block type="library_math_abs"></block>
  1833. <block type="library_math_trig"></block>
  1834. <block type="library_math_logs"></block>
  1835. <block type="library_math_pow"></block>
  1836. <block type="library_math_exp"></block>
  1837. <block type="library_math_sqrt"></block>
  1838. <block type="library_math_round"></block>
  1839. <block type="library_math_numcheck"></block>
  1840. <block type="library_math_numcompare"></block>
  1841. </category>
  1842. <category name="時間 time.h">
  1843. <block type="library_time_current"></block>
  1844. <block type="library_time_requiredTime"></block>
  1845. </category>
  1846. </category>
  1847. <category name="巨集">
  1848. <block type="define_declare"></block>
  1849. <block type="define_get"></block>
  1850. <block type="library_stdio_text"></block>
  1851. <block type="math_number"></block>
  1852. </category>
  1853. <category name="註解">
  1854. <block type="comment">
  1855. <value name="VAR0">
  1856. <block type="library_stdio_text">
  1857. </block>
  1858. </value>
  1859. </block>
  1860. <block type="library_stdio_text">
  1861. </block>
  1862. </category>
  1863. <category name="stm32 初始設定">
  1864. <block type="include">
  1865. </block>
  1866. <block type="vari">
  1867. <value name="VALUE">
  1868. <block type="math_number">
  1869. <field name="NUM">0</field>
  1870. </block>
  1871. </value>
  1872. </block>
  1873. <block type="def">
  1874. <value name="VALUE">
  1875. <block type="arr_data"></block>
  1876. </value>
  1877. </block>
  1878. <block type="array_declare">
  1879. <value name="LENGTH_1">
  1880. <block type="math_number">
  1881. <field name="NUM">3</field>
  1882. </block>
  1883. </value>
  1884. <value name="VALUE">
  1885. <block type="variables_array_initial">
  1886. <value name="ADD0">
  1887. <block type="arr_data">
  1888. </block>
  1889. </value>
  1890. <value name="ADD1">
  1891. <block type="arr_data">
  1892. </block>
  1893. </value>
  1894. <value name="ADD2">
  1895. <block type="arr_data">
  1896. </block>
  1897. </value>
  1898. </block>
  1899. </value>
  1900. </block>
  1901. </category>
  1902. <category name="stm32 函式">
  1903. <block type="var">
  1904. </block>
  1905. <block type="control">
  1906. </block>
  1907. <block type="free">
  1908. </block>
  1909. </category>
  1910. </xml>
  1911. <div class="col-md-5">
  1912. <div id="code-wrapper" class="panel panel-default">
  1913. <div class="panel-heading">
  1914. <h3 class="panel-title">程式碼</h3>
  1915. </div>
  1916. <pre id="code" class="panel-body"></pre>
  1917. </div>
  1918. </div>
  1919. </div>
  1920. </div>
  1921. </div>
  1922. </div>
  1923. </div>
  1924. </div>
  1925. </div>
  1926. </div>
  1927. <div class="album py-5 bg-light">
  1928. <div class="container">
  1929. <div class="row row-cols-1 row-cols-sm-1 row-cols-md-1 g-3">
  1930. <div class="col">
  1931. <div class="card shadow-sm">
  1932. <h1 class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">{{TankID}}</h1>
  1933. <h1 class="h3 mb-4 fw-normal"style="background-color: Silver; height: 50px; text-align:center;">燒錄結果</h1>
  1934. <div class="row row-cols-12 row-cols-sm-12 row-cols-md-12">
  1935. <div class="btn-toolbar" role="toolbar" style="justify-content: center;">
  1936. <div class="btn-group">
  1937. <button type="button" class="btn btn-secondary" onclick="back()">
  1938. <span class="glyphicon glyphicon-folder-open"></span> 重新選擇桶槽
  1939. </button>
  1940. <button type="button" class="btn btn-secondary" onclick="programmer()">
  1941. <span class="glyphicon glyphicon-download-alt"></span> 燒錄
  1942. </button>
  1943. </div>
  1944. </div>
  1945. </div>
  1946. <div class="card-body">
  1947. 生成hex檔:<span id="creat_hex_Value"></span>
  1948. <br>
  1949. <br>
  1950. 燒錄hex檔:<span id="programmer_Value"></span>
  1951. </div>
  1952. </div>
  1953. </div>
  1954. </div>
  1955. </div>
  1956. </div>
  1957. {% endblock %}