Here is an explanation and an example of
some Cicode that should make it easier to understand and use. It is
important to note that only one value for each field can be
selected at one time - for example, you cannot have "Ratio" and
"Step" at the same time because they are both "Stretch" methods.
You can combine "Mean" and "Raw Samples" because "Mean" is a
"Compress" method and "Raw Samples" is a "Stretch" method.
It will be easier to write Cicode to use these values by
defining meaningful names for the various bits and using the BITOR
operator, as follows:
Firstly, copy the following code to the top of your Cicode
file...............:
INT |
DISPLAYMODE_INVALID_GATED_ZERO |
= 0; |
INT |
DISPLAYMODE_INVALID_GATED_AS_IS |
= 1; |
INT |
DISPLAYMODE_NORMAL_DATA |
= 0; |
INT |
DISPLAYMODE_REVERSE_DATA |
= 2; |
INT |
DISPLAYMODE_CONDENSE_MEAN |
= 0; |
INT |
DISPLAYMODE_CONDENSE_MINIMUM |
= 4; |
INT |
DISPLAYMODE_CONDENSE_MAXIMUM |
= 8; |
INT |
DISPLAYMODE_STRETCH_STEP |
= 0; |
INT |
DISPLAYMODE_STRETCH_RATIO |
= 128; |
INT |
DISPLAYMODE_STRETCH_RAWSAMPLES |
= 256; |
INT |
DISPLAYMODE_GAPFILL_CONSTANT |
= 4096; |
Then use the BITOR operator to combine these values to get the
mode you require. So if you are calling TrnGetTable() with data
reversed, invalid and gated values set to zero, condense mode mean
and stretch mode of raw samples, use the following command to set
up your DisplayMode argument.
INT |
displayMode = |
|
|
DISPLAYMODE_INVALID_GATED_ZERO |
BITOR |
|
DISPLAYMODE_REVERSE_DATA |
BITOR |
|
DISPLAYMODE_CONDENSE_MEAN |
BITOR |
|
DISPLAYMODE_STRETCH_RAWSAMPLES; |
|
Then use this as the argument to TrnGetTable() or
TrnSetDisplayMode().
As DISPLAYMODE_INVALID_GATED_ZERO and DISPLAYMODE_CONDENSE_MEAN
are both equal to zero, the above statement is equivalent to
INT |
displayMode = |
|
|
DISPLAYMODE_REVERSE_DATA |
BITOR |
|
DISPLAYMODE_STRETCH_RAWSAMPLES; |
|
You would need to decide which formulation is more explicit in
your particular situation.
If you wish to fill gaps in the returned data, you can do it by
multiplying DISPLAYMODE_GAPFILL_CONSTANT by the number of samples
to gapfill, and using the BITOR operator.
INT |
gapFillValue =
DISPLAYMODE_GAPFILL_CONSTANT |
* number of samples to gap-fill; |
So to fill gaps of up to 5 samples long, and have the rest of
the display mode as above, use the following:
INT |
gapFillValue =
DISPLAYMODE_GAPFILL_CONSTANT |
* 5; |
INT |
displayMode = |
|
|
DISPLAYMODE_REVERSE_DATA |
BITOR |
|
DISPLAYMODE_STRETCH_RAWSAMPLES |
BITOR |
|
gapFillValue; |
|
|