pdf_report, cyflex_reporting

Background

At times there may be a need to generate a report of information from a set of CyFlex variables on a running CyFlex system. Two programs are available to assist with this, pdf_report and cyflex_reporting. pdf_report will generate a pdf formatted file, cyflex_reporting will generate readable files, for example plain text or HTML.

pdf_report

pdf_report has 3 required command line arguments and two optional ones.

cyflex_reporting

cyflex_reporting has 1 required command line argument and two optional ones.

cyflex_reporting outputs the report file to standard output. Normally this will be redirected to a file.

CyFlex Variables

For both pdf_report and cyflex_reporting an input file needs to specify CyFlex varibles that have values to be substituted into the report. In both cases these are specified in the same way. The general format is:

    $OBJECT_NAME.FUNCTION(ARGUMENTS)

OBJECT_NAME is the name either specified on the command line with the argument -object_name or by accepting the default "facade". FUNCTION and ARGUMENTS are discussed below.

In the following the object_name used will be "facade".

It is possible to parameterize a report somewhat. Both UNITS and FORMAT may be specified with values and then referenced in the functions as illustrated below.

#set ($format = '###.###')
#set ($units = 'psi')
$facade.getNumValUnits("rpm", $units, $format)

Sample of cyflex_reporting

Below is a sample template file for cyflex_reporting which uses a plain text format.

vf.getStringVar("string"): $facade.getStringVar("string")
vf.getNumValUnits("rpm"): $facade.getNumValUnits("rpm")
vf.getLogiVarState("logical"): $facade.getLogiVarState("logical")
vf.getLogiVarState("logical", "true_value", "false_value"): $facade.getLogiVarState("logical", "true_value", "false_value")
vf.getTimeStamp("date", "MM-dd-yyyy"): $facade.getTimeStamp("date", "MM-dd-yyyy")
vf.getTimeStamp("date", DateFormat.SHORT): $facade.getTimeStamp("date", $facade.getShort())
vf.getTimeStamp("date", DateFormat.MEDIUM): $facade.getTimeStamp("date", $facade.getMedium())
vf.getTimeStamp("date", DateFormat.LONG): $facade.getTimeStamp("date", $facade.getLong())
vf.getTimeStamp("date", DateFormat.FULL): $facade.getTimeStamp("date", $facade.getFull())
#set ($format = '###.###')
vf.getNumValUnits(conversion): $facade.getNumValUnits("pressure", "psi", $format)
vf.getNumValUnits(conversion): $facade.getNumVal("pressure", "psi", $format)
vf.getNumValUnits(conversion):
   $facade.getNumLabelValUnits("pressure", "psi", "###.###")

This file could be processed with the command:

   cyflex_reporting -input template.vm > template.out
This uses the default object_name setting of "facade".

Running the above command produced the following output.

vf.getStringVar("string"): This is a very long string value: 0
vf.getNumValUnits("rpm"): 1[IN_HG]
vf.getLogiVarState("logical"): 2
vf.getLogiVarState("logical", "true_value", "false_value"): true_value
vf.getTimeStamp("date", "MM-dd-yyyy"): 12-31-1969
vf.getTimeStamp("date", DateFormat.SHORT): 12/31/69
vf.getTimeStamp("date", DateFormat.MEDIUM): Dec 31, 1969
vf.getTimeStamp("date", DateFormat.LONG): December 31, 1969
vf.getTimeStamp("date", DateFormat.FULL): Wednesday, December 31, 1969
vf.getNumValUnits(conversion): 1.959[psi]
vf.getNumValUnits(conversion): 1.959
vf.getNumValUnits(conversion):
   pressure: 1.959[psi]