mantid
mantid copied to clipboard
Apply settings from the Preview tab to the batch
trafficstars
The Apply button needs to be implemented on the Preview tab. This will take the selected ROIs from the sliceviewer image and apply them to the lookup table on the Experiment Settings tab.
They should be applied to the appropriate row with a matching angle in the lookup table if one is found (this could be the wildcard row if an exact match is not found).
- [x] #34247
- [x] Notify the batch presenter when the apply button is pressed https://github.com/mantidproject/mantid/pull/34261
- [x] The batch presenter should get the ROIs and angle from the Preview tab and notify down to the Experiment presenter to update the table. https://github.com/mantidproject/mantid/pull/34261
- [x] The Experiment presenter should update the lookup row in its model then call
updateViewFromModel. Updating the model might be a little tricky and there are a number of ways it could be done:- Note that
findLookupRowcurrently returns a copy. It could be changed to return a reference so we can update it directly, but it could be tricky to ensure they get passed through all layers correctly (i.e. no accidental copies). - Alternatively we could update the copied row and add a method
LookupTable::addOrReplacefor example which could overwrite it if an existing LookupRow exists with the same angle and titleMatcher (or append a new LookupRow if none exists). We could potentially changeoperator==on the LookupRow to only consider rows equal if angle and titleMatcher are the same; those are the critical criteria in establishing if a row is unique. I thinkoperator==is currently only used in the tests (which we'd need to workaround but that's fine). However, I'm not 100% sure, so this should be done with care. - There is also a
getIndexmethod so we could simply get the index of the found row and use that to add methods to update a lookup row by index. This might be the easiest thing to get working but may make things a little confusing for the calling function. https://github.com/mantidproject/mantid/pull/34261
- Note that
- [x] If a matching lookup row is not found, pop up a help message e.g.
Could not update Experiment Settings: there is no row matching angle <value> in the Lookup Table. Please add a row for this angle, add a wildcard row, or change the angle.https://github.com/mantidproject/mantid/pull/34261