-
Notifications
You must be signed in to change notification settings - Fork 0
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
Suspension Dash GUI #22
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very sick PR Ahmed !
Couple of requested changes:
- Use new app.callback() arguement prevent_initial_call = True to prevent the callback from firing initially, and remove the workaround we used before
- Very few tiny style changes like consistent line spacing, and one or 2 long lines
- Most importantly, I think we will need a data structure to hold the profile in so that we can access that data when we go to start the test! This could be in a class - all we need is to load the profile (we can already do so) then on start we will have to read all the values in the current input boxes and set them to fields in a class
- The other important thing is exposing the min/max values a little more using constants at the top of the layout file. This is super easy, just use arbitrary values if they aren't in the spec doc, and we will ask any questions you have in a meeting with Nick
Very close to merge worthy!
@@ -1 +1,18 @@ | |||
# Stability dash entrypoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to see top of file comments replaced with a module docstring
import time | ||
|
||
import dash | ||
import dash_bootstrap_components as dbc | ||
import dash_core_components as dcc | ||
import dash_daq as daq | ||
import dash_html_components as html | ||
from dash.dependencies import Input, Output, State | ||
|
||
import stability_dash.callbacks.control_callbacks | ||
from stability_dash.app import app | ||
from stability_dash.layout.control import control_layout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imports look to be in order, nice~!
@@ -0,0 +1,44 @@ | |||
.pad-top { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We (meaning I) am pretty dumb for not laying out these dash apps to all use the same assets folder so we could avoid copy pasting what little custom css we do have
Way she goes
from dash.dependencies import Input, Output, State | ||
from dash.dash import no_update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swap these 2 to maintain alphabetical order of imports
json.dump(profiles_json, profiles_file, indent=4) | ||
|
||
return profile_name | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 lines
|
||
dbc.Row([ | ||
dbc.Col([ | ||
dbc.Card([dbc.Button("EMERGENCY STOP", color="danger", size="lg", block = True, style={"height":"100%","width":"100%"} )]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This row is a little long - maybe stack some of the arguments to button
@@ -0,0 +1,151 @@ | |||
import dash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is super clean, nice job dude
if not delete_clicks: | ||
raise dash.exceptions.PreventUpdate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above comment about the new feature
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be always one space between rows or always 2 spaces, seems like you went with mostly one space so you can just make this one space as well
|
||
dbc.Row([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Min/Max constants for each input at the top of this file.
OR we can add another file like suspension_config.py that includes all these constants and then import it. I kind of like that a little better!
This branch contains the GUI for suspension testing. It prompts entering test parameters and allows saving them as profiles in a JSON file. You can load profiles or delete them. The actual testing logic hasn't been done yet.
Features tested:
Note: some fixes need to be done for layout sizing