Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
SebCanet committed May 21, 2020
1 parent 4a1cd0b commit 16a09e3
Show file tree
Hide file tree
Showing 106 changed files with 32,229 additions and 1,974 deletions.
2 changes: 1 addition & 1 deletion CLI_functions.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Arduino CLI control
*/
const {ipcRenderer} = require('electron');
const {ipcRenderer} = require('electron');
const {exec} = require('child_process');
const fs = require('fs-extra');

Expand Down
21 changes: 20 additions & 1 deletion IDE_functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
const {ipcRenderer} = require('electron');
const {exec} = require('child_process');
const fs = require('fs-extra');
const tableify = require('tableify')
const SerialPort = require('serialport');

var serialPortsMenu = document.getElementById('serialMenu');
Expand All @@ -19,12 +20,30 @@ serialPortsMenu.addEventListener("mouseover", function (event) {
ports.forEach(function (port) {
var option = document.createElement('option');
option.value = port.path;
option.text = port.path + ' ' + port.manufacturer;
option.text = port.path;
serialPortsMenu.appendChild(option);
});
});
});

document.getElementById('serialButton').addEventListener("mouseover", function (event) {
SerialPort.list().then(ports => {
let portsList = ports.map(function(obj) {
return {
path: obj.path,
manufacturer: obj.manufacturer,
vendorId: obj.vendorId,
productId: obj.productId
}
});
if (portsList.length === 0) {
document.getElementById('portListModalBody').innerHTML = "Aucun port n'est disponible";
} else {
document.getElementById('portListModalBody').innerHTML = tableify(portsList);
}
})
});

window.addEventListener('load', function load(event) {
document.getElementById('verifyButton').onclick = function (event) {
try {
Expand Down
Loading

0 comments on commit 16a09e3

Please sign in to comment.