Setup
Environment
- Effectively, you can only develop MPSGui inside Eclipse on lcls-builder.
- Check out the CVS module physics/mps/mpsgui into your workspace
- From now on, the root of project is referred to as $MPSGUI_ROOT
Dependencies
For library paths, see the scripts $MPSGUI_ROOT/mpsgui or $MPSGUI_ROOT/mpscud
- ezJCA (version R0-0-10)
- javainterfaces (current version)
- MPS Config (current version)
- Oracle JDBC driver
- Sqlite JDBC driver
- SwingUtil (current version)
- jgoodies.jar can be added at runtime for the Matlab look & feel
- xal4lcls
- ext.jar (current version)
- xal.jar (current version)
Test inside Eclipse
- Select $MPSGUI_ROOT/src/edu.stanford.slac.mpsgui/MpsGuiLauncher
- Right-click => select Run As... => Java Application
- If you run the app for the first time, it should fail
- Go to Run in the Window menu
- Select "Open Run Dialog..."
- Select "MpsGuiLauncher" in the window on the left
- Select the "Arguments" tab
- Enter the following arguments:
in the "Program arguments" area.
jdbc:sqlite:/usr/local/lcls/epics/iocTop/MachineProtection/mpsConfiguration/database/ jdbc:sqlite:/usr/local/lcls/epics/iocTop/MachineProtection/mpsConfiguration/algorithm/ jdbc:oracle:thin:MPS_HISTORY/*current_password*@mccqa.slac.stanford.edu:1521:MCCQA
- Replace current_password with the current password (can be found in the $MPSGUI_ROOT/mpsgui script)
- Press "Run"
Development
Tips
- First, find the field that stores the UI component that prompted your development (change the back-/foreground color, if not sure); then use Eclipse References to find where the field is being used
Overview
Launch scripts
User Interface
- Consists of tabs
Classes and Functions
edu.stanford.slac.mpsgui.MpsCudController
- Creates the summary UI, tries to setup as a CUD
- Initializes the summary "viewer" (controller)
edu.stanford.slac.mpsgui.MpsGuiController
- Creates the full UI
- If successful, initializes "viewers" (controllers) for each tab
edu.stanford.slac.mpsgui.MpsGuiLauncher
- The main class expects the following arguments (in the order):
- Config DB URL prefix
- Logic DB URL prefix
- History JDBC URL (including username and password)
- See $MPSGUI_ROOT/mpsgui for an example
- Loads Config and Logic DB via MPS Config
- Depending on the system property slac.launchAsCud, initializes either MpsCudController or MpsGuiController
edu.stanford.slac.mpsgui.MpsGuiProperties
- Contains constants/properties used by MPSGui
edu.stanford.slac.mpsgui.controller.fault.MPSFaultsViewer
- Controller for the "Faults" tab
- A tree-like browser for faults hierarchies
- Shows the current information about a selected fault
edu.stanford.slac.mpsgui.controller.hist.MPSHistoryViewer
- Controller for the "History" tab
- Shows live history as well as allows interactive search
- If live history panel is empty, please trouble-shoot the MPSHistoryServer
edu.stanford.slac.mpsgui.controller.summary.SummaryViewer
- Controller for the "Summary" tab
- Initialized the logic "viewer" for the integrated logic panel
- If applicable, styles the summary UI as a CUD (larger font etc.)
- Monitors beam rate PVs (both MPS and actual)
- Monitors bypassed faults and end times; warns (using proper colors) when bypasses are about to expire
- Allows user to re-bypass a bypassed macro state
Release with Eclipse
- Update the application version in $MPSGUI_ROOT/src/edu.stanford.slac.mpsgui.MpsGuiProperties
- Add a note in $MPSGUI_ROOT/RELEASE_NOTES
- Increment the tag version accordingly
- Commit to CVS
- Tag with mpsgui-R#-#-#
- Check out the tagged version into production
cd $PHYSICS_TOP/release cvs co -r mpsgui-R#-#-# -d mpsgui-R#-#-# physics/mps/mpsgui
- Select File => New Java project => Create project from existing source
- Select $PHYSICS_TOP/release/mpsgui-R#-#-#
- Name the project mpsgui-R#-#-#
- Press "Finish"
- Right-click on the new project mpsgui-R#-#-# => Export...
- Select Java => JAR file
- Check mpsgui-R#-#-# in "Resources to export"
- Check "Export generated class files and resources"
- As the export destination, type (and/or select)
$PHYSICS_TOP/release/mpsgui-R#-#-#/jar/mpsgui.jar
- Press "Finish"
- Move the symbolic link
cd $PHYSICS_TOP/ rm -rf mpsgui; ln -s release/mpsgui-R#-#-# mpsgui
- Launch from lclshome
- MPS Global => MPS GUI...
- MPS Global => MPS CUD...
Immediate Release
java.lang.NullPointerException
at edu.stanford.slac.mpsgui.controller.ignorelogic.IgnoreLogicViewer.checkCurrentIgnoreLogic(IgnoreLogicViewer.java:80)
at edu.stanford.slac.mpsgui.controller.ignorelogic.IgnoreLogicViewer$1.run(IgnoreLogicViewer.java:44)
at java.lang.Thread.run(Thread.java:595)
- Pick up the new config/logic databases automatically
Test on lcls-dev2
mpsgui \ jdbc:sqlite:/afs/slac.stanford.edu/u/xr/snorum/ioc/mpsConfiguration/database/ \ jdbc:sqlite:/afs/slac.stanford.edu/u/xr/snorum/ioc/mpsConfiguration/algorithm/ \ jdbc:oracle:thin:MPS_HISTORY/Neutrin0!@slac-oracle02.slac.stanford.edu:1521:SLACDEV \ &
- Ignore/unignore truth tables by writing 0 or 1 to YAGS:IN20:211:IN_LMTSW_BYPV
caput YAGS:IN20:211:IN_LMTSW_BYPV 1 to ignore caput YAGS:IN20:211:IN_LMTSW_BYPV 0 to unignore
- Default solution etc. is "--"
New States
- If the truth table's state can't be found in the Logic DB, make an alert panel that shows the truth table's name, the raw state value from the IOC:BSY0:MP01:TTBLST array, and a message saying "Send the above information to the controls group."
- Documentation
- Highlight new truth table state when selected
Stuff
- Convert all JTables to MpsGuiTables
- MpsLe to remember previous directory
- Make A, B, and potentially C flexible