Conversation
1e74922 to
c2471c3
Compare
Create a static schema representing a response from a blueapi server using only the count plan. Generate a JSON form to fill in parameters for the count plan.
0626ce3 to
4d526d7
Compare
src/components/PlanSelector.tsx
Outdated
| <Select | ||
| defaultValue={""} | ||
| onChange={event => { | ||
| const i = event.target.value as unknown as number; |
There was a problem hiding this comment.
I really hope there is a better way to do this
There was a problem hiding this comment.
parseInt(event.target.value) would work
douglaswinter
left a comment
There was a problem hiding this comment.
It does the thing
There was a problem hiding this comment.
Not part of this PR but we should be using pnpm (according to UI policy) unless there's a good reason not to in this case.
src/components/PlanSelector.tsx
Outdated
| <Select | ||
| defaultValue={""} | ||
| onChange={event => { | ||
| const i = event.target.value as unknown as number; |
There was a problem hiding this comment.
parseInt(event.target.value) would work
src/utils/api.ts
Outdated
| } | ||
|
|
||
| export async function getPlans(): Promise<PlansResponse> { | ||
| const url = "http://localhost:8000/plans"; |
There was a problem hiding this comment.
These and the mocked endpoints could be b01-1-blueapi.diamond.ac.uk no?
There was a problem hiding this comment.
Yes, I guess I should be using some similar config to this? https://github.com/DiamondLightSource/logpanel/blob/7b7c5853c46618e6e3e46b2f54685f66e68afa2f/vite.config.ts#L10
| return ( | ||
| <div> | ||
| <h3>Available Plans</h3> | ||
| <Select |
There was a problem hiding this comment.
Fine for now. Going forward we need to decide what this UI really is. If it is a generic plan runner (which it currently wants to be), then this is probably not the correct component (would not be very usable with 12 plans) - maybe a scrollable list view and to the right the form for the selected plan. However the UI for this project should probably mapping-like.
There was a problem hiding this comment.
My $0.02 is that we'd end up with two "views", a rough JSONForms one which is mainly used for engineering, commissioning, plan dev and a more polished, custom-built mapping style UI for user facing experiments. Would also be a good vehicle for comparing the generated and artisan approaches.
|
|
||
| return ( | ||
| <div> | ||
| <h3>Available Plans</h3> |
There was a problem hiding this comment.
we'll probably want to replace all raw html with mui in future iterations
|
@GDYendell the red box is the "delay" parameter, I'm not sure why it is isn't labelled. The type annotation allows the delay to either be a scalar float (global delay) or a list of floats (per-scan-point delay). I don't think JSONForms has done too well with this, emphasizing @douglaswinter's point that JSONForms won't be good for everything, especially building clean user-facing GUIs. The metadata can be an arbitrary dictionary of key-value pairs and JSONForms doesn't seem to have a renderer for that, we could write one: A textfield where you just type raw JSON. To get this working with that we have we need to address the issues in the PR description and work out why I had to re-order the scanspec schema definition (next on my list is writing an issue about this). |
|
@GDYendell made a simplest-possible reproduction of the scanspec issue and raised a bug on JSONForms, see PR description. |
Create a dropdown menu for selecting a plan, populate using a mocked call to blueapi using mockserviceworker. Edit mocked output assuming that the following have been fixed: - DiamondLightSource/blueapi#1129 - DiamondLightSource/blueapi#1123 - DiamondLightSource/blueapi#1124 And reorder the scanspec schema so that its self-referential components can be detected in a single pass.
Get the button to trigger a plan on blueapi, no feedback yet. Add an instrument session field since that is a requirement for blueapi.
4d526d7 to
9a980e8
Compare

Create initial GUI with:
Use mockserviceworker to mock blueapi output, including assuming that the following issues are fixed:
oneOfdefs eclipsesource/jsonforms#2469