Setup
Environment
- Effectively, you can only develop MPS History Server inside Eclipse on lcls-builder.
- Check out the CVS module physics/mps/mpshist into your workspace
- From now on, the root of project is referred to as $MPSHIST_ROOT
Dependencies
- ezJCA (version R0-0-10)
- javainterfaces (current version)
- MPS Config
- xal4lcls
- ext.jar (current version)
- xal.jar (current version)
Test inside Eclipse
- Select $MPSGUI_ROOT/src/edu.stanford.slac.mpshist/MpsHistManager
- 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 "MpsHistManager" in the window on the left
- Select the "Arguments" tab
- Enter the following arguments:
Code Block /usr/local/lcls/epics/iocTop/MachineProtection/mpsConfiguration/database/XYZ/mpsdb.sqlite3 password
- XYZ - the current Config version (caget IOC:BSY0:MP01:DBVERS)
- password - the current password (see also #Launch Script)
in the "Program arguments" area.
- Press "Run"
- Note: to actually receive messages, you have to stop the production server (see #Starting and Stopping)
Development
Overview
Launch Script
- mpshist under $MPSHIST_ROOT
- Gets the current version of the Config DB
- Assembles the path to it
- Sets up the CLASSPATH
- Runs MpsHistManager and tells the process to write all message into a log file
Classes and Functions
edu.stanford.slac.mps.epics.ControlSystem
- Monitors current Macro state numbers from IOC:BSY0:MP01:TTBLST.VALA
- Bypasses faults to a value for a time duration
- Monitors bypassed faults and end times
- Given a fault name, gets current state, type, and timestamp
of the fault - Given a PV, gets beam rate names (MPS and actual)
- Translates between EPICS and Java time
edu.stanford.slac.mps.jdbc.JDBCMonitor
- 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
- 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_ROOT/RELEASE_NOTES
- Increment the tag version accordingly
- Commit to CVS
- Tag with mpsconfig-R#-#-#
- Check out the tagged version into production
Code Block cd $PHYSICS_TOP/release cvs co -r mpsconfig-R#-#-# -d mpsconfig-R#-#-# physics/mps/mpsconfig
- Select File => New Java project => Create project from existing source
- Select $PHYSICS_TOP/release/mpsconfig-R#-#-#
- Name the project mpsconfig-R#-#-#
- Press "Finish"
- Right-click on the new project mpsconfig-R#-#-# => Export...
- Select Java => JAR file
- Check mpsconfig-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/mpsconfig-R#-#-#/jar/mpsconfig.jar
- Press "Finish"
- Move the symbolic link
Code Block cd $PHYSICS_TOP/ rm -rf mpsconfig; ln -s release/mpsconfig-R#-#-# mpsconfig
- Launch MPS GUI from lclshome
- MPS Global => MPS GUI...
- MPS Global => MPS CUD...
MPS History Server (mpshist) is a server application for saving MPS messages to Oracle.
Starting and Stopping
- Only one MPS History Server is active at any time
- To start a new server, you must login as laci on lcls-daemon2
Code Block /etc/rc3.d/S99st.mpshist start
- To stop a production server, type
Code Block /etc/rc3.d/S99st.mpshist stop
#Programmer's Guide
#User's Guide
#References
...