Report template
A report template is used to generate reports from SBench6 projects. It is a XML structured file, which means that all entries are enclosed in tags, e.g. <display>DisplayName</display>.
Available elements:
- report
- paper
- size: paper size like A4, Letter, B3
- orientation: portrait or landscape
- margin
Defines the margins on each page.
- Available attributes:
- mirror: [optional] true if right and left margin should be mirrored on odd and even pages, default: false
- top: area at the top of each page that will not be used for printing
- bottom: area at the bottom of each page that will not be used for printing
- left: area at the left of each page that will not be used for printing
- right: area at the right of each page that will not be used for printing
- header
An area that will be printed at the top of each page.
- Available attributes:
- height: [mandatory] height of the header area
- mirror: [optional] true if right and left margin should be mirrored on odd and even pages, default: false
- text: a text block
- image: an image from a file
- hr: a horizontal line
- vr: a vertical line
- footer
An area that will be printed at the bottom of each page.
- Available attributes:
- height: [mandatory] height of the header area
- mirror: [optional] true if right and left margin should be mirrored on odd and even pages, default: false
- text: a text block
- image: an image from a file
- hr: a horizontal line
- vr: a vertical line
- page
Defines the content of one page. May appear multiple times.
Common elements for <header>, <footer> and <page>:
- text
Defines a text block. The text can be HTML formatted and may contain macros to access channel settings, display cursors and calculation results.
- Available attributes:
- pos: [mandatory] position of the upper left corner of the text rectangle.
- size: [optional] defines the rectangle into which the text will be printed. If not given, the whole page width is used.
- border: [optional] if not zero a border is drawn around the element.
- rotatecontent: [optional] rotate text inside the given rectangle by 0, 90, 180, 270 degrees. Default: 0
Available macros:
- Channel setup
- Input range: the used input range in mV
- Filter: the used filter
- Offset: the used offset
- Termination: the termination of the channel
- Type: single-ended or differential
- Path: the used path
- Coupling: AC or DC coupling
- Name: the channel's name
- Comment: the comment defined in the channel setup dialog
- Card: the card this channel belongs to
- Length: the length of the channel in samples
- Post: the number of samples after the trigger event
- Samplerate: the samplerate of the channel
Some examples:
AnalogCh#0.Termination will be replaced with the currently used termination of the first analog channel.
DigitalCh#12.Samplerate will be replaced with the samplerate used to acquire the 13th digital channel
To determine the template name of a channel setting right-click the matching cell in the Input Channels dialog for a context menu, then select "Show Report Template Name".
- Display
- CursorA
- x: X position of cursor A
- y: X position of cursor A
- CursorB:
- x: X position of cursor B
- y: X position of cursor B
- CursorDiff:
- x: X of cursor difference
- y: X of cursor difference
- Title: the title of the display
- Name: same as Title
Some examples:
AnalogDisplay#0.CursorA.x will be replaced with the current position of cursor A on the X axis of the first analog display
FFTDisplay#1.CursorDiff.y will be replaced with the difference of both cursors on the Y axis of the second FFT display
To determine the template name of a display right-click the display (e.g. the Analog Display) for a context menu, then select "Show Report Template Name".
To determine the template name of a cursor right-click the Info dialog for a context menu, then select "Show Report Template Name".
- Calculation Results
The available macros depend on the calculation. Each result of a calculation in the Info Dialog is available as a macro.
Available meta-information:
- y: the y position of the result.
- CalcStart: the number of the first sample in the calculation's source channel that is used in the calculation.
- CalcEnd: the number of the last sample in the calculation's source channel that is used in the calculation.
Depending on the calculation some more meta-information is available:
- x: the x position of the result.
Some examples:
AnalogCh#0.SignalInfo#0.Effective will be replaced with the effective value as calculated by the first Signal Info calculation on the first analog channel
FFTCh#0.All_Dynamic_parameters#0.6Harmonic.x will be replaced with the position of the 6th harmonic frequency as calculated by the first Dynamic Parameters calculation on the first FFT channel
To determine the template name of a calculation result right-click the Info dialog for a context menu, then select "Show Report Template Name".
- Info
- Version: the version of SBench6
- DriverLibVersion: the version of the used driver library
- DriverKernelVersion: the version of the used kernel driver
- EngineVersion: the version of the SBench6 engine
- Card: will be replaced with the type and serial number of the card. Use the following sub-elements to get part of the information:
- Type: [optional] will be replaced with the type of the card, e.g. M4i.4451-x8
- SN: [optional] will be replaced with the serial number of the card
- HW: [optional] needs one of the following sub-elements
- Base: will be replaced with the hardware version of the base card
- ModuleA: will be replaced with the hardware version of module A
- ModuleB: will be replaced with the hardware version of module B (if module is mounted)
- Starhub: will be replaced with the hardware version of the starhub (if mounted)
- FW: [optional] needs one of the following sub-elements
- Base: will be replaced with the firmware version of the base card
- ModuleA: will be replaced with the firmware version of module A
- ModuleB: will be replaced with the firmware version of module B (if module is mounted)
- Starhub: will be replaced with the firmware version of the starhub (if mounted)
- Clock: will be replaced with the firmware version of the clock (M2i only)
- Config: will be replaced with the firmware version of the config (M2i/M3i only)
- Power: will be replaced with the firmware version of the power section (M4i only)
- Golden: will be replaced with the firmware version of the golden image (M4i only)
- Current: will be replaced with the firmware version of the currently bootet image (normal or golden) (M4i only)
Some examples:
Info.Card#0.Type will be replaced with the type of the first card like M4i.4451-x8
Info.Card#1 will be replaced with the type and serial number of the second card like M4i.4451-x8 SN12345
Info.Card#0.FW.ModuleA will be replace with the firmware version of module A of the first card
- CurrentPage: the current page number during report creation
- TotalPages: the total number of pages of the complete report
- Time: time of report creation
- Date: date of report creation
- TemplateModificationTime: last time the template was modified
- TemplateModificationDate: last date the template was modified
- display
Not available in <header> and <footer>
- Available attributes:
- pos: [mandatory] position of the upper left corner of the display image.
- size: [optional] defines the rectangle into which the display image will be printed. If not given, the whole page width is used.
- border: [optional] if not zero a border is drawn around the element.
- palette: [optional] index of the display palette.
- blackwhite: [optional] true, if display image should be black and white. Default: false
- cursors: [optional] true, if cursor lines should be painted. Default: true
- comments: [optional] true, if comments should be painter. Default: true
- grid: [optional] true, if grid should be painted. Default: true
- channelnames: [optional] true, if names of channels in display should be painted. Default: false
- cursorvalues: [optional] true, if cursor values should be painted. Default: false
- triggerlevels: [optional] true, if channel trigger levels should be painted. Default: false
- datalinewidth: [optional] line width of signals in pixels. Default: 1
- cursorlinewidth: [optional] line width of cursors in pixels. Default: 1
- gridlinewidth: [optional] line width of grid in pixels. Default: 1
- rotatecontent: [optional] rotate display image inside the given rectangle by 0, 90, 180, 270 degrees. Default: 0
Some examples:
<display pos="20,0" size="120x80" datalinewidth="5">AnalogDisplay#0</display> will print an image of the first Analog Display 20mm from the left and zero mm from the top of the area, with a size of 120mm times 80mm and line width of five pixel for the signal.
- image
- Available attributes:
- pos: [mandatory] position of the upper left corner of the display image.
- size: [optional] defines the rectangle into which the image will be printed. If not given the unscaled image is printed.
- border: [optional] if not zero a border is drawn around the element.
- rotatecontent: [optional] rotate image inside the given rectangle by 0, 90, 180, 270 degrees. Default: 0
Some examples:
<image pos="20,0" size="120x80" >c:/myimage.png</image> will print the image c:\myimage.png 20mm from the left and zero mm from the top of the area, scaled to 120mm times 80mm.
- hr
- Available attributes:
- pos: [mandatory] position of the start point of the line.
- length: [mandatory] length in mm.
- width: [optional] width of the line. Default: 1
- style: [optional] solid, dash, dot. Default: solid
Some examples:
<hr pos="20,0" length="120" style="dash" /> will print a dashed horizontal line from 20mm from the left and zero mm from the top of the area with a length of 120mm.
- vr
- Available attributes:
- pos: [mandatory] position of the start point of the line.
- length: [mandatory] length in mm.
- width: [optional] width of the line. Default: 1
- style: [optional] solid, dash, dot. Default: solid
Some examples:
<vr pos="20,0" length="120" /> will print a solid vertical line from 20mm from the left and zero mm from the top of the area with a length of 120mm.