Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pitch roll integration #57

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "dashboard/pages/steeringsuspension/SuspensionSteeringLib"]
path = dashboard/pages/steeringsuspension/SuspensionSteeringLib
url = https://github.com/DallasFormulaRacing/SuspensionSteeringLib
1 change: 1 addition & 0 deletions dashboard/pages/steeringsuspension/SuspensionSteeringLib
Submodule SuspensionSteeringLib added at 703ce7
19 changes: 15 additions & 4 deletions dashboard/pages/steeringsuspension/layout.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
import dash
from dash import html, dcc
import dash_mantine_components as dmc
from ..utils.analytics_page import make_components
from .visualizations.wheel_load import wheel_load_over_time
from .visualizations.pitch_roll import pitch_roll_over_time
from .visualizations.linpot import linpot_over_time

dash.register_page(__name__, path="/suspension", name="Suspension", exact=True)
dash.register_page(__name__, path="/suspensionsteering", name="SuspensionSteering")

layout = dmc.Container([
dmc.Header("Suspension", height=0, className="text-4xl text-center")
])
graphs = {
"SuspensionSteering": {
"Wheel Load over Time": wheel_load_over_time,
"Linpot over Time": linpot_over_time,
"Pitch and Roll over Time": pitch_roll_over_time
}
}

layout = make_components(graphs)
40 changes: 40 additions & 0 deletions dashboard/pages/steeringsuspension/visualizations/linpot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from dash import html, dcc
import dash
import dash_mantine_components as dmc
from dash import callback
from dash.dependencies import Input, Output
import pandas as pd
from ..SuspensionSteeringLib.client import client
from pages.utils.graph_utils import color_seq
import plotly.express as px
import timeit

PAGE = "SuspensionSteering"
VIZ_ID = "linpot-over-time"

linpot_over_time = dmc.Card(
[
dmc.Group(
[
html.H3(
"Linpot vs Time (mm)",
className="card-title",
style={"textAlign": "center"},
),
dcc.Loading(
dcc.Graph(id=f"{PAGE}-{VIZ_ID}"),
),
]
),
],
)


# callback for commits over time graph
@callback(
Output(f"{PAGE}-{VIZ_ID}", "figure"),
Input("time-range", "data")
)
def wheel_load_over_time_graph(_time_range):
clientInstance = client()
return clientInstance.linpot_vs_time_client()
40 changes: 40 additions & 0 deletions dashboard/pages/steeringsuspension/visualizations/pitch_roll.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from dash import html, dcc
import dash
import dash_mantine_components as dmc
from dash import callback
from dash.dependencies import Input, Output
import pandas as pd
from ..SuspensionSteeringLib.client import client
from pages.utils.graph_utils import color_seq
import plotly.express as px
import timeit

PAGE = "SuspensionSteering"
VIZ_ID = "pitch-roll-over-time"

pitch_roll_over_time = dmc.Card(
[
dmc.Group(
[
html.H3(
"Pitch and Roll vs Time (deg)",
className="card-title",
style={"textAlign": "center"},
),
dcc.Loading(
dcc.Graph(id=f"{PAGE}-{VIZ_ID}"),
),
]
),
],
)


# callback for commits over time graph
@callback(
Output(f"{PAGE}-{VIZ_ID}", "figure"),
Input("time-range", "data")
)
def pitch_roll_over_time_graph(_time_range):
clientInstance = client()
return clientInstance.pitch_roll_client()
40 changes: 40 additions & 0 deletions dashboard/pages/steeringsuspension/visualizations/wheel_load.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from dash import html, dcc
import dash
import dash_mantine_components as dmc
from dash import callback
from dash.dependencies import Input, Output
import pandas as pd
from ..SuspensionSteeringLib.client import client
from pages.utils.graph_utils import color_seq
import plotly.express as px
import timeit

PAGE = "SuspensionSteering"
VIZ_ID = "wheel-load-over-time"

wheel_load_over_time = dmc.Card(
[
dmc.Group(
[
html.H3(
"Wheel Load vs Time (lbf)",
className="card-title",
style={"textAlign": "center"},
),
dcc.Loading(
dcc.Graph(id=f"{PAGE}-{VIZ_ID}"),
),
]
),
],
)


# callback for commits over time graph
@callback(
Output(f"{PAGE}-{VIZ_ID}", "figure"),
Input("time-range", "data")
)
def wheel_load_over_time_graph(_time_range):
clientInstance = client()
return clientInstance.wheel_load_client()
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ dash-mantine-components==0.12.1
pandas==2.2.1
dash_iconify==0.1.2
scipy==1.13.0
numpy==1.26.4
numpy==1.26.4