Skip to content

Commit

Permalink
ENH: make beamline a list
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Waters committed Jun 11, 2024
1 parent 6b96a04 commit d3da0ed
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
24 changes: 24 additions & 0 deletions demo/db.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,30 @@
"invalid": true,
"functional_group": "Vacuum",
"location_group": "S 2"
},
"TV5L0-VGC-1": {
"_id": "TV1L0-VGC-1",
"active": true,
"args": [],
"beamline": "DEMO_BEAMLINE",
"creation": "Tue Feb 27 10:41:25 2018",
"device_class": "ophyd.sim.SynAxis",
"kwargs": {
"name": "{{name}}"
},
"last_edit": "Thu Apr 12 14:40:08 2018",
"macros": null,
"name": "tv1l0_vgc_1",
"parent": null,
"prefix": "TV1L0-VGC-1",
"screen": null,
"stand": "ST1",
"system": "Device",
"type": "pcdsdevices.happi.containers.LCLSItem",
"z": 1035.5,
"invalid": true,
"functional_group": "Vacuum",
"location_group": "S 3"
}

}
10 changes: 6 additions & 4 deletions lucid/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from ophyd.signal import EpicsSignalBase
from pydm import exception
from qtpy import QtCore, QtWidgets
from typing import Optional, Union

import lucid

Expand Down Expand Up @@ -45,7 +46,8 @@ def get_parser():
parser.add_argument(
'beamline',
help='Specify the beamline name to compose the home screen.',
type=str
type=str,
nargs='+'
)
parser.add_argument(
'--toolbar',
Expand Down Expand Up @@ -103,9 +105,9 @@ def __init__(self, *args, beamline, group_keys, callbacks, **kwargs):
def _load_from_happi(self, row_group_key, col_group_key):
'''Fill with Data from Happi'''
cli = lucid.utils.get_happi_client()
results = (cli.search(beamline=self.beamline,
active=True)
or [])
results = []
for line in self.beamline:
results += cli.search(beamline=line, active=True)

dev_groups = collections.defaultdict(list)

Expand Down

0 comments on commit d3da0ed

Please sign in to comment.