diff --git a/ESP32/dataEdit/www/battery.js b/ESP32/dataEdit/www/battery.js index ee18f6e..d777401 100644 --- a/ESP32/dataEdit/www/battery.js +++ b/ESP32/dataEdit/www/battery.js @@ -35,7 +35,7 @@ function wsBatteryStatus(data) { var batteryCapacityRemainingPercentage = status["batteryCapacityRemainingPercentage"]; var batteryCapacityRemaining = status["batteryCapacityRemaining"]; var batteryTemperature = status["batteryTemperature"]; - + document.getElementById("batteryVoltage").value = batteryVoltage; document.getElementById("batteryCapacityRemaining").value = batteryCapacityRemaining; document.getElementById("batteryCapacityRemainingPercentage").value = batteryCapacityRemainingPercentage; @@ -55,7 +55,7 @@ function setBatterySettings() { userSettings["batteryCapacityMax"] = parseFloat(document.getElementById('batteryCapacityMax').value); setRestartRequired(); updateUserSettings(); -} +} function setBatteryFull() { sendWebsocketCommand("setBatteryFull"); } \ No newline at end of file diff --git a/ESP32/dataEdit/www/bldc-motor.js b/ESP32/dataEdit/www/bldc-motor.js index 00903bb..a1d5445 100644 --- a/ESP32/dataEdit/www/bldc-motor.js +++ b/ESP32/dataEdit/www/bldc-motor.js @@ -65,11 +65,11 @@ function updateBLDCSettings() { } function updateBLDCPins() { - if(upDateTimeout !== null) + if(upDateTimeout !== null) { clearTimeout(upDateTimeout); } - upDateTimeout = setTimeout(() => + upDateTimeout = setTimeout(() => { var pinValues = validateBLDCPins(); if(pinValues) { @@ -101,7 +101,7 @@ function getBLDCPinValues() { } function validateBLDCPins() { - clearErrors("pinValidation"); + clearErrors("pinValidation"); var assignedPins = []; var duplicatePins = []; var pwmErrors = []; @@ -125,7 +125,7 @@ function validateBLDCPins() { } } } - else + else { //assignedPins.push({name:"SPI1", pin:5}); assignedPins.push({name:"SPI CLK", pin:18}); @@ -143,7 +143,7 @@ function validateBLDCPins() { // } validatePin(pinValues.BLDC_Encoder_PIN, "Encoder", assignedPins, duplicatePins); - + // if(pinValues.BLDC_ChipSelect_PIN > -1) { // pinDupeIndex = assignedPins.findIndex(x => x.pin === pinValues.BLDC_ChipSelect_PIN); // if(pinDupeIndex > -1) @@ -199,7 +199,7 @@ function validateBLDCPins() { // } validatePin(pinValues.BLDC_HallEffect_PIN, "HallEffect", assignedPins, duplicatePins); } - + validateCommonPWMPins(assignedPins, duplicatePins, pinValues, pwmErrors); var invalidPins = []; @@ -217,10 +217,10 @@ function validateBLDCPins() { if (pwmErrors.length) { if(duplicatePins.length || invalidPins.length) { errorString += "
"; - } + } errorString += "
The following pins are invalid PWM pins:
"+pwmErrors.join("
")+"
"; } - + errorString += ""; showError(errorString); return undefined; diff --git a/ESP32/dataEdit/www/buttons.js b/ESP32/dataEdit/www/buttons.js index b7d72c9..ff70c3d 100644 --- a/ESP32/dataEdit/www/buttons.js +++ b/ESP32/dataEdit/www/buttons.js @@ -31,12 +31,12 @@ Buttons = { document.getElementById("buttonAnalogDebounce").value = buttonSettings["buttonAnalogDebounce"]; removeByClass("buttonSetRow"); buttonSettings["buttonSets"].forEach((buttonSet, setIndex) => { - + const buttons = buttonSet["buttons"]; //Main UI template const buttonSetsDiv = document.getElementById("buttonControls"); - + let buttonSetNameRow = Utils.createTextFormRow(0, "Name", 'buttonSetName'+setIndex, buttonSet.name, 25, function(setIndex) {this.update(setIndex)}.bind(this, setIndex)); buttonSetNameRow.input.setAttribute("readonly", true); let buttonSetPinRow = Utils.createNumericFormRow(0, "Pin", 'buttonSetPin'+setIndex, buttonSet.pin, -1, 255, function(setIndex) {this.update(setIndex)}.bind(this, setIndex)); @@ -72,7 +72,7 @@ Buttons = { buttonSetsDiv.appendChild(buttonSetPinRow.row); buttonSetsDiv.appendChild(buttonSetEditButton); - + //Modal Template var modalRootdiv = document.createElement("div"); modalRootdiv.classList.add("formTable"); @@ -100,7 +100,7 @@ Buttons = { }.bind(this, setIndex)); buttonSetPinRowEdit.input.required = true; buttonSetPinRowEdit.title = `The pin this button set is on` - + buttonTableDiv.appendChild(buttonSetNameRowEdit.row); buttonTableDiv.appendChild(buttonSetPinRowEdit.row); @@ -141,7 +141,7 @@ Buttons = { For example: '#motion-disable #resume #device-home #ok' NOTE: There is currently no way to delay between the command execution. ` - + modalParent.appendChild(buttonTable); buttonTable.appendChild(buttonTableDiv); modalParent.appendChild(span); @@ -166,7 +166,7 @@ Buttons = { buttonSettings["buttonSetsEnabled"] = setsEnabled; showRestartRequired(); } - + buttonSettings["bootButtonCommand"] = document.getElementById('bootButtonCommand').value.replace("\n", " "); if(validateIntControl("buttonAnalogDebounce", buttonSettings, "buttonAnalogDebounce")) { buttonSettings["buttonAnalogDebounce"] = parseInt(document.getElementById("buttonAnalogDebounce").value); @@ -211,7 +211,7 @@ Buttons = { modal.appendChild(this.templates[index]); this.setbuttonSet(index); const header = document.createElement("span"); - header.innerText = "Edit button set" + header.innerText = "Edit button set" header.setAttribute("slot", "title"); modal.appendChild(header); modal.show(); @@ -222,13 +222,13 @@ Buttons = { const buttonIndex = i; const button = buttons[i]; document.getElementById('buttonName'+setIndex+buttonIndex).value = button.name; - document.getElementById('buttonCommand'+setIndex+buttonIndex).value = button.command; + document.getElementById('buttonCommand'+setIndex+buttonIndex).value = button.command; // document.getElementById('buttonIndex'+setIndex+buttonIndex).value = button[i].index; }; }, updatebuttonSet(setIndex) { buttonSettings["buttonSets"][setIndex]["name"] = document.getElementById('buttonSetNameEdit'+setIndex).value; - buttonSettings["buttonSets"][setIndex]["pin"] = parseInt(document.getElementById('buttonSetPinEdit'+setIndex).value); + buttonSettings["buttonSets"][setIndex]["pin"] = parseInt(document.getElementById('buttonSetPinEdit'+setIndex).value); const buttons = buttonSettings["buttonSets"][setIndex]["buttons"]; for(var i = 0; i < buttons.length; i++) { const buttonIndex = i; @@ -236,17 +236,17 @@ Buttons = { const nameNode = document.getElementById('buttonName'+setIndex+buttonIndex); if(nameNode) { buttonSettings["buttonSets"][setIndex]["buttons"][i]["name"] = document.getElementById('buttonName'+setIndex+buttonIndex).value; - buttonSettings["buttonSets"][setIndex]["buttons"][i]["command"] = document.getElementById('buttonCommand'+setIndex+buttonIndex).value.replace("\n", " "); + buttonSettings["buttonSets"][setIndex]["buttons"][i]["command"] = document.getElementById('buttonCommand'+setIndex+buttonIndex).value.replace("\n", " "); } // document.getElementById('buttonIndex'+setIndex+buttonIndex).value = button[i].index; }; }, - + setButtonSetName(profileIndex) { if(this.setNameDebounce) { clearTimeout(this.setNameDebounce); } - + this.setNameDebounce = setTimeout(function(profileIndex) { if(validateStringControl("buttonSetName"+profileIndex, buttonSettings['buttonSets'][profileIndex], "name")) { //updateMotionProfileName(profileIndex); diff --git a/ESP32/dataEdit/www/esp-timer-setup.js b/ESP32/dataEdit/www/esp-timer-setup.js index 1d5f8c4..f52facf 100644 --- a/ESP32/dataEdit/www/esp-timer-setup.js +++ b/ESP32/dataEdit/www/esp-timer-setup.js @@ -49,7 +49,7 @@ ESPTimer = { } }, defaultDebounce); }.bind(this, timerObj, timerFrequencyRow); - + table.body.appendChild(timerFrequencyRow.row); } } diff --git a/ESP32/dataEdit/www/index.html b/ESP32/dataEdit/www/index.html index ad153da..f506ee3 100644 --- a/ESP32/dataEdit/www/index.html +++ b/ESP32/dataEdit/www/index.html @@ -9,7 +9,7 @@ - + @@ -19,6 +19,7 @@ +