Skip to content

Conversation

marcus-oscarsson
Copy link
Member

Moved all the remaining "diffractometer routes" in /routes to the DiffractometerAdapter

@marcus-oscarsson marcus-oscarsson force-pushed the mo-diff-route-cleanup branch 4 times, most recently from aea916a to d957052 Compare September 1, 2025 13:52
Copy link
Collaborator

@axelboc axelboc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

Comment on lines +357 to 360
await sendExecuteCommand('diffractometer', 'diffractometer', 'set_phase', {
phase,
});
dispatch(setCurrentPhase(phase));
Copy link
Collaborator

@axelboc axelboc Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh just to double check: does sendExecuteCommand resolve to a value — i.e. does the server respond with the updated phase value? If so, it would be best to use that value to update the Redux store.

Or maybe the updated value is sent soon after via a signal and the dispatch is not needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good point. I overlooked the dispatch. sendExecuteCommand can return a value, in the case of set_phase its done via an event (because its a action that can take some time). We should perhaps when you mention it distinguish between the two types, i.e have a sendAsync variant or something ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the moment, I think I will keep things as it is. But Ill think about a pattern or how to better handle/specify values updated by events

Copy link
Collaborator

@axelboc axelboc Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should perhaps when you mention it distinguish between the two types, i.e have a sendAsync variant or something ?

I see, thanks for the clarification! Yeah in that case it might be good, eventually, to have two distinct endpoints for predictability. 💯

@marcus-oscarsson marcus-oscarsson merged commit 112604b into develop Sep 2, 2025
26 checks passed
@marcus-oscarsson marcus-oscarsson deleted the mo-diff-route-cleanup branch September 2, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants