CIM69 - car database

This commit is contained in:
“VeLiTi”
2024-06-14 15:59:01 +02:00
parent c53535b50b
commit 3528be22b8
18 changed files with 1552 additions and 136 deletions

View File

@@ -235,10 +235,18 @@ async function listenToPort() {
}
const serialResultsDiv = document.getElementById("serialResults");
const plug_data = document.getElementById("plug_data");
async function appendToTerminal(newStuff) {
serialResultsDiv.innerHTML += newStuff;
serialOutput +=newStuff
//vcp_data.value +=newStuff
if (typeof plug_data !== "undefined"){
var plugdata = {"VCP":{VCP}, "VPP1":{VPP1},"VPP2":{VPP2},"VBAT":{VBAT}, "PWM":{PWM},"STATE":{STATE}, "xChart":{xChart}}
plug_data.value = JSON.stringify(plugdata);
}
serialOutput +=newStuff;
}
@@ -374,6 +382,37 @@ async function closePort(){
window.location.reload();
}
async function closePortCarTest(){
reader.cancel();
await readableStreamClosed.catch(() => { /* Ignore the error */ });
writer.close();
await writableStreamClosed
console.log(maintenanceRun);
await port.close();
//Check for errors maintenanceRun = 999
if (maintenanceRun != 999){
serialResultsDiv.innerHTML = '';
if (maintenanceRun !=0){
if (value != 33){//Include the correct ROWID of the Productrecord
progressBar("100", "Ready", "#04AA6D");
}
else{
progressBar("100", "Ready => Warning: Product requires TESLA adapter", "#ff6666");
}
}
else {
progressBar("100", "Ready", "#04AA6D");
}
}
maintenanceRun = 0; // reset maintenanceRun
}
async function updateHistory(){
var data = document.getElementById("servicetoken").innerHTML; //get ServiceID