@@ -68,6 +68,8 @@ def __init__(
68
68
self .motion_suffix = "CS:MOT:MOVING"
69
69
self .pre_post_cmd_manager = PrePostCmdManager ()
70
70
self .logger = GenieLogger ()
71
+ self ._sample_par_names_cache = None
72
+ self ._beamline_par_names_cache = None
71
73
72
74
if environment_details is None :
73
75
self ._environment_details = EnvironmentDetails ()
@@ -624,7 +626,11 @@ def set_sample_par(self, name: str, value: "PVValue") -> None:
624
626
name: the name of the parameter to change
625
627
value: the new value
626
628
"""
627
- names = self .blockserver .get_sample_par_names ()
629
+ try :
630
+ names = self .blockserver .get_sample_par_names ()
631
+ self ._sample_par_names_cache = names
632
+ except Exception :
633
+ names = self ._sample_par_names_cache
628
634
if names is not None :
629
635
for n in names :
630
636
m = re .match (".+:SAMPLE:%s" % name .upper (), n )
@@ -648,7 +654,11 @@ def set_beamline_par(self, name: str, value: "PVValue") -> None:
648
654
name: the name of the parameter to change
649
655
value: the new value
650
656
"""
651
- names = self .blockserver .get_beamline_par_names ()
657
+ try :
658
+ names = self .blockserver .get_beamline_par_names ()
659
+ self ._beamline_par_names_cache = names
660
+ except Exception :
661
+ names = self ._beamline_par_names_cache
652
662
if names is not None :
653
663
for n in names :
654
664
m = re .match (".+:BL:%s" % name .upper (), n )
0 commit comments