From 3413058e625b0dcbd49edc03c0d417ea42fe6364 Mon Sep 17 00:00:00 2001 From: Miri Shiwana Date: Tue, 17 Oct 2023 13:24:09 +0700 Subject: [PATCH] Revert "try to add instruction to the run button" This reverts commit 50759453492f1200b929d2d7a06467517c3daaf4. --- main-dev.js | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/main-dev.js b/main-dev.js index a8000e4..3b32d96 100644 --- a/main-dev.js +++ b/main-dev.js @@ -146,7 +146,6 @@ class ARMMane{ "min" : 0, "max" : 180, "num" : 0, - "instruction": "S0D000" }, { "type" : "conv", @@ -156,7 +155,6 @@ class ARMMane{ "min" : 0, "max" : 2, "num" : 0, - "instruction": "C0M0S255" } ]; @@ -1077,7 +1075,6 @@ class ARMMane{ newDiv.setAttribute("data-min", this.conf_list[index]["min"]); newDiv.setAttribute("data-max", this.conf_list[index]["max"]); newDiv.setAttribute("data-num", this.conf_list[index]["num"]); - newDiv.instructions = this.conf_list[index]["instruction"]; // newDiv.setAttribute("data-num", this.conf_list[index]["num"]); return newDiv; } @@ -1105,35 +1102,6 @@ class ARMMane{ } - - runInstruction(instruction) { - if (instructions.length == 0) { - this.consoleLog("「ARMMANE」 No instruction to run", "WARN"); - return; - } - if (instruction.startsWith("C")) { - //C0M1S180 = conv device 0 mode 1 speed 180 - this.consoleLog("「ARMMANE」 Run instruction: " + instruction); - let convDevice = instruction.split(",")[0].split("(")[1]; - let convMode = instruction.split(",")[1]; - let convSpeed = instruction.split(",")[2].split(")")[0]; - this.consoleLog("「ARMMANE」 Control conv: " + convDevice + " mode: " + convMode + " speed: " + convSpeed); - this.controlConv(convDevice, convMode, convSpeed); - } else if (instruction.startsWith("S")) { - //S0D180 - this.consoleLog("「ARMMANE」 Run instruction: " + instruction); - let servoDevice = instruction.split(",")[0].split("(")[1]; - let servoDegree = instruction.split(",")[1].split(")")[0]; - this.consoleLog("「ARMMANE」 Control servo: " + servoDevice + " degree: " + servoDegree); - this.controlServo(servoDevice, servoDegree); - } else { - this.consoleLog("「ARMMANE」 Unknown instruction: " + instruction, "ERROR"); - } - } - - - - attachCodeBlockEventListeners(clonedCodeBlock, newDiv) { clonedCodeBlock.querySelector(".cmd-del").addEventListener("click", () => { clonedCodeBlock.remove(); @@ -1144,7 +1112,7 @@ class ARMMane{ this.openConfigBox(); }); clonedCodeBlock.querySelector(".cmd-play").addEventListener("click", () => { - this.runInstruction(clonedCodeBlock.instruction); + this.consoleLog("「ARMMANE」 Run command"); }); clonedCodeBlock.setAttribute("data-type", newDiv.type); @@ -1153,7 +1121,6 @@ class ARMMane{ clonedCodeBlock.setAttribute("data-speed", newDiv.speed); clonedCodeBlock.setAttribute("data-min", newDiv.min); clonedCodeBlock.setAttribute("data-max", newDiv.max); - clonedCodeBlock.instructions = newDiv.instructions; clonedCodeBlock.removeEventListener("click", () => {}); @@ -1374,7 +1341,6 @@ class ARMMane{ newDiv.setAttribute("data-device", extdata.id || 0); newDiv.setAttribute("data-value", extdata.degree || 0); newDiv.setAttribute("data-speed", extdata.speed || 0); - newDiv.instructions = instructionText; swimLane.appendChild(newDiv); }); }