Setup
...
- SLAColors (latest version)
- SwingUtil (latest version)
- xypot xyplot (latest version)
Test inside Eclipse
- Select $ZPLOT_ROOT/src/edu.stanford.slac.util.zplot.example/SimpleExampleApplication
- Right-click => select Run As... => Java Application
- Add -Dsun.java2d.pmoffscreen=false to VM arguments, if too slow
Development
Overview
...
API
- Best is to look in $ZPLOT_ROOT/src/edu.stanford.slac.util.zplot.example/SimpleExampleApplication for how to use the API
Classes and Functions
Model
edu.stanford.slac.util.zplot.cartoon.model.CartoonDevice
- Has name, z position, and length
- Is associated with a CartoonWidget (see package #edu.stanford.slac.util.zplot.
...
...
...
edu.stanford.slac.util.zplot.cartoon.model.widget.CartoonWidget
- An abstract class that adds the length property to #edu.stanford.slac.util.zplot.model.Widget
edu.stanford.slac.util.zplot.model.Beamline
- Has name, start z position, and end z position
- A list of Beamlines can be drawn as a domain axis
edu.stanford.slac.util.zplot.model.Device
- Has name, z position, y value
- Is associated with an area (String) and a Widget
- Subclasses are AlarmMagnet, Obstruction, and #edu.stanford.slac.util.zplot.cartoon.model.CartoonDevice
edu.stanford.slac.util.zplot.model.Widget
- Has color, shape, and stroke
Controllers
edu.stanford.slac.util.zplot.ZPlotController
- Adds functionality to the right-click menu and the PropertiesDialog
edu.stanford.slac.util.zplot.ZPlotEvent, edu.stanford.slac.util.zplot.ZPlotListener
- Provide support for processing events after a tooltip is shown, or zoom is completed
Panels
...
edu.stanford.slac.util.
...
zplot.
...
ui.
...
AbstractPanel
- Loads all data from Config/Logic DB
- Config DB URL prefix: jdbc:sqlite:/usr/local/lcls/epics/iocTop/MachineProtection/mpsConfiguration/database/
- Logic DB URL prefix: jdbc:sqlite:/usr/local/lcls/epics/iocTop/MachineProtection/mpsConfiguration/algorithm/
- Checks periodically for new versions
- Current Config DB version is stored in IOC:BSY0:MP01:DBVERS
- Current Logic DB version is stored in IOC:BSY0:MP01:ALGRNAME
edu.stanford.slac.mps.jdbc.config.ConfigDB
- Singleton
- Serves as a facade to information about faults
- SQL queries are in the file sqlite.properties in the package edu.stanford.slac.mps.jdbc.config
edu.stanford.slac.mps.jdbc.logic.LogicDB
- Parent of all beamlineZplot panels
edu.stanford.slac.util.zplot.ui.CartoonFilterPanel
- Allows user to select which CartoonDevices to display
- Part of #edu.stanford.slac.util.zplot.ui.DevicesPanel
edu.stanford.slac.util.zplot.ui.DevicePlotsPanel
- Allows user to select which subplots to show
- Part of #edu.stanford.slac.util.zplot.ui.DevicesPanel
edu.stanford.slac.util.zplot.ui.DeviceRangePanel
- Allows user to select the range of devices to plot
- Part of #edu.stanford.slac.util.zplot.ui.DevicesPanel
edu.stanford.slac.util.zplot.ui.DevicesPanel
- Panel for configuring Devices (as well as CartoonDevices)
- Located on the Devices tab of the PropertiesDialog
edu.stanford.slac.util.zplot.ui.PropertiesDialog
- Dialog that pops up when you right-click on the plot and select "Properties..."
XYPlots
edu.stanford.slac.util.zplot.ZPlot
- Main plot for Devices; can include several subplots (e.g. X, Y) as well as a beamline cartoon; can draw device labels and beamlines (on the domain axis)
edu.stanford.slac.util.zplot.cartoon.BeamlineCartoon
- Plot for CartoonDevices (appaers at the bottom of the #edu.stanford.slac.util.zplot.ZPlot)
org.jfree.chart.plot.XYPlot
- Modified JFreeChart XYPlot
- Fixed bugs; needed access to some private methods
Renderers
edu.stanford.slac.util.zplot.ZPlotFeatherRenderer
- Draws Devices as feathers (sticks)
edu.stanford.slac.util.zplot.ZPlotLineAndShapeRenderer
- Draws devices as shapes; optionally connects lines between them
edu.stanford.slac.util.zplot.cartoon.CartoonRenderer
- Draws CartoonDevices as shapes
Other
edu.stanford.slac.util.zplot.DevicesDataset
- Adapts an array of Devices into a JFreeChart-specific dataset class
edu.stanford.slac.util.zplot.MatlabUtil
- Utility methods for access from Matlab
edu.stanford.slac.util.zplot.ZPlotUtil
- Contains useful methods, mostly related to Java2D
edu.stanford.slac.util.zplot.cartoon.CartoonWidgetIcon
- Adopts a CartoonWidget as an instance of Icon (needed to draw icons on Devices tab of the PropertiesDialog)
edu.stanford.slac.util.zplot.model.WidgetsRepository
- A repository of widgets for different types of devices
- Singleton
- Serves as a facade to information about Macros (and states), ignore conditions, current MacroStates
- SQL queries are in the file sqlite.properties in the package edu.stanford.slac.mps.jdbc.logic
Release with Eclipse
- Add a note in $MPSGUI$ZPLOT_ROOT/RELEASE_NOTES
- Increment the tag version accordingly
- Commit to CVS
- Tag with mpsconfigbeamlineZplot-R#-#-#
- Check out the tagged version into production
Code Block cd $PHYSICS_TOP/release cvs co -r mpsconfigbeamlineZplot-R#-#-# -d mpsconfigbeamlineZplot-R#-#-# physics/mps/mpsconfigbeamlineZplot
- Select File => New Java project => Create project from existing source
- Select $PHYSICS_TOP/release/mpsconfigbeamlineZplot-R#-#-#
- Name the project mpsconfigbeamlineZplot-R#-#-#
- Press "Finish"
- Right-click on the new project mpsconfigbeamlineZplot-R#-#-# => Export...
- Select Java => JAR file
- Check mpsconfigbeamlineZplot-R#-#-# in "Resources to export"
- Check "Export generated class files and resources"
- As the export destination, type (and/or select)
Code Block $PHYSICS_TOP/release/mpsconfigbeamlineZplot-R#-#-#/jar/mpsconfigbeamlineZplot.jar
- Press "Finish"
- Move the symbolic link
Launch MPS GUI from lclshomeCode Block cd $PHYSICS_TOP/ rm -rf mpsconfigbeamlineZplot; ln -s release/mpsconfigbeamlineZplot-R#-#-# mpsconfig
- MPS Global => MPS GUI... MPS Global => MPS CUD...
beamlineZplot
|