Ticket #9170 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Refl_gui Improvements - Fix 'Stopped Working' error on Mantid Exit

Reported by: Keith Brown Owned by: Keith Brown
Priority: major Milestone: Release 3.2
Component: Reflectometry Keywords:
Cc: Blocked By: #9039
Blocking: Tester: Martyn Gigg

Description

If the Reflectometry GUI is open and the Mantid main window is closed, the Reflectometry gui doesn't close automatically and a standard windows "MantidPlot has stopped working" error is displayed.

This doesn't happen in other python interfaces like ORNL SANS, find out what it's doing right and implement it on the Reflectometry Gui

Change History

comment:1 Changed 7 years ago by Martyn Gigg

  • Status changed from new to assigned

comment:2 Changed 7 years ago by Keith Brown

  • Status changed from assigned to inprogress

Refs #9170 Restructured Reflectometry Interface

The interface now follows the same pattern as the ORNL SANS interface for declaration. The ReflGui class is now the window itself, this means it recieves the close signal from the mantid main window and can override some things within itself.

Tidied up the connections, as there was no need for most of the handlers.

Renamed most of the methods to they follow python's style more closely.

Added more whitespace

Changeset: 6ec8c8eba69dbedab935982a73919c7b0dd5e133

comment:3 Changed 7 years ago by Keith Brown

  • Blocked By 9039 added

(In #9039) #9170 was had some big changes, so I need to be able to merge this in before i can put this up for testing

comment:4 Changed 7 years ago by Keith Brown

Martyn said (in #9043):

I think the code in Interface/ui/reflectometer/refl_gui.py could use a little tidy up though. A few things:

  • There are no spaces between any of the method definitions
  • There are virtually no comments and any commenting seems to be done with Python docstrings rather than the comment character #. The proper place for docstrings is immediately after the def line and the standard is to use double quotes, i.e.
        def on_comboPolarCorr_activated(self):
        """
            Event handler for polarisation correction selection.
        """
            if self.current_instrument in self.polarisation_instruments:
                chosen_method = self.comboPolarCorrect.currentText()
                self.current_polarisation_method =  self.polarisation_options[chosen_method]
            else:
                logger.notice("Polarisation correction is not supported on " +
    str(self.current_instrument))
    
    rather than what is currently on line 88.
  • There seems to be a lot of hard-coded numbers dotted over the code that refer to column indexes. Can these be factored out to separate constants so that the information is in a single place.
  • Both the copy_cells & paste_cells methods are quite long, can they be split up easily?

comment:5 Changed 7 years ago by Keith Brown

Refs #9170 fixed a typo and added a rethrow

An except wan't rethrowing when it should have, so i made it rethrow

there was a typo on one of the renamed methods

Changeset: 0faba5147be4c120ac1f666f0e0fb53731d7db86

comment:6 Changed 7 years ago by Keith Brown

Refs #9170 Merge master in to add other recent features

Merges changes from #9039 and #9043, tehy still need refactored for the new gui style though.

Merge remote-tracking branch 'origin/master' into bugfix/9170_Refl_stopped_working_error

Conflicts:

Code/Mantid/scripts/Interface/ui/reflectometer/refl_gui.py

Changeset: 784cd5e143ec3ec70676f0000e8e9e73e9760bc7

comment:7 Changed 7 years ago by Keith Brown

Refs #9170 More refactoring and tidying

The merged changes have been updated to be consistant in terms of connections and naming conventions

White space has been imporved

Existing docstrings have been updated to double quotes rather than single and have been moved to the proper place below Def. Some docstrings have been changed to comments

Some initialisations have been moved to the constructor

Changeset: b71aff13def77a59bbe01119eb1b09ee155be8ec

comment:8 Changed 7 years ago by Keith Brown

Refs #9170 Added Docstrings to all methods

All methods now have a docstring in the right place

Changeset: cf804d79ef5050fd3e6affcb0e087fc784c7f54c

comment:9 Changed 7 years ago by Keith Brown

Refs #9170 Factored out numbers and renamed variables

There were a lot of column indexes used as constants, they've been factored out into member variables

A few varaibles have been renamed as they didn't follow pyhton style

Changeset: d92444ebcecc236658aa7ae566527e4def945f14

comment:10 Changed 7 years ago by Keith Brown

Refs #9170 Fixed typos and missed connection

The choose columns button on the interface missing a connection

There were a couple of variables with typos after the refactor.

Changeset: b64e1aa84c96bd210385500d95e72622cf281dbd

comment:11 Changed 7 years ago by Keith Brown

  • Status changed from inprogress to verify
  • Resolution set to fixed

To tester:

I have created a new, temporary wiki page for this version of the gui to assist in testing this ticket. Follow all the instructions on it, noting any discrepancies.

http://www.mantidproject.org/Testing_Next_Reflectometry_GUI

The main change this was supposed to fix was that closing the mantid main window caused an error to appear, at least on windows, make sure this no longer appears.

comment:12 Changed 7 years ago by Keith Brown

refs #9170 merge conflict with develop

Merge branch 'bugfix/9170_Refl_stopped_working_error' into develop

Conflicts:

Code/Mantid/scripts/Interface/ui/reflectometer/refl_gui.py

Changeset: 6e30c568abb5ac844ddd82b0f4b37a647bef0b35

comment:13 Changed 7 years ago by Martyn Gigg

  • Status changed from verify to closed

Merge remote-tracking branch 'origin/bugfix/9170_Refl_stopped_working_error'

Full changeset: 8a539f906222c61d8d480d4a29e36deba80556ea

comment:14 Changed 7 years ago by Martyn Gigg

  • Tester set to Martyn Gigg

comment:15 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10015

Note: See TracTickets for help on using tickets.