Ticket #7874 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Muon: replace signals/slots with Python code

Reported by: Arturs Bekasovs Owned by: Arturs Bekasovs
Priority: minor Milestone: Release 3.0
Component: Muon Keywords:
Cc: Blocked By: #5116
Blocking: #7887 Tester: Anders Markvardsen

Description (last modified by Arturs Bekasovs) (diff)

UserSubWindow contains some signals which are exclusively used for Muon Analysis and which could be implemented using Python API for GUI. Removing them and using Python instead would help to clean-up UserSubWindow and add more flexibility, e.g. in Python code we can show the plot only if it's not being shown already and etc.

List of signals:

  • hideToolbars/showToolbars - methods for doing that should be exposed to Python API.
  • setAsPlotType - implementable, possibly with some adjustments to API
  • closeGraph, hideGraphs, showGraphs - easily implementable
  • fittingRequested - there is already a Python function selectMultiPeak
  • setFitFunctionBrowser - pretty back-end thing, hence leave as it is

Change History

comment:1 Changed 7 years ago by Arturs Bekasovs

  • Description modified (diff)

comment:2 Changed 7 years ago by Arturs Bekasovs

  • Status changed from new to inprogress

Added a function to change toolbar visibility state to the Python API.

Merged showToolbars and hideToolbars into one for simplicity.

Refs #7874

Changeset: b2acd07dbf74bfc3c1d3306e37d46977bc031ae2

comment:3 Changed 7 years ago by Arturs Bekasovs

Made Muon Analysis use new Python API function to show/hide toolbars.

Refs #7874

Changeset: b6b7fd970873c5ff96a6f5b4442da1ac52af3574

comment:4 Changed 7 years ago by Arturs Bekasovs

Apply plot style using Python.

Moved function for Parsing plot style to appropriate tab class and updated it.

Refs #7874

Changeset: 6b3dcdb5efeae2cdfaa3cad9c72d63599e023300

comment:5 Changed 7 years ago by Arturs Bekasovs

Plot error bars all the time.

Refs #7874

Changeset: 60cdbdc0167a6682890de66bdaba9120b76b43da

comment:6 Changed 7 years ago by Arturs Bekasovs

Make setPlotStyle accept wsName and add -1 itself.

A better approach would be to search for all the plots with such object name, as it gets set in plotSpectrum.

Refs #7874

Changeset: aa82dc47b10c1a70ba6cbf703cb9de284504a6f7

comment:7 Changed 7 years ago by Arturs Bekasovs

Moved the code for setting Y axis scale to style function.

Created another one for pre-processing style parameters and setting default values if something is not specified.

Refs #7874

Changeset: 99bea026cdc92efaab88b98e711d462d23912cfd

comment:8 Changed 7 years ago by Arturs Bekasovs

Build QString instead of stringstream for Python code.

Refs #7874

Changeset: 85bea78c53d39198a3e549e93f13a577a3d3ded2

comment:9 Changed 7 years ago by Arturs Bekasovs

Removed slots/signal which were replaced by Python code.

These were used by Muon Analysis only.

Refs #7874

Changeset: 1daee2422f5b4a4dc4cd00554418b7f29ca6ec9d

comment:10 Changed 7 years ago by Arturs Bekasovs

New inherits method for the proxy.

Helps to determine if the MDIWindow is of the desired type.

Refs #7874

Changeset: 1a4dc9ab7d05808f13ce6599dfda057e1f0900b0

comment:11 Changed 7 years ago by Arturs Bekasovs

Refactored setPlotStyle to make resulting Python code simplier.

Plus updated documentation.

Refs #7874

Changeset: c9b1cdf8936cd2af98e0244404762a2dc5ee4800

comment:12 Changed 7 years ago by Arturs Bekasovs

Add function to close plot window.

Removed the signal used to do that previously.

Refs #7874

Changeset: 916f71809391e6df421c796ca83617bce13619fb

comment:13 Changed 7 years ago by Arturs Bekasovs

Created function to hide all plot windows.

Removed signals/slots used to do that previously.

Refs #7874

Changeset: ffc16f1dd8daf75dab71476a22c0038b3d27e541

comment:14 Changed 7 years ago by Arturs Bekasovs

Added function to show all the plot windows.

Removed signals/slots used to do that before.

Refs #7874

Changeset: 889b761b2477bf8db01c1945d538fec39041a20a

comment:15 Changed 7 years ago by Arturs Bekasovs

  • Blocked By 5116 added

Need #5116 changes from to get here so setFitFunctionBrowser appears, and I no longer need to specify Fit Browser for fittingRequested and can use selectMultiPeak from Python. So pausing with this one till it happens.

comment:16 Changed 7 years ago by Arturs Bekasovs

  • Blocking 7887 added

comment:17 Changed 7 years ago by Arturs Bekasovs

While doing another ticket, a problem was revealed - if ws name contains "_" characters, they will get replaces by "-" which means that window title will not match ws name.

So we need to search for graphs by objectName which is set in plotSpectrum, which might require adding another method redirection to Python proxy class.

comment:18 Changed 7 years ago by Arturs Bekasovs

  • Milestone changed from Backlog to Release 3.0

comment:19 Changed 7 years ago by Arturs Bekasovs

Merge remote-tracking branch 'origin/master' into feature/7874_muon_remove_signals

Conflicts:

Code/Mantid/MantidPlot/src/ApplicationWindow.cpp Code/Mantid/MantidQt/API/inc/MantidQtAPI/UserSubWindow.h Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysis.cpp

Refs #7874

Changeset: d841ecd01f0141fb70d2ebbf849ddbedc3c94694

comment:20 Changed 7 years ago by Arturs Bekasovs

Search by objectName is not possible, as it is set for proxy object, which gets recreated every time, but the objectName of Graph object is used to store the title ("wsName-[number]"). So leave as it is for now.

comment:21 Changed 7 years ago by Arturs Bekasovs

Expose function to disable all tools fro all graphs to Python.

Refs #7874

Changeset: 81979216a37b0f74b44f2c22bfc40b7832b7d6fe

comment:22 Changed 7 years ago by Arturs Bekasovs

Use Python selectMultiPeak function instead of signal.

Search for "emit" shows that the only signal left emmited is setFitPropertyBrowser.

Refs #7874

Changeset: acb784b131f8a4a6a6048e4fc9d4b5b39da26a6a

comment:23 Changed 7 years ago by Arturs Bekasovs

Fix a merge error.

Refs #7874

Changeset: c87605cec258bcd56693d37c7f1e79f332b7f03e

comment:24 Changed 7 years ago by Arturs Bekasovs

Remove signals/slot used to attach PP tool before.

Refs #7874

Changeset: b81137945dfad2d1b7aded86ffebe71326a25ac5

comment:25 Changed 7 years ago by Arturs Bekasovs

Don't connect setFitFunctionBrowser for MuonAnalysis only.

If that's available for all the UserSubWindows, then make it possible for all of them to use it.

Refs #7874

Changeset: d121395dbd80e81c88812cd0f9b856fdd5ac52f1

comment:26 Changed 7 years ago by Arturs Bekasovs

Remove redundant method.

There is already a name() to get the name of the interface.

Refs #7874

Changeset: 08db328aeec87844a3ed08cea0fe8360a0c11db4

comment:27 Changed 7 years ago by Arturs Bekasovs

Tester:

Should be somebody familiar with the Muon Analysis interface.

In this ticket I've not changed any logic, just the way things are done, so the overall testing goal is to make sure that everything works in the same way as it was. In particular, please test the following things:

  1. Hide/show toolbars checkbox remained functional. [Un-]checking it shows/hides toolbars. When is checked: toolbars should get hidden when interface starts, and get shown when interface gets closed. When graph window is activated toolbars might appear but switching tabs in MuonAnalysis should hide them again if toolbar hiding is enabled.
  2. Plot styling: you should be able to change the type of line, Y-axis scale (inc. autoscaling) and whether to show error bars.
  3. Hide previous graphs checkbox. If checked, when plot a new graph, previous ones should get hidden. When it gets unchecked, previous graphs should get shown.
  4. When rewrite option is enabled, only single graph is plotted - i.e. previous plot is closed before plotting a new one.
  5. PP tool gets assigned when you go to Data Analysis tab, and is deleted when you leave it or close the interface.

comment:28 Changed 7 years ago by Arturs Bekasovs

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

comment:29 Changed 7 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:30 Changed 7 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/7874_muon_remove_signals'

comment:31 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8719

Note: See TracTickets for help on using tickets.