Skip to content

Commit

Permalink
Changed QR keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
teakubota committed Feb 3, 2023
1 parent 190ce33 commit f32b232
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 39 deletions.
6 changes: 3 additions & 3 deletions RawData.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ function dataToTable(dataObj) {
"<td>" + dataObj[i]["teleopcubesbottom"] + "</td>" +
"<td>" + dataObj[i]["teleopcubesmiddle"] + "</td>" +
"<td>" + dataObj[i]["teleopcubestop"] + "</td>" +
"<td>" + dataObj[i]["pickedupcone"] + "</td>" +
"<td>" + dataObj[i]["pickedupuprightcone"] + "</td>" +
"<td>" + dataObj[i]["pickeduptippedcone"] + "</td>" +
"<td>" + dataObj[i]["pickedupcube"] + "</td>" +
"<td>" + dataObj[i]["pickedupupright"] + "</td>" +
"<td>" + dataObj[i]["pickeduptipped"] + "</td>" +
"<td>" + dataObj[i]["endgamechargelevel"] + "</td>" +
"<td>" + dataObj[i]["died"] + "</td>" +
"<td>" + dataObj[i]["comment"] + "</td>" +
Expand Down
32 changes: 16 additions & 16 deletions dbHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function writeRowToTable($data)
teleopcubesbottom,
teleopcubesmiddle,
teleopcubestop,
pickedupcone,
pickedupuprightcone,
pickeduptippedcone,
pickedupcube,
pickedupupright,
pickeduptipped,
endgamechargelevel,
died,
matchnumber,
Expand All @@ -93,9 +93,9 @@ function writeRowToTable($data)
:teleopcubesbottom,
:teleopcubesmiddle,
:teleopcubestop,
:pickedupcone,
:pickedupuprightcone,
:pickeduptippedcone,
:pickedupcube,
:pickedupupright,
:pickeduptipped,
:endgamechargelevel,
:died,
:matchnumber,
Expand All @@ -118,7 +118,7 @@ function enforceDataTyping($data)
{
foreach ($row as $key => $value)
{
if ($key == "exitedcommunity" || $key == "autonconesbottom" || $key == "autonconesmiddle" || $key == "autonconestop" || $key == "autoncubesbottom" || $key == "autoncubesmiddle" || $key == "autoncubestop" || $key == "autonchargelevel" ||$key == "teleopconesbottom" || $key == "teleopconesmiddle" || $key == "teleopconestop" || $key == "teleopcubesbottom" || $key == "teleopcubesmiddle" || $key == "teleopcubestop" || $key == "pickedupcone" || $key == "pickedupuprightcone" || $key == "pickeduptippedcone" || $key == "endgamechargelevel" || $key == "died")
if ($key == "exitedcommunity" || $key == "autonconesbottom" || $key == "autonconesmiddle" || $key == "autonconestop" || $key == "autoncubesbottom" || $key == "autoncubesmiddle" || $key == "autoncubestop" || $key == "autonchargelevel" ||$key == "teleopconesbottom" || $key == "teleopconesmiddle" || $key == "teleopconestop" || $key == "teleopcubesbottom" || $key == "teleopcubesmiddle" || $key == "teleopcubestop" || $key == "pickedupcube" || $key == "pickedupupright" || $key == "pickeduptipped" || $key == "endgamechargelevel" || $key == "died")
{
$row[$key] = $this->enforceInt($value);
}
Expand Down Expand Up @@ -150,9 +150,9 @@ function readAllData($eventCode)
teleopcubesbottom,
teleopcubesmiddle,
teleopcubestop,
pickedupcone,
pickedupuprightcone,
pickeduptippedcone,
pickedupcube,
pickedupupright,
pickeduptipped,
endgamechargelevel,
died,
matchnumber,
Expand Down Expand Up @@ -183,9 +183,9 @@ function readTeamData($teamNumber, $eventCode)
teleopcubesbottom,
teleopcubesmiddle,
teleopcubestop,
pickedupcone,
pickedupuprightcone,
pickeduptippedcone,
pickedupcube,
pickedupupright,
pickeduptipped,
endgamechargelevel,
died,
matchnumber,
Expand Down Expand Up @@ -280,9 +280,9 @@ function createDataTable()
teleopcubesbottom TINYINT UNSIGNED NOT NULL,
teleopcubesmiddle TINYINT UNSIGNED NOT NULL,
teleopcubestop TINYINT UNSIGNED NOT NULL,
pickedupcone TINYINT UNSIGNED NOT NULL,
pickedupuprightcone TINYINT UNSIGNED NOT NULL,
pickeduptippedcone TINYINT UNSIGNED NOT NULL,
pickedupcube TINYINT UNSIGNED NOT NULL,
pickedupupright TINYINT UNSIGNED NOT NULL,
pickeduptipped TINYINT UNSIGNED NOT NULL,
endgamechargelevel TINYINT UNSIGNED NOT NULL,
died TINYINT UNSIGNED NOT NULL,
matchnumber VARCHAR(10) NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions scripts/qrHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function qrListToDict(dataList) {
out["teleopcubesbottom"] = dataList[12];
out["teleopcubesmiddle"] = dataList[13];
out["teleopcubestop"] = dataList[14];
out["pickedupcone"] = dataList[15];
out["pickedupuprightcone"] = dataList[16];
out["pickeduptippedcone"] = dataList[17];
out["pickedupcube"] = dataList[15];
out["pickedupupright"] = dataList[16];
out["pickeduptipped"] = dataList[17];
out["endgamechargelevel"] = dataList[18];
out["died"] = dataList[19];
out["matchnumber"] = dataList[20];
Expand Down
31 changes: 14 additions & 17 deletions teamLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,22 +374,22 @@ function dataToAutonGraph(matchdata) {
datasets.push({
label: "Auton Top Row Items",
data: [],
borderColor: 'red'
borderColor: 'Red'
});
datasets.push({
label: "Auton Middle Row Items",
data: [],
borderColor: 'green'
borderColor: 'Yellow'
});
datasets.push({
label: "Auton Bottom Row Items",
data: [],
borderColor: 'blue'
borderColor: 'Green'
});
datasets.push({
label: "Auton Charge Level",
data: [],
borderColor: 'yellow'
borderColor: 'Blue'
});


Expand Down Expand Up @@ -514,22 +514,22 @@ function dataToTeleopGraph(matchdata) {
datasets.push({
label: "Teleop Top Row Items",
data: [],
borderColor: 'red'
borderColor: 'MediumOrchid'
});
datasets.push({
label: "Teleop Middle Row Items",
data: [],
borderColor: 'green'
borderColor: 'MediumSeaGreen'
});
datasets.push({
label: "Teleop Bottom Row Items",
data: [],
borderColor: 'blue'
borderColor: 'MediumTurquoise'
});
datasets.push({
label: "Endgame Charge Level",
data: [],
borderColor: 'yellow'
borderColor: 'PaleVioletRed'
});


Expand Down Expand Up @@ -661,11 +661,8 @@ function processPitData(pitData, matchData) {
var pickedupcubevalue = 0;
var pickedupuprightvalue = 0;
var pickeduptippedvalue = 0;
console.log("matchData.length = "+matchData.length);
/*for (let i = 0; i < matchData.length; i++) {
console.log("matchData[i][pickedupcube] = "+matchData[i]["endgamechargelevel"]);
for (let i = 0; i < matchData.length; i++) {
if(matchData[i]["pickedupcube"] == true) {
console.log("HI");
pickedupcubevalue = 1;
}
else if(matchData[i]["pickedupupright"] == true) {
Expand All @@ -674,14 +671,14 @@ function processPitData(pitData, matchData) {
else if(matchData[i]["pickeduptipped"] == true) {
pickeduptippedvalue = 1;
}
}*/
}

const dictX = {
drivemotors: pitData["drivemotors"],
preparedness: pitData["preparedness"],
pickedupcone: matchData["pickedupcube"],
pickedupuprightcone: matchData["pickedupupright"],
pickeduptippedcone: matchData["pickeduptipped"]};
pickedupcube: pickedupcubevalue,
pickedupupright: pickedupuprightvalue,
pickeduptipped: pickeduptippedvalue};
writeTableRow("pitRow2", dictX, ["drivemotors", "preparedness", "pickedupcube", "pickedupupright", "pickeduptipped"]);

}
Expand Down

0 comments on commit f32b232

Please sign in to comment.