Crash on reflectometry simulation for nonsensible values of theta
|Status:||Resolved||Start date:||27 May 2019|
|Priority:||Normal||Due date:||27 May 2019|
|Target version:||Sprint 41|
1. Instrument view: Choose the Specular Instrument; In the Beam Parameters section --> Inclination Angles [deg] --> Min = 0.0, Max = 91 (i.e. a non-sensible value).
2. Sample View: Create any Multilayer sample (I chose the example "Multilayer With Correlated Roughness").
3. Simulation View: Hit "Run Simulation".
4. Jobs View: The figure shows a plot "alpha_i [deg] vs Signal [a.u.]"; hit "Properties" on top of the plot; on the pane that appears at the right, change axes units to q-space or to radians.
5. Don't call it a crash; call it a shortcut for closing the application without being asked whether to save the changes :)
Possible ways to go (in no particular order):
A. Impose that the value inserted in (1) is smaller than 90.
B. Trust that users won't ever set such large values, as they don't make sense anyway.
C. The error thrown is a std::runtime_error; what(): Error in UnitConverter1D: input axis range is out of bounds . Catch it and give feedback to users through a message box.
I'd personally go for A.
- Due date set to 27 May 2019
- Status changed from New to Sprint
- Assignee set to juan
- Target version set to Sprint 41
- Start date changed from 20 May 2019 to 27 May 2019
- % Done changed from 0 to 100
The fix was done following a logic already present inside BornAgain: Let users write any value inside the Instrument View, but do not run the simulation if the values entered do not make sense. Instead, communicate this information in the small bottom left dock inside the Jobs View.
Users are now prevented from feeding non-sensibe min and max values of theta in the GUI.