-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #152 from purduesigbots/develop
🔖Release 0.6.0
- Loading branch information
Showing
27 changed files
with
1,108 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.body__container { | ||
margin: 1rem auto; | ||
display: grid; | ||
} | ||
.selection { | ||
background-color: rgb(60, 60, 60); | ||
color: rgb(240, 240, 240); | ||
border-color: rgb(60, 60, 60); | ||
box-sizing: border-box; | ||
padding: 5px; | ||
width: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
(function () { | ||
const vscode = acquireVsCodeApi(); | ||
|
||
const brainInfo = document.getElementById("brain_info"); | ||
const brainList = document.getElementById("brain_list"); | ||
const programList = document.getElementById("programs"); | ||
const deviceContainer = document.getElementById("device_container"); | ||
const nameInput = document.getElementById("name"); | ||
const teamInput = document.getElementById("team"); | ||
|
||
window.addEventListener("message", (event) => { | ||
const message = event.data; | ||
|
||
switch (message.type) { | ||
case "deviceInfo": | ||
updateDeviceInfo(message.deviceInfo); | ||
break; | ||
case "deviceList": | ||
updateDeviceList(message.deviceList, message.currentDevice); | ||
} | ||
}); | ||
|
||
brainList.addEventListener("change", (event) => { | ||
const selector = event.target; | ||
vscode.postMessage({ type: "setPort", port: selector.value }); | ||
}); | ||
|
||
var oldName = ""; | ||
nameInput.addEventListener("keydown", (event) => { | ||
if (event.key === "Enter") { | ||
vscode.postMessage({ type: "setName", name: event.target.value }); | ||
} else if (event.key === "Escape") { | ||
nameInput.value = oldName; | ||
} | ||
}); | ||
|
||
var oldTeam = ""; | ||
teamInput.addEventListener("keydown", (event) => { | ||
if (event.key === "Enter") { | ||
vscode.postMessage({ type: "setTeam", team: event.target.value }); | ||
} else if (event.key === "Escape") { | ||
teamInput.value = oldTeam; | ||
} | ||
}); | ||
|
||
function updateDeviceInfo(deviceInfo) { | ||
if (deviceInfo.ssn) { | ||
if (deviceInfo.name !== oldName) { | ||
nameInput.value = deviceInfo.name; | ||
oldName = deviceInfo.name; | ||
} | ||
if (deviceInfo.team !== oldTeam) { | ||
teamInput.value = deviceInfo.team; | ||
oldTeam = deviceInfo.team; | ||
} | ||
brainInfo.innerHTML = "Brain Info:<br>"; | ||
brainInfo.innerHTML += `VEXos Version: ${deviceInfo.vexos}<br>`; | ||
brainInfo.innerHTML += `CPU0 Firmware Version: ${deviceInfo.cpu0}<br>`; | ||
brainInfo.innerHTML += `CPU1 SDK Version: ${deviceInfo.cpu1}<br>`; | ||
brainInfo.innerHTML += `System ID: ${deviceInfo.ssn}`; | ||
programList.innerHTML = "Programs:<br>"; | ||
deviceInfo.programs.forEach((program) => { | ||
//programList.innerHTML += `<option value=${program.slot} ${Number(program.slot) === Number(deviceInfo.currentSlot) ? "selected" : ""}>${program.file}</option>`; | ||
programList.innerHTML += `Slot ${program.slot}: ${program.file}`; | ||
}); | ||
deviceContainer.innerHTML = ""; | ||
deviceInfo.devices.forEach((device) => { | ||
deviceContainer.innerHTML += `Port ${device.port}: ${device.type}<br>`; | ||
}); | ||
} else { | ||
brainInfo.innerHTML = "No Brain Info Available!"; | ||
} | ||
} | ||
|
||
function updateDeviceList(deviceList, currentDevice) { | ||
brainList.innerHTML = ""; | ||
if (deviceList.length === 0) { | ||
programList.innerHTML = ""; | ||
brainInfo.innerHTML = "No V5 Devices Found!"; | ||
deviceContainer.innerHTML = ""; | ||
} | ||
deviceList.forEach((deviceInfo) => { | ||
brainList.innerHTML += `<option value=${deviceInfo.device} ${ | ||
deviceInfo.device === currentDevice ? "selected" : "" | ||
}>${deviceInfo.desc}</option>`; | ||
}); | ||
} | ||
|
||
setInterval(vscode.postMessage, 3000, { type: "updateDeviceList" }); | ||
})(); |
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.