Skip to content
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

[WIP] Prod xaloc rebase #824

Open
wants to merge 206 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
63e28c0
critical bug, reused code of XALOC MXCuBE 2.3 production version
Apr 21, 2022
218b191
state is a pytango devstate type, not a string. Consider stripping th…
Apr 21, 2022
cf317f2
Add TangoAttrValue to events different from attribute
Apr 21, 2022
2839a74
Fix for getRanges() being called on non-positional channel
Apr 21, 2022
3f001ab
attribute values should be read differently for different taurus rele…
Apr 21, 2022
1942cea
_TangoAttribute__attr_config not accepted
Apr 21, 2022
bf88a84
attribute values should be read differently for different taurus rele…
Apr 21, 2022
8c58489
Added error information logging on reading limit values
Apr 21, 2022
8591b26
why have beam and beaminfo hwobj, the information seems duplicated, r…
Apr 21, 2022
0480d20
add incident beam size to assess the minimum beam size at sample
Apr 21, 2022
ab4f2e2
correct names of local attribute _has_been_loaded
Apr 21, 2022
c02b0ee
added pass line to avoid exceptions om method _do_change_mode
Apr 21, 2022
b84a8a1
the Updating contents message is issued in different methods, added t…
Apr 21, 2022
e3fc94c
Fix error in local attribute name of attribute new_sample
Apr 21, 2022
e56ba60
Correct method name in logging message in method do_update_info
Apr 21, 2022
f5a396c
method do_state_action does not exist and doesnt seem to be necessary
Apr 21, 2022
0fd8f53
The basket type should be specified for the SetOnDiff method
Apr 21, 2022
a095b09
NOTINITIALIZED motor state does not exist
Apr 21, 2022
630ced2
strip PyTango DevState. from state to leave only the state string
Apr 21, 2022
6af0618
Removing unnecessary and incorrect state assessment of motor
Apr 21, 2022
4ec79ea
implement dynamic reads of the motor limits. Before, default limit va…
Apr 21, 2022
0052cd6
Resolution has no get_value_at_corner method, implemented an abstract…
Apr 21, 2022
4cd44f7
Reimplement MotorStates, required for rest of code
Apr 21, 2022
bb5723c
Removed requirement for minium of 4 images in online processing, sinc…
Apr 21, 2022
c48b2a1
Fix error that objects does not have an attribute items
Apr 21, 2022
458d293
The queue.Queue() instance doesnt give signals, treading.Queue() does…
Apr 21, 2022
d33a6a7
gevent version assessment does not result in working code, used XALOC…
Apr 21, 2022
df36437
The signal was never sent!! Added the line to send the signal
Apr 21, 2022
e56e15a
correct incorrect call to nonexisting set_value method of XSDataStrin…
Apr 21, 2022
007a4a4
change method name to new convention: online_processing instead of pa…
Jul 19, 2022
2e88344
Change call to getCommandObject to get_command_object
Jul 19, 2022
13f77ed
revert previous bug fixes after updates of the yaml and queue packages
Jul 19, 2022
c81b158
Add configuration files and new XALOC modules
Jul 19, 2022
9e7adb4
major update of the Xaloc MiniDiff module
Jul 19, 2022
36755f3
Update of the XALOC configuration files
Jul 19, 2022
d2f3ce3
Removal of old XALOC modules
Jul 19, 2022
ff32df2
Removal of old XALOC modules
Jul 19, 2022
72f0c6d
Addition of new XALOC modules
Jul 19, 2022
32d2a0f
Deletion of obsolete configuration files
Jul 19, 2022
24bd90d
Addition of new XALOC configuration files
Jul 19, 2022
124329d
Addition of XALOC configuration files
Jul 26, 2022
78f3383
Addition of Xaloc specific sample_view / XalocQtGraphicsManager
Jul 26, 2022
d62f00a
ADd configuration file for XALOC specific sample_view / XalocQtGraphi…
Jul 26, 2022
33b51fc
Remove debug comments
Jul 26, 2022
ff04860
Comment lines referring to minikappa_correction_hwobj, needs future fix
Jul 26, 2022
52bac6c
Improvements in automatic centring procedure, allowing for early abor…
Jul 26, 2022
037cf98
Allow user to specify space group for offline processing, removing un…
Jul 26, 2022
b9dd8c8
Improve logging
Jul 26, 2022
0f37c7f
Imrpove logging 2
Jul 26, 2022
46a98f3
Implementation of XSDataControlDozorv1_0
Jul 26, 2022
0d1326c
Sardana motor fix: incremental positional changes prevented proper em…
Jul 26, 2022
124c671
implementation of Dozor control v1_0, replacement of XSData module by…
Jul 26, 2022
3be99d5
Streamlining method names to allow for single generic calls to all pr…
Jul 26, 2022
ebf358e
Add the collect id to collect parameters for mesh scans before launch…
Jul 26, 2022
6b9048f
First update of modules for GPHL workflows
Jul 26, 2022
4e96a11
corrections to XALOC specific configuration files
Jul 26, 2022
0eb453f
configuration for processing tests
Jul 26, 2022
f04ae6a
small changes related to comments etc. Container change need investig…
Jul 26, 2022
c5fe019
Send signals to update beam parameters in GUI
Jul 26, 2022
4bf6bd3
In manual centring, move zoom to position 1 when a sample is centered…
Jul 26, 2022
b47a39a
Move to mesh center after mesh data collection
Jul 26, 2022
6ed5667
Remove code related to old camera code
Jul 26, 2022
06a6f4d
user Dozor plugin 1_1 for production processing
Jul 26, 2022
cf6b68c
Allow scoring of mesh in chunks
Jul 26, 2022
c6ddb18
textual corrections in comments and logging changes
Jul 26, 2022
b9d3a17
Temporary fix in QtGraphicsLib to allow visualization of mesh scan re…
Jul 26, 2022
2053d1c
removal of configuration files for old camera system
Jul 26, 2022
6e2daef
removal of unused configuration files
Jul 26, 2022
43a8a7f
Setting the production online-processing configuration
Jul 26, 2022
6580aa2
Reimplementation of zoom calibration, fixes in XalocMiniDiff and code…
Jul 28, 2022
a821a8e
Fix in QtGraphicsLib concerning the minimum pixel size of the grid qu…
Jul 28, 2022
93f1247
cleanup of unused and obsolete configuration files
Jul 28, 2022
7384e9e
First implementation of generating a more informative json file requi…
Aug 30, 2022
49bee4f
Bug fixes in the code generating XALOC specific json file with mesh w…
Sep 1, 2022
9d20348
remnant of parallel_processing naming in SimpleHTML removed
Sep 1, 2022
a7f591c
small bug fixes
Sep 11, 2022
09d8fb5
Correct wavelength reads from energy object
Sep 19, 2022
0924c36
No characterization when the data collection fails
Sep 19, 2022
c7290a2
Merge pull request #1 from drboer/wavelength_bug
drboer Sep 19, 2022
c8522a5
print error in user log when diff ready times out
Sep 20, 2022
96e816e
Merge pull request #2 from drboer/improve-errors
drboer Sep 20, 2022
c0d3bf9
Solve bug to allow user to interact with the sample list (dc_tree) af…
Oct 18, 2022
9800a5a
minor improvements in the recovery and error reporting in collect and…
Oct 18, 2022
669b256
Fixed beam size parameters not updated bug
Oct 18, 2022
259a77e
Addition of the ln2shower hardware object
Aug 2, 2022
2153b5d
Addition of default value for the washflow
Aug 2, 2022
a930207
several bug fixes in ln2shower HO code
Oct 18, 2022
869a393
Include timeout in diff phase change and make it more robust, with er…
Oct 18, 2022
1e815a8
introduce is_pumping method in ln2shower HO
Oct 19, 2022
e0e10eb
fix timeout bugs in xaloc minidiff
Oct 19, 2022
3eddaef
add wait_ready function in supervisor
Oct 19, 2022
b891af1
fix operation mode channel bug
Oct 19, 2022
ef57fbc
correction of old method names in fast shutter HO
Oct 24, 2022
9dfd228
Work around to set the transmission of previous value after energy ch…
Oct 24, 2022
83b2fc1
Small bug fixes
Oct 25, 2022
e8d3f32
Update transmission at the end of an energy change. Temporary fix, wa…
Oct 25, 2022
aeb10fe
Merge pull request #3 from drboer/morerobust
drboer Oct 25, 2022
2ec4c43
Merge branch 'production-xaloc' into ln2shower
Oct 25, 2022
5399a4b
Add automated crystal wash when changing sample
Oct 25, 2022
38bb189
read diff phase to decide if shower can be turned on
Oct 25, 2022
b34d850
implement cats recovery when blocked in front of the diffractometer
Oct 27, 2022
ce113b5
add supervisor to ln2shower HO and fix bugs
Oct 27, 2022
d697e04
convert channels to sardana and reorganize the cats configuration
Nov 3, 2022
7852bfd
Bug fixes in Cats HO: improved error messaging, failed put and solve …
Nov 15, 2022
e5c1a2b
Implementation of shower in other HO
Nov 15, 2022
c5cd114
Forced refresh read of transmission after energy change
Nov 15, 2022
b6f37ce
Addition of forced read of channel value in SardanaChannel
Nov 15, 2022
c0a981c
Fix of read of remaining time of top up
Nov 15, 2022
1939c2e
Omega should not be moved to zero after characterization or mesh
Nov 16, 2022
b677883
Merge pull request #4 from drboer/catsrecoverblock
drboer Nov 17, 2022
34b0e11
First approach to implementation of the pick function in the Cats code
Aug 2, 2022
8c416cc
several bug fixes in loading methods for sample changer
Nov 22, 2022
8bb359e
Implementation of finding next sample in ISPyB Client, for use in pick
Nov 22, 2022
35fd868
fixing next sample selection from ISpyB list in HO
Nov 25, 2022
cac014a
add supervisor and ln2shower as beamline objects and reorganize code
Nov 26, 2022
75a79db
Reorganization of code, addition of supervisor and ln2shower to beaml…
Nov 26, 2022
7d60310
Bug fixes in the implementation of the pick function in XalocCats
Dec 2, 2022
5988b95
Fixes in the method that retrieves the next sample to be mounted or p…
Dec 2, 2022
4e0f6ee
Separation of diff and supervisor HO
Dec 2, 2022
024cb20
removal of non-functional beamview phase
Dec 2, 2022
1a16906
Correction of cats DS command name (which itself should be corrected)
Dec 2, 2022
b3bab61
Improve logging
Nov 16, 2022
0567d03
Implement ControlAutoPROC version 1.1
Nov 16, 2022
67e0bb6
Change to sdm production for processing
Nov 16, 2022
9b1d9fd
Temporary change LIMS to ispybtest
Nov 16, 2022
7745cb1
fix anom and no anom for EDBAProc
Nov 22, 2022
4f7ddc3
Add cryostream HO
Jan 16, 2023
3351236
Important bug fix in collect to connect all erors to the data_collect…
Jan 16, 2023
0fa4046
bug fixes in energy to avoid exceptions on startup
Jan 16, 2023
b6491ba
minor edits: todos and error messaging. Connect to ispyb.cells.es now…
Jan 16, 2023
2356c62
Implement strategy runs through ssh
Feb 9, 2023
535a5b0
Reorganize end of collect methods: stop_collect to gracefully finish,…
Feb 9, 2023
b76a46f
Various small fixes:
Feb 9, 2023
4e4e0db
Reimplementation of do_collect to optimize the collect sequence
Feb 9, 2023
c792bcc
Reimplement phases in diff and supervisor and adjust HO accordingly
Feb 9, 2023
75b7780
Remove hardcoded data path name, replace with available variable from…
Feb 9, 2023
6830a6d
improved stop of the online processing
Feb 9, 2023
886dd85
Remove double movement of the detector
Feb 9, 2023
49a5edf
Implement Sardana environment variable updates using collect fields
Feb 9, 2023
53d8839
Select Advanced tab when drawing a grid
Feb 9, 2023
78c6c0b
Only wait for sardana macro to finish in case it properly starts
Feb 9, 2023
fa86a0c
Correction of pixel sizes for different zooms
Feb 9, 2023
aef2c60
Merge branches 'production-xaloc' and '2023feb_bug_fixes' into produc…
Feb 9, 2023
f8ea6c4
Merge pull request #5 from drboer/2023feb_bug_fixes
drboer Feb 9, 2023
2ecd60a
Merge branch 'production-xaloc' of https://github.com/drboer/mxcubeco…
Feb 9, 2023
0e095a7
bug fixes related to data collection aborts in collect
Feb 14, 2023
0c6950b
When flux cannot be read, provide a default flux for characterization
Feb 14, 2023
666b7a0
minor changes in searching for the loop in automatic centering
Feb 14, 2023
0b6d8b5
Merge pull request #6 from drboer/2023feb-bugfixes
drboer Feb 14, 2023
3b17cd7
Fix overloaded beam position method in Pilatus and the related method…
Feb 27, 2023
ec93929
remove debugging messages
isidrocg Feb 27, 2023
6bf4d25
Remove unnecessary lines from sardana
isidrocg Feb 27, 2023
b955874
Extend exposure times in collect
isidrocg Feb 27, 2023
4f734b0
Fix logout & login failure in general code, improve error reporting i…
isidrocg Mar 6, 2023
c41b45a
Add possibility for single step ssh for characterization
isidrocg Mar 6, 2023
dc5b497
Change GUI logging calls
isidrocg Mar 6, 2023
9bc5e86
add possibility for single step ssh for characterization
isidrocg Mar 6, 2023
e4dcfb0
Avoid unnnecessary characterisation errors when collection fails for …
Mar 28, 2023
7edeb08
Implement the resolution hardware object to replace the previous sard…
Mar 28, 2023
12c787f
Increase number of saved logs
Mar 28, 2023
090c2c8
Bug fix in force reading channel parameters for taurus 4 and beyond
Mar 28, 2023
09e4780
Implement pre collection checks to avoid unnnecessary actions when co…
Mar 28, 2023
5b5c05b
Increase front light limit
Mar 28, 2023
cad44ce
Configure resolution xml file to use the Resolution HO instead of a s…
Mar 28, 2023
3963f97
Small bug fixes: logging in characterisation, correct is_ready in res…
Mar 30, 2023
dacee37
Remove unnecessary connect for the wavelength, since energy already t…
Apr 17, 2023
9ff1e18
Set sensible motor threshold values
Apr 17, 2023
c486c3c
Avoid code duplication in transmission code
Apr 17, 2023
d787e22
Add change of limits to the resolution when energy changes
Apr 17, 2023
1f84dea
Add commented lines to be used for code tests of the downstream chara…
Apr 17, 2023
210c9b1
minor bug fixes
Apr 19, 2023
51834d1
Correction of kappa phi motor emit
May 8, 2023
cb4d5c4
Capture not logged in users in collect
May 8, 2023
9c854d7
minor bug fixes: 1) energy motor state emit, 2) graciously end collec…
May 16, 2023
e28230f
Add fast shutter delay to allow opening the fast shutter on time
Jun 1, 2023
675ef49
Update exposure times for the new detector
Jun 1, 2023
95e58c4
Update collect and pilatus detector HO for collections with the new P…
Jun 1, 2023
e44a6b3
Update pilatus configuration file of the new Pilatus 3X detector
Jun 1, 2023
e2d374f
Correct the location of the post-processing files
Jun 1, 2023
2073861
Remove superfluous debugging messages
Jun 1, 2023
c37d7ee
Change ealign when changing the wavelength
Oct 4, 2023
f5facb4
change names of the horizontal and vertical motors for mesh
Oct 4, 2023
39473db
Updates in unused method to run Sardana meshct macro
Oct 4, 2023
f06af4f
Implement change of fast motor in the mesh scan method depending on m…
Oct 4, 2023
3c84cec
Improve speed of mesh and calculate mesh scan parameters based on dir…
Oct 4, 2023
839cf91
Invert the states of the slow shutter and photon shutter to match ALB…
Oct 4, 2023
6165701
Fix confusion in the open and close commands of the front end
Oct 4, 2023
47b0669
Implement data collection on the Pilatus using the camserver DS
Oct 4, 2023
eb9cdde
Adapt the collect HO for data collection using the camserver: wait fo…
Oct 4, 2023
ba9eedb
Follow the images using adxv, remove symlink
Oct 4, 2023
0884f0c
Set the standard collection parameters for the Pilatus3X 100 Hz
Oct 4, 2023
3817591
Update the collect configuration to manage the symlink and image trac…
Oct 4, 2023
65439d7
update the pilatus configuration to collect with camserver and update…
Oct 4, 2023
d5fd99d
Improve logging and monitoring of the CATS state
Oct 4, 2023
74f8386
Improve preliminary checks for collects, monitoring and logging of co…
Oct 4, 2023
dfa3241
Implement proposal specific file saving
Oct 4, 2023
bbb8f38
fix bugs in logging, improve description of errors and remove unneces…
Oct 4, 2023
1359b0f
show sample addresses instead of ids in logging
Oct 4, 2023
f6d7c59
fix bugs in logging
Oct 4, 2023
d474af7
Implement testing when no sample is mounted, various small changes
Oct 4, 2023
fdaf8cd
Implement testing and small bug fixes in online processing
Oct 4, 2023
3702f19
Improve logging
Oct 4, 2023
3a7b04a
sardanize cats HO
Oct 4, 2023
09ee032
Implement testing in HO configuration
Oct 4, 2023
9876edb
Fix names of photon shutter states
Oct 4, 2023
1a915b4
Print error when greenlet exit exception occurs
Oct 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 84 additions & 41 deletions mxcubecore/Command/Sardana.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,10 @@
# from mxcubecore.TaskUtils import task

try:
from sardana.taurus.core.tango.sardana import registerExtensions
from taurus import Device, Attribute
import taurus
from taurus.core.tango.enums import DevState
from taurus.core.tango.tangoattribute import TangoAttrValue
except Exception:
logging.getLogger("HWR").warning("Sardana is not available in this computer.")

Expand Down Expand Up @@ -191,10 +192,16 @@ def __call__(self, *args, **kwargs):
import time

self.t0 = time.time()
if self.doorstate in ["ON", "ALARM"]:
if self.doorstate in [DevState.ON, DevState.ALARM]:
self.door.runMacro(fullcmd.split())
self.macrostate = SardanaMacro.STARTED
self.emit("commandBeginWaitReply", (str(self.name()),))

if wait:
logging.getLogger("HWR").debug("... start waiting...")
t = gevent.spawn(end_of_macro, self)
t.get()
logging.getLogger("HWR").debug("... end waiting...")
else:
logging.getLogger("HWR").error(
"%s. Cannot execute. Door is not READY", str(self.name())
Expand Down Expand Up @@ -226,54 +233,50 @@ def __call__(self, *args, **kwargs):
)
self.emit("commandFailed", (-1, self.name()))

if wait:
logging.getLogger("HWR").debug("... start waiting...")
t = gevent.spawn(end_of_macro, self)
t.get()
logging.getLogger("HWR").debug("... end waiting...")

return

def update(self, event):
data = event.event[2]

try:
if not isinstance(data, PyTango.DeviceAttribute):
if not isinstance(data, PyTango.DeviceAttribute) and \
not isinstance(data, TangoAttrValue):
# Events different than a value changed on attribute. Taurus sends an event with attribute info
# logging.getLogger('HWR').debug("==========. Got an event, but it is not an attribute . it is %s" % type(data))
# logging.getLogger('HWR').debug("doorstate event. type is %s" % str(type(data)))
return

# Handling macro state changed event
doorstate = str(data.value)
logging.getLogger("HWR").debug(
"doorstate changed. it is %s" % str(doorstate)
)
doorstate = data.rvalue
#logging.getLogger("HWR").debug(
#"doorstate changed. it is %s" % str(doorstate)
#)

if doorstate != self.doorstate:
self.doorstate = doorstate

# logging.getLogger('HWR').debug("self.doorstate is %s" % self.canExecute())
self.emit("commandCanExecute", (self.can_execute(),))

if doorstate in ["ON", "ALARM"]:
if doorstate in [DevState.ON, DevState.ALARM]:
# logging.getLogger('HWR').debug("Macroserver ready for commands")
self.emit("commandReady", ())
else:
# logging.getLogger('HWR').debug("Macroserver busy ")
self.emit("commandNotReady", ())

if self.macrostate == SardanaMacro.STARTED and doorstate == "RUNNING":
if self.macrostate == SardanaMacro.STARTED and \
doorstate == DevState.RUNNING:
# logging.getLogger('HWR').debug("Macro server is running")
self.macrostate = SardanaMacro.RUNNING
elif self.macrostate == SardanaMacro.RUNNING and (
doorstate in ["ON", "ALARM"]
elif self.macrostate == SardanaMacro.RUNNING and (\
doorstate in [DevState.ON, DevState.ALARM]
):
logging.getLogger("HWR").debug("Macro execution finished")
self.macrostate = SardanaMacro.DONE
self.result = self.door.result
self.emit("commandReplyArrived", (self.result, str(self.name())))
if doorstate == "ALARM":
if doorstate == DevState.ALARM:
self.emit("commandAborted", (str(self.name()),))
self._reply_arrived_event.set()
elif (
Expand Down Expand Up @@ -412,22 +415,23 @@ def init_device(self):
return

# read information
try:
if taurus.Release.version_info[0] == 3:
ranges = self.attribute.getConfig().getRanges()
if ranges is not None and ranges[0] != "Not specified":
self.info.minval = float(ranges[0])
if ranges is not None and ranges[-1] != "Not specified":
self.info.maxval = float(ranges[-1])
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
minval, maxval = self.attribute.ranges()
self.info.minval = minval.magnitude
self.info.maxval = maxval.magnitude
except Exception:
import traceback

logging.getLogger("HWR").info("info initialized. Cannot get limits")
logging.getLogger("HWR").info("%s" % traceback.format_exc())
if "Position" in str(self.attribute): # RB: quick hack, find a better way to check if this channel is a position channel
try:
if taurus.Release.version_info[0] == 3:
ranges = self.attribute.getConfig().getRanges()
if ranges is not None and ranges[0] != "Not specified":
self.info.minval = float(ranges[0])
if ranges is not None and ranges[-1] != "Not specified":
self.info.maxval = float(ranges[-1])
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
minval, maxval = self.attribute.getRanges()
self.info.minval = minval.magnitude
self.info.maxval = maxval.magnitude
except Exception:
import traceback

logging.getLogger("HWR").info("info initialized for Sardana channel %s. Cannot get limits" % self.model)
logging.getLogger("HWR").info("%s" % traceback.format_exc())

# prepare polling
# if the polling value is a number set it as the taurus polling period
Expand All @@ -441,26 +445,58 @@ def init_device(self):
def get_value(self):
return self._read_value()

def force_get_value(self):
return self._force_read_value()

def set_value(self, new_value):
self._write_value(new_value)

def _write_value(self, new_value):
self.attribute.write(new_value)

#TODO improve this: the magnitude is probably only available for certain channels, and the rvalue for others
# Instead of an exception, an if statement should decide which read method is to be applied,
# and a proper exception should be issued when necessary
def _read_value(self):
value = self.attribute.read().value
value = None
if taurus.Release.version_info[0] == 3:
value = self.attribute.read().value
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
try:
magnitude = getattr(self.attribute.rvalue, 'magnitude')
value = magnitude
except Exception:
value = self.attribute.rvalue
return value

def _force_read_value(self):
value = None
if taurus.Release.version_info[0] == 3: # not sure if this works in versions of taurus 3 and below
value = self.attribute.read(cache=False).value
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
try:
value = getattr(self.attribute.read(cache=False).rvalue, 'magnitude')
except Exception:
value = self.attribute.rvalue

return value

def get_info(self):
try:
b = dir(self.attribute)
(
self.info.minval,
self.info.maxval,
) = self.attribute._TangoAttribute__attr_config.get_limits()
if taurus.Release.version_info[0] == 3:
ranges = self.attribute.getConfig().getRanges()
if ranges is not None and ranges[0] != "Not specified":
self.info.min_val = float(ranges[0])
if ranges is not None and ranges[-1] != "Not specified":
self.info.max_val = float(ranges[-1])
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
range = getattr(self.attribute, 'range')
self.info.min_val = range[0].magnitude
self.info.max_val = range[1].magnitude
except Exception:
import traceback

logging.getLogger("HWR").info("info initialized. Cannot get limits")
logging.getLogger("HWR").info("%s" % traceback.format_exc())
return self.info

Expand All @@ -469,7 +505,14 @@ def update(self, event):
data = event.event[2]

try:
new_value = data.value
new_value = None
if taurus.Release.version_info[0] == 3:
new_value = data.value
elif taurus.Release.version_info[0] > 3: # taurus 4 and beyond
try:
new_value = data.rvalue.magnitude
except Exception:
new_value = data.rvalue

if new_value is None:
new_value = self.get_value()
Expand Down
5 changes: 1 addition & 4 deletions mxcubecore/Command/Tango.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ class TangoChannel(ChannelObject):
_tangoEventsQueue = queue.Queue()
_eventReceivers = {}

if gevent_version < [1, 3, 0]:
_tangoEventsProcessingTimer = getattr(gevent.get_hub().loop, "async")()
else:
_tangoEventsProcessingTimer = gevent.get_hub().loop.async_()
_tangoEventsProcessingTimer = gevent.get_hub().loop.async()

# start Tango events processing timer
_tangoEventsProcessingTimer.start(process_tango_events)
Expand Down
4 changes: 4 additions & 0 deletions mxcubecore/CommandContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def connect_signal(self, signalName, callableFunc):
except Exception:
pass
dispatcher.connect(callableFunc, signalName, self)
# RB: do not commit
# The cats_simple_brick doesnt receive the powered signal,
# the following line fixes that, but a better solution needs to be found.
self.emit(signalName, self.get_value())

def disconnect_signal(self, signalName, callableFunc):
try:
Expand Down
Loading