Skip to content

Commit eb21c59

Browse files
committed
update vis to fs-3 schema (not dynamic yet)
1 parent 8cb51f6 commit eb21c59

File tree

4 files changed

+487
-418
lines changed

4 files changed

+487
-418
lines changed

frontend/app/FlexLayoutProvider.tsx

Lines changed: 4 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client";
22

3-
import { Model } from "flexlayout-react";
4-
import { Mode } from "fs";
3+
import { layouts } from "@/constants/layouts";
4+
import { IJsonModel, Model } from "flexlayout-react";
55
import {
66
createContext,
77
Dispatch,
@@ -15,133 +15,10 @@ export const FlexLayoutContext = createContext<
1515
null | [Model, Dispatch<SetStateAction<Model>>]
1616
>(null);
1717

18-
const layoutModel = Model.fromJson({
19-
global: {},
20-
borders: [],
21-
layout: {
22-
type: "row",
23-
id: "root",
24-
weight: 100,
25-
children: [
26-
{
27-
type: "row",
28-
weight: 30,
29-
children: [
30-
{
31-
type: "tabset",
32-
weight: 50,
33-
children: [
34-
{
35-
type: "tab",
36-
name: "Lap Counter",
37-
component: "lap-counter",
38-
},
39-
],
40-
},
41-
{
42-
type: "tabset",
43-
weight: 50,
44-
children: [
45-
{
46-
type: "tab",
47-
name: "GPS",
48-
component: "gps",
49-
},
50-
],
51-
},
52-
// {
53-
// type: "tabset",
54-
// weight: 30,
55-
// children: [
56-
// {
57-
// type: "tab",
58-
// name: "CarWireframe",
59-
// component: "car-wireframe",
60-
// },
61-
// { type: "tab", name: "G-Force Gauge", component: "g-force-gauge" },
62-
// ],
63-
// },
64-
// {
65-
// type: "tabset",
66-
// weight: 40,
67-
// children: [{ type: "tab", name: "Timings", component: "timings-box" }],
68-
// },
69-
],
70-
},
71-
{
72-
type: "row",
73-
weight: 70,
74-
children: [
75-
{
76-
type: "tabset",
77-
children: [
78-
{
79-
type: "tab",
80-
name: "Stacked Line Chart",
81-
component: "stacked-line-chart",
82-
config: {
83-
yAxesInfo: [
84-
{
85-
columnNames: [
86-
"Seg0_VOLT_0",
87-
"Seg0_VOLT_1",
88-
"Seg0_VOLT_2",
89-
"Seg0_VOLT_3",
90-
"Seg0_VOLT_4",
91-
"Seg0_VOLT_5",
92-
"Seg0_VOLT_6",
93-
],
94-
label: "Seg0 Temps",
95-
units: "V",
96-
},
97-
{
98-
columnNames: [
99-
"Seg0_TEMP_0",
100-
"Seg0_TEMP_1",
101-
"Seg0_TEMP_2",
102-
"Seg0_TEMP_3",
103-
"Seg0_TEMP_4",
104-
"Seg0_TEMP_5",
105-
"Seg0_TEMP_6",
106-
],
107-
label: "Seg0 Voltages",
108-
units: "°C",
109-
},
110-
],
111-
},
112-
},
113-
],
114-
},
115-
// {
116-
// type: "tabset",
117-
// weight: 33,
118-
// children: [
119-
// {
120-
// type: "tab",
121-
// name: "Brake Presssure (psi)",
122-
// component: "brake-pressure-linegraph",
123-
// },
124-
// ],
125-
// },
126-
// {
127-
// type: "tabset",
128-
// weight: 33,
129-
// children: [
130-
// {
131-
// type: "tab",
132-
// name: "Longitudinal Acceleration",
133-
// component: "long-accel-linegraph",
134-
// },
135-
// ],
136-
// },
137-
],
138-
},
139-
],
140-
},
141-
});
18+
const defaultLayoutModel = layouts[0].config.model;
14219

14320
export function FlexLayoutProvider({ children }: PropsWithChildren) {
144-
const state = useState(layoutModel);
21+
const state = useState(defaultLayoutModel);
14522
return <FlexLayoutContext.Provider value={state}>{children}</FlexLayoutContext.Provider>;
14623
}
14724

frontend/app/data-processing/datatypes.ts

Lines changed: 3 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,17 @@
11
import { Field, Precision, Schema } from "apache-arrow";
22
import { Float, Float32, Int64, Timestamp, Utf8 } from "apache-arrow/type";
3-
import { fs3dataSchema } from "./schema";
3+
import { fs2dataSchema, fs3dataSchema } from "./schema";
44
import { DataSetXY } from "@lightningchart/lcjs";
55

66
// (just a shorter alias)
77
// const float32 = new Float(Precision.SINGLE);
88

99
const columnDataTypes = fs3dataSchema;
10-
// const columnDataTypes = {
11-
// "Acc Temp 1(Cel)": float32,
12-
// "Acc Temp 2(Cel)": float32,
13-
// "Acc Temp 3(Cel)": float32,
14-
// "Acc Temp 4(Cel)": float32,
15-
// "Acc Temp 5(Cel)": float32,
16-
// "Acc Temp 6(Cel)": float32,
17-
// "Acc Temp 7(Cel)": float32,
18-
// "Acc Temp 8(Cel)": float32,
19-
// "Acc Temp 9(Cel)": float32,
20-
// "Acc Temp 10(Cel)": float32,
21-
// "Acc Temp 11(Cel)": float32,
22-
// "Acc Temp 12(Cel)": float32,
23-
// "Acc Temp 13(Cel)": float32,
24-
// "Acc Temp 14(Cel)": float32,
25-
// "Acc Temp 15(Cel)": float32,
26-
// "Acc Temp 16(Cel)": float32,
27-
// "Acc Temp 17(Cel)": float32,
28-
// "Acc Temp 18(Cel)": float32,
29-
// "Acc Temp 19(Cel)": float32,
30-
// "Acc Temp 20(Cel)": float32,
31-
// "Acc Temp 21(Cel)": float32,
32-
// "Acc Temp 22(Cel)": float32,
33-
// "Acc Temp 23(Cel)": float32,
34-
// "Acc Temp 24(Cel)": float32,
35-
// "Acc Temp 25(Cel)": float32,
36-
// "Acc Temp 26(Cel)": float32,
37-
// "Acc Temp 27(Cel)": float32,
38-
// "Acc Temp 28(Cel)": float32,
39-
// "Acc Voltage 1(V)": float32,
40-
// "Acc Voltage 2(V)": float32,
41-
// "Acc Voltage 3(V)": float32,
42-
// "Acc Voltage 4(V)": float32,
43-
// "Acc Voltage 5(V)": float32,
44-
// "Acc Voltage 6(V)": float32,
45-
// "Acc Voltage 7(V)": float32,
46-
// "Acc Voltage 8(V)": float32,
47-
// "Acc Voltage 9(V)": float32,
48-
// "Acc Voltage 10(V)": float32,
49-
// "Acc Voltage 11(V)": float32,
50-
// "Acc Voltage 12(V)": float32,
51-
// "Acc Voltage 13(V)": float32,
52-
// "Acc Voltage 14(V)": float32,
53-
// "Acc Voltage 15(V)": float32,
54-
// "Acc Voltage 16(V)": float32,
55-
// "Acc Voltage 17(V)": float32,
56-
// "Acc Voltage 18(V)": float32,
57-
// "Acc Voltage 19(V)": float32,
58-
// "Acc Voltage 20(V)": float32,
59-
// "Acc Voltage 21(V)": float32,
60-
// "Acc Voltage 22(V)": float32,
61-
// "Acc Voltage 23(V)": float32,
62-
// "Acc Voltage 24(V)": float32,
63-
// "Acc Voltage 25(V)": float32,
64-
// "Acc Voltage 26(V)": float32,
65-
// "Acc Voltage 27(V)": float32,
66-
// "Acc Voltage 28(V)": float32,
67-
// "Brake Pressure Front(PSI)": float32,
68-
// "Brake Pressure Rear(PSI)": float32,
69-
// "Current to Acc(A)": float32,
70-
// "Hall Effect Sensor - FL(Hz)": float32,
71-
// "Hall Effect Sensor - FR(Hz)": float32,
72-
// "Hall Effect Sensor - RL(Hz)": float32,
73-
// "Hall Effect Sensor - RR(Hz)": float32,
74-
// "Altitude(ft)": float32,
75-
// "Latitude(ft)": float32,
76-
// "Longitude(ft)": float32,
77-
// "Speed(mph)": float32,
78-
// "x acceleration(m/s^2)": float32,
79-
// "y acceleration(m/s^2)": float32,
80-
// "z acceleration(m/s^2)": float32,
81-
// "x gyro(deg)": float32,
82-
// "y gyro(deg)": float32,
83-
// "z gyro(deg)": float32,
84-
// "Suspension Travel - FL(V)": float32,
85-
// "Suspension Travel - FR(V)": float32,
86-
// "Suspension Travel - RL(V)": float32,
87-
// "Suspension Travel - RR(V)": float32,
88-
// "Suspension Force - FL(Oh)": float32,
89-
// "Suspension Force - FR(Oh)": float32,
90-
// "Suspension Force - RL(Oh)": float32,
91-
// "Suspension Force - RR(Oh)": float32,
92-
// "Acc Air Intake Temp(C)": float32,
93-
// "Acc Air Exhaust Temp(C)": float32,
94-
// "Steering(Deg)": float32,
95-
// "Acc Air Intake Pressure(PSI)": float32,
96-
// "Acc Intake Air Flow Rate(m^3/sec)": float32,
97-
// "Timestamp(s)": float32,
98-
// };
10+
9911
export const columnNames = Object.keys(fs3dataSchema) as ColumnName[];
10012

10113
// TODO: This needs to not be hardcoded (along with the rest of the schema!)
102-
export const timeColumnName: ColumnName = ":Time";
14+
export const timeColumnName: ColumnName = "timestamp";
10315

10416
// columnDataTypes and columnNames are for use at runtime; everything with a
10517
// PascalCase name is purely for type-checking at compile time

0 commit comments

Comments
 (0)