R037 Diff Production


Outline

Creates a "diff" signal from 2 input signals. The diff signal is identical with the input if both input are equal. Regions with non equal signal data are tagged.

Platforms:
32/64bit 32/64bit 32/64bit
Requirements:
  • None
Known limitations:
  • None
Status:
  • Stable
Input signals:
  • 2 signals of the same type.
Output signal:
  • Signal of the same type as the input. Tags of the input signals are removed, instead regions with different content are tagged.
Parameters:
  • Ignore if 2nd input is shorter : Makes a diff of the common range only.
  • Ignore if 2nd input is longer: Makes a diff of the common range only.


Input Signal Configuration

The production accepts 2 signals of the same type.

Primary Source
The primary source is the first source signal of the production. For productions with multiple inputs it can be left empty, thus the first input is taken from the "Additional" sources.
Additional (Sources)
If more than 1 source signal is required, add them into this table. Instead of using the table you may drag and drop (with a closed dialog) signals onto the plot item.



Output Signal Configuration

The production creates a signal of the same type as the input signals. Tags of the input signals are removed, instead regions with different content are tagged.



Production Configuration

  • Ignore if 2nd input is shorter : Makes a diff of the common range only.
  • Ignore if 2nd input is longer: Makes a diff of the common range only.

Checking the "Ignore if 2nd input is shorter/longer" options, limits diff to common domain ranges.



Signal Handling

No signal handling options available for this production.



Operation

Below you find the operation code for the production.

	// iterate
	while (iter.hasNext()&&!isCanceled()) {
		long current = iter.next();
		if (current >= input[0].getEndUnits() && ignoreMore){
			break;
		}
		if (current >= input[1].getEndUnits() && ignoreLess){
			break;
		}
		CompoundPack packa = input[0].packed();
		CompoundPack packb = input[1].packed();
		if (packa == null && packb == null)
			continue;
		boolean differentValue = (packa == null && packb != null) || (packa != null && packb == null) || !packa.equalValues(packb);
		boolean differentPos = (packa != null && packb != null) && (packa.getUnits() != packb.getUnits());
		if (!different && !differentValue && differentPos) {
			packa.setUnits(current);
			packa.setTagged(true);
			targetWriter.writeSample(packa);
			hasDifference = true;
		} else if (differentValue) {
			if (!different) {
				targetWriter.writeSample(current, (byte) (ISample.DF_NONE | ISample.MASK_FORMAT_0_T));
			}
			different = true;
			hasDifference = true;
		} else {
			packa.setUnits(current);
			packa.setTagged(false);
			targetWriter.writeSample(packa);
			different = false;
		}
	}	 

toem

technical software and tooling

Company

Contact Us

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