ISISComputingGroup / IBEX

Top level repository for IBEX stories
5 stars 2 forks source link

Reflectometry IOC: Exception handling #3555

Closed ThomasLohnert closed 4 years ago

ThomasLohnert commented 6 years ago

As a user of reflectometers, I would like the reflectometry server to handle exceptions more robustly. Perhaps the reflectometry server should have top-level exception handling that prints/logs the error rather than just dying. We should also deal with stall conditions. E.g. If an exception is thrown or a stall happens all motors need to stop.

Acceptance Criteria

  1. High level exception catcher logs and display to user
  2. Central Error handler to set server status and message (move clears error status)
  3. Current thrown exception are either caught and handled or logged to central
  4. log.errors should be logged to central service and shown to the user through the OPI
ThomasLohnert commented 5 years ago

As part of this we should have a class that checks the validity of a read beamline config file, against conditions such as

and provides clear feedback in case of an invalid config.

Create ticket for this move after MVP we don't expect users to do this.

Alistair-McGann-Tessella commented 5 years ago

Ensure if a monitor can not be placed on a pv then the pv is placed into alarm and the montior is connected when it comes online.

John-Holt-Tessella commented 5 years ago

SAme with motor reolution, if the galil isn't there in startup then it is polled everytime and the motor is in error

ThomasLohnert commented 5 years ago

Things to do as part of this ticket (list might be expanded):

John-Holt-Tessella commented 4 years ago

Check it deals with:

Traceback (most recent call last):
  File "C:\Instrument\Apps\Python\lib\site-packages\pcaspy\driver.py", line 631, in getValue
    newValue = driver.read(self.info.reason)
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\ChannelAccess\reflectometry_driver.py", line 91, in read
    value = param_sort.get_from_parameter(param)
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\ChannelAccess\pv_manager.py", line 203, in get_from_parameter
    return convert_to_epics_pv_value(parameter.parameter_type, parameter.rbv)
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\parameters.py", line 193, in rbv
    return self._rbv()
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\parameters.py", line 554, in _rbv
    return self._component.beam_path_rbv.get_position_relative_to_beam()
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\beam_path_calc.py", line 159, in get_position_relative_to_beam
    self._theta_incoming_beam_if_set_else_incoming_beam())
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\movement_strategy.py", line 156, in get_distance_relative_to_beam
    return self._displacement - self._dist_along_axis_from_zero_to_beam_intercept(beam)
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\movement_strategy.py", line 103, in _dist_along_axis_from_zero_to_beam_intercept
    beam_intercept = self.calculate_interception(beam)
  File "C:\Instrument\Apps\EPICS\ISIS\inst_servers\master\ReflectometryServer\movement_strategy.py", line 38, in calculate_interception
    assert beam is not None

It doesn't might e easy to make this harder, @John-Holt-Tessella will investigate briefly

ThomasLohnert commented 4 years ago

PRs: https://github.com/ISISComputingGroup/EPICS-inst_servers/pull/274 https://github.com/ISISComputingGroup/ibex_gui/pull/1082 https://github.com/ISISComputingGroup/EPICS-IOC_Test_Framework/pull/303