Skip to content

Commit

Permalink
fixed ssot problems
Browse files Browse the repository at this point in the history
  • Loading branch information
klou23 committed Apr 26, 2024
1 parent f4ebe73 commit 8ad16f2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
6 changes: 3 additions & 3 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ function App() {
// }
// })
// const json = await fetchResponse.json()
const json = '[{"name":"driver","displayName":"Driver","type":"string","required":true,"dropdown":false,"automatic":false},{"name":"testingGoal","displayName":"Testing Goal","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"eventType","displayName":"Event Type","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"notes","displayName":"Notes","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"startTime","displayName":"Start Time/Date","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"endTime","displayName":"End Time/Date","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"location","displayName":"Location","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"conditions","displayName":"Conditions (ie dry, night time)","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"temperature","displayName":"Temperature (C)","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"aeroType","displayName":"Aero Type","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"MCUversion","displayName":"MCU Version","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"errors","displayName":"Errors","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"yawPIDValues","displayName":"Yaw Pid Values","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"TCSPIDValues","displayName":"TCS PID Values","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"TCSEnable","displayName":"TCS Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"yawPIDENable","displayName":"yaw PID Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"launchEnable","displayName":"Launch Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"normForceEnable","displayName":"Norm Force Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"mechPowerLimEnable","displayName":"Mech Power Lim. Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"name":"pidPowerLimEnable","displayName":"pid Power Lim. Enabled","type":"string","required":false,"dropdown":false,"automatic":false}]'
const json = '[{"id":0,"name":"driver","displayName":"Driver","type":"string","required":true,"dropdown":false,"automatic":false},{"id":1,"name":"testingGoal","displayName":"Testing Goal","type":"string","required":false,"dropdown":false,"automatic":false},{"id":2,"name":"eventType","displayName":"Event Type","type":"string","required":false,"dropdown":false,"automatic":false},{"id":3,"name":"notes","displayName":"Notes","type":"string","required":false,"dropdown":false,"automatic":false},{"id":4,"name":"startTime","displayName":"Start Time/Date","type":"string","required":false,"dropdown":false,"automatic":false},{"id":5,"name":"endTime","displayName":"End Time/Date","type":"string","required":false,"dropdown":false,"automatic":false},{"id":6,"name":"location","displayName":"Location","type":"string","required":false,"dropdown":false,"automatic":false},{"id":7,"name":"conditions","displayName":"Conditions (ie dry, night time)","type":"string","required":false,"dropdown":false,"automatic":false},{"id":8,"name":"temperature","displayName":"Temperature (C)","type":"string","required":false,"dropdown":false,"automatic":false},{"id":9,"name":"aeroType","displayName":"Aero Type","type":"string","required":false,"dropdown":false,"automatic":false},{"id":10,"name":"MCUversion","displayName":"MCU Version","type":"string","required":false,"dropdown":false,"automatic":false},{"id":11,"name":"errors","displayName":"Errors","type":"string","required":false,"dropdown":false,"automatic":false},{"id":12,"name":"yawPIDValues","displayName":"Yaw Pid Values","type":"string","required":false,"dropdown":false,"automatic":false},{"id":13,"name":"TCSPIDValues","displayName":"TCS PID Values","type":"string","required":false,"dropdown":false,"automatic":false},{"id":14,"name":"TCSEnable","displayName":"TCS Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"id":15,"name":"yawPIDENable","displayName":"Yaw PID Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"id":16,"name":"launchEnable","displayName":"Launch Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"id":17,"name":"normForceEnable","displayName":"Norm Force Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"id":18,"name":"mechPowerLimEnable","displayName":"Mech Power Lim. Enabled","type":"string","required":false,"dropdown":false,"automatic":false},{"id":19,"name":"pidPowerLimEnable","displayName":"Pid Power Lim. Enabled","type":"string","required":false,"dropdown":false,"automatic":false}]'
setFields(JSON.parse(json))
setData(new Array(fields.length).fill(undefined))
setData(new Array(JSON.parse(json).length).fill(''))

return JSON.parse(json)
}
Expand All @@ -45,7 +45,7 @@ function App() {
</div>

<div className={"flex flex-col gap-4 items-center justify-center"}>
{fields.map((_field, index) => <Field fields={fields} data={data} setData={setData} index={index} recording={recording}/>)}
{fields.map((field, index) => <Field key={field.id} fields={fields} data={data} setData={setData} index={index} recording={recording}/>)}
{/*<StartStopButton recording={recording} setRecording={setRecording} driverInput={driverInput} trackNameInput={trackNameInput} eventTypeInput={eventTypeInput} drivetrainTypeInput={drivetrainTypeInput} massInput={massInput} wheelbaseInput={wheelbaseInput} firmwareRevInput={firmwareRevInput}/>*/}
</div>

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/Components/TextForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export function TextForm({fields, data, setData, index, recording}) {
}

return (
<input input value={data[index]} onChange={handleChange} className={"input input-bordered w-80 -mt-3"} disabled={recording}/>
<input value={data[index] === undefined ? "test" : data[index]} onChange={handleChange} className={"input input-bordered w-80 -mt-3"} disabled={recording}/>
)
}
25 changes: 22 additions & 3 deletions py_data_acq/py_data_acq/web_server/files/metadata.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[
{
"id": 0,
"name": "driver",
"displayName": "Driver",
"type": "string",
"required": true,
"dropdown": false,
"automatic": false
},

{
"id": 1,
"name": "testingGoal",
"displayName": "Testing Goal",
"type": "string",
Expand All @@ -17,6 +18,7 @@
"automatic": false
},
{
"id": 2,
"name": "eventType",
"displayName": "Event Type",
"type": "string",
Expand All @@ -25,6 +27,7 @@
"automatic": false
},
{
"id": 3,
"name": "notes",
"displayName": "Notes",
"type": "string",
Expand All @@ -33,6 +36,7 @@
"automatic": false
},
{
"id": 4,
"name": "startTime",
"displayName": "Start Time/Date",
"type": "string",
Expand All @@ -41,6 +45,7 @@
"automatic": false
},
{
"id": 5,
"name": "endTime",
"displayName": "End Time/Date",
"type": "string",
Expand All @@ -49,6 +54,7 @@
"automatic": false
},
{
"id": 6,
"name": "location",
"displayName": "Location",
"type": "string",
Expand All @@ -57,6 +63,7 @@
"automatic": false
},
{
"id": 7,
"name": "conditions",
"displayName": "Conditions (ie dry, night time)",
"type": "string",
Expand All @@ -65,6 +72,7 @@
"automatic": false
},
{
"id": 8,
"name": "temperature",
"displayName": "Temperature (C)",
"type": "string",
Expand All @@ -73,6 +81,7 @@
"automatic": false
},
{
"id": 9,
"name": "aeroType",
"displayName": "Aero Type",
"type": "string",
Expand All @@ -81,6 +90,7 @@
"automatic": false
},
{
"id": 10,
"name": "MCUversion",
"displayName": "MCU Version",
"type": "string",
Expand All @@ -89,6 +99,7 @@
"automatic": false
},
{
"id": 11,
"name": "errors",
"displayName": "Errors",
"type": "string",
Expand All @@ -97,6 +108,7 @@
"automatic": false
},
{
"id": 12,
"name": "yawPIDValues",
"displayName": "Yaw Pid Values",
"type": "string",
Expand All @@ -105,6 +117,7 @@
"automatic": false
},
{
"id": 13,
"name": "TCSPIDValues",
"displayName": "TCS PID Values",
"type": "string",
Expand All @@ -113,6 +126,7 @@
"automatic": false
},
{
"id": 14,
"name": "TCSEnable",
"displayName": "TCS Enabled",
"type": "string",
Expand All @@ -121,14 +135,16 @@
"automatic": false
},
{
"id": 15,
"name": "yawPIDENable",
"displayName": "yaw PID Enabled",
"displayName": "Yaw PID Enabled",
"type": "string",
"required": false,
"dropdown": false,
"automatic": false
},
{
"id": 16,
"name": "launchEnable",
"displayName": "Launch Enabled",
"type": "string",
Expand All @@ -137,6 +153,7 @@
"automatic": false
},
{
"id": 17,
"name": "normForceEnable",
"displayName": "Norm Force Enabled",
"type": "string",
Expand All @@ -145,6 +162,7 @@
"automatic": false
},
{
"id": 18,
"name": "mechPowerLimEnable",
"displayName": "Mech Power Lim. Enabled",
"type": "string",
Expand All @@ -153,8 +171,9 @@
"automatic": false
},
{
"id": 19,
"name": "pidPowerLimEnable",
"displayName": "pid Power Lim. Enabled",
"displayName": "Pid Power Lim. Enabled",
"type": "string",
"required": false,
"dropdown": false,
Expand Down

0 comments on commit 8ad16f2

Please sign in to comment.