-
Notifications
You must be signed in to change notification settings - Fork 32
Improving SRW Sample element UI
Paul Moeller edited this page Jun 5, 2020
·
2 revisions
Below are the code changes for several improvements to the sirepo SRW sample element UI. View the Github Commit.
- Show/Hide the "Background Color" field unless the "Cutoff Background Noise Ratio" is selected (srw.js):
function updateSampleFields(item) {
//...
// hide the sample.backgroundColor field unless sample.cutoffBackgroundNoise has a non-zero value
panelState.showField('sample', 'backgroundColor', item.cutoffBackgroundNoise);
}
// call the updateSampleFields() method anytime one of the sample fields below are updated
beamlineService.watchBeamlineField(
$scope, 'sample',
['cropArea', 'tileImage', 'rotateAngle', 'cutoffBackgroundNoise'],
updateSampleFields);
- Add range validation to the "Cutoff Background Noise Ratio" field, valid values are between 0 and 1 (srw-schema.js):
// field: [label, type, default-value, help-text, min value, max value]
"cutoffBackgroundNoise": ["Cutoff Background Noise Ratio", "Float", 0.5, "The ratio for cutoff the background noise (between 0 and 1)", 0, 1],
- Add a new field which will display the sample preview image (srw.js):
// add a custom editor for the OutputImageFormat type (which is also an enum in the schema).
// this will call the angularjs directive samplePreview
SIREPO.appFieldEditors += [
// ...
'<div data-ng-switch-when="OutputImageFormat">',
'<div data-sample-preview=""></div>',
'</div>',
Much of the former imageFileField directive is repurposed into the samplePreview directive.
License: http://www.apache.org/licenses/LICENSE-2.0.html
Copyright ©️ 2015–2020 RadiaSoft LLC. All Rights Reserved.
- Activait
- Controls
- elegant
- FLASH
- Genesis
- JSPEC
- JupyterHub
- MAD-X
- OPAL
- Radia
- Shadow
- Synchrotron Radiation Workshop (SRW)
- Warp PBA
- Warp VND
- Zgoubi
- Authentication and Account Creation
- How Your Sirepo Workspace Works
- Navigating the Sirepo Simulations Interface
- How to upload a lattice file
- How to share a Sirepo simulation via URL
- How Example simulations work
- How to report a bug in Sirepo
- Using lattice files in Sirepo
- Resetting an Example Simulation to default
- Backup SRW Sirepo simulations
- SRW Aperture
- SRW Brilliance Report
- SRW Circular Cylinder Mirror
- SRW CRL
- SRW Crystal
- SRW Electron Beam
- SRW Elliptical Cylinder Mirror
- SRW Fiber
- SRW Flux
- SRW Fully Coherent Gaussian Beam
- SRW Import Python or JSON Simulation File
- SRW Initial Wavefront Simulation Grid
- SRW Intensity Report
- SRW Planar Mirror
- SRW Power Density Report
- SRW Propagation Parameters
- SRW Single Electron Spectrum Report
- SRW Spherical Mirror
- SRW Toroid Mirror
- SRW Watchpoint
- SRW Additional Documentation