# Presentation: 450412

## Java Application Overview

- J. Patrick
- December 10, 2003

## Applications

- Provide primary user interface to the system
- Machine independent / Machine dependent applications
- Extensive libraries behind them
- If some functionality has usage across machines, we attempt to make the same or similar applications for each
- Parameter page/Fast time plots
- Data logger viewer
- Low level hardware configuration, diagnostics (ramp cards, timer cards etc.)
- Multiwire displays
- ....
- At some point things become machine specific
- Probably sometimes unnecessarily...

## What Currently Exists

- Application Index
- Catalog applications, provide convenient startup
- Application Framework
- Basis of applications
- Basic functionality, common look and feel
- Code Management
- Code development environment
- Basic libraries
- Data acquisition, database, plotting, etc.
- Some general (D page type) applications
- A small number of machine applications

## Application Index

- Catalog of applications
- Web page (http://www-bd.fnal.gov/appix)
- Standalone program (like Windows Explorer)
- Click to start programs
- Can start both normal and browser based applications
- Application Startup
- Uses Java WebStart
- Only Java need be installed on your PC
- All required code is automatically copied to your PC and cached
- Program starts and runs on your PC

## Application Home Page

- http://www-bd.fnal.gov/appix

## Application Index

## Application Framework

- Provides common infrastructure for applications
- Basic window with common basic menu items
- Basic menus and toolbars easily extensible
- Capture, mail, etc. utilities like VAX program tools
- Message capture, application monitoring
- Post images directly to e-log!

## Graphical User Interface[JControlsFrame]

## Current Library Infrastructure

- Access to entire control system (readings/settings/snap/ftp)
- DaqJob API
- DaqJob (what, from, to, when, who, control)
- Still based on same “power supply” device paradigm
- Required for compatibility with old system
- The infrastructure allows manipulating structured sets of devices
- By writing custom “items”
- Still don’t apply structure to Acnet array data
- Theoretically possible, but would require front-end/Java cooperation
- Part of “Library support” encapsulated in “**what**” (item) subclasses
- Access via same API to
- Data logger data
- SDA data
- Save/Restore data
- Models

## Current Library Infrastructure

- Core Java libraries provide
- Graphical user interface
- Networking, threads, I/O
- Database access via Java standard (JDBC)
- Plotting
- Both internally written(fast) package, and JFreeChart (prettier/more options)
- New package under development
- Currently no general 3-D plot support
- Synoptic display infrastructure/drag&drop builder (Lexdraw successor)
- Finite State Machine infrastructure including graphical builder
- NOT a straight port of CLIB/User Libraries
- There are certainly missing pieces in the above

## Synoptic Display

## Missing Infrastructure

- Functionality of most machine specific VAX User Libraries
- Though functional equivalents exist in some cases
- Numerical methods/linear algebra use not extensive so far
- Usage in autotune, some other places
- Some fitting, FFT code in gov tree
- Third party packages exist that should satisfy requirements
- No Numerical Recipe Java port exists
- Full support for GPIB/specific scope models
- Lowest level infrastructure exists, needs to be built up
- We will do this as people ask for it.
- We will provide any infrastructure needed
- Ask us please before you write (or download) such packages

## CLIB Functionality Status

| CONSOLE_INFO | Get information about console, perhaps remote, and tasks | Some in App Framework |
| --- | --- | --- |
| DATA_LOGGER | Access data logger data | DaqJob/OSDA APIs
Could be more convenient |
| DATA_MANIPULATION | Manipulate strings, various format conversions | Java libraries, some could be written |
| MISCELLANEOUS | Acl, database convenience queries | Database access possible
Not very convenient
Should be a priority for us |
| DIO_XXX | Access control system data | DaqJob API
Could be more convenient for simple operations |
| ERROR_LOGGING | Error display, logging | Java logging API, App Framework |
| EVENTS_AND_CLOCKS | Check or control clock events etc. | Functionality possible, could be more convenient |

| CLIB LIBRARY | Functionality | Java functionality |
| --- | --- | --- |

## CLIB Functionality Status cont.

| FILEIO | Shared file I/O (FSHARE) | Database usage preferred.
Shared file access possible via servlet.
Convenient database frameworks exist, we don’t currently support however. |
| --- | --- | --- |
| GRAPHICS_SCREENS/WINDOWS
TV_WINDOWS | Graphics screens/windows | Java Libraries |
| INTER_NODE_COMMUNICATION | Low level Acnet calls | Exists, general users shouldn’t use |
| INTRANODE_COMMUNICATION | VMS mailbox access | Use TCP/IP |
| NETWORK_NAME_TRANSLATION | Acnet node information | Possible, could be more convenient |
| ONLINE_HELP | Help | Java Help library, App Framework support |
| OTHER_DATA_ACQUISITION | Appds, db_, locks, other stuff | Appds dropped, db_ exists, locks exist, other stuff needed |

## CLIB Functionality Status, cont.

| PROGRAM_CONTROL | Change program, find_sa, key press, locks | Change program/SA support does not exist.Java libraries for keysApp Framework has locks |
| --- | --- | --- |
| PROGRAM_UTILITIES | Program utilities menu
File view, FTP/Snap, xv capture, user validation | App Framework has panel capture/export, user authentication |
| SAVE_RESTORE_FILES | Access save/restore files | DaqJob API |
| SCRIPT | Record/playback scripts | Hooks exist in Java to do this, third party implementations exist but not yet included. |
| TIME | Time in different formats including the notorious clink format | Java libraries.
Clink stuff should be centralized |
|  |  |  |
|  |  |  |

## User Library Status

| CBSAUX | Support for many CAMAC cards, low level GPIB, tlg info, BLMs, BPMs | Only very minimal low level support for timer, 465 cards, GPIB, Tev BPM data |
| --- | --- | --- |
| CRE | Collider ramp generator | No |
| GFSDALIB | Finite State Machine | Java FSM exists, used for some things |
| LEXTOOLS | Graphics/synoptic display  | Java libraries/Java synoptic display exists |
| LSSOL | Constrained least squares fit | We certainly could find something if needed |
| MULTIWIRE | Multiwire support | No |
| NET | API for Acnet USM messages, ethernet multicasts | Done in Java by DxE, but not conveniently encapsulated. |

## User Library Status cont.

| OAC | Open Access Client | Java framework exists |
| --- | --- | --- |
| PASA | Misc: param page, states, tcp wrapper | Most functionality exists, could be more convenient |
| PBAR_XXX | Higher level libraries written by pbar dept. |  |
| PHYSLIB | Machine calculations, fitting, Numerical Recipes | Some machine calcs in osda. Some numerical methods. No Numerical Recipes in Java. But numerical libraries do exist. |
| SCOPES | Support for specific scope models | Low level GPIB support, plus one scope |
| SEQUENCER | Sequencer access | No |
| THREADED | Thread support | Java libraries |

## General Applications

- A modest number exist:
- Notify!
- SDA tools
- D44
- D80
- Parameter Page

## Parameter Page

## Device Database (D80)

## Data Logger Plotter (D44)

## Pbar Vacuum

## Code Overview

- Single rooted tree – the “gov tree”
- gov/fnal/controls/applicationsgov/fnal/controls/toolsgov/fnal/controls/daq...
- Following standard Java package naming conventions
- ~3000 classes, ~500K non-comment lines of code
- ~70 third party jar files
- Currently released as a whole package
- Done <once/day> as requested
- Not much of a problem so far, but we realize this won’t scale to many developers and many applications
- Z page equivalent now available
- Personal test versions can be made generally accessible

## Code Management/Development

- Code kept in CVS repository
- nova.fnal.gov
- Accessible over network for development on local PCs
- Write permissions applied to subdirectories
- Code and history is viewable on the web via cvsweb
- GUI (we use jCVS) and command line interfaces
- Global gov tree builds use “ant”
- Developers cvs tag new versions to go into build as “Ready4Alpha”
- Test builds each evening to catch problems early
- Not an optimal method for individual developers
- For individual development, people set up individual IDE and/or command line configuration
- Not as convenient as MECCA in various ways
- Various newer non-IDE environments available, haven’t yet decided whether to support any

## CVS Web

## Integrated Developer Environments

- Integrated editor, compiler, code browser, debugger
- CVS integration
- Newer ones compile your code as you type it in!
- Potentially more efficient development
- But requires investment to master
- Several choices of free and/or inexpensive products
- Controls developers use JBuilder/Netbeans/SlickEdit/Eclipse/command line

## Integrated Developer Environments

## Machine Applications

- Accelerator applications can map well onto object oriented code
- The opportunity exists to much better organize applications, though it would require significant cooperation among different departments.
- For example, it might be possible to have more common programs for transfer line tune-up etc.
- Store machine configuration in database
- Same algorithm to the extent possible
- Autotune attempts to do this

## Autotune

- Automatically tune transport lines for MiniBooNE
- Will also use for
- 120 GeV FT
- Electron Cooling
- Same code base for all 3 versions
- Read positions from BPMs
- Adjust magnets appropriately

## Slide 31

## COSY Application(ANKA – Karlsruhe)

## COSY application

## SNS Application – Uses COSY base code

## Slide 35

## Summary

- Basic infrastructure exists
- Application Framework
- Application Index
- Code management
- Basic library functionality
- Some general applications exist
- A small number of machine applications exist
- There is a long way to go...
- There is an opportunity to better organize applications
- Will be hard to complete if this isn’t done.