-
Notifications
You must be signed in to change notification settings - Fork 44
Moved all remaining beamline routes to BeamlineAdapter #1859
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
Conversation
71b4323
to
d7276ae
Compare
# 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") |
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.
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): |
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.
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 |
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.
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: |
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.
prepare_beamline_for_sample
is now under the BeamlineAdapter
, you guys (@fabcor-maxiv, @elmjag) have then to decide what to do with it.
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.
Related to #1845 ?
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.
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.
ui/src/api/beamline.js
Outdated
@@ -1,11 +1,17 @@ | |||
import api from './api'; | |||
import { fetchValue, sendExecuteCommand } from './hardware-object'; |
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.
Ill remove this entire file and replace the calls to fetchBeamlineSetup
and sendPrepareBeamlineForNewSample
with fetchValue
and sendExecuteCommand
ab2e61d
to
509b9f3
Compare
509b9f3
to
a562105
Compare
Moved all remaining beamline routes to the
BeamlineAdapter
. Ill add a few more details, and do some further cleanup ...