Skip to content

Commit

Permalink
basic 2024 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Shom770 committed Jan 26, 2024
1 parent 34513e6 commit f23a6f7
Show file tree
Hide file tree
Showing 4 changed files with 1,740 additions and 1,863 deletions.
Binary file added scoutingapp/public/2024fieldMapBlue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions scoutingapp/src/components/pages/Page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from "react"
import { useEffect, useState } from "react"
import { Link } from "react-router-dom"
import { DarkButton } from "../buttons"
import { DropdownTextInput, GenericTextArea, GenericTextInput, IncrementNumberInput, SliderInput, ConeCubeIncrementInput} from "../inputs"
import { DropdownTextInput, GenericTextArea, GenericTextInput, IncrementNumberInput, SliderInput, ConeCubeIncrementInput } from "../inputs"
import { ComponentSetup, PageSetup } from "../interface"
import { GenericCheckboxSelect, GenericDropdown, GenericRadioSelect, GenericToggle, ChargedUpGridSelect} from "../selects"
import { GenericCheckboxSelect, GenericDropdown, GenericRadioSelect, GenericToggle, ChargedUpGridSelect } from "../selects"
import { GenericHeaderOne, GenericHeaderTwo, QRCodeModal, Timer } from "../texts"
import { CycleCounter } from "../monitor"
import ChargedUpStartingPosition from "../selects/ChargedUpStartingPosition"
Expand All @@ -13,7 +13,7 @@ interface ImportedComponentSetup extends ComponentSetup {
type: string;
}

export function Page(props: PageSetup){
export function Page(props: PageSetup) {
const ComponentLibrary: Object = {
"DarkButton": [DarkButton, false],
"DropdownTextInput": [DropdownTextInput, ["", ""]],
Expand All @@ -30,7 +30,7 @@ export function Page(props: PageSetup){
"CycleCounter": [CycleCounter, ""],
"Timer": [Timer, ""],
"ChargedUpGridSelect": [ChargedUpGridSelect, []],
"ChargedUpStartingPosition":[ChargedUpStartingPosition, ""],
"ChargedUpStartingPosition": [ChargedUpStartingPosition, ""],
"ConeCubeIncrementInput": [ConeCubeIncrementInput, []]
}

Expand All @@ -39,13 +39,13 @@ export function Page(props: PageSetup){
const required: String[] = [];

props?.config?.components?.map((component: ImportedComponentSetup) => {
if (component.type != "Spacing"){
if (component.type != "Spacing") {
try {
componentSetup[component.id] = (ComponentLibrary as any)[component.type][1]
if (component.required == true){
if (component.required == true) {
required.push(component.id)
}
} catch {}
} catch { }
}
})

Expand All @@ -62,11 +62,11 @@ export function Page(props: PageSetup){
console.log("test")
//setPageComponents(state)
componentSetup = pageComponents
if (pageComponents["result"]){
if (pageComponents["result"]) {
var order = ""
for (var i = 0; i < props?.config?.export.order.length; i++){
for (var i = 0; i < props?.config?.export.order.length; i++) {
order += pageComponents[props?.config?.export.order[i]]
if (i != props?.config?.export.order.length - 1){
if (i != props?.config?.export.order.length - 1) {
order += props?.config?.export.delimiter
}
}
Expand All @@ -75,7 +75,7 @@ export function Page(props: PageSetup){
}
props?.config?.components?.map((requiredId: any) => {
componentSetup["export"].isRequiredCompleted = true
if (!["", []].includes(componentSetup[requiredId])){
if (!["", []].includes(componentSetup[requiredId])) {
console.log(false)
componentSetup["export"].isRequiredCompleted = false
}
Expand All @@ -89,19 +89,19 @@ export function Page(props: PageSetup){
<Link to="/">
<div className="w-full h-6 mx-4 text-2xl font-bold">
<svg xmlns="http://www.w3.org/2000/svg" height="40" width="40" viewBox="0 0 75 75">
<path d="M20 44 0 24 20 4l2.8 2.85L5.65 24 22.8 41.15Z"/>
<path d="M20 44 0 24 20 4l2.8 2.85L5.65 24 22.8 41.15Z" />
</svg>
</div>
</Link>
{
props?.config?.components?.map((component: ImportedComponentSetup) => {
if (component.required == true){
if (component.required == true) {
requiredComponents.push(component.id)
}

if (component.type == "Spacing"){
if (component.type == "Spacing") {
return (
<div className="h-[2px]"/>
<div className="h-[2px]" />
)
}
else {
Expand All @@ -116,13 +116,13 @@ export function Page(props: PageSetup){
const FoundComponent = (ComponentLibrary as any)[component.type][0];

return (
<FoundComponent {...sendprops} getValue={pageComponents} setValue={propsSetPageComponent} id={component.id}/>
<FoundComponent {...sendprops} getValue={pageComponents} setValue={propsSetPageComponent} id={component.id} />
);

}
})
}
<QRCodeModal getValue={pageComponents} setValue={propsSetPageComponent} required={requiredComponents}/>
<QRCodeModal getValue={pageComponents} setValue={propsSetPageComponent} required={requiredComponents} />
</div>
)
}
181 changes: 28 additions & 153 deletions scoutingapp/src/config/structure.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[
{
"name": "2023 Scouting App",
"description": "Team 4099: The Falcon's 2023 scouting data collection page",
"name": "2024 Scouting App",
"description": "Team 4099: The Falcon's 2024 scouting data collection page",
"components": [
{
"type": "GenericHeaderOne",
"text": "2023 Scouting App"
"text": "2024 Scouting App"
},
{
"type": "GenericHeaderTwo",
Expand All @@ -15,7 +15,7 @@
"type": "GenericTextInput",
"text": "Scout Name",
"placeholder": [
"Pranav"
"shayaan"
],
"id": "ScoutId",
"required": true
Expand Down Expand Up @@ -60,159 +60,49 @@
"type": "GenericTextInput",
"text": "Team Number",
"placeholder": [
"9999"
"4099"
],
"id": "TeamNumber",
"required": true
},
{
"type": "Spacing"
},
{
"type": "GenericHeaderTwo",
"text": "Auto Starting Position"
},
{
"type": "ChargedUpStartingPosition",
"text": "",
"id": "StartingPosition"
},
{
"type": "Spacing"
},
{
"type": "GenericHeaderTwo",
"text": "Auto Game Pieces"
},


{
"type": "IncrementNumberInput",
"text": "Auto High",
"placeholder": ["0"],
"options": ["green"],
"id": "AutoHigh"
},

{
"type": "IncrementNumberInput",
"text": "Auto Mid",
"placeholder": ["0"],
"options": ["yellow"],
"id": "AutoMid"
},

{
"type": "IncrementNumberInput",
"text": "Auto Low",
"placeholder": ["0"],
"options": ["red"],
"id": "AutoLow"
"text": "Auto Speaker Cycles",
"placeholder": [
"0"
],
"id": "AutoSpeaker"
},

{
"type": "IncrementNumberInput",
"text": "Auto Missed",
"placeholder": ["0"],
"options": [],
"id": "AutoMissed"
},
{
"type": "GenericHeaderTwo",
"text": "Auto Engage"
},
{
"type": "GenericToggle",
"text": "Auto Engage Attempted",
"id": "AutoAttemptedCharge"
"text": "Auto Amp Cycles",
"placeholder": [
"0"
],
"id": "AutoAmp"
},
{
"type": "GenericToggle",
"text": "Auto Engage Succeeded",
"id": "AutoAttemptedCharge"
"text": "Did they leave the starting zone (white line)?",
"id": "AutoLeave"
},
{
"type": "GenericTextArea",
"text": "Auto Notes",
"id": "AutoNotes"
},
{
"type": "Spacing"
},
{
"type": "Spacing"
},
{
"type": "GenericHeaderTwo",
"text": "Teleop Game Pieces"
},
{
"type": "ConeCubeIncrementInput",
"text": "Teleop High",
"options":["green"],
"id": "TeleopHigh"
},
{
"type": "ConeCubeIncrementInput",
"text": "Teleop Mid",
"options":["yellow"],
"id": "TeleopMid"
},
{
"type": "ConeCubeIncrementInput",
"text": "Teleop Low",
"options":["red"],
"id": "TeleopLow"
},
{
"type": "GenericTextArea",
"text": "Teleop or Endgame Notes",
"id": "TeleopNotes"
},
{
"type": "Spacing"
},
{
"type": "Spacing"
},
{
"type": "Spacing"
},
{
"type": "GenericHeaderTwo",
"text": "Ratings"
},
{
"type": "GenericToggle",
"text": "Did they disable",
"id": "Disable"
},
{
"type": "GenericToggle",
"text": "Were they tippy",
"id": "Tippy"
},
{
"type": "SliderInput",
"text": "How well do they drive",
"options": [
"1",
"5"
],
"placeholder":[3],
"id": "DriverRating"
},
{
"type": "GenericTextArea",
"text": "Rating Notes",
"id": "RatingNotes"
},
{
"type": "DarkButton",
"text": "Submit",
"id": "result"
}

],
"export": {
"delimiter": "|",
Expand All @@ -222,29 +112,10 @@
"Alliance",
"DriverStation",
"TeamNumber",
"StartingPosition",
"AutoHigh",
"AutoMid",
"AutoLow",
"AutoMissed",
"AutoEngageAttempted",
"AutoEngageSuccessful",
"AutoNotes",
"TeleopHigh",
"TeleopMid",
"TeleopLow",
"TeleopMissed",
"TeleopNotes",
"EndgameAttemptedCharge",
"EndgameFinalCharge",
"EndgameChargeTime",
"EndgameNotes",
"Disable",
"Tippy",
"DefenseTime",
"DefenseRating",
"DriverRating",
"RatingNotes"
"AutoSpeaker",
"AutoAmp",
"AutoLeave",
"AutoNotes"
]
}
},
Expand Down Expand Up @@ -324,7 +195,9 @@
{
"type": "IncrementNumberInput",
"text": "Auto Game Pieces Scored",
"placeholder": ["0"],
"placeholder": [
"0"
],
"id": "AutoPieces"
},
{
Expand Down Expand Up @@ -382,7 +255,9 @@
{
"type": "IncrementNumberInput",
"text": "Teleop Game Pieces Scored",
"placeholder": ["0"],
"placeholder": [
"0"
],
"id": "TeleopPieces"
},
{
Expand Down Expand Up @@ -541,4 +416,4 @@
]
}
}
]
]
Loading

0 comments on commit f23a6f7

Please sign in to comment.