Report

Top  Previous  Next

Description


The Report command outputs text or numeric data to a Console window, a DataTableWindow, a ReportInterface, or an external file. For more information, see the Generating Output and Interfacing with External Resources Guides.

 

 

Syntax


// Report to a DataTable window

Report myVariable;
Report "myText", myVariable;
Report myVariable1, myVariable2<12,6>, myVariable3<myWidth, myPrecision>;
 

// Report to Console
Report myVariable to myConsoleWindow;
Report mySpacecraft.A to myConsoleWindow;

 

// Report to a ReportInterface
Report myVariable to myReportInterface;
Report myVariable to myReportInterface without headers without linefeed without pad;

Report myMatrix   to myReportInterface;
Report myGroundStation.Elevation(mySpacecraft), mySpacecraft.Range(myGroundStation) to myReportInterface;

Report mySpacecraft.OD.Covariance.Matrix to myReportInterface;

 

// Report to an output file
Report myVariable to "myFile.txt";
Report myVariable to "myFile.txt" without headers without linefeed without pad;

Report myMatrix   to "myFile.txt";
Report mySpacecraft.ShadowTimes to "myFile.txt";

Report mySpacecraft.OD.Covariance.Matrix to "myFile.txt";

 

// Report with escape sequences

Report @"Tab\tseparated\twords\n\n" to Console;

Report @"Backslash: \\ \nPercent sign: \% \nDollar sign: \$" to Console;

 

Where:

 

myWidth and myPrecision evaluate to integers

myFile.txt is any text specifying a valid path and filename, including extension

 

 

Formatting Output


The format of the numeric data being reported can be specified using the Variable.Format, Array.Format, or Matrix.Format methods. The Format method converts a double precision floating point value to a string based on user-provided format specifiers. The format specifiers are standard C/C++ specifiers as used with the sprintf function. The following example reports myVariable in scientific notation with 4 places after the decimal point.

 

myVariable = .000000001543;

Report myVariable.Format("%1.4e");

 

Output formatted Variable in specified format.

Output formatted Variable in specified format.

Array a = {123.123, 234.234, 345.345};

Report a.Format("%1.3f"), a.Format("%1.3e");

 

Output formatted Array in specified format.

Output formatted Array in specified format.

Matrix matrix1 = 

  [1.5004600, 0.5000000, 0.5001000;         

   0.5004600, 1.5000000, 0.5001000;         

   0.5004600, 0.5000000, 1.5001000]; 

   

Report matrix1.Format("%1.3f");

 

Output formatted Matrix in specified format.

Output formatted Matrix in specified format.

 

Details


An unlimited number of properties can be reported.

If no output location is specified, values are reported to a DataTableWindow.

 

"myWidth" and "myPrecision" are optional qualifiers that specify the field width and precision.

o"myWidth" - the total number of characters including spaces and decimal place.

o"myPrecision" - the number of characters to the right of the decimal place.

 

The optional clauses "without headers", "without linefeed", and "without pad" can be used in any combination.

o"without headers" - FreeFlyer automatically adds headers to output files that include the title and units for each element of the report. This option removes the headers.

o"without linefeed" - FreeFlyer automatically adds linefeeds to output files. This option removes the linefeeds.

o"without pad" - FreeFlyer automatically adds pads or spacing to improve the formatting of the output file. This option removes the padding.

 

Note that FreeFlyer automatically adds these formatting options but they can be removed globally using the following script:

 

ReportInterface ri;

 

ri.HeaderType   = 0;        // Removes headers

ri.AutoLinefeed = 0;        // Removes linefeeds

ri.AutoPadding  = 0;        // Removes padding

 

 

Literal strings prefixed with the special character @ will be scanned for environment variables and escape sequences.

oThe supported escape sequences are:

Tab: \t

Carriage return: \r

Line feed: \n

Backslash: \\

Dollar sign: \$

Percent sign: \%

oEnvironment variables can be specified using the $() syntax: $(EnvironmentVariableName)

oSee the Parsing Arbitrary String Data page for more information.

 

A DataTableWindow object can be used in place of a Report command when reporting to the screen.

oDataTableWindows can be updated using the Update command at any point in the Mission Sequence or they can be updated automatically every time a Spacecraft is stepped or maneuvered.

 

 Example Output File


Example Output File

 

 

 Example DataTableWindow


Example DataTableWindow

 

Command Editor


What to Report

Defines the data to be produced in the report

 

Where to Report

DataTable

File

ConsoleWindow

ReportInterface

 

Without Headers

FreeFlyer automatically adds headers to output files that include the title and units for each element of the report. This option removes the headers.

 

Without Linefeed

FreeFlyer automatically adds linefeeds to output files. This option removes the linefeeds.

 

Without Pad

FreeFlyer automatically adds pads or spacing to improve the formatting of the output file. This option removes the padding.

 

Script

Displays the FreeFlyer Script that is generated by the editor

 

Description

Displays descriptions of the editor and its fields

Description text changes as the mouse pointer moves over the different fields within the editor

 

 

See Also


Update Command

Close Command

ConsoleWindows

ReportInterfaces

DataTableWindows

Generating Output Guide

Interfacing with External Resources Guide - Files page