| |
- epicsLogger
class epicsLogger |
|
Logs EPICS process variables to a GUI window and to a disk file.
epicsLogger was primarily written to be an interactive application.
However, it creates a Python class with the following public methods, so it
can be controlled from other applications or from the Python command line.
Restrictions:
Does not gracefully handle the case when PVs cannot be
accessed, such as when a crate is rebooted.
Example:
from epicsLogger import *
t = epicsLogger(input='xrf_pvs.inp', output='xrf_pvs.log', time=2., start=1)
t.menu_time(10.)
t.menu_output('another_file.out') |
|
Methods defined here:
- __init__(self, input=None, output=None, time=10.0, xsize=700, ysize=300, max_lines=1000, start=0, label_font=('courier', 9, 'bold'), output_font=('courier', 9), help_font=('courier', 10))
- Keywords:
input:
The name of an input file containing the list of EPICS process
variables (PV) to be logged. The format of this file is one line per
PV. Each line has the following format. The spaces between the fields
are optional, but the vertical bars (|) are required.
PVName | PVFormat | Description | DescriptionFormat
"PVName" is the name of the EPICS PV.
"PVFormat" is the format with which the PV should be displayed on the
screen and written to the disk file, e.g. "%15.3f" or %15d".
"Description" is a string which describes this PV. It is displayed at
the top of the screen. Any character except "|" can be used in this
field, including white space.
"DescriptionFormat" is the format with which the description string
should be displayed on the screen and in the disk file, e.g. %15.15s.
This format should specify the same field width (e.g. 15 characters) as
the PVformat for this PV to make things line up properly on the screen.
Example input file:
13BMD:DMM1Ch1_calc.VAL | %15.5f | Load, Tons | %15.15s
13BMD:DMM1Ch3_calc.VAL | %15.5f | Ram Ht, mm | %15.15s
13BMD:DMM1Ch5_calc.VAL | %15.3f | Sample Tc, mV | %15.15s
13BMD:DMM2Ch6_calc.VAL | %15.5f | Amps | %15.15s
13BMD:DMM2Ch1_calc.VAL | %15.5f | Volts | %15.15s
13BMD:DMM1Ch8_calc.VAL | %15.5f | Anvil Tc | %15.15s
13BMD:DMM1Ch10_calc.VAL | %15.5f | T (C) | %15.15s
13BMD:DMM2Ch4_calc.VAL | %15.5f | Watts | %15.15s
If "input" is not specified then the input file can be selected
later from the "File" menu in the procedure.
The default is None.
output:
The name of the output file to which the logging data will be written.
If "output" is not specified then the output file can be selected
later from the "File" menu in the procedure.
The output is an ASCII file with 3 types of lines in it. Lines
beginning with "PVS:" list the process variables which follow in the
file. Lines beginning with "DESCRIPTION:" list the descriptions of the
PVs. Finally, lines beginning with "DATA:" list the date and time, and
then the values of all of the PVs. Each value on a line is separated
from the next by a vertical bar ("|").
The following is an example of the first few lines from an output file:
PVS:|Date and time|13BMD:DMM1Ch1_calc.VAL|13BMD:DMM1Ch3_calc.VAL
DESCRIPTION:|Date and time|Load, Tons|Ram Ht, mm
DATA:|10-Jul-1999 09:35:44|91.42843|8.244
DATA:|10-Jul-1999 09:35:45|91.42777|8.244
DATA:|10-Jul-1999 09:35:46|91.42398|8.244
DATA:|10-Jul-1999 09:35:47|91.38756|8.244
These data files can be read into IDL with the function READ_EPICS_LOG.
They can easily be read into spreadsheets such as Excel, by specifying
that the input is "Delimited" with a delimiter character of "|".
The date format in the file is recognized by Excel as a valid date/time
field.
The default is None.
time:
The time interval for logging, in floating point seconds.
The default is 10.0.
lable_font:
A tuple defining the font for the PV and description labels. This
should be a fixed spacing font, i.e. not proportionally spaced, or the
columns won't line up correctly under the labels.
The default is ('courier', '9', 'bold')
output_font:
A tuple defining the font for the output window. This should be a fixed
spacing font, i.e. not proportionally spaced, or the columns won't line
up correctly under the labels.
The default is ('courier', '9')
help_font:
A tuple defining the font for the help window. The help looks better
in a fixed spacing font, i.e. not proportionally spaced.
The default is ('courier', '10')
xsize:
The width of the text output window in pixels. The window can be
resized with the mouse when the program is running.
The default is 700.
ysize:
The height of the text output window in pixels. The window can be
resized with the mouse when the program is running.
The default is 300.
max_lines:
The maximum number of lines which the text window will retain for
vertical scrolling.
The default is 1000.
start:
Set this flag to 1 start logging immediately when the procedure begins.
By default the user must press the "Start" button to begin logging.
The default is start=0.
- about(self)
- Opens a display window with information about the application.
- buildDisplay(self)
- Private method
- help(self)
- Opens a display window with help on the application.
- menu_exit(self)
- Kills the application.
- menu_input(self, file=None)
- Reads a new input file.
Keywords:
file:
The name of the new input file. If the file is not specified then
this function opens a file chooser window to select one.
- menu_output(self, file=None)
- Opens a new output file.
Keywords:
file:
The name of the new output file. If the file is not specified then
this function opens a file chooser window to select one.
- menu_start(self)
- Starts logging.
- menu_stop(self)
- Stops logging.
- menu_time(self, time=None)
- Changes the time interval for logging.
- timer(self)
- Private method
- write_output_headers(self)
- Private method
Data and non-method functions defined here:
- __doc__ = " \n Logs EPICS process variables to a GUI windo...10.)\n t.menu_output('another_file.out')\n\n "
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
- __module__ = 'epicsLogger'
- str(object) -> string
Return a nice string representation of the object.
If the argument is a string, the return value is the same object.
| |