Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
  1. #Known Issues
    1. #Bugs
    2. #To-Do
  2. #Documents
  3. #Setup
    1. #Environment
    2. #Dependencies
    3. #Test inside Eclipse
  4. #Development
    1. #Major Recurring Tasks
    2. #Tips
    3. #Overview
    4. #Launch Scripts#Glossary
    5. #Classes and Functions
      1. #User Interface
      2. #Controllers
      3. #Model
      4. #ControlSystem
      5. #Others
  5. #Release with EclipseAnt
  6. #PDUDiag

Known Issues

Bugs

  • The following PVs don't accept Strings (have wrong types?)
    • RATE_DEF:GLB0:%d:INPUTS
    • RATE_DEF:GLB0:%d:LONG_NAME

To-Do

  • Do Implement a Klystron check (see p. 3, point 11 of EVG upgrade requirements.pdf)
  • Provide support for the editable flag on the ModifiersPanel
  • Save descriptions of HW Input Bits
  • Implement the proper release procedure
  • If possible, make the initial saving of the EvgConfig faster on development

Documents

...

  • Effectively, you can only develop EVGui inside Eclipse
  • Check out the CVS module physics/evgui into your workspace
    • From now on, the root of project is referred to as $EVGUI_ROOT
  • If you run Eclipse in the development environment, check out also the following CVS modules:
    • physics/hlaCommon
    • physics/hlaExtension
    • physics/xal4lcls

Dependencies

  • hlaCommon (latest version)
  • hlaExtensions (latest version)
  • xal4lcls (latest version)

Test inside Eclipse

  • Select $EVGUI_ROOT/src/edu.stanford.slac.evgui/EvguiLauncher
  • Right-click => select Run As... => Java Application

Development

Overview

Launch Scripts

mpsgui
  • Located under $MPSGUI_ROOT, must be executable (chmod +x)
  • Sets up the CLASSPATH and the log file
  • Launches MPSGui using Plastic3DLookAndFeel from jgoodies
  • byenti is a legacy system property that tells MPSGui to interpret bypass end times as absolute (or, if false, relative) times
mpscud

Glossary

  • Modifier: a chunk of Rate Bits (has position, length, and value)
    • the least significant bit is at position (furthest on the right)
  • ModifierConfig: encapsulates HW Input Bits, frequency, offset, and position into one structure
  • Mods: 4 integers representing the 128 rate bits
    • Mod1: bits 31-0, Mod2: 63-32, Mod3: 95-64, Mod4: 127-96
  • Pattern: a list of values for Rate Selector Indices (aka RSIs) 1 through 720
    • Each RSI can also be seen as a time unit where 360 time units = 1 sec
  • Rate Bits: 128 bits (from 127 to 0), assigned to each RSI
  • HW Input Bit: essentially, a binary PV whose value may override modifier bits
  • Located under $MPSGUI_ROOT, must be executable (chmod +x)
  • Sets up the CLASSPATH and the log file
  • Launches MPSGui in CUD mode using Plastic3DLookAndFeel from jgoodies
    • Operators and Mike Z know details about the CUD mode
  • byenti is a legacy system property that tells MPSGui to interpret bypass end times as absolute (or, if false, relative) times

Classes and Functions

User Interface

  • The main user interface consists of 5 tabs: Summary, Faults, Logic, Ignore Logic, and History"Define Modifiers", "Define Rate Groups", "Define Input Bits", "Define Beam Rates", and "Define Patterns"
  • Each tab has a corresponding package XYZPanel class under edu.stanford.slac.mpsguievgui.ui
    • Classes in those packages are complex Swing components (mostly, JPanels and JTables)
    • Each XYZPanel
    class under edu.stanford.slac.mpsgui.ui
    • is a subclass of edu.stanford.slac.mpsgui.
    ui
    • util.AbstractPanel
    • (Almost) every widget of the panel is stored in a field in the corresponding XYZPanel class, where XYZ is a descriptive string that explains what the panel shows
    • The fields are public to allow registration of the listeners (however, it doesn't make sense to set them)
edu.stanford.slac.mpsgui.ui.

...

  • The root of all MpsGui XYZPanel classes
  • Defines how widgets are created/added to its subclass
edu.stanford.slac.mpsgui.ui.MacroDetailsPanel
BeamRatesPanel
  • Allows user to add/remove rates of a particular RateGroup; set a short (used by EVG) and a long rate name, as well as HW Input Bits
  • Shows the details of a Macro
  • Part of IngoreLogicPanel and LogicPanel
edu.stanford.slac.mpsgui.ui.

...

EvguiPanel
  • The main panel that is added to the JFrameContain whose child is a JTabbedPane as the immediate childthat contains the 5 tabs
edu.stanford.slac.mpsgui.ui.

...

InputBitNamesSelectionPanel
  • Pops up in a dialog when user edits the input bits in JTable cells
  • The root of all MpsGui XYZTable classes
  • Features a TableSorter (see SwingUtil) and alternating background colors for rows
edu.stanford.slac.mpsgui.ui.

...

InputBitsPanel
  • Allows user to select a cached stateenter names and description for HW Input Bits 0 through 9
edu.stanford.slac.mpsgui.ui.

...

ModifierConfigsPanel
  • Allows user to configure modifier bits for a rate (HW Input Bits, frequency, offset, and value)
    • Offset can be 1 or higher (not 0)
    • Display the resulting Pattern in cells to the right
  • Added dynamically to the #edu
  • Not used anymore
edu.stanford.slac.mpsgui.ui.fault.AbstractFaultPanel
  • The root of all XYZFaultPanel classes
  • Shows detailed information common to all types of faults

...

...

edu.stanford.slac.mpsgui.ui.

...

ModifiersPanel
  • Allows user to configure Modifiers (name, category, position, length, and whether the value should come from MPG)
    • Eventually, the "editable" flag shall prevent actual changes to Modifiers
    Shows information specific to each fault type
edu.stanford.slac.mpsgui.ui.

...

PatternsPanel
  • Allows user to select a rate group, specify which time slots to display, select a rate, and create ModifierConfigsFeatures a tree-like browser for faults and a placeholder for the detailed information
edu.stanford.slac.mpsgui.ui.

...

RateGroupsPanel
  • Allows users to add/remove a RateGroup, edit its name, and specify on which time slots it shall be active
  • Also features a button for uploading the Rate Groups (and patterns) to EVG

Controllers

  • Controllers are located under
  • Contains the text area for HTML that represents the MacroStates (obtainable via MPS Config)

Controllers

  • edu.stanford.slac.

...

  • Not used any moreevgui.controller; the majority of them are Swing TableModels for JTables on corresponding tabs
edu.stanford.slac.

...

evgui.controller.

...

EvguiController
  • Sets up the UI, registers all listeners
  • Loads the RatesConfig from the EvgConfig IOC and Modifiers from PNBN IOC
  • Delegates to EvgModelIO for actual EPICS gets/putsNot used any more
edu.stanford.slac.

...

evgui.controller.

...

InputBitNamesCellEditor
  • A cell editor for HW Input Bits

Model

...

edu.stanford.slac

...

.evgui.model.BeamRate, edu.stanford.slac.evgui.model.InputBit, edu.stanford.slac.evgui.

...

  • Filter applies to fault names only
  • Launches new search on "key typed", tries to cancel the previous search (may break in the future)
model.Modifier, edu.stanford.slac.

...

evgui.

...

  • Controller for the "Ignore Logic" tab
  • Monitors the state of ignoring macros (using MPS Config)
    • Caches previous states
  • Shows detailed information about ignoring and ignored macros
  • To test, ignore/unignore macros by writing 0 or 1 to YAGS:IN20:211:IN_LMTSW_BYPV
    Code Block
    
    caput YAGS:IN20:211:IN_LMTSW_BYPV 1 to ignore
    caput YAGS:IN20:211:IN_LMTSW_BYPV 0 to unignore
    
model.ModifierConfig, edu.stanford.slac.

...

evgui.

...

model.

...

RateGroup
  • Components of the EvgConfig (see also #Overview)
  • Monitors states of all macros
    • Caches previous states
  • Shows detailed information about a selected macro
  • Allows user to bypass a selected macro to a state
edu.stanford.slac.

...

evgui.

...

model.

...

EvgModel
  • Controller Container for the "Summary" tab
  • Initializes 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 to a bypassed macro state

Others

  • all components of the EvgConfig
edu.stanford.slac.evgui.

...

model.

...

  • Creates the summary UI, tries to setup as a CUD
  • Initializes the summary "viewer" (controller)
EvgModelIO
  • Adds a progress layer to gets/puts from EPICS IOCs (see also #ControlSystem)
  • Provides necessary information for #edu

...

...

  • Creates the full UI
  • If successful, initializes "viewers" (controllers) for each tab
edu.stanford.slac.evgui.

...

model.

...

ModifiersCollection
  • A custom collection that implements both getFirst() and get(key)
  • 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.evgui.

...

model.

...

PatternsProcessor
  • A facade for all bit manipulation methods that are used by EVGui

ControlSystem

  • The package
  • Contains constants/properties used by MPSGui, such as:
    • Application name, version number, NULL string, date formats, background color for alternate table rows, etc.
  • edu.stanford.slac.

...

  • evgui.epics contains 3 classes that implement gets/puts to EPICS IOCs that store the EVG (aka PABIG) data, the EvgConfig, and modifiers (PNBN)

Others

...

edu.stanford.slac.

...

evgui.

...

util.

...

EvguiUtil
  • Contains useful utility methods

Release with Ant

Release with Eclipse

...

  • Increment the tag version accordingly

...

Code Block

cd $EVGUI_ROOT
ant
java -jar /afs/slac.stanford.edu/g/lcls/vol8/epics/TestStand/evgui/evgui.jar &
  • You can change the destination of the jar file (and other parameters) in $EVGUI_ROOT/build.xml

PDUDiag

  • Matlab script for viewing data generated by the PDU; located under $TOOLS/matlab/src/pdudiag.m
    • Configured for production; uncomment line 19 to run on development
      Code Block
      
      matlab -nosplash -nodesktop -r pdudiag
      
  • Select location, crate, and channel; press "Collect Data"
  • $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)
    Code Block
    
    $PHYSICS_TOP/release/mpsgui-R#-#-#/jar/mpsgui.jar
    
  • Press "Finish"
  • Move the symbolic link
    Code Block
    
    cd $PHYSICS_TOP/
    rm -rf mpsgui; ln -s release/mpsgui-R#-#-# mpsgui
    
  • Launch from lclshome
  • MPS Global => MPS GUI...
  • MPS Global => MPS CUD...