Ticket #262 (closed: fixed)

Opened 12 years ago

Last modified 5 years ago

Create dynamic property validators

Reported by: Russell Taylor Owned by: Janik Zikovsky
Priority: minor Milestone: Iteration 30
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Martyn Gigg

Description

At present, the NormaliseToMonitor algorithm requires that you enter the spectrum number relating to the monitor you wish to use. It would be much nicer, particularly when using MantidPlot, to give the name of the monitor instead. But this isn't known until the input workspace has been set, so we would need to find a way in which the setting of the input workspace fired an event that the monitor property could catch and update itself.

Change History

comment:1 Changed 12 years ago by Nick Draper

  • Milestone changed from Iteration 13 to Iteration 14

comment:2 Changed 12 years ago by Nick Draper

  • Milestone changed from Iteration 14 to Iteration 15

comment:3 Changed 12 years ago by Nick Draper

  • Milestone changed from Iteration 15 to Iteration 16

Batch move uncompleted tickes to next iteration

comment:4 Changed 11 years ago by Nick Draper

  • Milestone changed from Iteration 16 to Unassigned

comment:5 Changed 9 years ago by Janik Zikovsky

  • Owner changed from Russell Taylor to Janik Zikovsky
  • Status changed from new to accepted
  • Component set to Mantid

comment:6 Changed 9 years ago by Janik Zikovsky

Hello all,

I have a suggestion concerning the algorithm's auto-generated GUIs: it would be nice to implement a few extra methods (on either Algorithm or IPropertyManager) so as to support more sophisticated auto-generated GUIs. It would be used to:

  • Hide or disable a property based on the current setting on another property. For example:
    • Show some properties only when a checkbox is checked (or unchecked)
    • Show some properties only when another property's value is/ is NOT the default.
  • Group some properties together, so that they are rendered inside a QGroupBox with a name.
  • If an algorithm has 2+ ways to specify a single value (e.g. LoadCalFile has 3 ways to choose an instrument) it might show each option as a radio button and only allow one to be filled at a time.

I would probably want the methods to be relatively simple, e.g.:

alg->setPropertyEnabledWhen("ThisPropertyName", "BoolPropertyName", IS_CHECKED); alg->setPropertyVisibleWhen("ThisPropertyName", "IntPropertyName", IS_NOT_DEFAULT_VALUE); alg->addPropertyToGroup("ThisPropertyName", "Name of My group"); alg->makeGroupRadioButtons("Name of My group");

I wouldn't want the system to grow into a full-fledged GUI writing toolkit so I think these 3 situations would handle most of the GUI improvements most algorithms would need to greatly increase usability. Not having to make as many custom widgets will make it much easier to maintain these algorithms. Anything more complicated would still need a custom GUI.

Comments?

Sincerely,

Janik Zikovsky

comment:7 Changed 9 years ago by Janik Zikovsky

In [14231]:

Refs #262: Created a more generic CompositeValidator and renamed the old CompositeValidator to CompositeWorkspaceValidator. Added some methods to IValidator for future enabled/visible choice.

comment:8 Changed 9 years ago by Janik Zikovsky

In [14238]:

Refs #262: added a validator that disables a property based on another property's value.

comment:9 Changed 9 years ago by Janik Zikovsky

In [14239]:

Refs #262: Validator to make a property not visible

comment:10 Changed 9 years ago by Janik Zikovsky

In [14253]:

Refs #262: Moved the new validators to a separate class that better reflects what they do. New method on algorithms setPropertySettings() to give an IPropertySettings to a given property. This allows you to make properties be hidden/disabled based on other properties.

comment:11 Changed 9 years ago by Janik Zikovsky

In [14254]:

Refs #262: Forgot 2 files

comment:12 Changed 9 years ago by Janik Zikovsky

In [14261]:

Refs #262: Make properties top-justified if some are hidden.

comment:13 Changed 9 years ago by Janik Zikovsky

In [14264]:

Refs #262: Show groups in the auto-generated GUI.

comment:14 Changed 9 years ago by Janik Zikovsky

In [14266]:

Refs #262: Groups of properties are set in separate boxes.

comment:15 Changed 9 years ago by Janik Zikovsky

In [14268]:

Refs #262: Used the new grouping and dynamic guis in a couple of algorithms

comment:16 Changed 9 years ago by Janik Zikovsky

In [14302]:

Refs #262: Fix custom Load dialog crash.

comment:17 Changed 9 years ago by Nick Draper

  • Milestone changed from Unassigned to Iteration 30

comment:18 Changed 9 years ago by Janik Zikovsky

Problem: Validator seems to only fail the FIRST bad property upon start-up and when clicking Run.

Also: Look for bad scrollbar choice when the algo has hidden entries.

Also: space out the title of a group more for windows

Last edited 9 years ago by Janik Zikovsky (previous) (diff)

comment:19 Changed 9 years ago by Janik Zikovsky

In [14366]:

Refs #262: Algo gui try to fix scrollbars.

comment:20 Changed 9 years ago by Janik Zikovsky

In [14388]:

Refs #262: Don't resize window

comment:21 Changed 9 years ago by Janik Zikovsky

In [14391]:

Refs #262: Fix scrollbar on mac

comment:22 Changed 9 years ago by Janik Zikovsky

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

In [14392]:

Fixes #262: Compiler was too clever for my own good. Validators now show up correctly if more than one property is failing.

comment:23 Changed 9 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:24 Changed 9 years ago by Martyn Gigg

  • Status changed from verifying to closed

Confirmed functionality that is currently used in LoadMD and BinToMDHistoWorkspace. Controls seem to be enabled/disabled correctly depending on other values.

I'm not sure this actually addresses the original ticket issue though so I've created another, #3763.

comment:25 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 1110

Note: See TracTickets for help on using tickets.