F009 Relations and labels

Relations and labels allow you to highlight relations between trace signals or add additional information to samples. Below example defines a  set of event signals using enumeration values.
If you attach an associations or labels, they are bound to the previously written sample (they don't have own domain positions). An association requires:

  • a target definition (e.g. \Enums\enum1)
  • a style definition (text/color/lineStyle/arrayStyle)
  • a domain delta (relative position at the target signal)

A label just requires:

  • a style definition (text/color/symbol)

Steps to create labels and relations

To create a label or relation, you need to:

  • Prepare enumeration definitions for style, target and domain base (optional).
  • Write a sample value at a given domain position  (e.g write value 'X' at 100ns).
  • Use flxriteRelation/writeRelation or flxWriteLabel/writeLabel to add a relation or label at the sample position. Relations and labels are always bound to a sample and can not exist without.

The textual representation of the enumeration values for style, target and domain baseis added by using the flxWriteEnumDef/writeEnumDef methods.

  • the trace object (c-language only),
  • itemId for the signal,
  • the enumeration scope, here ENUM_RELATION_TARGET, ENUM_RELATION_STYLE or ENUM_LABEL_STYLE.
  • the text representation,
  • and the enumeration value

 

ENUM_RELATION_TARGET = 1;

Use this enumeration scope for relation target. The target is specified by the cell path of the signal e.g. "\scope\signal1"

 

ENUM_RELATION_STYLE = 2;

t.b.d

ENUM_LABEL_STYLE = 3;

t.b.d.

Attaching relations and labels

The flxWriteRelation/writeRelation methods shall be used after writing a sample flxWriteXXXAt/writeXXXAt.

  • the trace object (c-language only),
  • itemId of the signal,
  • type of the relation,
  • the target enumneration value
  • the style value,
  • the target position ldeltaOrPosition as an absolute or relative value,
  • the targetBase.

The type is one of:

  • AT_ASSOC_DELTA = 0;
  • AT_ASSOC_DELTA_REV = 1;
  • AT_ASSOC_POS = 2;
  • AT_ASSOC_POS_REV = 3;

The target position can be defined either absolute (AT_ASSOC_POS,AT_ASSOC_POS_REV) or relative (AT_ASSOC_DELTA, AT_ASSOC_DELTA_REV). You have the option to define a relation from source to target (AT_ASSOC_DELTA, AT_ASSOC_POS), the reverse way (AT_ASSOC_DELTA_REV, AT_ASSOC_POS_REV) or both.

Also he flxWriteLabel/writeLabel methods shall be used after writing a sample.

  • the trace object (c-language only),
  • itemId of the signal,
  • and the style value.
  • Java

           // add event signals
            trace.addScope( 1, 0, "Enums", "Scope Description");
            trace.addSignal( 2, 1, "enum0", null, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal( 3, 1, "enum1", null, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal( 4, 1, "enum2", null, Flx.TYPE_EVENT, "gantt<>");
            
            // open
        
            // write enums for signal 2,3,4 (events)
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 0xfff1);
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2);
        
            // write relation and label related enums for signal 2,4 (events)
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2);
            trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1);
            
            ...
            
            // write at n * 10ns
            trace.writeEventAt(2, 0, current, false, 0xfff1);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0);
            trace.writeEventAt(3, 0, 0, true, 0);
            trace.writeEventAt(4, 0, 0, true, 0);
            trace.writeLabel(4, 1);
        
            // write at +2ns
            trace.writeEventAt(3, 0, 2, true, 1);
        
            // write at +1ns
            trace.writeEventAt(4, 0, 1, true, 1);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 1);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0);
            trace.writeEventAt(3, 0, 0, true, 2);
            trace.writeEventAt(4, 0, 0, true, 2);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 2);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 0);    
    
    
  • C/C++

    		// add event signals
    		flxAddScope(trace, 1, 0, "Enums", "Scope Description");
    		flxAddSignal(trace, 2, 1, "enum0", 0, FLX_TYPE_EVENT, "gantt<>");
    		flxAddSignal(trace, 3, 1, "enum1", 0, FLX_TYPE_EVENT, "gantt<>");
    		flxAddSignal(trace, 4, 1, "enum2", 0, FLX_TYPE_EVENT, "gantt<>");
    
    		// open
    
    		// write enums for signal 2,3,4 (events)
    		flxWriteEnumDef(trace, 2, FLX_ENUM_GLOBAL, "Started", 0xfff1);
    		flxWriteEnumDef(trace, 2, FLX_ENUM_GLOBAL, "Running", 2);
    		flxWriteEnumDef(trace, 3, FLX_ENUM_GLOBAL, "Reading", 1);
    		flxWriteEnumDef(trace, 3, FLX_ENUM_GLOBAL, "Writing", 2);
    		flxWriteEnumDef(trace, 4, FLX_ENUM_GLOBAL, "Fetching", 1);
    		flxWriteEnumDef(trace, 4, FLX_ENUM_GLOBAL, "Pushing", 2);
    
    		// write relation and label related enums for signal 2,4 (events)
    		flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1);
    		flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2);
    		flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_TARGET, "\\Enums\\enum1", 1);
    		flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_TARGET, "\\Enums\\enum2", 2);
    		flxWriteEnumDef(trace, 4, FLX_ENUM_LABEL_STYLE, "My label/444444/star", 1);
    
    		...
    
    		// write at n * 10ns
    		flxWriteEventAt(trace, 2, 0, current, 0, 0xfff1);
    		flxWriteRelation(trace, 2, FLX_AT_ASSOC_DELTA, 1, 1, 2, 0);
    		flxWriteEventAt(trace, 3, 0, 0, 1, 0);
    		flxWriteEventAt(trace, 4, 0, 0, 1, 0);
    		flxWriteLabel(trace, 4, 1);
    
    		// write at +2ns
    		flxWriteEventAt(trace, 3, 0, 2, 1, 1);
    
    		// write at +1ns
    		flxWriteEventAt(trace, 4, 0, 1, 1, 1);
    
    		// write at +2ns
    		flxWriteEventAt(trace, 2, 0, 2, 1, 1);
    		flxWriteRelation(trace, 2, FLX_AT_ASSOC_DELTA, 2, 2, 4, 0);
    		flxWriteEventAt(trace, 3, 0, 0, 1, 2);
    		flxWriteEventAt(trace, 4, 0, 0, 1, 2);
    
    		// write at +2ns
    		flxWriteEventAt(trace, 2, 0, 2, 1, 2);
    
    		// write at +2ns
    		flxWriteEventAt(trace, 2, 0, 2, 1, 0);
            
  • Python

            # add event signals
            trace.addScope( 1, 0, "Enums", "Scope Description");
            trace.addSignal( 2, 1, "enum0", None, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal( 3, 1, "enum1", None, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal( 4, 1, "enum2", None, Flx.TYPE_EVENT, "gantt<>");
            
            # open
    
            # write enums for signal 2,3,4 (events)
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 0xfff1);
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2);
    
            # write relation and label related enums for signal 2,4 (events)
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2);
            trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1);
            
            ...
    
            # write at n * 10ns
            trace.writeEventAt(2, 0, current, False, 0xfff1);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0);
            trace.writeEventAt(3, 0, 0, True, 0);
            trace.writeEventAt(4, 0, 0, True, 0);
            trace.writeLabel(4, 1);
    
            # write at +2ns
            trace.writeEventAt(3, 0, 2, True, 1);
    
            # write at +1ns
            trace.writeEventAt(4, 0, 1, True, 1);
    
            # write at +2ns
            trace.writeEventAt(2, 0, 2, True, 1);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0);
            trace.writeEventAt(3, 0, 0, True, 2);
            trace.writeEventAt(4, 0, 0, True, 2);
    
            # write at +2ns
            trace.writeEventAt(2, 0, 2, True, 2);
    
            # write at +2ns
            trace.writeEventAt(2, 0, 2, True, 0);    
  • TypeScript

            // add event signals
            trace.addScope(1, 0, "Enums", "Scope Description");
            trace.addSignal(2, 1, "enum0", null, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal(3, 1, "enum1", null, Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal(4, 1, "enum2", null, Flx.TYPE_EVENT, "gantt<>");
            
            // open
        
            // write enums for signal 2,3,4 (events)
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 65521);
            trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1);
            trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1);
            trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2);
            
            // write relation and label related enums for signal 2,4 (events)       
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1);
            trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2);
            trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1);
            
            ...
            
            // write at n * 10ns
            trace.writeEventAt(2, 0, current, false, 65521);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0);
            trace.writeEventAt(3, 0, 0, true, 0);
            trace.writeEventAt(4, 0, 0, true, 0);
            trace.writeLabel(4, 1);
       
            // write at +2ns
            trace.writeEventAt(3, 0, 2, true, 1);
        
            // write at +1ns
            trace.writeEventAt(4, 0, 1, true, 1);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 1);
            trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0);
            trace.writeEventAt(3, 0, 0, true, 2);
            trace.writeEventAt(4, 0, 0, true, 2);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 2);
        
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 0);    
  • JavaScript

            // add event signals
            trace.addScope(1, 0, "Enums", "Scope Description");
            trace.addSignal(2, 1, "enum0", null, Flx_1.Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal(3, 1, "enum1", null, Flx_1.Flx.TYPE_EVENT, "gantt<>");
            trace.addSignal(4, 1, "enum2", null, Flx_1.Flx.TYPE_EVENT, "gantt<>");
            
            // open
        
            // write enums for signal 2,3,4 (events)
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_GLOBAL, "Started", 65521);
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_GLOBAL, "Running", 2);
            trace.writeEnumDef(3, Flx_1.Flx.ENUM_GLOBAL, "Reading", 1);
            trace.writeEnumDef(3, Flx_1.Flx.ENUM_GLOBAL, "Writing", 2);
            trace.writeEnumDef(4, Flx_1.Flx.ENUM_GLOBAL, "Fetching", 1);
            trace.writeEnumDef(4, Flx_1.Flx.ENUM_GLOBAL, "Pushing", 2);
            
            // write relation and label related enums for signal 2,4 (events) 
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1);
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2);
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1);
            trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2);
            trace.writeEnumDef(4, Flx_1.Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1);
            
            ...
            
            // write at n * 10ns
            trace.writeEventAt(2, 0, current, false, 65521);
            trace.writeRelation(2, Flx_1.Flx.AT_ASSOC_DELTA, 1, 1, 2, 0);
            trace.writeEventAt(3, 0, 0, true, 0);
            trace.writeEventAt(4, 0, 0, true, 0);
            trace.writeLabel(4, 1);
            
            // write at +2ns
            trace.writeEventAt(3, 0, 2, true, 1);
            
            // write at +1ns
            trace.writeEventAt(4, 0, 1, true, 1);
            
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 1);
            trace.writeRelation(2, Flx_1.Flx.AT_ASSOC_DELTA, 2, 2, 4, 0);
            trace.writeEventAt(3, 0, 0, true, 2);
            trace.writeEventAt(4, 0, 0, true, 2);
            
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 2);
            
            // write at +2ns
            trace.writeEventAt(2, 0, 2, true, 0);    
toem

technical software and tooling

Company

Contact Us

This email address is being protected from spambots. You need JavaScript enabled to view it.