diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 0de0513..dd5f7c0 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -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) } @@ -45,7 +45,7 @@ function App() {
- {fields.map((_field, index) => )} + {fields.map((field, index) => )} {/**/}
diff --git a/frontend/src/Components/TextForm.jsx b/frontend/src/Components/TextForm.jsx index e24b3ec..e54c14f 100644 --- a/frontend/src/Components/TextForm.jsx +++ b/frontend/src/Components/TextForm.jsx @@ -11,6 +11,6 @@ export function TextForm({fields, data, setData, index, recording}) { } return ( - + ) } diff --git a/py_data_acq/py_data_acq/web_server/files/metadata.json b/py_data_acq/py_data_acq/web_server/files/metadata.json index c96831b..1abe003 100644 --- a/py_data_acq/py_data_acq/web_server/files/metadata.json +++ b/py_data_acq/py_data_acq/web_server/files/metadata.json @@ -1,5 +1,6 @@ [ { + "id": 0, "name": "driver", "displayName": "Driver", "type": "string", @@ -7,8 +8,8 @@ "dropdown": false, "automatic": false }, - { + "id": 1, "name": "testingGoal", "displayName": "Testing Goal", "type": "string", @@ -17,6 +18,7 @@ "automatic": false }, { + "id": 2, "name": "eventType", "displayName": "Event Type", "type": "string", @@ -25,6 +27,7 @@ "automatic": false }, { + "id": 3, "name": "notes", "displayName": "Notes", "type": "string", @@ -33,6 +36,7 @@ "automatic": false }, { + "id": 4, "name": "startTime", "displayName": "Start Time/Date", "type": "string", @@ -41,6 +45,7 @@ "automatic": false }, { + "id": 5, "name": "endTime", "displayName": "End Time/Date", "type": "string", @@ -49,6 +54,7 @@ "automatic": false }, { + "id": 6, "name": "location", "displayName": "Location", "type": "string", @@ -57,6 +63,7 @@ "automatic": false }, { + "id": 7, "name": "conditions", "displayName": "Conditions (ie dry, night time)", "type": "string", @@ -65,6 +72,7 @@ "automatic": false }, { + "id": 8, "name": "temperature", "displayName": "Temperature (C)", "type": "string", @@ -73,6 +81,7 @@ "automatic": false }, { + "id": 9, "name": "aeroType", "displayName": "Aero Type", "type": "string", @@ -81,6 +90,7 @@ "automatic": false }, { + "id": 10, "name": "MCUversion", "displayName": "MCU Version", "type": "string", @@ -89,6 +99,7 @@ "automatic": false }, { + "id": 11, "name": "errors", "displayName": "Errors", "type": "string", @@ -97,6 +108,7 @@ "automatic": false }, { + "id": 12, "name": "yawPIDValues", "displayName": "Yaw Pid Values", "type": "string", @@ -105,6 +117,7 @@ "automatic": false }, { + "id": 13, "name": "TCSPIDValues", "displayName": "TCS PID Values", "type": "string", @@ -113,6 +126,7 @@ "automatic": false }, { + "id": 14, "name": "TCSEnable", "displayName": "TCS Enabled", "type": "string", @@ -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", @@ -137,6 +153,7 @@ "automatic": false }, { + "id": 17, "name": "normForceEnable", "displayName": "Norm Force Enabled", "type": "string", @@ -145,6 +162,7 @@ "automatic": false }, { + "id": 18, "name": "mechPowerLimEnable", "displayName": "Mech Power Lim. Enabled", "type": "string", @@ -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,