thomas pelaia ii, ph.d. xal workshop 2012 december 14,...
TRANSCRIPT
![Page 1: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/1.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Thomas Pelaia II, Ph.D.
XAL Workshop 2012
December 14, 2012
![Page 2: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/2.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Migration Overview
• Two Distinct Scenarios–Source Code Porting
• Typically straight forward• Don’t forget Scripts• Mostly fixing compiler warnings• About two days per application
–Legacy Compatibility• Documents• Optics Files• Preferences• Services
![Page 3: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/3.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Source Code Porting
• Compiler Warnings
• Package Names
• Preferences
• API Changes
• Menu Definition Dot Notation
• Special Care for Scripts
![Page 4: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/4.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Compiler Warnings
• Eliminate all warnings with lint for JDK 6 and 7–Fix warnings when possible or suppress–Most Common
• Raw types• Unchecked • Cast• Serialization ID
–Careful to keep code JDK 6 compatible for now• Java 7 adds typing to several swing classes (e.g. JList)
• Time Intensive to Fix Correctly
![Page 5: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/5.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Package Name MappingMost Common
XAL Open XAL
gov.sns.xal xal
gov.sns xal
gov.sns.apps xal.app
gov.sns.xal.model.scenario xal.sim.scenario
![Page 6: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/6.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Class Mapping
XAL Open XAL
gov.sns.tools.apputils.iconlib.IconLib xal.tools.IconLib
gov.sns.ca.BatchGetRequest xal.ca.BatchGetValueRequest
![Page 7: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/7.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
API Changes
• Source Code Porting
• Data Adaptor
• Model Scenario
• Trivial Exercise
![Page 8: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/8.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Data Adaptor
• childAdaptorIterator methods gone
• Replace with associated childAdaptors methods
![Page 9: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/9.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Model Scenario
XAL Open XALfinal EnvTrackerAdapt tracker = new EnvTrackerAdapt( sequence );
final Probe probe = ProbeFactory.getEnvelopeProbe( sequence, tracker );
final EnvelopeTracker tracker = AlgorithmFactory.createEnvelopeTracker( sequence );
final Probe probe = ProbeFactory.getEnvelopeProbe( sequence, tracker );
![Page 10: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/10.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Menu Definition Dot Notation
• Source Code Porting
• XAL has legacy underscore notation but supports newer dot notation
• Most SNS XAL Applications already Ported
• Trivial Exercise
![Page 11: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/11.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Example: Menu Definition Port
XAL Open XAL# customize the menubar for the demo by adding a Special menumenubar = file edit view accelerator knobs window help
# define the Special menu itemsknobs_menu = makehorzbumps makevertbumps - makeproportional
# define the Special menu labelknobs_label = Knobs
# define the Knobs menu item labelsmakehorzbumps_label = Make Horizontal Bumpsmakevertbumps_label = Make Vertical Bumpsmakeproportional_label = Proportional Coefficients
# define the menu item actionsmakehorzbumps_action = make-horizontal-bumpsmakevertbumps_action = make-vertical-bumpsmakeproportional_action = make-proportional-coefficents
# customize the menubar for the demo by adding a Special menuaccelerator.after = knobs
# define the Special menu itemsknobs.menu = makehorzbumps makevertbumps - makeproportional
# define the Special menu labelknobs.label = Knobs
# define the Knobs menu item labelsmakehorzbumps.label = Make Horizontal Bumpsmakevertbumps.label = Make Vertical Bumpsmakeproportional.label = Proportional Coefficients
# define the menu item actionsmakehorzbumps.action = make-horizontal-bumpsmakevertbumps.action = make-vertical-bumpsmakeproportional.action = make-proportional-coefficents
![Page 12: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/12.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Special Care for Scripts
• No compiler warnings
• Find and Replace to address API changes
• Validate scripts on all code paths
![Page 13: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/13.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Legacy Compatibility
• Preferences
• Services Compatibility
• Document Compatibility
• Optics Compatibility
![Page 14: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/14.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Preferences
• Legacy Compatibility
• Based on Package Names
• Time Intensive Change
• Manually Regenerate Preferences
![Page 15: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/15.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Services
• Live Legacy Compatibility
• Communication Protocol–XAL uses XML-RPC–Open XAL uses JSON-RPC
• Service Type–Fully qualified interface–XAL and Open XAL have different package names
• Probably will never Interoperate
![Page 16: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/16.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Document Compatibility
• Legacy Compatibility
• Depends on Optics Compatibility due to accelerator reference–Somewhat alleviated by symbolic links to accelerator
• Must review all applications for custom compatibility
![Page 17: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/17.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Optics Compatibility
• Legacy Compatibility
• Implementation (sns.impl)–Could add a class to class mapping
• Probe–Not really used anyway
• Model Parameters (model.params)–New Tables–Old files will cause incomplete probe and tracker
initialization
• Manually Modify Optics as Needed
![Page 18: Thomas Pelaia II, Ph.D. XAL Workshop 2012 December 14, 2012openxal.github.io/meetings/2012/17_Migration to Open XAL.pdf · XAL Workshop 2012 December 14, 2012. Managed by UT-Battelle](https://reader037.vdocuments.net/reader037/viewer/2022090606/605c278df7e9bf1581021a26/html5/thumbnails/18.jpg)
Managed by UT-Battellefor the Department of Energy
Migration from XAL to Open XAL
Summary
• Porting code is straight forward
• Supporting legacy documents is a challenge
• Legacy services not supported