ID 2:  Field Formats

Top  Previous  Next

Called multiple times each time a signal is created, enabled or edited.  These describe how to format and display fields.  As you generate fields in PARSE, you tag each field with an index into this list to describe to the application how to display and format the field. You must provide at least one field format description.
The general format is:       Name,Background Color, Font Color, Display Format as described below:

Name: 

Any text that describes this format.  This shows up in the TABLE views (when field names are enabled) and in the search dialogs. Names should be unique.

Background Color: 

Color used to fill the field background in the waveform view and the table cells.  If left blank, the default signal background color is used. You can use one of the predefined colors listed below or specify a standard RGB triplet (808080 = middle gray).

Font Color:

Color used for the field text.   If left blank, the default signal font color is used. You can use one of the predefined colors listed below or specify a standard RGB triplet (0000FF = RED).

Display Format:

Describes what to print in a given field.  Can contain a mixture of text and data slices.  A 'Data Slice' defines a range of bits from the provided data.  The full format looks like:  TEXT {T%H:L} TEXT {T%H:L}....
The text portions can contain any printable character except '{','}' or ','  (we will probably remove the ',' restriction by full release)

'TEXT' is an optional text string.

It can contain any printable character except '{' or '}'

'{T%H:L}' is an optional data slice. Each part is option.

 

'T%'

signifies that this slice selects a string from a lookup table (returned from GetStrList(5,lst)  where 'T' is the table number. If T is omitted, then table 0 is used. If 'T%' is omitted, then this is a DATA slice rather than a lookup slice. The slice defines an int32 rather than a lookup string.

'H:L'

defines a range of bits to extract from the data.  H is the highest bit and L is the lowest bit.  If L is omitted, it defaults to the lowest bit (0).  IF H is omitted, it defaults to the highest bit possible for this slice type (L+31 for data or L+13 for lookups, but limited to 47). 
The largest number that we can display is 32bits long. Any single DATA slice with a range exceeding 32 bits will produce an error.
Lookup table indexes are limited to 14 bits. Any single LOOKUP slice with a range exceeding 14 bits will produce an error.

Some DATA slice examples: 

{3:1}  =  the number defined by bits 3->1
{3:} = {3:0}
{:12} = {43:12}
{:40} = {47:40}    (limited by highest bit available)
{3}  =  {3:0}
{} = {31:0}

Some Lookup table slice examples:

{2%47:40} = the string in lookup table 2 at the offset
                   specified by bits 47->40  (byte 5 of the data)
{%43:40} = {0%43:40}
{1%3} = {1%3:0}
{4%:30} = {4%43:30}
{3%:40} = {3%47:40}    (limited by highest bit available)
{1%3}  =  {1%3:0}
{1%} = {1%13:0}

Pre-defined colors

The following (non case-sensitive) color constants can be used in the Background and Font color parameters:
   'black','brown','red','orange','yellow','green','blue','violet','gray' and 'white'