Skip to content

Conversation

marcus-oscarsson
Copy link
Member

@marcus-oscarsson marcus-oscarsson commented Sep 3, 2025

Moved all remaining beamline routes to the BeamlineAdapter. Ill add a few more details, and do some further cleanup ...

@marcus-oscarsson marcus-oscarsson force-pushed the mo-beamline-route-cleanup branch from 71b4323 to d7276ae Compare September 3, 2025 15:17
@marcus-oscarsson marcus-oscarsson changed the title Moved all remaining beamline routes to BeamlineAdapter [WIP] - Moved all remaining beamline routes to BeamlineAdapter Sep 3, 2025
# so we add it manually here. We give it the id 'beamline'
# so that it can be retrieved by the adapter manager but
# in reality has no id.
self.adapt_hardware_object(HWR.beamline, "beamline")
Copy link
Member Author

Choose a reason for hiding this comment

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

The BeamlineAdapter used to be a sort of special object. Now its a Adapter object like the others. However the beamline HardwareObject is considered special as its the container for all (most) other HardwareObjects. It does not necessarily have to be in this way, but It was a design decision made at the time the Beamline object was introduced. It also means that the Beamline object does not have any id. So we specifically add the Beamline object to the list adapted hardware objects and give the id "beamline" which is alright as far as adapters are concerned.



class _BeamlineAdapter:
class BeamlineAdapter(ActuatorAdapterBase):
Copy link
Member Author

Choose a reason for hiding this comment

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

So the old some what strange custom _BeamlineAdapter object was made into a real Adapter

)

def wf_parameters_needed(self, params):
from mxcubeweb.routes import signals
Copy link
Member Author

Choose a reason for hiding this comment

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

So this will still need some further cleanup, so that we can get rid of this import


if escan:
elements = escan.get_elements()
def prepare_beamline_for_sample(self) -> dict:
Copy link
Member Author

Choose a reason for hiding this comment

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

prepare_beamline_for_sample is now under the BeamlineAdapter, you guys (@fabcor-maxiv, @elmjag) have then to decide what to do with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Related to #1845 ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes, in a way. If you decide to do something with prepare_beamline_for_sample, keep in mind that it changed location, thats what I wanted to say.

@@ -1,11 +1,17 @@
import api from './api';
import { fetchValue, sendExecuteCommand } from './hardware-object';
Copy link
Member Author

Choose a reason for hiding this comment

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

Ill remove this entire file and replace the calls to fetchBeamlineSetup and sendPrepareBeamlineForNewSample with fetchValue and sendExecuteCommand

@marcus-oscarsson marcus-oscarsson force-pushed the mo-beamline-route-cleanup branch 2 times, most recently from ab2e61d to 509b9f3 Compare September 4, 2025 15:04
@marcus-oscarsson marcus-oscarsson changed the title [WIP] - Moved all remaining beamline routes to BeamlineAdapter Moved all remaining beamline routes to BeamlineAdapter Sep 4, 2025
@marcus-oscarsson marcus-oscarsson marked this pull request as ready for review September 4, 2025 15:05
@marcus-oscarsson marcus-oscarsson force-pushed the mo-beamline-route-cleanup branch from 509b9f3 to a562105 Compare September 5, 2025 07:21
@marcus-oscarsson marcus-oscarsson merged commit f2c25df into develop Sep 5, 2025
24 checks passed
@marcus-oscarsson marcus-oscarsson deleted the mo-beamline-route-cleanup branch September 5, 2025 08:15
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