10 Relations and labels


Relations and labels

Associations 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)
	// 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
	flxOpen(trace, 0, "ns", 0, 0);

	// 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 association and label related enums for signal 2,4 (events)
	flxWriteEnumDef(trace, 2, FLX_ENUM_ASSOC_STYLE, "Trigger/444444/line/no", 1);
	flxWriteEnumDef(trace, 2, FLX_ENUM_ASSOC_STYLE, "Reference/00ff00/cubic/normal", 2);
	flxWriteEnumDef(trace, 2, FLX_ENUM_ASSOC_TARGET, "\\Enums\\enum1", 1);
	flxWriteEnumDef(trace, 2, FLX_ENUM_ASSOC_TARGET, "\\Enums\\enum2", 2);
	flxWriteEnumDef(trace, 4, FLX_ENUM_LABEL_STYLE, "My label/444444/star", 1);
// iterate over n

	// write at n * 100ns
	flxWriteEventAt(trace, 2, 0, n * 100, 0, 0xfff1);
	flxWriteAssociation(trace, 2, 1, 1, 25);
	flxWriteEventAt(trace, 3, 0, 0, 1, 0);
	flxWriteEventAt(trace, 4, 0, 0, 1, 0);
	flxWriteLabel(trace, 4, 1, 5,5);

	// write at +25ns
	flxWriteEventAt(trace, 3, 0, 25, 1, 1);

	// write at +5ns
	flxWriteEventAt(trace, 4, 0, 5, 1, 1);

	// write at +20ns
	flxWriteEventAt(trace, 2, 0, 20, 1, 1);
	flxWriteAssociation(trace, 2, 2, 2, 20);
	flxWriteEventAt(trace, 3, 0, 0, 1, 2);
	flxWriteEventAt(trace, 4, 0, 0, 1, 2);

	// write at +20ns
	flxWriteEventAt(trace, 2, 0, 20, 1, 2);

	// write at +20ns
	flxWriteEventAt(trace, 2, 0, 20, 1, 0);

toem

technical software and tooling

Company

Contact Us

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