All materials should map to Nanometers as the canonical unit, and then don't have to both converting or non of that crap. Just store materials once. If lambdas change size/samples, then you do need to trigger lambdas changed event. HOWEVER, when units change, this should not trigger a lambdas changed event. Instead, plots should looks for xunit everytime they redraw. You can just call redraw on xunit changed or lambdas changed and it will take care of it. Don't have to bother with reversing material_files in update_data().
In main parms, a mapping to nanometers should be stored at all times and listened to. Therefore, changes to xstart, xend would trigger redraws of this, but beneath the surface, all being stored as nm downstream.
Benefits
- Lambdas changing when xunits change are superfulous and slow down updates to nanomaterials because `update_cross()` updates like 80 times, once for each new material.
Results of R calculations seem wrong, or at least unstable, in these new units and I don't know where this is coming from.
Simplifies ABCMaterial.
"Reversing" a material can be done at draw time, and encapsulated in ABCView.
Implicitly using distance in nanometers a lot of places (fiber, nanoparticles etc...) and that's probably the reason these calculations are wrong. Therefore, I need to use canonical nm!
All materials should map to Nanometers as the canonical unit, and then don't have to both converting or non of that crap. Just store materials once. If lambdas change size/samples, then you do need to trigger lambdas changed event. HOWEVER, when units change, this should not trigger a lambdas changed event. Instead, plots should looks for xunit everytime they redraw. You can just call redraw on xunit changed or lambdas changed and it will take care of it. Don't have to bother with reversing material_files in update_data().
In main parms, a mapping to nanometers should be stored at all times and listened to. Therefore, changes to xstart, xend would trigger redraws of this, but beneath the surface, all being stored as nm downstream.
Benefits