Case Study: Adding "-> Logbook..." to CSS Data Browser
- Decide on the level of integration
- I decided to use the "very low level" of integration, because this seems to be the easiest way to work with CSS.
- More info: http://css.desy.de/content/e760/e761/index_eng.html
- Check out the CSS source code
- Install Mercurial locally
- Download Mercurial source code from http://mercurial.selenic.com/release/mercurial-1.6.4.tar.gz
- Type "make local" in the top directory
- Install the MercurialEclipse plugin, too, but don't use it as such (need usage tips from Kay & Co.)
- Clone the CSS repository
- Several available: http://sourceforge.net/apps/trac/cs-studio/wiki/SourceRepository
- Use 'read-only' repository => http://cs-studio.hg.sourceforge.net:8000/hgroot/cs-studio/cs-studio (no account/password)
- Increase JVM memory for Eclipse
- Edit eclipse.ini in $ECLIPSE_HOME (1024 MB is what I ended up with)
- Import the necessary CSS plugins as Eclipse projects (by trail & error, need clarification from Kay & Co.)
- The minimum list of plugins to develop with DataBrowser:
- The minimum list of plugins to develop with DataBrowser:
- Install Mercurial locally
- Checkout the HLA source code (from CVS)
- Create the edu.stanford.slac.logbook plugin
- Copy the HLA Save2Logbook source code to edu.stanford.slac.logbook
- Configure the plugin to be used by other plugins (the Eclipse help is good, plus I simply remembered some of it)
- Add to the DataBrowser plugin the dependency on edu.stanford.slac.logbook
- Eclipse bug: If plugins panel is empty, start typing the plugin name
- Implement the new features in DataBrowser and edu.stanford.slac.logbook plugins
- Find the class in the DataBrowser that handles buttons (Plot)
- Create a JFace button; set size, label, and background color; add it to the proper JFace figure
- Add a JFace ActionListener that generates an Eclipse (Graphics) image from XYGraph
- Add a method to edu.stanford.slac.logbook that saves an Eclipse image as a JPEG file and creates the logbook XML files as well as directories
- Call the new edu.stanford.slac.logbook method from the new JFace ActionListener
- Test the save2logbook feature by running DataBrowser as an Eclipse application within Eclipse
- Create a SLAC DataBrowser product configuration (the Eclipse help is no good; I needed to understand the SNS CSS product configuration)
- Select CSS Data Browser as the actual application
- Modify the CSS splash image
- Export the SLAC DataBrowser product to a local directory and distribute it from there
- When launching the SLAC DataBrowser for the first time, configure the EPICS and DataBrowser preferences with correct SLAC settings
Major To-Dos
- Headless build
- "Workspace in use" issues
Resources
How to develop with CSS
- Overview https://ics-web.sns.ornl.gov/css/EPICS2010Intro/EclipseCSSDevIntro1.pdf
- Demos http://css.desy.de/content/e70/e10/index_eng.html
- JavaDoc http://css-javadoc.desy.de/
- Plugins http://css.desy.de/epicsgroup/css/content/e428/e396/e402/e491/CSSPluginOverview.htm
- DAL
- Preferences
- Messages
- Authentication and Authorization http://sourceforge.net/apps/trac/cs-studio/wiki/AuthAndAuth
- Mailing list http://sourceforge.net/mailarchive/forum.php?forum_name=cs-studio-core
- Development environment
- Tools
- Localization editor http://css.desy.de/content/e428/e1446/e1448/index_eng.html
- IDE
- Version Control
- Hg http://sourceforge.net/apps/trac/cs-studio/wiki/SourceRepository
- Eclipse plugin: http://www.javaforge.com/project/HGE
- Commit, then push
- Pull, then update
- API
- Documentation
- Eclipse Architecture
- CSS Architecture
- Tools
- Build and release procedures
- Eclipse-based build http://ics-web.sns.ornl.gov/css/devel.html
- Headless
- Creating a product
- Automated?
- Production environment
How to contribute to CSS
- Level of integration http://css.desy.de/content/e760/e761/index_eng.html
- Standards
- Test-driven (JUnit) http://sourceforge.net/apps/trac/cs-studio/wiki/UnitTests
- Procedure http://css.desy.de/content/e760/e761/index_eng.html
- Select the level of integration for your plugin from the list above
- Use existing interfaces and extension points
- Add new extension points whenever useful
- Use Eclipse contributions to integrate your plugin seamlessly with other plugins
- Use common data types (IData) to exchange data (not only strings) with other plugins
- Localize strings in your code
- Decouple local requirements from CSS implementations. Use interfaces to decouple.
- Test CSS core versions and plugins on several platforms (at least Windows, Linux Mac-OS)
- Code style
Links